From owner-svn-src-head@freebsd.org Sun Aug 16 01:09:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54BCC9B737E; Sun, 16 Aug 2015 01:09:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 455131740; Sun, 16 Aug 2015 01:09:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7G190Lt066041; Sun, 16 Aug 2015 01:09:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7G190tb066040; Sun, 16 Aug 2015 01:09:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508160109.t7G190tb066040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 16 Aug 2015 01:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286821 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 01:09:00 -0000 Author: jhibbits Date: Sun Aug 16 01:08:59 2015 New Revision: 286821 URL: https://svnweb.freebsd.org/changeset/base/286821 Log: SRR1 and DSISR aren't pointers, print them as integers. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun Aug 16 00:39:44 2015 (r286820) +++ head/sys/powerpc/powerpc/trap.c Sun Aug 16 01:08:59 2015 (r286821) @@ -413,8 +413,8 @@ printtrap(u_int vector, struct trapframe case EXC_DTMISS: printf(" virtual address = 0x%" PRIxPTR "\n", frame->dar); #ifdef AIM - printf(" dsisr = 0x%" PRIxPTR "\n", - frame->cpu.aim.dsisr); + printf(" dsisr = 0x%lx\n", + (u_long)frame->cpu.aim.dsisr); #endif break; case EXC_ISE: @@ -438,7 +438,7 @@ printtrap(u_int vector, struct trapframe frame->cpu.booke.esr); #endif printf(" srr0 = 0x%" PRIxPTR "\n", frame->srr0); - printf(" srr1 = 0x%" PRIxPTR "\n", frame->srr1); + printf(" srr1 = 0x%lx\n", (u_long)frame->srr1); printf(" lr = 0x%" PRIxPTR "\n", frame->lr); printf(" curthread = %p\n", curthread); if (curthread != NULL) From owner-svn-src-head@freebsd.org Sun Aug 16 08:17:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8F0D9BAEC4; Sun, 16 Aug 2015 08:17:01 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8108B1A77; Sun, 16 Aug 2015 08:17:01 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wijp15 with SMTP id p15so51650269wij.0; Sun, 16 Aug 2015 01:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=PKipOI9vPEkc17DiSaM0NLbDlUByPEqPqp8wsmIHKuI=; b=o/2KhsBQNkvADbM2Se193gFAaqBI3LCHlpF7HObsW+k8qOZ/OBJgJIdfPb9P0RI7YA qb6EYpJKV/UZgPzDC1uPU6YaU45xjat06xkLM0DINS2V8sqE7nqYB9yFvgaBDoacPoTI Xcz0ONuOa/HxRAl4jwzvOfVuz5GTU7aHflI1ZMzcX0eGNuBJir34/sjThC4FHek0HE2e 6nA+I4KPKyZC15IN6K6y6xeLeCL9R7SdICEK7sl6+7ASXVdxcP3FNXojkMxUF4y8eCgR +5sp0Nxl19G/PxO2mCNp0/ib1G6CVWRpuBFYiGqcTUcpwIFmXbSXjeQrWN+Juq0fO6GQ RP1Q== X-Received: by 10.180.210.234 with SMTP id mx10mr24026565wic.42.1439713018861; Sun, 16 Aug 2015 01:16:58 -0700 (PDT) Received: from [172.16.1.30] (5.Red-79-156-191.staticIP.rima-tde.net. [79.156.191.5]) by smtp.gmail.com with ESMTPSA id du6sm11083074wib.24.2015.08.16.01.16.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Aug 2015 01:16:58 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <55D046F5.60601@FreeBSD.org> Date: Sun, 16 Aug 2015 10:16:53 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286787 - head/sys/x86/x86 References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> In-Reply-To: <55CF5B13.1040501@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 08:17:01 -0000 El 15/08/15 a les 17.30, Jason Harmening ha escrit: > On 08/15/15 08:05, Roger Pau Monné wrote: >> El 14/08/15 a les 22.08, Jason A. Harmening ha escrit: >>> Author: jah >>> Date: Fri Aug 14 20:08:16 2015 >>> New Revision: 286787 >>> URL: https://svnweb.freebsd.org/changeset/base/286787 >>> >>> Log: >>> Use pmap_quick_enter_page() to handle bouncing of unmapped buffers in the x86 busdma_bounce implementation. Also treat user buffers as unmapped. >>> This allows two things: >>> 1. Sync'ing bounced maps in non-sleepable contexts. The physcopy* calls previously used could sleep on sf_buf operations in some cases. >>> 2. Sync'ing user buffers outside the context of the owning process >> >> AFAICT this will break the Xen port. physcopy* uses uiomove_fromphys >> that on the amd64 port is able to deal with pages outside of the DMAP. >> OTOH pmap_quick_enter_page is not able to deal with pages outside of the >> DMAP, and will simply panic. >> >> Roger. >> > > Is it actually possible for those non-dom0 pages to be used for I/O that > passes through busdma? Yes, Qemu uses them as buffers to read/write syscalls. > If it is, then it would be easy to make > pmap_quick_enter_page() handle them by adding a pcpu pageframe similar > to what we do for i386. pmap_map_io_transient contains some of this logic, but it uses vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats part of the purpose of this change and cannot be used as-is. Roger. From owner-svn-src-head@freebsd.org Sun Aug 16 09:04:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E619B9A08; Sun, 16 Aug 2015 09:04:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0A961432; Sun, 16 Aug 2015 09:04:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7G93w8g036416 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 16 Aug 2015 12:03:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7G93w8g036416 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7G93wis036415; Sun, 16 Aug 2015 12:03:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 16 Aug 2015 12:03:58 +0300 From: Konstantin Belousov To: Roger Pau Monn?? Cc: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286787 - head/sys/x86/x86 Message-ID: <20150816090358.GW2072@kib.kiev.ua> References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> <55D046F5.60601@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D046F5.60601@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 09:04:04 -0000 On Sun, Aug 16, 2015 at 10:16:53AM +0200, Roger Pau Monn?? wrote: > pmap_map_io_transient contains some of this logic, but it uses > vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats > part of the purpose of this change and cannot be used as-is. This logic can be repeated, but it is probably too much for the purpose. It would be enough to have single frame (we cannot reuse CMAP1), protected by a spin mutex. I do not see much sense in providing optimized per-cpu frames for this case. From owner-svn-src-head@freebsd.org Sun Aug 16 09:50:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2709BA1BB; Sun, 16 Aug 2015 09:50:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDD417EE; Sun, 16 Aug 2015 09:50:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7G9o4Ut046811 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 16 Aug 2015 12:50:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7G9o4Ut046811 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7G9o412046810; Sun, 16 Aug 2015 12:50:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 16 Aug 2015 12:50:04 +0300 From: Konstantin Belousov To: Roger Pau Monn?? Cc: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286787 - head/sys/x86/x86 Message-ID: <20150816095004.GX2072@kib.kiev.ua> References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> <55D046F5.60601@FreeBSD.org> <20150816090358.GW2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150816090358.GW2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 09:50:15 -0000 On Sun, Aug 16, 2015 at 12:03:58PM +0300, Konstantin Belousov wrote: > On Sun, Aug 16, 2015 at 10:16:53AM +0200, Roger Pau Monn?? wrote: > > pmap_map_io_transient contains some of this logic, but it uses > > vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats > > part of the purpose of this change and cannot be used as-is. > > This logic can be repeated, but it is probably too much for the purpose. > It would be enough to have single frame (we cannot reuse CMAP1), > protected by a spin mutex. I do not see much sense in providing > optimized per-cpu frames for this case. Like this. I only compiled the patch. diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 1e64fc8..9d2b2d9 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -390,6 +390,8 @@ static struct md_page *pv_table; */ pt_entry_t *CMAP1 = 0; caddr_t CADDR1 = 0; +static vm_offset_t qframe = 0; +static struct mtx qframe_mtx; static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ @@ -1031,7 +1033,7 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t mpte; vm_size_t s; - int i, pv_npg; + int error, i, pv_npg; /* * Initialize the vm page array entries for the kernel pmap's @@ -1112,6 +1114,12 @@ pmap_init(void) printf("PPIM %u: PA=%#lx, VA=%#lx, size=%#lx, mode=%#x\n", i, ppim->pa, ppim->va, ppim->sz, ppim->mode); } + + mtx_init(&qframe_mtx, "qfrmlk", NULL, MTX_SPIN); + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, + (vmem_addr_t *)&qframe); + if (error != 0) + panic("qframe allocation failed"); } static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, @@ -7019,13 +7027,28 @@ pmap_unmap_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, vm_offset_t pmap_quick_enter_page(vm_page_t m) { + vm_paddr_t paddr; - return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); + paddr = VM_PAGE_TO_PHYS(m); + if (paddr < dmaplimit) + return (PHYS_TO_DMAP(paddr)); + mtx_lock_spin(&qframe_mtx); + KASSERT(*vtopte(qframe) == 0, ("qframe busy")); + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | + X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); + invlpg(qframe); + return (qframe); } void pmap_quick_remove_page(vm_offset_t addr) { + + if (addr != qframe) + return; + pte_store(vtopte(qframe), 0); + invlpg(qframe); + mtx_unlock_spin(&qframe_mtx); } #include "opt_ddb.h" From owner-svn-src-head@freebsd.org Sun Aug 16 09:51:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EB3D9BA35C; Sun, 16 Aug 2015 09:51:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F16F1AE8; Sun, 16 Aug 2015 09:51:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7G9pPBH086357; Sun, 16 Aug 2015 09:51:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7G9pOik086355; Sun, 16 Aug 2015 09:51:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508160951.t7G9pOik086355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Aug 2015 09:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286822 - in head: share/mk tools/build/options tools/tools/nanobsd/gateworks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 09:51:25 -0000 Author: ngie Date: Sun Aug 16 09:51:24 2015 New Revision: 286822 URL: https://svnweb.freebsd.org/changeset/base/286822 Log: Reap MK_SYSINSTALL It's no longer in use in the tree (most likely missed when sade/sysinstall were removed) MFC after: 1 week Deleted: head/tools/build/options/WITHOUT_SYSINSTALL Modified: head/share/mk/src.opts.mk head/tools/tools/nanobsd/gateworks/common Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Aug 16 01:08:59 2015 (r286821) +++ head/share/mk/src.opts.mk Sun Aug 16 09:51:24 2015 (r286822) @@ -155,7 +155,6 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_UCODE \ SVNLITE \ SYSCONS \ - SYSINSTALL \ TALK \ TCP_WRAPPERS \ TCSH \ Modified: head/tools/tools/nanobsd/gateworks/common ============================================================================== --- head/tools/tools/nanobsd/gateworks/common Sun Aug 16 01:08:59 2015 (r286821) +++ head/tools/tools/nanobsd/gateworks/common Sun Aug 16 09:51:24 2015 (r286822) @@ -147,7 +147,6 @@ WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SSP=true WITHOUT_SYSCONS=true -WITHOUT_SYSINSTALL=true WITHOUT_TCSH=true WITHOUT_TFTPD=true WITHOUT_ZFS=true From owner-svn-src-head@freebsd.org Sun Aug 16 10:10:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E868D9BA7E8; Sun, 16 Aug 2015 10:10:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BF9301; Sun, 16 Aug 2015 10:10:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GAAwvP092023; Sun, 16 Aug 2015 10:10:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GAAwSL092022; Sun, 16 Aug 2015 10:10:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508161010.t7GAAwSL092022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 16 Aug 2015 10:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286823 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 10:10:59 -0000 Author: ngie Date: Sun Aug 16 10:10:58 2015 New Revision: 286823 URL: https://svnweb.freebsd.org/changeset/base/286823 Log: Regen src.conf.5 per r286822 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Aug 16 09:51:24 2015 (r286822) +++ head/share/man/man5/src.conf.5 Sun Aug 16 10:10:58 2015 (r286823) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 284708 2015-06-22 20:21:57Z sjg .\" $FreeBSD$ -.Dd August 13, 2015 +.Dd August 16, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1215,11 +1215,6 @@ Set to disable symbol versioning when bu Set to not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. -.It Va WITHOUT_SYSINSTALL -.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam -Set to not build -.Xr sysinstall 8 -and related programs. .It Va WITH_SYSROOT .\" from FreeBSD: head/tools/build/options/WITH_SYSROOT 284708 2015-06-22 20:21:57Z sjg Enable use of sysroot during build. From owner-svn-src-head@freebsd.org Sun Aug 16 12:23:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEC69B946C; Sun, 16 Aug 2015 12:23:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB712AD; Sun, 16 Aug 2015 12:23:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GCNxqb049840; Sun, 16 Aug 2015 12:23:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GCNxh0049839; Sun, 16 Aug 2015 12:23:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508161223.t7GCNxh0049839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 16 Aug 2015 12:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286825 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 12:23:59 -0000 Author: melifaro Date: Sun Aug 16 12:23:58 2015 New Revision: 286825 URL: https://svnweb.freebsd.org/changeset/base/286825 Log: Split arpresolve() into fast/slow path. This change isolates the most common case (e.g. successful lookup) from more complicates scenarios. It also (tries to) make code more simple by avoiding retry: cycle. The actual goal is to prepare code to the upcoming change that will allow LL address retrieval without acquiring LLE lock at all. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D3383 Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Aug 16 12:09:55 2015 (r286824) +++ head/sys/netinet/if_ether.c Sun Aug 16 12:23:58 2015 (r286825) @@ -309,57 +309,37 @@ arprequest(struct ifnet *ifp, const stru } /* - * Resolve an IP address into an ethernet address. - * On input: - * ifp is the interface we use - * is_gw != if @dst represents gateway to some destination - * m is the mbuf. May be NULL if we don't have a packet. - * dst is the next hop, - * desten is where we want the address. - * flags returns lle entry flags. + * Resolve an IP address into an ethernet address - heavy version. + * Used internally by arpresolve(). + * We have already checked than we can't use existing lle without + * modification so we have to acquire LLE_EXCLUSIVE lle lock. * * On success, desten and flags are filled in and the function returns 0; * If the packet must be held pending resolution, we return EWOULDBLOCK * On other errors, we return the corresponding error code. * Note that m_freem() handles NULL. */ -int -arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, +static int +arpresolve_full(struct ifnet *ifp, int is_gw, int create, struct mbuf *m, const struct sockaddr *dst, u_char *desten, uint32_t *pflags) { - struct llentry *la = 0; - u_int flags = 0; + struct llentry *la = NULL; struct mbuf *curr = NULL; struct mbuf *next = NULL; - int create, error, renew; + int error, renew; if (pflags != NULL) *pflags = 0; - create = 0; - if (m != NULL) { - if (m->m_flags & M_BCAST) { - /* broadcast */ - (void)memcpy(desten, - ifp->if_broadcastaddr, ifp->if_addrlen); - return (0); - } - if (m->m_flags & M_MCAST) { - /* multicast */ - ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten); - return (0); - } + if (create == 0) { + IF_AFDATA_RLOCK(ifp); + la = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); + IF_AFDATA_RUNLOCK(ifp); } -retry: - IF_AFDATA_RLOCK(ifp); - la = lla_lookup(LLTABLE(ifp), flags, dst); - IF_AFDATA_RUNLOCK(ifp); - if ((la == NULL) && ((flags & LLE_EXCLUSIVE) == 0) - && ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0)) { + if (la == NULL && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { create = 1; - flags |= LLE_EXCLUSIVE; IF_AFDATA_WLOCK(ifp); - la = lla_create(LLTABLE(ifp), flags, dst); + la = lla_create(LLTABLE(ifp), 0, dst); IF_AFDATA_WUNLOCK(ifp); } if (la == NULL) { @@ -389,10 +369,7 @@ retry: if (pflags != NULL) *pflags = la->la_flags; - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(la); - else - LLE_RUNLOCK(la); + LLE_WUNLOCK(la); if (renew == 1) arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); @@ -400,20 +377,7 @@ retry: return (0); } - if (la->la_flags & LLE_STATIC) { /* should not happen! */ - log(LOG_DEBUG, "arpresolve: ouch, empty static llinfo for %s\n", - inet_ntoa(SIN(dst)->sin_addr)); - m_freem(m); - error = EINVAL; - goto done; - } - renew = (la->la_asked == 0 || la->la_expire != time_uptime); - if ((renew || m != NULL) && (flags & LLE_EXCLUSIVE) == 0) { - flags |= LLE_EXCLUSIVE; - LLE_RUNLOCK(la); - goto retry; - } /* * There is an arptab entry, but no ethernet address * response yet. Add the mbuf to the list, dropping @@ -438,11 +402,6 @@ retry: } else la->la_hold = m; la->la_numheld++; - if (renew == 0 && (flags & LLE_EXCLUSIVE)) { - flags &= ~LLE_EXCLUSIVE; - LLE_DOWNGRADE(la); - } - } /* * Return EWOULDBLOCK if we have tried less than arp_maxtries. It @@ -469,15 +428,88 @@ retry: arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); return (error); } -done: - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(la); - else - LLE_RUNLOCK(la); + + LLE_WUNLOCK(la); return (error); } /* + * Resolve an IP address into an ethernet address. + * On input: + * ifp is the interface we use + * is_gw != 0 if @dst represents gateway to some destination + * m is the mbuf. May be NULL if we don't have a packet. + * dst is the next hop, + * desten is the storage to put LL address. + * flags returns lle entry flags. + * + * On success, desten and flags are filled in and the function returns 0; + * If the packet must be held pending resolution, we return EWOULDBLOCK + * On other errors, we return the corresponding error code. + * Note that m_freem() handles NULL. + */ +int +arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, + const struct sockaddr *dst, u_char *desten, uint32_t *pflags) +{ + struct llentry *la = 0; + int renew; + + if (pflags != NULL) + *pflags = 0; + + if (m != NULL) { + if (m->m_flags & M_BCAST) { + /* broadcast */ + (void)memcpy(desten, + ifp->if_broadcastaddr, ifp->if_addrlen); + return (0); + } + if (m->m_flags & M_MCAST) { + /* multicast */ + ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten); + return (0); + } + } + + IF_AFDATA_RLOCK(ifp); + la = lla_lookup(LLTABLE(ifp), 0, dst); + IF_AFDATA_RUNLOCK(ifp); + + if (la == NULL) + return (arpresolve_full(ifp, is_gw, 1, m, dst, desten, pflags)); + + if ((la->la_flags & LLE_VALID) && + ((la->la_flags & LLE_STATIC) || la->la_expire > time_uptime)) { + bcopy(&la->ll_addr, desten, ifp->if_addrlen); + renew = 0; + /* + * If entry has an expiry time and it is approaching, + * see if we need to send an ARP request within this + * arpt_down interval. + */ + if (!(la->la_flags & LLE_STATIC) && + time_uptime + la->la_preempt > la->la_expire) { + renew = 1; + la->la_preempt--; + } + + if (pflags != NULL) + *pflags = la->la_flags; + + LLE_RUNLOCK(la); + + if (renew == 1) + arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); + + return (0); + } + LLE_RUNLOCK(la); + + return (arpresolve_full(ifp, is_gw, 0, m, dst, desten, pflags)); +} + +/* * Common length and type checks are done here, * then the protocol-specific routine is called. */ From owner-svn-src-head@freebsd.org Sun Aug 16 12:57:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB0FB9B99B8; Sun, 16 Aug 2015 12:57:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBACD1355; Sun, 16 Aug 2015 12:57:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GCvI1A062539; Sun, 16 Aug 2015 12:57:18 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GCvI7c062536; Sun, 16 Aug 2015 12:57:18 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508161257.t7GCvI7c062536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Aug 2015 12:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286826 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 12:57:19 -0000 Author: jilles Date: Sun Aug 16 12:57:17 2015 New Revision: 286826 URL: https://svnweb.freebsd.org/changeset/base/286826 Log: sh: Backslash-newline should not affect field splitting in read builtin. This was originally broken in r212339 in 2010. Added: head/bin/sh/tests/builtins/read8.0 (contents, props changed) Modified: head/bin/sh/miscbltin.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Aug 16 12:23:58 2015 (r286825) +++ head/bin/sh/miscbltin.c Sun Aug 16 12:57:17 2015 (r286826) @@ -191,9 +191,10 @@ readcmd(int argc __unused, char **argv _ CHECKSTRSPACE(1, p); if (backslash) { backslash = 0; - startword = 0; - if (c != '\n') + if (c != '\n') { + startword = 0; USTPUTC(c, p); + } continue; } if (!rflag && c == '\\') { Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Aug 16 12:23:58 2015 (r286825) +++ head/bin/sh/tests/builtins/Makefile Sun Aug 16 12:57:17 2015 (r286826) @@ -121,6 +121,7 @@ FILES+= read4.0 read4.0.stdout FILES+= read5.0 FILES+= read6.0 FILES+= read7.0 +FILES+= read8.0 FILES+= return1.0 FILES+= return2.1 FILES+= return3.1 Added: head/bin/sh/tests/builtins/read8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/read8.0 Sun Aug 16 12:57:17 2015 (r286826) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +read a b c <<\EOF +\ +A\ + \ + \ + \ +B\ + \ + \ +C\ + \ + \ + \ +EOF +[ "$a.$b.$c" = "A.B.C" ] From owner-svn-src-head@freebsd.org Sun Aug 16 13:59:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76E679BA675; Sun, 16 Aug 2015 13:59:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 600C6DCF; Sun, 16 Aug 2015 13:59:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GDxCNs086946; Sun, 16 Aug 2015 13:59:12 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GDxCwq086945; Sun, 16 Aug 2015 13:59:12 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508161359.t7GDxCwq086945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 16 Aug 2015 13:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286827 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 13:59:12 -0000 Author: ed Date: Sun Aug 16 13:59:11 2015 New Revision: 286827 URL: https://svnweb.freebsd.org/changeset/base/286827 Log: Pick UINT_MAX / 100 as an upperbound. The fix that I applied in r286798 is already good, but it assumes that sizeof(int) > sizeof(short). Express the upperbound in terms of UINT_MAX. By dividing that by 100, we're sure that the resulting value is never larger than approximately UINT_MAX / 10, which is safe. PR: 202326 Discussed with: kcwu csie org MFC after: 1 month Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sun Aug 16 12:57:17 2015 (r286826) +++ head/sys/teken/teken.c Sun Aug 16 13:59:11 2015 (r286827) @@ -411,13 +411,16 @@ teken_state_numbers(teken_t *t, teken_ch /* First digit. */ t->t_stateflags &= ~TS_FIRSTDIGIT; t->t_nums[t->t_curnum] = c - '0'; - } else if (t->t_nums[t->t_curnum] < USHRT_MAX) { + } else if (t->t_nums[t->t_curnum] < UINT_MAX / 100) { /* - * Screen positions are stored as unsigned - * shorts. There is no need to continue parsing - * input once the value exceeds USHRT_MAX. It - * would only allow for integer overflows when - * performing arithmetic on the cursor position. + * There is no need to continue parsing input + * once the value exceeds the size of the + * terminal. It would only allow for integer + * overflows when performing arithmetic on the + * cursor position. + * + * Ignore any further digits if the value is + * already UINT_MAX / 100. */ t->t_nums[t->t_curnum] = t->t_nums[t->t_curnum] * 10 + c - '0'; From owner-svn-src-head@freebsd.org Sun Aug 16 16:31:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC759BBBB9; Sun, 16 Aug 2015 16:31:11 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA6AEEF; Sun, 16 Aug 2015 16:31:11 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by obbhe7 with SMTP id he7so95203015obb.0; Sun, 16 Aug 2015 09:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=n9GhTXKLQxMrD9ONnIS5SX2O617WR0XjovaTsyZmBo8=; b=qcyWTgEM1Yrg/Sye+CJG22EwIz+bAwEqSM5wgrfhotIXlWOTSDLtlr+BPKN1F+V7u/ oEox2byx6lQ7jlXlOgM6biaxoiFw/yRtXGL3kvstoWrkN50dCmpOAcUwhOqpPkfnG9hB jWezmhMV/dNne3YZwpBl+7VkK21pD6gJr5MTN/mgAKYf9o/lIxl6QN9W1pz2yFWoGIWk Zb1iLg7GRxc8v7d21VsDfMo2F5BelrX7XOTFcZphzTacsIw/xvwnVIMwGTv1Csgu3koF TPQvixA+7TLRFfsjjIemSn0ySQ8Ua9u2j5wbc+PQ6gBuJFQ7Rz/acsitzYqoQbPvWk9+ j2NQ== X-Received: by 10.60.16.228 with SMTP id j4mr50442450oed.59.1439742670783; Sun, 16 Aug 2015 09:31:10 -0700 (PDT) Received: from corona.austin.rr.com (cpe-72-177-6-10.austin.res.rr.com. [72.177.6.10]) by smtp.googlemail.com with ESMTPSA id gu5sm5368964obc.21.2015.08.16.09.31.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Aug 2015 09:31:09 -0700 (PDT) Subject: Re: svn commit: r286787 - head/sys/x86/x86 To: Konstantin Belousov , Roger Pau Monn?? References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> <55D046F5.60601@FreeBSD.org> <20150816090358.GW2072@kib.kiev.ua> <20150816095004.GX2072@kib.kiev.ua> Cc: "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jason Harmening Message-ID: <55D0BBB3.4060707@gmail.com> Date: Sun, 16 Aug 2015 11:34:59 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150816095004.GX2072@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 16:31:11 -0000 On 08/16/15 04:50, Konstantin Belousov wrote: > On Sun, Aug 16, 2015 at 12:03:58PM +0300, Konstantin Belousov wrote: >> On Sun, Aug 16, 2015 at 10:16:53AM +0200, Roger Pau Monn?? wrote: >>> pmap_map_io_transient contains some of this logic, but it uses >>> vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats >>> part of the purpose of this change and cannot be used as-is. >> >> This logic can be repeated, but it is probably too much for the purpose. >> It would be enough to have single frame (we cannot reuse CMAP1), >> protected by a spin mutex. I do not see much sense in providing >> optimized per-cpu frames for this case. > > Like this. I only compiled the patch. > > diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c > index 1e64fc8..9d2b2d9 100644 > --- a/sys/amd64/amd64/pmap.c > +++ b/sys/amd64/amd64/pmap.c > @@ -390,6 +390,8 @@ static struct md_page *pv_table; > */ > pt_entry_t *CMAP1 = 0; > caddr_t CADDR1 = 0; > +static vm_offset_t qframe = 0; > +static struct mtx qframe_mtx; > > static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ > > @@ -1031,7 +1033,7 @@ pmap_init(void) > struct pmap_preinit_mapping *ppim; > vm_page_t mpte; > vm_size_t s; > - int i, pv_npg; > + int error, i, pv_npg; > > /* > * Initialize the vm page array entries for the kernel pmap's > @@ -1112,6 +1114,12 @@ pmap_init(void) > printf("PPIM %u: PA=%#lx, VA=%#lx, size=%#lx, mode=%#x\n", i, > ppim->pa, ppim->va, ppim->sz, ppim->mode); > } > + > + mtx_init(&qframe_mtx, "qfrmlk", NULL, MTX_SPIN); > + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, > + (vmem_addr_t *)&qframe); > + if (error != 0) > + panic("qframe allocation failed"); > } > > static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, > @@ -7019,13 +7027,28 @@ pmap_unmap_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, > vm_offset_t > pmap_quick_enter_page(vm_page_t m) > { > + vm_paddr_t paddr; > > - return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); > + paddr = VM_PAGE_TO_PHYS(m); > + if (paddr < dmaplimit) > + return (PHYS_TO_DMAP(paddr)); > + mtx_lock_spin(&qframe_mtx); > + KASSERT(*vtopte(qframe) == 0, ("qframe busy")); > + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | > + X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); > + invlpg(qframe); > + return (qframe); > } > > void > pmap_quick_remove_page(vm_offset_t addr) > { > + > + if (addr != qframe) > + return; > + pte_store(vtopte(qframe), 0); > + invlpg(qframe); > + mtx_unlock_spin(&qframe_mtx); > } > > #include "opt_ddb.h" > That looks fine to me. From owner-svn-src-head@freebsd.org Sun Aug 16 16:57:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D829BBE02; Sun, 16 Aug 2015 16:57:21 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85054185E; Sun, 16 Aug 2015 16:57:20 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.15.0.59/8.15.0.59) with SMTP id t7GGtg2o012503; Sun, 16 Aug 2015 11:57:18 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 1wa0ffrbnx-1; Sun, 16 Aug 2015 11:57:18 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 046B44044B; Sun, 16 Aug 2015 11:57:17 -0500 (CDT) Message-ID: <55D0C0ED.807@rice.edu> Date: Sun, 16 Aug 2015 11:57:17 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Konstantin Belousov , Roger Pau Monn?? CC: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286787 - head/sys/x86/x86 References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> <55D046F5.60601@FreeBSD.org> <20150816090358.GW2072@kib.kiev.ua> <20150816095004.GX2072@kib.kiev.ua> In-Reply-To: <20150816095004.GX2072@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1508160309 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 16:57:21 -0000 On 08/16/2015 04:50, Konstantin Belousov wrote: > On Sun, Aug 16, 2015 at 12:03:58PM +0300, Konstantin Belousov wrote: >> On Sun, Aug 16, 2015 at 10:16:53AM +0200, Roger Pau Monn?? wrote: >>> pmap_map_io_transient contains some of this logic, but it uses >>> vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats >>> part of the purpose of this change and cannot be used as-is. >> This logic can be repeated, but it is probably too much for the purpose. >> It would be enough to have single frame (we cannot reuse CMAP1), >> protected by a spin mutex. I do not see much sense in providing >> optimized per-cpu frames for this case. > Like this. I only compiled the patch. > > diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c > index 1e64fc8..9d2b2d9 100644 > --- a/sys/amd64/amd64/pmap.c > +++ b/sys/amd64/amd64/pmap.c > @@ -390,6 +390,8 @@ static struct md_page *pv_table; > */ > pt_entry_t *CMAP1 = 0; > caddr_t CADDR1 = 0; > +static vm_offset_t qframe = 0; > +static struct mtx qframe_mtx; > > static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ > > @@ -1031,7 +1033,7 @@ pmap_init(void) > struct pmap_preinit_mapping *ppim; > vm_page_t mpte; > vm_size_t s; > - int i, pv_npg; > + int error, i, pv_npg; > > /* > * Initialize the vm page array entries for the kernel pmap's > @@ -1112,6 +1114,12 @@ pmap_init(void) > printf("PPIM %u: PA=%#lx, VA=%#lx, size=%#lx, mode=%#x\n", i, > ppim->pa, ppim->va, ppim->sz, ppim->mode); > } > + > + mtx_init(&qframe_mtx, "qfrmlk", NULL, MTX_SPIN); > + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, > + (vmem_addr_t *)&qframe); > + if (error != 0) > + panic("qframe allocation failed"); > } > > static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, > @@ -7019,13 +7027,28 @@ pmap_unmap_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, > vm_offset_t > pmap_quick_enter_page(vm_page_t m) > { > + vm_paddr_t paddr; > > - return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); > + paddr = VM_PAGE_TO_PHYS(m); > + if (paddr < dmaplimit) > + return (PHYS_TO_DMAP(paddr)); > + mtx_lock_spin(&qframe_mtx); > + KASSERT(*vtopte(qframe) == 0, ("qframe busy")); > + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | > + X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); > + invlpg(qframe); This invlpg is unnecessary. > + return (qframe); > } > > void > pmap_quick_remove_page(vm_offset_t addr) > { > + > + if (addr != qframe) > + return; > + pte_store(vtopte(qframe), 0); > + invlpg(qframe); > + mtx_unlock_spin(&qframe_mtx); > } > > #include "opt_ddb.h" > > From owner-svn-src-head@freebsd.org Sun Aug 16 17:07:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D629BBFD2; Sun, 16 Aug 2015 17:07:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21A51D15; Sun, 16 Aug 2015 17:07:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GH7ruu064936; Sun, 16 Aug 2015 17:07:53 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GH7r0s064935; Sun, 16 Aug 2015 17:07:53 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508161707.t7GH7r0s064935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 16 Aug 2015 17:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286828 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 17:07:54 -0000 Author: alc Date: Sun Aug 16 17:07:53 2015 New Revision: 286828 URL: https://svnweb.freebsd.org/changeset/base/286828 Log: As another piece of PG_CACHE page elimination, remove an LRU-defeating call to vm_page_try_to_cache() from vm_pageout_flush(). Other changes, most recently r286814, have made this call unnecessary. Reviewed by: kib Discussed with: jeff Tested by: pho Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Aug 16 13:59:11 2015 (r286827) +++ head/sys/vm/vm_pageout.c Sun Aug 16 17:07:53 2015 (r286828) @@ -566,11 +566,6 @@ vm_pageout_flush(vm_page_t *mc, int coun if (pageout_status[i] != VM_PAGER_PEND) { vm_object_pip_wakeup(object); vm_page_sunbusy(mt); - if (vm_page_count_severe()) { - vm_page_lock(mt); - vm_page_try_to_cache(mt); - vm_page_unlock(mt); - } } } if (prunlen != NULL) From owner-svn-src-head@freebsd.org Sun Aug 16 19:06:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 040DB9BB192; Sun, 16 Aug 2015 19:06:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD68813CE; Sun, 16 Aug 2015 19:06:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GJ6ODW015835; Sun, 16 Aug 2015 19:06:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GJ6O3f015833; Sun, 16 Aug 2015 19:06:24 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508161906.t7GJ6O3f015833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Aug 2015 19:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286829 - in head: share/man/man4 sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 19:06:25 -0000 Author: sbruno Date: Sun Aug 16 19:06:23 2015 New Revision: 286829 URL: https://svnweb.freebsd.org/changeset/base/286829 Log: Add capability to disable CRC stripping. This breaks IPMI/BMC capabilities on certain adatpers. Linux has been doing the exact same thing since 2008 https://github.com/torvalds/linux/commit/eb7c3adb1ca92450870dbb0d347fc986cd5e2af4 PR: 161277 Differential Revision: https://reviews.freebsd.org/D3282 Submitted by: Fravadona@gmail.com Reviewed by: erj wblock MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks Modified: head/share/man/man4/em.4 head/sys/dev/e1000/if_em.c Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Sun Aug 16 17:07:53 2015 (r286828) +++ head/share/man/man4/em.4 Sun Aug 16 19:06:23 2015 (r286829) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2011 +.Dd August 16, 2015 .Dt EM 4 .Os .Sh NAME @@ -205,6 +205,11 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.em.disable_crc_stripping +Disable or enable hardware stripping of CRC field. +This is mostly useful on BMC/IPMI shared interfaces where stripping the CRC +causes remote access over IPMI to fail. +Default 0 (enabled). .It Va hw.em.eee_setting Disable or enable Energy Efficient Ethernet. Default 1 (disabled). Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Aug 16 17:07:53 2015 (r286828) +++ head/sys/dev/e1000/if_em.c Sun Aug 16 19:06:23 2015 (r286829) @@ -366,6 +366,10 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); +static int em_disable_crc_stripping = 0; +SYSCTL_INT(_hw_em, OID_AUTO, disable_crc_stripping, CTLFLAG_RDTUN, + &em_disable_crc_stripping, 0, "Disable CRC Stripping"); + static int em_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int em_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); SYSCTL_INT(_hw_em, OID_AUTO, tx_int_delay, CTLFLAG_RDTUN, &em_tx_int_delay_dflt, @@ -4514,7 +4518,8 @@ em_initialize_receive_unit(struct adapte (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT); /* Strip the CRC */ - rctl |= E1000_RCTL_SECRC; + if (!em_disable_crc_stripping) + rctl |= E1000_RCTL_SECRC; /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; From owner-svn-src-head@freebsd.org Sun Aug 16 19:42:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A1759BB7A8; Sun, 16 Aug 2015 19:42:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED71018AA; Sun, 16 Aug 2015 19:42:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GJgFjr032643; Sun, 16 Aug 2015 19:42:15 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GJgFPs032642; Sun, 16 Aug 2015 19:42:15 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508161942.t7GJgFPs032642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Aug 2015 19:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286830 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 19:42:16 -0000 Author: jilles Date: Sun Aug 16 19:42:15 2015 New Revision: 286830 URL: https://svnweb.freebsd.org/changeset/base/286830 Log: wordexp(): Stop using the undocumented wordexp builtin. The functionality of the wordexp builtin is easily replaced using normal shell code, although performance is slightly worse. This does not mean that wordexp() will remain shell-independent -- a fully reliable implementation of WRDE_NOCMD is really only possible using extensions to the shell, or by adding much of the shell's code to libc. Modified: head/lib/libc/gen/wordexp.c Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Sun Aug 16 19:06:23 2015 (r286829) +++ head/lib/libc/gen/wordexp.c Sun Aug 16 19:42:15 2015 (r286830) @@ -138,8 +138,7 @@ we_askshell(const char *words, wordexp_t } else if (pid == 0) { /* - * We are the child; just get /bin/sh to run the wordexp - * builtin on `words'. + * We are the child; make /bin/sh expand `words'. */ (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); if ((pdes[1] != STDOUT_FILENO ? @@ -147,7 +146,9 @@ we_askshell(const char *words, wordexp_t _fcntl(pdes[1], F_SETFD, 0)) < 0) _exit(1); execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", "IFS=$1;eval \"$2\";eval \"wordexp $3\"", "", + "-c", "IFS=$1;eval \"$2\";eval \"set -- $3\";IFS=;a=\"$*\";" + "printf '%08x' \"$#\" \"${#a}\";printf '%s\\0' \"$@\"", + "", ifs != NULL ? ifs : " \t\n", flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, (char *)NULL); From owner-svn-src-head@freebsd.org Sun Aug 16 19:43:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA609BB7E2; Sun, 16 Aug 2015 19:43:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 699151A12; Sun, 16 Aug 2015 19:43:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GJhjnS032738; Sun, 16 Aug 2015 19:43:45 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GJhiqa032735; Sun, 16 Aug 2015 19:43:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508161943.t7GJhiqa032735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Aug 2015 19:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286831 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 19:43:45 -0000 Author: sbruno Date: Sun Aug 16 19:43:44 2015 New Revision: 286831 URL: https://svnweb.freebsd.org/changeset/base/286831 Log: Increase EM_MAX_SCATTER to 64 such that the size of em_xmit()::segs[EM_MAX_SCATTER] doesn't get overrun by things like NFS that can and do shove more than 32 segs when being used with em(4) and TSO4. Update tso handling code in em_xmit() with update from jhb@ in email thread: https://lists.freebsd.org/pipermail/freebsd-net/2014-July/039306.html set ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount & ifp->if_hw_tsomaxsegsize to appropriate values. Define a TSO workaround "magic" number of 4 that is used to avoid an alignment issue in hardware. Change a couple of integer values that were used as booleans to actual bool types. Ensure that em_enable_intr() enables the appropriate mask of interrupts and not just a hardcoded define of values. PR: 200221 199174 195078 Differential Revision: https://reviews.freebsd.org/D3192 Reviewed by: erj jhb hiren MFC after: 2 weeks Sponsored by: Limelight Networks Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Aug 16 19:42:15 2015 (r286830) +++ head/sys/dev/e1000/if_em.c Sun Aug 16 19:43:44 2015 (r286831) @@ -364,6 +364,8 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); #define CSUM_TSO 0 #endif +#define TSO_WORKAROUND 4 + static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); static int em_disable_crc_stripping = 0; @@ -1876,13 +1878,15 @@ em_xmit(struct tx_ring *txr, struct mbuf struct ether_header *eh; struct ip *ip = NULL; struct tcphdr *tp = NULL; - u32 txd_upper = 0, txd_lower = 0, txd_used = 0; + u32 txd_upper = 0, txd_lower = 0; int ip_off, poff; int nsegs, i, j, first, last = 0; - int error, do_tso, tso_desc = 0, remap = 1; + int error; + bool do_tso, tso_desc, remap = TRUE; m_head = *m_headp; - do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); + do_tso = (m_head->m_pkthdr.csum_flags & CSUM_TSO); + tso_desc = FALSE; ip_off = poff = 0; /* @@ -1918,74 +1922,82 @@ em_xmit(struct tx_ring *txr, struct mbuf * for IPv6 yet. */ ip_off = sizeof(struct ether_header); - m_head = m_pullup(m_head, ip_off); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); + if (m_head->m_len < ip_off) { + m_head = m_pullup(m_head, ip_off); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } } eh = mtod(m_head, struct ether_header *); if (eh->ether_type == htons(ETHERTYPE_VLAN)) { ip_off = sizeof(struct ether_vlan_header); - m_head = m_pullup(m_head, ip_off); + if (m_head->m_len < ip_off) { + m_head = m_pullup(m_head, ip_off); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } + } + } + if (m_head->m_len < ip_off + sizeof(struct ip)) { + m_head = m_pullup(m_head, ip_off + sizeof(struct ip)); if (m_head == NULL) { *m_headp = NULL; return (ENOBUFS); } } - m_head = m_pullup(m_head, ip_off + sizeof(struct ip)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - if (do_tso) { - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); + + if (do_tso || (m_head->m_pkthdr.csum_flags & CSUM_TCP)) { + if (m_head->m_len < poff + sizeof(struct tcphdr)) { + m_head = m_pullup(m_head, poff + + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: * pull 4 more bytes of data into it. */ - m_head = m_pullup(m_head, poff + (tp->th_off << 2) + 4); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); + if (m_head->m_len < poff + (tp->th_off << 2)) { + m_head = m_pullup(m_head, poff + + (tp->th_off << 2) + + TSO_WORKAROUND); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } } ip = (struct ip *)(mtod(m_head, char *) + ip_off); - ip->ip_len = 0; - ip->ip_sum = 0; - /* - * The pseudo TCP checksum does not include TCP payload - * length so driver should recompute the checksum here - * what hardware expect to see. This is adherence of - * Microsoft's Large Send specification. - */ tp = (struct tcphdr *)(mtod(m_head, char *) + poff); - tp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); + if (do_tso) { + ip->ip_len = htons(m_head->m_pkthdr.tso_segsz + + (ip->ip_hl << 2) + + (tp->th_off << 2)); + ip->ip_sum = 0; + /* + * The pseudo TCP checksum does not include TCP + * payload length so driver should recompute + * the checksum here what hardware expect to + * see. This is adherence of Microsoft's Large + * Send specification. + */ + tp->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } - tp = (struct tcphdr *)(mtod(m_head, char *) + poff); - m_head = m_pullup(m_head, poff + (tp->th_off << 2)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } - ip = (struct ip *)(mtod(m_head, char *) + ip_off); - tp = (struct tcphdr *)(mtod(m_head, char *) + poff); } else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) { - m_head = m_pullup(m_head, poff + sizeof(struct udphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); + if (m_head->m_len < poff + sizeof(struct udphdr)) { + m_head = m_pullup(m_head, poff + + sizeof(struct udphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } } ip = (struct ip *)(mtod(m_head, char *) + ip_off); } @@ -2031,7 +2043,7 @@ retry: *m_headp = m; /* Try it again, but only once */ - remap = 0; + remap = FALSE; goto retry; } else if (error != 0) { adapter->no_tx_dma_setup++; @@ -2046,13 +2058,13 @@ retry: * it follows a TSO burst, then we need to add a * sentinel descriptor to prevent premature writeback. */ - if ((do_tso == 0) && (txr->tx_tso == TRUE)) { + if ((!do_tso) && (txr->tx_tso == TRUE)) { if (nsegs == 1) tso_desc = TRUE; txr->tx_tso = FALSE; } - if (nsegs > (txr->tx_avail - 2)) { + if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) { txr->no_desc_avail++; bus_dmamap_unload(txr->txtag, map); return (ENOBUFS); @@ -2092,23 +2104,23 @@ retry: ** If this is the last descriptor, we want to ** split it so we have a small final sentinel */ - if (tso_desc && (j == (nsegs -1)) && (seg_len > 8)) { - seg_len -= 4; + if (tso_desc && (j == (nsegs - 1)) && (seg_len > 8)) { + seg_len -= TSO_WORKAROUND; ctxd->buffer_addr = htole64(seg_addr); ctxd->lower.data = htole32( - adapter->txd_cmd | txd_lower | seg_len); - ctxd->upper.data = - htole32(txd_upper); + adapter->txd_cmd | txd_lower | seg_len); + ctxd->upper.data = htole32(txd_upper); if (++i == adapter->num_tx_desc) i = 0; + /* Now make the sentinel */ - ++txd_used; /* using an extra txd */ + txr->tx_avail--; ctxd = &txr->tx_base[i]; tx_buffer = &txr->tx_buffers[i]; ctxd->buffer_addr = htole64(seg_addr + seg_len); ctxd->lower.data = htole32( - adapter->txd_cmd | txd_lower | 4); + adapter->txd_cmd | txd_lower | TSO_WORKAROUND); ctxd->upper.data = htole32(txd_upper); last = i; @@ -2118,8 +2130,7 @@ retry: ctxd->buffer_addr = htole64(seg_addr); ctxd->lower.data = htole32( adapter->txd_cmd | txd_lower | seg_len); - ctxd->upper.data = - htole32(txd_upper); + ctxd->upper.data = htole32(txd_upper); last = i; if (++i == adapter->num_tx_desc) i = 0; @@ -2130,8 +2141,6 @@ retry: txr->next_avail_desc = i; txr->tx_avail -= nsegs; - if (tso_desc) /* TSO used an extra for sentinel */ - txr->tx_avail -= txd_used; tx_buffer->m_head = m_head; /* @@ -3034,6 +3043,11 @@ em_setup_interface(device_t dev, struct if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setioctlfn(ifp, em_ioctl); if_setgetcounterfn(ifp, em_get_counter); + /* TSO parameters */ + ifp->if_hw_tsomax = EM_TSO_SIZE; + ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER; + ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; + #ifdef EM_MULTIQUEUE /* Multiqueue stack interface */ if_settransmitfn(ifp, em_mq_start); @@ -4893,8 +4907,8 @@ em_enable_intr(struct adapter *adapter) u32 ims_mask = IMS_ENABLE_MASK; if (hw->mac.type == e1000_82574) { - E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); - ims_mask |= EM_MSIX_MASK; + E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); + ims_mask |= adapter->ims; } E1000_WRITE_REG(hw, E1000_IMS, ims_mask); } Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Sun Aug 16 19:42:15 2015 (r286830) +++ head/sys/dev/e1000/if_em.h Sun Aug 16 19:43:44 2015 (r286831) @@ -266,7 +266,7 @@ #define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) -#define EM_MAX_SCATTER 32 +#define EM_MAX_SCATTER 64 #define EM_VFTA_SIZE 128 #define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ From owner-svn-src-head@freebsd.org Sun Aug 16 20:10:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC0B9BBBDD; Sun, 16 Aug 2015 20:10:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3FC174C; Sun, 16 Aug 2015 20:10:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GKAiN5041309; Sun, 16 Aug 2015 20:10:44 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GKAiX3041307; Sun, 16 Aug 2015 20:10:44 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508162010.t7GKAiX3041307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Aug 2015 20:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286832 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 20:10:45 -0000 Author: sbruno Date: Sun Aug 16 20:10:43 2015 New Revision: 286832 URL: https://svnweb.freebsd.org/changeset/base/286832 Log: e1000/if_lem.c bump to 1.1.0 - deprecate fbsd 8 Differential Revision: https://reviews.freebsd.org/D3164 Submitted by: erj MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sun Aug 16 19:43:44 2015 (r286831) +++ head/sys/dev/e1000/if_lem.c Sun Aug 16 20:10:43 2015 (r286832) @@ -97,7 +97,7 @@ /********************************************************************* * Legacy Em Driver version: *********************************************************************/ -char lem_driver_version[] = "1.0.6"; +char lem_driver_version[] = "1.1.0"; /********************************************************************* * PCI Device ID Table @@ -2913,10 +2913,6 @@ lem_free_transmit_structures(struct adap bus_dma_tag_destroy(adapter->txtag); adapter->txtag = NULL; } -#if __FreeBSD_version >= 800000 - if (adapter->br != NULL) - buf_ring_free(adapter->br, M_DEVBUF); -#endif } /********************************************************************* Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Sun Aug 16 19:43:44 2015 (r286831) +++ head/sys/dev/e1000/if_lem.h Sun Aug 16 20:10:43 2015 (r286832) @@ -296,9 +296,6 @@ struct em_int_delay_info { /* Our adapter structure */ struct adapter { if_t ifp; -#if __FreeBSD_version >= 800000 - struct buf_ring *br; -#endif struct e1000_hw hw; /* FreeBSD operating-system-specific structures. */ From owner-svn-src-head@freebsd.org Sun Aug 16 20:14:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38979BBCEB; Sun, 16 Aug 2015 20:14:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 922571A93; Sun, 16 Aug 2015 20:14:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GKEAbV045209; Sun, 16 Aug 2015 20:14:10 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GKDxfl045163; Sun, 16 Aug 2015 20:13:59 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508162013.t7GKDxfl045163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 16 Aug 2015 20:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286833 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 20:14:10 -0000 Author: sbruno Date: Sun Aug 16 20:13:58 2015 New Revision: 286833 URL: https://svnweb.freebsd.org/changeset/base/286833 Log: Bump all copywrite dates to 2015 Differential Revision: https://reviews.freebsd.org/D3160 Submitted by: erj MFC after: 2 weeks Sponsored by: Intel Corportation Modified: head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_80003es2lan.h head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82541.h head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82543.h head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82571.h head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_manage.h head/sys/dev/e1000/e1000_mbx.c head/sys/dev/e1000/e1000_mbx.h head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_osdep.c head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/e1000_vf.c head/sys/dev/e1000/e1000_vf.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_80003es2lan.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_80003es2lan.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82540.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82541.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82541.h ============================================================================== --- head/sys/dev/e1000/e1000_82541.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82541.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82542.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82543.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82543.h ============================================================================== --- head/sys/dev/e1000/e1000_82543.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82543.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82571.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82571.h ============================================================================== --- head/sys/dev/e1000/e1000_82571.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82571.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82575.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_82575.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_api.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_api.h ============================================================================== --- head/sys/dev/e1000/e1000_api.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_api.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_defines.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_hw.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_i210.c ============================================================================== --- head/sys/dev/e1000/e1000_i210.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_i210.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_i210.h ============================================================================== --- head/sys/dev/e1000/e1000_i210.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_i210.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_ich8lan.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_ich8lan.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_mac.c ============================================================================== --- head/sys/dev/e1000/e1000_mac.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_mac.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_mac.h ============================================================================== --- head/sys/dev/e1000/e1000_mac.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_mac.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_manage.c ============================================================================== --- head/sys/dev/e1000/e1000_manage.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_manage.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_manage.h ============================================================================== --- head/sys/dev/e1000/e1000_manage.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_manage.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_mbx.c ============================================================================== --- head/sys/dev/e1000/e1000_mbx.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_mbx.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_mbx.h ============================================================================== --- head/sys/dev/e1000/e1000_mbx.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_mbx.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_nvm.c ============================================================================== --- head/sys/dev/e1000/e1000_nvm.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_nvm.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_nvm.h ============================================================================== --- head/sys/dev/e1000/e1000_nvm.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_nvm.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_osdep.c ============================================================================== --- head/sys/dev/e1000/e1000_osdep.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_osdep.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_osdep.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_phy.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_phy.h ============================================================================== --- head/sys/dev/e1000/e1000_phy.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_phy.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_regs.h ============================================================================== --- head/sys/dev/e1000/e1000_regs.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_regs.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_vf.c ============================================================================== --- head/sys/dev/e1000/e1000_vf.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_vf.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_vf.h ============================================================================== --- head/sys/dev/e1000/e1000_vf.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/e1000_vf.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/if_igb.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/if_igb.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/if_lem.c Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Sun Aug 16 20:10:43 2015 (r286832) +++ head/sys/dev/e1000/if_lem.h Sun Aug 16 20:13:58 2015 (r286833) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Sun Aug 16 20:44:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A801E9BB03E; Sun, 16 Aug 2015 20:44:17 +0000 (UTC) (envelope-from sbruno@ignoranthack.me) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CEBC160D; Sun, 16 Aug 2015 20:44:17 +0000 (UTC) (envelope-from sbruno@ignoranthack.me) Received: from [192.168.200.200] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id DAA171928D6; Sun, 16 Aug 2015 20:44:15 +0000 (UTC) Reply-To: sbruno@freebsd.org Subject: Re: svn commit: r286832 - head/sys/dev/e1000 References: <201508162010.t7GKAiX3041307@repo.freebsd.org> To: svn-src-head@freebsd.org From: Sean Bruno Message-ID: <55D0F61F.2060503@ignoranthack.me> Date: Sun, 16 Aug 2015 13:44:15 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508162010.t7GKAiX3041307@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 20:44:17 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 08/16/15 13:10, Sean Bruno wrote: > Author: sbruno Date: Sun Aug 16 20:10:43 2015 New Revision: 286832 > URL: https://svnweb.freebsd.org/changeset/base/286832 > > Log: e1000/if_lem.c bump to 1.1.0 - deprecate fbsd 8 > > Differential Revision: https://reviews.freebsd.org/D3164 Submitted > by: erj MFC after: 2 weeks Sponsored by: Intel Corporation > > Modified: head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h > > Modified: head/sys/dev/e1000/if_lem.c > ====================================================================== ======== > > - --- head/sys/dev/e1000/if_lem.c Sun Aug 16 19:43:44 2015 (r286831) > +++ head/sys/dev/e1000/if_lem.c Sun Aug 16 20:10:43 2015 (r286832) > @@ -97,7 +97,7 @@ > /********************************************************************* > > * Legacy Em Driver version: > *********************************************************************/ > > - -char lem_driver_version[] = "1.0.6"; > +char lem_driver_version[] = "1.1.0"; > > /********************************************************************* > > * PCI Device ID Table > @@ -2913,10 +2913,6 @@ lem_free_transmit_structures(struct adap > bus_dma_tag_destroy(adapter->txtag); adapter->txtag = NULL; } -#if > __FreeBSD_version >= 800000 - if (adapter->br != NULL) - > buf_ring_free(adapter->br, M_DEVBUF); -#endif } > > /********************************************************************* > > Modified: head/sys/dev/e1000/if_lem.h > ====================================================================== ======== > > - --- head/sys/dev/e1000/if_lem.h Sun Aug 16 19:43:44 2015 (r286831) > +++ head/sys/dev/e1000/if_lem.h Sun Aug 16 20:10:43 2015 (r286832) > @@ -296,9 +296,6 @@ struct em_int_delay_info { /* Our adapter > structure */ struct adapter { if_t ifp; -#if __FreeBSD_version >= > 800000 - struct buf_ring *br; -#endif struct e1000_hw hw; > > /* FreeBSD operating-system-specific structures. */ > > Ugh, sorry for the confusion for some of you. This is removing a freebsd 8 conditional by deleting an unused element in the adapter data structure. This doesn't change the ability to build this driver under FreeBSD 8. sean -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJV0PYfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kACsH/0A0O9NeGOkwB592rx2uvyUI PTYfR6BPL7ddHHIN1ZMC9Qc1NdlhhleVACtOZd/NVlJxMSo8ITSPgF97UHIy7I7V e4njPkc7z7Z/3QR1CoNXdW/mneZDLaWVOhfdbhhUAXxNE4+z4Qje/LQy/LhA5r43 3DLo6Un6EfC0eerKWzuBL5cQaUHgArqZRTcI0UVyB91YggdJxin1GIbVjYVEnz/j amw0VbgQ59FKmQkJ5cpceO0SFE/sfHfl9qt31z7x3+fSbwdtEg8Mo6H/CaGaX6ZA pwFaEm7hUBYzhvbcSqwNL7KxT6wQEKAjHf4nD+iSwpfvmhtAD5QxjW+0CEzTa6I= =XQvh -----END PGP SIGNATURE----- From owner-svn-src-head@freebsd.org Sun Aug 16 23:23:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC5BD9B9C86; Sun, 16 Aug 2015 23:23:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDFA610D9; Sun, 16 Aug 2015 23:23:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GNNx77032243; Sun, 16 Aug 2015 23:23:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GNNxpt032240; Sun, 16 Aug 2015 23:23:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508162323.t7GNNxpt032240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 16 Aug 2015 23:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286834 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 23:24:00 -0000 Author: delphij Date: Sun Aug 16 23:23:58 2015 New Revision: 286834 URL: https://svnweb.freebsd.org/changeset/base/286834 Log: Use arc4random_buf(). While there, unifdef the code for HAVE_ARC4RANDOM. MFC after: 2 weeks Modified: head/sbin/ping6/Makefile head/sbin/ping6/ping6.c Modified: head/sbin/ping6/Makefile ============================================================================== --- head/sbin/ping6/Makefile Sun Aug 16 20:13:58 2015 (r286833) +++ head/sbin/ping6/Makefile Sun Aug 16 23:23:58 2015 (r286834) @@ -3,8 +3,7 @@ PROG= ping6 MAN= ping6.8 -CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS \ - -DHAVE_ARC4RANDOM +CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS WARNS?= 3 BINOWN= root Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sun Aug 16 20:13:58 2015 (r286833) +++ head/sbin/ping6/ping6.c Sun Aug 16 23:23:58 2015 (r286834) @@ -288,9 +288,6 @@ main(int argc, char *argv[]) { struct timeval last, intvl; struct sockaddr_in6 from, *sin6; -#ifndef HAVE_ARC4RANDOM - struct timeval seed; -#endif struct addrinfo hints, *res; struct sigaction si_sa; int cc, i; @@ -751,17 +748,7 @@ main(int argc, char *argv[]) *datap++ = i; ident = getpid() & 0xFFFF; -#ifndef HAVE_ARC4RANDOM - gettimeofday(&seed, NULL); - srand((unsigned int)(seed.tv_sec ^ seed.tv_usec ^ (long)ident)); - memset(nonce, 0, sizeof(nonce)); - for (i = 0; i < sizeof(nonce); i += sizeof(int)) - *((int *)&nonce[i]) = rand(); -#else - memset(nonce, 0, sizeof(nonce)); - for (i = 0; i < (int)sizeof(nonce); i += sizeof(u_int32_t)) - *((u_int32_t *)&nonce[i]) = arc4random(); -#endif + arc4random_buf(nonce, sizeof(nonce)); optval = 1; if (options & F_DONTFRAG) if (setsockopt(s, IPPROTO_IPV6, IPV6_DONTFRAG, From owner-svn-src-head@freebsd.org Mon Aug 17 02:04:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CB059B9A44; Mon, 17 Aug 2015 02:04:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C8971301; Mon, 17 Aug 2015 02:04:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H24CEs008894; Mon, 17 Aug 2015 02:04:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H24BL2008889; Mon, 17 Aug 2015 02:04:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508170204.t7H24BL2008889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Aug 2015 02:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286835 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 02:04:13 -0000 Author: adrian Date: Mon Aug 17 02:04:11 2015 New Revision: 286835 URL: https://svnweb.freebsd.org/changeset/base/286835 Log: Remove most of the references of ifp->if_softc and replace with references to ic->ic_softc. This is in preparation for gleb's ifnet work. Tested: * ath(4), STA mode * ath(4), hostap mode * make universe Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Aug 16 23:23:58 2015 (r286834) +++ head/sys/dev/ath/if_ath.c Mon Aug 17 02:04:11 2015 (r286835) @@ -1473,7 +1473,7 @@ ath_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_vap *avp; struct ieee80211vap *vap; uint8_t mac[IEEE80211_ADDR_LEN]; @@ -1732,7 +1732,7 @@ ath_vap_delete(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); @@ -2340,7 +2340,7 @@ ath_fatal_proc(void *arg, int pending) static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; /* * Workaround phantom bmiss interrupts by sanity-checking @@ -2361,8 +2361,6 @@ ath_bmiss_vap(struct ieee80211vap *vap) ATH_UNLOCK(sc); if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; u_int64_t lastrx = sc->sc_lastrx; u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); /* XXX should take a locked ref to iv_bss */ @@ -2851,8 +2849,8 @@ ath_stop(struct ifnet *ifp) int ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type) { - struct ath_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; int i; @@ -3045,7 +3043,7 @@ ath_reset_vap(struct ieee80211vap *vap, { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; switch (cmd) { @@ -3248,7 +3246,7 @@ static int ath_transmit(struct ifnet *ifp, struct mbuf *m) { struct ieee80211com *ic = ifp->if_l2com; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ieee80211_node *ni; struct mbuf *next; struct ath_buf *bf; @@ -3538,8 +3536,7 @@ ath_media_change(struct ifnet *ifp) static void ath_key_update_begin(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_block(sc->sc_tq); @@ -3548,8 +3545,7 @@ ath_key_update_begin(struct ieee80211vap static void ath_key_update_end(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_unblock(sc->sc_tq); @@ -4156,7 +4152,7 @@ static struct ieee80211_node * ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; struct ath_node *an; @@ -4183,7 +4179,7 @@ static void ath_node_cleanup(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4198,7 +4194,7 @@ static void ath_node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4210,7 +4206,7 @@ static void ath_node_getsignal(const struct ieee80211_node *ni, int8_t *rssi, int8_t *noise) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; *rssi = ic->ic_node_getrssi(ni); @@ -4422,7 +4418,7 @@ ath_txq_update(struct ath_softc *sc, int int ath_wme_update(struct ieee80211com *ic) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; return !ath_txq_update(sc, WME_AC_BE) || !ath_txq_update(sc, WME_AC_BK) || @@ -5797,7 +5793,7 @@ static void ath_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -5821,8 +5817,7 @@ ath_scan_start(struct ieee80211com *ic) static void ath_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -5862,8 +5857,7 @@ ath_scan_end(struct ieee80211com *ic) static void ath_update_chw(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; DPRINTF(sc, ATH_DEBUG_STATE, "%s: called\n", __func__); ath_set_channel(ic); @@ -5873,8 +5867,7 @@ ath_update_chw(struct ieee80211com *ic) static void ath_set_channel(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); @@ -5916,7 +5909,7 @@ static int ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_vap *avp = ATH_VAP(vap); struct ath_hal *ah = sc->sc_ah; struct ieee80211_node *ni = NULL; @@ -6252,7 +6245,7 @@ static void ath_setup_stationkey(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; ieee80211_keyix keyix, rxkeyix; /* XXX should take a locked ref to vap->iv_bss */ @@ -6285,7 +6278,7 @@ ath_newassoc(struct ieee80211_node *ni, { struct ath_node *an = ATH_NODE(ni); struct ieee80211vap *vap = ni->ni_vap; - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; const struct ieee80211_txparam *tp = ni->ni_txparms; an->an_mcastrix = ath_tx_findrix(sc, tp->mcastrate); @@ -6337,7 +6330,7 @@ static int ath_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *reg, int nchans, struct ieee80211_channel chans[]) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; @@ -6361,7 +6354,7 @@ static void ath_getradiocaps(struct ieee80211com *ic, int maxchans, int *nchans, struct ieee80211_channel chans[]) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; DPRINTF(sc, ATH_DEBUG_REGDOMAIN, "%s: use rd %u cc %d\n", @@ -6693,8 +6686,8 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, { #define IS_RUNNING(ifp) \ ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) - struct ath_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct ath_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *)data; const HAL_RATE_TABLE *rt; int error = 0; @@ -6864,7 +6857,7 @@ ath_node_powersave(struct ieee80211_node #ifdef ATH_SW_PSQ struct ath_node *an = ATH_NODE(ni); struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_vap *avp = ATH_VAP(ni->ni_vap); /* XXX and no TXQ locks should be held here */ @@ -6931,7 +6924,7 @@ ath_node_set_tim(struct ieee80211_node * { #ifdef ATH_SW_PSQ struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_node *an = ATH_NODE(ni); struct ath_vap *avp = ATH_VAP(ni->ni_vap); int changed = 0; @@ -7136,7 +7129,7 @@ ath_node_recv_pspoll(struct ieee80211_no struct ath_node *an; struct ath_vap *avp; struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; int tid; /* Just paranoia */ Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Sun Aug 16 23:23:58 2015 (r286834) +++ head/sys/dev/ath/if_ath_keycache.c Mon Aug 17 02:04:11 2015 (r286835) @@ -425,7 +425,7 @@ int ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) { - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; /* * Group key allocation must be handled specially for @@ -493,7 +493,7 @@ ath_key_alloc(struct ieee80211vap *vap, int ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) { - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; struct ath_hal *ah = sc->sc_ah; const struct ieee80211_cipher *cip = k->wk_cipher; u_int keyix = k->wk_keyix; @@ -538,7 +538,7 @@ int ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, const u_int8_t mac[IEEE80211_ADDR_LEN]) { - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; return ath_keyset(sc, vap, k, vap->iv_bss); } Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Aug 16 23:23:58 2015 (r286834) +++ head/sys/dev/ath/if_ath_rx.c Mon Aug 17 02:04:11 2015 (r286835) @@ -330,7 +330,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf) { struct ieee80211vap *vap = ni->ni_vap; - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; uint64_t tsf_beacon_old, tsf_beacon; uint64_t nexttbtt; int64_t tsf_delta; Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Sun Aug 16 23:23:58 2015 (r286834) +++ head/sys/dev/ath/if_ath_tdma.c Mon Aug 17 02:04:11 2015 (r286835) @@ -359,7 +359,7 @@ ath_tdma_update(struct ieee80211_node *n #define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; const HAL_RATE_TABLE *rt = sc->sc_currates; u_int64_t tsf, rstamp, nextslot, nexttbtt, nexttbtt_full; Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Aug 16 23:23:58 2015 (r286834) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 17 02:04:11 2015 (r286835) @@ -2341,7 +2341,7 @@ ath_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_buf *bf; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); int error = 0; @@ -5731,7 +5731,7 @@ int ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int dialogtoken, int baparamset, int batimeout) { - struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct ath_softc *sc = ni->ni_ic->ic_softc; int tid = tap->txa_tid; struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; @@ -5809,7 +5809,7 @@ int ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status, int code, int batimeout) { - struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct ath_softc *sc = ni->ni_ic->ic_softc; int tid = tap->txa_tid; struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; @@ -5856,7 +5856,7 @@ ath_addba_response(struct ieee80211_node void ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct ath_softc *sc = ni->ni_ic->ic_softc; int tid = tap->txa_tid; struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; @@ -5991,7 +5991,7 @@ void ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status) { - struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct ath_softc *sc = ni->ni_ic->ic_softc; int tid = tap->txa_tid; struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; @@ -6064,7 +6064,7 @@ void ath_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct ath_softc *sc = ni->ni_ic->ic_softc; int tid = tap->txa_tid; struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; From owner-svn-src-head@freebsd.org Mon Aug 17 05:53:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76AE9B9438; Mon, 17 Aug 2015 05:53:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7DCA1792; Mon, 17 Aug 2015 05:53:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H5rcDt007261; Mon, 17 Aug 2015 05:53:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H5rcSh007260; Mon, 17 Aug 2015 05:53:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508170553.t7H5rcSh007260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Aug 2015 05:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286836 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 05:53:38 -0000 Author: delphij Date: Mon Aug 17 05:53:37 2015 New Revision: 286836 URL: https://svnweb.freebsd.org/changeset/base/286836 Log: so_vnet is constant after creation and no locking is necessary, document this fact. (netmap have an assignment too but that socket object is on stack). MFC after: 2 weeks Modified: head/sys/sys/socketvar.h Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Mon Aug 17 02:04:11 2015 (r286835) +++ head/sys/sys/socketvar.h Mon Aug 17 05:53:37 2015 (r286836) @@ -78,7 +78,7 @@ struct socket { short so_state; /* (b) internal state flags SS_* */ int so_qstate; /* (e) internal state flags SQ_* */ void *so_pcb; /* protocol control block */ - struct vnet *so_vnet; /* network stack instance */ + struct vnet *so_vnet; /* (a) network stack instance */ struct protosw *so_proto; /* (a) protocol handle */ /* * Variables for connection queuing. From owner-svn-src-head@freebsd.org Mon Aug 17 05:56:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66249B94D8; Mon, 17 Aug 2015 05:56:42 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6EA31979; Mon, 17 Aug 2015 05:56:42 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H5ugFd007442; Mon, 17 Aug 2015 05:56:42 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H5ugQt007441; Mon, 17 Aug 2015 05:56:42 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201508170556.t7H5ugQt007441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 17 Aug 2015 05:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286837 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 05:56:42 -0000 Author: grehan Date: Mon Aug 17 05:56:41 2015 New Revision: 286837 URL: https://svnweb.freebsd.org/changeset/base/286837 Log: Add define for SATA Check-Power-Mode command, 0xe5. Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Mon Aug 17 05:53:37 2015 (r286836) +++ head/sys/sys/ata.h Mon Aug 17 05:56:41 2015 (r286837) @@ -399,6 +399,7 @@ struct ata_params { #define ATA_IDLE_CMD 0xe3 /* idle */ #define ATA_READ_BUFFER 0xe4 /* read buffer */ #define ATA_READ_PM 0xe4 /* read portmultiplier */ +#define ATA_CHECK_POWER_MODE 0xe5 /* device power mode */ #define ATA_SLEEP 0xe6 /* sleep */ #define ATA_FLUSHCACHE 0xe7 /* flush cache to disk */ #define ATA_WRITE_PM 0xe8 /* write portmultiplier */ From owner-svn-src-head@freebsd.org Mon Aug 17 05:59:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 111779B955D; Mon, 17 Aug 2015 05:59:37 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015871AFE; Mon, 17 Aug 2015 05:59:37 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H5xakY007594; Mon, 17 Aug 2015 05:59:36 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H5xaqW007593; Mon, 17 Aug 2015 05:59:36 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201508170559.t7H5xaqW007593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 17 Aug 2015 05:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286838 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 05:59:37 -0000 Author: grehan Date: Mon Aug 17 05:59:36 2015 New Revision: 286838 URL: https://svnweb.freebsd.org/changeset/base/286838 Log: Add simple (no-op) emulations for the CHECK_POWER_MODE, READ_VERIFY and READ_VERIFY_EXT commands. Reviewed by: mav Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon Aug 17 05:56:41 2015 (r286837) +++ head/usr.sbin/bhyve/pci_ahci.c Mon Aug 17 05:59:36 2015 (r286838) @@ -1687,11 +1687,17 @@ ahci_handle_cmd(struct ahci_port *p, int ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; + case ATA_CHECK_POWER_MODE: + cfis[12] = 0xff; /* always on */ + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + break; case ATA_STANDBY_CMD: case ATA_STANDBY_IMMEDIATE: case ATA_IDLE_CMD: case ATA_IDLE_IMMEDIATE: case ATA_SLEEP: + case ATA_READ_VERIFY: + case ATA_READ_VERIFY48: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; case ATA_ATAPI_IDENTIFY: From owner-svn-src-head@freebsd.org Mon Aug 17 07:36:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB9D9BAAD8; Mon, 17 Aug 2015 07:36:16 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC361314; Mon, 17 Aug 2015 07:36:16 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H7aGLl048095; Mon, 17 Aug 2015 07:36:16 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H7aD7L048079; Mon, 17 Aug 2015 07:36:13 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201508170736.t7H7aD7L048079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Mon, 17 Aug 2015 07:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286839 - in head: . share/man/man4 sys/conf sys/dev/random sys/modules sys/modules/random_fortuna sys/modules/random_other sys/modules/random_yarrow sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 07:36:16 -0000 Author: markm Date: Mon Aug 17 07:36:12 2015 New Revision: 286839 URL: https://svnweb.freebsd.org/changeset/base/286839 Log: Add DEV_RANDOM pseudo-option and use it to "include out" random(4) if desired. Retire randomdev_none.c and introduce random_infra.c for resident infrastructure. Completely stub out random(4) calls in the "without DEV_RANDOM" case. Add RANDOM_LOADABLE option to allow loadable Yarrow/Fortuna/LocallyWritten algorithm. Add a skeleton "other" algorithm framework for folks to add their own processing code. NIST, anyone? Retire the RANDOM_DUMMY option. Build modules for Yarrow, Fortuna and "other". Use atomics for the live entropy rate-tracking. Convert ints to bools for the 'seeded' logic. Move _write() function from the algorithm-specific areas to randomdev.c Get rid of reseed() function - it is unused. Tidy up the opt_*.h includes. Update documentation for random(4) modules. Fix test program (reviewers, please leave this). Differential Revision: https://reviews.freebsd.org/D3354 Reviewed by: wblock,delphij,jmg,bjk Approved by: so (/dev/random blanket) Added: head/sys/dev/random/other_algorithm.c (contents, props changed) head/sys/dev/random/other_algorithm.h (contents, props changed) head/sys/dev/random/random_infra.c (contents, props changed) head/sys/modules/random_fortuna/ head/sys/modules/random_fortuna/Makefile (contents, props changed) head/sys/modules/random_other/ head/sys/modules/random_other/Makefile (contents, props changed) head/sys/modules/random_yarrow/ head/sys/modules/random_yarrow/Makefile (contents, props changed) Deleted: head/sys/dev/random/randomdev_none.c Modified: head/UPDATING head/share/man/man4/random.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/random/fortuna.c head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_harvestq.h head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/dev/random/unit_test.c head/sys/dev/random/yarrow.c head/sys/modules/Makefile head/sys/sys/random.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Aug 17 05:59:36 2015 (r286838) +++ head/UPDATING Mon Aug 17 07:36:12 2015 (r286839) @@ -31,6 +31,21 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150817: + Kernel-loadable modules for the random(4) device are back. To use + them, the kernel must have + + device random + options RANDOM_LOADABLE + + kldload(8) can then be used to load random_fortuna.ko + or random_yarrow.ko. Please note that due to the indirect + function calls that the loadable modules need to provide, + the build-in variants will be slightly more efficient. + + The random(4) kernel option RANDOM_DUMMY has been retired due to + unpopularity. It was not all that useful anyway. + 20150813: The WITHOUT_ELFTOOLCHAIN_TOOLS src.conf(5) knob has been retired. Control over building the ELF Tool Chain tools is now provided by Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Mon Aug 17 05:59:36 2015 (r286838) +++ head/share/man/man4/random.4 Mon Aug 17 07:36:12 2015 (r286839) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2015 +.Dd August 17, 2015 .Dt RANDOM 4 .Os .Sh NAME @@ -31,6 +31,7 @@ .Nd the entropy device .Sh SYNOPSIS .Cd "device random" +.Cd "options RANDOM_LOADABLE" .Sh DESCRIPTION The .Nm @@ -133,15 +134,49 @@ The .Va kern.random.harvest.mask_bin and .Va kern.random.harvest.mask_symbolic -sysctl -can be used confirm -that your choices are correct. +sysctls +can be used to confirm +that the choices are correct. Note that disabled items in the latter item are listed in square brackets. See .Xr random_harvest 9 for more on the harvesting of entropy. +.Pp +When +.Cd "options RANDOM_LOADABLE" +is used, +the +.Pa /dev/random +device is not created +until an "algorithm module" +is loaded. +Two of these modules +are built by default, +.Em random_fortuna +and +.Em random_yarrow . +The +.Em random_yarrow +module is deprecated, +and will be removed in +.Fx 12. +Use of the Yarrow algorithm +is not encouraged, +but while still present +in the kernel source, +it can be selected with the +.Cd "options RANDOM_YARROW" +kernel option. +Note that these loadable modules +are slightly less efficient +than their compiled-in equivalents. +This is because some functions +must be locked against +load and unload events, +and also must be indirect calls +to allow for removal. .Sh RANDOMNESS The use of randomness in the field of computing is a rather subtle issue because randomness means @@ -294,7 +329,7 @@ It replaces the previous implementation, introduced in .Fx 5.0 . -The older -.Em Yarrow -algorithm remains available -as a compile-time fallback. +The Yarrow algorithm +is no longer supported +by its authors, +and is therefore deprecated. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/conf/NOTES Mon Aug 17 07:36:12 2015 (r286839) @@ -2981,9 +2981,10 @@ options MAXFILES=999 # Random number generator # Only ONE of the below two may be used; they are mutually exclusive. -# If neither is present, then the Fortuna algorithm is used. -options RANDOM_YARROW # Yarrow CSPRNG (old default) -#options RANDOM_DUMMY # Dummy CSPRNG that always blocks +# If neither is present, then the Fortuna algorithm is selected. +#options RANDOM_YARROW # Yarrow CSPRNG (old default) +#options RANDOM_LOADABLE # Allow the algorithm to be loaded as + # a module. # For developers. options RANDOM_DEBUG # Extra debugging messages Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/conf/files Mon Aug 17 07:36:12 2015 (r286839) @@ -550,14 +550,14 @@ crypto/des/des_ecb.c optional crypto | crypto/des/des_setkey.c optional crypto | ipsec | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ - ipsec | random random_yarrow | random !random_yarrow !random_dummy | wlan_ccmp -crypto/rijndael/rijndael-api-fst.c optional geom_bde | random random_yarrow | random !random_yarrow !random_dummy + ipsec | random !random_loadable | wlan_ccmp +crypto/rijndael/rijndael-api-fst.c optional geom_bde | random !random_loadable crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp crypto/sha1.c optional carp | crypto | ipsec | \ netgraph_mppc_encryption | sctp -crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ +crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random !random_loadable | \ sctp | zfs -crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random random_yarrow | random !random_yarrow !random_dummy | \ +crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random !random_loadable | \ sctp | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 @@ -2314,12 +2314,14 @@ rt2860.fw optional rt2860fw | ralfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" -dev/random/randomdev_none.c optional !random -dev/random/randomdev.c optional random -dev/random/random_harvestq.c optional random random_yarrow | random !random_dummy +dev/random/random_infra.c optional random +dev/random/random_harvestq.c optional random +dev/random/randomdev.c optional random random_yarrow | \ + random !random_yarrow !random_loadable dev/random/yarrow.c optional random random_yarrow -dev/random/fortuna.c optional random !random_yarrow !random_dummy -dev/random/hash.c optional random random_yarrow | random !random_dummy +dev/random/fortuna.c optional random !random_yarrow !random_loadable +dev/random/hash.c optional random random_yarrow | \ + random !random_yarrow !random_loadable dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/conf/options Mon Aug 17 07:36:12 2015 (r286839) @@ -711,6 +711,7 @@ DEV_PCI opt_pci.h DEV_PF opt_pf.h DEV_PFLOG opt_pf.h DEV_PFSYNC opt_pf.h +DEV_RANDOM opt_global.h DEV_SPLASH opt_splash.h DEV_VLAN opt_vlan.h @@ -946,13 +947,14 @@ RCTL opt_global.h # The DEBUG option is in global.h as the random harvesting # puts probes all over the place, and it makes little sense # to pollute these headers with an extra include. -# the DUMMY option is in global.h because it is used to -# turn off harvesting all over the kernel. -RANDOM_DEBUG opt_global.h +RANDOM_DEBUG opt_random.h # Which CSPRNG hashes we get. -# These are mutually exclusive. With neither, Fortuna is selected. -RANDOM_DUMMY opt_global.h +# If Yarrow is not chosen, Fortuna is selected. RANDOM_YARROW opt_random.h +# With this, no entropy processor is loaded, but the entropy +# harvesting infrastructure is present. This means an entropy +# processor may be loaded as a module. +RANDOM_LOADABLE opt_random.h # Intel em(4) driver EM_MULTIQUEUE opt_em.h Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/dev/random/fortuna.c Mon Aug 17 07:36:12 2015 (r286839) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #else /* !_KERNEL */ #include +#include #include #include #include @@ -124,9 +125,7 @@ static uint8_t zero_region[RANDOM_ZERO_B static void random_fortuna_pre_read(void); static void random_fortuna_read(uint8_t *, u_int); -static void random_fortuna_write(uint8_t *, u_int); -static void random_fortuna_reseed(void); -static int random_fortuna_seeded(void); +static bool random_fortuna_seeded(void); static void random_fortuna_process_event(struct harvest_event *); static void random_fortuna_init_alg(void *); static void random_fortuna_deinit_alg(void *); @@ -139,8 +138,6 @@ struct random_algorithm random_alg_conte .ra_deinit_alg = random_fortuna_deinit_alg, .ra_pre_read = random_fortuna_pre_read, .ra_read = random_fortuna_read, - .ra_write = random_fortuna_write, - .ra_reseed = random_fortuna_reseed, .ra_seeded = random_fortuna_seeded, .ra_event_processor = random_fortuna_process_event, .ra_poolcount = RANDOM_FORTUNA_NPOOLS, @@ -420,43 +417,7 @@ random_fortuna_read(uint8_t *buf, u_int RANDOM_RESEED_UNLOCK(); } -/* Internal function to hand external entropy to the PRNG. */ -void -random_fortuna_write(uint8_t *buf, u_int count) -{ - static u_int destination = 0; - struct harvest_event event; - struct randomdev_hash hash; - uint32_t entropy_data[RANDOM_KEYSIZE_WORDS], timestamp; - int i; - - /* Extra timing here is helpful to scrape scheduler timing entropy */ - randomdev_hash_init(&hash); - timestamp = (uint32_t)get_cyclecount(); - randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp)); - randomdev_hash_iterate(&hash, buf, count); - timestamp = (uint32_t)get_cyclecount(); - randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp)); - randomdev_hash_finish(&hash, entropy_data); - explicit_bzero(&hash, sizeof(hash)); - for (i = 0; i < RANDOM_KEYSIZE_WORDS; i += sizeof(event.he_entropy)/sizeof(event.he_entropy[0])) { - event.he_somecounter = (uint32_t)get_cyclecount(); - event.he_size = sizeof(event.he_entropy); - event.he_bits = event.he_size/8; - event.he_source = RANDOM_CACHED; - event.he_destination = destination++; /* Harmless cheating */ - memcpy(event.he_entropy, entropy_data + i, sizeof(event.he_entropy)); - random_fortuna_process_event(&event); - } - explicit_bzero(entropy_data, sizeof(entropy_data)); -} - -void -random_fortuna_reseed(void) -{ -} - -int +bool random_fortuna_seeded(void) { Added: head/sys/dev/random/other_algorithm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/other_algorithm.c Mon Aug 17 07:36:12 2015 (r286839) @@ -0,0 +1,209 @@ +/*- + * Copyright (c) 2015 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/*- + * This is a skeleton for folks who wish to build a loadable module + * containing an alternative entropy-processing algorithm for random(4). + * + * The functions below should be completed with the appropriate code, + * and the nearby yarrow.c and fortuna.c may be consulted for examples + * of working code. + * + * The author is willing to provide reasonable help to those wishing to + * write such a module for themselves. Please use the markm@ FreeBSD + * email address, and ensure that you are developing this on a suitably + * supported branch (This is currently 11-CURRENT, and will be no + * older than 11-STABLE in the future). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +static void random_other_pre_read(void); +static void random_other_read(uint8_t *, u_int); +static bool random_other_seeded(void); +static void random_other_process_event(struct harvest_event *); +static void random_other_init_alg(void *); +static void random_other_deinit_alg(void *); + +/* + * RANDOM_OTHER_NPOOLS is used when reading hardware random + * number sources to ensure that each pool gets one read sample + * per loop iteration. Yarrow has 2 such pools (FAST and SLOW), + * and fortuna has 32 (0-31). The RNG used prior to Yarrow and + * ported from Linux had just 1 pool. + */ +#define RANDOM_OTHER_NPOOLS 1 + +struct random_algorithm random_alg_context = { + .ra_ident = "other", + .ra_init_alg = random_other_init_alg, + .ra_deinit_alg = random_other_deinit_alg, + .ra_pre_read = random_other_pre_read, + .ra_read = random_other_read, + .ra_seeded = random_other_seeded, + .ra_event_processor = random_other_process_event, + .ra_poolcount = RANDOM_OTHER_NPOOLS, +}; + +/* Use a mutex to protect your reseed variables? */ +static mtx_t other_mtx; + +/* + * void random_other_init_alg(void *unused __unused) + * + * Do algorithm-specific initialisation here. + */ +void +random_other_init_alg(void *unused __unused) +{ + + RANDOM_RESEED_INIT_LOCK(); + /* + * Do set-up work here! + */ +} + +/* + * void random_other_deinit_alg(void *unused __unused) + * + * Do algorithm-specific deinitialisation here. + */ +static void +random_other_deinit_alg(void *unused __unused) +{ + + /* + * Do tear-down work here! + */ + RANDOM_RESEED_DEINIT_LOCK(); +} + +/* + * void random_other_pre_read(void) + * + * Do any pre-read preparation you need to. This will be called + * before >=1 calls to random_other_read() corresponding to one + * read(2). + * + * This routine will be called periodically while the generator is + * still blocked and a read is being attempted, giving you an + * opportunity to unblock. + */ +static void +random_other_pre_read(void) +{ + + RANDOM_RESEED_LOCK(); + /* + * Do pre-read housekeeping work here! + * You may use this as a chance to unblock the generator. + */ + RANDOM_RESEED_UNLOCK(); +} + +/* + * void random_other_read(uint8_t *buf, u_int count) + * + * Generate bytes of output into <*buf>. + * You may use the fact that will be a multiple of + * RANDOM_BLOCKSIZE for optimization purposes. + * + * This function will always be called with your generator + * unblocked and ready. If you are not ready to generate + * output here, then feel free to KASSERT() or panic(). + */ +static void +random_other_read(uint8_t *buf, u_int count) +{ + + RANDOM_RESEED_LOCK(); + /* + * Do random-number generation work here! + */ + RANDOM_RESEED_UNLOCK(); +} + +/* + * bool random_other_seeded(void) + * + * Return true if your generator is ready to generate + * output, and false otherwise. + */ +static bool +random_other_seeded(void) +{ + bool seeded = false; + + /* + * Find out if your generator is seeded here! + */ + return (seeded); +} + +/* + * void random_other_process_event(struct harvest_event *event) + * + * Process one stochastic event <*event> into your entropy + * processor. + * + * The structure of the event may change, so it is easier to + * just grab the whole thing into your accumulation system. + * You may pick-and-choose bits, but please don't complain + * when/if these change. + */ +static void +random_other_process_event(struct harvest_event *event) +{ + + RANDOM_RESEED_LOCK(); + /* + * Do entropy accumulation work here! + * You may use this as a chance to unblock the generator. + */ + RANDOM_RESEED_UNLOCK(); +} Added: head/sys/dev/random/other_algorithm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/other_algorithm.h Mon Aug 17 07:36:12 2015 (r286839) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2015 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/*- + * This is a skeleton for folks who wish to build a loadable module + * containing an alternative entropy-processing algorithm for random(4). + * + * The functions below should be completed with the appropriate code, + * and the nearby yarrow.c and fortuna.c may be consulted for examples + * of working code. + * + * The author is willing to provide reasonable help to those wishing to + * write such a module for themselves. Please use the markm@ FreeBSD + * email address, and ensure that you are developing this on a suitably + * supported branch (This is currently 11-CURRENT, and will be no + * older than 11-STABLE in the future). + */ + +#ifndef SYS_DEV_RANDOM_OTHER_H_INCLUDED +#define SYS_DEV_RANDOM_OTHER_H_INCLUDED + +#ifdef _KERNEL +typedef struct mtx mtx_t; +#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&other_mtx, "reseed mutex", NULL, MTX_DEF) +#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&other_mtx) +#define RANDOM_RESEED_LOCK(x) mtx_lock(&other_mtx) +#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&other_mtx) +#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) mtx_assert(&other_mtx, MA_OWNED) +#else +#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&other_mtx, mtx_plain) +#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&other_mtx) +#define RANDOM_RESEED_LOCK(x) mtx_lock(&other_mtx) +#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&other_mtx) +#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) +#endif + +#endif /* SYS_DEV_RANDOM_OTHER_H_INCLUDED */ Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/dev/random/random_harvestq.c Mon Aug 17 07:36:12 2015 (r286839) @@ -47,12 +47,21 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(RANDOM_LOADABLE) +#include +#include +#endif + +#include #include #include #include static void random_kthread(void); +static void random_sources_feed(void); + +static u_int read_rate; /* List for the dynamic sysctls */ static struct sysctl_ctx_list random_clist; @@ -66,7 +75,7 @@ static struct sysctl_ctx_list random_cli #define RANDOM_RING_MAX 1024 #define RANDOM_ACCUM_MAX 8 -/* 1 to let the kernel thread run, 0 to terminate */ +/* 1 to let the kernel thread run, 0 to terminate, -1 to mark completion */ volatile int random_kthread_control; /* @@ -123,13 +132,18 @@ static struct kproc_desc random_proc_kp &harvest_context.hc_kthread_proc, }; - /* Pass the given event straight through to Fortuna/Yarrow/Whatever. */ static __inline void random_harvestq_fast_process_event(struct harvest_event *event) { - if (random_alg_context.ra_event_processor) - random_alg_context.ra_event_processor(event); +#if defined(RANDOM_LOADABLE) + RANDOM_CONFIG_S_LOCK(); + if (p_random_alg_context) +#endif + p_random_alg_context->ra_event_processor(event); +#if defined(RANDOM_LOADABLE) + RANDOM_CONFIG_S_UNLOCK(); +#endif } static void @@ -163,12 +177,58 @@ random_kthread(void) /* XXX: FIX!! This is a *great* place to pass hardware/live entropy to random(9) */ tsleep_sbt(&harvest_context.hc_kthread_proc, 0, "-", SBT_1S/10, 0, C_PREL(1)); } + random_kthread_control = -1; wakeup(&harvest_context.hc_kthread_proc); kproc_exit(0); /* NOTREACHED */ } +/* This happens well after SI_SUB_RANDOM */ SYSINIT(random_device_h_proc, SI_SUB_CREATE_INIT, SI_ORDER_ANY, kproc_start, &random_proc_kp); +/* + * Run through all fast sources reading entropy for the given + * number of rounds, which should be a multiple of the number + * of entropy accumulation pools in use; 2 for Yarrow and 32 + * for Fortuna. + */ +static void +random_sources_feed(void) +{ + uint32_t entropy[HARVESTSIZE]; + struct random_sources *rrs; + u_int i, n, local_read_rate; + + /* + * Step over all of live entropy sources, and feed their output + * to the system-wide RNG. + */ +#if defined(RANDOM_LOADABLE) + RANDOM_CONFIG_S_LOCK(); + if (p_random_alg_context) { + /* It's an indenting error. Yeah, Yeah. */ +#endif + local_read_rate = atomic_readandclear_32(&read_rate); + LIST_FOREACH(rrs, &source_list, rrs_entries) { + for (i = 0; i < p_random_alg_context->ra_poolcount*(local_read_rate + 1); i++) { + n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); + KASSERT((n > 0 && n <= sizeof(entropy)), ("very bad return from rs_read (= %d) in %s", n, __func__)); + random_harvest_direct(entropy, n, (n*8)/2, rrs->rrs_source->rs_source); + } + } + explicit_bzero(entropy, sizeof(entropy)); +#if defined(RANDOM_LOADABLE) + } + RANDOM_CONFIG_S_UNLOCK(); +#endif +} + +void +read_rate_increment(u_int chunk) +{ + + atomic_add_32(&read_rate, chunk); +} + /* ARGSUSED */ RANDOM_CHECK_UINT(harvestmask, 0, RANDOM_HARVEST_EVERYTHING_MASK); @@ -317,7 +377,8 @@ random_harvestq_deinit(void *unused __un /* Command the hash/reseed thread to end and wait for it to finish */ random_kthread_control = 0; - tsleep(&harvest_context.hc_kthread_proc, 0, "harvqterm", 0); + while (random_kthread_control >= 0) + tsleep(&harvest_context.hc_kthread_proc, 0, "harvqterm", hz/5); sysctl_ctx_free(&random_clist); } SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_SECOND, random_harvestq_deinit, NULL); @@ -412,3 +473,5 @@ random_harvest_direct(const void *entrop random_harvestq_fast_process_event(&event); explicit_bzero(&event, sizeof(event)); } + +MODULE_VERSION(random_harvestq, 1); Modified: head/sys/dev/random/random_harvestq.h ============================================================================== --- head/sys/dev/random/random_harvestq.h Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/dev/random/random_harvestq.h Mon Aug 17 07:36:12 2015 (r286839) @@ -43,6 +43,8 @@ struct harvest_event { uint8_t he_source; /* origin of the entropy */ } __packed; +void read_rate_increment(u_int); + #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" #define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN) Added: head/sys/dev/random/random_infra.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/random_infra.c Mon Aug 17 07:36:12 2015 (r286839) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2015 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#if defined(RANDOM_LOADABLE) +#include +#include +#endif + +#include + +/* Set up the sysctl root node for the entropy device */ +SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, "Cryptographically Secure Random Number Generator"); + +MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data structures"); + +struct sources_head source_list = LIST_HEAD_INITIALIZER(source_list); + +#if defined(RANDOM_LOADABLE) +struct random_algorithm *p_random_alg_context = NULL; +#else /* !defined(RANDOM_LOADABLE) */ +struct random_algorithm *p_random_alg_context = &random_alg_context; +#endif /* defined(RANDOM_LOADABLE) */ + +#if defined(RANDOM_LOADABLE) + +struct random_readers { + int (*read_random_uio)(struct uio *, bool); + u_int (*read_random)(void *, u_int); +} random_reader_context = { + (int (*)(struct uio *, bool))nullop, + (u_int (*)(void *, u_int))nullop, +}; + +struct sx randomdev_config_lock; + +static void +random_infra_sysinit(void *dummy __unused) +{ + + RANDOM_CONFIG_INIT_LOCK(); +} +SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_FIRST, random_infra_sysinit, NULL); + +void +random_infra_init(int (*p_random_read_uio)(struct uio *, bool), u_int (*p_random_read)(void *, u_int)) +{ + + RANDOM_CONFIG_X_LOCK(); + random_reader_context.read_random_uio = p_random_read_uio; + random_reader_context.read_random = p_random_read; + RANDOM_CONFIG_X_UNLOCK(); +} + +void +random_infra_uninit(void) +{ + + RANDOM_CONFIG_X_LOCK(); + random_reader_context.read_random_uio = (int (*)(struct uio *, bool))nullop; + random_reader_context.read_random = (u_int (*)(void *, u_int))nullop; + RANDOM_CONFIG_X_UNLOCK(); +} + +static void +random_infra_sysuninit(void *dummy __unused) +{ + + RANDOM_CONFIG_DEINIT_LOCK(); +} +SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_FIRST, random_infra_sysuninit, NULL); + +int +read_random_uio(struct uio *uio, bool nonblock) +{ + int retval; + + RANDOM_CONFIG_S_LOCK(); + retval = random_reader_context.read_random_uio(uio, nonblock); + RANDOM_CONFIG_S_UNLOCK(); + return (retval); +} + +u_int +read_random(void *buf, u_int len) +{ + u_int retval; + + RANDOM_CONFIG_S_LOCK(); + retval = random_reader_context.read_random(buf, len); + RANDOM_CONFIG_S_UNLOCK(); + return (retval); +} + +#endif /* defined(RANDOM_LOADABLE) */ Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Mon Aug 17 05:59:36 2015 (r286838) +++ head/sys/dev/random/randomdev.c Mon Aug 17 07:36:12 2015 (r286839) @@ -56,14 +56,18 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_random.h" +#define RANDOM_UNIT 0 -#if defined(RANDOM_DUMMY) && defined(RANDOM_YARROW) -#error "Cannot define both RANDOM_DUMMY and RANDOM_YARROW" +#if defined(RANDOM_LOADABLE) +#define READ_RANDOM_UIO _read_random_uio +#define READ_RANDOM _read_random +static int READ_RANDOM_UIO(struct uio *, bool); +static u_int READ_RANDOM(void *, u_int); +#else +#define READ_RANDOM_UIO read_random_uio +#define READ_RANDOM read_random #endif -#define RANDOM_UNIT 0 - /* Return the largest number >= x that is a multiple of m */ #define CEIL_TO_MULTIPLE(x, m) ((((x) + (m) - 1)/(m))*(m)) @@ -84,68 +88,31 @@ static struct cdevsw random_cdevsw = { /* For use with make_dev(9)/destroy_dev(9). */ static struct cdev *random_dev; -/* Set up the sysctl root node for the entropy device */ -SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, "Cryptographically Secure Random Number Generator"); - -MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data structures"); - -#if defined(RANDOM_DUMMY) - -/*- - * Dummy "always block" pseudo algorithm, used when there is no real - * random(4) driver to provide a CSPRNG. - */ - -static u_int -dummy_random_zero(void) -{ - - return (0); -} - -static void -dummy_random(void) -{ -} - -struct random_algorithm random_alg_context = { - .ra_ident = "Dummy", - .ra_init_alg = NULL, - .ra_deinit_alg = NULL, - .ra_pre_read = dummy_random, - .ra_read = (random_alg_read_t *)dummy_random_zero, - .ra_write = (random_alg_write_t *)dummy_random_zero, - .ra_reseed = dummy_random, - .ra_seeded = (random_alg_seeded_t *)dummy_random_zero, - .ra_event_processor = NULL, - .ra_poolcount = 0, -}; - -#else /* !defined(RANDOM_DUMMY) */ - -LIST_HEAD(sources_head, random_sources); -static struct sources_head source_list = LIST_HEAD_INITIALIZER(source_list); -static u_int read_rate; - static void random_alg_context_ra_init_alg(void *data) { - random_alg_context.ra_init_alg(data); + p_random_alg_context = &random_alg_context; + p_random_alg_context->ra_init_alg(data); +#if defined(RANDOM_LOADABLE) + random_infra_init(READ_RANDOM_UIO, READ_RANDOM); +#endif } static void random_alg_context_ra_deinit_alg(void *data) { - random_alg_context.ra_deinit_alg(data); +#if defined(RANDOM_LOADABLE) + random_infra_uninit(); +#endif + p_random_alg_context->ra_deinit_alg(data); + p_random_alg_context = NULL; } SYSINIT(random_device, SI_SUB_RANDOM, SI_ORDER_THIRD, random_alg_context_ra_init_alg, NULL); SYSUNINIT(random_device, SI_SUB_RANDOM, SI_ORDER_THIRD, random_alg_context_ra_deinit_alg, NULL); -#endif /* defined(RANDOM_DUMMY) */ - static struct selinfo rsel; /* @@ -156,28 +123,28 @@ static int randomdev_read(struct cdev *dev __unused, struct uio *uio, int flags) { - return (read_random_uio(uio, (flags & O_NONBLOCK) != 0)); + return (READ_RANDOM_UIO(uio, (flags & O_NONBLOCK) != 0)); } int -read_random_uio(struct uio *uio, bool nonblock) +READ_RANDOM_UIO(struct uio *uio, bool nonblock) { uint8_t *random_buf; int error, spamcount; ssize_t read_len, total_read, c; random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); - random_alg_context.ra_pre_read(); + p_random_alg_context->ra_pre_read(); error = 0; spamcount = 0; /* (Un)Blocking logic */ - while (!random_alg_context.ra_seeded()) { + while (!p_random_alg_context->ra_seeded()) { if (nonblock) { error = EWOULDBLOCK; break; } /* keep tapping away at the pre-read until we seed/unblock. */ - random_alg_context.ra_pre_read(); + p_random_alg_context->ra_pre_read(); /* Only bother the console every 10 seconds or so */ if (spamcount == 0) printf("random: %s unblock wait\n", __func__); @@ -187,10 +154,7 @@ read_random_uio(struct uio *uio, bool no break; } if (error == 0) { -#if !defined(RANDOM_DUMMY) - /* XXX: FIX!! Next line as an atomic operation? */ - read_rate += (uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t); -#endif + read_rate_increment((uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t)); total_read = 0; while (uio->uio_resid && !error) { read_len = uio->uio_resid; @@ -203,7 +167,7 @@ read_random_uio(struct uio *uio, bool no read_len = CEIL_TO_MULTIPLE(read_len, RANDOM_BLOCKSIZE); /* Work in chunks page-sized or less */ read_len = MIN(read_len, PAGE_SIZE); - random_alg_context.ra_read(random_buf, read_len); + p_random_alg_context->ra_read(random_buf, read_len); c = MIN(uio->uio_resid, read_len); error = uiomove(random_buf, c, uio); total_read += c; @@ -224,19 +188,16 @@ read_random_uio(struct uio *uio, bool no * RANDOM_BLOCKSIZE bytes. */ u_int -read_random(void *random_buf, u_int len) +READ_RANDOM(void *random_buf, u_int len) { u_int read_len; uint8_t local_buf[len + RANDOM_BLOCKSIZE]; KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); - random_alg_context.ra_pre_read(); + p_random_alg_context->ra_pre_read(); /* (Un)Blocking logic; if not seeded, return nothing. */ - if (random_alg_context.ra_seeded()) { -#if !defined(RANDOM_DUMMY) - /* XXX: FIX!! Next line as an atomic operation? */ - read_rate += (len + sizeof(uint32_t))/sizeof(uint32_t); -#endif + if (p_random_alg_context->ra_seeded()) { + read_rate_increment((len + sizeof(uint32_t))/sizeof(uint32_t)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 17 09:18:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 244EC9BB58B; Mon, 17 Aug 2015 09:18:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 158D71FF8; Mon, 17 Aug 2015 09:18:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7H9Is8K090677; Mon, 17 Aug 2015 09:18:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7H9IsDd090676; Mon, 17 Aug 2015 09:18:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508170918.t7H9IsDd090676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Aug 2015 09:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286840 - head/usr.sbin/wlandebug X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 09:18:55 -0000 Author: glebius Date: Mon Aug 17 09:18:54 2015 New Revision: 286840 URL: https://svnweb.freebsd.org/changeset/base/286840 Log: Belatedly fix documentation on which interface to use as argument. Modified: head/usr.sbin/wlandebug/wlandebug.8 Modified: head/usr.sbin/wlandebug/wlandebug.8 ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.8 Mon Aug 17 07:36:12 2015 (r286839) +++ head/usr.sbin/wlandebug/wlandebug.8 Mon Aug 17 09:18:54 2015 (r286840) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2009 +.Dd August 17, 2015 .Dt WLANDEBUG 8 .Os .Sh NAME @@ -45,7 +45,7 @@ Running .Nm without any options will display the current messages enabled for the specified network interface -(by default, ``ath0'). +(by default, ``wlan0'). The default debugging level for new interfaces can be set by specifying the .Fl d @@ -148,7 +148,7 @@ trace transmit rate control operation. .Sh EXAMPLES The following might be used to debug basic station mode operation: .Pp -.Dl "wlandebug -i ral0 scan+auth+assoc" +.Dl "wlandebug -i wlan1 scan+auth+assoc" .Pp it enables debug messages while scanning, authenticating to an access point, and associating to an access point. From owner-svn-src-head@freebsd.org Mon Aug 17 09:59:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE479BBFAF; Mon, 17 Aug 2015 09:59:05 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA746116F; Mon, 17 Aug 2015 09:59:04 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wicja10 with SMTP id ja10so75954105wic.1; Mon, 17 Aug 2015 02:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=AssXDGRqTc1y2uGrcTIOYaA2ZLrUqZ9RCOy37LIH57w=; b=WKzSx/HXAaRY8AZFHCrJJ1vKH9e/hg76wj99qxO2oMVKL3MbWe789IpCPo7zsz7MBX L+Q+I1TmtQb6ywc/an4KC8KYt6f/4tbJCtnM2H/YG3CNfstPALEbCMxskaaEKPSxQZmB SWRG7AHuiouPDLkpl1P7KzTIQ8nlkMp6zhXIxvJaILOC8fXp09gd91v4hT5ZU2woy3OH DgFMS9we/uSEYZVkimTQAxWNerGVasdW8h+AKC84hhcpIaGZiBFrMGSyJDqEEXlsnfav K71OPx+acK2uROvSlf+u5O94dQgSziCN5UxTYhV/GXBJ/tBK5z+afbeus7IuBCT06wbw T0+Q== X-Received: by 10.194.24.196 with SMTP id w4mr1022073wjf.137.1439805542424; Mon, 17 Aug 2015 02:59:02 -0700 (PDT) Received: from [172.16.1.30] (5.Red-79-156-191.staticIP.rima-tde.net. [79.156.191.5]) by smtp.gmail.com with ESMTPSA id j7sm21121819wjz.11.2015.08.17.02.59.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 02:59:01 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <55D1B05F.8040101@FreeBSD.org> Date: Mon, 17 Aug 2015 11:58:55 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Konstantin Belousov CC: Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286787 - head/sys/x86/x86 References: <201508142008.t7EK8Hkt037329@repo.freebsd.org> <55CF390F.5010407@FreeBSD.org> <55CF5B13.1040501@gmail.com> <55D046F5.60601@FreeBSD.org> <20150816090358.GW2072@kib.kiev.ua> <20150816095004.GX2072@kib.kiev.ua> In-Reply-To: <20150816095004.GX2072@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 09:59:05 -0000 El 16/08/15 a les 11.50, Konstantin Belousov ha escrit: > On Sun, Aug 16, 2015 at 12:03:58PM +0300, Konstantin Belousov wrote: >> On Sun, Aug 16, 2015 at 10:16:53AM +0200, Roger Pau Monn?? wrote: >>> pmap_map_io_transient contains some of this logic, but it uses >>> vmem_alloc (with M_WAITOK) instead of a pcpu pageframe, which defeats >>> part of the purpose of this change and cannot be used as-is. >> >> This logic can be repeated, but it is probably too much for the purpose. >> It would be enough to have single frame (we cannot reuse CMAP1), >> protected by a spin mutex. I do not see much sense in providing >> optimized per-cpu frames for this case. > > Like this. I only compiled the patch. Thanks, yes, this looks right. Since this is only used for the bounce buffer code I don't think it's necessary to have a per-cpu frame. If the usage of this function is expanded I might look into adding a per-cpu frame. Roger. From owner-svn-src-head@freebsd.org Mon Aug 17 10:47:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33F2D9BBE63; Mon, 17 Aug 2015 10:47:11 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDB621EFC; Mon, 17 Aug 2015 10:47:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wibhh20 with SMTP id hh20so77270144wib.0; Mon, 17 Aug 2015 03:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a8gMdMccg+5/rFQt2/CV9sfW8A5Jv07k6lNFj8LgZpE=; b=d8AobN0SqQnpoHqzOaVErc5ce29X0pMSPopW991iW+8m8BZvCav44BGwIQUwusWC8a l93hOwkq1Q1xtlBVXhfglH9nNP72UcxrN+32IxWgInlmuM5cdVDTCHbZrjstHz2jEuAM 3hTYM1+weX2Hj6Ok1mrhwbAfrf9FfieAsHKTbcuWVUOmyFAeWfmaNQo4CPDkY53LZmwt 4YXDTVQsZxva04n3JoVGx9uTUZuLnp39jvBdHxCdaMBEqBtk8q1lIEmD1ji1e7imFNvD BStW6VF8rzLA1TBEVwtIaB71xgyZe5r44+XY0giPv6wAAoUWSkEMGF+LGETQHBaB7I7L 41rA== X-Received: by 10.194.78.84 with SMTP id z20mr1422028wjw.141.1439808429044; Mon, 17 Aug 2015 03:47:09 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id k4sm16154541wix.19.2015.08.17.03.47.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 03:47:08 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 17 Aug 2015 12:47:06 +0200 From: Baptiste Daroussin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286840 - head/usr.sbin/wlandebug Message-ID: <20150817104706.GE68726@ivaldir.etoilebsd.net> References: <201508170918.t7H9IsDd090676@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline In-Reply-To: <201508170918.t7H9IsDd090676@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 10:47:11 -0000 --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 17, 2015 at 09:18:54AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Aug 17 09:18:54 2015 > New Revision: 286840 > URL: https://svnweb.freebsd.org/changeset/base/286840 >=20 > Log: > Belatedly fix documentation on which interface to use as argument. >=20 > Modified: > head/usr.sbin/wlandebug/wlandebug.8 >=20 > Modified: head/usr.sbin/wlandebug/wlandebug.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/wlandebug/wlandebug.8 Mon Aug 17 07:36:12 2015 (r286839) > +++ head/usr.sbin/wlandebug/wlandebug.8 Mon Aug 17 09:18:54 2015 (r286840) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 17, 2009 > +.Dd August 17, 2015 > .Dt WLANDEBUG 8 > .Os > .Sh NAME > @@ -45,7 +45,7 @@ Running > .Nm > without any options will display the current messages > enabled for the specified network interface > -(by default, ``ath0'). > +(by default, ``wlan0'). > The default debugging level for new interfaces can be set > by specifying the > .Fl d > @@ -148,7 +148,7 @@ trace transmit rate control operation. > .Sh EXAMPLES > The following might be used to debug basic station mode operation: > .Pp > -.Dl "wlandebug -i ral0 scan+auth+assoc" > +.Dl "wlandebug -i wlan1 scan+auth+assoc" You meant wlan0 ? (even if wlan1 is valid you probably meant wlan0 :)) Best regards, Bapt --10jrOL3x2xqLmOsH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXRu6oACgkQ8kTtMUmk6ExeeQCgrL5s9N6yS2K3UoM3dEbGdihx zkkAoLMYyVsZL49t1RCenIRDujk0XItf =NSTK -----END PGP SIGNATURE----- --10jrOL3x2xqLmOsH-- From owner-svn-src-head@freebsd.org Mon Aug 17 10:48:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B46A9BBEB8; Mon, 17 Aug 2015 10:48:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69FA1086; Mon, 17 Aug 2015 10:48:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HAmuHL031902; Mon, 17 Aug 2015 10:48:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HAmuAi031899; Mon, 17 Aug 2015 10:48:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508171048.t7HAmuAi031899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Aug 2015 10:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286842 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 10:48:57 -0000 Author: emaste Date: Mon Aug 17 10:48:55 2015 New Revision: 286842 URL: https://svnweb.freebsd.org/changeset/base/286842 Log: Separate ELFTOOLCHAIN_BOOTSTRAP from BINUTILS_BOOTSTRAP For most cases they are equivalent, but BINUTILS_BOOTSTRAP is a BROKEN_OPTION on arm64 as the in-tree GNU binutils do not support it, so we need a separate internal flag for ELF Tool Chain. Reviewed by: andrew, brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3381 Modified: head/Makefile.inc1 head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 17 10:03:23 2015 (r286841) +++ head/Makefile.inc1 Mon Aug 17 10:48:55 2015 (r286842) @@ -1493,6 +1493,8 @@ _btxld= usr.sbin/btxld .if ${XAS:M/*} == "" .if ${MK_BINUTILS_BOOTSTRAP} != "no" _binutils= gnu/usr.bin/binutils +.endif +.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" _elftctools= lib/libelftc \ usr.bin/elfcopy \ usr.bin/nm \ @@ -1502,7 +1504,7 @@ _elftctools= lib/libelftc \ # cross-build on a FreeBSD 10 host: _elftctools+= usr.bin/addr2line .endif -.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_BINUTILS_BOOTSTRAP} != "no" +.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" # If cross-building with an external binutils we still need to build strip for # the target (for at least crunchide). _elftctools= lib/libelftc \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Aug 17 10:03:23 2015 (r286841) +++ head/share/mk/src.opts.mk Mon Aug 17 10:48:55 2015 (r286842) @@ -80,6 +80,7 @@ __DEFAULT_YES_OPTIONS = \ DYNAMICROOT \ ED_CRYPTO \ EE \ + ELFTOOLCHAIN_BOOTSTRAP \ EXAMPLES \ FDT \ FILE \ @@ -328,6 +329,7 @@ MK_GROFF:= no .if ${MK_CROSS_COMPILER} == "no" MK_BINUTILS_BOOTSTRAP:= no MK_CLANG_BOOTSTRAP:= no +MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_GCC_BOOTSTRAP:= no .endif From owner-svn-src-head@freebsd.org Mon Aug 17 12:47:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EB99B9DD4; Mon, 17 Aug 2015 12:47:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D66451257; Mon, 17 Aug 2015 12:47:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t7HClNQK023475 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Aug 2015 15:47:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t7HClN4a023474; Mon, 17 Aug 2015 15:47:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 17 Aug 2015 15:47:23 +0300 From: Gleb Smirnoff To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286840 - head/usr.sbin/wlandebug Message-ID: <20150817124723.GJ75813@FreeBSD.org> References: <201508170918.t7H9IsDd090676@repo.freebsd.org> <20150817104706.GE68726@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150817104706.GE68726@ivaldir.etoilebsd.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 12:47:27 -0000 On Mon, Aug 17, 2015 at 12:47:06PM +0200, Baptiste Daroussin wrote: B> > @@ -24,7 +24,7 @@ B> > .\" B> > .\" $FreeBSD$ B> > .\" B> > -.Dd July 17, 2009 B> > +.Dd August 17, 2015 B> > .Dt WLANDEBUG 8 B> > .Os B> > .Sh NAME B> > @@ -45,7 +45,7 @@ Running B> > .Nm B> > without any options will display the current messages B> > enabled for the specified network interface B> > -(by default, ``ath0'). B> > +(by default, ``wlan0'). B> > The default debugging level for new interfaces can be set B> > by specifying the B> > .Fl d B> > @@ -148,7 +148,7 @@ trace transmit rate control operation. B> > .Sh EXAMPLES B> > The following might be used to debug basic station mode operation: B> > .Pp B> > -.Dl "wlandebug -i ral0 scan+auth+assoc" B> > +.Dl "wlandebug -i wlan1 scan+auth+assoc" B> B> You meant wlan0 ? (even if wlan1 is valid you probably meant wlan0 :)) No, it intentonally is wlan1. The utility has "wlan0" hardcoded, so -i is used to specify something different from wlan0. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Aug 17 13:07:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9D039BAE48; Mon, 17 Aug 2015 13:07:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85FB01A7E; Mon, 17 Aug 2015 13:07:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HD7Dvx000607; Mon, 17 Aug 2015 13:07:13 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HD7D2a000606; Mon, 17 Aug 2015 13:07:13 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508171307.t7HD7D2a000606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 17 Aug 2015 13:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286844 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 13:07:13 -0000 Author: ed Date: Mon Aug 17 13:07:12 2015 New Revision: 286844 URL: https://svnweb.freebsd.org/changeset/base/286844 Log: Don't forget to invoke pre_execve() and post_execve(). CloudABI's proc_exec() was implemented before r282708 introduced pre_execve() and post_execve(). Sync up by adding these missing calls. Modified: head/sys/compat/cloudabi/cloudabi_proc.c Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Mon Aug 17 12:51:46 2015 (r286843) +++ head/sys/compat/cloudabi/cloudabi_proc.c Mon Aug 17 13:07:12 2015 (r286844) @@ -46,14 +46,19 @@ cloudabi_sys_proc_exec(struct thread *td struct cloudabi_sys_proc_exec_args *uap) { struct image_args args; + struct vmspace *oldvmspace; int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = exec_copyin_data_fds(td, &args, uap->data, uap->datalen, uap->fds, uap->fdslen); if (error == 0) { args.fd = uap->fd; error = kern_execve(td, &args, NULL); } + post_execve(td, error, oldvmspace); return (error); } From owner-svn-src-head@freebsd.org Mon Aug 17 16:51:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4F8B9BB024; Mon, 17 Aug 2015 16:51:38 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8976A1F17; Mon, 17 Aug 2015 16:51:38 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HGpcjN026128; Mon, 17 Aug 2015 16:51:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HGpcLc026127; Mon, 17 Aug 2015 16:51:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508171651.t7HGpcLc026127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 17 Aug 2015 16:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286845 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 16:51:38 -0000 Author: loos Date: Mon Aug 17 16:51:37 2015 New Revision: 286845 URL: https://svnweb.freebsd.org/changeset/base/286845 Log: Fix a few bugs when gpiobus is detaching: - Detach the gpiobus and the gpioc devices from the GPIO controller. - Fix the leak of gpiobus IRQ rman(9) region descriptor. - Fix the leak of child ivars and IRQ resource list. While here return NULL (instead of 0) for a device_t that fails to allocate the ivar memory. Tested with gpiobus built as a module. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Mon Aug 17 13:07:12 2015 (r286844) +++ head/sys/dev/gpio/gpiobus.c Mon Aug 17 16:51:37 2015 (r286845) @@ -155,12 +155,16 @@ gpiobus_attach_bus(device_t dev) int gpiobus_detach_bus(device_t dev) { + int err; #ifdef FDT ofw_gpiobus_unregister_provider(dev); #endif + err = bus_generic_detach(dev); + if (err != 0) + return (err); - return (bus_generic_detach(dev)); + return (device_delete_children(dev)); } int @@ -338,11 +342,14 @@ gpiobus_detach(device_t dev) if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) return (err); for (i = 0; i < ndevs; i++) { - device_delete_child(dev, devlist[i]); devi = GPIOBUS_IVAR(devlist[i]); gpiobus_free_ivars(devi); + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); + device_delete_child(dev, devlist[i]); } free(devlist, M_TEMP); + rman_fini(&sc->sc_intr_rman); if (sc->sc_pins) { for (i = 0; i < sc->sc_npins; i++) { if (sc->sc_pins[i].name != NULL) @@ -442,7 +449,7 @@ gpiobus_add_child(device_t dev, u_int or devi = malloc(sizeof(struct gpiobus_ivar), M_DEVBUF, M_NOWAIT | M_ZERO); if (devi == NULL) { device_delete_child(dev, child); - return (0); + return (NULL); } resource_list_init(&devi->rl); device_set_ivars(child, devi); @@ -461,8 +468,11 @@ gpiobus_hinted_child(device_t bus, const child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = GPIOBUS_IVAR(child); resource_int_value(dname, dunit, "pins", &pins); - if (gpiobus_parse_pins(sc, child, pins)) + if (gpiobus_parse_pins(sc, child, pins)) { + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); device_delete_child(bus, child); + } if (resource_int_value(dname, dunit, "irq", &irq) == 0) { if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) device_printf(bus, From owner-svn-src-head@freebsd.org Mon Aug 17 17:01:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CB799BB2C8; Mon, 17 Aug 2015 17:01:27 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E51A133E; Mon, 17 Aug 2015 17:01:27 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HH1QLc030907; Mon, 17 Aug 2015 17:01:26 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HH1QPC030905; Mon, 17 Aug 2015 17:01:26 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508171701.t7HH1QPC030905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 17 Aug 2015 17:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286846 - head/sys/modules/gpio/gpiobus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 17:01:27 -0000 Author: loos Date: Mon Aug 17 17:01:26 2015 New Revision: 286846 URL: https://svnweb.freebsd.org/changeset/base/286846 Log: Fix the build of gpiobus as a module. Add the missing newbus interfaces and gpioc, which is part of basic gpiobus framework. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/modules/gpio/gpiobus/Makefile Modified: head/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- head/sys/modules/gpio/gpiobus/Makefile Mon Aug 17 16:51:37 2015 (r286845) +++ head/sys/modules/gpio/gpiobus/Makefile Mon Aug 17 17:01:26 2015 (r286846) @@ -32,8 +32,9 @@ .PATH: ${.CURDIR}/../../../dev/gpio/ KMOD= gpiobus -SRCS= gpiobus.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h +SRCS= gpiobus.c gpioc.c +SRCS+= gpio_if.c gpio_if.h gpiobus_if.c gpiobus_if.h +SRCS+= device_if.h bus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ From owner-svn-src-head@freebsd.org Mon Aug 17 17:09:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9A119BB44C; Mon, 17 Aug 2015 17:09:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D329A19B4; Mon, 17 Aug 2015 17:09:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HH9vdw032643; Mon, 17 Aug 2015 17:09:57 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HH9vWI032642; Mon, 17 Aug 2015 17:09:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508171709.t7HH9vWI032642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 17 Aug 2015 17:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286847 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 17:09:58 -0000 Author: loos Date: Mon Aug 17 17:09:57 2015 New Revision: 286847 URL: https://svnweb.freebsd.org/changeset/base/286847 Log: gpioled(4) depends on gpiobus. This fixes the loading of gpioled as a module. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Mon Aug 17 17:01:26 2015 (r286846) +++ head/sys/dev/gpio/gpioled.c Mon Aug 17 17:09:57 2015 (r286847) @@ -255,3 +255,4 @@ static driver_t gpioled_driver = { }; DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0); +MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); From owner-svn-src-head@freebsd.org Mon Aug 17 17:52:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE43A9BBC1A; Mon, 17 Aug 2015 17:52:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97BE11B7D; Mon, 17 Aug 2015 17:52:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HHqTp2055888; Mon, 17 Aug 2015 17:52:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HHqTEB055884; Mon, 17 Aug 2015 17:52:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508171752.t7HHqTEB055884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Aug 2015 17:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286848 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 17:52:29 -0000 Author: jhb Date: Mon Aug 17 17:52:28 2015 New Revision: 286848 URL: https://svnweb.freebsd.org/changeset/base/286848 Log: - Decode the arguments for several signal-related system calls: sigpending, sigqueue, sigreturn, sigsuspend, sigtimedwait, sigwait, sigwaitinfo, and thr_kill. - Print signal sets as a structure (with {}'s) and in particular use this to differentiate empty sets from a NULL pointer. - Decode arguments for some other system calls: issetugid, pipe2, sysarch (operations are only decoded for amd64 and i386), and thr_self. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Mon Aug 17 17:09:57 2015 (r286847) +++ head/usr.bin/truss/syscall.h Mon Aug 17 17:52:28 2015 (r286848) @@ -41,7 +41,8 @@ enum Argtype { None = 1, Hex, Octal, Int Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, - LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode }; + LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, + Sysarch }; #define ARG_MASK 0xff #define OUT 0x100 Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Aug 17 17:09:57 2015 (r286847) +++ head/usr.bin/truss/syscalls.c Mon Aug 17 17:52:28 2015 (r286848) @@ -56,6 +56,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -113,6 +114,7 @@ static struct syscall syscalls[] = { { .name = "getsid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getuid", .ret_type = 1, .nargs = 0 }, + { .name = "issetugid", .ret_type = 1, .nargs = 0 }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Int, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, @@ -280,8 +282,22 @@ static struct syscall syscalls[] = { { .name = "kevent", .ret_type = 0, .nargs = 6, .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } }, + { .name = "sigpending", .ret_type = 0, .nargs = 1, + .args = { { Sigset | OUT, 0 } } }, { .name = "sigprocmask", .ret_type = 0, .nargs = 3, .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } }, + { .name = "sigqueue", .ret_type = 0, .nargs = 3, + .args = { { Int, 0 }, { Signal, 1 }, { LongHex, 2 } } }, + { .name = "sigreturn", .ret_type = 0, .nargs = 1, + .args = { { Ptr, 0 } } }, + { .name = "sigsuspend", .ret_type = 0, .nargs = 1, + .args = { { Sigset | IN, 0 } } }, + { .name = "sigtimedwait", .ret_type = 1, .nargs = 3, + .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } }, + { .name = "sigwait", .ret_type = 1, .nargs = 2, + .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2, + .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Int, 1 } } }, { .name = "socket", .ret_type = 1, .nargs = 3, @@ -317,6 +333,8 @@ static struct syscall syscalls[] = { .args = { { Name | IN, 0 }, { Pathconf, 1 } } }, { .name = "pipe", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, + { .name = "pipe2", .ret_type = 1, .nargs = 2, + .args = { { Ptr, 0 }, { Open, 1 } } }, { .name = "truncate", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Int | IN, 1 }, { Quad | IN, 2 } } }, { .name = "ftruncate", .ret_type = 1, .nargs = 3, @@ -345,9 +363,15 @@ static struct syscall syscalls[] = { { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Int, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "sysarch", .ret_type = 1, .nargs = 2, + .args = { { Sysarch, 0 }, { Ptr, 1 } } }, { .name = "_umtx_op", .ret_type = 1, .nargs = 5, .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 }, { Ptr, 4 } } }, + { .name = "thr_kill", .ret_type = 0, .nargs = 2, + .args = { { Long, 0 }, { Signal, 1 } } }, + { .name = "thr_self", .ret_type = 0, .nargs = 1, + .args = { { Ptr, 0 } } }, { .name = 0 }, }; @@ -511,6 +535,16 @@ static struct xlat access_modes[] = { X(R_OK) X(W_OK) X(X_OK) XEND }; +static struct xlat sysarch_ops[] = { +#if defined(__i386__) || defined(__amd64__) + X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM) + X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE) + X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE) + X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE) + X(AMD64_GET_XFPUSTATE) +#endif + XEND +}; #undef X #undef XEND @@ -721,7 +755,10 @@ print_arg(struct syscall_args *sc, unsig break; case LongHex: asprintf(&tmp, "0x%lx", args[sc->offset]); - break; + break; + case Long: + asprintf(&tmp, "%ld", args[sc->offset]); + break; case Name: { /* NULL-terminated string. */ char *tmp2; @@ -1089,8 +1126,10 @@ print_arg(struct syscall_args *sc, unsig asprintf(&tmp, "0x%lx", args[sc->offset]); break; } - tmp = malloc(sys_nsig * 8); /* 7 bytes avg per signal name */ + tmp = malloc(sys_nsig * 8 + 2); /* 7 bytes avg per signal name */ used = 0; + tmp[used++] = '{'; + tmp[used++] = ' '; for (i = 1; i < sys_nsig; i++) { if (sigismember(&ss, i)) { signame = strsig(i); @@ -1098,10 +1137,11 @@ print_arg(struct syscall_args *sc, unsig free(signame); } } - if (used) - tmp[used-1] = 0; - else - strcpy(tmp, "0x0"); + if (tmp[used - 1] == '|') + used--; + tmp[used++] = ' '; + tmp[used++] = '}'; + tmp[used++] = '\0'; break; } case Sigprocmask: { @@ -1447,6 +1487,9 @@ print_arg(struct syscall_args *sc, unsig tmp = strdup(xlookup_bits(access_modes, args[sc->offset])); break; + case Sysarch: + tmp = strdup(xlookup(sysarch_ops, args[sc->offset])); + break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } From owner-svn-src-head@freebsd.org Mon Aug 17 17:57:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B0F9BBCB7; Mon, 17 Aug 2015 17:57:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C101D62; Mon, 17 Aug 2015 17:57:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HHv1pY056213; Mon, 17 Aug 2015 17:57:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HHv1sA056212; Mon, 17 Aug 2015 17:57:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508171757.t7HHv1sA056212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Aug 2015 17:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286849 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 17:57:02 -0000 Author: jhb Date: Mon Aug 17 17:57:01 2015 New Revision: 286849 URL: https://svnweb.freebsd.org/changeset/base/286849 Log: Decode the optional SOCK_NONBLOCK and SOCK_CLOEXEC flags passed in a socket type. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Aug 17 17:52:28 2015 (r286848) +++ head/usr.bin/truss/syscalls.c Mon Aug 17 17:57:01 2015 (r286849) @@ -1228,9 +1228,22 @@ print_arg(struct syscall_args *sc, unsig case Sockdomain: tmp = strdup(xlookup(sockdomain_arg, args[sc->offset])); break; - case Socktype: - tmp = strdup(xlookup(socktype_arg, args[sc->offset])); + case Socktype: { + FILE *fp; + size_t len; + int type, flags; + + flags = args[sc->offset] & (SOCK_CLOEXEC | SOCK_NONBLOCK); + type = args[sc->offset] & ~flags; + fp = open_memstream(&tmp, &len); + fputs(xlookup(socktype_arg, type), fp); + if (flags & SOCK_CLOEXEC) + fprintf(fp, "|SOCK_CLOEXEC"); + if (flags & SOCK_NONBLOCK) + fprintf(fp, "|SOCK_NONBLOCK"); + fclose(fp); break; + } case Shutdown: tmp = strdup(xlookup(shutdown_arg, args[sc->offset])); break; From owner-svn-src-head@freebsd.org Mon Aug 17 18:28:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CD039BB4FA; Mon, 17 Aug 2015 18:28:41 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70D5B1FCB; Mon, 17 Aug 2015 18:28:41 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HISfNU068521; Mon, 17 Aug 2015 18:28:41 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HISfC2068520; Mon, 17 Aug 2015 18:28:41 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201508171828.t7HISfC2068520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Mon, 17 Aug 2015 18:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286851 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 18:28:41 -0000 Author: jah Date: Mon Aug 17 18:28:40 2015 New Revision: 286851 URL: https://svnweb.freebsd.org/changeset/base/286851 Log: Some cleanups to make the style of pmap_quick_enter_page() and pmap_quick_remove_page() in arm/pmap-v6-new.c more consistent with the rest of the file. Submitted by: Svatopluk Kraus Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Mon Aug 17 18:21:18 2015 (r286850) +++ head/sys/arm/arm/pmap-v6-new.c Mon Aug 17 18:28:40 2015 (r286851) @@ -1166,10 +1166,9 @@ pmap_init_qpages(void) pc = pcpu_find(i); pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); if (pc->pc_qmap_addr == 0) - panic("pmap_init_qpages: unable to allocate KVA"); + panic("%s: unable to allocate KVA", __func__); } } - SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL); /* @@ -5728,18 +5727,17 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_offset_t pmap_quick_enter_page(vm_page_t m) { - pt2_entry_t *pte; - vm_offset_t qmap_addr; + pt2_entry_t *pte2p; + vm_offset_t qmap_addr; critical_enter(); - qmap_addr = PCPU_GET(qmap_addr); - pte = pt2map_entry(qmap_addr); + pte2p = pt2map_entry(qmap_addr); - KASSERT(*pte == 0, ("pmap_quick_enter_page: PTE busy")); + KASSERT(pte2_load(pte2p) == 0, ("%s: PTE2 busy", __func__)); - pte2_store(pte, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), - PTE2_AP_KRW, pmap_page_get_memattr(m))); + pte2_store(pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW, + pmap_page_get_memattr(m))); tlb_flush_local(qmap_addr); return (qmap_addr); @@ -5748,16 +5746,16 @@ pmap_quick_enter_page(vm_page_t m) void pmap_quick_remove_page(vm_offset_t addr) { - pt2_entry_t *pte; + pt2_entry_t *pte2p; vm_offset_t qmap_addr; qmap_addr = PCPU_GET(qmap_addr); - pte = pt2map_entry(qmap_addr); + pte2p = pt2map_entry(qmap_addr); - KASSERT(addr == qmap_addr, ("pmap_quick_remove_page: invalid address")); - KASSERT(*pte != 0, ("pmap_quick_remove_page: PTE not in use")); + KASSERT(addr == qmap_addr, ("%s: invalid address", __func__)); + KASSERT(pte2_load(pte2p) != 0, ("%s: PTE2 not in use", __func__)); - pte2_clear(pte); + pte2_clear(pte2p); critical_exit(); } From owner-svn-src-head@freebsd.org Mon Aug 17 18:42:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B54469BB8B4; Mon, 17 Aug 2015 18:42:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D98D1CCF; Mon, 17 Aug 2015 18:42:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HIgkdc076692; Mon, 17 Aug 2015 18:42:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HIgkgD076691; Mon, 17 Aug 2015 18:42:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508171842.t7HIgkgD076691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Aug 2015 18:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286855 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 18:42:46 -0000 Author: kib Date: Mon Aug 17 18:42:45 2015 New Revision: 286855 URL: https://svnweb.freebsd.org/changeset/base/286855 Log: XEN/amd64 may initiate i/o over the pages not mapped by the direct map. Handle busdma bouncing and ata PIO accesses by using global frame used by the current CPU locally for the duration of pmap_quick_enter/remove_page(). A spin mutex protects the concurent frame use and prevents thread migration. Noted by: royger Reviewed by: alc, jah, royger (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Aug 17 18:36:16 2015 (r286854) +++ head/sys/amd64/amd64/pmap.c Mon Aug 17 18:42:45 2015 (r286855) @@ -390,6 +390,8 @@ static struct md_page *pv_table; */ pt_entry_t *CMAP1 = 0; caddr_t CADDR1 = 0; +static vm_offset_t qframe = 0; +static struct mtx qframe_mtx; static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ @@ -1031,7 +1033,7 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t mpte; vm_size_t s; - int i, pv_npg; + int error, i, pv_npg; /* * Initialize the vm page array entries for the kernel pmap's @@ -1112,6 +1114,12 @@ pmap_init(void) printf("PPIM %u: PA=%#lx, VA=%#lx, size=%#lx, mode=%#x\n", i, ppim->pa, ppim->va, ppim->sz, ppim->mode); } + + mtx_init(&qframe_mtx, "qfrmlk", NULL, MTX_SPIN); + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, + (vmem_addr_t *)&qframe); + if (error != 0) + panic("qframe allocation failed"); } static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, @@ -7019,13 +7027,27 @@ pmap_unmap_io_transient(vm_page_t page[] vm_offset_t pmap_quick_enter_page(vm_page_t m) { + vm_paddr_t paddr; - return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); + paddr = VM_PAGE_TO_PHYS(m); + if (paddr < dmaplimit) + return (PHYS_TO_DMAP(paddr)); + mtx_lock_spin(&qframe_mtx); + KASSERT(*vtopte(qframe) == 0, ("qframe busy")); + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | + X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); + return (qframe); } void pmap_quick_remove_page(vm_offset_t addr) { + + if (addr != qframe) + return; + pte_store(vtopte(qframe), 0); + invlpg(qframe); + mtx_unlock_spin(&qframe_mtx); } #include "opt_ddb.h" From owner-svn-src-head@freebsd.org Mon Aug 17 18:47:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B94AA9BB986; Mon, 17 Aug 2015 18:47:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9983111E3; Mon, 17 Aug 2015 18:47:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HIleJ1077019; Mon, 17 Aug 2015 18:47:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HIleev077018; Mon, 17 Aug 2015 18:47:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508171847.t7HIleev077018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Aug 2015 18:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286857 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 18:47:40 -0000 Author: jhb Date: Mon Aug 17 18:47:39 2015 New Revision: 286857 URL: https://svnweb.freebsd.org/changeset/base/286857 Log: Tidy the linux_socketcall decoding: - Don't exit if get_struct() fails, instead print the raw pointer value to match all other argument decoding cases. - Use an xlat table instead of a home-rolled switch for the operation name. - Display the nested socketcall args structure as a structure instead of as two inline arguments. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Aug 17 18:43:39 2015 (r286856) +++ head/usr.bin/truss/syscalls.c Mon Aug 17 18:47:39 2015 (r286857) @@ -545,6 +545,16 @@ static struct xlat sysarch_ops[] = { #endif XEND }; + +static struct xlat linux_socketcall_ops[] = { + X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN) + X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME) + X(LINUX_SOCKETPAIR) X(LINUX_SEND) X(LINUX_RECV) X(LINUX_SENDTO) + X(LINUX_RECVFROM) X(LINUX_SHUTDOWN) X(LINUX_SETSOCKOPT) + X(LINUX_GETSOCKOPT) X(LINUX_SENDMSG) X(LINUX_RECVMSG) + XEND +}; + #undef X #undef XEND @@ -962,71 +972,12 @@ print_arg(struct syscall_args *sc, unsig { struct linux_socketcall_args largs; if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, - sizeof(largs)) == -1) { - err(1, "get_struct %p", (void *)args[sc->offset]); - } - const char *what; - char buf[30]; - - switch (largs.what) { - case LINUX_SOCKET: - what = "LINUX_SOCKET"; - break; - case LINUX_BIND: - what = "LINUX_BIND"; - break; - case LINUX_CONNECT: - what = "LINUX_CONNECT"; - break; - case LINUX_LISTEN: - what = "LINUX_LISTEN"; - break; - case LINUX_ACCEPT: - what = "LINUX_ACCEPT"; - break; - case LINUX_GETSOCKNAME: - what = "LINUX_GETSOCKNAME"; - break; - case LINUX_GETPEERNAME: - what = "LINUX_GETPEERNAME"; - break; - case LINUX_SOCKETPAIR: - what = "LINUX_SOCKETPAIR"; - break; - case LINUX_SEND: - what = "LINUX_SEND"; - break; - case LINUX_RECV: - what = "LINUX_RECV"; - break; - case LINUX_SENDTO: - what = "LINUX_SENDTO"; - break; - case LINUX_RECVFROM: - what = "LINUX_RECVFROM"; - break; - case LINUX_SHUTDOWN: - what = "LINUX_SHUTDOWN"; - break; - case LINUX_SETSOCKOPT: - what = "LINUX_SETSOCKOPT"; - break; - case LINUX_GETSOCKOPT: - what = "LINUX_GETSOCKOPT"; - break; - case LINUX_SENDMSG: - what = "LINUX_SENDMSG"; - break; - case LINUX_RECVMSG: - what = "LINUX_RECVMSG"; - break; - default: - sprintf(buf, "%d", largs.what); - what = buf; - break; - } - asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, - (long unsigned int)largs.args); + sizeof(largs)) != -1) + asprintf(&tmp, "{ %s, 0x%lx }", + lookup(linux_socketcall_ops, largs.what, 10), + (long unsigned int)largs.args); + else + asprintf(&tmp, "0x%lx", args[sc->offset]); break; } case Pollfd: { From owner-svn-src-head@freebsd.org Mon Aug 17 19:08:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0239BC05A; Mon, 17 Aug 2015 19:08:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89A2019E5; Mon, 17 Aug 2015 19:08:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HJ8n3P086184; Mon, 17 Aug 2015 19:08:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HJ8n3W086183; Mon, 17 Aug 2015 19:08:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508171908.t7HJ8n3W086183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Aug 2015 19:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286860 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 19:08:49 -0000 Author: jhb Date: Mon Aug 17 19:08:48 2015 New Revision: 286860 URL: https://svnweb.freebsd.org/changeset/base/286860 Log: Use an xlat table and xlookup() instead of a home-rolled version for the sigprocmask operation type. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Aug 17 19:06:14 2015 (r286859) +++ head/usr.bin/truss/syscalls.c Mon Aug 17 19:08:48 2015 (r286860) @@ -555,6 +555,11 @@ static struct xlat linux_socketcall_ops[ XEND }; +static struct xlat sigprocmask_ops[] = { + X(SIG_BLOCK) X(SIG_UNBLOCK) X(SIG_SETMASK) + XEND +}; + #undef X #undef XEND @@ -1096,15 +1101,7 @@ print_arg(struct syscall_args *sc, unsig break; } case Sigprocmask: { - switch (args[sc->offset]) { -#define S(a) case a: tmp = strdup(#a); break; - S(SIG_BLOCK); - S(SIG_UNBLOCK); - S(SIG_SETMASK); -#undef S - } - if (tmp == NULL) - asprintf(&tmp, "0x%lx", args[sc->offset]); + tmp = strdup(xlookup(sigprocmask_ops, args[sc->offset])); break; } case Fcntlflag: { From owner-svn-src-head@freebsd.org Mon Aug 17 23:03:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A40B9BC59F; Mon, 17 Aug 2015 23:03:55 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD92116B; Mon, 17 Aug 2015 23:03:55 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HN3s8q083935; Mon, 17 Aug 2015 23:03:54 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HN3sxC083934; Mon, 17 Aug 2015 23:03:54 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508172303.t7HN3sxC083934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 17 Aug 2015 23:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286862 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 23:03:55 -0000 Author: loos Date: Mon Aug 17 23:03:54 2015 New Revision: 286862 URL: https://svnweb.freebsd.org/changeset/base/286862 Log: Fix the copy of addresses passed from userland in table replace command. The size2 is the maximum userland buffer size (used when the addresses are copied back to userland). Obtained from: pfSense MFC after: 3 days Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Mon Aug 17 21:07:21 2015 (r286861) +++ head/sys/netpfil/pf/pf_ioctl.c Mon Aug 17 23:03:54 2015 (r286862) @@ -2724,8 +2724,7 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = (io->pfrio_size + io->pfrio_size2) * - sizeof(struct pfr_addr); + totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = malloc(totlen, M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { From owner-svn-src-head@freebsd.org Mon Aug 17 23:19:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 997799BC73A; Mon, 17 Aug 2015 23:19:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81C3917DD; Mon, 17 Aug 2015 23:19:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HNJbi4088214; Mon, 17 Aug 2015 23:19:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HNJaSJ088210; Mon, 17 Aug 2015 23:19:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508172319.t7HNJaSJ088210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Aug 2015 23:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286863 - in head/lib: libc/tests/sys libproc/tests libutil/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 23:19:37 -0000 Author: emaste Date: Mon Aug 17 23:19:36 2015 New Revision: 286863 URL: https://svnweb.freebsd.org/changeset/base/286863 Log: On arm64 disable three tests that hang or panic Each issue has a PR open to track. This workaround allows us to run the tests to investigate the failures and avoid any new regressions. PR: 202304, 202305, 202307 Reviewed by: ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3378 Modified: head/lib/libc/tests/sys/Makefile head/lib/libproc/tests/proc_test.c head/lib/libutil/tests/Makefile Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Mon Aug 17 23:03:54 2015 (r286862) +++ head/lib/libc/tests/sys/Makefile Mon Aug 17 23:19:36 2015 (r286863) @@ -25,7 +25,10 @@ NETBSD_ATF_TESTS_C+= kevent_test NETBSD_ATF_TESTS_C+= kill_test NETBSD_ATF_TESTS_C+= link_test NETBSD_ATF_TESTS_C+= listen_test +# On arm64 triggers panic ARM64TODO: pmap_mincore (PR202307). +.if ${MACHINE_CPUARCH} != "aarch64" NETBSD_ATF_TESTS_C+= mincore_test +.endif NETBSD_ATF_TESTS_C+= mkdir_test NETBSD_ATF_TESTS_C+= mkfifo_test NETBSD_ATF_TESTS_C+= mknod_test Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Mon Aug 17 23:03:54 2015 (r286862) +++ head/lib/libproc/tests/proc_test.c Mon Aug 17 23:19:36 2015 (r286863) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include static const char *aout_object = "a.out"; +#if !defined(__aarch64__) static const char *ldelf_object = "ld-elf.so.1"; +#endif static const char *target_prog_file = "target_prog"; /* @@ -75,6 +77,7 @@ start_prog(const struct atf_tc *tc, bool return (phdl); } +#if !defined(__aarch64__) static void set_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long *saved) { @@ -151,6 +154,7 @@ verify_bkpt(struct proc_handle *phdl, GE ATF_REQUIRE_EQ_MSG(strcmp(mapname, mapbname), 0, "expected map name '%s' doesn't match '%s'", mapname, mapbname); } +#endif ATF_TC(map_alias_obj2map); ATF_TC_HEAD(map_alias_obj2map, tc) @@ -255,6 +259,7 @@ ATF_TC_BODY(map_alias_name2sym, tc) proc_free(phdl); } +#if !defined(__aarch64__) ATF_TC(symbol_lookup); ATF_TC_HEAD(symbol_lookup, tc) { @@ -331,6 +336,7 @@ ATF_TC_BODY(symbol_lookup_fail, tc) proc_free(phdl); } +#endif ATF_TC(signal_forward); ATF_TC_HEAD(signal_forward, tc) @@ -379,8 +385,11 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, map_alias_obj2map); ATF_TP_ADD_TC(tp, map_alias_name2map); ATF_TP_ADD_TC(tp, map_alias_name2sym); +/* On arm64 triggers panic ARM64TODO: pmap_sync_icache (PR202305). */ +#if !defined(__aarch64__) ATF_TP_ADD_TC(tp, symbol_lookup); ATF_TP_ADD_TC(tp, symbol_lookup_fail); +#endif ATF_TP_ADD_TC(tp, signal_forward); return (atf_no_error()); Modified: head/lib/libutil/tests/Makefile ============================================================================== --- head/lib/libutil/tests/Makefile Mon Aug 17 23:03:54 2015 (r286862) +++ head/lib/libutil/tests/Makefile Mon Aug 17 23:19:36 2015 (r286863) @@ -5,7 +5,9 @@ TESTSDIR= ${TESTSBASE}/lib/libutil TAP_TESTS_C+= flopen_test TAP_TESTS_C+= grp_test TAP_TESTS_C+= humanize_number_test +.if ${MACHINE_CPUARCH} != "aarch64" # PR202304: pidfile_test hangs on arm64 TAP_TESTS_C+= pidfile_test +.endif TAP_TESTS_C+= trimdomain_test TAP_TESTS_C+= trimdomain-nodomain_test From owner-svn-src-head@freebsd.org Mon Aug 17 23:35:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E82869BCA10; Mon, 17 Aug 2015 23:35:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA521FD3; Mon, 17 Aug 2015 23:35:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HNZWeD096140; Mon, 17 Aug 2015 23:35:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HNZW7i096139; Mon, 17 Aug 2015 23:35:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508172335.t7HNZW7i096139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Aug 2015 23:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286864 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 23:35:33 -0000 Author: adrian Date: Mon Aug 17 23:35:31 2015 New Revision: 286864 URL: https://svnweb.freebsd.org/changeset/base/286864 Log: Migrate ifp->if_softc -> ic->ic_softc. Tested: * Lenovo T400 (Intel 5300) * make universe Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Aug 17 23:19:36 2015 (r286863) +++ head/sys/dev/iwn/if_iwn.c Mon Aug 17 23:35:31 2015 (r286864) @@ -4922,7 +4922,7 @@ iwn_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct iwn_softc *sc = ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; int error = 0; DPRINTF(sc, IWN_DEBUG_XMIT | IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -5057,8 +5057,8 @@ iwn_watchdog(void *arg) static int iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct iwn_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct iwn_softc *sc = ic->ic_softc; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0, stop = 0; @@ -8872,8 +8872,7 @@ iwn_stop(struct iwn_softc *sc) static void iwn_scan_start(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct iwn_softc *sc = ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; IWN_LOCK(sc); /* make the link LED blink while we're scanning */ @@ -8887,8 +8886,7 @@ iwn_scan_start(struct ieee80211com *ic) static void iwn_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct iwn_softc *sc = ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); IWN_LOCK(sc); @@ -8906,8 +8904,7 @@ static void iwn_set_channel(struct ieee80211com *ic) { const struct ieee80211_channel *c = ic->ic_curchan; - struct ifnet *ifp = ic->ic_ifp; - struct iwn_softc *sc = ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; int error; DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); From owner-svn-src-head@freebsd.org Mon Aug 17 23:44:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FD09BCB33; Mon, 17 Aug 2015 23:44:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80DA813DC; Mon, 17 Aug 2015 23:44:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7HNiete000259; Mon, 17 Aug 2015 23:44:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7HNicRZ000253; Mon, 17 Aug 2015 23:44:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508172344.t7HNicRZ000253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 17 Aug 2015 23:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286865 - in head/sys/dev: bwi bwn ipw iwm wi wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 23:44:40 -0000 Author: adrian Date: Mon Aug 17 23:44:38 2015 New Revision: 286865 URL: https://svnweb.freebsd.org/changeset/base/286865 Log: Convert more ifp->if_softc -> ic->ic_softc. These should be a big no-op. Tested: * make universe Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwm/if_iwm.c head/sys/dev/wi/if_wi.c head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/bwi/if_bwi.c Mon Aug 17 23:44:38 2015 (r286865) @@ -1444,7 +1444,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct bwi_softc *sc = ifp->if_softc; + struct bwi_softc *sc = ic->ic_softc; /* XXX wme? */ struct bwi_txbuf_data *tbd = &sc->sc_tx_bdata[BWI_TX_DATA_RING]; int idx, error; @@ -1728,7 +1728,7 @@ bwi_intr(void *xsc) static void bwi_scan_start(struct ieee80211com *ic) { - struct bwi_softc *sc = ic->ic_ifp->if_softc; + struct bwi_softc *sc = ic->ic_softc; BWI_LOCK(sc); /* Enable MAC beacon promiscuity */ @@ -1739,7 +1739,7 @@ bwi_scan_start(struct ieee80211com *ic) static void bwi_set_channel(struct ieee80211com *ic) { - struct bwi_softc *sc = ic->ic_ifp->if_softc; + struct bwi_softc *sc = ic->ic_softc; struct ieee80211_channel *c = ic->ic_curchan; struct bwi_mac *mac; @@ -1765,7 +1765,7 @@ bwi_set_channel(struct ieee80211com *ic) static void bwi_scan_end(struct ieee80211com *ic) { - struct bwi_softc *sc = ic->ic_ifp->if_softc; + struct bwi_softc *sc = ic->ic_softc; BWI_LOCK(sc); CSR_CLRBITS_4(sc, BWI_MAC_STATUS, BWI_MAC_STATUS_PASS_BCN); @@ -1776,10 +1776,9 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - struct ieee80211com *ic= vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; + struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate = vap->iv_state; - struct bwi_softc *sc = ifp->if_softc; + struct bwi_softc *sc = ic->ic_softc; struct bwi_mac *mac; int error; Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/bwn/if_bwn.c Mon Aug 17 23:44:38 2015 (r286865) @@ -2736,7 +2736,7 @@ bwn_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac = sc->sc_curmac; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || @@ -2817,7 +2817,7 @@ bwn_update_promisc(struct ieee80211com * static int bwn_wme_update(struct ieee80211com *ic) { - struct bwn_softc *sc = ic->ic_ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac = sc->sc_curmac; struct wmeParams *wmep; int i; @@ -2839,8 +2839,7 @@ bwn_wme_update(struct ieee80211com *ic) static void bwn_scan_start(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac; BWN_LOCK(sc); @@ -2857,8 +2856,7 @@ bwn_scan_start(struct ieee80211com *ic) static void bwn_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac; BWN_LOCK(sc); @@ -2874,8 +2872,7 @@ bwn_scan_end(struct ieee80211com *ic) static void bwn_set_channel(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac = sc->sc_curmac; struct bwn_phy *phy = &mac->mac_phy; int chan, error; @@ -2933,8 +2930,7 @@ bwn_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) { - struct ifnet *ifp = ic->ic_ifp; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct ieee80211vap *vap; struct bwn_vap *bvp; uint8_t mac[IEEE80211_ADDR_LEN]; @@ -8331,7 +8327,7 @@ bwn_newstate(struct ieee80211vap *vap, e struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; - struct bwn_softc *sc = ifp->if_softc; + struct bwn_softc *sc = ic->ic_softc; struct bwn_mac *mac = sc->sc_curmac; int error; Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/ipw/if_ipw.c Mon Aug 17 23:44:38 2015 (r286865) @@ -428,8 +428,7 @@ ipw_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct ifnet *ifp = ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; struct ipw_vap *ivp; struct ieee80211vap *vap; const struct firmware *fp; @@ -866,7 +865,7 @@ ipw_media_status(struct ifnet *ifp, stru { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - struct ipw_softc *sc = ic->ic_ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; /* read current transmission rate from adapter */ vap->iv_bss->ni_txrate = ipw_cvtrate( @@ -879,8 +878,7 @@ ipw_newstate(struct ieee80211vap *vap, e { struct ipw_vap *ivp = IPW_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; enum ieee80211_state ostate; DPRINTF(("%s: %s -> %s flags 0x%x\n", __func__, @@ -1581,8 +1579,8 @@ ipw_cmd(struct ipw_softc *sc, uint32_t t static int ipw_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni) { - struct ipw_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct ipw_softc *sc = ic->ic_softc; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh; struct ipw_soft_bd *sbd; @@ -2217,8 +2215,7 @@ ipw_setchannel(struct ipw_softc *sc, str static void ipw_assoc(struct ieee80211com *ic, struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; struct ieee80211_node *ni = vap->iv_bss; struct ipw_security security; uint32_t data; @@ -2309,9 +2306,8 @@ done: static void ipw_disassoc(struct ieee80211com *ic, struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; struct ieee80211_node *ni = vap->iv_bss; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; IPW_LOCK(sc); DPRINTF(("Disassociate from %6D\n", ni->ni_bssid, ":")); @@ -2677,8 +2673,7 @@ ipw_write_mem_1(struct ipw_softc *sc, bu static void ipw_scan_start(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; IPW_LOCK(sc); ipw_scan(sc); @@ -2688,8 +2683,7 @@ ipw_scan_start(struct ieee80211com *ic) static void ipw_set_channel(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; IPW_LOCK(sc); if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -2715,8 +2709,7 @@ ipw_scan_mindwell(struct ieee80211_scan_ static void ipw_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct ipw_softc *sc = ifp->if_softc; + struct ipw_softc *sc = ic->ic_softc; IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/iwm/if_iwm.c Mon Aug 17 23:44:38 2015 (r286865) @@ -2874,7 +2874,7 @@ iwm_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct iwm_softc *sc = ifp->if_softc; + struct iwm_softc *sc = ic->ic_softc; int error = 0; IWM_DPRINTF(sc, IWM_DEBUG_XMIT, @@ -3510,8 +3510,7 @@ iwm_newstate(struct ieee80211vap *vap, e { struct iwm_vap *ivp = IWM_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; - struct iwm_softc *sc = ifp->if_softc; + struct iwm_softc *sc = ic->ic_softc; struct iwm_node *in; int error; @@ -4820,7 +4819,7 @@ fail: static int iwm_update_edca(struct ieee80211com *ic) { - struct iwm_softc *sc = ic->ic_ifp->if_softc; + struct iwm_softc *sc = ic->ic_softc; device_printf(sc->sc_dev, "%s: called\n", __func__); return (0); @@ -4960,7 +4959,7 @@ static void iwm_scan_start(struct ieee80211com *ic) { struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct iwm_softc *sc = ic->ic_ifp->if_softc; + struct iwm_softc *sc = ic->ic_softc; int error; if (sc->sc_scanband) Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/wi/if_wi.c Mon Aug 17 23:44:38 2015 (r286865) @@ -520,7 +520,7 @@ wi_vap_create(struct ieee80211com *ic, c const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct wi_softc *sc = ic->ic_ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; struct wi_vap *wvp; struct ieee80211vap *vap; @@ -750,8 +750,7 @@ wi_stop(struct wi_softc *sc, int disable static void wi_set_channel(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; DPRINTF(("%s: channel %d, %sscanning\n", __func__, ieee80211_chan2ieee(ic, ic->ic_curchan), @@ -766,8 +765,7 @@ wi_set_channel(struct ieee80211com *ic) static void wi_scan_start(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; struct ieee80211_scan_state *ss = ic->ic_scan; DPRINTF(("%s\n", __func__)); @@ -790,8 +788,7 @@ wi_scan_start(struct ieee80211com *ic) static void wi_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; DPRINTF(("%s: restore port type %d\n", __func__, sc->sc_porttype)); @@ -824,9 +821,8 @@ static int wi_newstate_sta(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_node *bss; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; DPRINTF(("%s: %s -> %s\n", __func__, ieee80211_state_name[vap->iv_state], @@ -894,9 +890,8 @@ static int wi_newstate_hostap(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_node *bss; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; int error; DPRINTF(("%s: %s -> %s\n", __func__, @@ -1082,7 +1077,7 @@ wi_raw_xmit(struct ieee80211_node *ni, s struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap = ni->ni_vap; - struct wi_softc *sc = ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; struct ieee80211_key *k; struct ieee80211_frame *wh; struct wi_frame frmhdr; @@ -1252,7 +1247,7 @@ wi_media_status(struct ifnet *ifp, struc { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - struct wi_softc *sc = ic->ic_ifp->if_softc; + struct wi_softc *sc = ic->ic_softc; u_int16_t val; int rate, len; Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Aug 17 23:35:31 2015 (r286864) +++ head/sys/dev/wpi/if_wpi.c Mon Aug 17 23:44:38 2015 (r286865) @@ -1549,8 +1549,7 @@ static int wpi_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd, int nchan, struct ieee80211_channel chans[]) { - struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; int i; for (i = 0; i < nchan; i++) { @@ -1673,7 +1672,7 @@ static void wpi_node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); if (wn->id != WPI_ID_UNDEFINED) { @@ -1700,7 +1699,7 @@ wpi_recv_mgmt(struct ieee80211_node *ni, int rssi, int nf) { struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct wpi_softc *sc = vap->iv_ic->ic_softc; struct wpi_vap *wvp = WPI_VAP(vap); uint64_t ni_tstamp, rx_tstamp; @@ -1763,8 +1762,7 @@ wpi_newstate(struct ieee80211vap *vap, e { struct wpi_vap *wvp = WPI_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; int error = 0; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3037,7 +3035,7 @@ wpi_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; int error = 0; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3492,7 +3490,7 @@ static int wpi_updateedca(struct ieee80211com *ic) { #define WPI_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */ - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; struct wpi_edca_params cmd; int aci, error; @@ -4324,7 +4322,7 @@ wpi_config_beacon(struct wpi_vap *wvp) struct ieee80211com *ic = wvp->wv_vap.iv_ic; struct ieee80211_beacon_offsets *bo = &wvp->wv_boff; struct wpi_buf *bcn = &wvp->wv_bcbuf; - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; struct wpi_cmd_beacon *cmd = (struct wpi_cmd_beacon *)&bcn->data; struct ieee80211_tim_ie *tie; struct mbuf *m; @@ -4406,7 +4404,7 @@ wpi_setup_beacon(struct wpi_softc *sc, s static void wpi_update_beacon(struct ieee80211vap *vap, int item) { - struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct wpi_softc *sc = vap->iv_ic->ic_softc; struct wpi_vap *wvp = WPI_VAP(vap); struct wpi_buf *bcn = &wvp->wv_bcbuf; struct ieee80211_beacon_offsets *bo = &wvp->wv_boff; @@ -4448,7 +4446,7 @@ static void wpi_newassoc(struct ieee80211_node *ni, int isnew) { struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_softc *sc = ni->ni_ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); int error; @@ -4575,7 +4573,7 @@ wpi_load_key(struct ieee80211_node *ni, { const struct ieee80211_cipher *cip = k->wk_cipher; struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_softc *sc = ni->ni_ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); struct wpi_node_info node; uint16_t kflags; @@ -4639,7 +4637,7 @@ wpi_load_key_cb(void *arg, struct ieee80 { const struct ieee80211_key *k = arg; struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_softc *sc = ni->ni_ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); int error; @@ -4674,7 +4672,7 @@ static int wpi_del_key(struct ieee80211_node *ni, const struct ieee80211_key *k) { struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_softc *sc = ni->ni_ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); struct wpi_node_info node; uint16_t kflags; @@ -4724,7 +4722,7 @@ wpi_del_key_cb(void *arg, struct ieee802 { const struct ieee80211_key *k = arg; struct ieee80211vap *vap = ni->ni_vap; - struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_softc *sc = ni->ni_ic->ic_softc; struct wpi_node *wn = WPI_NODE(ni); int error; @@ -4746,7 +4744,7 @@ wpi_process_key(struct ieee80211vap *vap int set) { struct ieee80211com *ic = vap->iv_ic; - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; struct wpi_vap *wvp = WPI_VAP(vap); struct ieee80211_node *ni; int error, ni_ref = 0; @@ -5544,7 +5542,7 @@ wpi_stop(struct wpi_softc *sc) static void wpi_scan_start(struct ieee80211com *ic) { - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; wpi_set_led(sc, WPI_LED_LINK, 20, 2); } @@ -5555,8 +5553,7 @@ wpi_scan_start(struct ieee80211com *ic) static void wpi_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); if (vap->iv_state == IEEE80211_S_RUN) @@ -5571,8 +5568,7 @@ static void wpi_set_channel(struct ieee80211com *ic) { const struct ieee80211_channel *c = ic->ic_curchan; - struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); @@ -5618,7 +5614,7 @@ wpi_scan_curchan(struct ieee80211_scan_s { struct ieee80211vap *vap = ss->ss_vap; struct ieee80211com *ic = vap->iv_ic; - struct wpi_softc *sc = ic->ic_ifp->if_softc; + struct wpi_softc *sc = ic->ic_softc; int error; WPI_RXON_LOCK(sc); From owner-svn-src-head@freebsd.org Tue Aug 18 00:21:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F3109BB240; Tue, 18 Aug 2015 00:21:28 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35BB738B; Tue, 18 Aug 2015 00:21:28 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I0LSfA016299; Tue, 18 Aug 2015 00:21:28 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I0LQwE016289; Tue, 18 Aug 2015 00:21:26 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180021.t7I0LQwE016289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 00:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 00:21:28 -0000 Author: jasone Date: Tue Aug 18 00:21:25 2015 New Revision: 286866 URL: https://svnweb.freebsd.org/changeset/base/286866 Log: Update jemalloc to version 4.0.0. Added: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/pages.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/valgrind.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/jemalloc_typedefs.h (contents, props changed) head/contrib/jemalloc/src/pages.c (contents, props changed) Modified: head/contrib/jemalloc/COPYING head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-Xlist head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/atomic.h head/contrib/jemalloc/include/jemalloc/internal/base.h head/contrib/jemalloc/include/jemalloc/internal/bitmap.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h head/contrib/jemalloc/include/jemalloc/internal/ckh.h head/contrib/jemalloc/include/jemalloc/internal/ctl.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/hash.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h head/contrib/jemalloc/include/jemalloc/internal/mutex.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prng.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/public_namespace.h head/contrib/jemalloc/include/jemalloc/internal/ql.h head/contrib/jemalloc/include/jemalloc/internal/qr.h head/contrib/jemalloc/include/jemalloc/internal/quarantine.h head/contrib/jemalloc/include/jemalloc/internal/rb.h head/contrib/jemalloc/include/jemalloc/internal/rtree.h head/contrib/jemalloc/include/jemalloc/internal/size_classes.h head/contrib/jemalloc/include/jemalloc/internal/stats.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/bitmap.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/ckh.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/extent.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/util.c head/include/malloc_np.h head/lib/libc/gen/tls.c head/lib/libc/stdlib/jemalloc/Makefile.inc Modified: head/contrib/jemalloc/COPYING ============================================================================== --- head/contrib/jemalloc/COPYING Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/COPYING Tue Aug 18 00:21:25 2015 (r286866) @@ -1,10 +1,10 @@ Unless otherwise specified, files in the jemalloc source distribution are subject to the following license: -------------------------------------------------------------------------------- -Copyright (C) 2002-2014 Jason Evans . +Copyright (C) 2002-2015 Jason Evans . All rights reserved. Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. -Copyright (C) 2009-2014 Facebook, Inc. All rights reserved. +Copyright (C) 2009-2015 Facebook, 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: Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/ChangeLog Tue Aug 18 00:21:25 2015 (r286866) @@ -1,10 +1,166 @@ Following are change highlights associated with official releases. Important -bug fixes are all mentioned, but internal enhancements are omitted here for -brevity (even though they are more fun to write about). Much more detail can be -found in the git revision history: +bug fixes are all mentioned, but some internal enhancements are omitted here for +brevity. Much more detail can be found in the git revision history: https://github.com/jemalloc/jemalloc +* 4.0.0 (August 17, 2015) + + This version contains many speed and space optimizations, both minor and + major. The major themes are generalization, unification, and simplification. + Although many of these optimizations cause no visible behavior change, their + cumulative effect is substantial. + + New features: + - Normalize size class spacing to be consistent across the complete size + range. By default there are four size classes per size doubling, but this + is now configurable via the --with-lg-size-class-group option. Also add the + --with-lg-page, --with-lg-page-sizes, --with-lg-quantum, and + --with-lg-tiny-min options, which can be used to tweak page and size class + settings. Impacts: + + Worst case performance for incrementally growing/shrinking reallocation + is improved because there are far fewer size classes, and therefore + copying happens less often. + + Internal fragmentation is limited to 20% for all but the smallest size + classes (those less than four times the quantum). (1B + 4 KiB) + and (1B + 4 MiB) previously suffered nearly 50% internal fragmentation. + + Chunk fragmentation tends to be lower because there are fewer distinct run + sizes to pack. + - Add support for explicit tcaches. The "tcache.create", "tcache.flush", and + "tcache.destroy" mallctls control tcache lifetime and flushing, and the + MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to the *allocx() API + control which tcache is used for each operation. + - Implement per thread heap profiling, as well as the ability to + enable/disable heap profiling on a per thread basis. Add the "prof.reset", + "prof.lg_sample", "thread.prof.name", "thread.prof.active", + "opt.prof_thread_active_init", "prof.thread_active_init", and + "thread.prof.active" mallctls. + - Add support for per arena application-specified chunk allocators, configured + via the "arena..chunk_hooks" mallctl. + - Refactor huge allocation to be managed by arenas, so that arenas now + function as general purpose independent allocators. This is important in + the context of user-specified chunk allocators, aside from the scalability + benefits. Related new statistics: + + The "stats.arenas..huge.allocated", "stats.arenas..huge.nmalloc", + "stats.arenas..huge.ndalloc", and "stats.arenas..huge.nrequests" + mallctls provide high level per arena huge allocation statistics. + + The "arenas.nhchunks", "arenas.hchunk..size", + "stats.arenas..hchunks..nmalloc", + "stats.arenas..hchunks..ndalloc", + "stats.arenas..hchunks..nrequests", and + "stats.arenas..hchunks..curhchunks" mallctls provide per size class + statistics. + - Add the 'util' column to malloc_stats_print() output, which reports the + proportion of available regions that are currently in use for each small + size class. + - Add "alloc" and "free" modes for for junk filling (see the "opt.junk" + mallctl), so that it is possible to separately enable junk filling for + allocation versus deallocation. + - Add the jemalloc-config script, which provides information about how + jemalloc was configured, and how to integrate it into application builds. + - Add metadata statistics, which are accessible via the "stats.metadata", + "stats.arenas..metadata.mapped", and + "stats.arenas..metadata.allocated" mallctls. + - Add the "stats.resident" mallctl, which reports the upper limit of + physically resident memory mapped by the allocator. + - Add per arena control over unused dirty page purging, via the + "arenas.lg_dirty_mult", "arena..lg_dirty_mult", and + "stats.arenas..lg_dirty_mult" mallctls. + - Add the "prof.gdump" mallctl, which makes it possible to toggle the gdump + feature on/off during program execution. + - Add sdallocx(), which implements sized deallocation. The primary + optimization over dallocx() is the removal of a metadata read, which often + suffers an L1 cache miss. + - Add missing header includes in jemalloc/jemalloc.h, so that applications + only have to #include . + - Add support for additional platforms: + + Bitrig + + Cygwin + + DragonFlyBSD + + iOS + + OpenBSD + + OpenRISC/or1k + + Optimizations: + - Maintain dirty runs in per arena LRUs rather than in per arena trees of + dirty-run-containing chunks. In practice this change significantly reduces + dirty page purging volume. + - Integrate whole chunks into the unused dirty page purging machinery. This + reduces the cost of repeated huge allocation/deallocation, because it + effectively introduces a cache of chunks. + - Split the arena chunk map into two separate arrays, in order to increase + cache locality for the frequently accessed bits. + - Move small run metadata out of runs, into arena chunk headers. This reduces + run fragmentation, smaller runs reduce external fragmentation for small size + classes, and packed (less uniformly aligned) metadata layout improves CPU + cache set distribution. + - Randomly distribute large allocation base pointer alignment relative to page + boundaries in order to more uniformly utilize CPU cache sets. This can be + disabled via the --disable-cache-oblivious configure option, and queried via + the "config.cache_oblivious" mallctl. + - Micro-optimize the fast paths for the public API functions. + - Refactor thread-specific data to reside in a single structure. This assures + that only a single TLS read is necessary per call into the public API. + - Implement in-place huge allocation growing and shrinking. + - Refactor rtree (radix tree for chunk lookups) to be lock-free, and make + additional optimizations that reduce maximum lookup depth to one or two + levels. This resolves what was a concurrency bottleneck for per arena huge + allocation, because a global data structure is critical for determining + which arenas own which huge allocations. + + Incompatible changes: + - Replace --enable-cc-silence with --disable-cc-silence to suppress spurious + warnings by default. + - Assure that the constness of malloc_usable_size()'s return type matches that + of the system implementation. + - Change the heap profile dump format to support per thread heap profiling, + rename pprof to jeprof, and enhance it with the --thread= option. As a + result, the bundled jeprof must now be used rather than the upstream + (gperftools) pprof. + - Disable "opt.prof_final" by default, in order to avoid atexit(3), which can + internally deadlock on some platforms. + - Change the "arenas.nlruns" mallctl type from size_t to unsigned. + - Replace the "stats.arenas..bins..allocated" mallctl with + "stats.arenas..bins..curregs". + - Ignore MALLOC_CONF in set{uid,gid,cap} binaries. + - Ignore MALLOCX_ARENA(a) in dallocx(), in favor of using the + MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to control tcache usage. + + Removed features: + - Remove the *allocm() API, which is superseded by the *allocx() API. + - Remove the --enable-dss options, and make dss non-optional on all platforms + which support sbrk(2). + - Remove the "arenas.purge" mallctl, which was obsoleted by the + "arena..purge" mallctl in 3.1.0. + - Remove the unnecessary "opt.valgrind" mallctl; jemalloc automatically + detects whether it is running inside Valgrind. + - Remove the "stats.huge.allocated", "stats.huge.nmalloc", and + "stats.huge.ndalloc" mallctls. + - Remove the --enable-mremap option. + - Remove the "stats.chunks.current", "stats.chunks.total", and + "stats.chunks.high" mallctls. + + Bug fixes: + - Fix the cactive statistic to decrease (rather than increase) when active + memory decreases. This regression was first released in 3.5.0. + - Fix OOM handling in memalign() and valloc(). A variant of this bug existed + in all releases since 2.0.0, which introduced these functions. + - Fix an OOM-related regression in arena_tcache_fill_small(), which could + cause cache corruption on OOM. This regression was present in all releases + from 2.2.0 through 3.6.0. + - Fix size class overflow handling for malloc(), posix_memalign(), memalign(), + calloc(), and realloc() when profiling is enabled. + - Fix the "arena..dss" mallctl to return an error if "primary" or + "secondary" precedence is specified, but sbrk(2) is not supported. + - Fix fallback lg_floor() implementations to handle extremely large inputs. + - Ensure the default purgeable zone is after the default zone on OS X. + - Fix latent bugs in atomic_*(). + - Fix the "arena..dss" mallctl to handle read-only calls. + - Fix tls_model configuration to enable the initial-exec model when possible. + - Mark malloc_conf as a weak symbol so that the application can override it. + - Correctly detect glibc's adaptive pthread mutexes. + - Fix the --without-export configure option. + * 3.6.0 (March 31, 2014) This version contains a critical bug fix for a regression present in 3.5.0 and @@ -21,7 +177,7 @@ found in the git revision history: backtracing to be reliable. - Use dss allocation precedence for huge allocations as well as small/large allocations. - - Fix test assertion failure message formatting. This bug did not manifect on + - Fix test assertion failure message formatting. This bug did not manifest on x86_64 systems because of implementation subtleties in va_list. - Fix inconsequential test failures for hash and SFMT code. @@ -516,7 +672,7 @@ found in the git revision history: - Make it possible for the application to manually flush a thread's cache, via the "tcache.flush" mallctl. - Base maximum dirty page count on proportion of active memory. - - Compute various addtional run-time statistics, including per size class + - Compute various additional run-time statistics, including per size class statistics for large objects. - Expose malloc_stats_print(), which can be called repeatedly by the application. Modified: head/contrib/jemalloc/FREEBSD-Xlist ============================================================================== --- head/contrib/jemalloc/FREEBSD-Xlist Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/FREEBSD-Xlist Tue Aug 18 00:21:25 2015 (r286866) @@ -1,6 +1,6 @@ $FreeBSD$ -.git -.gitignore +.autom4te.cfg +.git* FREEBSD-* INSTALL Makefile* @@ -40,7 +40,10 @@ include/jemalloc/jemalloc_protos.h include/jemalloc/jemalloc_protos.h.in include/jemalloc/jemalloc_rename.h include/jemalloc/jemalloc_rename.sh +include/jemalloc/jemalloc_typedefs.h.in include/msvc_compat/ install-sh +jemalloc.pc* +src/valgrind.c src/zone.c test/ Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 00:21:25 2015 (r286866) @@ -1,15 +1,14 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index d8e2e71..330ba2a 100644 +index 8fc774b..47b453c 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in -@@ -57,12 +57,23 @@ +@@ -53,6 +53,17 @@ This manual describes jemalloc @jemalloc_version@. More information can be found at the jemalloc website. + + The following configuration options are enabled in libc's built-in -+ jemalloc: , -+ , , ++ jemalloc: , + , , + , , + , , and @@ -17,17 +16,11 @@ index d8e2e71..330ba2a 100644 + is enabled in development versions of + FreeBSD (controlled by the MALLOC_PRODUCTION make + variable). ++ SYNOPSIS - - #include <stdlib.h> --#include <jemalloc/jemalloc.h> -+#include <malloc_np.h> - - Standard API - -@@ -2342,4 +2353,19 @@ malloc_conf = "lg_chunk:24";]]> +@@ -2759,4 +2770,18 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). @@ -38,9 +31,8 @@ index d8e2e71..330ba2a 100644 + FreeBSD 7.0. + + The aligned_alloc, -+ malloc_stats_print, -+ mallctl*, and -+ *allocm functions first appeared in ++ malloc_stats_print, and ++ mallctl* functions first appeared in + FreeBSD 10.0. + + The *allocx functions first appeared @@ -48,20 +40,11 @@ index d8e2e71..330ba2a 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 574bbb1..e3eafdf 100644 +index 7a137b6..b0001e9 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in -@@ -1,5 +1,8 @@ - #ifndef JEMALLOC_INTERNAL_H - #define JEMALLOC_INTERNAL_H -+#include "libc_private.h" -+#include "namespace.h" -+ - #include - #ifdef _WIN32 - # include -@@ -65,6 +68,9 @@ typedef intptr_t ssize_t; - #include +@@ -8,6 +8,9 @@ + #include #endif +#include "un-namespace.h" @@ -70,7 +53,7 @@ index 574bbb1..e3eafdf 100644 #define JEMALLOC_NO_DEMANGLE #ifdef JEMALLOC_JET # define JEMALLOC_N(n) jet_##n -@@ -99,13 +105,7 @@ static const bool config_fill = +@@ -42,13 +45,7 @@ static const bool config_fill = false #endif ; @@ -85,11 +68,25 @@ index 574bbb1..e3eafdf 100644 static const bool config_prof = #ifdef JEMALLOC_PROF true +diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h b/include/jemalloc/internal/jemalloc_internal_decls.h +index a601d6e..e7094b2 100644 +--- a/include/jemalloc/internal/jemalloc_internal_decls.h ++++ b/include/jemalloc/internal/jemalloc_internal_decls.h +@@ -1,6 +1,9 @@ + #ifndef JEMALLOC_INTERNAL_DECLS_H + #define JEMALLOC_INTERNAL_DECLS_H + ++#include "libc_private.h" ++#include "namespace.h" ++ + #include + #ifdef _WIN32 + # include diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h -index de44e14..564d604 100644 +index f051f29..561378f 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h -@@ -43,9 +43,6 @@ struct malloc_mutex_s { +@@ -47,15 +47,13 @@ struct malloc_mutex_s { #ifdef JEMALLOC_LAZY_LOCK extern bool isthreaded; @@ -99,24 +96,31 @@ index de44e14..564d604 100644 #endif bool malloc_mutex_init(malloc_mutex_t *mutex); + void malloc_mutex_prefork(malloc_mutex_t *mutex); + void malloc_mutex_postfork_parent(malloc_mutex_t *mutex); + void malloc_mutex_postfork_child(malloc_mutex_t *mutex); ++bool malloc_mutex_first_thread(void); + bool mutex_boot(void); + + #endif /* JEMALLOC_H_EXTERNS */ diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index 93516d2..22f9af9 100644 +index dbf6aa7..f87dba8 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt -@@ -226,7 +226,6 @@ iralloc - iralloct - iralloct_realign +@@ -277,7 +277,6 @@ iralloct_realign isalloc + isdalloct + isqalloc -isthreaded ivsalloc ixalloc jemalloc_postfork_child diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..94554bc +index 0000000..66d6da5 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,134 @@ +@@ -0,0 +1,137 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -192,6 +196,7 @@ index 0000000..94554bc +#undef je_realloc +#undef je_free +#undef je_posix_memalign ++#undef je_aligned_alloc +#undef je_malloc_usable_size +#undef je_mallocx +#undef je_rallocx @@ -209,6 +214,7 @@ index 0000000..94554bc +#define je_realloc __realloc +#define je_free __free +#define je_posix_memalign __posix_memalign ++#define je_aligned_alloc __aligned_alloc +#define je_malloc_usable_size __malloc_usable_size +#define je_mallocx __mallocx +#define je_rallocx __rallocx @@ -238,6 +244,7 @@ index 0000000..94554bc +__weak_reference(__realloc, realloc); +__weak_reference(__free, free); +__weak_reference(__posix_memalign, posix_memalign); ++__weak_reference(__aligned_alloc, aligned_alloc); +__weak_reference(__malloc_usable_size, malloc_usable_size); +__weak_reference(__mallocx, mallocx); +__weak_reference(__rallocx, rallocx); @@ -263,32 +270,142 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 204778b..9e5f2df 100644 +index ed7863b..d078a1f 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c -@@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL) - malloc_tsd_data(, thread_allocated, thread_allocated_t, - THREAD_ALLOCATED_INITIALIZER) +@@ -4,6 +4,10 @@ + /******************************************************************************/ + /* Data. */ +/* Work around : */ +const char *__malloc_options_1_0 = NULL; +__sym_compat(_malloc_options, __malloc_options_1_0, FBSD_1.0); + /* Runtime configuration options. */ - const char *je_malloc_conf; + const char *je_malloc_conf JEMALLOC_ATTR(weak); bool opt_abort = -@@ -457,7 +461,8 @@ malloc_conf_init(void) - #endif - ; +@@ -2475,6 +2479,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) + */ + /******************************************************************************/ + /* ++ * Begin compatibility functions. ++ */ ++ ++#define ALLOCM_LG_ALIGN(la) (la) ++#define ALLOCM_ALIGN(a) (ffsl(a)-1) ++#define ALLOCM_ZERO ((int)0x40) ++#define ALLOCM_NO_MOVE ((int)0x80) ++ ++#define ALLOCM_SUCCESS 0 ++#define ALLOCM_ERR_OOM 1 ++#define ALLOCM_ERR_NOT_MOVED 2 ++ ++int ++je_allocm(void **ptr, size_t *rsize, size_t size, int flags) ++{ ++ void *p; ++ ++ assert(ptr != NULL); ++ ++ p = je_mallocx(size, flags); ++ if (p == NULL) ++ return (ALLOCM_ERR_OOM); ++ if (rsize != NULL) ++ *rsize = isalloc(p, config_prof); ++ *ptr = p; ++ return (ALLOCM_SUCCESS); ++} ++ ++int ++je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags) ++{ ++ int ret; ++ bool no_move = flags & ALLOCM_NO_MOVE; ++ ++ assert(ptr != NULL); ++ assert(*ptr != NULL); ++ assert(size != 0); ++ assert(SIZE_T_MAX - size >= extra); ++ ++ if (no_move) { ++ size_t usize = je_xallocx(*ptr, size, extra, flags); ++ ret = (usize >= size) ? ALLOCM_SUCCESS : ALLOCM_ERR_NOT_MOVED; ++ if (rsize != NULL) ++ *rsize = usize; ++ } else { ++ void *p = je_rallocx(*ptr, size+extra, flags); ++ if (p != NULL) { ++ *ptr = p; ++ ret = ALLOCM_SUCCESS; ++ } else ++ ret = ALLOCM_ERR_OOM; ++ if (rsize != NULL) ++ *rsize = isalloc(*ptr, config_prof); ++ } ++ return (ret); ++} ++ ++int ++je_sallocm(const void *ptr, size_t *rsize, int flags) ++{ ++ ++ assert(rsize != NULL); ++ *rsize = je_sallocx(ptr, flags); ++ return (ALLOCM_SUCCESS); ++} ++ ++int ++je_dallocm(void *ptr, int flags) ++{ ++ ++ je_dallocx(ptr, flags); ++ return (ALLOCM_SUCCESS); ++} ++ ++int ++je_nallocm(size_t *rsize, size_t size, int flags) ++{ ++ size_t usize; ++ ++ usize = je_nallocx(size, flags); ++ if (usize == 0) ++ return (ALLOCM_ERR_OOM); ++ if (rsize != NULL) ++ *rsize = usize; ++ return (ALLOCM_SUCCESS); ++} ++ ++#undef ALLOCM_LG_ALIGN ++#undef ALLOCM_ALIGN ++#undef ALLOCM_ZERO ++#undef ALLOCM_NO_MOVE ++ ++#undef ALLOCM_SUCCESS ++#undef ALLOCM_ERR_OOM ++#undef ALLOCM_ERR_NOT_MOVED ++ ++/* ++ * End compatibility functions. ++ */ ++/******************************************************************************/ ++/* + * The following functions are used by threading libraries for protection of + * malloc during fork(). + */ +@@ -2575,4 +2680,11 @@ jemalloc_postfork_child(void) + ctl_postfork_child(); + } -- if ((opts = getenv(envname)) != NULL) { -+ if (issetugid() == 0 && (opts = getenv(envname)) != -+ NULL) { - /* - * Do nothing; opts is already initialized to - * the value of the MALLOC_CONF environment ++void ++_malloc_first_thread(void) ++{ ++ ++ (void)malloc_mutex_first_thread(); ++} ++ + /******************************************************************************/ diff --git a/src/mutex.c b/src/mutex.c -index 788eca3..6f5954e 100644 +index 2d47af9..934d5aa 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, @@ -296,21 +413,45 @@ index 788eca3..6f5954e 100644 JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, void *(calloc_cb)(size_t, size_t)); + -+__weak_reference(_pthread_mutex_init_calloc_cb_stub, -+ _pthread_mutex_init_calloc_cb); -+ ++#pragma weak _pthread_mutex_init_calloc_cb +int -+_pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex, ++_pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, + void *(calloc_cb)(size_t, size_t)) +{ + -+ return (0); ++ return (((int (*)(pthread_mutex_t *, void *(*)(size_t, size_t))) ++ __libc_interposing[INTERPOS__pthread_mutex_init_calloc_cb])(mutex, ++ calloc_cb)); +} #endif bool +@@ -137,7 +148,7 @@ malloc_mutex_postfork_child(malloc_mutex_t *mutex) + } + + bool +-mutex_boot(void) ++malloc_mutex_first_thread(void) + { + + #ifdef JEMALLOC_MUTEX_INIT_CB +@@ -151,3 +162,14 @@ mutex_boot(void) + #endif + return (false); + } ++ ++bool ++mutex_boot(void) ++{ ++ ++#ifndef JEMALLOC_MUTEX_INIT_CB ++ return (malloc_mutex_first_thread()); ++#else ++ return (false); ++#endif ++} diff --git a/src/util.c b/src/util.c -index 93a19fd..70b3e45 100644 +index 4cb0d6c..25b61c2 100644 --- a/src/util.c +++ b/src/util.c @@ -58,6 +58,22 @@ wrtmessage(void *cbopaque, const char *s) Modified: head/contrib/jemalloc/FREEBSD-upgrade ============================================================================== --- head/contrib/jemalloc/FREEBSD-upgrade Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/FREEBSD-upgrade Tue Aug 18 00:21:25 2015 (r286866) @@ -80,7 +80,13 @@ do_extract() { } do_diff() { - (cd ${work}; git add -A; git diff --cached) > FREEBSD-diffs + ( + cd ${work} + find . -name '*.orig' -delete + find . -name '*.rej' -delete + git add -A + git diff --cached + ) > FREEBSD-diffs } command=$1 Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/VERSION Tue Aug 18 00:21:25 2015 (r286866) @@ -1 +1 @@ -3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 +4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Mon Aug 17 23:44:38 2015 (r286865) +++ head/contrib/jemalloc/doc/jemalloc.3 Tue Aug 18 00:21:25 2015 (r286866) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 03/31/2014 +.\" Date: 08/17/2015 .\" Manual: User Manual -.\" Source: jemalloc 3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 +.\" Source: jemalloc 4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2 .\" Language: English .\" -.TH "JEMALLOC" "3" "03/31/2014" "jemalloc 3.6.0-0-g46c0af68bd24" "User Manual" +.TH "JEMALLOC" "3" "08/17/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,12 +31,10 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 3\&.6\&.0\-0\-g46c0af68bd248b04df75e4f92d5fb804c3d75340\&. More information can be found at the +This manual describes jemalloc 4\&.0\&.0\-0\-g6e98caf8f064482b9ab292ef3638dea67420bbc2\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: -\fB\-\-enable\-dss\fR, -\fB\-\-enable\-experimental\fR, \fB\-\-enable\-fill\fR, \fB\-\-enable\-lazy\-lock\fR, \fB\-\-enable\-munmap\fR, @@ -53,8 +51,7 @@ make variable)\&. .sp .ft B .nf -#include -#include +#include .fi .ft .SS "Standard API" @@ -81,6 +78,8 @@ make variable)\&. .BI "size_t sallocx(void\ *" "ptr" ", int\ " "flags" ");" .HP \w'void\ dallocx('u .BI "void dallocx(void\ *" "ptr" ", int\ " "flags" ");" +.HP \w'void\ sdallocx('u +.BI "void sdallocx(void\ *" "ptr" ", size_t\ " "size" ", int\ " "flags" ");" .HP \w'size_t\ nallocx('u .BI "size_t nallocx(size_t\ " "size" ", int\ " "flags" ");" .HP \w'int\ mallctl('u @@ -97,17 +96,6 @@ make variable)\&. .BI "void (*malloc_message)(void\ *" "cbopaque" ", const\ char\ *" "s" ");" .PP const char *\fImalloc_conf\fR; -.SS "Experimental API" -.HP \w'int\ allocm('u -.BI "int allocm(void\ **" "ptr" ", size_t\ *" "rsize" ", size_t\ " "size" ", int\ " "flags" ");" -.HP \w'int\ rallocm('u -.BI "int rallocm(void\ **" "ptr" ", size_t\ *" "rsize" ", size_t\ " "size" ", size_t\ " "extra" ", int\ " "flags" ");" -.HP \w'int\ sallocm('u -.BI "int sallocm(const\ void\ *" "ptr" ", size_t\ *" "rsize" ", int\ " "flags" ");" -.HP \w'int\ dallocm('u -.BI "int dallocm(void\ *" "ptr" ", int\ " "flags" ");" -.HP \w'int\ nallocm('u -.BI "int nallocm(size_t\ *" "rsize" ", size_t\ " "size" ", int\ " "flags" ");" .SH "DESCRIPTION" .SS "Standard API" .PP @@ -134,7 +122,7 @@ The \fBposix_memalign\fR\fB\fR function allocates \fIsize\fR -bytes of memory such that the allocation\*(Aqs base address is an even multiple of +bytes of memory such that the allocation\*(Aqs base address is a multiple of \fIalignment\fR, and returns the allocation in the value pointed to by \fIptr\fR\&. The requested \fIalignment\fR @@ -145,7 +133,7 @@ The \fBaligned_alloc\fR\fB\fR function allocates \fIsize\fR -bytes of memory such that the allocation\*(Aqs base address is an even multiple of +bytes of memory such that the allocation\*(Aqs base address is a multiple of \fIalignment\fR\&. The requested \fIalignment\fR must be a power of 2\&. Behavior is undefined if @@ -188,7 +176,8 @@ The \fBrallocx\fR\fB\fR, \fBxallocx\fR\fB\fR, \fBsallocx\fR\fB\fR, -\fBdallocx\fR\fB\fR, and +\fBdallocx\fR\fB\fR, +\fBsdallocx\fR\fB\fR, and \fBnallocx\fR\fB\fR functions all have a \fIflags\fR @@ -217,11 +206,32 @@ is a power of 2\&. Initialize newly allocated memory to contain zero bytes\&. In the growing reallocation case, the real size prior to reallocation defines the boundary between untouched bytes and those that are initialized to contain zero bytes\&. If this macro is absent, newly allocated memory is uninitialized\&. .RE .PP +\fBMALLOCX_TCACHE(\fR\fB\fItc\fR\fR\fB) \fR +.RS 4 +Use the thread\-specific cache (tcache) specified by the identifier +\fItc\fR, which must have been acquired via the +"tcache\&.create" +mallctl\&. This macro does not validate that +\fItc\fR +specifies a valid identifier\&. +.RE +.PP +\fBMALLOCX_TCACHE_NONE\fR +.RS 4 +Do not use a thread\-specific cache (tcache)\&. Unless +\fBMALLOCX_TCACHE(\fR\fB\fItc\fR\fR\fB)\fR +or +\fBMALLOCX_TCACHE_NONE\fR +is specified, an automatically managed tcache will be used under many circumstances\&. This macro cannot be used in the same +\fIflags\fR +argument as +\fBMALLOCX_TCACHE(\fR\fB\fItc\fR\fR\fB)\fR\&. +.RE +.PP \fBMALLOCX_ARENA(\fR\fB\fIa\fR\fR\fB) \fR .RS 4 Use the arena specified by the index -\fIa\fR -(and by necessity bypass the thread cache)\&. This macro has no effect for huge regions, nor for regions that were allocated via an arena other than the one specified\&. This macro does not validate that +\fIa\fR\&. This macro has no effect for regions that were allocated via an arena other than the one specified\&. This macro does not validate that \fIa\fR specifies an arena index in the valid range\&. .RE @@ -274,6 +284,17 @@ function causes the memory referenced by to be made available for future allocations\&. .PP The +\fBsdallocx\fR\fB\fR +function is an extension of +\fBdallocx\fR\fB\fR +with a +\fIsize\fR +parameter to allow the caller to pass in the allocation size as an optimization\&. The minimum valid input size is the original requested size of the allocation, and the maximum valid input size is the corresponding value returned by +\fBnallocx\fR\fB\fR +or +\fBsallocx\fR\fB\fR\&. +.PP +The \fBnallocx\fR\fB\fR function allocates no memory, but it performs the same size computation as the \fBmallocx\fR\fB\fR @@ -367,7 +388,7 @@ uses the \fBmallctl*\fR\fB\fR functions internally, so inconsistent statistics can be reported if multiple threads use these functions simultaneously\&. If \fB\-\-enable\-stats\fR -is specified during configuration, \(lqm\(rq and \(lqa\(rq can be specified to omit merged arena and per arena statistics, respectively; \(lqb\(rq and \(lql\(rq can be specified to omit per size class statistics for bins and large objects, respectively\&. Unrecognized characters are silently ignored\&. Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations\&. +is specified during configuration, \(lqm\(rq and \(lqa\(rq can be specified to omit merged arena and per arena statistics, respectively; \(lqb\(rq, \(lql\(rq, and \(lqh\(rq can be specified to omit per size class statistics for bins, large objects, and huge objects, respectively\&. Unrecognized characters are silently ignored\&. Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations\&. .PP The \fBmalloc_usable_size\fR\fB\fR @@ -378,126 +399,6 @@ function is not a mechanism for in\-plac \fBrealloc\fR\fB\fR; rather it is provided solely as a tool for introspection purposes\&. Any discrepancy between the requested allocation size and the size reported by \fBmalloc_usable_size\fR\fB\fR should not be depended on, since such behavior is entirely implementation\-dependent\&. -.SS "Experimental API" -.PP -The experimental API is subject to change or removal without regard for backward compatibility\&. If -\fB\-\-disable\-experimental\fR -is specified during configuration, the experimental API is omitted\&. -.PP -The -\fBallocm\fR\fB\fR, -\fBrallocm\fR\fB\fR, -\fBsallocm\fR\fB\fR, -\fBdallocm\fR\fB\fR, and -\fBnallocm\fR\fB\fR -functions all have a -\fIflags\fR -argument that can be used to specify options\&. The functions only check the options that are contextually relevant\&. Use bitwise or (|) operations to specify one or more of the following: -.PP -\fBALLOCM_LG_ALIGN(\fR\fB\fIla\fR\fR\fB) \fR -.RS 4 -Align the memory allocation to start at an address that is a multiple of -(1 << \fIla\fR)\&. This macro does not validate that -\fIla\fR -is within the valid range\&. -.RE -.PP -\fBALLOCM_ALIGN(\fR\fB\fIa\fR\fR\fB) \fR -.RS 4 -Align the memory allocation to start at an address that is a multiple of -\fIa\fR, where -\fIa\fR -is a power of two\&. This macro does not validate that -\fIa\fR -is a power of 2\&. -.RE -.PP -\fBALLOCM_ZERO\fR -.RS 4 -Initialize newly allocated memory to contain zero bytes\&. In the growing reallocation case, the real size prior to reallocation defines the boundary between untouched bytes and those that are initialized to contain zero bytes\&. If this macro is absent, newly allocated memory is uninitialized\&. -.RE -.PP -\fBALLOCM_NO_MOVE\fR -.RS 4 -For reallocation, fail rather than moving the object\&. This constraint can apply to both growth and shrinkage\&. -.RE -.PP -\fBALLOCM_ARENA(\fR\fB\fIa\fR\fR\fB) \fR -.RS 4 -Use the arena specified by the index -\fIa\fR -(and by necessity bypass the thread cache)\&. This macro has no effect for huge regions, nor for regions that were allocated via an arena other than the one specified\&. This macro does not validate that -\fIa\fR -specifies an arena index in the valid range\&. -.RE -.PP -The -\fBallocm\fR\fB\fR -function allocates at least -\fIsize\fR -bytes of memory, sets -\fI*ptr\fR -to the base address of the allocation, and sets -\fI*rsize\fR -to the real size of the allocation if -\fIrsize\fR -is not -\fBNULL\fR\&. Behavior is undefined if -\fIsize\fR -is -\fB0\fR, or if request size overflows due to size class and/or alignment constraints\&. -.PP -The -\fBrallocm\fR\fB\fR -function resizes the allocation at -\fI*ptr\fR -to be at least -\fIsize\fR -bytes, sets -\fI*ptr\fR -to the base address of the allocation if it moved, and sets -\fI*rsize\fR -to the real size of the allocation if -\fIrsize\fR -is not -\fBNULL\fR\&. If -\fIextra\fR -is non\-zero, an attempt is made to resize the allocation to be at least -(\fIsize\fR + \fIextra\fR) -bytes, though inability to allocate the extra byte(s) will not by itself result in failure\&. Behavior is undefined if -\fIsize\fR -is -\fB0\fR, if request size overflows due to size class and/or alignment constraints, or if -(\fIsize\fR + \fIextra\fR > \fBSIZE_T_MAX\fR)\&. -.PP -The -\fBsallocm\fR\fB\fR -function sets -\fI*rsize\fR -to the real size of the allocation\&. -.PP -The -\fBdallocm\fR\fB\fR -function causes the memory referenced by -\fIptr\fR -to be made available for future allocations\&. -.PP -The -\fBnallocm\fR\fB\fR -function allocates no memory, but it performs the same size computation as the -\fBallocm\fR\fB\fR -function, and if -\fIrsize\fR -is not -\fBNULL\fR -it sets -\fI*rsize\fR -to the real size of the allocation that would result from the equivalent -\fBallocm\fR\fB\fR -function call\&. Behavior is undefined if -\fIsize\fR -is -\fB0\fR, or if request size overflows due to size class and/or alignment constraints\&. .SH "TUNING" .PP Once, when the first call is made to one of the memory allocation routines, the allocator initializes its internals based in part on various options that can be specified at compile\- or run\-time\&. @@ -535,8 +436,8 @@ options\&. Some options have boolean val Traditionally, allocators have used \fBsbrk\fR(2) to obtain memory, which is suboptimal for several reasons, including race conditions, increased fragmentation, and artificial limitations on maximum usable memory\&. If -\fB\-\-enable\-dss\fR -is specified during configuration, this allocator uses both +\fBsbrk\fR(2) +is supported by the operating system, this allocator uses both \fBmmap\fR(2) and \fBsbrk\fR(2), in that order of preference; otherwise only @@ -551,18 +452,29 @@ is specified during configuration, this .PP Memory is conceptually broken into equal\-sized chunks, where the chunk size is a power of two that is greater than the page size\&. Chunks are always aligned to multiples of the chunk size\&. This alignment makes it possible to find metadata for user objects very quickly\&. .PP -User objects are broken into three categories according to size: small, large, and huge\&. Small objects are smaller than one page\&. Large objects are smaller than the chunk size\&. Huge objects are a multiple of the chunk size\&. Small and large objects are managed by arenas; huge objects are managed separately in a single data structure that is shared by all threads\&. Huge objects are used by applications infrequently enough that this single data structure is not a scalability issue\&. +User objects are broken into three categories according to size: small, large, and huge\&. Small and large objects are managed entirely by arenas; huge objects are additionally aggregated in a single data structure that is shared by all threads\&. Huge objects are typically used by applications infrequently enough that this single data structure is not a scalability issue\&. .PP Each chunk that is managed by an arena tracks its contents as runs of contiguous pages (unused, backing a set of small objects, or backing one large object)\&. The combination of chunk alignment and chunk page maps makes it possible to determine all metadata regarding small and large allocations in constant time\&. .PP -Small objects are managed in groups by page runs\&. Each run maintains a frontier and free list to track which regions are in use\&. Allocation requests that are no more than half the quantum (8 or 16, depending on architecture) are rounded up to the nearest power of two that is at least -sizeof(\fBdouble\fR)\&. All other small object size classes are multiples of the quantum, spaced such that internal fragmentation is limited to approximately 25% for all but the smallest size classes\&. Allocation requests that are larger than the maximum small size class, but small enough to fit in an arena\-managed chunk (see the +Small objects are managed in groups by page runs\&. Each run maintains a bitmap to track which regions are in use\&. Allocation requests that are no more than half the quantum (8 or 16, depending on architecture) are rounded up to the nearest power of two that is at least +sizeof(\fBdouble\fR)\&. All other object size classes are multiples of the quantum, spaced such that there are four size classes for each doubling in size, which limits internal fragmentation to approximately 20% for all but the smallest size classes\&. Small size classes are smaller than four times the page size, large size classes are smaller than the chunk size (see the "opt\&.lg_chunk" -option), are rounded up to the nearest run size\&. Allocation requests that are too large to fit in an arena\-managed chunk are rounded up to the nearest multiple of the chunk size\&. +option), and huge size classes extend from the chunk size up to one size class less than the full address space size\&. .PP Allocations are packed tightly together, which can be an issue for multi\-threaded applications\&. If you need to assure that allocations do not suffer from cacheline sharing, round your allocation requests up to the nearest multiple of the cacheline size, or specify cacheline alignment when allocating\&. .PP -Assuming 4 MiB chunks, 4 KiB pages, and a 16\-byte quantum on a 64\-bit system, the size classes in each category are as shown in +The +\fBrealloc\fR\fB\fR, +\fBrallocx\fR\fB\fR, and +\fBxallocx\fR\fB\fR +functions may resize allocations without moving them under limited circumstances\&. Unlike the +\fB*allocx\fR\fB\fR +API, the standard API does not officially round up the usable size of an allocation to the nearest size class, so technically it is necessary to call +\fBrealloc\fR\fB\fR +to grow e\&.g\&. a 9\-byte allocation to 16 bytes, or shrink a 16\-byte allocation to 9 bytes\&. Growth and shrinkage trivially succeeds in place as long as the pre\-size and post\-size both round up to the same size class\&. No other API guarantees are made regarding in\-place resizing, but the current implementation also tries to resize large and huge allocations in place, as long as the pre\-size and post\-size are both large or both huge\&. In such cases shrinkage always succeeds for large size classes, but for huge size classes the chunk allocator must support splitting (see +"arena\&.\&.chunk_hooks")\&. Growth only succeeds if the trailing memory is currently available, and additionally for huge size classes the chunk allocator must support merging\&. +.PP +Assuming 2 MiB chunks, 4 KiB pages, and a 16\-byte quantum on a 64\-bit system, the size classes in each category are as shown in Table 1\&. .sp .it 1 an-trap @@ -588,8 +500,23 @@ l r l ^ r l ^ r l ^ r l +^ r l +^ r l +l r l +^ r l +^ r l +^ r l +^ r l +^ r l +^ r l +^ r l l r l -l r l. +^ r l +^ r l +^ r l +^ r l +^ r l +^ r l. T{ Small T}:T{ @@ -600,7 +527,7 @@ T} :T{ 16 T}:T{ -[16, 32, 48, \&.\&.\&., 128] +[16, 32, 48, 64, 80, 96, 112, 128] T} :T{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 18 00:47:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CAF99BB63C; Tue, 18 Aug 2015 00:47:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5381EFA9; Tue, 18 Aug 2015 00:47:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I0l3hx024735; Tue, 18 Aug 2015 00:47:03 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I0l2qr024733; Tue, 18 Aug 2015 00:47:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508180047.t7I0l2qr024733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Aug 2015 00:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286867 - in head/sys/dev/vt: . hw/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 00:47:03 -0000 Author: marcel Date: Tue Aug 18 00:47:02 2015 New Revision: 286867 URL: https://svnweb.freebsd.org/changeset/base/286867 Log: Support frame buffers that are larger than the default screen size as defined by VT_FB_DEFAULT_WIDTH and VT_FB_DEFAULT_HEIGHT (at this time 2048x1200). The default is really a max. We cap the height and width to those defaults and position the screen in the center of the frame buffer. Ideally we use a bigger font to utility the entire real estate that is the frame buffer, but that's seen as an improvement over making it work first. PR: 193745 Modified: head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Tue Aug 18 00:21:25 2015 (r286866) +++ head/sys/dev/vt/hw/fb/vt_fb.c Tue Aug 18 00:47:02 2015 (r286867) @@ -294,6 +294,7 @@ vt_fb_bitblt_bitmap(struct vt_device *vd if (mask != NULL && (mask[byte] & bit) == 0) continue; o = (y + yi) * info->fb_stride + (x + xi) * bpp; + o += vd->vd_transpose; cc = pattern[byte] & bit ? fgc : bgc; switch(bpp) { @@ -411,11 +412,16 @@ int vt_fb_init(struct vt_device *vd) { struct fb_info *info; + u_int margin; int err; info = vd->vd_softc; - vd->vd_height = info->fb_height; - vd->vd_width = info->fb_width; + vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + margin = (info->fb_height - vd->vd_height) >> 1; + vd->vd_transpose = margin * info->fb_stride; + vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + margin = (info->fb_width - vd->vd_width) >> 1; + vd->vd_transpose += margin * (info->fb_bpp / NBBY); vd->vd_video_dev = info->fb_video_dev; if (info->fb_size == 0) Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Aug 18 00:21:25 2015 (r286866) +++ head/sys/dev/vt/vt.h Tue Aug 18 00:47:02 2015 (r286867) @@ -140,6 +140,7 @@ struct vt_device { uint32_t vd_mstate; /* (?) Mouse state. */ vt_axis_t vd_width; /* (?) Screen width. */ vt_axis_t vd_height; /* (?) Screen height. */ + size_t vd_transpose; /* (?) Screen offset in FB */ struct mtx vd_lock; /* Per-device lock. */ struct cv vd_winswitch; /* (d) Window switch notify. */ struct callout vd_timer; /* (d) Display timer. */ From owner-svn-src-head@freebsd.org Tue Aug 18 01:16:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A72D29BB90D; Tue, 18 Aug 2015 01:16:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B06C1BAD; Tue, 18 Aug 2015 01:16:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qged69 with SMTP id d69so106680899qge.0; Mon, 17 Aug 2015 18:16:28 -0700 (PDT) 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=FqFgY2F57HvIvxTuMtxLipXVqXL67RGDBafkC/TANQA=; b=ZCE7y3lb7350BHW2XiTZ0d1NpjOrPKxveBNmx9/lkkv7LFb4QWS+gDTCyp6qofxe00 nrHnOy/izIlrTOUs0GvmX0usdfa5GU90Tj2c0/NuLC6QJYsktRkDl1eEa/EHSTuB0QUI bx5Fu1JhEE/Amd41Lg3V38tUJIkEMMt8Km0SRTkSVef1nJZGE/lvNEZrLJlZVQ4jykNj WVW4zbj15hR+wI9LSRmv/Cx9FPlV9tGwW0dSj4jsx5D+IuwrqJ+ScUoHyQA3P8sIDF0/ O4tkfJn4wIDPTVzhNM48vKz+qvchVOYWhzCxZpdg5GH/IHkQm7IWiLZs8UXhFJAsE4m9 OmPA== MIME-Version: 1.0 X-Received: by 10.140.144.83 with SMTP id 80mr8032639qhq.54.1439860588544; Mon, 17 Aug 2015 18:16:28 -0700 (PDT) Received: by 10.140.18.211 with HTTP; Mon, 17 Aug 2015 18:16:28 -0700 (PDT) In-Reply-To: <201508180021.t7I0LQwE016289@repo.freebsd.org> References: <201508180021.t7I0LQwE016289@repo.freebsd.org> Date: Mon, 17 Aug 2015 18:16:28 -0700 Message-ID: Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: NGie Cooper To: Jason Evans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 01:16:29 -0000 On Mon, Aug 17, 2015 at 5:21 PM, Jason Evans wrote: > Author: jasone > Date: Tue Aug 18 00:21:25 2015 > New Revision: 286866 > URL: https://svnweb.freebsd.org/changeset/base/286866 > > Log: > Update jemalloc to version 4.0.0. Relnotes: yes! Also, is there a summary of the changes that can be provided here, or should the reader get this information from the ChangeLog? Thanks! -NGie From owner-svn-src-head@freebsd.org Tue Aug 18 01:53:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCC49BB127; Tue, 18 Aug 2015 01:53:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 210A01099; Tue, 18 Aug 2015 01:53:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I1rfho049377; Tue, 18 Aug 2015 01:53:41 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I1rfAQ049376; Tue, 18 Aug 2015 01:53:41 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508180153.t7I1rfAQ049376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Aug 2015 01:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286868 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 01:53:42 -0000 Author: marcel Date: Tue Aug 18 01:53:41 2015 New Revision: 286868 URL: https://svnweb.freebsd.org/changeset/base/286868 Log: Add 24 more page table pages we allocate on boot-up. 16MB slop is a little tight in and by itself, but severily insufficient when one needs to map a large frame buffer as part of console initialization. 64MB slop should be enough for a while. As an example: a 15" MacBook Pro with retina display needs ~28MB of KVA for the frame buffer. PR: 193745 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 18 00:47:02 2015 (r286867) +++ head/sys/amd64/amd64/pmap.c Tue Aug 18 01:53:41 2015 (r286868) @@ -699,8 +699,14 @@ nkpt_init(vm_paddr_t addr) * pmap_growkernel() will need to allocate page table pages to map * the entire 512GB of KVA space which is an unnecessary tax on * physical memory. + * + * Secondly, device memory mapped as part of setting up the low- + * level console(s) is taken from KVA, starting at virtual_avail. + * This is because cninit() is called after pmap_bootstrap() but + * before vm_init() and pmap_init(). 20MB for a frame buffer is + * not uncommon. */ - pt_pages += 8; /* 16MB additional slop for kernel modules */ + pt_pages += 32; /* 64MB additional slop. */ #endif nkpt = pt_pages; } From owner-svn-src-head@freebsd.org Tue Aug 18 04:36:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BFC89BB3CF for ; Tue, 18 Aug 2015 04:36:00 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from vfemail.net (ninezero.vfemail.net [96.30.253.190]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3551ACC for ; Tue, 18 Aug 2015 04:35:59 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: (qmail 99970 invoked by uid 89); 18 Aug 2015 04:35:53 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 18 Aug 2015 04:35:53 -0000 Received: (qmail 99948 invoked by uid 89); 18 Aug 2015 04:35:35 -0000 Received: by simscan 1.3.1 ppid: 99940, pid: 99944, t: 0.0041s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 18 Aug 2015 04:35:35 -0000 Received: (qmail 4135 invoked by uid 89); 18 Aug 2015 04:35:35 -0000 Received: by simscan 1.4.0 ppid: 4122, pid: 4132, t: 0.7762s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 18 Aug 2015 04:35:34 -0000 From: Jan Beich To: Jason Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... References: <201508180021.t7I0LQwE016289@repo.freebsd.org> Date: Tue, 18 Aug 2015 06:35:21 +0200 In-Reply-To: <201508180021.t7I0LQwE016289@repo.freebsd.org> (Jason Evans's message of "Tue, 18 Aug 2015 00:21:26 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 04:36:00 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jason Evans writes: > Author: jasone > Date: Tue Aug 18 00:21:25 2015 > New Revision: 286866 > URL: https://svnweb.freebsd.org/changeset/base/286866 > > Log: > Update jemalloc to version 4.0.0. Can you bump __FreeBSD_version for non-standard API changes? Some ports like www/firefox may want to take advantage of it without complicating configure scripts. > + - Add sdallocx(), which implements sized deallocation. The primary > + optimization over dallocx() is the removal of a metadata read, which= often > + suffers an L1 cache miss. [...] >+ - Remove the *allocm() API, which is superseded by the *allocx() API. Symbol.map and manpages haven't been updated. $ nm -D /lib/libc.so.7 | fgrep sdalloc Index: lib/libc/stdlib/jemalloc/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/libc/stdlib/jemalloc/Makefile.inc (revision 285602) +++ lib/libc/stdlib/jemalloc/Makefile.inc (working copy) @@ -39,12 +39,8 @@ MLINKS+=3D \ jemalloc.3 xallocx.3 \ jemalloc.3 sallocx.3 \ jemalloc.3 dallocx.3 \ + jemalloc.3 sdallocx.3 \ jemalloc.3 nallocx.3 \ =2D jemalloc.3 allocm.3 \ =2D jemalloc.3 rallocm.3 \ =2D jemalloc.3 sallocm.3 \ =2D jemalloc.3 dallocm.3 \ =2D jemalloc.3 nallocm.3 \ jemalloc.3 malloc.conf.5 =20 .if defined(MALLOC_PRODUCTION) Index: lib/libc/stdlib/jemalloc/Symbol.map =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/libc/stdlib/jemalloc/Symbol.map (revision 285602) +++ lib/libc/stdlib/jemalloc/Symbol.map (working copy) @@ -51,6 +51,11 @@ FBSD_1.3 { __nallocm; }; =20 +FBSD_1.4 { + sdallocx; + __sdallocx; +}; + FBSDprivate_1.0 { _malloc_thread_cleanup; _malloc_prefork; --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJV0rYJXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b0wUIAI99rKCt2tpipJ8Dup4LhJYo eTjiG72lei0fDX9dObTNVpf+hZoyBoZ8WGf+5YLeIw3jk+0xIJ2DSCaMIjnthus7 K+6IcnmfL1Bk8JC3n9YhsJIVngeG05YPK+Ah+UH5v6qFVBlVqWG+ynL1oti3Cidv /AlLoydOccEgg42V6HnVRVwAn3wmCVmag4JP1qEmo3rto4WwU2iY1/sjEFw/9w4r cWvcAnC5c/wadxxCGeKPvhcbHyd8Sc365pMzM3NGQoemjMeSYcwwVJn76IuoPlO/ QHMbrO+x8q1NLcj98BMTGMBnIXw0kzKUP6gI5jFvLEPVtNU2E4yzSh2pOyKWDF8= =v2HX -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Tue Aug 18 04:37:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A829BB491 for ; Tue, 18 Aug 2015 04:37:21 +0000 (UTC) (envelope-from pubannu@ns305830.ovh.net) Received: from ns305830.ovh.net (unknown [IPv6:2001:41d0:2:8507::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C169B1D74 for ; Tue, 18 Aug 2015 04:37:21 +0000 (UTC) (envelope-from pubannu@ns305830.ovh.net) Received: by ns305830.ovh.net (Postfix, from userid 10018) id 34E4D47C97B2; Tue, 18 Aug 2015 03:59:31 +0200 (CEST) To: svn-src-head@freebsd.org Subject: We could not deliver your parcel, #00000530657 X-PHP-Originating-Script: 10018:post.php(13) : eval()'d code Date: Tue, 18 Aug 2015 03:59:31 +0200 From: "FedEx Ground" Reply-To: "FedEx Ground" Message-ID: <3ddbf67f78a292166e57cfd2b7795d57@actusports.fr> X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 04:37:22 -0000 Dear Customer, We could not deliver your item. Shipment Label is attached to this email. Yours faithfully, Perry Lancaster, Station Manager. From owner-svn-src-head@freebsd.org Tue Aug 18 06:16:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BAB29BC5A0; Tue, 18 Aug 2015 06:16:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 092B3803; Tue, 18 Aug 2015 06:16:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I6GJ1Y057632; Tue, 18 Aug 2015 06:16:19 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I6GJoK057631; Tue, 18 Aug 2015 06:16:19 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508180616.t7I6GJoK057631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 18 Aug 2015 06:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286869 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 06:16:20 -0000 Author: melifaro Date: Tue Aug 18 06:16:19 2015 New Revision: 286869 URL: https://svnweb.freebsd.org/changeset/base/286869 Log: Fix panic when handling non-inet arp message introduced in r286825. Submitted by: delphij Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Aug 18 01:53:41 2015 (r286868) +++ head/sys/netinet/if_ether.c Tue Aug 18 06:16:19 2015 (r286869) @@ -749,7 +749,6 @@ match: } if (ifp->if_addrlen != ah->ar_hln) { - LLE_WUNLOCK(la); ARP_LOG(LOG_WARNING, "from %*D: addr len: new %d, " "i/f %d (ignored)\n", ifp->if_addrlen, (u_char *) ar_sha(ah), ":", ah->ar_hln, From owner-svn-src-head@freebsd.org Tue Aug 18 06:28:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A46639BC997; Tue, 18 Aug 2015 06:28:38 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F06DE4F; Tue, 18 Aug 2015 06:28:38 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I6Sc6n061812; Tue, 18 Aug 2015 06:28:38 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I6Scn4061810; Tue, 18 Aug 2015 06:28:38 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180628.t7I6Scn4061810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 06:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286870 - in head/contrib/jemalloc: . include/jemalloc/internal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 06:28:38 -0000 Author: jasone Date: Tue Aug 18 06:28:37 2015 New Revision: 286870 URL: https://svnweb.freebsd.org/changeset/base/286870 Log: Add jemalloc support for 8 KiB, 16 KiB, and 64 KiB pages. Modified: head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/include/jemalloc/internal/size_classes.h Modified: head/contrib/jemalloc/FREEBSD-upgrade ============================================================================== --- head/contrib/jemalloc/FREEBSD-upgrade Tue Aug 18 06:16:19 2015 (r286869) +++ head/contrib/jemalloc/FREEBSD-upgrade Tue Aug 18 06:28:37 2015 (r286870) @@ -74,7 +74,7 @@ do_extract() { # Generate various files. ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \ --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \ - --with-private-namespace=__ + --with-private-namespace=__ --with-lg-page-sizes=12,13,14,16 gmake dist ) } Modified: head/contrib/jemalloc/include/jemalloc/internal/size_classes.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/size_classes.h Tue Aug 18 06:16:19 2015 (r286869) +++ head/contrib/jemalloc/include/jemalloc/internal/size_classes.h Tue Aug 18 06:28:37 2015 (r286870) @@ -182,305 +182,313 @@ #define LG_LARGE_MINCLASS 14 #endif -#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 12) +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 13) #define SIZE_CLASSES \ /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ SC( 0, 3, 3, 0, yes, 3) \ - \ SC( 1, 3, 3, 1, yes, 3) \ - SC( 2, 4, 4, 1, yes, 4) \ - SC( 3, 4, 4, 2, yes, 4) \ - SC( 4, 4, 4, 3, yes, 4) \ + SC( 2, 3, 3, 2, yes, 3) \ + SC( 3, 3, 3, 3, yes, 3) \ \ - SC( 5, 6, 4, 1, yes, 4) \ - SC( 6, 6, 4, 2, yes, 4) \ - SC( 7, 6, 4, 3, yes, 4) \ - SC( 8, 6, 4, 4, yes, 4) \ + SC( 4, 5, 3, 1, yes, 3) \ + SC( 5, 5, 3, 2, yes, 3) \ + SC( 6, 5, 3, 3, yes, 3) \ + SC( 7, 5, 3, 4, yes, 3) \ \ - SC( 9, 7, 5, 1, yes, 5) \ - SC( 10, 7, 5, 2, yes, 5) \ - SC( 11, 7, 5, 3, yes, 5) \ - SC( 12, 7, 5, 4, yes, 5) \ + SC( 8, 6, 4, 1, yes, 4) \ + SC( 9, 6, 4, 2, yes, 4) \ + SC( 10, 6, 4, 3, yes, 4) \ + SC( 11, 6, 4, 4, yes, 4) \ \ - SC( 13, 8, 6, 1, yes, 6) \ - SC( 14, 8, 6, 2, yes, 6) \ - SC( 15, 8, 6, 3, yes, 6) \ - SC( 16, 8, 6, 4, yes, 6) \ + SC( 12, 7, 5, 1, yes, 5) \ + SC( 13, 7, 5, 2, yes, 5) \ + SC( 14, 7, 5, 3, yes, 5) \ + SC( 15, 7, 5, 4, yes, 5) \ \ - SC( 17, 9, 7, 1, yes, 7) \ - SC( 18, 9, 7, 2, yes, 7) \ - SC( 19, 9, 7, 3, yes, 7) \ - SC( 20, 9, 7, 4, yes, 7) \ + SC( 16, 8, 6, 1, yes, 6) \ + SC( 17, 8, 6, 2, yes, 6) \ + SC( 18, 8, 6, 3, yes, 6) \ + SC( 19, 8, 6, 4, yes, 6) \ \ - SC( 21, 10, 8, 1, yes, 8) \ - SC( 22, 10, 8, 2, yes, 8) \ - SC( 23, 10, 8, 3, yes, 8) \ - SC( 24, 10, 8, 4, yes, 8) \ + SC( 20, 9, 7, 1, yes, 7) \ + SC( 21, 9, 7, 2, yes, 7) \ + SC( 22, 9, 7, 3, yes, 7) \ + SC( 23, 9, 7, 4, yes, 7) \ \ - SC( 25, 11, 9, 1, yes, 9) \ - SC( 26, 11, 9, 2, yes, 9) \ - SC( 27, 11, 9, 3, yes, 9) \ - SC( 28, 11, 9, 4, yes, 9) \ + SC( 24, 10, 8, 1, yes, 8) \ + SC( 25, 10, 8, 2, yes, 8) \ + SC( 26, 10, 8, 3, yes, 8) \ + SC( 27, 10, 8, 4, yes, 8) \ \ - SC( 29, 12, 10, 1, yes, no) \ - SC( 30, 12, 10, 2, yes, no) \ - SC( 31, 12, 10, 3, yes, no) \ - SC( 32, 12, 10, 4, yes, no) \ + SC( 28, 11, 9, 1, yes, 9) \ + SC( 29, 11, 9, 2, yes, 9) \ + SC( 30, 11, 9, 3, yes, 9) \ + SC( 31, 11, 9, 4, yes, 9) \ \ - SC( 33, 13, 11, 1, yes, no) \ - SC( 34, 13, 11, 2, yes, no) \ - SC( 35, 13, 11, 3, yes, no) \ - SC( 36, 13, 11, 4, no, no) \ + SC( 32, 12, 10, 1, yes, no) \ + SC( 33, 12, 10, 2, yes, no) \ + SC( 34, 12, 10, 3, yes, no) \ + SC( 35, 12, 10, 4, yes, no) \ \ - SC( 37, 14, 12, 1, no, no) \ - SC( 38, 14, 12, 2, no, no) \ - SC( 39, 14, 12, 3, no, no) \ - SC( 40, 14, 12, 4, no, no) \ + SC( 36, 13, 11, 1, yes, no) \ + SC( 37, 13, 11, 2, yes, no) \ + SC( 38, 13, 11, 3, yes, no) \ + SC( 39, 13, 11, 4, yes, no) \ \ - SC( 41, 15, 13, 1, no, no) \ - SC( 42, 15, 13, 2, no, no) \ - SC( 43, 15, 13, 3, no, no) \ - SC( 44, 15, 13, 4, no, no) \ + SC( 40, 14, 12, 1, yes, no) \ + SC( 41, 14, 12, 2, yes, no) \ + SC( 42, 14, 12, 3, yes, no) \ + SC( 43, 14, 12, 4, no, no) \ \ - SC( 45, 16, 14, 1, no, no) \ - SC( 46, 16, 14, 2, no, no) \ - SC( 47, 16, 14, 3, no, no) \ - SC( 48, 16, 14, 4, no, no) \ + SC( 44, 15, 13, 1, no, no) \ + SC( 45, 15, 13, 2, no, no) \ + SC( 46, 15, 13, 3, no, no) \ + SC( 47, 15, 13, 4, no, no) \ \ - SC( 49, 17, 15, 1, no, no) \ - SC( 50, 17, 15, 2, no, no) \ - SC( 51, 17, 15, 3, no, no) \ - SC( 52, 17, 15, 4, no, no) \ + SC( 48, 16, 14, 1, no, no) \ + SC( 49, 16, 14, 2, no, no) \ + SC( 50, 16, 14, 3, no, no) \ + SC( 51, 16, 14, 4, no, no) \ \ - SC( 53, 18, 16, 1, no, no) \ - SC( 54, 18, 16, 2, no, no) \ - SC( 55, 18, 16, 3, no, no) \ - SC( 56, 18, 16, 4, no, no) \ + SC( 52, 17, 15, 1, no, no) \ + SC( 53, 17, 15, 2, no, no) \ + SC( 54, 17, 15, 3, no, no) \ + SC( 55, 17, 15, 4, no, no) \ \ - SC( 57, 19, 17, 1, no, no) \ - SC( 58, 19, 17, 2, no, no) \ - SC( 59, 19, 17, 3, no, no) \ - SC( 60, 19, 17, 4, no, no) \ + SC( 56, 18, 16, 1, no, no) \ + SC( 57, 18, 16, 2, no, no) \ + SC( 58, 18, 16, 3, no, no) \ + SC( 59, 18, 16, 4, no, no) \ \ - SC( 61, 20, 18, 1, no, no) \ - SC( 62, 20, 18, 2, no, no) \ - SC( 63, 20, 18, 3, no, no) \ - SC( 64, 20, 18, 4, no, no) \ + SC( 60, 19, 17, 1, no, no) \ + SC( 61, 19, 17, 2, no, no) \ + SC( 62, 19, 17, 3, no, no) \ + SC( 63, 19, 17, 4, no, no) \ \ - SC( 65, 21, 19, 1, no, no) \ - SC( 66, 21, 19, 2, no, no) \ - SC( 67, 21, 19, 3, no, no) \ - SC( 68, 21, 19, 4, no, no) \ + SC( 64, 20, 18, 1, no, no) \ + SC( 65, 20, 18, 2, no, no) \ + SC( 66, 20, 18, 3, no, no) \ + SC( 67, 20, 18, 4, no, no) \ \ - SC( 69, 22, 20, 1, no, no) \ - SC( 70, 22, 20, 2, no, no) \ - SC( 71, 22, 20, 3, no, no) \ - SC( 72, 22, 20, 4, no, no) \ + SC( 68, 21, 19, 1, no, no) \ + SC( 69, 21, 19, 2, no, no) \ + SC( 70, 21, 19, 3, no, no) \ + SC( 71, 21, 19, 4, no, no) \ \ - SC( 73, 23, 21, 1, no, no) \ - SC( 74, 23, 21, 2, no, no) \ - SC( 75, 23, 21, 3, no, no) \ - SC( 76, 23, 21, 4, no, no) \ + SC( 72, 22, 20, 1, no, no) \ + SC( 73, 22, 20, 2, no, no) \ + SC( 74, 22, 20, 3, no, no) \ + SC( 75, 22, 20, 4, no, no) \ \ - SC( 77, 24, 22, 1, no, no) \ - SC( 78, 24, 22, 2, no, no) \ - SC( 79, 24, 22, 3, no, no) \ - SC( 80, 24, 22, 4, no, no) \ + SC( 76, 23, 21, 1, no, no) \ + SC( 77, 23, 21, 2, no, no) \ + SC( 78, 23, 21, 3, no, no) \ + SC( 79, 23, 21, 4, no, no) \ \ - SC( 81, 25, 23, 1, no, no) \ - SC( 82, 25, 23, 2, no, no) \ - SC( 83, 25, 23, 3, no, no) \ - SC( 84, 25, 23, 4, no, no) \ + SC( 80, 24, 22, 1, no, no) \ + SC( 81, 24, 22, 2, no, no) \ + SC( 82, 24, 22, 3, no, no) \ + SC( 83, 24, 22, 4, no, no) \ \ - SC( 85, 26, 24, 1, no, no) \ - SC( 86, 26, 24, 2, no, no) \ - SC( 87, 26, 24, 3, no, no) \ - SC( 88, 26, 24, 4, no, no) \ + SC( 84, 25, 23, 1, no, no) \ + SC( 85, 25, 23, 2, no, no) \ + SC( 86, 25, 23, 3, no, no) \ + SC( 87, 25, 23, 4, no, no) \ \ - SC( 89, 27, 25, 1, no, no) \ - SC( 90, 27, 25, 2, no, no) \ - SC( 91, 27, 25, 3, no, no) \ - SC( 92, 27, 25, 4, no, no) \ + SC( 88, 26, 24, 1, no, no) \ + SC( 89, 26, 24, 2, no, no) \ + SC( 90, 26, 24, 3, no, no) \ + SC( 91, 26, 24, 4, no, no) \ \ - SC( 93, 28, 26, 1, no, no) \ - SC( 94, 28, 26, 2, no, no) \ - SC( 95, 28, 26, 3, no, no) \ - SC( 96, 28, 26, 4, no, no) \ + SC( 92, 27, 25, 1, no, no) \ + SC( 93, 27, 25, 2, no, no) \ + SC( 94, 27, 25, 3, no, no) \ + SC( 95, 27, 25, 4, no, no) \ \ - SC( 97, 29, 27, 1, no, no) \ - SC( 98, 29, 27, 2, no, no) \ - SC( 99, 29, 27, 3, no, no) \ - SC(100, 29, 27, 4, no, no) \ + SC( 96, 28, 26, 1, no, no) \ + SC( 97, 28, 26, 2, no, no) \ + SC( 98, 28, 26, 3, no, no) \ + SC( 99, 28, 26, 4, no, no) \ \ - SC(101, 30, 28, 1, no, no) \ - SC(102, 30, 28, 2, no, no) \ - SC(103, 30, 28, 3, no, no) \ - SC(104, 30, 28, 4, no, no) \ + SC(100, 29, 27, 1, no, no) \ + SC(101, 29, 27, 2, no, no) \ + SC(102, 29, 27, 3, no, no) \ + SC(103, 29, 27, 4, no, no) \ \ - SC(105, 31, 29, 1, no, no) \ - SC(106, 31, 29, 2, no, no) \ - SC(107, 31, 29, 3, no, no) \ + SC(104, 30, 28, 1, no, no) \ + SC(105, 30, 28, 2, no, no) \ + SC(106, 30, 28, 3, no, no) \ + SC(107, 30, 28, 4, no, no) \ + \ + SC(108, 31, 29, 1, no, no) \ + SC(109, 31, 29, 2, no, no) \ + SC(110, 31, 29, 3, no, no) \ #define SIZE_CLASSES_DEFINED -#define NTBINS 1 -#define NLBINS 29 -#define NBINS 36 -#define NSIZES 108 -#define LG_TINY_MAXCLASS 3 +#define NTBINS 0 +#define NLBINS 32 +#define NBINS 43 +#define NSIZES 111 +#define LG_TINY_MAXCLASS "NA" #define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9)) -#define SMALL_MAXCLASS ((((size_t)1) << 13) + (((size_t)3) << 11)) -#define LG_LARGE_MINCLASS 14 +#define SMALL_MAXCLASS ((((size_t)1) << 14) + (((size_t)3) << 12)) +#define LG_LARGE_MINCLASS 15 #endif -#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 12) +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 14) #define SIZE_CLASSES \ /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ - SC( 0, 4, 4, 0, yes, 4) \ - SC( 1, 4, 4, 1, yes, 4) \ - SC( 2, 4, 4, 2, yes, 4) \ - SC( 3, 4, 4, 3, yes, 4) \ - \ - SC( 4, 6, 4, 1, yes, 4) \ - SC( 5, 6, 4, 2, yes, 4) \ - SC( 6, 6, 4, 3, yes, 4) \ - SC( 7, 6, 4, 4, yes, 4) \ + SC( 0, 3, 3, 0, yes, 3) \ + SC( 1, 3, 3, 1, yes, 3) \ + SC( 2, 3, 3, 2, yes, 3) \ + SC( 3, 3, 3, 3, yes, 3) \ \ - SC( 8, 7, 5, 1, yes, 5) \ - SC( 9, 7, 5, 2, yes, 5) \ - SC( 10, 7, 5, 3, yes, 5) \ - SC( 11, 7, 5, 4, yes, 5) \ + SC( 4, 5, 3, 1, yes, 3) \ + SC( 5, 5, 3, 2, yes, 3) \ + SC( 6, 5, 3, 3, yes, 3) \ + SC( 7, 5, 3, 4, yes, 3) \ \ - SC( 12, 8, 6, 1, yes, 6) \ - SC( 13, 8, 6, 2, yes, 6) \ - SC( 14, 8, 6, 3, yes, 6) \ - SC( 15, 8, 6, 4, yes, 6) \ + SC( 8, 6, 4, 1, yes, 4) \ + SC( 9, 6, 4, 2, yes, 4) \ + SC( 10, 6, 4, 3, yes, 4) \ + SC( 11, 6, 4, 4, yes, 4) \ \ - SC( 16, 9, 7, 1, yes, 7) \ - SC( 17, 9, 7, 2, yes, 7) \ - SC( 18, 9, 7, 3, yes, 7) \ - SC( 19, 9, 7, 4, yes, 7) \ + SC( 12, 7, 5, 1, yes, 5) \ + SC( 13, 7, 5, 2, yes, 5) \ + SC( 14, 7, 5, 3, yes, 5) \ + SC( 15, 7, 5, 4, yes, 5) \ \ - SC( 20, 10, 8, 1, yes, 8) \ - SC( 21, 10, 8, 2, yes, 8) \ - SC( 22, 10, 8, 3, yes, 8) \ - SC( 23, 10, 8, 4, yes, 8) \ + SC( 16, 8, 6, 1, yes, 6) \ + SC( 17, 8, 6, 2, yes, 6) \ + SC( 18, 8, 6, 3, yes, 6) \ + SC( 19, 8, 6, 4, yes, 6) \ \ - SC( 24, 11, 9, 1, yes, 9) \ - SC( 25, 11, 9, 2, yes, 9) \ - SC( 26, 11, 9, 3, yes, 9) \ - SC( 27, 11, 9, 4, yes, 9) \ + SC( 20, 9, 7, 1, yes, 7) \ + SC( 21, 9, 7, 2, yes, 7) \ + SC( 22, 9, 7, 3, yes, 7) \ + SC( 23, 9, 7, 4, yes, 7) \ \ - SC( 28, 12, 10, 1, yes, no) \ - SC( 29, 12, 10, 2, yes, no) \ - SC( 30, 12, 10, 3, yes, no) \ - SC( 31, 12, 10, 4, yes, no) \ + SC( 24, 10, 8, 1, yes, 8) \ + SC( 25, 10, 8, 2, yes, 8) \ + SC( 26, 10, 8, 3, yes, 8) \ + SC( 27, 10, 8, 4, yes, 8) \ \ - SC( 32, 13, 11, 1, yes, no) \ - SC( 33, 13, 11, 2, yes, no) \ - SC( 34, 13, 11, 3, yes, no) \ - SC( 35, 13, 11, 4, no, no) \ + SC( 28, 11, 9, 1, yes, 9) \ + SC( 29, 11, 9, 2, yes, 9) \ + SC( 30, 11, 9, 3, yes, 9) \ + SC( 31, 11, 9, 4, yes, 9) \ \ - SC( 36, 14, 12, 1, no, no) \ - SC( 37, 14, 12, 2, no, no) \ - SC( 38, 14, 12, 3, no, no) \ - SC( 39, 14, 12, 4, no, no) \ + SC( 32, 12, 10, 1, yes, no) \ + SC( 33, 12, 10, 2, yes, no) \ + SC( 34, 12, 10, 3, yes, no) \ + SC( 35, 12, 10, 4, yes, no) \ \ - SC( 40, 15, 13, 1, no, no) \ - SC( 41, 15, 13, 2, no, no) \ - SC( 42, 15, 13, 3, no, no) \ - SC( 43, 15, 13, 4, no, no) \ + SC( 36, 13, 11, 1, yes, no) \ + SC( 37, 13, 11, 2, yes, no) \ + SC( 38, 13, 11, 3, yes, no) \ + SC( 39, 13, 11, 4, yes, no) \ \ - SC( 44, 16, 14, 1, no, no) \ - SC( 45, 16, 14, 2, no, no) \ - SC( 46, 16, 14, 3, no, no) \ - SC( 47, 16, 14, 4, no, no) \ + SC( 40, 14, 12, 1, yes, no) \ + SC( 41, 14, 12, 2, yes, no) \ + SC( 42, 14, 12, 3, yes, no) \ + SC( 43, 14, 12, 4, yes, no) \ + \ + SC( 44, 15, 13, 1, yes, no) \ + SC( 45, 15, 13, 2, yes, no) \ + SC( 46, 15, 13, 3, yes, no) \ + SC( 47, 15, 13, 4, no, no) \ \ - SC( 48, 17, 15, 1, no, no) \ - SC( 49, 17, 15, 2, no, no) \ - SC( 50, 17, 15, 3, no, no) \ - SC( 51, 17, 15, 4, no, no) \ + SC( 48, 16, 14, 1, no, no) \ + SC( 49, 16, 14, 2, no, no) \ + SC( 50, 16, 14, 3, no, no) \ + SC( 51, 16, 14, 4, no, no) \ \ - SC( 52, 18, 16, 1, no, no) \ - SC( 53, 18, 16, 2, no, no) \ - SC( 54, 18, 16, 3, no, no) \ - SC( 55, 18, 16, 4, no, no) \ + SC( 52, 17, 15, 1, no, no) \ + SC( 53, 17, 15, 2, no, no) \ + SC( 54, 17, 15, 3, no, no) \ + SC( 55, 17, 15, 4, no, no) \ \ - SC( 56, 19, 17, 1, no, no) \ - SC( 57, 19, 17, 2, no, no) \ - SC( 58, 19, 17, 3, no, no) \ - SC( 59, 19, 17, 4, no, no) \ + SC( 56, 18, 16, 1, no, no) \ + SC( 57, 18, 16, 2, no, no) \ + SC( 58, 18, 16, 3, no, no) \ + SC( 59, 18, 16, 4, no, no) \ \ - SC( 60, 20, 18, 1, no, no) \ - SC( 61, 20, 18, 2, no, no) \ - SC( 62, 20, 18, 3, no, no) \ - SC( 63, 20, 18, 4, no, no) \ + SC( 60, 19, 17, 1, no, no) \ + SC( 61, 19, 17, 2, no, no) \ + SC( 62, 19, 17, 3, no, no) \ + SC( 63, 19, 17, 4, no, no) \ \ - SC( 64, 21, 19, 1, no, no) \ - SC( 65, 21, 19, 2, no, no) \ - SC( 66, 21, 19, 3, no, no) \ - SC( 67, 21, 19, 4, no, no) \ + SC( 64, 20, 18, 1, no, no) \ + SC( 65, 20, 18, 2, no, no) \ + SC( 66, 20, 18, 3, no, no) \ + SC( 67, 20, 18, 4, no, no) \ \ - SC( 68, 22, 20, 1, no, no) \ - SC( 69, 22, 20, 2, no, no) \ - SC( 70, 22, 20, 3, no, no) \ - SC( 71, 22, 20, 4, no, no) \ + SC( 68, 21, 19, 1, no, no) \ + SC( 69, 21, 19, 2, no, no) \ + SC( 70, 21, 19, 3, no, no) \ + SC( 71, 21, 19, 4, no, no) \ \ - SC( 72, 23, 21, 1, no, no) \ - SC( 73, 23, 21, 2, no, no) \ - SC( 74, 23, 21, 3, no, no) \ - SC( 75, 23, 21, 4, no, no) \ + SC( 72, 22, 20, 1, no, no) \ + SC( 73, 22, 20, 2, no, no) \ + SC( 74, 22, 20, 3, no, no) \ + SC( 75, 22, 20, 4, no, no) \ \ - SC( 76, 24, 22, 1, no, no) \ - SC( 77, 24, 22, 2, no, no) \ - SC( 78, 24, 22, 3, no, no) \ - SC( 79, 24, 22, 4, no, no) \ + SC( 76, 23, 21, 1, no, no) \ + SC( 77, 23, 21, 2, no, no) \ + SC( 78, 23, 21, 3, no, no) \ + SC( 79, 23, 21, 4, no, no) \ \ - SC( 80, 25, 23, 1, no, no) \ - SC( 81, 25, 23, 2, no, no) \ - SC( 82, 25, 23, 3, no, no) \ - SC( 83, 25, 23, 4, no, no) \ + SC( 80, 24, 22, 1, no, no) \ + SC( 81, 24, 22, 2, no, no) \ + SC( 82, 24, 22, 3, no, no) \ + SC( 83, 24, 22, 4, no, no) \ \ - SC( 84, 26, 24, 1, no, no) \ - SC( 85, 26, 24, 2, no, no) \ - SC( 86, 26, 24, 3, no, no) \ - SC( 87, 26, 24, 4, no, no) \ + SC( 84, 25, 23, 1, no, no) \ + SC( 85, 25, 23, 2, no, no) \ + SC( 86, 25, 23, 3, no, no) \ + SC( 87, 25, 23, 4, no, no) \ \ - SC( 88, 27, 25, 1, no, no) \ - SC( 89, 27, 25, 2, no, no) \ - SC( 90, 27, 25, 3, no, no) \ - SC( 91, 27, 25, 4, no, no) \ + SC( 88, 26, 24, 1, no, no) \ + SC( 89, 26, 24, 2, no, no) \ + SC( 90, 26, 24, 3, no, no) \ + SC( 91, 26, 24, 4, no, no) \ \ - SC( 92, 28, 26, 1, no, no) \ - SC( 93, 28, 26, 2, no, no) \ - SC( 94, 28, 26, 3, no, no) \ - SC( 95, 28, 26, 4, no, no) \ + SC( 92, 27, 25, 1, no, no) \ + SC( 93, 27, 25, 2, no, no) \ + SC( 94, 27, 25, 3, no, no) \ + SC( 95, 27, 25, 4, no, no) \ \ - SC( 96, 29, 27, 1, no, no) \ - SC( 97, 29, 27, 2, no, no) \ - SC( 98, 29, 27, 3, no, no) \ - SC( 99, 29, 27, 4, no, no) \ + SC( 96, 28, 26, 1, no, no) \ + SC( 97, 28, 26, 2, no, no) \ + SC( 98, 28, 26, 3, no, no) \ + SC( 99, 28, 26, 4, no, no) \ \ - SC(100, 30, 28, 1, no, no) \ - SC(101, 30, 28, 2, no, no) \ - SC(102, 30, 28, 3, no, no) \ - SC(103, 30, 28, 4, no, no) \ + SC(100, 29, 27, 1, no, no) \ + SC(101, 29, 27, 2, no, no) \ + SC(102, 29, 27, 3, no, no) \ + SC(103, 29, 27, 4, no, no) \ \ - SC(104, 31, 29, 1, no, no) \ - SC(105, 31, 29, 2, no, no) \ - SC(106, 31, 29, 3, no, no) \ + SC(104, 30, 28, 1, no, no) \ + SC(105, 30, 28, 2, no, no) \ + SC(106, 30, 28, 3, no, no) \ + SC(107, 30, 28, 4, no, no) \ + \ + SC(108, 31, 29, 1, no, no) \ + SC(109, 31, 29, 2, no, no) \ + SC(110, 31, 29, 3, no, no) \ #define SIZE_CLASSES_DEFINED #define NTBINS 0 -#define NLBINS 28 -#define NBINS 35 -#define NSIZES 107 +#define NLBINS 32 +#define NBINS 47 +#define NSIZES 111 #define LG_TINY_MAXCLASS "NA" #define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9)) -#define SMALL_MAXCLASS ((((size_t)1) << 13) + (((size_t)3) << 11)) -#define LG_LARGE_MINCLASS 14 +#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13)) +#define LG_LARGE_MINCLASS 16 #endif -#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 12) +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 16) #define SIZE_CLASSES \ /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ SC( 0, 3, 3, 0, yes, 3) \ @@ -531,26 +539,26 @@ SC( 36, 13, 11, 1, yes, no) \ SC( 37, 13, 11, 2, yes, no) \ SC( 38, 13, 11, 3, yes, no) \ - SC( 39, 13, 11, 4, no, no) \ - \ - SC( 40, 14, 12, 1, no, no) \ - SC( 41, 14, 12, 2, no, no) \ - SC( 42, 14, 12, 3, no, no) \ - SC( 43, 14, 12, 4, no, no) \ - \ - SC( 44, 15, 13, 1, no, no) \ - SC( 45, 15, 13, 2, no, no) \ - SC( 46, 15, 13, 3, no, no) \ - SC( 47, 15, 13, 4, no, no) \ - \ - SC( 48, 16, 14, 1, no, no) \ - SC( 49, 16, 14, 2, no, no) \ - SC( 50, 16, 14, 3, no, no) \ - SC( 51, 16, 14, 4, no, no) \ + SC( 39, 13, 11, 4, yes, no) \ \ - SC( 52, 17, 15, 1, no, no) \ - SC( 53, 17, 15, 2, no, no) \ - SC( 54, 17, 15, 3, no, no) \ + SC( 40, 14, 12, 1, yes, no) \ + SC( 41, 14, 12, 2, yes, no) \ + SC( 42, 14, 12, 3, yes, no) \ + SC( 43, 14, 12, 4, yes, no) \ + \ + SC( 44, 15, 13, 1, yes, no) \ + SC( 45, 15, 13, 2, yes, no) \ + SC( 46, 15, 13, 3, yes, no) \ + SC( 47, 15, 13, 4, yes, no) \ + \ + SC( 48, 16, 14, 1, yes, no) \ + SC( 49, 16, 14, 2, yes, no) \ + SC( 50, 16, 14, 3, yes, no) \ + SC( 51, 16, 14, 4, yes, no) \ + \ + SC( 52, 17, 15, 1, yes, no) \ + SC( 53, 17, 15, 2, yes, no) \ + SC( 54, 17, 15, 3, yes, no) \ SC( 55, 17, 15, 4, no, no) \ \ SC( 56, 18, 16, 1, no, no) \ @@ -621,489 +629,4627 @@ SC(108, 31, 29, 1, no, no) \ SC(109, 31, 29, 2, no, no) \ SC(110, 31, 29, 3, no, no) \ - SC(111, 31, 29, 4, no, no) \ + +#define SIZE_CLASSES_DEFINED +#define NTBINS 0 +#define NLBINS 32 +#define NBINS 55 +#define NSIZES 111 +#define LG_TINY_MAXCLASS "NA" +#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9)) +#define SMALL_MAXCLASS ((((size_t)1) << 17) + (((size_t)3) << 15)) +#define LG_LARGE_MINCLASS 18 +#endif + +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 12) +#define SIZE_CLASSES \ + /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ + SC( 0, 3, 3, 0, yes, 3) \ \ - SC(112, 32, 30, 1, no, no) \ - SC(113, 32, 30, 2, no, no) \ - SC(114, 32, 30, 3, no, no) \ - SC(115, 32, 30, 4, no, no) \ + SC( 1, 3, 3, 1, yes, 3) \ + SC( 2, 4, 4, 1, yes, 4) \ + SC( 3, 4, 4, 2, yes, 4) \ + SC( 4, 4, 4, 3, yes, 4) \ \ - SC(116, 33, 31, 1, no, no) \ - SC(117, 33, 31, 2, no, no) \ - SC(118, 33, 31, 3, no, no) \ - SC(119, 33, 31, 4, no, no) \ + SC( 5, 6, 4, 1, yes, 4) \ + SC( 6, 6, 4, 2, yes, 4) \ + SC( 7, 6, 4, 3, yes, 4) \ + SC( 8, 6, 4, 4, yes, 4) \ \ - SC(120, 34, 32, 1, no, no) \ - SC(121, 34, 32, 2, no, no) \ - SC(122, 34, 32, 3, no, no) \ - SC(123, 34, 32, 4, no, no) \ + SC( 9, 7, 5, 1, yes, 5) \ + SC( 10, 7, 5, 2, yes, 5) \ + SC( 11, 7, 5, 3, yes, 5) \ + SC( 12, 7, 5, 4, yes, 5) \ \ - SC(124, 35, 33, 1, no, no) \ - SC(125, 35, 33, 2, no, no) \ - SC(126, 35, 33, 3, no, no) \ - SC(127, 35, 33, 4, no, no) \ + SC( 13, 8, 6, 1, yes, 6) \ + SC( 14, 8, 6, 2, yes, 6) \ + SC( 15, 8, 6, 3, yes, 6) \ + SC( 16, 8, 6, 4, yes, 6) \ \ - SC(128, 36, 34, 1, no, no) \ - SC(129, 36, 34, 2, no, no) \ - SC(130, 36, 34, 3, no, no) \ - SC(131, 36, 34, 4, no, no) \ + SC( 17, 9, 7, 1, yes, 7) \ + SC( 18, 9, 7, 2, yes, 7) \ + SC( 19, 9, 7, 3, yes, 7) \ + SC( 20, 9, 7, 4, yes, 7) \ + \ + SC( 21, 10, 8, 1, yes, 8) \ + SC( 22, 10, 8, 2, yes, 8) \ + SC( 23, 10, 8, 3, yes, 8) \ + SC( 24, 10, 8, 4, yes, 8) \ + \ + SC( 25, 11, 9, 1, yes, 9) \ + SC( 26, 11, 9, 2, yes, 9) \ + SC( 27, 11, 9, 3, yes, 9) \ + SC( 28, 11, 9, 4, yes, 9) \ + \ + SC( 29, 12, 10, 1, yes, no) \ + SC( 30, 12, 10, 2, yes, no) \ + SC( 31, 12, 10, 3, yes, no) \ + SC( 32, 12, 10, 4, yes, no) \ + \ + SC( 33, 13, 11, 1, yes, no) \ + SC( 34, 13, 11, 2, yes, no) \ + SC( 35, 13, 11, 3, yes, no) \ + SC( 36, 13, 11, 4, no, no) \ + \ + SC( 37, 14, 12, 1, no, no) \ + SC( 38, 14, 12, 2, no, no) \ + SC( 39, 14, 12, 3, no, no) \ + SC( 40, 14, 12, 4, no, no) \ + \ + SC( 41, 15, 13, 1, no, no) \ + SC( 42, 15, 13, 2, no, no) \ + SC( 43, 15, 13, 3, no, no) \ + SC( 44, 15, 13, 4, no, no) \ + \ + SC( 45, 16, 14, 1, no, no) \ + SC( 46, 16, 14, 2, no, no) \ + SC( 47, 16, 14, 3, no, no) \ + SC( 48, 16, 14, 4, no, no) \ + \ + SC( 49, 17, 15, 1, no, no) \ + SC( 50, 17, 15, 2, no, no) \ + SC( 51, 17, 15, 3, no, no) \ + SC( 52, 17, 15, 4, no, no) \ + \ + SC( 53, 18, 16, 1, no, no) \ + SC( 54, 18, 16, 2, no, no) \ + SC( 55, 18, 16, 3, no, no) \ + SC( 56, 18, 16, 4, no, no) \ + \ + SC( 57, 19, 17, 1, no, no) \ + SC( 58, 19, 17, 2, no, no) \ + SC( 59, 19, 17, 3, no, no) \ + SC( 60, 19, 17, 4, no, no) \ + \ + SC( 61, 20, 18, 1, no, no) \ + SC( 62, 20, 18, 2, no, no) \ + SC( 63, 20, 18, 3, no, no) \ + SC( 64, 20, 18, 4, no, no) \ + \ + SC( 65, 21, 19, 1, no, no) \ + SC( 66, 21, 19, 2, no, no) \ + SC( 67, 21, 19, 3, no, no) \ + SC( 68, 21, 19, 4, no, no) \ + \ + SC( 69, 22, 20, 1, no, no) \ + SC( 70, 22, 20, 2, no, no) \ + SC( 71, 22, 20, 3, no, no) \ + SC( 72, 22, 20, 4, no, no) \ + \ + SC( 73, 23, 21, 1, no, no) \ + SC( 74, 23, 21, 2, no, no) \ + SC( 75, 23, 21, 3, no, no) \ + SC( 76, 23, 21, 4, no, no) \ + \ + SC( 77, 24, 22, 1, no, no) \ + SC( 78, 24, 22, 2, no, no) \ + SC( 79, 24, 22, 3, no, no) \ + SC( 80, 24, 22, 4, no, no) \ + \ + SC( 81, 25, 23, 1, no, no) \ + SC( 82, 25, 23, 2, no, no) \ + SC( 83, 25, 23, 3, no, no) \ + SC( 84, 25, 23, 4, no, no) \ + \ + SC( 85, 26, 24, 1, no, no) \ + SC( 86, 26, 24, 2, no, no) \ + SC( 87, 26, 24, 3, no, no) \ + SC( 88, 26, 24, 4, no, no) \ + \ + SC( 89, 27, 25, 1, no, no) \ + SC( 90, 27, 25, 2, no, no) \ + SC( 91, 27, 25, 3, no, no) \ + SC( 92, 27, 25, 4, no, no) \ + \ + SC( 93, 28, 26, 1, no, no) \ + SC( 94, 28, 26, 2, no, no) \ + SC( 95, 28, 26, 3, no, no) \ + SC( 96, 28, 26, 4, no, no) \ + \ + SC( 97, 29, 27, 1, no, no) \ + SC( 98, 29, 27, 2, no, no) \ + SC( 99, 29, 27, 3, no, no) \ + SC(100, 29, 27, 4, no, no) \ + \ + SC(101, 30, 28, 1, no, no) \ + SC(102, 30, 28, 2, no, no) \ + SC(103, 30, 28, 3, no, no) \ + SC(104, 30, 28, 4, no, no) \ + \ + SC(105, 31, 29, 1, no, no) \ + SC(106, 31, 29, 2, no, no) \ + SC(107, 31, 29, 3, no, no) \ + +#define SIZE_CLASSES_DEFINED +#define NTBINS 1 +#define NLBINS 29 +#define NBINS 36 +#define NSIZES 108 +#define LG_TINY_MAXCLASS 3 +#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9)) +#define SMALL_MAXCLASS ((((size_t)1) << 13) + (((size_t)3) << 11)) +#define LG_LARGE_MINCLASS 14 +#endif + +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 13) +#define SIZE_CLASSES \ + /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ + SC( 0, 3, 3, 0, yes, 3) \ + \ + SC( 1, 3, 3, 1, yes, 3) \ + SC( 2, 4, 4, 1, yes, 4) \ + SC( 3, 4, 4, 2, yes, 4) \ + SC( 4, 4, 4, 3, yes, 4) \ + \ + SC( 5, 6, 4, 1, yes, 4) \ + SC( 6, 6, 4, 2, yes, 4) \ + SC( 7, 6, 4, 3, yes, 4) \ + SC( 8, 6, 4, 4, yes, 4) \ + \ + SC( 9, 7, 5, 1, yes, 5) \ + SC( 10, 7, 5, 2, yes, 5) \ + SC( 11, 7, 5, 3, yes, 5) \ + SC( 12, 7, 5, 4, yes, 5) \ + \ + SC( 13, 8, 6, 1, yes, 6) \ + SC( 14, 8, 6, 2, yes, 6) \ + SC( 15, 8, 6, 3, yes, 6) \ + SC( 16, 8, 6, 4, yes, 6) \ + \ + SC( 17, 9, 7, 1, yes, 7) \ + SC( 18, 9, 7, 2, yes, 7) \ + SC( 19, 9, 7, 3, yes, 7) \ + SC( 20, 9, 7, 4, yes, 7) \ + \ + SC( 21, 10, 8, 1, yes, 8) \ + SC( 22, 10, 8, 2, yes, 8) \ + SC( 23, 10, 8, 3, yes, 8) \ + SC( 24, 10, 8, 4, yes, 8) \ + \ + SC( 25, 11, 9, 1, yes, 9) \ + SC( 26, 11, 9, 2, yes, 9) \ + SC( 27, 11, 9, 3, yes, 9) \ + SC( 28, 11, 9, 4, yes, 9) \ + \ + SC( 29, 12, 10, 1, yes, no) \ + SC( 30, 12, 10, 2, yes, no) \ + SC( 31, 12, 10, 3, yes, no) \ + SC( 32, 12, 10, 4, yes, no) \ + \ + SC( 33, 13, 11, 1, yes, no) \ + SC( 34, 13, 11, 2, yes, no) \ + SC( 35, 13, 11, 3, yes, no) \ + SC( 36, 13, 11, 4, yes, no) \ + \ + SC( 37, 14, 12, 1, yes, no) \ + SC( 38, 14, 12, 2, yes, no) \ + SC( 39, 14, 12, 3, yes, no) \ + SC( 40, 14, 12, 4, no, no) \ + \ + SC( 41, 15, 13, 1, no, no) \ + SC( 42, 15, 13, 2, no, no) \ + SC( 43, 15, 13, 3, no, no) \ + SC( 44, 15, 13, 4, no, no) \ + \ + SC( 45, 16, 14, 1, no, no) \ + SC( 46, 16, 14, 2, no, no) \ + SC( 47, 16, 14, 3, no, no) \ + SC( 48, 16, 14, 4, no, no) \ + \ + SC( 49, 17, 15, 1, no, no) \ + SC( 50, 17, 15, 2, no, no) \ + SC( 51, 17, 15, 3, no, no) \ + SC( 52, 17, 15, 4, no, no) \ + \ + SC( 53, 18, 16, 1, no, no) \ + SC( 54, 18, 16, 2, no, no) \ + SC( 55, 18, 16, 3, no, no) \ + SC( 56, 18, 16, 4, no, no) \ + \ + SC( 57, 19, 17, 1, no, no) \ + SC( 58, 19, 17, 2, no, no) \ + SC( 59, 19, 17, 3, no, no) \ + SC( 60, 19, 17, 4, no, no) \ + \ + SC( 61, 20, 18, 1, no, no) \ + SC( 62, 20, 18, 2, no, no) \ + SC( 63, 20, 18, 3, no, no) \ + SC( 64, 20, 18, 4, no, no) \ + \ + SC( 65, 21, 19, 1, no, no) \ + SC( 66, 21, 19, 2, no, no) \ + SC( 67, 21, 19, 3, no, no) \ + SC( 68, 21, 19, 4, no, no) \ + \ + SC( 69, 22, 20, 1, no, no) \ + SC( 70, 22, 20, 2, no, no) \ + SC( 71, 22, 20, 3, no, no) \ + SC( 72, 22, 20, 4, no, no) \ + \ + SC( 73, 23, 21, 1, no, no) \ + SC( 74, 23, 21, 2, no, no) \ + SC( 75, 23, 21, 3, no, no) \ + SC( 76, 23, 21, 4, no, no) \ + \ + SC( 77, 24, 22, 1, no, no) \ + SC( 78, 24, 22, 2, no, no) \ + SC( 79, 24, 22, 3, no, no) \ + SC( 80, 24, 22, 4, no, no) \ + \ + SC( 81, 25, 23, 1, no, no) \ + SC( 82, 25, 23, 2, no, no) \ + SC( 83, 25, 23, 3, no, no) \ + SC( 84, 25, 23, 4, no, no) \ + \ + SC( 85, 26, 24, 1, no, no) \ + SC( 86, 26, 24, 2, no, no) \ + SC( 87, 26, 24, 3, no, no) \ + SC( 88, 26, 24, 4, no, no) \ + \ + SC( 89, 27, 25, 1, no, no) \ + SC( 90, 27, 25, 2, no, no) \ + SC( 91, 27, 25, 3, no, no) \ + SC( 92, 27, 25, 4, no, no) \ + \ + SC( 93, 28, 26, 1, no, no) \ + SC( 94, 28, 26, 2, no, no) \ + SC( 95, 28, 26, 3, no, no) \ + SC( 96, 28, 26, 4, no, no) \ + \ + SC( 97, 29, 27, 1, no, no) \ + SC( 98, 29, 27, 2, no, no) \ + SC( 99, 29, 27, 3, no, no) \ + SC(100, 29, 27, 4, no, no) \ + \ + SC(101, 30, 28, 1, no, no) \ + SC(102, 30, 28, 2, no, no) \ + SC(103, 30, 28, 3, no, no) \ + SC(104, 30, 28, 4, no, no) \ + \ + SC(105, 31, 29, 1, no, no) \ + SC(106, 31, 29, 2, no, no) \ + SC(107, 31, 29, 3, no, no) \ + +#define SIZE_CLASSES_DEFINED +#define NTBINS 1 +#define NLBINS 29 +#define NBINS 40 +#define NSIZES 108 +#define LG_TINY_MAXCLASS 3 +#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9)) +#define SMALL_MAXCLASS ((((size_t)1) << 14) + (((size_t)3) << 12)) +#define LG_LARGE_MINCLASS 15 +#endif + +#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 14) +#define SIZE_CLASSES \ + /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \ + SC( 0, 3, 3, 0, yes, 3) \ + \ + SC( 1, 3, 3, 1, yes, 3) \ + SC( 2, 4, 4, 1, yes, 4) \ + SC( 3, 4, 4, 2, yes, 4) \ + SC( 4, 4, 4, 3, yes, 4) \ + \ + SC( 5, 6, 4, 1, yes, 4) \ + SC( 6, 6, 4, 2, yes, 4) \ + SC( 7, 6, 4, 3, yes, 4) \ + SC( 8, 6, 4, 4, yes, 4) \ + \ + SC( 9, 7, 5, 1, yes, 5) \ + SC( 10, 7, 5, 2, yes, 5) \ + SC( 11, 7, 5, 3, yes, 5) \ + SC( 12, 7, 5, 4, yes, 5) \ + \ + SC( 13, 8, 6, 1, yes, 6) \ + SC( 14, 8, 6, 2, yes, 6) \ + SC( 15, 8, 6, 3, yes, 6) \ + SC( 16, 8, 6, 4, yes, 6) \ + \ + SC( 17, 9, 7, 1, yes, 7) \ + SC( 18, 9, 7, 2, yes, 7) \ + SC( 19, 9, 7, 3, yes, 7) \ + SC( 20, 9, 7, 4, yes, 7) \ + \ + SC( 21, 10, 8, 1, yes, 8) \ + SC( 22, 10, 8, 2, yes, 8) \ + SC( 23, 10, 8, 3, yes, 8) \ + SC( 24, 10, 8, 4, yes, 8) \ + \ + SC( 25, 11, 9, 1, yes, 9) \ + SC( 26, 11, 9, 2, yes, 9) \ + SC( 27, 11, 9, 3, yes, 9) \ + SC( 28, 11, 9, 4, yes, 9) \ + \ + SC( 29, 12, 10, 1, yes, no) \ + SC( 30, 12, 10, 2, yes, no) \ + SC( 31, 12, 10, 3, yes, no) \ + SC( 32, 12, 10, 4, yes, no) \ + \ + SC( 33, 13, 11, 1, yes, no) \ + SC( 34, 13, 11, 2, yes, no) \ + SC( 35, 13, 11, 3, yes, no) \ + SC( 36, 13, 11, 4, yes, no) \ + \ + SC( 37, 14, 12, 1, yes, no) \ + SC( 38, 14, 12, 2, yes, no) \ + SC( 39, 14, 12, 3, yes, no) \ + SC( 40, 14, 12, 4, yes, no) \ + \ + SC( 41, 15, 13, 1, yes, no) \ + SC( 42, 15, 13, 2, yes, no) \ + SC( 43, 15, 13, 3, yes, no) \ + SC( 44, 15, 13, 4, no, no) \ + \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 18 08:10:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 933CE9B8760; Tue, 18 Aug 2015 08:10:47 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 812ED1B66; Tue, 18 Aug 2015 08:10:47 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I8AlaX003730; Tue, 18 Aug 2015 08:10:47 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I8AlZI003729; Tue, 18 Aug 2015 08:10:47 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180810.t7I8AlZI003729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 08:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286871 - head/contrib/jemalloc/include/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:10:47 -0000 Author: jasone Date: Tue Aug 18 08:10:46 2015 New Revision: 286871 URL: https://svnweb.freebsd.org/changeset/base/286871 Log: Fix build failure due to missing CPU_SPINWAIT definition. Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 06:28:37 2015 (r286870) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 08:10:46 2015 (r286871) @@ -57,6 +57,10 @@ # define JEMALLOC_TLS_MODEL /* Default. */ #endif +#ifndef CPU_SPINWAIT +# define CPU_SPINWAIT do {} while (0) +#endif + #define STATIC_PAGE_SHIFT PAGE_SHIFT #define LG_SIZEOF_INT 2 #define LG_SIZEOF_LONG LG_SIZEOF_PTR From owner-svn-src-head@freebsd.org Tue Aug 18 08:18:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F7D69B89D3; Tue, 18 Aug 2015 08:18:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 302821F18; Tue, 18 Aug 2015 08:18:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I8ITgG006645; Tue, 18 Aug 2015 08:18:29 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I8ISVa006643; Tue, 18 Aug 2015 08:18:28 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180818.t7I8ISVa006643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 08:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286872 - head/lib/libc/stdlib/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:18:29 -0000 Author: jasone Date: Tue Aug 18 08:18:28 2015 New Revision: 286872 URL: https://svnweb.freebsd.org/changeset/base/286872 Log: Add missing sdallocx updates and remove *allocm manpage links. Submitted by: jbeich Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc head/lib/libc/stdlib/jemalloc/Symbol.map Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/jemalloc/Makefile.inc Tue Aug 18 08:10:46 2015 (r286871) +++ head/lib/libc/stdlib/jemalloc/Makefile.inc Tue Aug 18 08:18:28 2015 (r286872) @@ -40,12 +40,8 @@ MLINKS+= \ jemalloc.3 xallocx.3 \ jemalloc.3 sallocx.3 \ jemalloc.3 dallocx.3 \ + jemalloc.3 sdallocx.3 \ jemalloc.3 nallocx.3 \ - jemalloc.3 allocm.3 \ - jemalloc.3 rallocm.3 \ - jemalloc.3 sallocm.3 \ - jemalloc.3 dallocm.3 \ - jemalloc.3 nallocm.3 \ jemalloc.3 malloc.conf.5 .if defined(MALLOC_PRODUCTION) Modified: head/lib/libc/stdlib/jemalloc/Symbol.map ============================================================================== --- head/lib/libc/stdlib/jemalloc/Symbol.map Tue Aug 18 08:10:46 2015 (r286871) +++ head/lib/libc/stdlib/jemalloc/Symbol.map Tue Aug 18 08:18:28 2015 (r286872) @@ -51,6 +51,11 @@ FBSD_1.3 { __nallocm; }; +FBSD_1.4 { + sdallocx; + __sdallocx; +}; + FBSDprivate_1.0 { _malloc_thread_cleanup; _malloc_prefork; From owner-svn-src-head@freebsd.org Tue Aug 18 08:27:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE96E9B8D81; Tue, 18 Aug 2015 08:27:26 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFA397F8; Tue, 18 Aug 2015 08:27:26 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I8RQi7010718; Tue, 18 Aug 2015 08:27:26 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I8RQ33010717; Tue, 18 Aug 2015 08:27:26 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508180827.t7I8RQ33010717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 18 Aug 2015 08:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286873 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:27:27 -0000 Author: jch Date: Tue Aug 18 08:27:26 2015 New Revision: 286873 URL: https://svnweb.freebsd.org/changeset/base/286873 Log: Make clear that TIME_WAIT timeout expiration is managed solely by tcp_tw_2msl_scan(). Sponsored by: Verisign, Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 18 08:18:28 2015 (r286872) +++ head/sys/netinet/tcp_timer.c Tue Aug 18 08:27:26 2015 (r286873) @@ -333,21 +333,29 @@ tcp_timer_2msl(void *xtp) /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle - * too long, or if 2MSL time is up from TIME_WAIT, delete connection - * control block. Otherwise, check again in a bit. + * too long delete connection control block. Otherwise, check + * again in a bit. + * + * If in TIME_WAIT state just ignore as this timeout is handled in + * tcp_tw_2msl_scan(). * * If fastrecycle of FIN_WAIT_2, in FIN_WAIT_2 and receiver has closed, * there's no point in hanging onto FIN_WAIT_2 socket. Just close it. * Ignore fact that there were recent incoming segments. */ + if ((inp->inp_flags & INP_TIMEWAIT) != 0) { + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } if (tcp_fast_finwait2_recycle && tp->t_state == TCPS_FIN_WAIT_2 && tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { - if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { + if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { if (!callout_reset(&tp->t_timers->tt_2msl, TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { tp->t_timers->tt_flags &= ~TT_2MSL_RST; From owner-svn-src-head@freebsd.org Tue Aug 18 08:29:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48A489B8E2D; Tue, 18 Aug 2015 08:29:14 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 397F99FE; Tue, 18 Aug 2015 08:29:14 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I8TEx9010858; Tue, 18 Aug 2015 08:29:14 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I8TEO2010857; Tue, 18 Aug 2015 08:29:14 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180829.t7I8TEO2010857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 08:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286874 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:29:14 -0000 Author: jasone Date: Tue Aug 18 08:29:13 2015 New Revision: 286874 URL: https://svnweb.freebsd.org/changeset/base/286874 Log: Bump __FreeBSD_version for the jemalloc 4.0.0 import. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Aug 18 08:27:26 2015 (r286873) +++ head/sys/sys/param.h Tue Aug 18 08:29:13 2015 (r286874) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100078 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100079 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Aug 18 08:40:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568289BB66C; Tue, 18 Aug 2015 08:40:28 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33DD518B6; Tue, 18 Aug 2015 08:40:27 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from [192.168.168.10] (unknown [208.94.83.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 02258286F2; Tue, 18 Aug 2015 01:40:26 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: Jason Evans In-Reply-To: Date: Tue, 18 Aug 2015 01:40:25 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508180021.t7I0LQwE016289@repo.freebsd.org> To: NGie Cooper X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:40:28 -0000 On Aug 17, 2015, at 6:16 PM, NGie Cooper wrote: > On Mon, Aug 17, 2015 at 5:21 PM, Jason Evans = wrote: >> Author: jasone >> Date: Tue Aug 18 00:21:25 2015 >> New Revision: 286866 >> URL: https://svnweb.freebsd.org/changeset/base/286866 >>=20 >> Log: >> Update jemalloc to version 4.0.0. >=20 > Relnotes: yes! >=20 > Also, is there a summary of the changes that can be provided here, or > should the reader get this information from the ChangeLog? The ChangeLog is rather long, and part of the commit itself. See = src/contrib/jemalloc/ChangeLog or = https://github.com/jemalloc/jemalloc/releases/tag/4.0.0 . Thanks, Jason= From owner-svn-src-head@freebsd.org Tue Aug 18 08:46:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F119BB853; Tue, 18 Aug 2015 08:46:32 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE351C81; Tue, 18 Aug 2015 08:46:31 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from [192.168.168.10] (unknown [208.94.83.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id B7A9D286F2; Tue, 18 Aug 2015 01:46:30 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: Jason Evans In-Reply-To: Date: Tue, 18 Aug 2015 01:46:29 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508180021.t7I0LQwE016289@repo.freebsd.org> To: Jan Beich X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 08:46:32 -0000 On Aug 17, 2015, at 9:35 PM, Jan Beich wrote: > Jason Evans writes: >=20 >> Author: jasone >> Date: Tue Aug 18 00:21:25 2015 >> New Revision: 286866 >> URL: https://svnweb.freebsd.org/changeset/base/286866 >>=20 >> Log: >> Update jemalloc to version 4.0.0. >=20 > Can you bump __FreeBSD_version for non-standard API changes? Some = ports > like www/firefox may want to take advantage of it without complicating > configure scripts. Done. >> + - Add sdallocx(), which implements sized deallocation. The = primary >> + optimization over dallocx() is the removal of a metadata read, = which often >> + suffers an L1 cache miss. > [...] >> + - Remove the *allocm() API, which is superseded by the *allocx() = API. >=20 > Symbol.map and manpages haven't been updated. > [...] Committed; thanks! Jason From owner-svn-src-head@freebsd.org Tue Aug 18 09:09:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A1569BC0A4; Tue, 18 Aug 2015 09:09:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E7FB7F; Tue, 18 Aug 2015 09:09:28 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I99SHx026464; Tue, 18 Aug 2015 09:09:28 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I99S1L026462; Tue, 18 Aug 2015 09:09:28 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508180909.t7I99S1L026462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 09:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286877 - in head/contrib/jemalloc: . include/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 09:09:29 -0000 Author: jasone Date: Tue Aug 18 09:09:27 2015 New Revision: 286877 URL: https://svnweb.freebsd.org/changeset/base/286877 Log: Re-add LG_SIZEOF_PTR definition for __aarch64__. This definition was erroneously removed during the 4.0.0 import. Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 09:05:59 2015 (r286876) +++ head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 09:09:27 2015 (r286877) @@ -117,10 +117,10 @@ index dbf6aa7..f87dba8 100644 jemalloc_postfork_child diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..66d6da5 +index 0000000..c5113b9 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,137 @@ +@@ -0,0 +1,144 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -163,6 +163,9 @@ index 0000000..66d6da5 +#ifdef __arm__ +# define LG_SIZEOF_PTR 2 +#endif ++#ifdef __aarch64__ ++# define LG_SIZEOF_PTR 3 ++#endif +#ifdef __mips__ +#ifdef __mips_n64 +# define LG_SIZEOF_PTR 3 @@ -180,6 +183,10 @@ index 0000000..66d6da5 +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif + ++#ifndef CPU_SPINWAIT ++# define CPU_SPINWAIT do {} while (0) ++#endif ++ +#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_SIZEOF_INT 2 +#define LG_SIZEOF_LONG LG_SIZEOF_PTR Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 09:05:59 2015 (r286876) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 09:09:27 2015 (r286877) @@ -40,6 +40,9 @@ #ifdef __arm__ # define LG_SIZEOF_PTR 2 #endif +#ifdef __aarch64__ +# define LG_SIZEOF_PTR 3 +#endif #ifdef __mips__ #ifdef __mips_n64 # define LG_SIZEOF_PTR 3 From owner-svn-src-head@freebsd.org Tue Aug 18 10:07:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712AB9BC152; Tue, 18 Aug 2015 10:07:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623C316D4; Tue, 18 Aug 2015 10:07:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IA74a4051698; Tue, 18 Aug 2015 10:07:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IA746S051697; Tue, 18 Aug 2015 10:07:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508181007.t7IA746S051697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 18 Aug 2015 10:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286879 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 10:07:04 -0000 Author: emaste Date: Tue Aug 18 10:07:03 2015 New Revision: 286879 URL: https://svnweb.freebsd.org/changeset/base/286879 Log: Remove register dump from arm64 el0 unknown exception An exception with an unknown reasion is the expected result of the attempted execution of an instruction bit pattern that has no allocated instruction. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Aug 18 09:09:39 2015 (r286878) +++ head/sys/arm64/arm64/trap.c Tue Aug 18 10:07:03 2015 (r286879) @@ -309,8 +309,8 @@ do_el1h_sync(struct trapframe *frame) } /* - * We get EXCP_UNKNOWN from QEMU when executing zeroed memory. For now turn - * this into a SIGILL. + * The attempted execution of an instruction bit pattern that has no allocated + * instruction resuls in an exception with an unknown reason. */ static void el0_excp_unknown(struct trapframe *frame) @@ -320,8 +320,6 @@ el0_excp_unknown(struct trapframe *frame td = curthread; far = READ_SPECIALREG(far_el1); - printf("el0 EXCP_UNKNOWN exception\n"); - print_registers(frame); call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far); userret(td, frame); } From owner-svn-src-head@freebsd.org Tue Aug 18 10:15:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE5F59BC32F; Tue, 18 Aug 2015 10:15:10 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A91D81C86; Tue, 18 Aug 2015 10:15:10 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IAFALs055890; Tue, 18 Aug 2015 10:15:10 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IAFAex055889; Tue, 18 Aug 2015 10:15:10 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508181015.t7IAFAex055889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 18 Aug 2015 10:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286880 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 10:15:10 -0000 Author: jch Date: Tue Aug 18 10:15:09 2015 New Revision: 286880 URL: https://svnweb.freebsd.org/changeset/base/286880 Log: callout_stop() should return 0 (fail) when the callout is currently being serviced and indeed unstoppable. A scenario to reproduce this case is: - the callout is being serviced and at same time, - callout_reset() is called on this callout that sets the CALLOUT_PENDING flag and at same time, - callout_stop() is called on this callout and returns 1 (success) even if the callout is indeed currently running and unstoppable. This issue was caught up while making r284245 (D2763) workaround, and was discussed at BSDCan 2015. Once applied the r284245 workaround is not needed anymore and will be reverted. Differential Revision: https://reviews.freebsd.org/D3078 Reviewed by: jhb Sponsored by: Verisign, Inc. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r286879) +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r286880) @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in struct callout_cpu *cc, *old_cc; struct lock_class *class; int direct, sq_locked, use_lock; - int not_on_a_list; + int not_on_a_list, not_running; if (safe) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, @@ -1378,8 +1378,15 @@ again: } } callout_cc_del(c, cc); + + /* + * If we are asked to stop a callout which is currently in progress + * and indeed impossible to stop then return 0. + */ + not_running = !(cc_exec_curr(cc, direct) == c); + CC_UNLOCK(cc); - return (1); + return (not_running); } void From owner-svn-src-head@freebsd.org Tue Aug 18 10:58:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A869BCA85; Tue, 18 Aug 2015 10:58:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 008AA15FC; Tue, 18 Aug 2015 10:58:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A06DD1FE023; Tue, 18 Aug 2015 12:58:34 +0200 (CEST) Subject: Re: svn commit: r286880 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508181015.t7IAFAex055889@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <55D3102F.6080206@selasky.org> Date: Tue, 18 Aug 2015 12:59:59 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508181015.t7IAFAex055889@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 10:58:38 -0000 On 08/18/15 12:15, Julien Charbon wrote: > Author: jch > Date: Tue Aug 18 10:15:09 2015 > New Revision: 286880 > URL: https://svnweb.freebsd.org/changeset/base/286880 > > Log: > callout_stop() should return 0 (fail) when the callout is currently > being serviced and indeed unstoppable. > > A scenario to reproduce this case is: > > - the callout is being serviced and at same time, > - callout_reset() is called on this callout that sets > the CALLOUT_PENDING flag and at same time, > - callout_stop() is called on this callout and returns 1 (success) > even if the callout is indeed currently running and unstoppable. > > This issue was caught up while making r284245 (D2763) workaround, and > was discussed at BSDCan 2015. Once applied the r284245 workaround > is not needed anymore and will be reverted. > > Differential Revision: https://reviews.freebsd.org/D3078 > Reviewed by: jhb > Sponsored by: Verisign, Inc. > > Modified: > head/sys/kern/kern_timeout.c > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r286879) > +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r286880) > @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in > struct callout_cpu *cc, *old_cc; > struct lock_class *class; > int direct, sq_locked, use_lock; > - int not_on_a_list; > + int not_on_a_list, not_running; > > if (safe) > WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, > @@ -1378,8 +1378,15 @@ again: > } > } > callout_cc_del(c, cc); > + > + /* > + * If we are asked to stop a callout which is currently in progress > + * and indeed impossible to stop then return 0. > + */ > + not_running = !(cc_exec_curr(cc, direct) == c); > + > CC_UNLOCK(cc); > - return (1); > + return (not_running); > } > > void > > Should this be MFC'ed to 10? --HPS From owner-svn-src-head@freebsd.org Tue Aug 18 11:52:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D33529BC79C; Tue, 18 Aug 2015 11:52:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C406019D1; Tue, 18 Aug 2015 11:52:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IBqkMO097626; Tue, 18 Aug 2015 11:52:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IBqkJT097625; Tue, 18 Aug 2015 11:52:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508181152.t7IBqkJT097625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 18 Aug 2015 11:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286883 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 11:52:46 -0000 Author: emaste Date: Tue Aug 18 11:52:45 2015 New Revision: 286883 URL: https://svnweb.freebsd.org/changeset/base/286883 Log: Correct comment typo noted by erik Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Aug 18 11:51:29 2015 (r286882) +++ head/sys/arm64/arm64/trap.c Tue Aug 18 11:52:45 2015 (r286883) @@ -310,7 +310,7 @@ do_el1h_sync(struct trapframe *frame) /* * The attempted execution of an instruction bit pattern that has no allocated - * instruction resuls in an exception with an unknown reason. + * instruction results in an exception with an unknown reason. */ static void el0_excp_unknown(struct trapframe *frame) From owner-svn-src-head@freebsd.org Tue Aug 18 12:27:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F0449BC338; Tue, 18 Aug 2015 12:27:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F39ADCE; Tue, 18 Aug 2015 12:27:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ICRMnv010356; Tue, 18 Aug 2015 12:27:22 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ICRM3K010355; Tue, 18 Aug 2015 12:27:22 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201508181227.t7ICRM3K010355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 18 Aug 2015 12:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286885 - head/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 12:27:22 -0000 Author: brueffer Date: Tue Aug 18 12:27:21 2015 New Revision: 286885 URL: https://svnweb.freebsd.org/changeset/base/286885 Log: RIP Stefan Farfeleder (stefanf), committer since 2004. You will be missed! Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 18 12:26:38 2015 (r286884) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 18 12:27:21 2015 (r286885) @@ -259,6 +259,7 @@ 08/06 Damjan Marion born in Rijeka, Croatia, 1978 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/08 Mikolaj Golub born in Kharkov, USSR, 1977 +08/09 Stefan Farfeleder died in Wien, Austria, 2015 08/10 Julio Merino born in Barcelona, Spain, 1984 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 08/12 Joe Marcus Clarke born in Lakeland, Florida, United States, 1976 From owner-svn-src-head@freebsd.org Tue Aug 18 12:50:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9A259BCCF2; Tue, 18 Aug 2015 12:50:47 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5ED7E5; Tue, 18 Aug 2015 12:50:47 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IColci020807; Tue, 18 Aug 2015 12:50:47 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IColCg020806; Tue, 18 Aug 2015 12:50:47 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201508181250.t7IColCg020806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Tue, 18 Aug 2015 12:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286886 - head/sys/dev/sound/midi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 12:50:47 -0000 Author: avatar Date: Tue Aug 18 12:50:46 2015 New Revision: 286886 URL: https://svnweb.freebsd.org/changeset/base/286886 Log: Fixing typo as well as improving readability of a few comments. MFC after: 3 days Modified: head/sys/dev/sound/midi/midi.c Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Tue Aug 18 12:27:21 2015 (r286885) +++ head/sys/dev/sound/midi/midi.c Tue Aug 18 12:50:46 2015 (r286886) @@ -86,7 +86,7 @@ enum midi_states { }; /* - * The MPU interface current has init() uninit() inqsize(( outqsize() + * The MPU interface current has init() uninit() inqsize() outqsize() * callback() : fiddle with the tx|rx status. */ @@ -160,10 +160,15 @@ DEFINE_CLASS(midisynth, midisynth_method /* * Module Exports & Interface * - * struct midi_chan *midi_init(MPU_CLASS cls, int unit, int chan) int - * midi_uninit(struct snd_midi *) 0 == no error EBUSY or other error int - * Midi_in(struct midi_chan *, char *buf, int count) int Midi_out(struct - * midi_chan *, char *buf, int count) + * struct midi_chan *midi_init(MPU_CLASS cls, int unit, int chan, + * void *cookie) + * int midi_uninit(struct snd_midi *) + * + * 0 == no error + * EBUSY or other error + * + * int midi_in(struct snd_midi *, char *buf, int count) + * int midi_out(struct snd_midi *, char *buf, int count) * * midi_{in,out} return actual size transfered * @@ -388,7 +393,7 @@ err0: mtx_unlock(&midistat_lock); /* * midi_uninit does not call MIDI_UNINIT, as since this is the implementors - * entry point. midi_unint if fact, does not send any methods. A call to + * entry point. midi_uninit if fact, does not send any methods. A call to * midi_uninit is a defacto promise that you won't manipulate ch anymore * */ From owner-svn-src-head@freebsd.org Tue Aug 18 13:16:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B739BB565; Tue, 18 Aug 2015 13:16:07 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E998D1D19; Tue, 18 Aug 2015 13:16:06 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IDG67k031543; Tue, 18 Aug 2015 13:16:06 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IDG6e9031542; Tue, 18 Aug 2015 13:16:06 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201508181316.t7IDG6e9031542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Tue, 18 Aug 2015 13:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286887 - head/sys/dev/sound/midi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 13:16:07 -0000 Author: avatar Date: Tue Aug 18 13:16:06 2015 New Revision: 286887 URL: https://svnweb.freebsd.org/changeset/base/286887 Log: Using the error return code documented in the comment. Though there is no direct midi_uninit() caller amongst existing drivers at this moment, a quick experiment indicates that EBUSY gives users more precise error message once drivers start to honour this result. For example, emu_midi_detach() should check the result of mpu401_uninit() and block module unloading if there is any MIDI I/O in progress. MFC after: 2 weeks Modified: head/sys/dev/sound/midi/midi.c Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Tue Aug 18 12:50:46 2015 (r286886) +++ head/sys/dev/sound/midi/midi.c Tue Aug 18 13:16:06 2015 (r286887) @@ -403,7 +403,7 @@ midi_uninit(struct snd_midi *m) { int err; - err = ENXIO; + err = EBUSY; mtx_lock(&midistat_lock); mtx_lock(&m->lock); if (m->busy) { From owner-svn-src-head@freebsd.org Tue Aug 18 13:16:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D2E69BB59D; Tue, 18 Aug 2015 13:16:24 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DFD81E2D; Tue, 18 Aug 2015 13:16:24 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IDGNBr031599; Tue, 18 Aug 2015 13:16:23 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IDGNb6031598; Tue, 18 Aug 2015 13:16:23 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201508181316.t7IDGNb6031598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Tue, 18 Aug 2015 13:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286888 - head/sys/gnu/fs/reiserfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 13:16:24 -0000 Author: avatar Date: Tue Aug 18 13:16:23 2015 New Revision: 286888 URL: https://svnweb.freebsd.org/changeset/base/286888 Log: Using consistent coding style to deal with error inside the loop. MFC after: 1 week Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Aug 18 13:16:06 2015 (r286887) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Aug 18 13:16:23 2015 (r286888) @@ -960,8 +960,8 @@ uint32_t find_hash_out(struct reiserfs_m key.on_disk_key.k_objectid, key.on_disk_key.k_dir_id); retval = search_by_entry_key(sbi, &key, &path, &de); if (retval == IO_ERROR) { - pathrelse(&path); - return (UNSET_HASH); + hash = UNSET_HASH; + break; } if (retval == NAME_NOT_FOUND) de.de_entry_num--; From owner-svn-src-head@freebsd.org Tue Aug 18 13:12:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B2EE9BB470 for ; Tue, 18 Aug 2015 13:12:12 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8FAC1A25 for ; Tue, 18 Aug 2015 13:12:11 +0000 (UTC) (envelope-from julien@jch.io) Received: by wibhh20 with SMTP id hh20so108429169wib.0 for ; Tue, 18 Aug 2015 06:12:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=SkZbIdxLCQdt+A/8Fd5ak2pTAMr64Sdb8ZafNSbm8lU=; b=VgJv11rSy2wSYpEk1FhlOjWLvdRsQQ2g92hwVdmEl4pLIFh5/GgQbm/XkQoCo48+Ij RYcMzGPyD6FGhZZ7dtGFcLrFyDp5QQ8reKRu0xbMLuJRup7Ti59ifYnN/cILlrrbaGOL i4R6ZKi9lfIh8sGhuhInoLR5y3JthQHZ4jqETbJXiK4QC9h/CtVZ8N8n5OzUURbA4kl5 6H7XPp58nmpaZ62oCVLl8qEwWpNA7bLx21bCQeeCLu60gbMjJqpYedv+gl/jBQFXm97V gz67UuhXj1/grMYaG3qkdNuKqZf937HNRD3Go6ZemV8yWpEpOcWjLIh1NQI7l//gVqqH /uCw== X-Gm-Message-State: ALoCoQm453MtpfpGIlQmayFo1aq6tkaGpm6GjwOk78uCgKjtjvll5WOL1TAEFZsfkNA36lTAtUeG X-Received: by 10.180.108.39 with SMTP id hh7mr45240916wib.3.1439903530092; Tue, 18 Aug 2015 06:12:10 -0700 (PDT) Received: from fri2jcharbon-m1.vcorp.ad.vrsn.com ([217.30.88.7]) by smtp.googlemail.com with ESMTPSA id z11sm21354694wij.9.2015.08.18.06.12.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2015 06:12:08 -0700 (PDT) Message-ID: <55D32F22.5060400@freebsd.org> Date: Tue, 18 Aug 2015 15:12:02 +0200 From: Julien Charbon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286880 - head/sys/kern References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55D3102F.6080206@selasky.org> In-Reply-To: <55D3102F.6080206@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ltqFU8Ami5s4SGcnbNXK48ElTOL7bNXK7" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 13:12:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ltqFU8Ami5s4SGcnbNXK48ElTOL7bNXK7 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Hans, On 18/08/15 12:59, Hans Petter Selasky wrote: > On 08/18/15 12:15, Julien Charbon wrote: >> Author: jch >> Date: Tue Aug 18 10:15:09 2015 >> New Revision: 286880 >> URL: https://svnweb.freebsd.org/changeset/base/286880 >> >> Log: >> callout_stop() should return 0 (fail) when the callout is currently= >> being serviced and indeed unstoppable. >> [...] >=20 > Should this be MFC'ed to 10? Good question. I did not find any code paths that relies on the issue to happen, thus it looks "MFC-able" to 10. I would say "MFC: After two weeks" if nobody disagrees. -- Julien --ltqFU8Ami5s4SGcnbNXK48ElTOL7bNXK7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV0y8nAAoJEKVlQ5Je6dhxZkMH/2cLHXgokd1TnW9ecjiphzfY d3F61bs13vC1KH1ed/ef0oQd+n7KWra57E6YXWP3x83FldwMqDEaQ0rmtkYT234X i5ITWHJ2hui4CrOLVcO35LcE6FXRecKuE+t2H7dNTejNrCqQpDugSpx8eKBzfNx4 2k55VTw33ZcVpet3H0tK2pjistfUYbPIP7n8RiFSpzMdcVAAWV8QqCmEwY4J1P3y K/2Hs4MVybe58afVkB/3Yo6XxMVoEbeg+PemWrrQnkZv6Ik8u3l4AV6oMzi3ZPlE KhZCQsP+7yJHe8t2YVQu5ftiHeBKxJoUquuvuxg/ckIHRSpmPHLCfvDVW5IvTX4= =+8Ep -----END PGP SIGNATURE----- --ltqFU8Ami5s4SGcnbNXK48ElTOL7bNXK7-- From owner-svn-src-head@freebsd.org Tue Aug 18 14:54:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1DA9BC48A; Tue, 18 Aug 2015 14:54:30 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB2D11051; Tue, 18 Aug 2015 14:54:30 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IEsUIW073445; Tue, 18 Aug 2015 14:54:30 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IEsUvF073442; Tue, 18 Aug 2015 14:54:30 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201508181454.t7IEsUvF073442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Tue, 18 Aug 2015 14:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286890 - head/sys/dev/ichwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 14:54:31 -0000 Author: fabient Date: Tue Aug 18 14:54:29 2015 New Revision: 286890 URL: https://svnweb.freebsd.org/changeset/base/286890 Log: Add ichwd TCO version 3 support (Bay Trail / Rangeley...) Reviewed by: jhb Obtained from: Cas-well Sponsored by: Stormshield Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Tue Aug 18 14:10:04 2015 (r286889) +++ head/sys/dev/ichwd/ichwd.c Tue Aug 18 14:54:29 2015 (r286890) @@ -53,6 +53,7 @@ * (document no. 252516-001) sections 9.10 and 9.11. * * ICH6/7/8 support by Takeharu KATO + * SoC PMC support by Denir Li */ #include @@ -74,161 +75,216 @@ __FBSDID("$FreeBSD$"); #include static struct ichwd_device ichwd_devices[] = { - { DEVICEID_82801AA, "Intel 82801AA watchdog timer", 1 }, - { DEVICEID_82801AB, "Intel 82801AB watchdog timer", 1 }, - { DEVICEID_82801BA, "Intel 82801BA watchdog timer", 2 }, - { DEVICEID_82801BAM, "Intel 82801BAM watchdog timer", 2 }, - { DEVICEID_82801CA, "Intel 82801CA watchdog timer", 3 }, - { DEVICEID_82801CAM, "Intel 82801CAM watchdog timer", 3 }, - { DEVICEID_82801DB, "Intel 82801DB watchdog timer", 4 }, - { DEVICEID_82801DBM, "Intel 82801DBM watchdog timer", 4 }, - { DEVICEID_82801E, "Intel 82801E watchdog timer", 5 }, - { DEVICEID_82801EB, "Intel 82801EB watchdog timer", 5 }, - { DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer", 5 }, - { DEVICEID_6300ESB, "Intel 6300ESB watchdog timer", 5 }, - { DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer", 6 }, - { DEVICEID_ICH6M, "Intel ICH6M watchdog timer", 6 }, - { DEVICEID_ICH6W, "Intel ICH6W watchdog timer", 6 }, - { DEVICEID_ICH7, "Intel ICH7 watchdog timer", 7 }, - { DEVICEID_ICH7DH, "Intel ICH7DH watchdog timer", 7 }, - { DEVICEID_ICH7M, "Intel ICH7M watchdog timer", 7 }, - { DEVICEID_ICH7MDH, "Intel ICH7MDH watchdog timer", 7 }, - { DEVICEID_NM10, "Intel NM10 watchdog timer", 7 }, - { DEVICEID_ICH8, "Intel ICH8 watchdog timer", 8 }, - { DEVICEID_ICH8DH, "Intel ICH8DH watchdog timer", 8 }, - { DEVICEID_ICH8DO, "Intel ICH8DO watchdog timer", 8 }, - { DEVICEID_ICH8M, "Intel ICH8M watchdog timer", 8 }, - { DEVICEID_ICH8ME, "Intel ICH8M-E watchdog timer", 8 }, - { DEVICEID_63XXESB, "Intel 63XXESB watchdog timer", 8 }, - { DEVICEID_ICH9, "Intel ICH9 watchdog timer", 9 }, - { DEVICEID_ICH9DH, "Intel ICH9DH watchdog timer", 9 }, - { DEVICEID_ICH9DO, "Intel ICH9DO watchdog timer", 9 }, - { DEVICEID_ICH9M, "Intel ICH9M watchdog timer", 9 }, - { DEVICEID_ICH9ME, "Intel ICH9M-E watchdog timer", 9 }, - { DEVICEID_ICH9R, "Intel ICH9R watchdog timer", 9 }, - { DEVICEID_ICH10, "Intel ICH10 watchdog timer", 10 }, - { DEVICEID_ICH10D, "Intel ICH10D watchdog timer", 10 }, - { DEVICEID_ICH10DO, "Intel ICH10DO watchdog timer", 10 }, - { DEVICEID_ICH10R, "Intel ICH10R watchdog timer", 10 }, - { DEVICEID_PCH, "Intel PCH watchdog timer", 10 }, - { DEVICEID_PCHM, "Intel PCH watchdog timer", 10 }, - { DEVICEID_P55, "Intel P55 watchdog timer", 10 }, - { DEVICEID_PM55, "Intel PM55 watchdog timer", 10 }, - { DEVICEID_H55, "Intel H55 watchdog timer", 10 }, - { DEVICEID_QM57, "Intel QM57 watchdog timer", 10 }, - { DEVICEID_H57, "Intel H57 watchdog timer", 10 }, - { DEVICEID_HM55, "Intel HM55 watchdog timer", 10 }, - { DEVICEID_Q57, "Intel Q57 watchdog timer", 10 }, - { DEVICEID_HM57, "Intel HM57 watchdog timer", 10 }, - { DEVICEID_PCHMSFF, "Intel PCHMSFF watchdog timer", 10 }, - { DEVICEID_QS57, "Intel QS57 watchdog timer", 10 }, - { DEVICEID_3400, "Intel 3400 watchdog timer", 10 }, - { DEVICEID_3420, "Intel 3420 watchdog timer", 10 }, - { DEVICEID_3450, "Intel 3450 watchdog timer", 10 }, - { DEVICEID_CPT0, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT1, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT2, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT3, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT4, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT5, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT6, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT7, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT8, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT9, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT10, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT11, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT12, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT13, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT14, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT15, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT16, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT17, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT18, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT19, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT20, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT21, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT22, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT25, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT26, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT27, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT28, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT29, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT30, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_CPT31, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_PATSBURG_LPC1, "Intel Patsburg watchdog timer", 10 }, - { DEVICEID_PATSBURG_LPC2, "Intel Patsburg watchdog timer", 10 }, - { DEVICEID_PPT0, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT1, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT2, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT3, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT4, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT5, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT6, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT7, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT8, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT9, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT10, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT11, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT12, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT13, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT14, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT15, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT16, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT17, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT18, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT19, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT20, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT21, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT22, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT23, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT24, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT25, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT26, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT27, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT28, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10 }, - { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT3, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT4, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT5, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT6, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT7, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT8, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT9, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT10, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT11, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT12, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT13, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT14, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT15, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT16, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT17, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT18, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT19, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT20, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT21, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT22, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT23, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT24, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT25, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT26, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT27, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT28, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT29, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT30, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_LPT31, "Intel Lynx Point watchdog timer", 10 }, - { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10 }, - { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10 }, - { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10 }, - { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, - { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10 }, - { 0, NULL, 0 }, + { DEVICEID_82801AA, "Intel 82801AA watchdog timer", 1, 1 }, + { DEVICEID_82801AB, "Intel 82801AB watchdog timer", 1, 1 }, + { DEVICEID_82801BA, "Intel 82801BA watchdog timer", 2, 1 }, + { DEVICEID_82801BAM, "Intel 82801BAM watchdog timer", 2, 1 }, + { DEVICEID_82801CA, "Intel 82801CA watchdog timer", 3, 1 }, + { DEVICEID_82801CAM, "Intel 82801CAM watchdog timer", 3, 1 }, + { DEVICEID_82801DB, "Intel 82801DB watchdog timer", 4, 1 }, + { DEVICEID_82801DBM, "Intel 82801DBM watchdog timer", 4, 1 }, + { DEVICEID_82801E, "Intel 82801E watchdog timer", 5, 1 }, + { DEVICEID_82801EB, "Intel 82801EB watchdog timer", 5, 1 }, + { DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer", 5, 1 }, + { DEVICEID_6300ESB, "Intel 6300ESB watchdog timer", 5, 1 }, + { DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer", 6, 2 }, + { DEVICEID_ICH6M, "Intel ICH6M watchdog timer", 6, 2 }, + { DEVICEID_ICH6W, "Intel ICH6W watchdog timer", 6, 2 }, + { DEVICEID_ICH7, "Intel ICH7 watchdog timer", 7, 2 }, + { DEVICEID_ICH7DH, "Intel ICH7DH watchdog timer", 7, 2 }, + { DEVICEID_ICH7M, "Intel ICH7M watchdog timer", 7, 2 }, + { DEVICEID_ICH7MDH, "Intel ICH7MDH watchdog timer", 7, 2 }, + { DEVICEID_NM10, "Intel NM10 watchdog timer", 7, 2 }, + { DEVICEID_ICH8, "Intel ICH8 watchdog timer", 8, 2 }, + { DEVICEID_ICH8DH, "Intel ICH8DH watchdog timer", 8, 2 }, + { DEVICEID_ICH8DO, "Intel ICH8DO watchdog timer", 8, 2 }, + { DEVICEID_ICH8M, "Intel ICH8M watchdog timer", 8, 2 }, + { DEVICEID_ICH8ME, "Intel ICH8M-E watchdog timer", 8, 2 }, + { DEVICEID_63XXESB, "Intel 63XXESB watchdog timer", 8, 2 }, + { DEVICEID_ICH9, "Intel ICH9 watchdog timer", 9, 2 }, + { DEVICEID_ICH9DH, "Intel ICH9DH watchdog timer", 9, 2 }, + { DEVICEID_ICH9DO, "Intel ICH9DO watchdog timer", 9, 2 }, + { DEVICEID_ICH9M, "Intel ICH9M watchdog timer", 9, 2 }, + { DEVICEID_ICH9ME, "Intel ICH9M-E watchdog timer", 9, 2 }, + { DEVICEID_ICH9R, "Intel ICH9R watchdog timer", 9, 2 }, + { DEVICEID_ICH10, "Intel ICH10 watchdog timer", 10, 2 }, + { DEVICEID_ICH10D, "Intel ICH10D watchdog timer", 10, 2 }, + { DEVICEID_ICH10DO, "Intel ICH10DO watchdog timer", 10, 2 }, + { DEVICEID_ICH10R, "Intel ICH10R watchdog timer", 10, 2 }, + { DEVICEID_PCH, "Intel PCH watchdog timer", 10, 2 }, + { DEVICEID_PCHM, "Intel PCH watchdog timer", 10, 2 }, + { DEVICEID_P55, "Intel P55 watchdog timer", 10, 2 }, + { DEVICEID_PM55, "Intel PM55 watchdog timer", 10, 2 }, + { DEVICEID_H55, "Intel H55 watchdog timer", 10, 2 }, + { DEVICEID_QM57, "Intel QM57 watchdog timer", 10, 2 }, + { DEVICEID_H57, "Intel H57 watchdog timer", 10, 2 }, + { DEVICEID_HM55, "Intel HM55 watchdog timer", 10, 2 }, + { DEVICEID_Q57, "Intel Q57 watchdog timer", 10, 2 }, + { DEVICEID_HM57, "Intel HM57 watchdog timer", 10, 2 }, + { DEVICEID_PCHMSFF, "Intel PCHMSFF watchdog timer", 10, 2 }, + { DEVICEID_QS57, "Intel QS57 watchdog timer", 10, 2 }, + { DEVICEID_3400, "Intel 3400 watchdog timer", 10, 2 }, + { DEVICEID_3420, "Intel 3420 watchdog timer", 10, 2 }, + { DEVICEID_3450, "Intel 3450 watchdog timer", 10, 2 }, + { DEVICEID_CPT0, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT1, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT2, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT3, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT4, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT5, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT6, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT7, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT8, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT9, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT10, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT11, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT12, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT13, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT14, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT15, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT16, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT17, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT18, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT19, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT20, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT21, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT22, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT24, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT25, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT26, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT27, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT28, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT29, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT30, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_CPT31, "Intel Cougar Point watchdog timer", 10, 2 }, + { DEVICEID_PATSBURG_LPC1, "Intel Patsburg watchdog timer", 10, 2 }, + { DEVICEID_PATSBURG_LPC2, "Intel Patsburg watchdog timer", 10, 2 }, + { DEVICEID_PPT0, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT1, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT2, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT3, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT4, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT5, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT6, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT7, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT8, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT9, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT10, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT11, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT12, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT13, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT14, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT15, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT16, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT17, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT18, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT19, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT20, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT21, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT22, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT23, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT24, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT25, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT26, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT27, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT28, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10, 2 }, + { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT3, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT4, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT5, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT6, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT7, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT8, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT9, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT10, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT11, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT12, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT13, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT14, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT15, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT16, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT17, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT18, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT19, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT20, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT21, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT22, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT23, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT24, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT25, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT26, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT27, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT28, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT29, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT30, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_LPT31, "Intel Lynx Point watchdog timer", 10, 2 }, + { DEVICEID_WCPT1, "Intel Wildcat Point watchdog timer", 10, 2 }, + { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10, 2 }, + { DEVICEID_WCPT3, "Intel Wildcat Point watchdog timer", 10, 2 }, + { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10, 2 }, + { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10, 2 }, + { DEVICEID_WBG0, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG1, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG2, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG3, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG4, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG5, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG6, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG7, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG8, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG9, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG10, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG11, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG12, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG13, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG14, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG15, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG16, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG17, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG18, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG19, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG20, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG21, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG22, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG23, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG24, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG25, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG26, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG27, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG28, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG29, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG30, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_WBG31, "Intel Wellsburg watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP0, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP1, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP2, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP3, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP4, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP5, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP6, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_LPT_LP7, "Intel Lynx Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP1, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP2, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP3, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP5, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP6, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP7, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_WCPT_LP9, "Intel Wildcat Point-LP watchdog timer", 10, 2 }, + { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10, 2 }, + { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10, 2 }, + { DEVICEID_AVN0, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 }, + { DEVICEID_AVN1, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 }, + { DEVICEID_AVN2, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 }, + { DEVICEID_AVN3, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 }, + { DEVICEID_BAYTRAIL, "Intel Bay Trail SoC watchdog timer", 10, 3 }, + { DEVICEID_BRASWELL, "Intel Braswell SoC watchdog timer", 10, 3 }, + { 0, NULL, 0, 0 }, }; static devclass_t ichwd_devclass; @@ -243,6 +299,9 @@ static devclass_t ichwd_devclass; bus_read_4((sc)->smi_res, (off)) #define ichwd_read_gcs_4(sc, off) \ bus_read_4((sc)->gcs_res, (off)) +/* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */ +#define ichwd_read_pmc_4(sc, off) \ + bus_read_4((sc)->gcs_res, (off)) #define ichwd_write_tco_1(sc, off, val) \ bus_write_1((sc)->tco_res, (off), (val)) @@ -254,6 +313,9 @@ static devclass_t ichwd_devclass; bus_write_4((sc)->smi_res, (off), (val)) #define ichwd_write_gcs_4(sc, off, val) \ bus_write_4((sc)->gcs_res, (off), (val)) +/* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */ +#define ichwd_write_pmc_4(sc, off, val) \ + bus_write_4((sc)->gcs_res, (off), (val)) #define ichwd_verbose_printf(dev, ...) \ do { \ @@ -352,7 +414,7 @@ ichwd_tmr_disable(struct ichwd_softc *sc static __inline void ichwd_tmr_reload(struct ichwd_softc *sc) { - if (sc->ich_version <= 5) + if (sc->tco_version == 1) ichwd_write_tco_1(sc, TCO_RLD, 1); else ichwd_write_tco_2(sc, TCO_RLD, 1); @@ -369,7 +431,7 @@ ichwd_tmr_set(struct ichwd_softc *sc, un if (timeout < TCO_RLD_TMR_MIN) timeout = TCO_RLD_TMR_MIN; - if (sc->ich_version <= 5) { + if (sc->tco_version == 1) { uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1); tmr_val8 &= (~TCO_RLD1_TMR_MAX & 0xff); @@ -399,20 +461,36 @@ ichwd_clear_noreboot(struct ichwd_softc int rc = 0; /* try to clear the NO_REBOOT bit */ - if (sc->ich_version <= 5) { + switch (sc->tco_version) { + case 1: status = pci_read_config(sc->ich, ICH_GEN_STA, 1); status &= ~ICH_GEN_STA_NO_REBOOT; pci_write_config(sc->ich, ICH_GEN_STA, status, 1); status = pci_read_config(sc->ich, ICH_GEN_STA, 1); if (status & ICH_GEN_STA_NO_REBOOT) rc = EIO; - } else { + break; + case 2: status = ichwd_read_gcs_4(sc, 0); status &= ~ICH_GCS_NO_REBOOT; ichwd_write_gcs_4(sc, 0, status); status = ichwd_read_gcs_4(sc, 0); if (status & ICH_GCS_NO_REBOOT) rc = EIO; + break; + case 3: + status = ichwd_read_pmc_4(sc, 0); + status &= ~ICH_PMC_NO_REBOOT; + ichwd_write_pmc_4(sc, 0, status); + status = ichwd_read_pmc_4(sc, 0); + if (status & ICH_PMC_NO_REBOOT) + rc = EIO; + break; + default: + ichwd_verbose_printf(sc->device, + "Unknown TCO Version: %d, can't set NO_REBOOT.\n", + sc->tco_version); + break; } if (rc) @@ -463,7 +541,7 @@ ichwd_find_ich_lpc_bridge(struct ichwd_d return (NULL); ichwd_verbose_printf(ich, "found ICH%d or equivalent chipset: %s\n", - id->version, id->desc); + id->ich_version, id->desc); if (id_p) *id_p = id; @@ -481,7 +559,7 @@ ichwd_identify(driver_t *driver, device_ struct ichwd_device *id_p; device_t ich = NULL; device_t dev; - uint32_t rcba; + uint32_t base_address; int rc; ich = ichwd_find_ich_lpc_bridge(&id_p); @@ -497,14 +575,36 @@ ichwd_identify(driver_t *driver, device_ device_set_desc_copy(dev, id_p->desc); - if (id_p->version >= 6) { + switch (id_p->tco_version) { + case 1: + break; + case 2: /* get RCBA (root complex base address) */ - rcba = pci_read_config(ich, ICH_RCBA, 4); + base_address = pci_read_config(ich, ICH_RCBA, 4); + rc = bus_set_resource(ich, SYS_RES_MEMORY, 0, + (base_address & 0xffffc000) + ICH_GCS_OFFSET, + ICH_GCS_SIZE); + if (rc) + ichwd_verbose_printf(dev, + "Can not set TCO v%d memory resource for RCBA\n", + id_p->tco_version); + break; + case 3: + /* get PBASE (Power Management Controller base address) */ + base_address = pci_read_config(ich, ICH_PBASE, 4); rc = bus_set_resource(ich, SYS_RES_MEMORY, 0, - (rcba & 0xffffc000) + ICH_GCS_OFFSET, ICH_GCS_SIZE); + (base_address & 0xfffffe00) + ICH_PMC_OFFSET, + ICH_PMC_SIZE); if (rc) ichwd_verbose_printf(dev, - "Can not set memory resource for RCBA\n"); + "Can not set TCO v%d memory resource for PBASE\n", + id_p->tco_version); + break; + default: + ichwd_verbose_printf(dev, + "Can not set unknown TCO v%d memory resource for unknown base address\n", + id_p->tco_version); + break; } } @@ -535,7 +635,8 @@ ichwd_attach(device_t dev) goto fail; } sc->ich = ich; - sc->ich_version = id_p->version; + sc->ich_version = id_p->ich_version; + sc->tco_version = id_p->tco_version; /* get ACPI base address */ pmbase = pci_read_config(ich, ICH_PMBASE, 2) & ICH_PMBASE_MASK; @@ -564,7 +665,7 @@ ichwd_attach(device_t dev) } sc->gcs_rid = 0; - if (sc->ich_version >= 6) { + if (sc->tco_version >= 2) { sc->gcs_res = bus_alloc_resource_any(ich, SYS_RES_MEMORY, &sc->gcs_rid, RF_ACTIVE|RF_SHAREABLE); if (sc->gcs_res == NULL) { @@ -577,7 +678,7 @@ ichwd_attach(device_t dev) goto fail; ichwd_verbose_printf(dev, "%s (ICH%d or equivalent)\n", - device_get_desc(dev), sc->ich_version); + id_p->desc, sc->ich_version); /* * Determine if we are coming up after a watchdog-induced reset. Some @@ -648,7 +749,8 @@ ichwd_detach(device_t dev) /* deallocate memory resource */ ich = ichwd_find_ich_lpc_bridge(NULL); if (sc->gcs_res && ich) - bus_release_resource(ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); + bus_release_resource(ich, SYS_RES_MEMORY, sc->gcs_rid, + sc->gcs_res); return (0); } Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Tue Aug 18 14:10:04 2015 (r286889) +++ head/sys/dev/ichwd/ichwd.h Tue Aug 18 14:54:29 2015 (r286890) @@ -34,13 +34,15 @@ struct ichwd_device { uint16_t device; char *desc; - unsigned int version; + unsigned int ich_version; + unsigned int tco_version; }; struct ichwd_softc { device_t device; device_t ich; int ich_version; + int tco_version; int active; unsigned int timeout; @@ -59,6 +61,7 @@ struct ichwd_softc { }; #define VENDORID_INTEL 0x8086 +#define DEVICEID_BAYTRAIL 0x0f1c #define DEVICEID_CPT0 0x1c40 #define DEVICEID_CPT1 0x1c41 #define DEVICEID_CPT2 0x1c42 @@ -125,6 +128,11 @@ struct ichwd_softc { #define DEVICEID_PPT29 0x1e5d #define DEVICEID_PPT30 0x1e5e #define DEVICEID_PPT31 0x1e5f +#define DEVICEID_AVN0 0x1f38 +#define DEVICEID_AVN1 0x1f39 +#define DEVICEID_AVN2 0x1f3a +#define DEVICEID_AVN3 0x1f3b +#define DEVICEID_BRASWELL 0x229c #define DEVICEID_DH89XXCC_LPC 0x2310 #define DEVICEID_COLETOCRK_LPC 0x2390 #define DEVICEID_82801AA 0x2410 @@ -210,9 +218,58 @@ struct ichwd_softc { #define DEVICEID_LPT29 0x8c5d #define DEVICEID_LPT30 0x8c5e #define DEVICEID_LPT31 0x8c5f +#define DEVICEID_WCPT1 0x8cc1 #define DEVICEID_WCPT2 0x8cc2 +#define DEVICEID_WCPT3 0x8cc3 #define DEVICEID_WCPT4 0x8cc4 #define DEVICEID_WCPT6 0x8cc6 +#define DEVICEID_WBG0 0x8d40 +#define DEVICEID_WBG1 0x8d41 +#define DEVICEID_WBG2 0x8d42 +#define DEVICEID_WBG3 0x8d43 +#define DEVICEID_WBG4 0x8d44 +#define DEVICEID_WBG5 0x8d45 +#define DEVICEID_WBG6 0x8d46 +#define DEVICEID_WBG7 0x8d47 +#define DEVICEID_WBG8 0x8d48 +#define DEVICEID_WBG9 0x8d49 +#define DEVICEID_WBG10 0x8d4a +#define DEVICEID_WBG11 0x8d4b +#define DEVICEID_WBG12 0x8d4c +#define DEVICEID_WBG13 0x8d4d +#define DEVICEID_WBG14 0x8d4e +#define DEVICEID_WBG15 0x8d4f +#define DEVICEID_WBG16 0x8d50 +#define DEVICEID_WBG17 0x8d51 +#define DEVICEID_WBG18 0x8d52 +#define DEVICEID_WBG19 0x8d53 +#define DEVICEID_WBG20 0x8d54 +#define DEVICEID_WBG21 0x8d55 +#define DEVICEID_WBG22 0x8d56 +#define DEVICEID_WBG23 0x8d57 +#define DEVICEID_WBG24 0x8d58 +#define DEVICEID_WBG25 0x8d59 +#define DEVICEID_WBG26 0x8d5a +#define DEVICEID_WBG27 0x8d5b +#define DEVICEID_WBG28 0x8d5c +#define DEVICEID_WBG29 0x8d5d +#define DEVICEID_WBG30 0x8d5e +#define DEVICEID_WBG31 0x8d5f +#define DEVICEID_LPT_LP0 0x9c40 +#define DEVICEID_LPT_LP1 0x9c41 +#define DEVICEID_LPT_LP2 0x9c42 +#define DEVICEID_LPT_LP3 0x9c43 +#define DEVICEID_LPT_LP4 0x9c44 +#define DEVICEID_LPT_LP5 0x9c45 +#define DEVICEID_LPT_LP6 0x9c46 +#define DEVICEID_LPT_LP7 0x9c47 +#define DEVICEID_WCPT_LP1 0x9cc1 +#define DEVICEID_WCPT_LP2 0x9cc2 +#define DEVICEID_WCPT_LP3 0x9cc3 +#define DEVICEID_WCPT_LP5 0x9cc5 +#define DEVICEID_WCPT_LP6 0x9cc6 +#define DEVICEID_WCPT_LP7 0x9cc7 +#define DEVICEID_WCPT_LP9 0x9cc9 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 @@ -226,6 +283,12 @@ struct ichwd_softc { #define ICH_GCS_SIZE 0x4 #define ICH_GCS_NO_REBOOT 0x20 +/* SoC Power Management Configuration Registers */ +#define ICH_PBASE 0x44 +#define ICH_PMC_OFFSET 0x08 +#define ICH_PMC_SIZE 0x4 +#define ICH_PMC_NO_REBOOT 0x10 + /* register names and locations (relative to PMBASE) */ #define SMI_BASE 0x30 /* base address for SMI registers */ #define SMI_LEN 0x08 From owner-svn-src-head@freebsd.org Tue Aug 18 15:11:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F0F99BCA7A; Tue, 18 Aug 2015 15:11:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 801FC80; Tue, 18 Aug 2015 15:11:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IFBgps082057; Tue, 18 Aug 2015 15:11:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IFBg65082056; Tue, 18 Aug 2015 15:11:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508181511.t7IFBg65082056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 18 Aug 2015 15:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286891 - head/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 15:11:42 -0000 Author: pfg Date: Tue Aug 18 15:11:41 2015 New Revision: 286891 URL: https://svnweb.freebsd.org/changeset/base/286891 Log: Calendar: add a few more dates to the Christian calendar The many christian denominations have different dates for their celebrations and controversies are likely to be always. These are well established and happen to be holidays in many Catholic countries. MFC after: 1 month Modified: head/usr.bin/calendar/calendars/calendar.christian Modified: head/usr.bin/calendar/calendars/calendar.christian ============================================================================== --- head/usr.bin/calendar/calendars/calendar.christian Tue Aug 18 14:54:29 2015 (r286890) +++ head/usr.bin/calendar/calendars/calendar.christian Tue Aug 18 15:11:41 2015 (r286891) @@ -5,8 +5,9 @@ */ #ifndef _calendar_christian_ -#define _calendar_christian_ +#define _calendar_christian_ +01/01 Solemnity of Mary, Mother of God 01/05 Last (twelfth) day of Christmastide 01/06 Epiphany Easter-47 Shrove Tuesday / Mardi Gras (day before Ash Wednesday) @@ -21,10 +22,13 @@ Easter+50 Whitmonday Easter+56 Trinity Sunday (7 days after Pentecost) Easter+60 Corpus Christi (11 days after Pentecost) 05/28* Rogation Sunday +08/15 Assumption of the Blessed Virgin Mary +09/01 All Saints' Day 10/18 Feast Day of St. Luke 11/SunLast First Sunday of Advent (4th Sunday before Christmas) 12/SunFirst First Sunday of Advent (4th Sunday before Christmas) 12/06 St. Nicholas' Day +12/08 Feast of the Immaculate Conception 12/24 Christmas Eve 12/25 Christmastide begins: First day of Christmas 12/26 Second day of Christmas (Boxing Day) From owner-svn-src-head@freebsd.org Tue Aug 18 15:33:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE3F9BCEF9; Tue, 18 Aug 2015 15:33:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39FF1101A; Tue, 18 Aug 2015 15:33:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IFXPtH090971; Tue, 18 Aug 2015 15:33:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IFXOZm090967; Tue, 18 Aug 2015 15:33:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201508181533.t7IFXOZm090967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 18 Aug 2015 15:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286892 - head/usr.sbin/ypserv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 15:33:25 -0000 Author: asomers Date: Tue Aug 18 15:33:23 2015 New Revision: 286892 URL: https://svnweb.freebsd.org/changeset/base/286892 Log: Serve /etc/eui64 via NIS. The C library already knows how to lookup eui64 entries from NIS. For example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes that. Reviewed by: brooks, wblock MFC after: 2 weeks Sponsored by: SpectraLogic Corp Differential Revision: https://reviews.freebsd.org/D3404 Modified: head/usr.sbin/ypserv/Makefile.yp head/usr.sbin/ypserv/ypinit.8 head/usr.sbin/ypserv/ypinit.sh Modified: head/usr.sbin/ypserv/Makefile.yp ============================================================================== --- head/usr.sbin/ypserv/Makefile.yp Tue Aug 18 15:11:41 2015 (r286891) +++ head/usr.sbin/ypserv/Makefile.yp Tue Aug 18 15:33:23 2015 (r286892) @@ -103,6 +103,7 @@ YPMAPDIR = $(YPDIR)/$(DOMAIN) # passwd file will be generated from the master.passwd file automagically. # ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd) +EUI64 = $(YPSRCDIR)/eui64 # eui64 addresses (for firewire) BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd) HOSTS = $(YPSRCDIR)/hosts IPNODES = $(YPDIR)/ipnodes @@ -143,8 +144,8 @@ TARGETS= servers hosts networks protocol #TARGETS+= aliases # Sanity checks: filter out targets we can't build -# Note that we don't build the ethers or boorparams maps by default -# since /etc/ethers and /etc/bootparams are not likely to be present +# Note that we don't build the ethers, eui64, or boorparams maps by default +# since /etc/ethers, /etc/eui64 and /etc/bootparams are not likely to be present # on all systems. .if exists($(ETHERS)) TARGETS+= ethers @@ -152,6 +153,12 @@ TARGETS+= ethers ETHERS= /dev/null .endif +.if exists($(EUI64)) +TARGETS+= eui64 +.else +EUI64= /dev/null +.endif + .if exists($(BOOTPARAMS)) TARGETS+= bootparams .else @@ -195,6 +202,7 @@ IPNODES= /dev/null all: $(TARGETS) ethers: ethers.byname ethers.byaddr +eui64: eui64.byname eui64.byid bootparam: bootparams hosts: hosts.byname hosts.byaddr ipnodes: ipnodes.byname ipnodes.byaddr @@ -294,6 +302,32 @@ ethers.byaddr: $(ETHERS) @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi .endif +eui64.byname: $(EUI64) + @echo "Updating $@..." +.if ${EUI64} == "/dev/null" + @echo "EUI64 source file not found -- skipping" +.else + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$2"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \ + -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + +eui64.byid: $(EUI64) + @echo "Updating $@..." +.if ${EUI64} == "/dev/null" + @echo "EUI64 source file not found -- skipping" +.else + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(EUI64) | $(DBLOAD) -i $(EUI64) \ + -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + bootparams: $(BOOTPARAMS) @echo "Updating $@..." Modified: head/usr.sbin/ypserv/ypinit.8 ============================================================================== --- head/usr.sbin/ypserv/ypinit.8 Tue Aug 18 15:11:41 2015 (r286891) +++ head/usr.sbin/ypserv/ypinit.8 Tue Aug 18 15:33:23 2015 (r286892) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 1997 +.Dd August 18, 2015 .Dt YPINIT 8 .Os .Sh NAME @@ -147,6 +147,8 @@ can propagate updates on the master to a Bootparams source file .It Pa /etc/ethers Ethers data source file +.It Pa /etc/eui64 +EUI64 data source file .It Pa /etc/group Group source file .It Pa /etc/hosts Modified: head/usr.sbin/ypserv/ypinit.sh ============================================================================== --- head/usr.sbin/ypserv/ypinit.sh Tue Aug 18 15:11:41 2015 (r286891) +++ head/usr.sbin/ypserv/ypinit.sh Tue Aug 18 15:33:23 2015 (r286892) @@ -14,8 +14,9 @@ MAPLIST="master.passwd.byname master.pas group.byname group.bygid hosts.byname hosts.byaddr services.byname \ rpc.byname rpc.bynumber networks.byname networks.byaddr netgroup \ netgroup.byuser netgroup.byhost netid.byname publickey.byname \ - bootparams ethers.byname ethers.byaddr amd.host mail.aliases \ - ypservers protocols.byname protocols.bynumber netmasks.byaddr" + bootparams ethers.byname ethers.byaddr eui64.byname eui64.byid \ + amd.host mail.aliases ypservers protocols.byname protocols.bynumber \ + netmasks.byaddr" ERROR_EXISTS="NO" umask 077 From owner-svn-src-head@freebsd.org Tue Aug 18 15:50:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F81B9BC2F8; Tue, 18 Aug 2015 15:50:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 605B31CC1; Tue, 18 Aug 2015 15:50:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IFo3AH095840; Tue, 18 Aug 2015 15:50:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IFo3tR095839; Tue, 18 Aug 2015 15:50:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508181550.t7IFo3tR095839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 18 Aug 2015 15:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286893 - head/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 15:50:03 -0000 Author: pfg Date: Tue Aug 18 15:50:02 2015 New Revision: 286893 URL: https://svnweb.freebsd.org/changeset/base/286893 Log: Correct All Saints' day. Thanks to: zec X-MFC with: r286891 Modified: head/usr.bin/calendar/calendars/calendar.christian Modified: head/usr.bin/calendar/calendars/calendar.christian ============================================================================== --- head/usr.bin/calendar/calendars/calendar.christian Tue Aug 18 15:33:23 2015 (r286892) +++ head/usr.bin/calendar/calendars/calendar.christian Tue Aug 18 15:50:02 2015 (r286893) @@ -23,8 +23,8 @@ Easter+56 Trinity Sunday (7 days after P Easter+60 Corpus Christi (11 days after Pentecost) 05/28* Rogation Sunday 08/15 Assumption of the Blessed Virgin Mary -09/01 All Saints' Day 10/18 Feast Day of St. Luke +11/01 All Saints' Day 11/SunLast First Sunday of Advent (4th Sunday before Christmas) 12/SunFirst First Sunday of Advent (4th Sunday before Christmas) 12/06 St. Nicholas' Day From owner-svn-src-head@freebsd.org Tue Aug 18 18:12:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886DD9BD56C; Tue, 18 Aug 2015 18:12:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607E61D2F; Tue, 18 Aug 2015 18:12:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IIClh4058530; Tue, 18 Aug 2015 18:12:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IICk88058528; Tue, 18 Aug 2015 18:12:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508181812.t7IICk88058528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Aug 2015 18:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286894 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 18:12:47 -0000 Author: delphij Date: Tue Aug 18 18:12:46 2015 New Revision: 286894 URL: https://svnweb.freebsd.org/changeset/base/286894 Log: Set curvnet context inside the RPC code in more places. Reviewed by: melifaro MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3398 Modified: head/sys/rpc/rpc_generic.c head/sys/rpc/svc_vc.c Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Tue Aug 18 15:50:02 2015 (r286893) +++ head/sys/rpc/rpc_generic.c Tue Aug 18 18:12:46 2015 (r286894) @@ -703,7 +703,9 @@ __rpc_sockisbound(struct socket *so) struct sockaddr *sa; int error, bound; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (0); @@ -791,7 +793,9 @@ bindresvport(struct socket *so, struct s socklen_t salen; if (sa == NULL) { + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) return (error); freesa = TRUE; Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Aug 18 15:50:02 2015 (r286893) +++ head/sys/rpc/svc_vc.c Tue Aug 18 18:12:46 2015 (r286894) @@ -150,7 +150,9 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCK_LOCK(so); if (so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED)) { SOCK_UNLOCK(so); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); + CURVNET_RESTORE(); if (error) return (NULL); xprt = svc_vc_create_conn(pool, so, sa); @@ -167,7 +169,9 @@ svc_vc_create(SVCPOOL *pool, struct sock xprt->xp_p2 = NULL; xprt->xp_ops = &svc_vc_rendezvous_ops; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) { goto cleanup_svc_vc_create; } @@ -249,7 +253,9 @@ svc_vc_create_conn(SVCPOOL *pool, struct memcpy(&xprt->xp_rtaddr, raddr, raddr->sa_len); + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) goto cleanup_svc_vc_create; From owner-svn-src-head@freebsd.org Tue Aug 18 19:30:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E441D9BC9BA; Tue, 18 Aug 2015 19:30:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2CE18FD; Tue, 18 Aug 2015 19:30:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IJU4iv089424; Tue, 18 Aug 2015 19:30:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IJU4Gs089423; Tue, 18 Aug 2015 19:30:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508181930.t7IJU4Gs089423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Aug 2015 19:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286899 - head/contrib/expat/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 19:30:05 -0000 Author: delphij Date: Tue Aug 18 19:30:04 2015 New Revision: 286899 URL: https://svnweb.freebsd.org/changeset/base/286899 Log: Fix multiple integer overflows in expat. Security: CVE-2015-1283 Security: FreeBSD-SA-15:20.expat Modified: head/contrib/expat/lib/xmlparse.c Modified: head/contrib/expat/lib/xmlparse.c ============================================================================== --- head/contrib/expat/lib/xmlparse.c Tue Aug 18 19:15:20 2015 (r286898) +++ head/contrib/expat/lib/xmlparse.c Tue Aug 18 19:30:04 2015 (r286899) @@ -1678,6 +1678,12 @@ XML_ParseBuffer(XML_Parser parser, int l void * XMLCALL XML_GetBuffer(XML_Parser parser, int len) { +/* BEGIN MOZILLA CHANGE (sanity check len) */ + if (len < 0) { + errorCode = XML_ERROR_NO_MEMORY; + return NULL; + } +/* END MOZILLA CHANGE */ switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; @@ -1689,8 +1695,13 @@ XML_GetBuffer(XML_Parser parser, int len } if (len > bufferLim - bufferEnd) { - /* FIXME avoid integer overflow */ int neededSize = len + (int)(bufferEnd - bufferPtr); +/* BEGIN MOZILLA CHANGE (sanity check neededSize) */ + if (neededSize < 0) { + errorCode = XML_ERROR_NO_MEMORY; + return NULL; + } +/* END MOZILLA CHANGE */ #ifdef XML_CONTEXT_BYTES int keep = (int)(bufferPtr - buffer); @@ -1719,7 +1730,15 @@ XML_GetBuffer(XML_Parser parser, int len bufferSize = INIT_BUFFER_SIZE; do { bufferSize *= 2; - } while (bufferSize < neededSize); +/* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */ + } while (bufferSize < neededSize && bufferSize > 0); +/* END MOZILLA CHANGE */ +/* BEGIN MOZILLA CHANGE (sanity check bufferSize) */ + if (bufferSize <= 0) { + errorCode = XML_ERROR_NO_MEMORY; + return NULL; + } +/* END MOZILLA CHANGE */ newBuf = (char *)MALLOC(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; From owner-svn-src-head@freebsd.org Tue Aug 18 19:50:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F22C99BD09B for ; Tue, 18 Aug 2015 19:50:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from vfemail.net (ninezero.vfemail.net [96.30.253.190]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDDCABF0 for ; Tue, 18 Aug 2015 19:50:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: (qmail 23015 invoked by uid 89); 18 Aug 2015 19:50:14 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 18 Aug 2015 19:50:14 -0000 Received: (qmail 22836 invoked by uid 89); 18 Aug 2015 19:49:56 -0000 Received: by simscan 1.3.1 ppid: 22828, pid: 22834, t: 0.0048s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 18 Aug 2015 19:49:56 -0000 Received: (qmail 7696 invoked by uid 89); 18 Aug 2015 19:49:56 -0000 Received: by simscan 1.4.0 ppid: 7666, pid: 7693, t: 0.7217s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 18 Aug 2015 19:49:56 -0000 From: Jan Beich To: Jason Evans Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... References: <201508180021.t7I0LQwE016289@repo.freebsd.org> Date: Tue, 18 Aug 2015 21:49:44 +0200 In-Reply-To: (Jason Evans's message of "Tue, 18 Aug 2015 01:46:29 -0700") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 19:50:21 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jason Evans writes: >>> Index: include/malloc_np.h [...] >>> +typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, = unsigned); >>> +typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); malloc_np.h changes regressing consumers isn't surprising given the lack of tests for jemalloc shipped with FreeBSD. $ cc -include malloc_np.h -c -xc -:311: In file included from :1: /usr/include/malloc_np.h:39:55: error: unknown type name 'bool' typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, uns= igned); ^ /usr/include/malloc_np.h:39:63: error: unknown type name 'bool' typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, uns= igned); ^ [...] >>> + - Remove the --enable-dss options, and make dss non-optional on all = platforms >>> + which support sbrk(2). FREEBSD-upgrade still references it. >>> Modified: head/contrib/jemalloc/doc/jemalloc.3 [...] >>> @@ -53,8 +51,7 @@ make variable)\&. >>> .sp >>> .ft B >>> .nf >>> -#include >>> -#include >>> +#include Bad rebase. >>> + - Add sdallocx(), which implements sized deallocation. The primary >>> + optimization over dallocx() is the removal of a metadata read, whi= ch often >>> + suffers an L1 cache miss. >> [...] >>> + - Remove the *allocm() API, which is superseded by the *allocx() API. >>=20 >> Symbol.map and manpages haven't been updated. >> [...] > > Committed; thanks! Stale links have to be removed as well. Index: contrib/jemalloc/FREEBSD-diffs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- contrib/jemalloc/FREEBSD-diffs (revision 286894) +++ contrib/jemalloc/FREEBSD-diffs (working copy) @@ -20,7 +20,14 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xm SYNOPSIS =2D@@ -2759,4 +2770,18 @@ malloc_conf =3D "lg_chunk:24";]]> + +- #include <jemal= loc/jemalloc.h> ++ #include <stdli= b.h> ++#include <malloc_np.h> + + Standard API + +@@ -2759,4 +2771,18 @@ malloc_conf =3D "lg_chunk:24";]]><= /para> The posix_memalign function co= nforms to IEEE Std 1003.1-2001 (“POSIX.1”). Index: contrib/jemalloc/FREEBSD-upgrade =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- contrib/jemalloc/FREEBSD-upgrade (revision 286894) +++ contrib/jemalloc/FREEBSD-upgrade (working copy) @@ -72,7 +72,7 @@ do_extract() { patch -p1 < "${src}/FREEBSD-diffs" find . -name '*.orig' -delete # Generate various files. =2D ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \ + ./autogen.sh --enable-cc-silence --enable-xmalloc \ --enable-utrace --with-xslroot=3D/usr/local/share/xsl/docbook \ --with-private-namespace=3D__ --with-lg-page-sizes=3D12,13,14,16 gmake dist Index: contrib/jemalloc/doc/jemalloc.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- contrib/jemalloc/doc/jemalloc.3 (revision 286894) +++ contrib/jemalloc/doc/jemalloc.3 (working copy) @@ -51,7 +51,8 @@ make variable)\&. .sp .ft B .nf =2D#include +#include +#include .fi .ft .SS "Standard API" Index: include/malloc_np.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- include/malloc_np.h (revision 286893) +++ include/malloc_np.h (working copy) @@ -33,6 +33,7 @@ #define _MALLOC_NP_H_ #include #include +#include #include =20 __BEGIN_DECLS Index: ObsoleteFiles.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- ObsoleteFiles.inc (revision 286893) +++ ObsoleteFiles.inc (working copy) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done =20 +# 20150818: *allocm() are gone in jemalloc 4.0.0 +OLD_FILES+=3Dusr/share/man/man3/allocm.3.gz +OLD_FILES+=3Dusr/share/man/man3/dallocm.3.gz +OLD_FILES+=3Dusr/share/man/man3/nallocm.3.gz +OLD_FILES+=3Dusr/share/man/man3/rallocm.3.gz +OLD_FILES+=3Dusr/share/man/man3/sallocm.3.gz # 20150802: Remove netbsd's test on pw(8) OLD_FILES+=3Dusr/tests/usr.sbin/pw/pw_test # 20150719: Remove libarchive.pc --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJV04xYXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bncsH+gPc5BPkP/FPwSDZBRrLsXtN zXzamcOXGeg1uikVc7XaFP7b/bCkpaTCnPENVxQ3kXZwff57G+E3+xGJqYbLKGX/ FE4a5SqQdNr3v5ccenoYXhCMRxeEvwQHEwUunyTdHLEYM5TgFUMvBrUyKjbnLx84 3Jheu7GkAykwyFh1B6zEnP4sYP+JdpqTAJkZ1dLY6oERDb+XQaCuszaN/24MOYvG rOEaPjLl0uFF2cplUdrJ2fDX8lRkgONehz071DWOI+GtNhDNft9AL1ylHLwI7pXz kV26WxWDyF5mIjL/klt3dJgYWMT+HQ3LdMNsEKqJv3oMjqIryRSXeMnyzxXCaTc= =cE2k -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Tue Aug 18 20:13:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A45C69BD678; Tue, 18 Aug 2015 20:13:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 952305E8; Tue, 18 Aug 2015 20:13:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IKDbOQ011468; Tue, 18 Aug 2015 20:13:37 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IKDbhv011467; Tue, 18 Aug 2015 20:13:37 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508182013.t7IKDbhv011467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 18 Aug 2015 20:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286903 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 20:13:37 -0000 Author: jilles Date: Tue Aug 18 20:13:36 2015 New Revision: 286903 URL: https://svnweb.freebsd.org/changeset/base/286903 Log: wordexp(3): Update man page for no longer using the wordexp builtin. Modified: head/lib/libc/gen/wordexp.3 Modified: head/lib/libc/gen/wordexp.3 ============================================================================== --- head/lib/libc/gen/wordexp.3 Tue Aug 18 19:30:35 2015 (r286902) +++ head/lib/libc/gen/wordexp.3 Tue Aug 18 20:13:36 2015 (r286903) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 07, 2015 +.Dd August 18, 2015 .Dt WORDEXP 3 .Os .Sh NAME @@ -108,9 +108,8 @@ function frees the memory allocated by .Sh IMPLEMENTATION NOTES The .Fn wordexp -function is implemented as a wrapper around the undocumented -.Ic wordexp -shell built-in command. +function is implemented by executing +.Xr sh 1 . .Sh RETURN VALUES The .Fn wordexp From owner-svn-src-head@freebsd.org Tue Aug 18 20:19:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5C19BDC25; Tue, 18 Aug 2015 20:19:49 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F261965; Tue, 18 Aug 2015 20:19:49 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IKJnxi012017; Tue, 18 Aug 2015 20:19:49 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IKJn2k012016; Tue, 18 Aug 2015 20:19:49 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201508182019.t7IKJn2k012016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Tue, 18 Aug 2015 20:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286904 - head/tools/tools/sysbuild X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 20:19:50 -0000 Author: phk Date: Tue Aug 18 20:19:48 2015 New Revision: 286904 URL: https://svnweb.freebsd.org/changeset/base/286904 Log: Update sysbuild to new ports infrastructure. Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Tue Aug 18 20:13:36 2015 (r286903) +++ head/tools/tools/sysbuild/sysbuild.sh Tue Aug 18 20:19:48 2015 (r286904) @@ -80,6 +80,8 @@ fi # serial console ? SERCONS=false +PKG_DIR=/usr/ports/packages/All + # Remotely mounted distfiles # REMOTEDISTFILES=fs:/rdonly/distfiles @@ -174,6 +176,7 @@ log_it() ( ports_recurse() ( + cd /usr/ports t=$1 shift if [ "x$t" = "x." ] ; then @@ -191,6 +194,7 @@ ports_recurse() ( echo "Missing port $d" 1>&2 continue fi + d=`cd /usr/ports && cd $d && /bin/pwd` if [ ! -f $d/Makefile ] ; then echo "Missing port $d" 1>&2 continue @@ -205,7 +209,16 @@ ports_recurse() ( else ( cd $d - ports_recurse $d `make -V _DEPEND_DIRS ${PORTS_OPTS}` + l="" + for a in `make -V _UNIFIED_DEPENDS ${PORTS_OPTS}` + do + x=`expr "$a" : '.*:\(.*\)'` + l="${l} ${x}" + done + ports_recurse $d $l + # -> _UNIFIED_DEPENDS + #ports_recurse $d `make -V _DEPEND_DIRS ${PORTS_OPTS}` + #ports_recurse $d `make all-depends-list` ) echo "$d" >> /tmp/_.plist fi @@ -223,11 +236,12 @@ ports_build() ( mkdir -p ${PKG_DIR} fi + pd=`cd /usr/ports && /bin/pwd` # Now build & install them for p in `cat /tmp/_.plist` do b=`echo $p | tr / _` - t=`echo $p | sed 's,/usr/ports/,,'` + t=`echo $p | sed "s,${pd},,"` pn=`cd $p && make package-name` if [ "x`basename $p`" == "xpkg" ] ; then @@ -471,10 +485,13 @@ fi for i in ${PORTS_WE_WANT} do + ( + cd /usr/ports if [ ! -d $i ] ; then echo "Port $i not found" 1>&2 exit 2 fi + ) done export PORTS_WE_WANT From owner-svn-src-head@freebsd.org Tue Aug 18 20:42:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7639BC5B5; Tue, 18 Aug 2015 20:42:09 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB25EF6; Tue, 18 Aug 2015 20:42:09 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IKg944024146; Tue, 18 Aug 2015 20:42:09 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IKg9AZ024144; Tue, 18 Aug 2015 20:42:09 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508182042.t7IKg9AZ024144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Tue, 18 Aug 2015 20:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286907 - in head/contrib/jemalloc: . include/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 20:42:09 -0000 Author: jasone Date: Tue Aug 18 20:42:08 2015 New Revision: 286907 URL: https://svnweb.freebsd.org/changeset/base/286907 Log: Define CPU_SPINWAIT as cpu_spinwait(). Submitted by: cem Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 20:27:03 2015 (r286906) +++ head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 20:42:08 2015 (r286907) @@ -117,10 +117,10 @@ index dbf6aa7..f87dba8 100644 jemalloc_postfork_child diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..c5113b9 +index 0000000..737542e --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,144 @@ +@@ -0,0 +1,142 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -135,7 +135,6 @@ index 0000000..c5113b9 + * The following are architecture-dependent, so conditionally define them for + * each supported architecture. + */ -+#undef CPU_SPINWAIT +#undef JEMALLOC_TLS_MODEL +#undef STATIC_PAGE_SHIFT +#undef LG_SIZEOF_PTR @@ -145,7 +144,6 @@ index 0000000..c5113b9 + +#ifdef __i386__ +# define LG_SIZEOF_PTR 2 -+# define CPU_SPINWAIT __asm__ volatile("pause") +# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) +#endif +#ifdef __ia64__ @@ -157,7 +155,6 @@ index 0000000..c5113b9 +#endif +#ifdef __amd64__ +# define LG_SIZEOF_PTR 3 -+# define CPU_SPINWAIT __asm__ volatile("pause") +# define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) +#endif +#ifdef __arm__ @@ -183,15 +180,16 @@ index 0000000..c5113b9 +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif + -+#ifndef CPU_SPINWAIT -+# define CPU_SPINWAIT do {} while (0) -+#endif -+ +#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_SIZEOF_INT 2 +#define LG_SIZEOF_LONG LG_SIZEOF_PTR +#define LG_SIZEOF_INTMAX_T 3 + ++#undef CPU_SPINWAIT ++#include ++#include ++#define CPU_SPINWAIT cpu_spinwait() ++ +/* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */ +#undef JEMALLOC_LAZY_LOCK +extern int __isthreaded; Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 20:27:03 2015 (r286906) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Tue Aug 18 20:42:08 2015 (r286907) @@ -12,7 +12,6 @@ * The following are architecture-dependent, so conditionally define them for * each supported architecture. */ -#undef CPU_SPINWAIT #undef JEMALLOC_TLS_MODEL #undef STATIC_PAGE_SHIFT #undef LG_SIZEOF_PTR @@ -22,7 +21,6 @@ #ifdef __i386__ # define LG_SIZEOF_PTR 2 -# define CPU_SPINWAIT __asm__ volatile("pause") # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __ia64__ @@ -34,7 +32,6 @@ #endif #ifdef __amd64__ # define LG_SIZEOF_PTR 3 -# define CPU_SPINWAIT __asm__ volatile("pause") # define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __arm__ @@ -60,15 +57,16 @@ # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#ifndef CPU_SPINWAIT -# define CPU_SPINWAIT do {} while (0) -#endif - #define STATIC_PAGE_SHIFT PAGE_SHIFT #define LG_SIZEOF_INT 2 #define LG_SIZEOF_LONG LG_SIZEOF_PTR #define LG_SIZEOF_INTMAX_T 3 +#undef CPU_SPINWAIT +#include +#include +#define CPU_SPINWAIT cpu_spinwait() + /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */ #undef JEMALLOC_LAZY_LOCK extern int __isthreaded; From owner-svn-src-head@freebsd.org Tue Aug 18 21:05:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EBC39BCB3A; Tue, 18 Aug 2015 21:05:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CFCF1BC2; Tue, 18 Aug 2015 21:05:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IL5woQ032806; Tue, 18 Aug 2015 21:05:58 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IL5v50032802; Tue, 18 Aug 2015 21:05:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508182105.t7IL5v50032802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Aug 2015 21:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286908 - in head: share/man/man4 sys/conf sys/dev/rccgpio sys/modules/rccgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 21:05:58 -0000 Author: loos Date: Tue Aug 18 21:05:56 2015 New Revision: 286908 URL: https://svnweb.freebsd.org/changeset/base/286908 Log: Add the GPIO driver for the ADI Engineering RCC-VE and RCC-DFF/DFFv2. This driver allows read the software reset switch state and control the status LEDs. The GPIO pins have their direction (input/output) locked down to prevent possible short circuits. Note that most people get a reset button that is a hardware reset. The software reset button is available on boards from Netgate. Sponsored by: Rubicon Communications (Netgate) Added: head/share/man/man4/rccgpio.4 (contents, props changed) head/sys/dev/rccgpio/ head/sys/dev/rccgpio/rccgpio.c (contents, props changed) head/sys/modules/rccgpio/ head/sys/modules/rccgpio/Makefile (contents, props changed) Modified: head/sys/conf/files Added: head/share/man/man4/rccgpio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rccgpio.4 Tue Aug 18 21:05:56 2015 (r286908) @@ -0,0 +1,63 @@ +.\" Copyright (c) 2015, Rubicon Communications, LLC (Netgate) +.\" 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 August 18, 2015 +.Dt RCCGPIO 4 +.Os +.Sh NAME +.Nm rccgpio +.Nd ADI Engineering RCC-VE and RCC-DFF/DFFv2 GPIO controller +.Sh SYNOPSIS +.Cd "device rccgpio" +.Cd "device gpio" +.Cd "device gpioled" +.Sh DESCRIPTION +The +.Nm +provides a simple interface to read the reset switch state and control the +status LEDs. +.Pp +The software controlled reset switch is known to be available on boards from +Netgate. +Most people get a button that is a hardware reset. +.Pp +All the GPIO pins are locked in their intended setup to disallow any harmful +settings (the ones that can cause short circuits). +.Sh SEE ALSO +.Xr gpio 3 , +.Xr gpio 4 , +.Xr gpioled 4 , +.Xr gpioctl 8 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 18 20:42:08 2015 (r286907) +++ head/sys/conf/files Tue Aug 18 21:05:56 2015 (r286908) @@ -2323,6 +2323,7 @@ dev/random/fortuna.c optional random !r dev/random/hash.c optional random random_yarrow | \ random !random_yarrow !random_loadable dev/rc/rc.c optional rc +dev/rccgpio/rccgpio.c optional rccgpio gpio dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci dev/rndtest/rndtest.c optional rndtest Added: head/sys/dev/rccgpio/rccgpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rccgpio/rccgpio.c Tue Aug 18 21:05:56 2015 (r286908) @@ -0,0 +1,368 @@ +/*- + * Copyright (c) 2015 Rubicon Communications, LLC (Netgate) + * 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$"); + +/* + * GPIO driver for the ADI Engineering RCC-VE and RCC-DFF/DFFv2. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "gpio_if.h" + +#define RCC_GPIO_BASE 0x500 +#define RCC_GPIO_USE_SEL 0x00 +#define RCC_GPIO_IO_SEL 0x04 +#define RCC_GPIO_GP_LVL 0x08 + +struct rcc_gpio_pin { + uint32_t pin; + const char *name; + uint32_t caps; +}; + +static struct rcc_gpio_pin rcc_pins[] = { + { .pin = 11, .name = "reset switch", .caps = GPIO_PIN_INPUT }, + { .pin = 15, .name = "red LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = 17, .name = "green LED", .caps = GPIO_PIN_OUTPUT }, +#if 0 + { .pin = 16, .name = "HD1 LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = 18, .name = "HD2 LED", .caps = GPIO_PIN_OUTPUT }, +#endif +}; + +struct rcc_gpio_softc { + device_t sc_dev; + device_t sc_busdev; + struct mtx sc_mtx; + struct resource *sc_io_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + uint32_t sc_output; + int sc_io_rid; + int sc_gpio_npins; +}; + +#define RCC_GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define RCC_GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define RCC_WRITE(_sc, _off, _val) \ + bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, _off, _val) +#define RCC_READ(_sc, _off) \ + bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, _off) + +static void +rcc_gpio_modify_bits(struct rcc_gpio_softc *sc, uint32_t reg, uint32_t mask, + uint32_t bit) +{ + uint32_t value; + + RCC_GPIO_LOCK(sc); + value = RCC_READ(sc, reg); + value &= ~(1 << mask); + value |= (1 << bit); + RCC_WRITE(sc, reg, value); + RCC_GPIO_UNLOCK(sc); +} + +static device_t +rcc_gpio_get_bus(device_t dev) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->sc_busdev); +} + +static int +rcc_gpio_pin_max(device_t dev, int *maxpin) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + *maxpin = sc->sc_gpio_npins - 1; + + return (0); +} + +static int +rcc_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + *caps = rcc_pins[pin].caps; + + return (0); +} + +static int +rcc_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + /* Flags cannot be changed. */ + *flags = rcc_pins[pin].caps; + + return (0); +} + +static int +rcc_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + memcpy(name, rcc_pins[pin].name, GPIOMAXNAME); + + return (0); +} + +static int +rcc_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + /* Flags cannot be changed - risk of short-circuit!!! */ + + return (0); +} + +static int +rcc_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + RCC_GPIO_LOCK(sc); + if (value) + sc->sc_output |= (1 << rcc_pins[pin].pin); + else + sc->sc_output &= ~(1 << rcc_pins[pin].pin); + RCC_WRITE(sc, RCC_GPIO_GP_LVL, sc->sc_output); + RCC_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rcc_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct rcc_gpio_softc *sc; + uint32_t value; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + RCC_GPIO_LOCK(sc); + if (rcc_pins[pin].caps & GPIO_PIN_INPUT) + value = RCC_READ(sc, RCC_GPIO_GP_LVL); + else + value = sc->sc_output; + RCC_GPIO_UNLOCK(sc); + *val = (value & (1 << rcc_pins[pin].pin)) ? 1 : 0; + + return (0); +} + +static int +rcc_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin > sc->sc_gpio_npins) + return (EINVAL); + + RCC_GPIO_LOCK(sc); + if ((sc->sc_output & (1 << rcc_pins[pin].pin)) == 0) + sc->sc_output |= (1 << rcc_pins[pin].pin); + else + sc->sc_output &= ~(1 << rcc_pins[pin].pin); + RCC_WRITE(sc, RCC_GPIO_GP_LVL, sc->sc_output); + RCC_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rcc_gpio_probe(device_t dev) +{ + char *prod; + int port; + + /* + * We don't know of any PnP ID's for this GPIO controller. + */ + if (isa_get_logicalid(dev) != 0) + return (ENXIO); + + /* + * We have to have an IO port hint that is valid. + */ + port = isa_get_port(dev); + if (port != RCC_GPIO_BASE) + return (ENXIO); + + prod = kern_getenv("smbios.system.product"); + if (prod == NULL || + (strcmp(prod, "RCC-VE") != 0 && strcmp(prod, "RCC-DFF") != 0)) + return (ENXIO); + + device_set_desc(dev, "RCC-VE/DFF GPIO controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +rcc_gpio_attach(device_t dev) +{ + int i; + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* Allocate IO resources. */ + sc->sc_io_rid = 0; + sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_io_rid, RF_ACTIVE); + if (sc->sc_io_res == NULL) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + sc->sc_bst = rman_get_bustag(sc->sc_io_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_io_res); + mtx_init(&sc->sc_mtx, "rcc-gpio", "gpio", MTX_DEF); + + /* Initialize the pins. */ + sc->sc_gpio_npins = nitems(rcc_pins); + for (i = 0; i < sc->sc_gpio_npins; i++) { + /* Enable it for GPIO. */ + rcc_gpio_modify_bits(sc, RCC_GPIO_USE_SEL, 0, rcc_pins[i].pin); + /* Set the pin as input or output. */ + if (rcc_pins[i].caps & GPIO_PIN_OUTPUT) + rcc_gpio_modify_bits(sc, RCC_GPIO_IO_SEL, + rcc_pins[i].pin, 0); + else + rcc_gpio_modify_bits(sc, RCC_GPIO_IO_SEL, + 0, rcc_pins[i].pin); + } + RCC_WRITE(sc, RCC_GPIO_GP_LVL, sc->sc_output); + + /* Attach the gpiobus. */ + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_io_rid, + sc->sc_io_res); + mtx_destroy(&sc->sc_mtx); + return (ENXIO); + } + + return (0); +} + +static int +rcc_gpio_detach(device_t dev) +{ + int i; + struct rcc_gpio_softc *sc; + + sc = device_get_softc(dev); + gpiobus_detach_bus(dev); + + /* Disable the GPIO function. */ + for (i = 0; i < sc->sc_gpio_npins; i++) + rcc_gpio_modify_bits(sc, RCC_GPIO_USE_SEL, rcc_pins[i].pin, 0); + + if (sc->sc_io_res != NULL) + bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_io_rid, + sc->sc_io_res); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static device_method_t rcc_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rcc_gpio_probe), + DEVMETHOD(device_attach, rcc_gpio_attach), + DEVMETHOD(device_detach, rcc_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, rcc_gpio_get_bus), + DEVMETHOD(gpio_pin_max, rcc_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, rcc_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, rcc_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, rcc_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, rcc_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, rcc_gpio_pin_get), + DEVMETHOD(gpio_pin_set, rcc_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, rcc_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t rcc_gpio_devclass; + +static driver_t rcc_gpio_driver = { + "gpio", + rcc_gpio_methods, + sizeof(struct rcc_gpio_softc), +}; + +DRIVER_MODULE(rcc_gpio, isa, rcc_gpio_driver, rcc_gpio_devclass, 0, 0); +MODULE_DEPEND(rcc_gpio, gpiobus, 1, 1, 1); Added: head/sys/modules/rccgpio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rccgpio/Makefile Tue Aug 18 21:05:56 2015 (r286908) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/rccgpio +KMOD= rccgpio +SRCS= rccgpio.c +SRCS+= device_if.h bus_if.h isa_if.h gpio_if.h opt_platform.h + +.include From owner-svn-src-head@freebsd.org Tue Aug 18 21:17:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5564A9BCE82; Tue, 18 Aug 2015 21:17:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A64C267; Tue, 18 Aug 2015 21:17:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A99B735930A; Tue, 18 Aug 2015 23:17:43 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 7230428494; Tue, 18 Aug 2015 23:17:43 +0200 (CEST) Date: Tue, 18 Aug 2015 23:17:43 +0200 From: Jilles Tjoelker To: Jan Beich Cc: Jason Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... Message-ID: <20150818211743.GA29760@stack.nl> References: <201508180021.t7I0LQwE016289@repo.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) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 21:17:47 -0000 On Tue, Aug 18, 2015 at 09:49:44PM +0200, Jan Beich wrote: > Jason Evans writes: > >>> Index: include/malloc_np.h > [...] > >>> +typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); > >>> +typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); > malloc_np.h changes regressing consumers isn't surprising given the lack > of tests for jemalloc shipped with FreeBSD. > $ cc -include malloc_np.h -c -xc - In file included from :311: > In file included from :1: > /usr/include/malloc_np.h:39:55: error: unknown type name 'bool' > typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); > ^ > /usr/include/malloc_np.h:39:63: error: unknown type name 'bool' > typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); A #include will of course fix this, but by using 1, 0 and _Bool instead of true, false and bool you can make it work without adding namespace pollution. This might be useful if someone has bool defined or typedeffed to something else. Note that only the header files need to be uglified this way. > >>> + - Add sdallocx(), which implements sized deallocation. The primary > >>> + optimization over dallocx() is the removal of a metadata read, which often > >>> + suffers an L1 cache miss. > >> [...] > >>> + - Remove the *allocm() API, which is superseded by the *allocx() API. > >> Symbol.map and manpages haven't been updated. You can't really remove anything from Symbol.map files, since that breaks binary compatibility for applications that used the removed symbols. Such breakage usually crashes the application if and when it attempts to use a removed symbol. To avoid the breakage, wrappers invoking the new APIs should be provided; using some special symver directives, it is possible to prevent linking new applications against the obsolete symbols. A corollary is that experimental APIs should not be added to Symbol.map. It may be better for developers that want to use experimental APIs to build jemalloc themselves, or to use jemalloc from ports (although such a port doesn't seem to exist, currently). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Tue Aug 18 21:28:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 853CF9BB0F9; Tue, 18 Aug 2015 21:28:28 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67D57A42; Tue, 18 Aug 2015 21:28:28 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from [192.168.168.10] (unknown [208.94.83.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 8CBDC286F2; Tue, 18 Aug 2015 14:28:26 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: Jason Evans In-Reply-To: <20150818211743.GA29760@stack.nl> Date: Tue, 18 Aug 2015 14:28:25 -0700 Cc: Jan Beich , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <790D5607-6662-4817-8CD0-6A435D1F7E49@freebsd.org> References: <201508180021.t7I0LQwE016289@repo.freebsd.org> <20150818211743.GA29760@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 21:28:28 -0000 On Aug 18, 2015, at 2:17 PM, Jilles Tjoelker wrote: > On Tue, Aug 18, 2015 at 09:49:44PM +0200, Jan Beich wrote: >> Jason Evans writes: >>>>> Index: include/malloc_np.h >> [...] >>>>> +typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, = bool *, unsigned); >>>>> +typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); >=20 >> malloc_np.h changes regressing consumers isn't surprising given the = lack >> of tests for jemalloc shipped with FreeBSD. >=20 >> $ cc -include malloc_np.h -c -xc -> In file included from :311: >> In file included from :1: >> /usr/include/malloc_np.h:39:55: error: unknown type name 'bool' >> typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool = *, unsigned); >> ^ >> /usr/include/malloc_np.h:39:63: error: unknown type name 'bool' >> typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool = *, unsigned); >=20 > A #include will of course fix this, but by using 1, 0 and > _Bool instead of true, false and bool you can make it work without > adding namespace pollution. This might be useful if someone has bool > defined or typedeffed to something else. Note that only the header = files > need to be uglified this way. Cool, I'll make that change to the patch I'm currently testing. >>>>> + - Remove the *allocm() API, which is superseded by the = *allocx() API. >>>> Symbol.map and manpages haven't been updated. >=20 > You can't really remove anything from Symbol.map files, since that > breaks binary compatibility for applications that used the removed > symbols. Such breakage usually crashes the application if and when it > attempts to use a removed symbol. To avoid the breakage, wrappers > invoking the new APIs should be provided; using some special symver > directives, it is possible to prevent linking new applications against > the obsolete symbols. *allocm() compatibility functions are in place, so I think this is = correctly sorted out. Jan also pointed out missing entries for = sdallocx() in a previous email, which I've already committed the fix for = (r286872). > A corollary is that experimental APIs should not be added to = Symbol.map. > It may be better for developers that want to use experimental APIs to > build jemalloc themselves, or to use jemalloc from ports (although = such > a port doesn't seem to exist, currently). Yes, exposing *allocm() was a big mistake. :( Thanks, Jason= From owner-svn-src-head@freebsd.org Tue Aug 18 21:37:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3919BB477; Tue, 18 Aug 2015 21:37:15 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1361327; Tue, 18 Aug 2015 21:37:15 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ILbFB5045671; Tue, 18 Aug 2015 21:37:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ILbFrc045670; Tue, 18 Aug 2015 21:37:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508182137.t7ILbFrc045670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 18 Aug 2015 21:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286909 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 21:37:15 -0000 Author: loos Date: Tue Aug 18 21:37:14 2015 New Revision: 286909 URL: https://svnweb.freebsd.org/changeset/base/286909 Log: Fix the use of plural in two cases that I missed on r285784. This should cause no functional change. Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Aug 18 21:05:56 2015 (r286908) +++ head/sys/dev/gpio/gpiobus.c Tue Aug 18 21:37:14 2015 (r286909) @@ -386,7 +386,10 @@ gpiobus_probe_nomatch(device_t dev, devi devi = GPIOBUS_IVAR(child); memset(pins, 0, sizeof(pins)); gpiobus_print_pins(devi, pins, sizeof(pins)); - device_printf(dev, " at pin(s) %s", pins); + if (devi->npins > 1) + device_printf(dev, " at pins %s", pins); + else + device_printf(dev, " at pin %s", pins); resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); printf("\n"); } @@ -422,7 +425,10 @@ gpiobus_child_location_str(device_t bus, struct gpiobus_ivar *devi; devi = GPIOBUS_IVAR(child); - strlcpy(buf, "pin(s)=", buflen); + if (devi->npins > 1) + strlcpy(buf, "pins=", buflen); + else + strlcpy(buf, "pin=", buflen); gpiobus_print_pins(devi, buf, buflen); return (0); From owner-svn-src-head@freebsd.org Tue Aug 18 22:37:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4038A9BD2D2; Tue, 18 Aug 2015 22:37:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31151166F; Tue, 18 Aug 2015 22:37:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7IMbQRq069955; Tue, 18 Aug 2015 22:37:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7IMbQgS069954; Tue, 18 Aug 2015 22:37:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508182237.t7IMbQgS069954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 18 Aug 2015 22:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286910 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 22:37:26 -0000 Author: delphij Date: Tue Aug 18 22:37:25 2015 New Revision: 286910 URL: https://svnweb.freebsd.org/changeset/base/286910 Log: - ANSIfy - Remove the redundant _PATH_RSH definition (paths.h at r96194); - Use pid_t for PIDs - Note that we are at the same level of OpenBSD's counterpart of revision 1.7 (r94757). No functional changes. MFC after: 2 weeks Modified: head/lib/libc/net/rcmdsh.c Modified: head/lib/libc/net/rcmdsh.c ============================================================================== --- head/lib/libc/net/rcmdsh.c Tue Aug 18 21:37:14 2015 (r286909) +++ head/lib/libc/net/rcmdsh.c Tue Aug 18 22:37:25 2015 (r286910) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.5 1998/04/25 16:23:58 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.7 2002/03/12 00:05:44 millert Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -49,23 +49,18 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef _PATH_RSH -#define _PATH_RSH "/usr/bin/rsh" -#endif - /* * This is a replacement rcmd() function that uses the rsh(1) * program in place of a direct rcmd(3) function call so as to * avoid having to be root. Note that rport is ignored. */ int -rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) - char **ahost; - int rport; - const char *locuser, *remuser, *cmd, *rshprog; +rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, + const char *cmd, const char *rshprog) { struct addrinfo hints, *res; - int cpid, sp[2], error; + int sp[2], error; + pid_t cpid; char *p; struct passwd *pw; char num[8]; From owner-svn-src-head@freebsd.org Wed Aug 19 00:06:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 226749BC559; Wed, 19 Aug 2015 00:06:49 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB33106; Wed, 19 Aug 2015 00:06:49 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J06m58006811; Wed, 19 Aug 2015 00:06:48 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J06lgO006806; Wed, 19 Aug 2015 00:06:47 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508190006.t7J06lgO006806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Wed, 19 Aug 2015 00:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286911 - in head: . contrib/jemalloc contrib/jemalloc/doc include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 00:06:49 -0000 Author: jasone Date: Wed Aug 19 00:06:46 2015 New Revision: 286911 URL: https://svnweb.freebsd.org/changeset/base/286911 Log: Fix minor malloc regressions. - Use _Bool rather than bool to resolve missing type errors in malloc_np.h. - Fix malloc manual page #include documentation. - Add *allocm manual pages to obsolete files. Submitted by: jbeich Modified: head/ObsoleteFiles.inc head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/doc/jemalloc.3 head/include/malloc_np.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Aug 18 22:37:25 2015 (r286910) +++ head/ObsoleteFiles.inc Wed Aug 19 00:06:46 2015 (r286911) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20150818: *allocm() are gone in jemalloc 4.0.0 +OLD_FILES+=usr/share/man/man3/allocm.3.gz +OLD_FILES+=usr/share/man/man3/dallocm.3.gz +OLD_FILES+=usr/share/man/man3/nallocm.3.gz +OLD_FILES+=usr/share/man/man3/rallocm.3.gz +OLD_FILES+=usr/share/man/man3/sallocm.3.gz # 20150802: Remove netbsd's test on pw(8) OLD_FILES+=usr/tests/usr.sbin/pw/pw_test # 20150719: Remove libarchive.pc Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 22:37:25 2015 (r286910) +++ head/contrib/jemalloc/FREEBSD-diffs Wed Aug 19 00:06:46 2015 (r286911) @@ -1,8 +1,8 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index 8fc774b..47b453c 100644 +index 8fc774b..fdbef95 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in -@@ -53,6 +53,17 @@ +@@ -53,11 +53,23 @@ This manual describes jemalloc @jemalloc_version@. More information can be found at the jemalloc website. @@ -20,7 +20,14 @@ index 8fc774b..47b453c 100644 SYNOPSIS -@@ -2759,4 +2770,18 @@ malloc_conf = "lg_chunk:24";]]> + +- #include <jemalloc/jemalloc.h> ++ #include <stdlib.h> ++#include <malloc_np.h> + + Standard API + +@@ -2759,4 +2771,18 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). Modified: head/contrib/jemalloc/FREEBSD-upgrade ============================================================================== --- head/contrib/jemalloc/FREEBSD-upgrade Tue Aug 18 22:37:25 2015 (r286910) +++ head/contrib/jemalloc/FREEBSD-upgrade Wed Aug 19 00:06:46 2015 (r286911) @@ -72,9 +72,9 @@ do_extract() { patch -p1 < "${src}/FREEBSD-diffs" find . -name '*.orig' -delete # Generate various files. - ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \ - --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \ - --with-private-namespace=__ --with-lg-page-sizes=12,13,14,16 + ./autogen.sh --enable-cc-silence --enable-xmalloc --enable-utrace \ + --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \ + --with-lg-page-sizes=12,13,14,16 gmake dist ) } Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Tue Aug 18 22:37:25 2015 (r286910) +++ head/contrib/jemalloc/doc/jemalloc.3 Wed Aug 19 00:06:46 2015 (r286911) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 08/17/2015 +.\" Date: 08/18/2015 .\" Manual: User Manual .\" Source: jemalloc 4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2 .\" Language: English .\" -.TH "JEMALLOC" "3" "08/17/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual" +.TH "JEMALLOC" "3" "08/18/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,7 +51,8 @@ make variable)\&. .sp .ft B .nf -#include +#include +#include .fi .ft .SS "Standard API" Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Tue Aug 18 22:37:25 2015 (r286910) +++ head/include/malloc_np.h Wed Aug 19 00:06:46 2015 (r286911) @@ -36,13 +36,14 @@ #include __BEGIN_DECLS -typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); -typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); -typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned); -typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned); +typedef void *(chunk_alloc_t)(void *, size_t, size_t, _Bool *, _Bool *, + unsigned); +typedef _Bool (chunk_dalloc_t)(void *, size_t, _Bool, unsigned); +typedef _Bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_split_t)(void *, size_t, size_t, size_t, _Bool, unsigned); +typedef _Bool (chunk_merge_t)(void *, size_t, void *, size_t, _Bool, unsigned); typedef struct { chunk_alloc_t *alloc; chunk_dalloc_t *dalloc; From owner-svn-src-head@freebsd.org Wed Aug 19 00:07:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05809BC5A9; Wed, 19 Aug 2015 00:07:41 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 941BC2EF; Wed, 19 Aug 2015 00:07:41 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from [192.168.168.10] (unknown [208.94.83.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id A938A286EE; Tue, 18 Aug 2015 17:07:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... From: Jason Evans In-Reply-To: Date: Tue, 18 Aug 2015 17:07:37 -0700 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201508180021.t7I0LQwE016289@repo.freebsd.org> To: Jan Beich X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 00:07:41 -0000 On Aug 18, 2015, at 12:49 PM, Jan Beich wrote: > [various fixes] Committed as r286911. Thanks, Jason From owner-svn-src-head@freebsd.org Wed Aug 19 00:49:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CAFD9BCCE9; Wed, 19 Aug 2015 00:49:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282FC772; Wed, 19 Aug 2015 00:49:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J0npps023232; Wed, 19 Aug 2015 00:49:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J0noUX023229; Wed, 19 Aug 2015 00:49:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508190049.t7J0noUX023229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 00:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286913 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 00:49:51 -0000 Author: jhb Date: Wed Aug 19 00:49:50 2015 New Revision: 286913 URL: https://svnweb.freebsd.org/changeset/base/286913 Log: Change the argument formatting function to use a stdio FILE object opened with open_memstream() to build the string for each argument. This allows for more complicated argument building without resorting to intermediate malloc's, etc. Related, the strsig*() functions no longer return allocated strings but use a static global buffer instead. Modified: head/usr.bin/truss/main.c head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Wed Aug 19 00:26:54 2015 (r286912) +++ head/usr.bin/truss/main.c Wed Aug 19 00:49:50 2015 (r286913) @@ -149,15 +149,13 @@ set_etype(struct trussinfo *trussinfo) char * strsig(int sig) { - char *ret; + static char tmp[64]; - ret = NULL; if (sig > 0 && sig < NSIG) { - asprintf(&ret, "SIG%s", sys_signame[sig]); - if (ret == NULL) - return (NULL); + snprintf(tmp, sizeof(tmp), "SIG%s", sys_signame[sig]); + return (tmp); } - return (ret); + return (NULL); } int @@ -340,7 +338,6 @@ START_TRACE: fprintf(trussinfo->outfile, "SIGNAL %u (%s)\n", trussinfo->pr_data, signame == NULL ? "?" : signame); - free(signame); break; case S_EXIT: if (trussinfo->flags & COUNTONLY) Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 19 00:26:54 2015 (r286912) +++ head/usr.bin/truss/syscalls.c Wed Aug 19 00:49:50 2015 (r286913) @@ -731,12 +731,15 @@ get_string(pid_t pid, void *addr, int ma static char * strsig2(int sig) { - char *tmp; + static char tmp[sizeof(int) * 3 + 1]; + char *ret; - tmp = strsig(sig); - if (tmp == NULL) - asprintf(&tmp, "%d", sig); - return (tmp); + ret = strsig(sig); + if (ret == NULL) { + snprintf(tmp, sizeof(tmp), "%d", sig); + ret = tmp; + } + return (ret); } /* @@ -753,32 +756,34 @@ char * print_arg(struct syscall_args *sc, unsigned long *args, long retval, struct trussinfo *trussinfo) { + FILE *fp; char *tmp; + size_t tmplen; pid_t pid; - tmp = NULL; + fp = open_memstream(&tmp, &tmplen); pid = trussinfo->pid; switch (sc->type & ARG_MASK) { case Hex: - asprintf(&tmp, "0x%x", (int)args[sc->offset]); + fprintf(fp, "0x%x", (int)args[sc->offset]); break; case Octal: - asprintf(&tmp, "0%o", (int)args[sc->offset]); + fprintf(fp, "0%o", (int)args[sc->offset]); break; case Int: - asprintf(&tmp, "%d", (int)args[sc->offset]); + fprintf(fp, "%d", (int)args[sc->offset]); break; case LongHex: - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; case Long: - asprintf(&tmp, "%ld", args[sc->offset]); + fprintf(fp, "%ld", args[sc->offset]); break; case Name: { /* NULL-terminated string. */ char *tmp2; tmp2 = get_string(pid, (void*)args[sc->offset], 0); - asprintf(&tmp, "\"%s\"", tmp2); + fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; } @@ -814,11 +819,11 @@ print_arg(struct syscall_args *sc, unsig len--; truncated = 1; }; - asprintf(&tmp, "\"%s\"%s", tmp3, truncated ? + fprintf(fp, "\"%s\"%s", tmp3, truncated ? "..." : ""); free(tmp3); } else { - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); } break; } @@ -857,37 +862,35 @@ print_arg(struct syscall_args *sc, unsig } #ifdef __LP64__ case Quad: - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; #else case Quad: { unsigned long long ll; ll = *(unsigned long long *)(args + sc->offset); - asprintf(&tmp, "0x%llx", ll); + fprintf(fp, "0x%llx", ll); break; } #endif case Ptr: - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; case Readlinkres: { char *tmp2; - if (retval == -1) { - tmp = strdup(""); + if (retval == -1) break; - } tmp2 = get_string(pid, (void*)args[sc->offset], retval); - asprintf(&tmp, "\"%s\"", tmp2); + fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; } case Ioctl: { const char *temp = ioctlname(args[sc->offset]); if (temp) - tmp = strdup(temp); + fputs(temp, fp); else { unsigned long arg = args[sc->offset]; - asprintf(&tmp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }", + fprintf(fp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }", arg, arg & IOC_OUT ? "R" : "", arg & IOC_IN ? "W" : "", IOCGROUP(arg), isprint(IOCGROUP(arg)) ? (char)IOCGROUP(arg) : '?', @@ -899,22 +902,19 @@ print_arg(struct syscall_args *sc, unsig struct timespec ts; if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) - asprintf(&tmp, "{ %ld.%09ld }", (long)ts.tv_sec, + fprintf(fp, "{ %ld.%09ld }", (long)ts.tv_sec, ts.tv_nsec); else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timespec2: { struct timespec ts[2]; - FILE *fp; - size_t len; const char *sep; unsigned int i; if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) { - fp = open_memstream(&tmp, &len); fputs("{ ", fp); sep = ""; for (i = 0; i < nitems(ts); i++) { @@ -934,43 +934,42 @@ print_arg(struct syscall_args *sc, unsig } } fputs(" }", fp); - fclose(fp); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timeval: { struct timeval tv; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - asprintf(&tmp, "{ %ld.%06ld }", (long)tv.tv_sec, + fprintf(fp, "{ %ld.%06ld }", (long)tv.tv_sec, tv.tv_usec); else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timeval2: { struct timeval tv[2]; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - asprintf(&tmp, "{ %ld.%06ld, %ld.%06ld }", + fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", (long)tv[0].tv_sec, tv[0].tv_usec, (long)tv[1].tv_sec, tv[1].tv_usec); else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Itimerval: { struct itimerval itv; if (get_struct(pid, (void *)args[sc->offset], &itv, sizeof(itv)) != -1) - asprintf(&tmp, "{ %ld.%06ld, %ld.%06ld }", + fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", (long)itv.it_interval.tv_sec, itv.it_interval.tv_usec, (long)itv.it_value.tv_sec, itv.it_value.tv_usec); else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case LinuxSockArgs: @@ -978,11 +977,11 @@ print_arg(struct syscall_args *sc, unsig struct linux_socketcall_args largs; if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, sizeof(largs)) != -1) - asprintf(&tmp, "{ %s, 0x%lx }", + fprintf(fp, "{ %s, 0x%lx }", lookup(linux_socketcall_ops, largs.what, 10), (long unsigned int)largs.args); else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Pollfd: { @@ -992,37 +991,23 @@ print_arg(struct syscall_args *sc, unsig * syscall. */ struct pollfd *pfd; - int numfds = args[sc->offset+1]; - int bytes = sizeof(struct pollfd) * numfds; - int i, tmpsize, u, used; - const int per_fd = 100; + int numfds = args[sc->offset + 1]; + size_t bytes = sizeof(struct pollfd) * numfds; + int i; if ((pfd = malloc(bytes)) == NULL) - err(1, "Cannot malloc %d bytes for pollfd array", + err(1, "Cannot malloc %zu bytes for pollfd array", bytes); if (get_struct(pid, (void *)args[sc->offset], pfd, bytes) != -1) { - used = 0; - tmpsize = 1 + per_fd * numfds + 2; - if ((tmp = malloc(tmpsize)) == NULL) - err(1, "Cannot alloc %d bytes for poll output", - tmpsize); - - tmp[used++] = '{'; - tmp[used++] = ' '; + fputs("{", fp); for (i = 0; i < numfds; i++) { - - u = snprintf(tmp + used, per_fd, "%s%d/%s", - i > 0 ? " " : "", pfd[i].fd, + fprintf(fp, " %d/%s", pfd[i].fd, xlookup_bits(poll_flags, pfd[i].events)); - if (u > 0) - used += u < per_fd ? u : per_fd; } - tmp[used++] = ' '; - tmp[used++] = '}'; - tmp[used++] = '\0'; + fputs(" }", fp); } else { - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); } free(pfd); break; @@ -1035,108 +1020,86 @@ print_arg(struct syscall_args *sc, unsig */ fd_set *fds; int numfds = args[0]; - int bytes = _howmany(numfds, _NFDBITS) * _NFDBITS; - int i, tmpsize, u, used; - const int per_fd = 20; + size_t bytes = _howmany(numfds, _NFDBITS) * _NFDBITS; + int i; if ((fds = malloc(bytes)) == NULL) - err(1, "Cannot malloc %d bytes for fd_set array", + err(1, "Cannot malloc %zu bytes for fd_set array", bytes); if (get_struct(pid, (void *)args[sc->offset], fds, bytes) != -1) { - used = 0; - tmpsize = 1 + numfds * per_fd + 2; - if ((tmp = malloc(tmpsize)) == NULL) - err(1, "Cannot alloc %d bytes for fd_set " - "output", tmpsize); - - tmp[used++] = '{'; - tmp[used++] = ' '; + fputs("{", fp); for (i = 0; i < numfds; i++) { - if (FD_ISSET(i, fds)) { - u = snprintf(tmp + used, per_fd, "%d ", - i); - if (u > 0) - used += u < per_fd ? u : per_fd; - } + if (FD_ISSET(i, fds)) + fprintf(fp, " %d", i); } - tmp[used++] = '}'; - tmp[used++] = '\0'; + fputs(" }", fp); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); free(fds); break; } case Signal: - tmp = strsig2(args[sc->offset]); + fputs(strsig2(args[sc->offset]), fp); break; case Sigset: { long sig; sigset_t ss; - int i, used; - char *signame; + int i, first; sig = args[sc->offset]; if (get_struct(pid, (void *)args[sc->offset], (void *)&ss, sizeof(ss)) == -1) { - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } - tmp = malloc(sys_nsig * 8 + 2); /* 7 bytes avg per signal name */ - used = 0; - tmp[used++] = '{'; - tmp[used++] = ' '; + fputs("{ ", fp); + first = 1; for (i = 1; i < sys_nsig; i++) { if (sigismember(&ss, i)) { - signame = strsig(i); - used += sprintf(tmp + used, "%s|", signame); - free(signame); + fprintf(fp, "%s%s", !first ? "|" : "", + strsig(i)); + first = 0; } } - if (tmp[used - 1] == '|') - used--; - tmp[used++] = ' '; - tmp[used++] = '}'; - tmp[used++] = '\0'; + if (!first) + fputc(' ', fp); + fputc('}', fp); break; } case Sigprocmask: { - tmp = strdup(xlookup(sigprocmask_ops, args[sc->offset])); + fputs(xlookup(sigprocmask_ops, args[sc->offset]), fp); break; } case Fcntlflag: { /* XXX output depends on the value of the previous argument */ switch (args[sc->offset-1]) { case F_SETFD: - tmp = strdup(xlookup_bits(fcntlfd_arg, - args[sc->offset])); + fputs(xlookup_bits(fcntlfd_arg, args[sc->offset]), fp); break; case F_SETFL: - tmp = strdup(xlookup_bits(fcntlfl_arg, - args[sc->offset])); + fputs(xlookup_bits(fcntlfl_arg, args[sc->offset]), fp); break; case F_GETFD: case F_GETFL: case F_GETOWN: - tmp = strdup(""); break; default: - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } break; } case Open: - tmp = strdup(xlookup_bits(open_flags, args[sc->offset])); + fputs(xlookup_bits(open_flags, args[sc->offset]), fp); break; case Fcntl: - tmp = strdup(xlookup(fcntl_arg, args[sc->offset])); + fputs(xlookup(fcntl_arg, args[sc->offset]), fp); break; case Mprot: - tmp = strdup(xlookup_bits(mprot_flags, args[sc->offset])); + fputs(xlookup_bits(mprot_flags, args[sc->offset]), fp); break; case Mmapflags: { - char *base, *alignstr; int align, flags; /* @@ -1150,59 +1113,46 @@ print_arg(struct syscall_args *sc, unsig align = args[sc->offset] & MAP_ALIGNMENT_MASK; if (align != 0) { if (align == MAP_ALIGNED_SUPER) - alignstr = strdup("MAP_ALIGNED_SUPER"); + fputs("MAP_ALIGNED_SUPER", fp); else - asprintf(&alignstr, "MAP_ALIGNED(%d)", + fprintf(fp, "MAP_ALIGNED(%d)", align >> MAP_ALIGNMENT_SHIFT); - if (flags == 0) { - tmp = alignstr; + if (flags == 0) break; - } - } else - alignstr = NULL; - base = strdup(xlookup_bits(mmap_flags, flags)); - if (alignstr == NULL) { - tmp = base; - break; + fputc('|', fp); } - asprintf(&tmp, "%s|%s", alignstr, base); - free(alignstr); - free(base); + fputs(xlookup_bits(mmap_flags, flags), fp); break; } case Whence: - tmp = strdup(xlookup(whence_arg, args[sc->offset])); + fputs(xlookup(whence_arg, args[sc->offset]), fp); break; case Sockdomain: - tmp = strdup(xlookup(sockdomain_arg, args[sc->offset])); + fputs(xlookup(sockdomain_arg, args[sc->offset]), fp); break; case Socktype: { - FILE *fp; - size_t len; int type, flags; flags = args[sc->offset] & (SOCK_CLOEXEC | SOCK_NONBLOCK); type = args[sc->offset] & ~flags; - fp = open_memstream(&tmp, &len); fputs(xlookup(socktype_arg, type), fp); if (flags & SOCK_CLOEXEC) fprintf(fp, "|SOCK_CLOEXEC"); if (flags & SOCK_NONBLOCK) fprintf(fp, "|SOCK_NONBLOCK"); - fclose(fp); break; } case Shutdown: - tmp = strdup(xlookup(shutdown_arg, args[sc->offset])); + fputs(xlookup(shutdown_arg, args[sc->offset]), fp); break; case Resource: - tmp = strdup(xlookup(resource_arg, args[sc->offset])); + fputs(xlookup(resource_arg, args[sc->offset]), fp); break; case Pathconf: - tmp = strdup(xlookup(pathconf_arg, args[sc->offset])); + fputs(xlookup(pathconf_arg, args[sc->offset]), fp); break; case Rforkflags: - tmp = strdup(xlookup_bits(rfork_flags, args[sc->offset])); + fputs(xlookup_bits(rfork_flags, args[sc->offset]), fp); break; case Sockaddr: { struct sockaddr_storage ss; @@ -1211,19 +1161,20 @@ print_arg(struct syscall_args *sc, unsig struct sockaddr_in6 *lsin6; struct sockaddr_un *sun; struct sockaddr *sa; - char *p; u_char *q; - int i; if (args[sc->offset] == 0) { - asprintf(&tmp, "NULL"); + fputs("NULL", fp); break; } /* yuck: get ss_len */ if (get_struct(pid, (void *)args[sc->offset], (void *)&ss, - sizeof(ss.ss_len) + sizeof(ss.ss_family)) == -1) - err(1, "get_struct %p", (void *)args[sc->offset]); + sizeof(ss.ss_len) + sizeof(ss.ss_family)) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + /* * If ss_len is 0, then try to guess from the sockaddr type. * AF_UNIX may be initialized incorrectly, so always frob @@ -1234,73 +1185,71 @@ print_arg(struct syscall_args *sc, unsig case AF_INET: ss.ss_len = sizeof(*lsin); break; + case AF_INET6: + ss.ss_len = sizeof(*lsin6); + break; case AF_UNIX: ss.ss_len = sizeof(*sun); break; default: - /* hurrrr */ break; } } - if (get_struct(pid, (void *)args[sc->offset], (void *)&ss, + if (ss.ss_len != 0 && + get_struct(pid, (void *)args[sc->offset], (void *)&ss, ss.ss_len) == -1) { - err(2, "get_struct %p", (void *)args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); + break; } switch (ss.ss_family) { case AF_INET: lsin = (struct sockaddr_in *)&ss; inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof addr); - asprintf(&tmp, "{ AF_INET %s:%d }", addr, + fprintf(fp, "{ AF_INET %s:%d }", addr, htons(lsin->sin_port)); break; case AF_INET6: lsin6 = (struct sockaddr_in6 *)&ss; inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, sizeof addr); - asprintf(&tmp, "{ AF_INET6 [%s]:%d }", addr, + fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, htons(lsin6->sin6_port)); break; case AF_UNIX: sun = (struct sockaddr_un *)&ss; - asprintf(&tmp, "{ AF_UNIX \"%s\" }", sun->sun_path); + fprintf(fp, "{ AF_UNIX \"%s\" }", sun->sun_path); break; default: sa = (struct sockaddr *)&ss; - asprintf(&tmp, "{ sa_len = %d, sa_family = %d, sa_data " - "= { %n%*s } }", (int)sa->sa_len, - (int)sa->sa_family, &i, - 6 * (int)(sa->sa_len - ((char *)&sa->sa_data - - (char *)sa)), ""); - if (tmp != NULL) { - p = tmp + i; - for (q = (u_char *)&sa->sa_data; - q < (u_char *)sa + sa->sa_len; q++) - p += sprintf(p, " %#02x,", *q); - } + fprintf(fp, + "{ sa_len = %d, sa_family = %d, sa_data = {", + (int)sa->sa_len, (int)sa->sa_family); + for (q = (u_char *)sa->sa_data; + q < (u_char *)sa + sa->sa_len; q++) + fprintf(fp, "%s 0x%02x", + q == (u_char *)sa->sa_data ? "" : ",", + *q); + fputs(" } }", fp); } break; } case Sigaction: { struct sigaction sa; - char *hand; - const char *h; if (get_struct(pid, (void *)args[sc->offset], &sa, sizeof(sa)) != -1) { - asprintf(&hand, "%p", sa.sa_handler); + fputs("{ ", fp); if (sa.sa_handler == SIG_DFL) - h = "SIG_DFL"; + fputs("SIG_DFL", fp); else if (sa.sa_handler == SIG_IGN) - h = "SIG_IGN"; + fputs("SIG_IGN", fp); else - h = hand; - - asprintf(&tmp, "{ %s %s ss_t }", h, + fprintf(fp, "%p", sa.sa_handler); + fprintf(fp, " %s ss_t }", xlookup_bits(sigaction_flags, sa.sa_flags)); - free(hand); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Kevent: { @@ -1313,48 +1262,36 @@ print_arg(struct syscall_args *sc, unsig */ struct kevent *ke; int numevents = -1; - int bytes = 0; - int i, tmpsize, u, used; - const int per_ke = 100; + size_t bytes; + int i; if (sc->offset == 1) numevents = args[sc->offset+1]; else if (sc->offset == 3 && retval != -1) numevents = retval; - if (numevents >= 0) + if (numevents >= 0) { bytes = sizeof(struct kevent) * numevents; - if ((ke = malloc(bytes)) == NULL) - err(1, "Cannot malloc %d bytes for kevent array", - bytes); + if ((ke = malloc(bytes)) == NULL) + err(1, + "Cannot malloc %zu bytes for kevent array", + bytes); + } else + ke = NULL; if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset], ke, bytes) != -1) { - used = 0; - tmpsize = 1 + per_ke * numevents + 2; - if ((tmp = malloc(tmpsize)) == NULL) - err(1, "Cannot alloc %d bytes for kevent " - "output", tmpsize); - - tmp[used++] = '{'; - tmp[used++] = ' '; - for (i = 0; i < numevents; i++) { - u = snprintf(tmp + used, per_ke, - "%s%p,%s,%s,%d,%p,%p", - i > 0 ? " " : "", + fputc('{', fp); + for (i = 0; i < numevents; i++) + fprintf(fp, " %p,%s,%s,%d,%p,%p", (void *)ke[i].ident, xlookup(kevent_filters, ke[i].filter), xlookup_bits(kevent_flags, ke[i].flags), ke[i].fflags, (void *)ke[i].data, (void *)ke[i].udata); - if (u > 0) - used += u < per_ke ? u : per_ke; - } - tmp[used++] = ' '; - tmp[used++] = '}'; - tmp[used++] = '\0'; + fputs(" }", fp); } else { - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); } free(ke); break; @@ -1365,12 +1302,12 @@ print_arg(struct syscall_args *sc, unsig != -1) { char mode[12]; strmode(st.st_mode, mode); - asprintf(&tmp, + fprintf(fp, "{ mode=%s,inode=%jd,size=%jd,blksize=%ld }", mode, (intmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); } break; } @@ -1378,82 +1315,82 @@ print_arg(struct syscall_args *sc, unsig struct rusage ru; if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru)) != -1) { - asprintf(&tmp, + fprintf(fp, "{ u=%ld.%06ld,s=%ld.%06ld,in=%ld,out=%ld }", (long)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec, (long)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec, ru.ru_inblock, ru.ru_oublock); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Rlimit: { struct rlimit rl; if (get_struct(pid, (void *)args[sc->offset], &rl, sizeof(rl)) != -1) { - asprintf(&tmp, "{ cur=%ju,max=%ju }", + fprintf(fp, "{ cur=%ju,max=%ju }", rl.rlim_cur, rl.rlim_max); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case ExitStatus: { - char *signame; int status; - signame = NULL; + if (get_struct(pid, (void *)args[sc->offset], &status, sizeof(status)) != -1) { + fputs("{ ", fp); if (WIFCONTINUED(status)) - tmp = strdup("{ CONTINUED }"); + fputs("CONTINUED", fp); else if (WIFEXITED(status)) - asprintf(&tmp, "{ EXITED,val=%d }", + fprintf(fp, "EXITED,val=%d", WEXITSTATUS(status)); else if (WIFSIGNALED(status)) - asprintf(&tmp, "{ SIGNALED,sig=%s%s }", - signame = strsig2(WTERMSIG(status)), + fprintf(fp, "SIGNALED,sig=%s%s", + strsig2(WTERMSIG(status)), WCOREDUMP(status) ? ",cored" : ""); else - asprintf(&tmp, "{ STOPPED,sig=%s }", - signame = strsig2(WTERMSIG(status))); + fprintf(fp, "STOPPED,sig=%s", + strsig2(WTERMSIG(status))); + fputs(" }", fp); } else - asprintf(&tmp, "0x%lx", args[sc->offset]); - free(signame); + fprintf(fp, "0x%lx", args[sc->offset]); break; } case Waitoptions: - tmp = strdup(xlookup_bits(wait_options, args[sc->offset])); + fputs(xlookup_bits(wait_options, args[sc->offset]), fp); break; case Idtype: - tmp = strdup(xlookup(idtype_arg, args[sc->offset])); + fputs(xlookup(idtype_arg, args[sc->offset]), fp); break; case Procctl: - tmp = strdup(xlookup(procctl_arg, args[sc->offset])); + fputs(xlookup(procctl_arg, args[sc->offset]), fp); break; case Umtxop: - tmp = strdup(xlookup(umtx_ops, args[sc->offset])); + fputs(xlookup(umtx_ops, args[sc->offset]), fp); break; case Atfd: if ((int)args[sc->offset] == AT_FDCWD) - tmp = strdup("AT_FDCWD"); + fputs("AT_FDCWD", fp); else - asprintf(&tmp, "%d", (int)args[sc->offset]); + fprintf(fp, "%d", (int)args[sc->offset]); break; case Atflags: - tmp = strdup(xlookup_bits(at_flags, args[sc->offset])); + fputs(xlookup_bits(at_flags, args[sc->offset]), fp); break; case Accessmode: if (args[sc->offset] == F_OK) - tmp = strdup("F_OK"); + fputs("F_OK", fp); else - tmp = strdup(xlookup_bits(access_modes, - args[sc->offset])); + fputs(xlookup_bits(access_modes, args[sc->offset]), fp); break; case Sysarch: - tmp = strdup(xlookup(sysarch_ops, args[sc->offset])); + fputs(xlookup(sysarch_ops, args[sc->offset]), fp); break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } + fclose(fp); return (tmp); } From owner-svn-src-head@freebsd.org Wed Aug 19 01:44:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1FF09BB9F8; Wed, 19 Aug 2015 01:44:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B22055E7; Wed, 19 Aug 2015 01:44:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J1ivdO048376; Wed, 19 Aug 2015 01:44:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J1ivtC048375; Wed, 19 Aug 2015 01:44:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508190144.t7J1ivtC048375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 01:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286914 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 01:44:58 -0000 Author: jhb Date: Wed Aug 19 01:44:56 2015 New Revision: 286914 URL: https://svnweb.freebsd.org/changeset/base/286914 Log: Expand the decoding of kevent structures. - Print the ident value as decimal instead of hexadecimal for filter types that use "small" values such as file descriptors and PIDs. - Decode NOTE_* flags in the fflags field of kevents for several system filter types. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 19 00:49:50 2015 (r286913) +++ head/usr.bin/truss/syscalls.c Wed Aug 19 01:44:56 2015 (r286914) @@ -397,6 +397,30 @@ static struct xlat kevent_flags[] = { X(EV_DROP) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND }; +static struct xlat kevent_user_ffctrl[] = { + X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY) + XEND +}; + +static struct xlat kevent_rdwr_fflags[] = { + X(NOTE_LOWAT) X(NOTE_FILE_POLL) XEND +}; + +static struct xlat kevent_vnode_fflags[] = { + X(NOTE_DELETE) X(NOTE_WRITE) X(NOTE_EXTEND) X(NOTE_ATTRIB) + X(NOTE_LINK) X(NOTE_RENAME) X(NOTE_REVOKE) XEND +}; + +static struct xlat kevent_proc_fflags[] = { + X(NOTE_EXIT) X(NOTE_FORK) X(NOTE_EXEC) X(NOTE_TRACK) X(NOTE_TRACKERR) + X(NOTE_CHILD) XEND +}; + +static struct xlat kevent_timer_fflags[] = { + X(NOTE_SECONDS) X(NOTE_MSECONDS) X(NOTE_USECONDS) X(NOTE_NSECONDS) + XEND +}; + static struct xlat poll_flags[] = { X(POLLSTANDARD) X(POLLIN) X(POLLPRI) X(POLLOUT) X(POLLERR) X(POLLHUP) X(POLLNVAL) X(POLLRDNORM) X(POLLRDBAND) @@ -742,6 +766,64 @@ strsig2(int sig) return (ret); } +static void +print_kevent(FILE *fp, struct kevent *ke, int input) +{ + + switch (ke->filter) { + case EVFILT_READ: + case EVFILT_WRITE: + case EVFILT_VNODE: + case EVFILT_PROC: + case EVFILT_TIMER: + case EVFILT_PROCDESC: + fprintf(fp, "%ju", (uintmax_t)ke->ident); + break; + case EVFILT_SIGNAL: + fputs(strsig2(ke->ident), fp); + break; + default: + fprintf(fp, "%p", (void *)ke->ident); + } + fprintf(fp, ",%s,%s,", xlookup(kevent_filters, ke->filter), + xlookup_bits(kevent_flags, ke->flags)); + switch (ke->filter) { + case EVFILT_READ: + case EVFILT_WRITE: + fputs(xlookup_bits(kevent_rdwr_fflags, ke->fflags), fp); + break; + case EVFILT_VNODE: + fputs(xlookup_bits(kevent_vnode_fflags, ke->fflags), fp); + break; + case EVFILT_PROC: + case EVFILT_PROCDESC: + fputs(xlookup_bits(kevent_proc_fflags, ke->fflags), fp); + break; + case EVFILT_TIMER: + fputs(xlookup_bits(kevent_timer_fflags, ke->fflags), fp); + break; + case EVFILT_USER: { + int ctrl, data; + + ctrl = ke->fflags & NOTE_FFCTRLMASK; + data = ke->fflags & NOTE_FFLAGSMASK; + if (input) { + fputs(xlookup(kevent_user_ffctrl, ctrl), fp); + if (ke->fflags & NOTE_TRIGGER) + fputs("|NOTE_TRIGGER", fp); + if (data != 0) + fprintf(fp, "|%#x", data); + } else { + fprintf(fp, "%#x", data); + } + break; + } + default: + fprintf(fp, "%#x", ke->fflags); + } + fprintf(fp, ",%p,%p", (void *)ke->data, (void *)ke->udata); +} + /* * print_arg * Converts a syscall argument into a string. Said string is @@ -1281,14 +1363,10 @@ print_arg(struct syscall_args *sc, unsig if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset], ke, bytes) != -1) { fputc('{', fp); - for (i = 0; i < numevents; i++) - fprintf(fp, " %p,%s,%s,%d,%p,%p", - (void *)ke[i].ident, - xlookup(kevent_filters, ke[i].filter), - xlookup_bits(kevent_flags, ke[i].flags), - ke[i].fflags, - (void *)ke[i].data, - (void *)ke[i].udata); + for (i = 0; i < numevents; i++) { + fputc(' ', fp); + print_kevent(fp, &ke[i], sc->offset == 1); + } fputs(" }", fp); } else { fprintf(fp, "0x%lx", args[sc->offset]); From owner-svn-src-head@freebsd.org Wed Aug 19 02:37:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3620E9BD63F; Wed, 19 Aug 2015 02:37:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2691013D2; Wed, 19 Aug 2015 02:37:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J2bVTd069455; Wed, 19 Aug 2015 02:37:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J2bVgt069454; Wed, 19 Aug 2015 02:37:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508190237.t7J2bVgt069454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 19 Aug 2015 02:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286915 - head/sys/modules/am335x_dmtpps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 02:37:31 -0000 Author: ian Date: Wed Aug 19 02:37:30 2015 New Revision: 286915 URL: https://svnweb.freebsd.org/changeset/base/286915 Log: Add required foo_if.h files to SRCS to fix build errors. Pointed out by: gjb Pointy hat to: ian Modified: head/sys/modules/am335x_dmtpps/Makefile Modified: head/sys/modules/am335x_dmtpps/Makefile ============================================================================== --- head/sys/modules/am335x_dmtpps/Makefile Wed Aug 19 01:44:56 2015 (r286914) +++ head/sys/modules/am335x_dmtpps/Makefile Wed Aug 19 02:37:30 2015 (r286915) @@ -5,4 +5,6 @@ KMOD= am335x_dmtpps SRCS= am335x_dmtpps.c +SRCS+= bus_if.h device_if.h ofw_bus_if.h + .include From owner-svn-src-head@freebsd.org Wed Aug 19 06:07:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBF6E9BDE1D; Wed, 19 Aug 2015 06:07:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D7AE3C; Wed, 19 Aug 2015 06:07:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J67XGW059407; Wed, 19 Aug 2015 06:07:33 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J67XeY059406; Wed, 19 Aug 2015 06:07:33 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508190607.t7J67XeY059406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 19 Aug 2015 06:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286916 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 06:07:34 -0000 Author: jhibbits Date: Wed Aug 19 06:07:32 2015 New Revision: 286916 URL: https://svnweb.freebsd.org/changeset/base/286916 Log: Save the registers at the correct offsets. When merging the AIM and BookE trap.c files, the offsets for BookE's setfault inadvertantly got munged. Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Wed Aug 19 02:37:30 2015 (r286915) +++ head/sys/powerpc/booke/locore.S Wed Aug 19 06:07:32 2015 (r286916) @@ -723,11 +723,12 @@ setfault: mfsprg0 %r4 lwz %r4, TD_PCB(%r2) stw %r3, PCB_ONFAULT(%r4) - mfcr %r10 + mfcr %r4 stw %r0, 0(%r3) stw %r1, 4(%r3) stw %r2, 8(%r3) - stmw %r13, 12(%r3) /* store CR, CTR, XER, [r13 .. r31] */ + stw %r4, 8(%r3) + stmw %r13, 16(%r3) /* store CR, CTR, XER, [r13 .. r31] */ li %r3, 0 /* return FALSE */ blr From owner-svn-src-head@freebsd.org Wed Aug 19 06:08:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E25249BDE51; Wed, 19 Aug 2015 06:08:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E1AF82; Wed, 19 Aug 2015 06:08:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J68CnC059476; Wed, 19 Aug 2015 06:08:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J68Cct059475; Wed, 19 Aug 2015 06:08:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508190608.t7J68Cct059475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 19 Aug 2015 06:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286917 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 06:08:13 -0000 Author: jhibbits Date: Wed Aug 19 06:08:11 2015 New Revision: 286917 URL: https://svnweb.freebsd.org/changeset/base/286917 Log: Fix copy&paste. Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Wed Aug 19 06:07:32 2015 (r286916) +++ head/sys/powerpc/booke/locore.S Wed Aug 19 06:08:11 2015 (r286917) @@ -727,7 +727,7 @@ setfault: stw %r0, 0(%r3) stw %r1, 4(%r3) stw %r2, 8(%r3) - stw %r4, 8(%r3) + stw %r4, 12(%r3) stmw %r13, 16(%r3) /* store CR, CTR, XER, [r13 .. r31] */ li %r3, 0 /* return FALSE */ blr From owner-svn-src-head@freebsd.org Wed Aug 19 09:49:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAA2F9BC6EF; Wed, 19 Aug 2015 09:49:31 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF60D17C2; Wed, 19 Aug 2015 09:49:31 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7J9nVR0054133; Wed, 19 Aug 2015 09:49:31 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7J9nUau054129; Wed, 19 Aug 2015 09:49:30 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201508190949.t7J9nUau054129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Wed, 19 Aug 2015 09:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286918 - in head/sys: conf dev/cyapa dev/ichiic dev/isl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 09:49:31 -0000 Author: grembo (ports committer) Date: Wed Aug 19 09:49:29 2015 New Revision: 286918 URL: https://svnweb.freebsd.org/changeset/base/286918 Log: Allow building a kernel with baked in ig4, isl and cyapa drivers. Also addresses jhb's remarks on D2811 and D3068. PR: 202059 Differential Revision: https://reviews.freebsd.org/D3351 Reviewed by: jhb Approved by: jhb Modified: head/sys/conf/files head/sys/dev/cyapa/cyapa.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/isl/isl.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 19 06:08:11 2015 (r286917) +++ head/sys/conf/files Wed Aug 19 09:49:29 2015 (r286918) @@ -1236,6 +1236,7 @@ t5fw.fw optional cxgbe \ dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci +dev/cyapa/cyapa.c optional cyapa smbus dev/dc/if_dc.c optional dc pci dev/dc/dcphy.c optional dc pci dev/dc/pnphy.c optional dc pci @@ -1461,8 +1462,8 @@ dev/hptiop/hptiop.c optional hptiop scb dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc -dev/ichiic/ig4_iic.c optional ichiic -dev/ichiic/ig4_pci.c optional ichiic pci +dev/ichiic/ig4_iic.c optional ig4 smbus +dev/ichiic/ig4_pci.c optional ig4 pci smbus dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida @@ -1557,6 +1558,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/ismt/ismt.c optional ismt +dev/isl/isl.c optional isl smbus dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Modified: head/sys/dev/cyapa/cyapa.c ============================================================================== --- head/sys/dev/cyapa/cyapa.c Wed Aug 19 06:08:11 2015 (r286917) +++ head/sys/dev/cyapa/cyapa.c Wed Aug 19 09:49:29 2015 (r286918) @@ -149,7 +149,6 @@ struct cyapa_fifo { struct cyapa_softc { device_t dev; int count; /* >0 if device opened */ - int unit; int addr; struct cdev *devnode; struct selinfo selinfo; @@ -450,7 +449,6 @@ static int cyapa_probe(device_t dev) { struct cyapa_cap cap; - int unit; int addr; int error; @@ -463,8 +461,6 @@ cyapa_probe(device_t dev) if (addr != 0x67) return (ENXIO); - unit = device_get_unit(dev); - error = init_device(dev, &cap, addr, 1); if (error != 0) return (ENXIO); @@ -486,7 +482,7 @@ cyapa_attach(device_t dev) sc->reporting_mode = 1; unit = device_get_unit(dev); - addr = *((unsigned char*) device_get_ivars(dev)); + addr = smbus_get_addr(dev); if (init_device(dev, &cap, addr, 0)) return (ENXIO); @@ -494,7 +490,6 @@ cyapa_attach(device_t dev) mtx_init(&sc->mutex, "cyapa", NULL, MTX_DEF); sc->dev = dev; - sc->unit = unit; sc->addr = addr; knlist_init_mtx(&sc->selinfo.si_note, &sc->mutex); Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Wed Aug 19 06:08:11 2015 (r286917) +++ head/sys/dev/ichiic/ig4_iic.c Wed Aug 19 09:49:29 2015 (r286918) @@ -74,8 +74,8 @@ static void ig4iic_intr(void *cookie); static void ig4iic_dump(ig4iic_softc_t *sc); static int ig4_dump; -SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLTYPE_INT | CTLFLAG_RW, - &ig4_dump, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLFLAG_RW, + &ig4_dump, 0, "Dump controller registers"); /* * Low-level inline support functions Modified: head/sys/dev/isl/isl.c ============================================================================== --- head/sys/dev/isl/isl.c Wed Aug 19 06:08:11 2015 (r286917) +++ head/sys/dev/isl/isl.c Wed Aug 19 09:49:29 2015 (r286918) @@ -71,12 +71,9 @@ __FBSDID("$FreeBSD$"); struct isl_softc { device_t dev; - int unit; int addr; struct sx isl_sx; - struct sysctl_ctx_list *sysctl_ctx; - struct sysctl_oid *sysctl_tree; }; /* Returns < 0 on problem. */ @@ -85,8 +82,7 @@ static int isl_read_sensor(device_t dev, /* * Initialize the device */ -static -int +static int init_device(device_t dev, int addr, int probe) { static char bl_init[] = { 0x00 }; @@ -145,7 +141,6 @@ static driver_t isl_driver = { static int isl_probe(device_t dev) { - int unit; int addr; int error; @@ -158,8 +153,6 @@ isl_probe(device_t dev) if (addr != 0x44) return (ENXIO); - unit = device_get_unit(dev); - error = init_device(dev, addr, 1); if (error) return (ENXIO); @@ -173,7 +166,8 @@ static int isl_attach(device_t dev) { struct isl_softc *sc; - int unit; + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; int addr; int use_als; int use_ir; @@ -184,8 +178,7 @@ isl_attach(device_t dev) if (!sc) return (ENOMEM); - unit = device_get_unit(dev); - addr = *((unsigned char*) device_get_ivars(dev)); + addr = smbus_get_addr(dev); if (init_device(dev, addr, 0)) return (ENXIO); @@ -193,48 +186,47 @@ isl_attach(device_t dev) sx_init(&sc->isl_sx, "ISL read lock"); sc->dev = dev; - sc->unit = unit; sc->addr = addr; - sc->sysctl_ctx = device_get_sysctl_ctx(dev); - sc->sysctl_tree = device_get_sysctl_tree(dev); + sysctl_ctx = device_get_sysctl_ctx(dev); + sysctl_tree = device_get_sysctl_tree(dev); use_als = isl_read_sensor(dev, addr, CMD1_MASK_ALS_ONCE) >= 0; use_ir = isl_read_sensor(dev, addr, CMD1_MASK_IR_ONCE) >= 0; use_prox = isl_read_sensor(dev, addr, CMD1_MASK_PROX_ONCE) >= 0; if (use_als) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "als", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_ALS, isl_sysctl, "I", "Current ALS sensor read-out"); } if (use_ir) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "ir", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_IR, isl_sysctl, "I", "Current IR sensor read-out"); } if (use_prox) { - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prox", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_PROX, isl_sysctl, "I", "Current proximity sensor read-out"); } - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "resolution", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_RESOLUTION, isl_sysctl, "I", "Current proximity sensor resolution"); - SYSCTL_ADD_PROC(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + SYSCTL_ADD_PROC(sysctl_ctx, + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "range", CTLTYPE_INT | CTLFLAG_RD, sc, ISL_METHOD_RANGE, isl_sysctl, "I", "Current proximity sensor range"); @@ -307,7 +299,8 @@ isl_sysctl(SYSCTL_HANDLER_ARGS) return (0); } -static int isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask) +static int +isl_read_sensor(device_t dev, int addr, uint8_t cmd_mask) { device_t bus; uint8_t rbyte; From owner-svn-src-head@freebsd.org Wed Aug 19 10:25:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFF579BD239; Wed, 19 Aug 2015 10:25:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 15173113F; Wed, 19 Aug 2015 10:25:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA13903; Wed, 19 Aug 2015 13:24:57 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZS0YD-000AiH-7N; Wed, 19 Aug 2015 13:24:57 +0300 Subject: Re: svn commit: r286776 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Alexander Motin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201508141343.t7EDhCJ5058696@repo.freebsd.org> From: Andriy Gapon Message-ID: <55D45942.6050608@FreeBSD.org> Date: Wed, 19 Aug 2015 13:24:02 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508141343.t7EDhCJ5058696@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 10:25:07 -0000 On 14/08/2015 16:43, Alexander Motin wrote: > Author: mav > Date: Fri Aug 14 13:43:12 2015 > New Revision: 286776 > URL: https://svnweb.freebsd.org/changeset/base/286776 > > Log: > Remove some random accumulated diff from Illumos. > > Submitted by: avg (partially) > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > [snip] > @@ -6514,6 +6509,12 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) > csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, > cdata, l2hdr->b_asize); > > + rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); > + if (rounded > csize) { > + bzero((char *)cdata + csize, rounded - csize); > + csize = rounded; > + } > + > if (csize == 0) { > /* zero block, indicate that there's nothing to write */ > zio_data_buf_free(cdata, len); > @@ -6522,19 +6523,11 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) > hdr->b_l1hdr.b_tmp_cdata = NULL; > ARCSTAT_BUMP(arcstat_l2_compress_zeros); > return (B_TRUE); > - } > - > - rounded = P2ROUNDUP(csize, > - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); > - if (rounded < len) { Alexander, it is my fault, but this commit introduced a regression for L2ARC devices with ashift > 9: P2ROUNDUP(1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift) became P2ROUNDUP(SPA_MINBLOCKSIZE) while the line got moved. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Aug 19 10:36:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC799BD663; Wed, 19 Aug 2015 10:36:38 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D007319D9; Wed, 19 Aug 2015 10:36:38 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JAaccv074399; Wed, 19 Aug 2015 10:36:38 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JAabOX074394; Wed, 19 Aug 2015 10:36:37 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508191036.t7JAabOX074394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 19 Aug 2015 10:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286919 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 10:36:39 -0000 Author: zbb Date: Wed Aug 19 10:36:36 2015 New Revision: 286919 URL: https://svnweb.freebsd.org/changeset/base/286919 Log: Add SMP support to GICv3 and ITS drivers Introduce supprot for SMP to GICv3 and ITS drivers. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3299 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_reg.h head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Wed Aug 19 09:49:29 2015 (r286918) +++ head/sys/arm64/arm64/gic_v3.c Wed Aug 19 10:36:36 2015 (r286919) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,10 @@ static void gic_v3_dispatch(device_t, st static void gic_v3_eoi(device_t, u_int); static void gic_v3_mask_irq(device_t, u_int); static void gic_v3_unmask_irq(device_t, u_int); +#ifdef SMP +static void gic_v3_init_secondary(device_t); +static void gic_v3_ipi_send(device_t, cpuset_t, u_int); +#endif static device_method_t gic_v3_methods[] = { /* Device interface */ @@ -71,7 +76,10 @@ static device_method_t gic_v3_methods[] DEVMETHOD(pic_eoi, gic_v3_eoi), DEVMETHOD(pic_mask, gic_v3_mask_irq), DEVMETHOD(pic_unmask, gic_v3_unmask_irq), - +#ifdef SMP + DEVMETHOD(pic_init_secondary, gic_v3_init_secondary), + DEVMETHOD(pic_ipi_send, gic_v3_ipi_send), +#endif /* End */ DEVMETHOD_END }; @@ -95,6 +103,7 @@ enum gic_v3_xdist { /* Helper routines starting with gic_v3_ */ static int gic_v3_dist_init(struct gic_v3_softc *); +static int gic_v3_redist_alloc(struct gic_v3_softc *); static int gic_v3_redist_find(struct gic_v3_softc *); static int gic_v3_redist_init(struct gic_v3_softc *); static int gic_v3_cpu_init(struct gic_v3_softc *); @@ -105,11 +114,21 @@ typedef int (*gic_v3_initseq_t) (struct /* Primary CPU initialization sequence */ static gic_v3_initseq_t gic_v3_primary_init[] = { gic_v3_dist_init, + gic_v3_redist_alloc, gic_v3_redist_init, gic_v3_cpu_init, NULL }; +#ifdef SMP +/* Secondary CPU initialization sequence */ +static gic_v3_initseq_t gic_v3_secondary_init[] = { + gic_v3_redist_init, + gic_v3_cpu_init, + NULL +}; +#endif + /* * Device interface. */ @@ -213,7 +232,7 @@ gic_v3_detach(device_t dev) for (rid = 0; rid < (sc->gic_redists.nregions + 1); rid++) bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->gic_res[rid]); - for (i = 0; i < MAXCPU; i++) + for (i = 0; i < mp_ncpus; i++) free(sc->gic_redists.pcpu[i], M_GIC_V3); free(sc->gic_res, M_GIC_V3); @@ -258,13 +277,9 @@ gic_v3_dispatch(device_t dev, struct tra } if (active_irq <= GIC_LAST_SGI) { - /* - * TODO: Implement proper SGI handling. - * Mask it if such is received for some reason. - */ - device_printf(dev, - "Received unsupported interrupt type: SGI\n"); - PIC_MASK(dev, active_irq); + gic_icc_write(EOIR1, (uint64_t)active_irq); + arm_dispatch_intr(active_irq, frame); + continue; } } } @@ -283,7 +298,7 @@ gic_v3_mask_irq(device_t dev, u_int irq) sc = device_get_softc(dev); - if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_PPI) { /* PPIs in corresponding Re-Distributor */ + if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding Re-Distributor */ gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ICENABLER(irq), GICD_I_MASK(irq)); gic_v3_wait_for_rwp(sc, REDIST); @@ -303,7 +318,7 @@ gic_v3_unmask_irq(device_t dev, u_int ir sc = device_get_softc(dev); - if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_PPI) { /* PPIs in corresponding Re-Distributor */ + if (irq <= GIC_LAST_PPI) { /* SGIs and PPIs in corresponding Re-Distributor */ gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), GICD_I_MASK(irq)); gic_v3_wait_for_rwp(sc, REDIST); @@ -316,6 +331,101 @@ gic_v3_unmask_irq(device_t dev, u_int ir panic("%s: Unsupported IRQ number %u", __func__, irq); } +#ifdef SMP +static void +gic_v3_init_secondary(device_t dev) +{ + struct gic_v3_softc *sc; + gic_v3_initseq_t *init_func; + int err; + + sc = device_get_softc(dev); + + /* Train init sequence for boot CPU */ + for (init_func = gic_v3_secondary_init; *init_func != NULL; init_func++) { + err = (*init_func)(sc); + if (err != 0) { + device_printf(dev, + "Could not initialize GIC for CPU%u\n", + PCPU_GET(cpuid)); + return; + } + } + + /* + * Try to initialize ITS. + * If there is no driver attached this routine will fail but that + * does not mean failure here as only LPIs will not be functional + * on the current CPU. + */ + if (its_init_cpu(NULL) != 0) { + device_printf(dev, + "Could not initialize ITS for CPU%u. " + "No LPIs will arrive on this CPU\n", + PCPU_GET(cpuid)); + } + + /* + * ARM64TODO: Unmask timer PPIs. To be removed when appropriate + * mechanism is implemented. + * Activate the timer interrupts: virtual (27), secure (29), + * and non-secure (30). Use hardcoded values here as there + * should be no defines for them. + */ + gic_v3_unmask_irq(dev, 27); + gic_v3_unmask_irq(dev, 29); + gic_v3_unmask_irq(dev, 30); +} + +static void +gic_v3_ipi_send(device_t dev, cpuset_t cpuset, u_int ipi) +{ + u_int cpu; + uint64_t aff, tlist; + uint64_t val; + uint64_t aff_mask; + + /* Set affinity mask to match level 3, 2 and 1 */ + aff_mask = CPU_AFF1_MASK | CPU_AFF2_MASK | CPU_AFF3_MASK; + + /* Iterate through all CPUs in set */ + while (!CPU_EMPTY(&cpuset)) { + aff = tlist = 0; + for (cpu = 0; cpu < mp_ncpus; cpu++) { + /* Compose target list for single AFF3:AFF2:AFF1 set */ + if (CPU_ISSET(cpu, &cpuset)) { + if (!tlist) { + /* + * Save affinity of the first CPU to + * send IPI to for later comparison. + */ + aff = CPU_AFFINITY(cpu); + tlist |= (1UL << CPU_AFF0(aff)); + CPU_CLR(cpu, &cpuset); + } + /* Check for same Affinity level 3, 2 and 1 */ + if ((aff & aff_mask) == (CPU_AFFINITY(cpu) & aff_mask)) { + tlist |= (1UL << CPU_AFF0(CPU_AFFINITY(cpu))); + /* Clear CPU in cpuset from target list */ + CPU_CLR(cpu, &cpuset); + } + } + } + if (tlist) { + KASSERT((tlist & ~GICI_SGI_TLIST_MASK) == 0, + ("Target list too long for GICv3 IPI")); + /* Send SGI to CPUs in target list */ + val = tlist; + val |= (uint64_t)CPU_AFF3(aff) << GICI_SGI_AFF3_SHIFT; + val |= (uint64_t)CPU_AFF2(aff) << GICI_SGI_AFF2_SHIFT; + val |= (uint64_t)CPU_AFF1(aff) << GICI_SGI_AFF1_SHIFT; + val |= (uint64_t)(ipi & GICI_SGI_IPI_MASK) << GICI_SGI_IPI_SHIFT; + gic_icc_write(SGI1R, val); + } + } +} +#endif + /* * Helper routines */ @@ -463,6 +573,22 @@ gic_v3_dist_init(struct gic_v3_softc *sc /* Re-Distributor */ static int +gic_v3_redist_alloc(struct gic_v3_softc *sc) +{ + u_int cpuid; + + /* Allocate struct resource for all CPU's Re-Distributor registers */ + for (cpuid = 0; cpuid < mp_ncpus; cpuid++) + if (CPU_ISSET(cpuid, &all_cpus) != 0) + sc->gic_redists.pcpu[cpuid] = + malloc(sizeof(*sc->gic_redists.pcpu[0]), + M_GIC_V3, M_WAITOK); + else + sc->gic_redists.pcpu[cpuid] = NULL; + return (0); +} + +static int gic_v3_redist_find(struct gic_v3_softc *sc) { struct resource r_res; @@ -475,10 +601,6 @@ gic_v3_redist_find(struct gic_v3_softc * cpuid = PCPU_GET(cpuid); - /* Allocate struct resource for this CPU's Re-Distributor registers */ - sc->gic_redists.pcpu[cpuid] = - malloc(sizeof(*sc->gic_redists.pcpu[0]), M_GIC_V3, M_WAITOK); - aff = CPU_AFFINITY(cpuid); /* Affinity in format for comparison with typer */ aff = (CPU_AFF3(aff) << 24) | (CPU_AFF2(aff) << 16) | @@ -502,7 +624,6 @@ gic_v3_redist_find(struct gic_v3_softc * default: device_printf(sc->dev, "No Re-Distributor found for CPU%u\n", cpuid); - free(sc->gic_redists.pcpu[cpuid], M_GIC_V3); return (ENODEV); } @@ -531,7 +652,6 @@ gic_v3_redist_find(struct gic_v3_softc * } while ((typer & GICR_TYPER_LAST) == 0); } - free(sc->gic_redists.pcpu[cpuid], M_GIC_V3); device_printf(sc->dev, "No Re-Distributor found for CPU%u\n", cpuid); return (ENXIO); } Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Wed Aug 19 09:49:29 2015 (r286918) +++ head/sys/arm64/arm64/gic_v3_its.c Wed Aug 19 10:36:36 2015 (r286919) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,7 +89,6 @@ MALLOC_DEFINE(M_GIC_V3_ITS, "GICv3 ITS", static int its_alloc_tables(struct gic_v3_its_softc *); static void its_free_tables(struct gic_v3_its_softc *); static void its_init_commandq(struct gic_v3_its_softc *); -static int its_init_cpu(struct gic_v3_its_softc *); static void its_init_cpu_collection(struct gic_v3_its_softc *); static uint32_t its_get_devid(device_t); @@ -105,8 +105,8 @@ static uint32_t its_get_devbits(device_t static void lpi_init_conftable(struct gic_v3_its_softc *); static void lpi_bitmap_init(struct gic_v3_its_softc *); -static void lpi_init_cpu(struct gic_v3_its_softc *); static int lpi_config_cpu(struct gic_v3_its_softc *); +static void lpi_alloc_cpu_pendtables(struct gic_v3_its_softc *); const char *its_ptab_cache[] = { [GITS_BASER_CACHE_NCNB] = "(NC,NB)", @@ -223,8 +223,12 @@ gic_v3_its_attach(device_t dev) } /* 3. Allocate collections. One per-CPU */ - sc->its_cols = malloc(sizeof(*sc->its_cols) * MAXCPU, - M_GIC_V3_ITS, (M_WAITOK | M_ZERO)); + for (int cpu = 0; cpu < mp_ncpus; cpu++) + if (CPU_ISSET(cpu, &all_cpus) != 0) + sc->its_cols[cpu] = malloc(sizeof(*sc->its_cols[0]), + M_GIC_V3_ITS, (M_WAITOK | M_ZERO)); + else + sc->its_cols[cpu] = NULL; /* 4. Enable ITS in GITS_CTLR */ gits_tmp = gic_its_read(sc, 4, GITS_CTLR); @@ -236,10 +240,13 @@ gic_v3_its_attach(device_t dev) /* 6. LPIs bitmap init */ lpi_bitmap_init(sc); - /* 7. CPU init */ + /* 7. Allocate pending tables for all CPUs */ + lpi_alloc_cpu_pendtables(sc); + + /* 8. CPU init */ (void)its_init_cpu(sc); - /* 8. Init ITS devices list */ + /* 9. Init ITS devices list */ TAILQ_INIT(&sc->its_dev_list); arm_register_msi_pic(dev); @@ -280,7 +287,8 @@ gic_v3_its_detach(device_t dev) /* ITTs */ its_free_tables(sc); /* Collections */ - free(sc->its_cols, M_GIC_V3_ITS); + for (cpuid = 0; cpuid < mp_ncpus; cpuid++) + free(sc->its_cols[cpuid], M_GIC_V3_ITS); /* LPI config table */ parent = device_get_parent(sc->dev); gic_sc = device_get_softc(parent); @@ -288,10 +296,13 @@ gic_v3_its_detach(device_t dev) contigfree((void *)gic_sc->gic_redists.lpis.conf_base, LPI_CONFTAB_SIZE, M_GIC_V3_ITS); } - if ((void *)gic_sc->gic_redists.lpis.pend_base[cpuid] != NULL) { - contigfree((void *)gic_sc->gic_redists.lpis.pend_base[cpuid], - roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K), M_GIC_V3_ITS); - } + for (cpuid = 0; cpuid < mp_ncpus; cpuid++) + if ((void *)gic_sc->gic_redists.lpis.pend_base[cpuid] != NULL) { + contigfree( + (void *)gic_sc->gic_redists.lpis.pend_base[cpuid], + roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K), + M_GIC_V3_ITS); + } /* Resource... */ bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->its_res); @@ -525,13 +536,31 @@ its_init_commandq(struct gic_v3_its_soft gic_its_write(sc, 8, GITS_CWRITER, 0x0); } -static int +int its_init_cpu(struct gic_v3_its_softc *sc) { device_t parent; struct gic_v3_softc *gic_sc; /* + * NULL in place of the softc pointer means that + * this function was called during GICv3 secondary initialization. + */ + if (sc == NULL) { + if (device_is_attached(its_sc->dev)) { + /* + * XXX ARM64TODO: This is part of the workaround that + * saves ITS software context for further use in + * mask/unmask and here. This should be removed as soon + * as the upper layer is capable of passing the ITS + * context to this function. + */ + sc = its_sc; + } else + return (ENXIO); + } + + /* * Check for LPIs support on this Re-Distributor. */ parent = device_get_parent(sc->dev); @@ -544,8 +573,8 @@ its_init_cpu(struct gic_v3_its_softc *sc return (ENXIO); } - /* Initialize LPIs for this CPU */ - lpi_init_cpu(sc); + /* Configure LPIs for this CPU */ + lpi_config_cpu(sc); /* Initialize collections */ its_init_cpu_collection(sc); @@ -582,11 +611,12 @@ its_init_cpu_collection(struct gic_v3_it target = GICR_TYPER_CPUNUM(typer); } - sc->its_cols[cpuid].col_target = target; - sc->its_cols[cpuid].col_id = cpuid; + sc->its_cols[cpuid]->col_target = target; + sc->its_cols[cpuid]->col_id = cpuid; + + its_cmd_mapc(sc, sc->its_cols[cpuid], 1); + its_cmd_invall(sc, sc->its_cols[cpuid]); - its_cmd_mapc(sc, &sc->its_cols[cpuid], 1); - its_cmd_invall(sc, &sc->its_cols[cpuid]); } static void @@ -633,7 +663,7 @@ lpi_init_conftable(struct gic_v3_its_sof } static void -lpi_init_cpu(struct gic_v3_its_softc *sc) +lpi_alloc_cpu_pendtables(struct gic_v3_its_softc *sc) { device_t parent; struct gic_v3_softc *gic_sc; @@ -647,25 +677,31 @@ lpi_init_cpu(struct gic_v3_its_softc *sc * LPI Pending Table settings. * This has to be done for each Re-Distributor, hence for each CPU. */ - cpuid = PCPU_GET(cpuid); + for (cpuid = 0; cpuid < mp_ncpus; cpuid++) { - pend_base = (vm_offset_t)contigmalloc( - roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K), M_GIC_V3_ITS, - (M_WAITOK | M_ZERO), 0, ~0UL, PAGE_SIZE_64K, 0); - - /* Clean D-cache so that ITS can see zeroed pages */ - cpu_dcache_wb_range((vm_offset_t)pend_base, - roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K)); + /* Limit allocation to active CPUs only */ + if (CPU_ISSET(cpuid, &all_cpus) == 0) + continue; - if (bootverbose) { - device_printf(sc->dev, - "LPI Pending Table for CPU%u at PA: 0x%lx\n", - cpuid, vtophys(pend_base)); - } + pend_base = (vm_offset_t)contigmalloc( + roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K), M_GIC_V3_ITS, + (M_WAITOK | M_ZERO), 0, ~0UL, PAGE_SIZE_64K, 0); + + /* Clean D-cache so that ITS can see zeroed pages */ + cpu_dcache_wb_range((vm_offset_t)pend_base, + roundup2(LPI_PENDTAB_SIZE, PAGE_SIZE_64K)); - gic_sc->gic_redists.lpis.pend_base[cpuid] = pend_base; + if (bootverbose) { + device_printf(sc->dev, + "LPI Pending Table for CPU%u at PA: 0x%lx\n", + cpuid, vtophys(pend_base)); + } - lpi_config_cpu(sc); + gic_sc->gic_redists.lpis.pend_base[cpuid] = pend_base; + } + + /* Ensure visibility of pend_base addresses on other CPUs */ + wmb(); } static int @@ -683,6 +719,9 @@ lpi_config_cpu(struct gic_v3_its_softc * gic_sc = device_get_softc(parent); cpuid = PCPU_GET(cpuid); + /* Ensure data observability on a current CPU */ + rmb(); + conf_base = gic_sc->gic_redists.lpis.conf_base; pend_base = gic_sc->gic_redists.lpis.pend_base[cpuid]; @@ -1379,7 +1418,7 @@ its_device_alloc_locked(struct gic_v3_it * to be bound to the CPU that performs the configuration. */ cpuid = PCPU_GET(cpuid); - newdev->col = &sc->its_cols[cpuid]; + newdev->col = sc->its_cols[cpuid]; TAILQ_INSERT_TAIL(&sc->its_dev_list, newdev, entry); Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Wed Aug 19 09:49:29 2015 (r286918) +++ head/sys/arm64/arm64/gic_v3_reg.h Wed Aug 19 10:36:36 2015 (r286919) @@ -356,6 +356,12 @@ /* * CPU interface */ +#define GICI_SGI_TLIST_MASK (0xffffUL) +#define GICI_SGI_AFF1_SHIFT (16UL) +#define GICI_SGI_AFF2_SHIFT (32UL) +#define GICI_SGI_AFF3_SHIFT (48UL) +#define GICI_SGI_IPI_MASK (0xfUL) +#define GICI_SGI_IPI_SHIFT (24UL) /* * Registers list (ICC_xyz_EL1): Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Wed Aug 19 09:49:29 2015 (r286918) +++ head/sys/arm64/arm64/gic_v3_var.h Wed Aug 19 10:36:36 2015 (r286919) @@ -221,7 +221,7 @@ struct gic_v3_its_softc { struct its_cmd * its_cmdq_base; /* ITS command queue base */ struct its_cmd * its_cmdq_write; /* ITS command queue write ptr */ struct its_ptab its_ptabs[GITS_BASER_NUM];/* ITS private tables */ - struct its_col * its_cols; /* Per-CPU collections */ + struct its_col * its_cols[MAXCPU];/* Per-CPU collections */ uint64_t its_flags; @@ -253,6 +253,8 @@ int gic_v3_its_alloc_msix(device_t, devi int gic_v3_its_alloc_msi(device_t, device_t, int, int *); int gic_v3_its_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); +int its_init_cpu(struct gic_v3_its_softc *); + void lpi_unmask_irq(device_t, uint32_t); void lpi_mask_irq(device_t, uint32_t); /* Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Wed Aug 19 09:49:29 2015 (r286918) +++ head/sys/arm64/include/cpu.h Wed Aug 19 10:36:36 2015 (r286919) @@ -57,7 +57,12 @@ #define CPU_AFF1(mpidr) (u_int)(((mpidr) >> 8) & 0xff) #define CPU_AFF2(mpidr) (u_int)(((mpidr) >> 16) & 0xff) #define CPU_AFF3(mpidr) (u_int)(((mpidr) >> 32) & 0xff) -#define CPU_AFF_MASK 0xff00ffffffUL /* Mask affinity fields in MPIDR_EL1 */ +#define CPU_AFF0_MASK 0xffUL +#define CPU_AFF1_MASK 0xff00UL +#define CPU_AFF2_MASK 0xff0000UL +#define CPU_AFF3_MASK 0xff00000000UL +#define CPU_AFF_MASK (CPU_AFF0_MASK | CPU_AFF1_MASK | \ + CPU_AFF2_MASK| CPU_AFF3_MASK) /* Mask affinity fields in MPIDR_EL1 */ #ifdef _KERNEL From owner-svn-src-head@freebsd.org Wed Aug 19 11:45:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062AF9BCF4D; Wed, 19 Aug 2015 11:45:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1E4111F2; Wed, 19 Aug 2015 11:45:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JBjj31003472; Wed, 19 Aug 2015 11:45:45 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JBjjCv003471; Wed, 19 Aug 2015 11:45:45 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508191145.t7JBjjCv003471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 19 Aug 2015 11:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286920 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 11:45:46 -0000 Author: zbb Date: Wed Aug 19 11:45:45 2015 New Revision: 286920 URL: https://svnweb.freebsd.org/changeset/base/286920 Log: Remove redundant mp_naps from ARM64 secondary CPU start-up code The global variable has been only used for CPU startup ordering which is not needed anyway. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3296 Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Wed Aug 19 10:36:36 2015 (r286919) +++ head/sys/arm64/arm64/mp_machdep.c Wed Aug 19 11:45:45 2015 (r286920) @@ -94,8 +94,6 @@ void init_secondary(uint64_t); uint8_t secondary_stacks[MAXCPU - 1][PAGE_SIZE * KSTACK_PAGES] __aligned(16); -/* # of Applications processors */ -volatile int mp_naps; /* Set to 1 once we're ready to let the APs out of the pen. */ volatile int aps_ready = 0; @@ -211,16 +209,6 @@ init_secondary(uint64_t cpu) "mov x18, %0 \n" "msr tpidr_el1, %0" :: "r"(pcpup)); - /* - * pcpu_init() updates queue, so it should not be executed in parallel - * on several cores - */ - while(mp_naps < (cpu - 1)) - ; - - /* Signal our startup to BSP */ - atomic_add_rel_32(&mp_naps, 1); - /* Spin until the BSP releases the APs */ while (!aps_ready) __asm __volatile("wfe"); From owner-svn-src-head@freebsd.org Wed Aug 19 11:53:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D52459BD0AC; Wed, 19 Aug 2015 11:53:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3356177C; Wed, 19 Aug 2015 11:53:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JBrXBZ007668; Wed, 19 Aug 2015 11:53:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JBrXAf007667; Wed, 19 Aug 2015 11:53:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508191153.t7JBrXAf007667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Aug 2015 11:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286921 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 11:53:33 -0000 Author: kib Date: Wed Aug 19 11:53:32 2015 New Revision: 286921 URL: https://svnweb.freebsd.org/changeset/base/286921 Log: fget_unlocked() depends on the freed struct file f_count field being zero. The file_zone if no-free, but r284861 added trashing of the freed memory. Most visible manifestation of the issue were 'memory modified after free' panics for the file zone, triggered from falloc_noinstall(). Add UMA_ZONE_ZINIT flag to turn off trashing. Mjg noted that it makes sense to not trash freed memory for any non-free zone, which will be done later. Reported and tested by: pho Discussed with: mjg Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Aug 19 11:45:45 2015 (r286920) +++ head/sys/kern/kern_descrip.c Wed Aug 19 11:53:32 2015 (r286921) @@ -3833,7 +3833,7 @@ filelistinit(void *dummy) { file_zone = uma_zcreate("Files", sizeof(struct file), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_ZINIT); filedesc0_zone = uma_zcreate("filedesc0", sizeof(struct filedesc0), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Wed Aug 19 11:59:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D866A9BD422; Wed, 19 Aug 2015 11:59:42 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C934B19CC; Wed, 19 Aug 2015 11:59:42 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JBxgDN008160; Wed, 19 Aug 2015 11:59:42 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JBxggw008159; Wed, 19 Aug 2015 11:59:42 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508191159.t7JBxggw008159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 19 Aug 2015 11:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286922 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 11:59:42 -0000 Author: zbb Date: Wed Aug 19 11:59:41 2015 New Revision: 286922 URL: https://svnweb.freebsd.org/changeset/base/286922 Log: Increase MAXCPU in ARM64 Increase MAXCPU number to the maximum known value the existing hardware can support. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3405 Modified: head/sys/arm64/include/param.h Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Wed Aug 19 11:53:32 2015 (r286921) +++ head/sys/arm64/include/param.h Wed Aug 19 11:59:41 2015 (r286922) @@ -51,7 +51,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 2 +#define MAXCPU 96 #endif #else #define MAXCPU 1 From owner-svn-src-head@freebsd.org Wed Aug 19 13:23:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B8EE9BE26C; Wed, 19 Aug 2015 13:23:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C75B176C; Wed, 19 Aug 2015 13:23:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JDN75f045892; Wed, 19 Aug 2015 13:23:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JDN7Yj045891; Wed, 19 Aug 2015 13:23:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508191323.t7JDN7Yj045891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 19 Aug 2015 13:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286923 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 13:23:08 -0000 Author: jhibbits Date: Wed Aug 19 13:23:07 2015 New Revision: 286923 URL: https://svnweb.freebsd.org/changeset/base/286923 Log: Remove debug printf. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Wed Aug 19 11:59:41 2015 (r286922) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Wed Aug 19 13:23:07 2015 (r286923) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); static int fsl_pcib_rc_probe(device_t dev) { - printf("Probe called\n"); if (pci_get_vendor(dev) != 0x1957) return (ENXIO); if (pci_get_progif(dev) != 0) From owner-svn-src-head@freebsd.org Wed Aug 19 15:18:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62049BCB25; Wed, 19 Aug 2015 15:18:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C542A1F28; Wed, 19 Aug 2015 15:18:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JFIXjs095937; Wed, 19 Aug 2015 15:18:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JFIXCg095936; Wed, 19 Aug 2015 15:18:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508191518.t7JFIXCg095936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 19 Aug 2015 15:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286924 - head/sys/amd64/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 15:18:33 -0000 Author: bapt Date: Wed Aug 19 15:18:32 2015 New Revision: 286924 URL: https://svnweb.freebsd.org/changeset/base/286924 Log: Add a kern.features.cloudabi64 entry when the module is loaded to helps the userland to be able to test is cloudabi64 is supported or not Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D3430 Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 19 13:23:07 2015 (r286923) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 19 15:18:32 2015 (r286924) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -272,3 +273,4 @@ static moduledata_t cloudabi64_module = DECLARE_MODULE_TIED(cloudabi64, cloudabi64_module, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_DEPEND(cloudabi64, cloudabi, 1, 1, 1); +FEATURE(cloudabi64, "CloudABI 64bit support"); From owner-svn-src-head@freebsd.org Wed Aug 19 15:40:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A25389BE3A7; Wed, 19 Aug 2015 15:40:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBCA16BD; Wed, 19 Aug 2015 15:40:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JFe4Mg005028; Wed, 19 Aug 2015 15:40:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JFe388005026; Wed, 19 Aug 2015 15:40:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201508191540.t7JFe388005026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Aug 2015 15:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286926 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 15:40:04 -0000 Author: np Date: Wed Aug 19 15:40:03 2015 New Revision: 286926 URL: https://svnweb.freebsd.org/changeset/base/286926 Log: cxgbe(4): Save the flags for the last adapter-wide synchronized operation that was initiated successfully. (The caller and thread are already recorded). MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Aug 19 15:30:55 2015 (r286925) +++ head/sys/dev/cxgbe/adapter.h Wed Aug 19 15:40:03 2015 (r286926) @@ -808,6 +808,7 @@ struct adapter { #ifdef INVARIANTS const char *last_op; const void *last_op_thr; + int last_op_flags; #endif int sc_do_rxcopy; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 19 15:30:55 2015 (r286925) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 19 15:40:03 2015 (r286926) @@ -1149,6 +1149,7 @@ cxgbe_detach(device_t dev) #ifdef INVARIANTS sc->last_op = "t4detach"; sc->last_op_thr = curthread; + sc->last_op_flags = 0; #endif ADAPTER_UNLOCK(sc); @@ -3165,6 +3166,7 @@ begin_synchronized_op(struct adapter *sc #ifdef INVARIANTS sc->last_op = wmesg; sc->last_op_thr = curthread; + sc->last_op_flags = flags; #endif done: From owner-svn-src-head@freebsd.org Wed Aug 19 17:51:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10DCF9BEEDE; Wed, 19 Aug 2015 17:51:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F41ACEEC; Wed, 19 Aug 2015 17:51:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JHp45N061355; Wed, 19 Aug 2015 17:51:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JHp4VH061354; Wed, 19 Aug 2015 17:51:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201508191751.t7JHp4VH061354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 19 Aug 2015 17:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286932 - head/release/doc/en_US.ISO8859-1/errata stable/10/release/doc/en_US.ISO8859-1/errata stable/9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 17:51:05 -0000 Author: gjb Date: Wed Aug 19 17:51:03 2015 New Revision: 286932 URL: https://svnweb.freebsd.org/changeset/base/286932 Log: Remove a broken link. While here, prefer https where possible. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: head/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/errata/article.xml Wed Aug 19 17:47:47 2015 (r286931) +++ head/release/doc/en_US.ISO8859-1/errata/article.xml Wed Aug 19 17:51:03 2015 (r286932) @@ -62,7 +62,7 @@ the Internet and should be consulted as the current errata for this release. These other copies of the errata are located at - , + , plus any sites which keep up-to-date mirrors of this location. @@ -71,8 +71,7 @@ the snapshot). For a list of all &os; CERT security advisories, see - - or . + . From owner-svn-src-head@freebsd.org Wed Aug 19 18:24:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3709BE6E8; Wed, 19 Aug 2015 18:24:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B13376A2; Wed, 19 Aug 2015 18:24:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JIOeho075564; Wed, 19 Aug 2015 18:24:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JIOeb7075563; Wed, 19 Aug 2015 18:24:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508191824.t7JIOeb7075563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 19 Aug 2015 18:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286933 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 18:24:41 -0000 Author: delphij Date: Wed Aug 19 18:24:39 2015 New Revision: 286933 URL: https://svnweb.freebsd.org/changeset/base/286933 Log: Issue warning and refuse to proceed further if the configured repository signature_type is unsupported by bootstrap pkg(7). Previously, when signature_type specified an unsupported method, the bootstrap pkg(7) would proceed like when signature_type is "none". MITM attackers may be able to use this vulnerability and bypass validation and install their own versions of pkg(8). At this time, only fingerprint and none are supported by the bootstrap pkg(7). FreeBSD's official pkg(8) repository uses the fingerprint method and is therefore unaffected. Errata candidate. Discussed with: bapt@ Submitted by: Fabian Keil Obtained from: ElectroBSD Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Aug 19 17:51:03 2015 (r286932) +++ head/usr.sbin/pkg/pkg.c Wed Aug 19 18:24:39 2015 (r286933) @@ -767,7 +767,13 @@ bootstrap_pkg(bool force) goto fetchfail; if (signature_type != NULL && - strcasecmp(signature_type, "FINGERPRINTS") == 0) { + strcasecmp(signature_type, "NONE") != 0) { + if (strcasecmp(signature_type, "FINGERPRINTS") != 0) { + warnx("Signature type %s is not supported for " + "bootstrapping.", signature_type); + goto cleanup; + } + snprintf(tmpsig, MAXPATHLEN, "%s/pkg.txz.sig.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz.sig", @@ -855,7 +861,13 @@ bootstrap_pkg_local(const char *pkgpath, goto cleanup; } if (signature_type != NULL && - strcasecmp(signature_type, "FINGERPRINTS") == 0) { + strcasecmp(signature_type, "NONE") != 0) { + if (strcasecmp(signature_type, "FINGERPRINTS") != 0) { + warnx("Signature type %s is not supported for " + "bootstrapping.", signature_type); + goto cleanup; + } + snprintf(path, sizeof(path), "%s.sig", pkgpath); if ((fd_sig = open(path, O_RDONLY)) == -1) { From owner-svn-src-head@freebsd.org Wed Aug 19 18:32:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F4E9BE873; Wed, 19 Aug 2015 18:32:13 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 831D4B96; Wed, 19 Aug 2015 18:32:13 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JIWDwl079548; Wed, 19 Aug 2015 18:32:13 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JIWDd5079547; Wed, 19 Aug 2015 18:32:13 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201508191832.t7JIWDd5079547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Wed, 19 Aug 2015 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286934 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 18:32:13 -0000 Author: jasone Date: Wed Aug 19 18:32:12 2015 New Revision: 286934 URL: https://svnweb.freebsd.org/changeset/base/286934 Log: Use bool rather than _Bool for C++ compatibility. Submitted by: Nikolai Lifanov Modified: head/include/malloc_np.h Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Wed Aug 19 18:24:39 2015 (r286933) +++ head/include/malloc_np.h Wed Aug 19 18:32:12 2015 (r286934) @@ -33,17 +33,17 @@ #define _MALLOC_NP_H_ #include #include +#include #include __BEGIN_DECLS -typedef void *(chunk_alloc_t)(void *, size_t, size_t, _Bool *, _Bool *, - unsigned); -typedef _Bool (chunk_dalloc_t)(void *, size_t, _Bool, unsigned); -typedef _Bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); -typedef _Bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); -typedef _Bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); -typedef _Bool (chunk_split_t)(void *, size_t, size_t, size_t, _Bool, unsigned); -typedef _Bool (chunk_merge_t)(void *, size_t, void *, size_t, _Bool, unsigned); +typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); +typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); +typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); +typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); +typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); +typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned); +typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned); typedef struct { chunk_alloc_t *alloc; chunk_dalloc_t *dalloc; From owner-svn-src-head@freebsd.org Wed Aug 19 19:59:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B012F9BE64A; Wed, 19 Aug 2015 19:59:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF8617DE; Wed, 19 Aug 2015 19:59:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JJxjDi012874; Wed, 19 Aug 2015 19:59:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JJxg4E012862; Wed, 19 Aug 2015 19:59:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508191959.t7JJxg4E012862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 19:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286937 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 19:59:45 -0000 Author: jhb Date: Wed Aug 19 19:59:42 2015 New Revision: 286937 URL: https://svnweb.freebsd.org/changeset/base/286937 Log: Use nitems(). Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-fbsd.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -64,7 +64,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 19:59:42 2015 (r286937) @@ -64,8 +64,7 @@ static const char rcsid[] = #include "freebsd32_syscalls.h" -static int nsyscalls = sizeof(freebsd32_syscallnames) / - sizeof(freebsd32_syscallnames[0]); +static int nsyscalls = nitems(freebsd32_syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-linux32.c Wed Aug 19 19:59:42 2015 (r286937) @@ -61,8 +61,7 @@ static const char rcsid[] = #include "linux32_syscalls.h" -static int nsyscalls = - sizeof(linux32_syscallnames) / sizeof(linux32_syscallnames[0]); +static int nsyscalls = nitems(linux32_syscallnames); /* * This is what this particular file uses to keep track of a system call. @@ -310,8 +309,7 @@ amd64_linux32_syscall_exit(struct trussi * but that complicates things considerably. */ if (errorp) { - for (i = 0; - (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) { + for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) { if (retval == bsd_to_linux_errno[i]) break; } Modified: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- head/usr.bin/truss/arm-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/arm-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/i386-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -64,7 +64,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/i386-linux.c Wed Aug 19 19:59:42 2015 (r286937) @@ -61,8 +61,7 @@ static const char rcsid[] = #include "linux_syscalls.h" -static int nsyscalls = - sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]); +static int nsyscalls = nitems(linux_syscallnames); /* * This is what this particular file uses to keep track of a system call. @@ -309,8 +308,7 @@ i386_linux_syscall_exit(struct trussinfo * but that complicates things considerably. */ if (errorp) { - for (i = 0; - (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) { + for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) { if (retval == bsd_to_linux_errno[i]) break; } Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/mips-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -68,7 +68,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -68,7 +68,7 @@ static const char rcsid[] = #include "syscalls.h" #endif -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -63,7 +63,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -69,7 +69,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. From owner-svn-src-head@freebsd.org Wed Aug 19 20:02:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76E069BE7CD; Wed, 19 Aug 2015 20:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 668A71CF2; Wed, 19 Aug 2015 20:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JK27xU016739; Wed, 19 Aug 2015 20:02:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JK24xc016727; Wed, 19 Aug 2015 20:02:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508192002.t7JK24xc016727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 20:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286938 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:02:07 -0000 Author: jhb Date: Wed Aug 19 20:02:03 2015 New Revision: 286938 URL: https://svnweb.freebsd.org/changeset/base/286938 Log: Various style and whitespace fixes. Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-fbsd.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -305,6 +305,7 @@ amd64_syscall_exit(struct trussinfo *tru */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 20:02:03 2015 (r286938) @@ -305,6 +305,7 @@ amd64_fbsd32_syscall_exit(struct trussin */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/amd64-linux32.c Wed Aug 19 20:02:03 2015 (r286938) @@ -287,6 +287,7 @@ amd64_linux32_syscall_exit(struct trussi */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- head/usr.bin/truss/arm-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/arm-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -336,6 +336,7 @@ arm_syscall_exit(struct trussinfo *truss */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/i386-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -299,6 +299,7 @@ i386_syscall_exit(struct trussinfo *trus */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/i386-linux.c Wed Aug 19 20:02:03 2015 (r286938) @@ -286,6 +286,7 @@ i386_linux_syscall_exit(struct trussinfo */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/mips-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -333,6 +333,7 @@ mips_syscall_exit(struct trussinfo *trus */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -318,6 +318,7 @@ powerpc_syscall_exit(struct trussinfo *t */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -298,6 +298,7 @@ powerpc64_syscall_exit(struct trussinfo */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 20:02:03 2015 (r286938) @@ -327,6 +327,7 @@ sparc64_syscall_exit(struct trussinfo *t */ for (i = 0; i < sc->nargs; i++) { char *temp; + if (sc->args[i].type & OUT) { /* * If an error occurred, then don't bother Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 19 19:59:42 2015 (r286937) +++ head/usr.bin/truss/syscalls.c Wed Aug 19 20:02:03 2015 (r286938) @@ -623,9 +623,11 @@ xlookup(struct xlat *xlat, int val) return (lookup(xlat, val, 16)); } -/* Searches an xlat array containing bitfield values. Remaining bits - set after removing the known ones are printed at the end: - IN|0x400 */ +/* + * Searches an xlat array containing bitfield values. Remaining bits + * set after removing the known ones are printed at the end: + * IN|0x400. + */ static char * xlookup_bits(struct xlat *xlat, int val) { @@ -636,15 +638,21 @@ xlookup_bits(struct xlat *xlat, int val) rem = val; for (; xlat->str != NULL; xlat++) { if ((xlat->val & rem) == xlat->val) { - /* don't print the "all-bits-zero" string unless all - bits are really zero */ + /* + * Don't print the "all-bits-zero" string unless all + * bits are really zero. + */ if (xlat->val == 0 && val != 0) continue; len += sprintf(str + len, "%s|", xlat->str); rem &= ~(xlat->val); } } - /* if we have leftover bits or didn't match anything */ + + /* + * If we have leftover bits or didn't match anything, print + * the remainder. + */ if (rem || len == 0) len += sprintf(str + len, "0x%x", rem); if (len && str[len - 1] == '|') @@ -657,7 +665,6 @@ xlookup_bits(struct xlat *xlat, int val) * If/when the list gets big, it might be desirable to do it * as a hash table or binary search. */ - struct syscall * get_syscall(const char *name) { @@ -675,11 +682,8 @@ get_syscall(const char *name) } /* - * get_struct - * * Copy a fixed amount of bytes from the process. */ - static int get_struct(pid_t pid, void *offset, void *buf, int len) { @@ -697,7 +701,6 @@ get_struct(pid_t pid, void *offset, void #define MAXSIZE 4096 /* - * get_string * Copy a string from the process. Note that it is * expected to be a C string, but if max is set, it will * only get that much. @@ -825,15 +828,11 @@ print_kevent(FILE *fp, struct kevent *ke } /* - * print_arg * Converts a syscall argument into a string. Said string is - * allocated via malloc(), so needs to be free()'d. The file - * descriptor is for the process' memory (via /proc), and is used - * to get any data (where the argument is a pointer). sc is + * allocated via malloc(), so needs to be free()'d. sc is * a pointer to the syscall description (see above); args is * an array of all of the system call arguments. */ - char * print_arg(struct syscall_args *sc, unsigned long *args, long retval, struct trussinfo *trussinfo) @@ -864,18 +863,21 @@ print_arg(struct syscall_args *sc, unsig case Name: { /* NULL-terminated string. */ char *tmp2; + tmp2 = get_string(pid, (void*)args[sc->offset], 0); fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; } case BinString: { - /* Binary block of data that might have printable characters. - XXX If type|OUT, assume that the length is the syscall's - return value. Otherwise, assume that the length of the block - is in the next syscall argument. */ + /* + * Binary block of data that might have printable characters. + * XXX If type|OUT, assume that the length is the syscall's + * return value. Otherwise, assume that the length of the block + * is in the next syscall argument. + */ int max_string = trussinfo->strsize; - char tmp2[max_string+1], *tmp3; + char tmp2[max_string + 1], *tmp3; int len; int truncated = 0; @@ -884,9 +886,10 @@ print_arg(struct syscall_args *sc, unsig else len = args[sc->offset + 1]; - /* Don't print more than max_string characters, to avoid word - wrap. If we have to truncate put some ... after the string. - */ + /* + * Don't print more than max_string characters, to avoid word + * wrap. If we have to truncate put some ... after the string. + */ if (len > max_string) { len = max_string; truncated = 1; @@ -949,6 +952,7 @@ print_arg(struct syscall_args *sc, unsig #else case Quad: { unsigned long long ll; + ll = *(unsigned long long *)(args + sc->offset); fprintf(fp, "0x%llx", ll); break; @@ -959,6 +963,7 @@ print_arg(struct syscall_args *sc, unsig break; case Readlinkres: { char *tmp2; + if (retval == -1) break; tmp2 = get_string(pid, (void*)args[sc->offset], retval); @@ -967,21 +972,25 @@ print_arg(struct syscall_args *sc, unsig break; } case Ioctl: { - const char *temp = ioctlname(args[sc->offset]); + const char *temp; + unsigned long cmd; + + cmd = args[sc->offset]; + temp = ioctlname(cmd); if (temp) fputs(temp, fp); else { - unsigned long arg = args[sc->offset]; fprintf(fp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }", - arg, arg & IOC_OUT ? "R" : "", - arg & IOC_IN ? "W" : "", IOCGROUP(arg), - isprint(IOCGROUP(arg)) ? (char)IOCGROUP(arg) : '?', - arg & 0xFF, IOCPARM_LEN(arg)); + cmd, cmd & IOC_OUT ? "R" : "", + cmd & IOC_IN ? "W" : "", IOCGROUP(cmd), + isprint(IOCGROUP(cmd)) ? (char)IOCGROUP(cmd) : '?', + cmd & 0xFF, IOCPARM_LEN(cmd)); } break; } case Timespec: { struct timespec ts; + if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) fprintf(fp, "{ %ld.%09ld }", (long)ts.tv_sec, @@ -1022,6 +1031,7 @@ print_arg(struct syscall_args *sc, unsig } case Timeval: { struct timeval tv; + if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %ld.%06ld }", (long)tv.tv_sec, @@ -1032,6 +1042,7 @@ print_arg(struct syscall_args *sc, unsig } case Timeval2: { struct timeval tv[2]; + if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", @@ -1043,6 +1054,7 @@ print_arg(struct syscall_args *sc, unsig } case Itimerval: { struct itimerval itv; + if (get_struct(pid, (void *)args[sc->offset], &itv, sizeof(itv)) != -1) fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", @@ -1057,6 +1069,7 @@ print_arg(struct syscall_args *sc, unsig case LinuxSockArgs: { struct linux_socketcall_args largs; + if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, sizeof(largs)) != -1) fprintf(fp, "{ %s, 0x%lx }", @@ -1154,8 +1167,8 @@ print_arg(struct syscall_args *sc, unsig break; } case Fcntlflag: { - /* XXX output depends on the value of the previous argument */ - switch (args[sc->offset-1]) { + /* XXX: Output depends on the value of the previous argument. */ + switch (args[sc->offset - 1]) { case F_SETFD: fputs(xlookup_bits(fcntlfd_arg, args[sc->offset]), fp); break; @@ -1287,14 +1300,14 @@ print_arg(struct syscall_args *sc, unsig switch (ss.ss_family) { case AF_INET: lsin = (struct sockaddr_in *)&ss; - inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof addr); + inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); fprintf(fp, "{ AF_INET %s:%d }", addr, htons(lsin->sin_port)); break; case AF_INET6: lsin6 = (struct sockaddr_in6 *)&ss; inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, - sizeof addr); + sizeof(addr)); fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, htons(lsin6->sin6_port)); break; @@ -1336,8 +1349,8 @@ print_arg(struct syscall_args *sc, unsig } case Kevent: { /* - * XXX XXX: the size of the array is determined by either the - * next syscall argument, or by the syscall returnvalue, + * XXX XXX: The size of the array is determined by either the + * next syscall argument, or by the syscall return value, * depending on which argument number we are. This matches the * kevent syscall, but luckily that's the only syscall that uses * them. @@ -1376,9 +1389,11 @@ print_arg(struct syscall_args *sc, unsig } case Stat: { struct stat st; + if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st)) != -1) { char mode[12]; + strmode(st.st_mode, mode); fprintf(fp, "{ mode=%s,inode=%jd,size=%jd,blksize=%ld }", mode, @@ -1391,6 +1406,7 @@ print_arg(struct syscall_args *sc, unsig } case Rusage: { struct rusage ru; + if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru)) != -1) { fprintf(fp, @@ -1404,6 +1420,7 @@ print_arg(struct syscall_args *sc, unsig } case Rlimit: { struct rlimit rl; + if (get_struct(pid, (void *)args[sc->offset], &rl, sizeof(rl)) != -1) { fprintf(fp, "{ cur=%ju,max=%ju }", @@ -1473,12 +1490,10 @@ print_arg(struct syscall_args *sc, unsig } /* - * print_syscall * Print (to outfile) the system call and its arguments. Note that * nargs is the number of arguments (not the number of words; this is * potentially confusing, I know). */ - void print_syscall(struct trussinfo *trussinfo, const char *name, int nargs, char **s_args) From owner-svn-src-head@freebsd.org Wed Aug 19 20:09:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48F3C9BE88D; Wed, 19 Aug 2015 20:09:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2554A6E; Wed, 19 Aug 2015 20:09:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JK9FVJ017075; Wed, 19 Aug 2015 20:09:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JK9Elb017073; Wed, 19 Aug 2015 20:09:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508192009.t7JK9Elb017073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 20:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286939 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:09:15 -0000 Author: jhb Date: Wed Aug 19 20:09:14 2015 New Revision: 286939 URL: https://svnweb.freebsd.org/changeset/base/286939 Log: Always use %j with an intmax_t cast to print time_t values. time_t is longer than long on 32-bit platforms with a 64-bit time_t. Inspired by: mail from bde Modified: head/usr.bin/truss/main.c head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Wed Aug 19 20:02:03 2015 (r286938) +++ head/usr.bin/truss/main.c Wed Aug 19 20:09:14 2015 (r286939) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -323,15 +324,15 @@ START_TRACE: if (trussinfo->flags & ABSOLUTETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); - fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, + fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); - fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, + fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } signame = strsig(trussinfo->pr_data); @@ -348,15 +349,16 @@ START_TRACE: if (trussinfo->flags & ABSOLUTETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); - fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, + fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); - fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, timediff.tv_nsec); + fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, + timediff.tv_nsec); } fprintf(trussinfo->outfile, "process exit, rval = %u\n", trussinfo->pr_data); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 19 20:02:03 2015 (r286938) +++ head/usr.bin/truss/syscalls.c Wed Aug 19 20:09:14 2015 (r286939) @@ -993,7 +993,7 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) - fprintf(fp, "{ %ld.%09ld }", (long)ts.tv_sec, + fprintf(fp, "{ %jd.%09ld }", (intmax_t)ts.tv_sec, ts.tv_nsec); else fprintf(fp, "0x%lx", args[sc->offset]); @@ -1019,8 +1019,9 @@ print_arg(struct syscall_args *sc, unsig fprintf(fp, "UTIME_OMIT"); break; default: - fprintf(fp, "%ld.%09ld", - (long)ts[i].tv_sec, ts[i].tv_nsec); + fprintf(fp, "%jd.%09ld", + (intmax_t)ts[i].tv_sec, + ts[i].tv_nsec); break; } } @@ -1034,7 +1035,7 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - fprintf(fp, "{ %ld.%06ld }", (long)tv.tv_sec, + fprintf(fp, "{ %jd.%06ld }", (intmax_t)tv.tv_sec, tv.tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); @@ -1045,9 +1046,9 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", - (long)tv[0].tv_sec, tv[0].tv_usec, - (long)tv[1].tv_sec, tv[1].tv_usec); + fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", + (intmax_t)tv[0].tv_sec, tv[0].tv_usec, + (intmax_t)tv[1].tv_sec, tv[1].tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); break; @@ -1057,10 +1058,10 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &itv, sizeof(itv)) != -1) - fprintf(fp, "{ %ld.%06ld, %ld.%06ld }", - (long)itv.it_interval.tv_sec, + fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", + (intmax_t)itv.it_interval.tv_sec, itv.it_interval.tv_usec, - (long)itv.it_value.tv_sec, + (intmax_t)itv.it_value.tv_sec, itv.it_value.tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); @@ -1410,9 +1411,9 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru)) != -1) { fprintf(fp, - "{ u=%ld.%06ld,s=%ld.%06ld,in=%ld,out=%ld }", - (long)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec, - (long)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec, + "{ u=%jd.%06ld,s=%jd.%06ld,in=%ld,out=%ld }", + (intmax_t)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec, + (intmax_t)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec, ru.ru_inblock, ru.ru_oublock); } else fprintf(fp, "0x%lx", args[sc->offset]); @@ -1513,15 +1514,15 @@ print_syscall(struct trussinfo *trussinf if (trussinfo->flags & ABSOLUTETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); - len += fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, timediff.tv_nsec); + len += fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); - len += fprintf(trussinfo->outfile, "%ld.%09ld ", - (long)timediff.tv_sec, timediff.tv_nsec); + len += fprintf(trussinfo->outfile, "%jd.%09ld ", + (intmax_t)timediff.tv_sec, timediff.tv_nsec); } len += fprintf(trussinfo->outfile, "%s(", name); From owner-svn-src-head@freebsd.org Wed Aug 19 20:10:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 373149BEA0B; Wed, 19 Aug 2015 20:10:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21D436EC; Wed, 19 Aug 2015 20:10:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JKAxoj019124; Wed, 19 Aug 2015 20:10:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JKAxUG019123; Wed, 19 Aug 2015 20:10:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508192010.t7JKAxUG019123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 20:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286940 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:10:59 -0000 Author: jhb Date: Wed Aug 19 20:10:58 2015 New Revision: 286940 URL: https://svnweb.freebsd.org/changeset/base/286940 Log: ino_t is unsigned, so use uintmax_t instead of intmax_t when printing it. Submitted by: bde (sort of) Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 19 20:09:14 2015 (r286939) +++ head/usr.bin/truss/syscalls.c Wed Aug 19 20:10:58 2015 (r286940) @@ -1397,8 +1397,8 @@ print_arg(struct syscall_args *sc, unsig strmode(st.st_mode, mode); fprintf(fp, - "{ mode=%s,inode=%jd,size=%jd,blksize=%ld }", mode, - (intmax_t)st.st_ino, (intmax_t)st.st_size, + "{ mode=%s,inode=%ju,size=%jd,blksize=%ld }", mode, + (uintmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { fprintf(fp, "0x%lx", args[sc->offset]); From owner-svn-src-head@freebsd.org Wed Aug 19 20:31:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06EFD9BEC5B; Wed, 19 Aug 2015 20:31:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D71A410F6; Wed, 19 Aug 2015 20:31:04 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JKV4lg028452; Wed, 19 Aug 2015 20:31:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JKV49G028449; Wed, 19 Aug 2015 20:31:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508192031.t7JKV49G028449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 19 Aug 2015 20:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286941 - in head: lib/libc/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:31:05 -0000 Author: jilles Date: Wed Aug 19 20:31:03 2015 New Revision: 286941 URL: https://svnweb.freebsd.org/changeset/base/286941 Log: wordexp(): Improve some error codes. Distinguish between WRDE_BADVAL and WRDE_SYNTAX based on when the error occurred (parsing or execution), not based on whether WRDE_UNDEF was passed. Also, return WRDE_NOSPACE for a few more unexpected results from sh. Modified: head/lib/libc/gen/wordexp.3 head/lib/libc/gen/wordexp.c head/tools/regression/lib/libc/gen/test-wordexp.c Modified: head/lib/libc/gen/wordexp.3 ============================================================================== --- head/lib/libc/gen/wordexp.3 Wed Aug 19 20:10:58 2015 (r286940) +++ head/lib/libc/gen/wordexp.3 Wed Aug 19 20:31:03 2015 (r286941) @@ -131,9 +131,10 @@ argument contains one of the following u .Ql { , .Ql } . .It Dv WRDE_BADVAL -An attempt was made to expand an undefined shell variable and +An error after successful parsing, +such as an attempt to expand an undefined shell variable with .Dv WRDE_UNDEF -is set in +set in .Fa flags . .It Dv WRDE_CMDSUB An attempt was made to use command substitution and @@ -141,7 +142,9 @@ An attempt was made to use command subst is set in .Fa flags . .It Dv WRDE_NOSPACE -Not enough memory to store the result. +Not enough memory to store the result or +an error during +.Xr fork 2 . .It Dv WRDE_SYNTAX Shell syntax error in .Fa words . Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Wed Aug 19 20:10:58 2015 (r286940) +++ head/lib/libc/gen/wordexp.c Wed Aug 19 20:31:03 2015 (r286941) @@ -103,8 +103,7 @@ static int we_askshell(const char *words, wordexp_t *we, int flags) { int pdes[2]; /* Pipe to child */ - char bbuf[9]; /* Buffer for byte count */ - char wbuf[9]; /* Buffer for word count */ + char buf[18]; /* Buffer for byte and word count */ long nwords, nbytes; /* Number of words, bytes from child */ long i; /* Handy integer */ size_t sofs; /* Offset into we->we_strings */ @@ -119,6 +118,7 @@ we_askshell(const char *words, wordexp_t char **nwv; /* Temporary for realloc() */ sigset_t newsigblock, oldsigblock; const char *ifs; + char save; serrno = errno; ifs = getenv("IFS"); @@ -146,8 +146,9 @@ we_askshell(const char *words, wordexp_t _fcntl(pdes[1], F_SETFD, 0)) < 0) _exit(1); execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", "IFS=$1;eval \"$2\";eval \"set -- $3\";IFS=;a=\"$*\";" - "printf '%08x' \"$#\" \"${#a}\";printf '%s\\0' \"$@\"", + "-c", "IFS=$1;eval \"$2\";eval \"echo;set -- $3\";" + "IFS=;a=\"$*\";printf '%08x' \"$#\" \"${#a}\";" + "printf '%s\\0' \"$@\"", "", ifs != NULL ? ifs : " \t\n", flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, @@ -157,20 +158,30 @@ we_askshell(const char *words, wordexp_t /* * We are the parent; read the output of the shell wordexp function, - * which is a 32-bit hexadecimal word count, a 32-bit hexadecimal - * byte count (not including terminating null bytes), followed by - * the expanded words separated by nulls. + * which is a byte indicating that the words were parsed successfully, + * a 32-bit hexadecimal word count, a 32-bit hexadecimal byte count + * (not including terminating null bytes), followed by the expanded + * words separated by nulls. */ _close(pdes[1]); - if (we_read_fully(pdes[0], wbuf, 8) != 8 || - we_read_fully(pdes[0], bbuf, 8) != 8) { - error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + switch (we_read_fully(pdes[0], buf, 17)) { + case 1: + error = WRDE_BADVAL; + serrno = errno; + goto cleanup; + case 17: + break; + default: + error = WRDE_SYNTAX; serrno = errno; goto cleanup; } - wbuf[8] = bbuf[8] = '\0'; - nwords = strtol(wbuf, NULL, 16); - nbytes = strtol(bbuf, NULL, 16) + nwords; + save = buf[9]; + buf[9] = '\0'; + nwords = strtol(buf + 1, NULL, 16); + buf[9] = save; + buf[17] = '\0'; + nbytes = strtol(buf + 9, NULL, 16) + nwords; /* * Allocate or reallocate (when flags & WRDE_APPEND) the word vector @@ -200,7 +211,7 @@ we_askshell(const char *words, wordexp_t we->we_strings = nstrings; if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { - error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + error = WRDE_NOSPACE; /* abort for unknown reason */ serrno = errno; goto cleanup; } @@ -217,7 +228,7 @@ cleanup: return (error); } if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + return (WRDE_NOSPACE); /* abort for unknown reason */ /* * Break the null-terminated expanded word strings out into Modified: head/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-wordexp.c Wed Aug 19 20:10:58 2015 (r286940) +++ head/tools/regression/lib/libc/gen/test-wordexp.c Wed Aug 19 20:31:03 2015 (r286941) @@ -206,6 +206,15 @@ main(int argc, char *argv[]) assert(strcmp(we.we_wordv[0], "\\") == 0); assert(we.we_wordv[1] == NULL); wordfree(&we); + /* Two syntax errors that are not detected by the current we_check(). */ + r = wordexp("${IFS:+'}", &we, 0); + assert(r == WRDE_SYNTAX); + r = wordexp("${IFS:+'}", &we, WRDE_UNDEF); + assert(r == WRDE_SYNTAX); + r = wordexp("$(case)", &we, 0); + assert(r == WRDE_SYNTAX); + r = wordexp("$(case)", &we, WRDE_UNDEF); + assert(r == WRDE_SYNTAX); /* With a SIGCHLD handler that reaps all zombies. */ sa.sa_flags = 0; From owner-svn-src-head@freebsd.org Wed Aug 19 20:31:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3759BED47; Wed, 19 Aug 2015 20:31:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBEBF12B9; Wed, 19 Aug 2015 20:31:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JKVaAL028512; Wed, 19 Aug 2015 20:31:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JKVaaC028510; Wed, 19 Aug 2015 20:31:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508192031.t7JKVaaC028510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 19 Aug 2015 20:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286942 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:31:37 -0000 Author: ian Date: Wed Aug 19 20:31:35 2015 New Revision: 286942 URL: https://svnweb.freebsd.org/changeset/base/286942 Log: Add compatible strings for all the hardware this driver works with. Also, move the READ/WRITE bus space access macros from the header into the source file, and rename them to RD2/WR2 to make it clear they're 16-bit accessors. (READ/WRITE just don't seem like good names to be in a public header file.) Modified: head/sys/arm/freescale/imx/imx_wdog.c head/sys/arm/freescale/imx/imx_wdogreg.h Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Wed Aug 19 20:31:03 2015 (r286941) +++ head/sys/arm/freescale/imx/imx_wdog.c Wed Aug 19 20:31:35 2015 (r286942) @@ -65,6 +65,20 @@ static struct resource_spec imx_wdog_spe { -1, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6sx-wdt", 1}, + {"fsl,imx6sl-wdt", 1}, + {"fsl,imx6q-wdt", 1}, + {"fsl,imx53-wdt", 1}, + {"fsl,imx51-wdt", 1}, + {"fsl,imx50-wdt", 1}, + {"fsl,imx35-wdt", 1}, + {"fsl,imx27-wdt", 1}, + {"fsl,imx25-wdt", 1}, + {"fsl,imx21-wdt", 1}, + {NULL, 0} +}; + static void imx_watchdog(void *, u_int, int *); static int imx_wdog_probe(device_t); static int imx_wdog_attach(device_t); @@ -83,6 +97,10 @@ static driver_t imx_wdog_driver = { static devclass_t imx_wdog_devclass; DRIVER_MODULE(imx_wdog, simplebus, imx_wdog_driver, imx_wdog_devclass, 0, 0); +#define RD2(_sc, _r) \ + bus_space_read_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r)) +#define WR2(_sc, _r, _v) \ + bus_space_write_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r), (_v)) static void imx_watchdog(void *arg, u_int cmd, int *error) @@ -95,8 +113,8 @@ imx_watchdog(void *arg, u_int cmd, int * mtx_lock(&sc->sc_mtx); /* Refresh counter, since we feels good */ - WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP1); - WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP2); + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); /* We don't require precession, so "-10" (/1024) is ok */ timeout = (1 << ((cmd & WD_INTERVAL) - 10)) / 1000000; @@ -105,14 +123,14 @@ imx_watchdog(void *arg, u_int cmd, int * device_printf(sc->sc_dev, "WARNING: watchdog can't be disabled!!!"); sc->sc_timeout = timeout; - reg = READ(sc, WDOG_CR_REG); + reg = RD2(sc, WDOG_CR_REG); reg &= ~WDOG_CR_WT_MASK; reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) & WDOG_CR_WT_MASK; - WRITE(sc, WDOG_CR_REG, reg); + WR2(sc, WDOG_CR_REG, reg); /* Refresh counter */ - WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP1); - WRITE(sc, WDOG_SR_REG, WDOG_SR_STEP2); + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); + WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); *error = 0; } else { *error = EOPNOTSUPP; @@ -132,11 +150,10 @@ imx_wdog_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx51-wdt") && - !ofw_bus_is_compatible(dev, "fsl,imx53-wdt")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "Freescale i.MX5xx Watchdog Timer"); + device_set_desc(dev, "Freescale i.MX Watchdog"); return (0); } Modified: head/sys/arm/freescale/imx/imx_wdogreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx_wdogreg.h Wed Aug 19 20:31:03 2015 (r286941) +++ head/sys/arm/freescale/imx/imx_wdogreg.h Wed Aug 19 20:31:35 2015 (r286942) @@ -59,7 +59,3 @@ #define WDOG_MCR_REG 0x08 /* Miscellaneous Control Register */ #define WDOG_MCR_PDE (1 << 0) -#define READ(_sc, _r) \ - bus_space_read_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r)) -#define WRITE(_sc, _r, _v) \ - bus_space_write_2((_sc)->sc_bst, (_sc)->sc_bsh, (_r), (_v)) From owner-svn-src-head@freebsd.org Wed Aug 19 20:50:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3359BEEFB; Wed, 19 Aug 2015 20:50:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 769191DBC; Wed, 19 Aug 2015 20:50:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JKoWAI034711; Wed, 19 Aug 2015 20:50:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JKoWsW034710; Wed, 19 Aug 2015 20:50:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508192050.t7JKoWsW034710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 19 Aug 2015 20:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286943 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 20:50:32 -0000 Author: ian Date: Wed Aug 19 20:50:31 2015 New Revision: 286943 URL: https://svnweb.freebsd.org/changeset/base/286943 Log: Make the imx watchdog actually work, by setting WDOG_CR_WDE (enable bit). Also, follow the rules from watchdog(9) about what values to return in various situations (especially, don't touch *error when asked to set a non-zero timeout that isn't achievable on the hardware). Modified: head/sys/arm/freescale/imx/imx_wdog.c Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Wed Aug 19 20:31:35 2015 (r286942) +++ head/sys/arm/freescale/imx/imx_wdog.c Wed Aug 19 20:50:31 2015 (r286943) @@ -107,40 +107,32 @@ imx_watchdog(void *arg, u_int cmd, int * { struct imx_wdog_softc *sc; uint16_t reg; - int timeout; + u_int timeout; sc = arg; mtx_lock(&sc->sc_mtx); - - /* Refresh counter, since we feels good */ - WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); - WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); - - /* We don't require precession, so "-10" (/1024) is ok */ - timeout = (1 << ((cmd & WD_INTERVAL) - 10)) / 1000000; - if (timeout > 1 && timeout < 128) { - if (timeout != sc->sc_timeout) { - device_printf(sc->sc_dev, - "WARNING: watchdog can't be disabled!!!"); - sc->sc_timeout = timeout; - reg = RD2(sc, WDOG_CR_REG); - reg &= ~WDOG_CR_WT_MASK; - reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) & - WDOG_CR_WT_MASK; - WR2(sc, WDOG_CR_REG, reg); + if (cmd == 0) { + if (bootverbose) + device_printf(sc->sc_dev, "Can not be disabled.\n"); + *error = EOPNOTSUPP; + } else { + timeout = (u_int)((1ULL << (cmd & WD_INTERVAL)) / 1000000000U); + if (timeout > 1 && timeout < 128) { + if (timeout != sc->sc_timeout) { + sc->sc_timeout = timeout; + reg = RD2(sc, WDOG_CR_REG); + reg &= ~WDOG_CR_WT_MASK; + reg |= (timeout << (WDOG_CR_WT_SHIFT + 1)) & + WDOG_CR_WT_MASK; + WR2(sc, WDOG_CR_REG, reg | WDOG_CR_WDE); + } /* Refresh counter */ WR2(sc, WDOG_SR_REG, WDOG_SR_STEP1); WR2(sc, WDOG_SR_REG, WDOG_SR_STEP2); *error = 0; - } else { - *error = EOPNOTSUPP; } - } else { - device_printf(sc->sc_dev, "Can not be disabled.\n"); - *error = EOPNOTSUPP; } mtx_unlock(&sc->sc_mtx); - } static int From owner-svn-src-head@freebsd.org Wed Aug 19 21:04:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CAE09BE254; Wed, 19 Aug 2015 21:04:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A13FBE1; Wed, 19 Aug 2015 21:04:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JL4p00041680; Wed, 19 Aug 2015 21:04:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JL4pf8041679; Wed, 19 Aug 2015 21:04:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508192104.t7JL4pf8041679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 19 Aug 2015 21:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286944 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:04:51 -0000 Author: ian Date: Wed Aug 19 21:04:50 2015 New Revision: 286944 URL: https://svnweb.freebsd.org/changeset/base/286944 Log: Enable the watchdog driver on imx6, now that it works. Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Wed Aug 19 20:50:31 2015 (r286943) +++ head/sys/arm/conf/IMX6 Wed Aug 19 21:04:50 2015 (r286944) @@ -136,5 +136,5 @@ device ffec # Freescale Fast Ethernet device fsliic # Freescale i2c/iic device iic # iic protocol device iicbus # iic bus -#device imxwdt # Watchdog. WARNING: can't be disabled!!! +device imxwdt # Watchdog. WARNING: can't be disabled!!! From owner-svn-src-head@freebsd.org Wed Aug 19 21:04:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E21E9BE282; Wed, 19 Aug 2015 21:04:59 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x22d.google.com (mail-yk0-x22d.google.com [IPv6:2607:f8b0:4002:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 298C0D16; Wed, 19 Aug 2015 21:04:59 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykfw73 with SMTP id w73so18378512ykf.3; Wed, 19 Aug 2015 14:04:58 -0700 (PDT) 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=RLXPWpEIO/02QDEifLYiciFh3IG0vSgcGQCJLk6e+is=; b=eXhIwg0eFZS2NsB7cbkthXQ3o/qenhF6rlcrPb5Z+zYoVwLmyN219iIwcyWiBP/aLJ curbBNWhzH8y6M7hu4pCWtJeL8A04cD5zqrO08WFBBiN7rnq4d3TQ43P2N+nR6vM/6tO 2iszLY4tEAPWieu5Ogu41ZsJUTGETrHFXXPqJiYJ5HbvJXgOFtcTANFO2V92Gt+VKw1K AF1oLxvEwrOMHL4KMy4IBWSJVlioFEWB2Yu8VG82knYmBdvvmGQeqKtAzLWifHg5JlZt dYjAB0u2NKEf87Z0l+JHfUvrr/JukBAdOpUT7XJdtMCuxQY1FKwSjtPo3kn7p/JvDfC8 sLKA== MIME-Version: 1.0 X-Received: by 10.170.75.212 with SMTP id r203mr15955610ykr.34.1440018297932; Wed, 19 Aug 2015 14:04:57 -0700 (PDT) Received: by 10.129.73.205 with HTTP; Wed, 19 Aug 2015 14:04:57 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Wed, 19 Aug 2015 23:04:57 +0200 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Adrian Chadd Cc: Oliver Pinter , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:04:59 -0000 Just an update there. Here is the patch i had prepared https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c2435= 86cb062edea Now its public at least. On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd wrote: > Ermal - yes please. :) Or, just do the MFC yourself. :) > > > -a > > > On 6 August 2015 at 00:21, Ermal Lu=C3=A7i wrote: > > I did the port for pfSense and the whole stack works from HEAD into > > 10-STABLE. > > > > Just minor modifications were required. > > If you want i can try to send the diff. > > > > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter > > wrote: > >> > >> Yup. :) If you need testers with the backport, then ping me. ;) > >> > >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd > wrote: > >> > The whole wifi stack / drivers need backporting. :) > >> > > >> > > >> > > >> > -a > >> > > >> > > >> > On 5 August 2015 at 12:41, Shawn Webb > >> > wrote: > >> >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: > >> >>> Author: adrian > >> >>> Date: Wed Aug 5 19:32:35 2015 > >> >>> New Revision: 286337 > >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337 > >> >>> > >> >>> Log: > >> >>> Add TXOP enforce support to the AR9300 HAL. > >> >>> > >> >>> This is required for (more) correct TDMA support. Without it, t= he > >> >>> code tries to calculate the required guard interval based on the > >> >>> current rate, and since this is an 11n NIC and people try using > >> >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then > >> >>> panics. > >> >>> > >> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it > >> >>> have one less bug. > >> >>> > >> >>> Reported by: Berislav Purgar > >> >>> > >> >>> Modified: > >> >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c > >> >> > >> >> Hey Adrian, > >> >> > >> >> Can this be MFC'd? > >> >> > >> >> Thanks, > >> >> > >> >> -- > >> >> Shawn Webb > >> >> HardenedBSD > >> >> > >> >> GPG Key ID: 0x6A84658F52456EEE > >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 > 6EEE > >> > _______________________________________________ > >> > 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" > >> > > > > > > > > -- > > Ermal > --=20 Ermal From owner-svn-src-head@freebsd.org Wed Aug 19 21:08:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 467D09BE35E; Wed, 19 Aug 2015 21:08:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3797A1098; Wed, 19 Aug 2015 21:08:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JL8hDS041933; Wed, 19 Aug 2015 21:08:43 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JL8hvS041932; Wed, 19 Aug 2015 21:08:43 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508192108.t7JL8hvS041932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 19 Aug 2015 21:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286945 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:08:43 -0000 Author: melifaro Date: Wed Aug 19 21:08:42 2015 New Revision: 286945 URL: https://svnweb.freebsd.org/changeset/base/286945 Log: Check value return from lle_create() for NULL. This bug sneaked unnoticed in r286722. Reported by: adrian Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Aug 19 21:04:50 2015 (r286944) +++ head/sys/netinet/if_ether.c Wed Aug 19 21:08:42 2015 (r286945) @@ -790,10 +790,13 @@ match: */ IF_AFDATA_WLOCK(ifp); la = lla_create(LLTABLE(ifp), 0, (struct sockaddr *)&sin); - arp_update_lle(ah, ifp, la); + if (la != NULL) + arp_update_lle(ah, ifp, la); IF_AFDATA_WUNLOCK(ifp); - arp_mark_lle_reachable(la); - LLE_WUNLOCK(la); + if (la != NULL) { + arp_mark_lle_reachable(la); + LLE_WUNLOCK(la); + } } reply: if (op != ARPOP_REQUEST) From owner-svn-src-head@freebsd.org Wed Aug 19 21:13:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBC019BE522 for ; Wed, 19 Aug 2015 21:13:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 833D8174E for ; Wed, 19 Aug 2015 21:13:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by qgeb6 with SMTP id b6so14796081qge.3 for ; Wed, 19 Aug 2015 14:13:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+8tQmU3rUtUg43O3mGVDQAp4mbeV4vCfnQlyBH21RCo=; b=Q6P8zgcOSS8S0jiyiKEM0erQPp3dBfW4rArDPdhRtLYU/95slGbtQBHd1yu9UuS1di SjQlCq/Zus0FzSMaAEhtwWB2NO5r3skWLd658SmgVcdLNoKC2rvlQYFYHg5jo7BwaaAQ vPvtSZhcKYtEoC5jf0yOWkCF0Ys3DV7rFOAgoOTSCv+eV7flhJOLztORcF4M4MSH9BfD K6Y/d1kgUkhmBlJGUViAr2zWsN+rLYFlDC2w1OXps9Pj6VQPKoB6zO0vdyDQbZueHZ/1 vGO3q+WZhL1OP1W//1OIFn7GvEvJF+guZUAs9vHz/yKWQGi+Xddf1OZeXRdTgSq4N72R 6NOQ== X-Gm-Message-State: ALoCoQkFBPN65GPB19dY0ioOkBxcrVhJnNQ4Lua1eCDFoHYnHh8ARaDAf75Fxjv09f3JobmawpSZ MIME-Version: 1.0 X-Received: by 10.140.98.116 with SMTP id n107mr15313118qge.52.1440018815939; Wed, 19 Aug 2015 14:13:35 -0700 (PDT) Received: by 10.55.167.133 with HTTP; Wed, 19 Aug 2015 14:13:35 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Wed, 19 Aug 2015 23:13:35 +0200 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= Cc: Adrian Chadd , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:13:43 -0000 Cool! Thanks Ermal! On 8/19/15, Ermal Lu=C3=A7i wrote: > Just an update there. > > Here is the patch i had prepared > https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c24= 3586cb062edea > Now its public at least. > > On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd wrote: > >> Ermal - yes please. :) Or, just do the MFC yourself. :) >> >> >> -a >> >> >> On 6 August 2015 at 00:21, Ermal Lu=C3=A7i wrote: >> > I did the port for pfSense and the whole stack works from HEAD into >> > 10-STABLE. >> > >> > Just minor modifications were required. >> > If you want i can try to send the diff. >> > >> > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter >> > wrote: >> >> >> >> Yup. :) If you need testers with the backport, then ping me. ;) >> >> >> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd >> wrote: >> >> > The whole wifi stack / drivers need backporting. :) >> >> > >> >> > >> >> > >> >> > -a >> >> > >> >> > >> >> > On 5 August 2015 at 12:41, Shawn Webb >> >> > wrote: >> >> >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >> >> >>> Author: adrian >> >> >>> Date: Wed Aug 5 19:32:35 2015 >> >> >>> New Revision: 286337 >> >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337 >> >> >>> >> >> >>> Log: >> >> >>> Add TXOP enforce support to the AR9300 HAL. >> >> >>> >> >> >>> This is required for (more) correct TDMA support. Without it, >> >> >>> the >> >> >>> code tries to calculate the required guard interval based on th= e >> >> >>> current rate, and since this is an 11n NIC and people try using >> >> >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then >> >> >>> panics. >> >> >>> >> >> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it >> >> >>> have one less bug. >> >> >>> >> >> >>> Reported by: Berislav Purgar >> >> >>> >> >> >>> Modified: >> >> >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c >> >> >> >> >> >> Hey Adrian, >> >> >> >> >> >> Can this be MFC'd? >> >> >> >> >> >> Thanks, >> >> >> >> >> >> -- >> >> >> Shawn Webb >> >> >> HardenedBSD >> >> >> >> >> >> GPG Key ID: 0x6A84658F52456EEE >> >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 >> 6EEE >> >> > _______________________________________________ >> >> > 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" >> >> >> > >> > >> > >> > -- >> > Ermal >> > > > > -- > Ermal > From owner-svn-src-head@freebsd.org Wed Aug 19 21:23:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9985C9BE750; Wed, 19 Aug 2015 21:23:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5511D43; Wed, 19 Aug 2015 21:23:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JLNIHg050386; Wed, 19 Aug 2015 21:23:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JLNIUU050385; Wed, 19 Aug 2015 21:23:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508192123.t7JLNIUU050385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Aug 2015 21:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286946 - head/contrib/compiler-rt/lib/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:23:18 -0000 Author: emaste Date: Wed Aug 19 21:23:17 2015 New Revision: 286946 URL: https://svnweb.freebsd.org/changeset/base/286946 Log: compiler-rt: update __multc3 to upstream style and variable names I introduced a local copy of __multc3 in r281221, which has now been committed upstream to compiler-rt in revision 245296. Update our version to match the changes made there. Sponsored by: The FreeBSD Foundation Modified: head/contrib/compiler-rt/lib/builtins/multc3.c Modified: head/contrib/compiler-rt/lib/builtins/multc3.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/multc3.c Wed Aug 19 21:08:42 2015 (r286945) +++ head/contrib/compiler-rt/lib/builtins/multc3.c Wed Aug 19 21:23:17 2015 (r286946) @@ -18,55 +18,50 @@ /* Returns: the product of a + ib and c + id */ COMPILER_RT_ABI long double _Complex -__multc3(long double __a, long double __b, long double __c, long double __d) +__multc3(long double a, long double b, long double c, long double d) { - long double __ac = __a * __c; - long double __bd = __b * __d; - long double __ad = __a * __d; - long double __bc = __b * __c; + long double ac = a * c; + long double bd = b * d; + long double ad = a * d; + long double bc = b * c; long double _Complex z; - __real__ z = __ac - __bd; - __imag__ z = __ad + __bc; - if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) - { - int __recalc = 0; - if (crt_isinf(__a) || crt_isinf(__b)) - { - __a = crt_copysignl(crt_isinf(__a) ? 1 : 0, __a); - __b = crt_copysignl(crt_isinf(__b) ? 1 : 0, __b); - if (crt_isnan(__c)) - __c = crt_copysignl(0, __c); - if (crt_isnan(__d)) - __d = crt_copysignl(0, __d); - __recalc = 1; + __real__ z = ac - bd; + __imag__ z = ad + bc; + if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) { + int recalc = 0; + if (crt_isinf(a) || crt_isinf(b)) { + a = crt_copysignl(crt_isinf(a) ? 1 : 0, a); + b = crt_copysignl(crt_isinf(b) ? 1 : 0, b); + if (crt_isnan(c)) + c = crt_copysignl(0, c); + if (crt_isnan(d)) + d = crt_copysignl(0, d); + recalc = 1; } - if (crt_isinf(__c) || crt_isinf(__d)) - { - __c = crt_copysignl(crt_isinf(__c) ? 1 : 0, __c); - __d = crt_copysignl(crt_isinf(__d) ? 1 : 0, __d); - if (crt_isnan(__a)) - __a = crt_copysignl(0, __a); - if (crt_isnan(__b)) - __b = crt_copysignl(0, __b); - __recalc = 1; + if (crt_isinf(c) || crt_isinf(d)) { + c = crt_copysignl(crt_isinf(c) ? 1 : 0, c); + d = crt_copysignl(crt_isinf(d) ? 1 : 0, d); + if (crt_isnan(a)) + a = crt_copysignl(0, a); + if (crt_isnan(b)) + b = crt_copysignl(0, b); + recalc = 1; } - if (!__recalc && (crt_isinf(__ac) || crt_isinf(__bd) || - crt_isinf(__ad) || crt_isinf(__bc))) - { - if (crt_isnan(__a)) - __a = crt_copysignl(0, __a); - if (crt_isnan(__b)) - __b = crt_copysignl(0, __b); - if (crt_isnan(__c)) - __c = crt_copysignl(0, __c); - if (crt_isnan(__d)) - __d = crt_copysignl(0, __d); - __recalc = 1; + if (!recalc && (crt_isinf(ac) || crt_isinf(bd) || + crt_isinf(ad) || crt_isinf(bc))) { + if (crt_isnan(a)) + a = crt_copysignl(0, a); + if (crt_isnan(b)) + b = crt_copysignl(0, b); + if (crt_isnan(c)) + c = crt_copysignl(0, c); + if (crt_isnan(d)) + d = crt_copysignl(0, d); + recalc = 1; } - if (__recalc) - { - __real__ z = CRT_INFINITY * (__a * __c - __b * __d); - __imag__ z = CRT_INFINITY * (__a * __d + __b * __c); + if (recalc) { + __real__ z = CRT_INFINITY * (a * c - b * d); + __imag__ z = CRT_INFINITY * (a * d + b * c); } } return z; From owner-svn-src-head@freebsd.org Wed Aug 19 21:31:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D29C49BE7B5; Wed, 19 Aug 2015 21:31:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 980461D9; Wed, 19 Aug 2015 21:31:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbjg10 with SMTP id jg10so115183271igb.0; Wed, 19 Aug 2015 14:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=nrRA1GHaElN7fFBGZiDTMNJjjnSR07CvgVW/dVHzvWU=; b=EMPcKTCDSxR45y+j5eUC2F0qJ58E0tZXtDBuo6Q1IbOfrAgCRrZ+RF42nhUhIWIfhu 7Y2G2JjENsp1zViNUxCGrUJHCjE9YPVTWbpFXz3T0rgpmxy2hkn27GHtyaddJG+Ltjcp zO0mLvI5WPe3JiAZtqzoEqh7xcu7hXi0VhRo0vTQFGO+N873Elzj3LTx0Zvx0mguC7k2 AJDL1xiRA683RdICZpSEH0TGeZdeg5vFbJVAJYiJoo0pXQ8TOWZLrcabOWN96SQTIntI WznID2nJMSGm4jmbz6yTyMM0E0NfQCaUV7pzpnrMeYIB275Jxi6+5AXKDfJDLwYGPIuk wvyw== MIME-Version: 1.0 X-Received: by 10.50.61.144 with SMTP id p16mr4099815igr.22.1440019895090; Wed, 19 Aug 2015 14:31:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Wed, 19 Aug 2015 14:31:34 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Wed, 19 Aug 2015 14:31:34 -0700 X-Google-Sender-Auth: Vg9jxQJFmB58k6rmNeQeQH0ltpQ Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: Oliver Pinter Cc: =?UTF-8?Q?Ermal_Lu=C3=A7i?= , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:31:35 -0000 jim asked me again to do the MFC, so once I've finished doing some more tidying up of bits and pieces I'll do the MFC. -a On 19 August 2015 at 14:13, Oliver Pinter w= rote: > Cool! Thanks Ermal! > > On 8/19/15, Ermal Lu=C3=A7i wrote: >> Just an update there. >> >> Here is the patch i had prepared >> https://github.com/pfsense/FreeBSD-src/commit/6ee75bdd7bf7c20359dd6e38c2= 43586cb062edea >> Now its public at least. >> >> On Thu, Aug 6, 2015 at 3:03 PM, Adrian Chadd wrote: >> >>> Ermal - yes please. :) Or, just do the MFC yourself. :) >>> >>> >>> -a >>> >>> >>> On 6 August 2015 at 00:21, Ermal Lu=C3=A7i wrote= : >>> > I did the port for pfSense and the whole stack works from HEAD into >>> > 10-STABLE. >>> > >>> > Just minor modifications were required. >>> > If you want i can try to send the diff. >>> > >>> > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter >>> > wrote: >>> >> >>> >> Yup. :) If you need testers with the backport, then ping me. ;) >>> >> >>> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd >>> wrote: >>> >> > The whole wifi stack / drivers need backporting. :) >>> >> > >>> >> > >>> >> > >>> >> > -a >>> >> > >>> >> > >>> >> > On 5 August 2015 at 12:41, Shawn Webb >>> >> > wrote: >>> >> >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >>> >> >>> Author: adrian >>> >> >>> Date: Wed Aug 5 19:32:35 2015 >>> >> >>> New Revision: 286337 >>> >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337 >>> >> >>> >>> >> >>> Log: >>> >> >>> Add TXOP enforce support to the AR9300 HAL. >>> >> >>> >>> >> >>> This is required for (more) correct TDMA support. Without it, >>> >> >>> the >>> >> >>> code tries to calculate the required guard interval based on t= he >>> >> >>> current rate, and since this is an 11n NIC and people try usin= g >>> >> >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which the= n >>> >> >>> panics. >>> >> >>> >>> >> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it >>> >> >>> have one less bug. >>> >> >>> >>> >> >>> Reported by: Berislav Purgar >>> >> >>> >>> >> >>> Modified: >>> >> >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c >>> >> >> >>> >> >> Hey Adrian, >>> >> >> >>> >> >> Can this be MFC'd? >>> >> >> >>> >> >> Thanks, >>> >> >> >>> >> >> -- >>> >> >> Shawn Webb >>> >> >> HardenedBSD >>> >> >> >>> >> >> GPG Key ID: 0x6A84658F52456EEE >>> >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 524= 5 >>> 6EEE >>> >> > _______________________________________________ >>> >> > 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" >>> >> >>> > >>> > >>> > >>> > -- >>> > Ermal >>> >> >> >> >> -- >> Ermal >> From owner-svn-src-head@freebsd.org Wed Aug 19 21:46:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 334689BEA03; Wed, 19 Aug 2015 21:46:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C584911; Wed, 19 Aug 2015 21:46:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JLkD7p058539; Wed, 19 Aug 2015 21:46:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JLkDnm058537; Wed, 19 Aug 2015 21:46:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508192146.t7JLkDnm058537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 19 Aug 2015 21:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286947 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:46:14 -0000 Author: ian Date: Wed Aug 19 21:46:12 2015 New Revision: 286947 URL: https://svnweb.freebsd.org/changeset/base/286947 Log: Add a new exit-timeout option to watchdogd. Watchdogd currently disables the watchdog when it exits, such as during rc.shutdown processing. That leaves the system vulnerable to getting hung or deadlocked during the shutdown part of a reboot. For embedded systems it's especially important that the hardware watchdog always be active. It can also be useful for servers that are administered remotely. The new -x option tells watchdogd to program the watchdog with the given timeout just before exiting. The -x value can be longer or shorter than the -t normal time value, to allow for various exceptional conditions at shutdown such as allowing extra time for buffer flushing. The exit value is also used internally in the "failsafe" handling (which used to just disable the watchdog), on the theory that if you're using this option, "safe" means having the watchdog always running, not disabled. The default is still to disable the watchdog on exit if -x is not specified. Differential Revision: https://reviews.freebsd.org/D2556 (timed out) Modified: head/usr.sbin/watchdogd/watchdogd.8 head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.8 ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.8 Wed Aug 19 21:23:17 2015 (r286946) +++ head/usr.sbin/watchdogd/watchdogd.8 Wed Aug 19 21:46:12 2015 (r286947) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2014 +.Dd May 11, 2015 .Dt WATCHDOGD 8 .Os .Sh NAME @@ -46,6 +46,7 @@ .Op Fl s Ar sleep .Op Fl t Ar timeout .Op Fl T Ar script_timeout +.Op Fl x Ar exit_timeout .Sh DESCRIPTION The .Nm @@ -103,14 +104,25 @@ defaults to the value specified by the .Fl s Ar sleep option. .Pp +The +.Fl x Ar exit_timeout +argument is the timeout period (in seconds) to leave in effect when the +program exits. +Using +.Fl x +with a non-zero value protects against lockup during a reboot by +triggering a hardware reset if the software reboot doesn't complete +before the given timeout expires. +.Pp Upon receiving the .Dv SIGTERM or .Dv SIGINT signals, .Nm -will first instruct the kernel to no longer perform watchdog checks and then -will terminate. +will terminate, after first instructing the kernel to either disable the +timeout or reset it to the value given by +.Fl x Ar exit_timeout . .Pp The .Nm Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Wed Aug 19 21:23:17 2015 (r286946) +++ head/usr.sbin/watchdogd/watchdogd.c Wed Aug 19 21:46:12 2015 (r286947) @@ -77,6 +77,7 @@ static int debugging = 0; static int end_program = 0; static const char *pidfile = _PATH_VARRUN "watchdogd.pid"; static u_int timeout = WD_TO_128SEC; +static u_int exit_timeout = WD_TO_NEVER; static u_int pretimeout = 0; static u_int timeout_sec; static u_int passive = 0; @@ -461,10 +462,10 @@ watchdog_onoff(int onoff) /* pat one more time for good measure */ return watchdog_patpat((timeout|WD_ACTIVE)); } else { - return watchdog_patpat(0); + return watchdog_patpat(exit_timeout); } failsafe: - watchdog_patpat(0); + watchdog_patpat(exit_timeout); return (error); } @@ -476,8 +477,8 @@ usage(void) { if (is_daemon) fprintf(stderr, "usage:\n" -" watchdogd [-dnSw] [-e cmd] [-I file] [-s sleep] [-t timeout]\n" -" [-T script_timeout]\n" +" watchdogd [-dnSw] [-e cmd] [-I pidfile] [-s sleep] [-t timeout]\n" +" [-T script_timeout] [-x exit_timeout]\n" " [--debug]\n" " [--pretimeout seconds] [-pretimeout-action action]\n" " [--softtimeout] [-softtimeout-action action]\n" @@ -697,7 +698,7 @@ parseargs(int argc, char *argv[]) is_daemon = 1; if (is_daemon) - getopt_shortopts = "I:de:ns:t:ST:w?"; + getopt_shortopts = "I:de:ns:t:ST:wx:?"; else getopt_shortopts = "dt:?"; @@ -741,6 +742,11 @@ parseargs(int argc, char *argv[]) case 'w': do_timedog = 1; break; + case 'x': + exit_timeout = parse_timeout_to_pow2ns(c, NULL, optarg); + if (exit_timeout != 0) + exit_timeout |= WD_ACTIVE; + break; case 0: lopt = longopts[longindex].name; if (!strcmp(lopt, "pretimeout")) { From owner-svn-src-head@freebsd.org Wed Aug 19 21:51:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8704F9BEB4D; Wed, 19 Aug 2015 21:51:27 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37815D0A; Wed, 19 Aug 2015 21:51:27 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgj62 with SMTP id 62so15542906qgj.2; Wed, 19 Aug 2015 14:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uue9y2ZRGR2ANAyj1KhymO2Dw7yPdgDs/4xSIxPsfvE=; b=GoL83a2zQxH0bA3lw8TbmIkLlb7K5GalFUdiCLj916rwsdkpoEdHtXoaohZC5Pzj4P nPyHuGeYVmhv/uVUanlG85909Gz40trShGHRVHP7C6afxJmDWeYutmqvuBbDEVEXjXp8 RTyRzDE5NKQQgRS3xDExD10ggRejVDxx93+bgPp45YXuVffQRISf0Nmcwptis/uFU4aZ hlqLChhqQszdPv0ZH+OQFS31EvosaTbczMjLnDd+hiiojBGJutaadRlmHZ6dOOezgF5G /3OWeqHB9ax+j7lk91RcilXHVlG4Ju4AsC8wCus/8vyy7Z3LXi1D0wTMhOotXav0+Wox i0Hw== X-Received: by 10.140.102.119 with SMTP id v110mr27101977qge.103.1440021086299; Wed, 19 Aug 2015 14:51:26 -0700 (PDT) Received: from mbp.home ([186.249.144.75]) by smtp.gmail.com with ESMTPSA id 108sm1123883qgz.17.2015.08.19.14.51.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Aug 2015 14:51:25 -0700 (PDT) Sender: Renato Botelho Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Renato Botelho In-Reply-To: Date: Wed, 19 Aug 2015 18:51:20 -0300 Cc: Oliver Pinter , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?utf-8?Q?Ermal_Lu=C3=A7i?= Content-Transfer-Encoding: 7bit Message-Id: <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 21:51:27 -0000 > On Aug 19, 2015, at 18:31, Adrian Chadd wrote: > > jim asked me again to do the MFC, so once I've finished doing some > more tidying up of bits and pieces I'll do the MFC. Thank you very much! -- Renato Botelho From owner-svn-src-head@freebsd.org Thu Aug 20 00:00:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9711F9BE1D8; Thu, 20 Aug 2015 00:00:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EBFB339; Thu, 20 Aug 2015 00:00:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7K00Gdi011448; Thu, 20 Aug 2015 00:00:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7K00G4m011447; Thu, 20 Aug 2015 00:00:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508200000.t7K00G4m011447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 20 Aug 2015 00:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286948 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 00:00:16 -0000 Author: cem Date: Thu Aug 20 00:00:15 2015 New Revision: 286948 URL: https://svnweb.freebsd.org/changeset/base/286948 Log: getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly Alphabetize the RLIMIT_ list while here. Reviewed by: jilles (previous version), wblock (previous version) Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3433 Modified: head/lib/libc/sys/getrlimit.2 Modified: head/lib/libc/sys/getrlimit.2 ============================================================================== --- head/lib/libc/sys/getrlimit.2 Wed Aug 19 21:46:12 2015 (r286947) +++ head/lib/libc/sys/getrlimit.2 Thu Aug 20 00:00:15 2015 (r286948) @@ -28,7 +28,7 @@ .\" @(#)getrlimit.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd August 19, 2015 .Dt GETRLIMIT 2 .Os .Sh NAME @@ -74,6 +74,8 @@ this defines how far a program may exten function. .It Dv RLIMIT_FSIZE The largest size (in bytes) file that may be created. +.It Dv RLIMIT_KQUEUES +The maximum number of kqueues this user id is allowed to create. .It Dv RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into memory using the @@ -83,12 +85,25 @@ system call. The maximum number of open files for this process. .It Dv RLIMIT_NPROC The maximum number of simultaneous processes for this user id. +.It Dv RLIMIT_NPTS +The maximum number of pseudo-terminals this user id is allowed to create. .It Dv RLIMIT_RSS -The maximum size (in bytes) to which a process's resident set size may -grow. -This imposes a limit on the amount of physical memory to be given to -a process; if memory is tight, the system will prefer to take memory -from processes that are exceeding their declared resident set size. +When there is memory pressure and swap is available, prioritize eviction of +a process' resident pages beyond this amount (in bytes). +When memory is not under pressure, this rlimit is effectively ignored. +Even when there is memory pressure, the amount of available swap space and some +sysctl settings like +.Xr vm.swap_enabled +and +.Xr vm.swap_idle_enabled +can affect what happens to processes that have exceeded this size. +.Pp +Processes that exceed their set +.Dv RLIMIT_RSS +are not signalled or halted. +The limit is merely a hint to the VM daemon to prefer to deactivate pages from +processes that have exceeded their set +.Dv RLIMIT_RSS . .It Dv RLIMIT_SBSIZE The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of @@ -106,18 +121,20 @@ sysctl is set. Please see .Xr tuning 7 for a complete description of this sysctl. -.It Dv RLIMIT_NPTS -The maximum number of pseudo-terminals created by this user id. -.It Dv RLIMIT_KQUEUES -The maximum number of kqueues created by this user id. +.It Dv RLIMIT_VMEM +An alias for +.Dv RLIMIT_AS . .El .Pp A resource limit is specified as a soft limit and a hard limit. -When a -soft limit is exceeded a process may receive a signal (for example, if -the cpu time or file size is exceeded), but it will be allowed to -continue execution until it reaches the hard limit (or modifies -its resource limit). +When a soft limit is exceeded, a process might or might not receive a signal. +For example, signals are generated when the cpu time or file size is exceeded, +but not if the address space or RSS limit is exceeded. +A program that exceeds the soft limit is allowed to continue execution until it +reaches the hard limit, or modifies its own resource limit. +Even reaching the hard limit does not necessarily halt a process. +For example, if the RSS hard limit is exceeded, nothing happens. +.Pp The .Vt rlimit structure is used to specify the hard and soft limits on a resource, @@ -170,6 +187,20 @@ the soft cpu time limit is exceeded, a s .Dv SIGXCPU is sent to the offending process. +.Pp +When most operations would allocate more virtual memory than allowed by the +soft limit of +.Dv RLIMIT_AS , +the operation fails with +.Dv ENOMEM +and no signal is raised. +A notable exception is stack extension, described above. +If stack extension would allocate more virtual memory than allowed by the soft +limit of +.Dv RLIMIT_AS , +the signal SIGSEGV will be delivered. +The caller is free to raise the soft address space limit up to the hard limit +and retry the allocation. .Sh RETURN VALUES .Rv -std .Sh ERRORS From owner-svn-src-head@freebsd.org Thu Aug 20 03:57:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1D159BE5DD; Thu, 20 Aug 2015 03:57:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C1B165B; Thu, 20 Aug 2015 03:57:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7K3vgq5009949; Thu, 20 Aug 2015 03:57:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7K3vgYR009948; Thu, 20 Aug 2015 03:57:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508200357.t7K3vgYR009948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 20 Aug 2015 03:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286949 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 03:57:42 -0000 Author: adrian Date: Thu Aug 20 03:57:41 2015 New Revision: 286949 URL: https://svnweb.freebsd.org/changeset/base/286949 Log: Remove some if_softc references from urtwn(4). The only ones that are left are in if_start, if_stop and ioctl. Tested: * urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, STA mode Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Aug 20 00:00:15 2015 (r286948) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Aug 20 03:57:41 2015 (r286949) @@ -1513,7 +1513,7 @@ urtwn_newstate(struct ieee80211vap *vap, { struct urtwn_vap *uvp = URTWN_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct urtwn_softc *sc = ic->ic_ifp->if_softc; + struct urtwn_softc *sc = ic->ic_softc; struct ieee80211_node *ni; enum ieee80211_state ostate; uint32_t reg; @@ -1989,8 +1989,8 @@ urtwn_start_locked(struct ifnet *ifp, st static int urtwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct urtwn_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct urtwn_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; @@ -2004,7 +2004,7 @@ urtwn_ioctl(struct ifnet *ifp, u_long cm case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - urtwn_init(ifp->if_softc); + urtwn_init(sc); startall = 1; } } else { @@ -3134,7 +3134,7 @@ urtwn_scan_end(struct ieee80211com *ic) static void urtwn_set_channel(struct ieee80211com *ic) { - struct urtwn_softc *sc = ic->ic_ifp->if_softc; + struct urtwn_softc *sc = ic->ic_softc; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); URTWN_LOCK(sc); @@ -3524,7 +3524,7 @@ urtwn_raw_xmit(struct ieee80211_node *ni { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct urtwn_softc *sc = ifp->if_softc; + struct urtwn_softc *sc = ic->ic_softc; struct urtwn_data *bf; /* prevent management frames from being sent if we're not ready */ From owner-svn-src-head@freebsd.org Thu Aug 20 05:13:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC74F9BE137; Thu, 20 Aug 2015 05:13:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99CF7167E; Thu, 20 Aug 2015 05:13:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7K5DvGq043420; Thu, 20 Aug 2015 05:13:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7K5DtZd043409; Thu, 20 Aug 2015 05:13:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508200513.t7K5DtZd043409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 20 Aug 2015 05:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286950 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 05:13:57 -0000 Author: adrian Date: Thu Aug 20 05:13:54 2015 New Revision: 286950 URL: https://svnweb.freebsd.org/changeset/base/286950 Log: Further conversions from ifp->if_softc -> ic_softc. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_rsu.c Thu Aug 20 05:13:54 2015 (r286950) @@ -509,8 +509,7 @@ static void rsu_scan_start(struct ieee80211com *ic) { int error; - struct ifnet *ifp = ic->ic_ifp; - struct rsu_softc *sc = ifp->if_softc; + struct rsu_softc *sc = ic->ic_softc; /* Scanning is done by the firmware. */ RSU_LOCK(sc); @@ -935,7 +934,7 @@ rsu_newstate(struct ieee80211vap *vap, e { struct rsu_vap *uvp = RSU_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct rsu_softc *sc = ic->ic_ifp->if_softc; + struct rsu_softc *sc = ic->ic_softc; struct ieee80211_node *ni; struct ieee80211_rateset *rs; enum ieee80211_state ostate; @@ -1819,6 +1818,7 @@ static int rsu_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ieee80211com *ic = ifp->if_l2com; + struct rsu_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; @@ -1826,7 +1826,7 @@ rsu_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - rsu_init(ifp->if_softc); + rsu_init(sc); startall = 1; } } else { @@ -2297,7 +2297,7 @@ rsu_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct rsu_softc *sc = ifp->if_softc; + struct rsu_softc *sc = ic->ic_softc; struct rsu_data *bf; /* prevent management frames from being sent if we're not ready */ Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_rum.c Thu Aug 20 05:13:54 2015 (r286950) @@ -595,7 +595,7 @@ rum_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct rum_softc *sc = ic->ic_ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; struct rum_vap *rvp; struct ieee80211vap *vap; @@ -711,7 +711,7 @@ rum_newstate(struct ieee80211vap *vap, e { struct rum_vap *rvp = RUM_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct rum_softc *sc = ic->ic_ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; @@ -1333,8 +1333,8 @@ rum_start(struct ifnet *ifp) static int rum_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct rum_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct rum_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int error; int startall = 0; @@ -1786,8 +1786,8 @@ rum_enable_tsf(struct rum_softc *sc) static void rum_update_slot(struct ifnet *ifp) { - struct rum_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct rum_softc *sc = ic->ic_softc; uint8_t slottime; uint32_t tmp; @@ -2189,7 +2189,7 @@ rum_raw_xmit(struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { struct ifnet *ifp = ni->ni_ic->ic_ifp; - struct rum_softc *sc = ifp->if_softc; + struct rum_softc *sc = ni->ni_ic->ic_softc; RUM_LOCK(sc); /* prevent management frames from being sent if we're not ready */ @@ -2263,7 +2263,7 @@ rum_ratectl_task(void *arg, int pending) struct ieee80211vap *vap = &rvp->vap; struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; - struct rum_softc *sc = ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; struct ieee80211_node *ni; int ok, fail; int sum, retrycnt; @@ -2293,7 +2293,7 @@ static void rum_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; - struct rum_softc *sc = ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; uint32_t tmp; RUM_LOCK(sc); @@ -2308,7 +2308,7 @@ rum_scan_start(struct ieee80211com *ic) static void rum_scan_end(struct ieee80211com *ic) { - struct rum_softc *sc = ic->ic_ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; RUM_LOCK(sc); rum_enable_tsf_sync(sc); @@ -2320,7 +2320,7 @@ rum_scan_end(struct ieee80211com *ic) static void rum_set_channel(struct ieee80211com *ic) { - struct rum_softc *sc = ic->ic_ifp->if_softc; + struct rum_softc *sc = ic->ic_softc; RUM_LOCK(sc); rum_set_chan(sc, ic->ic_curchan); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_run.c Thu Aug 20 05:13:54 2015 (r286950) @@ -894,7 +894,7 @@ run_vap_create(struct ieee80211com *ic, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ifnet *ifp = ic->ic_ifp; - struct run_softc *sc = ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct run_vap *rvp; struct ieee80211vap *vap; int i; @@ -1005,8 +1005,7 @@ run_vap_delete(struct ieee80211vap *vap) ic = vap->iv_ic; ifp = ic->ic_ifp; - - sc = ifp->if_softc; + sc = ic->ic_softc; RUN_LOCK(sc); @@ -2002,7 +2001,7 @@ run_media_change(struct ifnet *ifp) struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; const struct ieee80211_txparam *tp; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint8_t rate, ridx; int error; @@ -2048,7 +2047,7 @@ run_newstate(struct ieee80211vap *vap, e { const struct ieee80211_txparam *tp; struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct run_vap *rvp = RUN_VAP(vap); enum ieee80211_state ostate; uint32_t sta[3]; @@ -2181,7 +2180,7 @@ static void run_wme_update_cb(void *arg) { struct ieee80211com *ic = arg; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct ieee80211_wme_state *wmesp = &ic->ic_wme; int aci, error = 0; @@ -2234,7 +2233,7 @@ err: static int run_wme_update(struct ieee80211com *ic) { - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; /* sometime called wothout lock */ if (mtx_owned(&ic->ic_comlock.mtx)) { @@ -2277,7 +2276,7 @@ run_key_set_cb(void *arg) struct ieee80211vap *vap = cmdq->arg1; struct ieee80211_key *k = cmdq->k; struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct ieee80211_node *ni; uint32_t attr; uint16_t base, associd; @@ -2399,7 +2398,7 @@ run_key_set(struct ieee80211vap *vap, st const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint32_t i; i = RUN_CMDQ_GET(&sc->cmdq_store); @@ -2467,7 +2466,7 @@ static int run_key_delete(struct ieee80211vap *vap, struct ieee80211_key *k) { struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct ieee80211_key *k0; uint32_t i; @@ -2661,7 +2660,7 @@ run_newassoc_cb(void *arg) { struct run_cmdq *cmdq = arg; struct ieee80211_node *ni = cmdq->arg1; - struct run_softc *sc = ni->ni_vap->iv_ic->ic_ifp->if_softc; + struct run_softc *sc = ni->ni_vap->iv_ic->ic_softc; uint8_t wcid = cmdq->wcid; RUN_LOCK_ASSERT(sc, MA_OWNED); @@ -2679,7 +2678,7 @@ run_newassoc(struct ieee80211_node *ni, struct ieee80211_rateset *rs = &ni->ni_rates; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint8_t rate; uint8_t ridx; uint8_t wcid; @@ -3692,7 +3691,7 @@ run_raw_xmit(struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { struct ifnet *ifp = ni->ni_ic->ic_ifp; - struct run_softc *sc = ifp->if_softc; + struct run_softc *sc = ni->ni_ic->ic_softc; int error = 0; RUN_LOCK(sc); @@ -3767,8 +3766,8 @@ run_start(struct ifnet *ifp) static int run_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct run_softc *sc = ifp->if_softc; - struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ieee80211com *ic = ifp->if_l2com; + struct run_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int startall = 0; int error; @@ -4841,7 +4840,7 @@ run_set_chan(struct run_softc *sc, struc static void run_set_channel(struct ieee80211com *ic) { - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; RUN_LOCK(sc); run_set_chan(sc, ic->ic_curchan); @@ -4853,7 +4852,7 @@ run_set_channel(struct ieee80211com *ic) static void run_scan_start(struct ieee80211com *ic) { - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint32_t tmp; RUN_LOCK(sc); @@ -4873,7 +4872,7 @@ run_scan_start(struct ieee80211com *ic) static void run_scan_end(struct ieee80211com *ic) { - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; RUN_LOCK(sc); @@ -4894,7 +4893,7 @@ static void run_update_beacon(struct ieee80211vap *vap, int item) { struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct run_vap *rvp = RUN_VAP(vap); int mcast = 0; uint32_t i; @@ -4939,7 +4938,7 @@ run_update_beacon_cb(void *arg) struct ieee80211vap *vap = arg; struct run_vap *rvp = RUN_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; struct rt2860_txwi txwi; struct mbuf *m; uint16_t txwisize; @@ -4987,7 +4986,7 @@ run_update_beacon_cb(void *arg) static void run_updateprot(struct ieee80211com *ic) { - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint32_t i; i = RUN_CMDQ_GET(&sc->cmdq_store); @@ -5001,7 +5000,7 @@ static void run_updateprot_cb(void *arg) { struct ieee80211com *ic = arg; - struct run_softc *sc = ic->ic_ifp->if_softc; + struct run_softc *sc = ic->ic_softc; uint32_t tmp; tmp = RT2860_RTSTH_EN | RT2860_PROT_NAV_SHORT | RT2860_TXOP_ALLOW_ALL; @@ -5025,7 +5024,7 @@ static void run_usb_timeout_cb(void *arg) { struct ieee80211vap *vap = arg; - struct run_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct run_softc *sc = vap->iv_ic->ic_softc; RUN_LOCK_ASSERT(sc, MA_OWNED); @@ -5231,8 +5230,8 @@ static void run_updateslot_cb(void *arg) { struct ifnet *ifp = arg; - struct run_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct run_softc *sc = ic->ic_softc; uint32_t tmp; run_read(sc, RT2860_BKOFF_SLOT_CFG, &tmp); Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_uath.c Thu Aug 20 05:13:54 2015 (r286950) @@ -1559,7 +1559,7 @@ uath_ioctl(struct ifnet *ifp, u_long cmd { struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - struct uath_softc *sc = ifp->if_softc; + struct uath_softc *sc = ic->ic_softc; int error; int startall = 0; @@ -1573,7 +1573,7 @@ uath_ioctl(struct ifnet *ifp, u_long cmd case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - uath_init(ifp->if_softc); + uath_init(sc); startall = 1; } } else { @@ -1857,7 +1857,7 @@ uath_raw_xmit(struct ieee80211_node *ni, struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; struct uath_data *bf; - struct uath_softc *sc = ifp->if_softc; + struct uath_softc *sc = ic->ic_softc; /* prevent management frames from being sent if we're not ready */ if ((sc->sc_flags & UATH_FLAG_INVALID) || @@ -1908,7 +1908,7 @@ static void uath_set_channel(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; - struct uath_softc *sc = ifp->if_softc; + struct uath_softc *sc = ic->ic_softc; UATH_LOCK(sc); if ((sc->sc_flags & UATH_FLAG_INVALID) || @@ -2075,7 +2075,7 @@ uath_newstate(struct ieee80211vap *vap, int error; struct ieee80211_node *ni; struct ieee80211com *ic = vap->iv_ic; - struct uath_softc *sc = ic->ic_ifp->if_softc; + struct uath_softc *sc = ic->ic_softc; struct uath_vap *uvp = UATH_VAP(vap); DPRINTF(sc, UATH_DEBUG_STATE, Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_upgt.c Thu Aug 20 05:13:54 2015 (r286950) @@ -765,8 +765,7 @@ upgt_set_macfilter(struct upgt_softc *sc static void upgt_setup_rates(struct ieee80211vap *vap, struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct upgt_softc *sc = ifp->if_softc; + struct upgt_softc *sc = vap->iv_ic->ic_softc; const struct ieee80211_txparam *tp; /* @@ -870,7 +869,7 @@ upgt_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct upgt_softc *sc = ifp->if_softc; + struct upgt_softc *sc = ic->ic_softc; struct upgt_data *data_tx = NULL; /* prevent management frames from being sent if we're not ready */ @@ -950,7 +949,7 @@ upgt_scan_end(struct ieee80211com *ic) static void upgt_set_channel(struct ieee80211com *ic) { - struct upgt_softc *sc = ic->ic_ifp->if_softc; + struct upgt_softc *sc = ic->ic_softc; UPGT_LOCK(sc); upgt_set_chan(sc, ic->ic_curchan); @@ -1069,7 +1068,7 @@ upgt_newstate(struct ieee80211vap *vap, { struct upgt_vap *uvp = UPGT_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct upgt_softc *sc = ic->ic_ifp->if_softc; + struct upgt_softc *sc = ic->ic_softc; /* do it in a process context */ sc->sc_state = nstate; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_ural.c Thu Aug 20 05:13:54 2015 (r286950) @@ -580,7 +580,7 @@ ural_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct ural_softc *sc = ic->ic_ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; struct ural_vap *uvp; struct ieee80211vap *vap; @@ -697,7 +697,7 @@ ural_newstate(struct ieee80211vap *vap, { struct ural_vap *uvp = URAL_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct ural_softc *sc = ic->ic_ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; const struct ieee80211_txparam *tp; struct ieee80211_node *ni; struct mbuf *m; @@ -1615,7 +1615,7 @@ static void ural_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; - struct ural_softc *sc = ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; RAL_LOCK(sc); ural_write(sc, RAL_TXRX_CSR19, 0); @@ -1626,7 +1626,7 @@ ural_scan_start(struct ieee80211com *ic) static void ural_scan_end(struct ieee80211com *ic) { - struct ural_softc *sc = ic->ic_ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; RAL_LOCK(sc); ural_enable_tsf_sync(sc); @@ -1638,7 +1638,7 @@ ural_scan_end(struct ieee80211com *ic) static void ural_set_channel(struct ieee80211com *ic) { - struct ural_softc *sc = ic->ic_ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; RAL_LOCK(sc); ural_set_chan(sc, ic->ic_curchan); @@ -1819,8 +1819,8 @@ ural_enable_tsf(struct ural_softc *sc) static void ural_update_slot(struct ifnet *ifp) { - struct ural_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct ural_softc *sc = ic->ic_softc; uint16_t slottime, sifs, eifs; slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; @@ -2194,7 +2194,7 @@ ural_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct ural_softc *sc = ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; RAL_LOCK(sc); /* prevent management frames from being sent if we're not ready */ @@ -2267,7 +2267,7 @@ ural_ratectl_task(void *arg, int pending struct ieee80211vap *vap = &uvp->vap; struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; - struct ural_softc *sc = ifp->if_softc; + struct ural_softc *sc = ic->ic_softc; struct ieee80211_node *ni; int ok, fail; int sum, retrycnt; Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_urtw.c Thu Aug 20 05:13:54 2015 (r286950) @@ -1404,8 +1404,8 @@ urtw_abort_xfers(struct urtw_softc *sc) static int urtw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct urtw_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct urtw_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int error; int startall = 0; @@ -1424,7 +1424,7 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd (IFF_ALLMULTI | IFF_PROMISC)) urtw_set_multi(sc); } else { - urtw_init(ifp->if_softc); + urtw_init(sc); startall = 1; } } else { @@ -1567,7 +1567,7 @@ urtw_raw_xmit(struct ieee80211_node *ni, struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; struct urtw_data *bf; - struct urtw_softc *sc = ifp->if_softc; + struct urtw_softc *sc = ic->ic_softc; /* prevent management frames from being sent if we're not ready */ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { @@ -1615,7 +1615,7 @@ urtw_scan_end(struct ieee80211com *ic) static void urtw_set_channel(struct ieee80211com *ic) { - struct urtw_softc *sc = ic->ic_ifp->if_softc; + struct urtw_softc *sc = ic->ic_softc; struct ifnet *ifp = sc->sc_ifp; uint32_t data, orig; usb_error_t error; @@ -1862,7 +1862,7 @@ static int urtw_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211com *ic = vap->iv_ic; - struct urtw_softc *sc = ic->ic_ifp->if_softc; + struct urtw_softc *sc = ic->ic_softc; struct urtw_vap *uvp = URTW_VAP(vap); struct ieee80211_node *ni; usb_error_t error = 0; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Aug 20 03:57:41 2015 (r286949) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Aug 20 05:13:54 2015 (r286950) @@ -593,7 +593,7 @@ zyd_newstate(struct ieee80211vap *vap, e { struct zyd_vap *zvp = ZYD_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct zyd_softc *sc = ic->ic_ifp->if_softc; + struct zyd_softc *sc = ic->ic_softc; int error; DPRINTF(sc, ZYD_DEBUG_STATE, "%s: %s -> %s\n", __func__, @@ -2623,7 +2623,7 @@ zyd_raw_xmit(struct ieee80211_node *ni, { struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = ic->ic_ifp; - struct zyd_softc *sc = ifp->if_softc; + struct zyd_softc *sc = ic->ic_softc; ZYD_LOCK(sc); /* prevent management frames from being sent if we're not ready */ @@ -2659,8 +2659,8 @@ zyd_raw_xmit(struct ieee80211_node *ni, static int zyd_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct zyd_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; + struct zyd_softc *sc = ic->ic_softc; struct ifreq *ifr = (struct ifreq *) data; int error; int startall = 0; @@ -2926,7 +2926,7 @@ static void zyd_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; - struct zyd_softc *sc = ifp->if_softc; + struct zyd_softc *sc = ic->ic_softc; ZYD_LOCK(sc); /* want broadcast address while scanning */ @@ -2937,7 +2937,7 @@ zyd_scan_start(struct ieee80211com *ic) static void zyd_scan_end(struct ieee80211com *ic) { - struct zyd_softc *sc = ic->ic_ifp->if_softc; + struct zyd_softc *sc = ic->ic_softc; ZYD_LOCK(sc); /* restore previous bssid */ @@ -2948,7 +2948,7 @@ zyd_scan_end(struct ieee80211com *ic) static void zyd_set_channel(struct ieee80211com *ic) { - struct zyd_softc *sc = ic->ic_ifp->if_softc; + struct zyd_softc *sc = ic->ic_softc; ZYD_LOCK(sc); zyd_set_chan(sc, ic->ic_curchan); From owner-svn-src-head@freebsd.org Thu Aug 20 06:25:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB28F9BED30; Thu, 20 Aug 2015 06:25:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-x234.google.com (mail-pd0-x234.google.com [IPv6:2607:f8b0:400e:c02::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A622D1471; Thu, 20 Aug 2015 06:25:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pdbmi9 with SMTP id mi9so10464452pdb.3; Wed, 19 Aug 2015 23:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0r+1GIP3rMFwBfrdcBA2LUWqWtopprM0DrKpBe2j5+g=; b=AhmJEoHMzbtLGa3P0EVz81njIY0Fie/urntOJh1kmy5MkyhCxMYS3E4XuUllXRHzsC oXmFHYnAOo5of3/KwhwI25+FhtLOHMuTVCcQwCQvrW8Hjt5grbWbHwQifaNavtLAKw9q 31DbZ5VF3QBjGYG/n9g1HYtY+bTULb2/uf5bMCwE5xYIRYHmoAEPnZk08wnECzzM1+fc tdNN/hnCypiUXLmwXjOPnP0Gb8KXphpdOP04vA34AZiOqdP0VoSUWBSy2gLCvRKiE/Ir 18NPhlwZaRBFIJB8DaRlIzB26cP0wchvemghyAhEfKWggX8RXxvBWEJRRrC1t2Uku+Em RCjw== X-Received: by 10.70.47.232 with SMTP id g8mr3250544pdn.67.1440051909168; Wed, 19 Aug 2015 23:25:09 -0700 (PDT) Received: from [21.131.188.103] (m852036d0.tmodns.net. [208.54.32.133]) by smtp.gmail.com with ESMTPSA id uk6sm2971626pac.27.2015.08.19.23.25.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Aug 2015 23:25:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r286948 - head/lib/libc/sys From: Garrett Cooper X-Mailer: iPhone Mail (12H321) In-Reply-To: <201508200000.t7K00G4m011447@repo.freebsd.org> Date: Wed, 19 Aug 2015 23:25:07 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <0A04A1AE-B0EE-4C89-A29F-0B91AA67AAB2@gmail.com> References: <201508200000.t7K00G4m011447@repo.freebsd.org> To: "Conrad E. Meyer" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 06:25:10 -0000 > On Aug 19, 2015, at 17:00, Conrad E. Meyer wrote: > > Author: cem > Date: Thu Aug 20 00:00:15 2015 > New Revision: 286948 > URL: https://svnweb.freebsd.org/changeset/base/286948 > > Log: > getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly > > Alphabetize the RLIMIT_ list while here. > > Reviewed by: jilles (previous version), wblock (previous version) > Approved by: markj (mentor) > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3433 > > Modified: > head/lib/libc/sys/getrlimit.2 Should this be mfced? From owner-svn-src-head@freebsd.org Thu Aug 20 07:41:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE209BEE71; Thu, 20 Aug 2015 07:41:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B411D1A; Thu, 20 Aug 2015 07:41:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7K7fY93003209; Thu, 20 Aug 2015 07:41:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7K7fYpX003208; Thu, 20 Aug 2015 07:41:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508200741.t7K7fYpX003208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Aug 2015 07:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286951 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 07:41:35 -0000 Author: mav Date: Thu Aug 20 07:41:33 2015 New Revision: 286951 URL: https://svnweb.freebsd.org/changeset/base/286951 Log: Restore part of r274628, reverted at r286776. Submitted by: avg Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Aug 20 05:13:54 2015 (r286950) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Aug 20 07:41:33 2015 (r286951) @@ -6509,7 +6509,8 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, cdata, l2hdr->b_asize); - rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); + rounded = P2ROUNDUP(csize, + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); if (rounded > csize) { bzero((char *)cdata + csize, rounded - csize); csize = rounded; From owner-svn-src-head@freebsd.org Thu Aug 20 11:07:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E939BD927; Thu, 20 Aug 2015 11:07:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD961F2F; Thu, 20 Aug 2015 11:07:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KB7q8O087802; Thu, 20 Aug 2015 11:07:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KB7pTW087799; Thu, 20 Aug 2015 11:07:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201107.t7KB7pTW087799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 11:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286953 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 11:07:52 -0000 Author: andrew Date: Thu Aug 20 11:07:51 2015 New Revision: 286953 URL: https://svnweb.freebsd.org/changeset/base/286953 Log: Add support to libkvm for reading minidumps on arm64. The kernel side is missing until it can be cleaned up. Reviewed by: jhb Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3319 Added: head/lib/libkvm/kvm_minidump_aarch64.c (contents, props changed) Modified: head/lib/libkvm/kvm_aarch64.c head/lib/libkvm/kvm_private.h Modified: head/lib/libkvm/kvm_aarch64.c ============================================================================== --- head/lib/libkvm/kvm_aarch64.c Thu Aug 20 08:34:13 2015 (r286952) +++ head/lib/libkvm/kvm_aarch64.c Thu Aug 20 11:07:51 2015 (r286953) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (C) 2006 Bruce M. Simpson. + * Copyright (c) 2015 The FreeBSD Foundation * All rights reserved. * * This software was developed by Andrew Turner under @@ -27,38 +28,78 @@ * SUCH DAMAGE. */ +/* + * arm64 (AArch64) machine dependent routines for kvm. + */ + #include __FBSDID("$FreeBSD$"); #include +#include + +#include +#include +#include + +#include #include #include -#include #include +#include +#include #include "kvm_private.h" +/* minidump must be the first item! */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + void *mmapbase; + size_t mmapsize; +}; + void _kvm_freevtop(kvm_t *kd) { - printf("_kvm_freevtop\n"); - abort(); + if (kd->vmst != 0) { + if (kd->vmst->minidump) + return (_kvm_minidump_freevtop(kd)); + if (kd->vmst->mmapbase != NULL) + munmap(kd->vmst->mmapbase, kd->vmst->mmapsize); + free(kd->vmst); + kd->vmst = NULL; + } } int _kvm_initvtop(kvm_t *kd) { + char minihdr[8]; + + if (!kd->rawdump) { + if (pread(kd->pmfd, &minihdr, 8, 0) == 8) { + if (memcmp(&minihdr, "minidump", 8) == 0) + return (_kvm_minidump_initvtop(kd)); + } else { + _kvm_err(kd, kd->program, "cannot read header"); + return (-1); + } + } - printf("_kvm_initvtop\n"); - abort(); + _kvm_err(kd, 0, "_kvm_initvtop: Unsupported image type"); + return (-1); } int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { - printf("_kvm_kvatop\n"); - abort(); + if (kd->vmst->minidump) + return _kvm_minidump_kvatop(kd, va, pa); + + + _kvm_err(kd, 0, "_kvm_kvatop: Unsupported image type"); + return (0); } Added: head/lib/libkvm/kvm_minidump_aarch64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_aarch64.c Thu Aug 20 11:07:51 2015 (r286953) @@ -0,0 +1,269 @@ +/*- + * Copyright (c) 2006 Peter Wemm + * + * 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: src/lib/libkvm/kvm_minidump_amd64.c r261799 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ARM64 (AArch64) machine dependent routines for kvm and minidumps. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "kvm_private.h" + +struct hpte { + struct hpte *next; + vm_paddr_t pa; + int64_t off; +}; + +#define HPT_SIZE 1024 + +/* minidump must be the first item! */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + struct minidumphdr hdr; + void *hpt_head[HPT_SIZE]; + uint64_t *bitmap; + uint64_t *page_map; +}; + +static void +hpt_insert(kvm_t *kd, vm_paddr_t pa, int64_t off) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + hpte = malloc(sizeof(*hpte)); + hpte->pa = pa; + hpte->off = off; + hpte->next = kd->vmst->hpt_head[fnv]; + kd->vmst->hpt_head[fnv] = hpte; +} + +static int64_t +hpt_find(kvm_t *kd, vm_paddr_t pa) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) { + if (pa == hpte->pa) + return (hpte->off); + } + return (-1); +} + +static int +inithash(kvm_t *kd, uint64_t *base, int len, off_t off) +{ + uint64_t idx; + uint64_t bit, bits; + vm_paddr_t pa; + + for (idx = 0; idx < len / sizeof(*base); idx++) { + bits = base[idx]; + while (bits) { + bit = ffsl(bits) - 1; + bits &= ~(1ul << bit); + pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE; + hpt_insert(kd, pa, off); + off += PAGE_SIZE; + } + } + return (off); +} + +void +_kvm_minidump_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + free(vm->bitmap); + free(vm->page_map); + free(vm); + kd->vmst = NULL; +} + +int +_kvm_minidump_initvtop(kvm_t *kd) +{ + struct vmstate *vmst; + off_t off; + + vmst = _kvm_malloc(kd, sizeof(*vmst)); + if (vmst == 0) { + _kvm_err(kd, kd->program, "cannot allocate vm"); + return (-1); + } + kd->vmst = vmst; + vmst->minidump = 1; + if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != + sizeof(vmst->hdr)) { + _kvm_err(kd, kd->program, "cannot read dump header"); + return (-1); + } + if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, + sizeof(vmst->hdr.magic)) != 0) { + _kvm_err(kd, kd->program, "not a minidump for this platform"); + return (-1); + } + + if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { + _kvm_err(kd, kd->program, "wrong minidump version. " + "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); + return (-1); + } + + /* Skip header and msgbuf */ + off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize); + + vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize); + if (vmst->bitmap == NULL) { + _kvm_err(kd, kd->program, + "cannot allocate %d bytes for bitmap", + vmst->hdr.bitmapsize); + return (-1); + } + if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != + vmst->hdr.bitmapsize) { + _kvm_err(kd, kd->program, + "cannot read %d bytes for page bitmap", + vmst->hdr.bitmapsize); + return (-1); + } + off += round_page(vmst->hdr.bitmapsize); + + vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); + if (vmst->page_map == NULL) { + _kvm_err(kd, kd->program, + "cannot allocate %d bytes for page_map", + vmst->hdr.pmapsize); + return (-1); + } + /* This is the end of the dump, savecore may have truncated it. */ + if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) < + PAGE_SIZE) { + _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", + vmst->hdr.pmapsize); + } + off += vmst->hdr.pmapsize; + + /* build physical address hash table for sparse pages */ + inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off); + + return (0); +} + +static int +_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa) +{ + struct vmstate *vm; + u_long offset; + pt_entry_t l3; + u_long l3_index; + u_long a; + off_t ofs; + + vm = kd->vmst; + offset = va & PAGE_MASK; + + if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { + a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) & ~PAGE_MASK; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: " + "direct map address 0x%lx not in minidump", va); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else if (va >= vm->hdr.kernbase) { + l3_index = (va - vm->hdr.kernbase) >> L3_SHIFT; + if (l3_index >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + goto invalid; + l3 = vm->page_map[l3_index]; + if ((l3 & ATTR_DESCR_MASK) != L3_PAGE) { + _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid"); + goto invalid; + } + a = l3 & ~ATTR_MASK; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: " + "physical address 0x%lx not in minidump", a); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else { + _kvm_err(kd, kd->program, + "_kvm_vatop: virtual address 0x%lx not minidumped", va); + goto invalid; + } + +invalid: + _kvm_err(kd, 0, "invalid address (0x%lx)", va); + return (0); +} + +int +_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa) +{ + + if (ISALIVE(kd)) { + _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); + return (0); + } + return (_kvm_minidump_vatop(kd, va, pa)); +} Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Thu Aug 20 08:34:13 2015 (r286952) +++ head/lib/libkvm/kvm_private.h Thu Aug 20 11:07:51 2015 (r286953) @@ -104,8 +104,8 @@ uintptr_t _kvm_vnet_validaddr(kvm_t *, u int _kvm_dpcpu_initialized(kvm_t *, int); uintptr_t _kvm_dpcpu_validaddr(kvm_t *, uintptr_t); -#if defined(__amd64__) || defined(__i386__) || defined(__arm__) || \ - defined(__mips__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ + defined(__i386__) || defined(__mips__) void _kvm_minidump_freevtop(kvm_t *); int _kvm_minidump_initvtop(kvm_t *); int _kvm_minidump_kvatop(kvm_t *, u_long, off_t *); From owner-svn-src-head@freebsd.org Thu Aug 20 11:26:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 492CC9BDF09; Thu, 20 Aug 2015 11:26:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2A8C99; Thu, 20 Aug 2015 11:26:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KBQRPt096073; Thu, 20 Aug 2015 11:26:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KBQRhk096072; Thu, 20 Aug 2015 11:26:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201126.t7KBQRhk096072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 11:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286954 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 11:26:27 -0000 Author: andrew Date: Thu Aug 20 11:26:26 2015 New Revision: 286954 URL: https://svnweb.freebsd.org/changeset/base/286954 Log: Add the arm64 minidump header. This was missed from r286953. Added: head/sys/arm64/include/minidump.h - copied, changed from r286130, head/sys/i386/include/minidump.h Copied and modified: head/sys/arm64/include/minidump.h (from r286130, head/sys/i386/include/minidump.h) ============================================================================== --- head/sys/i386/include/minidump.h Fri Jul 31 14:17:26 2015 (r286130, copy source) +++ head/sys/arm64/include/minidump.h Thu Aug 20 11:26:26 2015 (r286954) @@ -23,13 +23,14 @@ * (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 i386: FreeBSD: 157909 2006-04-21 04:28:43Z peter * $FreeBSD$ */ #ifndef _MACHINE_MINIDUMP_H_ #define _MACHINE_MINIDUMP_H_ 1 -#define MINIDUMP_MAGIC "minidump FreeBSD/i386" +#define MINIDUMP_MAGIC "minidump FreeBSD/arm64" #define MINIDUMP_VERSION 1 struct minidumphdr { @@ -37,9 +38,11 @@ struct minidumphdr { uint32_t version; uint32_t msgbufsize; uint32_t bitmapsize; - uint32_t ptesize; - uint32_t kernbase; - uint32_t paemode; + uint32_t pmapsize; + uint64_t kernbase; + uint64_t dmapphys; + uint64_t dmapbase; + uint64_t dmapend; }; #endif /* _MACHINE_MINIDUMP_H_ */ From owner-svn-src-head@freebsd.org Thu Aug 20 12:05:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C28A9BEDE7; Thu, 20 Aug 2015 12:05:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BF463DD; Thu, 20 Aug 2015 12:05:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KC5KnM012666; Thu, 20 Aug 2015 12:05:20 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KC5IoT012658; Thu, 20 Aug 2015 12:05:18 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508201205.t7KC5IoT012658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 20 Aug 2015 12:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286955 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 12:05:20 -0000 Author: melifaro Date: Thu Aug 20 12:05:17 2015 New Revision: 286955 URL: https://svnweb.freebsd.org/changeset/base/286955 Log: * Split allocation and table linking for lle's. Before that, the logic besides lle_create() was the following: return existing if found, create if not. This behaviour was error-prone since we had to deal with 'sudden' static<>dynamic lle changes. This commit fixes bunch of different issues like: - refcount leak when lle is converted to static. Simple check case: console 1: while true; do for i in `arp -an|awk '$4~/incomp/{print$2}'|tr -d '()'`; do arp -s $i 00:22:44:66:88:00 ; arp -d $i; done; done console 2: ping -f any-dead-host-in-L2 console 3: # watch for memory consumption: vmstat -m | awk '$1~/lltable/{print$2}' - possible problems in arptimer() / nd6_timer() when dropping/reacquiring lock. New logic explicitly handles use-or-create cases in every lla_create user. Basically, most of the changes are purely mechanical. However, we explicitly avoid using existing lle's for interface/static LLE records. * While here, call lle_event handlers on all real table lle change. * Create lltable_free_entry() calling existing per-lltable lle_free_t callback for entry deletion Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet/toecore.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/net/if_llatbl.c Thu Aug 20 12:05:17 2015 (r286955) @@ -228,7 +228,7 @@ htable_prefix_free(struct lltable *llt, IF_AFDATA_WUNLOCK(llt->llt_ifp); LIST_FOREACH_SAFE(lle, &pmd.dchain, lle_chain, next) - llt->llt_free_entry(llt, lle); + lltable_free_entry(llt, lle); } static void @@ -278,10 +278,13 @@ lltable_drop_entry_queue(struct llentry } /* - * Deletes an address from the address table. - * This function is called by the timer functions - * such as arptimer() and nd6_llinfo_timer(), and - * the caller does the locking. + * + * Performes generic cleanup routines and frees lle. + * + * Called for non-linked entries, with callouts and + * other AF-specific cleanups performed. + * + * @lle must be passed WLOCK'ed * * Returns the number of held packets, if any, that were dropped. */ @@ -316,21 +319,35 @@ struct llentry * llentry_alloc(struct ifnet *ifp, struct lltable *lt, struct sockaddr_storage *dst) { - struct llentry *la; + struct llentry *la, *la_tmp; IF_AFDATA_RLOCK(ifp); la = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst); IF_AFDATA_RUNLOCK(ifp); - if ((la == NULL) && - (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { - IF_AFDATA_WLOCK(ifp); - la = lla_create(lt, 0, (struct sockaddr *)dst); - IF_AFDATA_WUNLOCK(ifp); - } if (la != NULL) { LLE_ADDREF(la); LLE_WUNLOCK(la); + return (la); + } + + if ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { + la = lltable_alloc_entry(lt, 0, (struct sockaddr *)dst); + if (la == NULL) + return (NULL); + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(la); + /* Prefer any existing LLE over newly-created one */ + la_tmp = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst); + if (la_tmp == NULL) + lltable_link_entry(lt, la); + IF_AFDATA_WUNLOCK(ifp); + if (la_tmp != NULL) { + lltable_free_entry(lt, la); + la = la_tmp; + } + LLE_ADDREF(la); + LLE_WUNLOCK(la); } return (la); @@ -483,6 +500,21 @@ lltable_foreach_lle(struct lltable *llt, return (llt->llt_foreach_entry(llt, f, farg)); } +struct llentry * +lltable_alloc_entry(struct lltable *llt, u_int flags, + const struct sockaddr *l3addr) +{ + + return (llt->llt_alloc_entry(llt, flags, l3addr)); +} + +void +lltable_free_entry(struct lltable *llt, struct llentry *lle) +{ + + llt->llt_free_entry(llt, lle); +} + void lltable_link_entry(struct lltable *llt, struct llentry *lle) { @@ -531,7 +563,7 @@ lla_rt_output(struct rt_msghdr *rtm, str struct sockaddr *dst = (struct sockaddr *)info->rti_info[RTAX_DST]; struct ifnet *ifp; struct lltable *llt; - struct llentry *lle; + struct llentry *lle, *lle_tmp; u_int laflags = 0; int error; @@ -560,13 +592,9 @@ lla_rt_output(struct rt_msghdr *rtm, str switch (rtm->rtm_type) { case RTM_ADD: /* Add static LLE */ - IF_AFDATA_WLOCK(ifp); - lle = lla_create(llt, 0, dst); - if (lle == NULL) { - IF_AFDATA_WUNLOCK(ifp); + lle = lltable_alloc_entry(llt, 0, dst); + if (lle == NULL) return (ENOMEM); - } - bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); if ((rtm->rtm_flags & RTF_ANNOUNCE)) @@ -589,8 +617,39 @@ lla_rt_output(struct rt_msghdr *rtm, str } else lle->la_expire = rtm->rtm_rmx.rmx_expire; laflags = lle->la_flags; - LLE_WUNLOCK(lle); + + /* Try to link new entry */ + lle_tmp = NULL; + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + lle_tmp = lla_lookup(llt, LLE_EXCLUSIVE, dst); + if (lle_tmp != NULL) { + /* Check if we are trying to replace immutable entry */ + if ((lle_tmp->la_flags & LLE_IFADDR) != 0) { + IF_AFDATA_WUNLOCK(ifp); + LLE_WUNLOCK(lle_tmp); + lltable_free_entry(llt, lle); + return (EPERM); + } + /* Unlink existing entry from table */ + lltable_unlink_entry(llt, lle_tmp); + } + lltable_link_entry(llt, lle); IF_AFDATA_WUNLOCK(ifp); + + if (lle_tmp != NULL) { + EVENTHANDLER_INVOKE(lle_event, lle_tmp,LLENTRY_EXPIRED); + lltable_free_entry(llt, lle_tmp); + } + + /* + * By invoking LLE handler here we might get + * two events on static LLE entry insertion + * in routing socket. However, since we might have + * other subscribers we need to generate this event. + */ + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_RESOLVED); + LLE_WUNLOCK(lle); #ifdef INET /* gratuitous ARP */ if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/net/if_llatbl.h Thu Aug 20 12:05:17 2015 (r286955) @@ -133,7 +133,7 @@ struct llentry { typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); -typedef struct llentry *(llt_create_t)(struct lltable *, u_int flags, +typedef struct llentry *(llt_alloc_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); typedef int (llt_delete_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); @@ -161,7 +161,7 @@ struct lltable { struct ifnet *llt_ifp; llt_lookup_t *llt_lookup; - llt_create_t *llt_create; + llt_alloc_t *llt_alloc_entry; llt_delete_t *llt_delete; llt_prefix_free_t *llt_prefix_free; llt_dump_entry_t *llt_dump_entry; @@ -209,8 +209,9 @@ struct llentry *llentry_alloc(struct if /* helper functions */ size_t lltable_drop_entry_queue(struct llentry *); -struct llentry *lltable_create_lle(struct lltable *llt, u_int flags, - const void *paddr); +struct llentry *lltable_alloc_entry(struct lltable *llt, u_int flags, + const struct sockaddr *l4addr); +void lltable_free_entry(struct lltable *llt, struct llentry *lle); void lltable_link_entry(struct lltable *llt, struct llentry *lle); void lltable_unlink_entry(struct lltable *llt, struct llentry *lle); void lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa); @@ -229,13 +230,6 @@ lla_lookup(struct lltable *llt, u_int fl return (llt->llt_lookup(llt, flags, l3addr)); } -static __inline struct llentry * -lla_create(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) -{ - - return (llt->llt_create(llt, flags, l3addr)); -} - static __inline int lla_delete(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet/if_ether.c Thu Aug 20 12:05:17 2015 (r286955) @@ -218,8 +218,8 @@ arptimer(void *arg) /* Guard against race with other llentry_free(). */ if (lle->la_flags & LLE_LINKED) { - size_t pkts_dropped; + size_t pkts_dropped; LLE_REMREF(lle); pkts_dropped = llentry_free(lle); ARPSTAT_ADD(dropped, pkts_dropped); @@ -323,7 +323,7 @@ static int arpresolve_full(struct ifnet *ifp, int is_gw, int create, struct mbuf *m, const struct sockaddr *dst, u_char *desten, uint32_t *pflags) { - struct llentry *la = NULL; + struct llentry *la = NULL, *la_tmp; struct mbuf *curr = NULL; struct mbuf *next = NULL; int error, renew; @@ -337,16 +337,28 @@ arpresolve_full(struct ifnet *ifp, int i IF_AFDATA_RUNLOCK(ifp); } if (la == NULL && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { - create = 1; + la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); + if (la == NULL) { + log(LOG_DEBUG, + "arpresolve: can't allocate llinfo for %s on %s\n", + inet_ntoa(SIN(dst)->sin_addr), if_name(ifp)); + m_freem(m); + return (EINVAL); + } + IF_AFDATA_WLOCK(ifp); - la = lla_create(LLTABLE(ifp), 0, dst); + LLE_WLOCK(la); + la_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); + /* Prefer ANY existing lle over newly-created one */ + if (la_tmp == NULL) + lltable_link_entry(LLTABLE(ifp), la); IF_AFDATA_WUNLOCK(ifp); + if (la_tmp != NULL) { + lltable_free_entry(LLTABLE(ifp), la); + la = la_tmp; + } } if (la == NULL) { - if (create != 0) - log(LOG_DEBUG, - "arpresolve: can't allocate llinfo for %s on %s\n", - inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); m_freem(m); return (EINVAL); } @@ -608,7 +620,7 @@ in_arpinput(struct mbuf *m) struct rm_priotracker in_ifa_tracker; struct arphdr *ah; struct ifnet *ifp = m->m_pkthdr.rcvif; - struct llentry *la = NULL; + struct llentry *la = NULL, *la_tmp; struct rtentry *rt; struct ifaddr *ifa; struct in_ifaddr *ia; @@ -620,6 +632,7 @@ in_arpinput(struct mbuf *m) int bridged = 0, is_bridge = 0; int carped; struct sockaddr_in sin; + struct sockaddr *dst; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr.s_addr = 0; @@ -778,8 +791,9 @@ match: sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr = isaddr; + dst = (struct sockaddr *)&sin; IF_AFDATA_RLOCK(ifp); - la = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, (struct sockaddr *)&sin); + la = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); IF_AFDATA_RUNLOCK(ifp); if (la != NULL) arp_check_update_lle(ah, isaddr, ifp, bridged, la); @@ -788,15 +802,47 @@ match: * Reply to our address, but no lle exists yet. * do we really have to create an entry? */ + la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); + if (la == NULL) + goto drop; + arp_update_lle(ah, ifp, la); + IF_AFDATA_WLOCK(ifp); - la = lla_create(LLTABLE(ifp), 0, (struct sockaddr *)&sin); - if (la != NULL) - arp_update_lle(ah, ifp, la); + LLE_WLOCK(la); + la_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); + + /* + * Check if lle still does not exists. + * If it does, that means that we either + * 1) have configured it explicitly, via + * 1a) 'arp -s' static entry or + * 1b) interface address static record + * or + * 2) it was the result of sending first packet to-host + * or + * 3) it was another arp reply packet we handled in + * different thread. + * + * In all cases except 3) we definitely need to prefer + * existing lle. For the sake of simplicity, prefer any + * existing lle over newly-create one. + */ + if (la_tmp == NULL) + lltable_link_entry(LLTABLE(ifp), la); IF_AFDATA_WUNLOCK(ifp); - if (la != NULL) { + + if (la_tmp == NULL) { arp_mark_lle_reachable(la); LLE_WUNLOCK(la); + } else { + /* Free newly-create entry and handle packet */ + lltable_free_entry(LLTABLE(ifp), la); + la = la_tmp; + la_tmp = NULL; + arp_check_update_lle(ah, isaddr, ifp, bridged, la); + /* arp_check_update_lle() returns @la unlocked */ } + la = NULL; } reply: if (op != ARPOP_REQUEST) @@ -1044,30 +1090,53 @@ arp_mark_lle_reachable(struct llentry *l void arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) { - struct llentry *lle; + struct llentry *lle, *lle_tmp; + struct sockaddr_in *dst_in; + struct sockaddr *dst; if (ifa->ifa_carp != NULL) return; - if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) { - arprequest(ifp, &IA_SIN(ifa)->sin_addr, - &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); - /* - * interface address is considered static entry - * because the output of the arp utility shows - * that L2 entry as permanent - */ - IF_AFDATA_LOCK(ifp); - lle = lla_create(LLTABLE(ifp), LLE_IFADDR | LLE_STATIC, - (struct sockaddr *)IA_SIN(ifa)); - IF_AFDATA_UNLOCK(ifp); - if (lle == NULL) - log(LOG_INFO, "arp_ifinit: cannot create arp " - "entry for interface address\n"); - else - LLE_WUNLOCK(lle); - } ifa->ifa_rtrequest = NULL; + + dst_in = IA_SIN(ifa); + dst = (struct sockaddr *)dst_in; + + if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) == INADDR_ANY) + return; + + arprequest(ifp, &IA_SIN(ifa)->sin_addr, + &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); + + /* + * Interface address LLE record is considered static + * because kernel code relies on LLE_STATIC flag to check + * if these entries can be rewriten by arp updates. + */ + lle = lltable_alloc_entry(LLTABLE(ifp), LLE_IFADDR | LLE_STATIC, dst); + if (lle == NULL) { + log(LOG_INFO, "arp_ifinit: cannot create arp " + "entry for interface address\n"); + return; + } + + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + /* Unlink any entry if exists */ + lle_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); + if (lle_tmp != NULL) + lltable_unlink_entry(LLTABLE(ifp), lle_tmp); + + lltable_link_entry(LLTABLE(ifp), lle); + IF_AFDATA_WUNLOCK(ifp); + + if (lle_tmp != NULL) + EVENTHANDLER_INVOKE(lle_event, lle_tmp, LLENTRY_EXPIRED); + + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_RESOLVED); + LLE_WUNLOCK(lle); + if (lle_tmp != NULL) + lltable_free_entry(LLTABLE(ifp), lle_tmp); } void Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet/in.c Thu Aug 20 12:05:17 2015 (r286955) @@ -1202,25 +1202,15 @@ in_lltable_delete(struct lltable *llt, u } static struct llentry * -in_lltable_create(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) +in_lltable_alloc(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; - IF_AFDATA_WLOCK_ASSERT(ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - lle = in_lltable_find_dst(llt, sin->sin_addr); - - if (lle != NULL) { - LLE_WLOCK(lle); - return (lle); - } - - /* no existing record, we need to create new one */ - /* * A route that covers the given address must have * been installed 1st because we are doing a resolution, @@ -1241,9 +1231,6 @@ in_lltable_create(struct lltable *llt, u lle->la_flags |= (LLE_VALID | LLE_STATIC); } - lltable_link_entry(llt, lle); - LLE_WLOCK(lle); - return (lle); } @@ -1346,7 +1333,7 @@ in_lltattach(struct ifnet *ifp) llt->llt_ifp = ifp; llt->llt_lookup = in_lltable_lookup; - llt->llt_create = in_lltable_create; + llt->llt_alloc_entry = in_lltable_alloc; llt->llt_delete = in_lltable_delete; llt->llt_dump_entry = in_lltable_dump_entry; llt->llt_hash = in_lltable_hash; Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet/toecore.c Thu Aug 20 12:05:17 2015 (r286955) @@ -456,7 +456,7 @@ toe_route_redirect_event(void *arg __unu static int toe_nd6_resolve(struct ifnet *ifp, struct sockaddr *sa, uint8_t *lladdr) { - struct llentry *lle; + struct llentry *lle, *lle_tmp; struct sockaddr_in6 *sin6 = (void *)sa; int rc, flags = 0; @@ -465,19 +465,32 @@ restart: lle = lla_lookup(LLTABLE6(ifp), flags, sa); IF_AFDATA_RUNLOCK(ifp); if (lle == NULL) { - IF_AFDATA_LOCK(ifp); - lle = nd6_create(&sin6->sin6_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + lle = nd6_alloc(&sin6->sin6_addr, 0, ifp); if (lle == NULL) return (ENOMEM); /* Couldn't create entry in cache. */ lle->ln_state = ND6_LLINFO_INCOMPLETE; - nd6_llinfo_settimer_locked(lle, - (long)ND_IFINFO(ifp)->retrans * hz / 1000); - LLE_WUNLOCK(lle); + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + lle_tmp = nd6_lookup(&sin6->sin6_addr, ND6_EXCLUSIVE, ifp); + /* Prefer any existing lle over newly-created one */ + if (lle_tmp == NULL) + lltable_link_entry(LLTABLE6(ifp), lle); + IF_AFDATA_WUNLOCK(ifp); + if (lle_tmp == NULL) { + /* Arm timer for newly-created entry and send NS */ + nd6_llinfo_settimer_locked(lle, + (long)ND_IFINFO(ifp)->retrans * hz / 1000); + LLE_WUNLOCK(lle); - nd6_ns_output(ifp, NULL, &sin6->sin6_addr, NULL, 0); + nd6_ns_output(ifp, NULL, &sin6->sin6_addr, NULL, 0); - return (EWOULDBLOCK); + return (EWOULDBLOCK); + } else { + /* Drop newly-created lle and switch to existing one */ + lltable_free_entry(LLTABLE6(ifp), lle); + lle = lle_tmp; + lle_tmp = NULL; + } } if (lle->ln_state == ND6_LLINFO_STALE) { Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet6/in6.c Thu Aug 20 12:05:17 2015 (r286955) @@ -2239,24 +2239,16 @@ in6_lltable_delete(struct lltable *llt, } static struct llentry * -in6_lltable_create(struct lltable *llt, u_int flags, +in6_lltable_alloc(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; - IF_AFDATA_WLOCK_ASSERT(ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); - lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); - - if (lle != NULL) { - LLE_WLOCK(lle); - return (lle); - } - /* * A route that covers the given address must have * been installed 1st because we are doing a resolution, @@ -2277,9 +2269,6 @@ in6_lltable_create(struct lltable *llt, lle->la_flags |= (LLE_VALID | LLE_STATIC); } - lltable_link_entry(llt, lle); - LLE_WLOCK(lle); - return (lle); } @@ -2382,7 +2371,7 @@ in6_lltattach(struct ifnet *ifp) llt->llt_ifp = ifp; llt->llt_lookup = in6_lltable_lookup; - llt->llt_create = in6_lltable_create; + llt->llt_alloc_entry = in6_lltable_alloc; llt->llt_delete = in6_lltable_delete; llt->llt_dump_entry = in6_lltable_dump_entry; llt->llt_hash = in6_lltable_hash; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet6/nd6.c Thu Aug 20 12:05:17 2015 (r286955) @@ -939,12 +939,8 @@ nd6_lookup(struct in6_addr *addr6, int f return (ln); } -/* - * the caller acquires and releases the lock on the lltbls - * Returns the llentry wlocked - */ struct llentry * -nd6_create(struct in6_addr *addr6, int flags, struct ifnet *ifp) +nd6_alloc(struct in6_addr *addr6, int flags, struct ifnet *ifp) { struct sockaddr_in6 sin6; struct llentry *ln; @@ -954,9 +950,7 @@ nd6_create(struct in6_addr *addr6, int f sin6.sin6_family = AF_INET6; sin6.sin6_addr = *addr6; - IF_AFDATA_WLOCK_ASSERT(ifp); - - ln = lla_create(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6); + ln = lltable_alloc_entry(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6); if (ln != NULL) ln->ln_state = ND6_LLINFO_NOSTATE; @@ -1640,7 +1634,7 @@ struct llentry * nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, int lladdrlen, int type, int code) { - struct llentry *ln = NULL; + struct llentry *ln = NULL, *ln_tmp; int is_newentry; int do_update; int olladdr; @@ -1674,22 +1668,33 @@ nd6_cache_lladdr(struct ifnet *ifp, stru IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(from, flags, ifp); IF_AFDATA_RUNLOCK(ifp); + is_newentry = 0; if (ln == NULL) { flags |= ND6_EXCLUSIVE; - IF_AFDATA_LOCK(ifp); - ln = nd6_create(from, 0, ifp); - IF_AFDATA_UNLOCK(ifp); - is_newentry = 1; - } else { - /* do nothing if static ndp is set */ - if (ln->la_flags & LLE_STATIC) { + ln = nd6_alloc(from, 0, ifp); + if (ln == NULL) + return (NULL); + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(ln); + /* Prefer any existing lle over newly-created one */ + ln_tmp = nd6_lookup(from, ND6_EXCLUSIVE, ifp); + if (ln_tmp == NULL) + lltable_link_entry(LLTABLE6(ifp), ln); + IF_AFDATA_WUNLOCK(ifp); + if (ln_tmp == NULL) + /* No existing lle, mark as new entry */ + is_newentry = 1; + else { + lltable_free_entry(LLTABLE6(ifp), ln); + ln = ln_tmp; + ln_tmp = NULL; + } + } + /* do nothing if static ndp is set */ + if ((ln->la_flags & LLE_STATIC)) { static_route = 1; goto done; - } - is_newentry = 0; } - if (ln == NULL) - return (NULL); olladdr = (ln->la_flags & LLE_VALID) ? 1 : 0; if (olladdr && lladdr) { @@ -2032,7 +2037,7 @@ static int nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m, struct sockaddr_in6 *dst) { - struct llentry *lle = NULL; + struct llentry *lle = NULL, *lle_tmp; KASSERT(m != NULL, ("NULL mbuf, nothing to send")); /* discard the packet if IPv6 operation is disabled on the interface */ @@ -2063,19 +2068,35 @@ nd6_output_lle(struct ifnet *ifp, struct * the condition below is not very efficient. But we believe * it is tolerable, because this should be a rare case. */ - IF_AFDATA_LOCK(ifp); - lle = nd6_create(&dst->sin6_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + lle = nd6_alloc(&dst->sin6_addr, 0, ifp); + if (lle == NULL) { + char ip6buf[INET6_ADDRSTRLEN]; + log(LOG_DEBUG, + "nd6_output: can't allocate llinfo for %s " + "(ln=%p)\n", + ip6_sprintf(ip6buf, &dst->sin6_addr), lle); + m_freem(m); + return (ENOBUFS); + } + lle->ln_state = ND6_LLINFO_NOSTATE; + + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + /* Prefer any existing entry over newly-created one */ + lle_tmp = nd6_lookup(&dst->sin6_addr, ND6_EXCLUSIVE, ifp); + if (lle_tmp == NULL) + lltable_link_entry(LLTABLE6(ifp), lle); + IF_AFDATA_WUNLOCK(ifp); + if (lle_tmp != NULL) { + lltable_free_entry(LLTABLE6(ifp), lle); + lle = lle_tmp; + lle_tmp = NULL; + } } } if (lle == NULL) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0 && !(ND_IFINFO(ifp)->flags & ND6_IFF_PERFORMNUD)) { - char ip6buf[INET6_ADDRSTRLEN]; - log(LOG_DEBUG, - "nd6_output: can't allocate llinfo for %s " - "(ln=%p)\n", - ip6_sprintf(ip6buf, &dst->sin6_addr), lle); m_freem(m); return (ENOBUFS); } @@ -2241,24 +2262,40 @@ int nd6_add_ifa_lle(struct in6_ifaddr *ia) { struct ifnet *ifp; - struct llentry *ln; + struct llentry *ln, *ln_tmp; + struct sockaddr *dst; ifp = ia->ia_ifa.ifa_ifp; if (nd6_need_cache(ifp) == 0) return (0); - IF_AFDATA_LOCK(ifp); + ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; - ln = lla_create(LLTABLE6(ifp), LLE_IFADDR, - (struct sockaddr *)&ia->ia_addr); - IF_AFDATA_UNLOCK(ifp); - if (ln != NULL) { - ln->la_expire = 0; /* for IPv6 this means permanent */ - ln->ln_state = ND6_LLINFO_REACHABLE; - LLE_WUNLOCK(ln); - return (0); - } + dst = (struct sockaddr *)&ia->ia_addr; + ln = lltable_alloc_entry(LLTABLE6(ifp), LLE_IFADDR, dst); + if (ln == NULL) + return (ENOBUFS); - return (ENOBUFS); + ln->la_expire = 0; /* for IPv6 this means permanent */ + ln->ln_state = ND6_LLINFO_REACHABLE; + + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(ln); + /* Unlink any entry if exists */ + ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_EXCLUSIVE, dst); + if (ln_tmp != NULL) + lltable_unlink_entry(LLTABLE6(ifp), ln_tmp); + lltable_link_entry(LLTABLE6(ifp), ln); + IF_AFDATA_WUNLOCK(ifp); + + if (ln_tmp != NULL) + EVENTHANDLER_INVOKE(lle_event, ln_tmp, LLENTRY_EXPIRED); + EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); + + LLE_WUNLOCK(ln); + if (ln_tmp != NULL) + llentry_free(ln_tmp); + + return (0); } /* Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Aug 20 11:26:26 2015 (r286954) +++ head/sys/netinet6/nd6.h Thu Aug 20 12:05:17 2015 (r286955) @@ -407,7 +407,7 @@ void nd6_option_init(void *, int, union struct nd_opt_hdr *nd6_option(union nd_opts *); int nd6_options(union nd_opts *); struct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *); -struct llentry *nd6_create(struct in6_addr *, int, struct ifnet *); +struct llentry *nd6_alloc(struct in6_addr *, int, struct ifnet *); void nd6_setmtu(struct ifnet *); void nd6_llinfo_settimer(struct llentry *, long); void nd6_llinfo_settimer_locked(struct llentry *, long); From owner-svn-src-head@freebsd.org Thu Aug 20 12:05:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF8A9BEE47; Thu, 20 Aug 2015 12:05:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E980F7A8; Thu, 20 Aug 2015 12:05:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KC5hMC012730; Thu, 20 Aug 2015 12:05:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KC5hVE012728; Thu, 20 Aug 2015 12:05:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201205.t7KC5hVE012728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 12:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286956 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 12:05:44 -0000 Author: andrew Date: Thu Aug 20 12:05:42 2015 New Revision: 286956 URL: https://svnweb.freebsd.org/changeset/base/286956 Log: Add pmap_get_tables to get the page tables for a given virtual address. This will be used for minidump support. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pmap.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Aug 20 12:05:17 2015 (r286955) +++ head/sys/arm64/arm64/pmap.c Thu Aug 20 12:05:42 2015 (r286956) @@ -314,6 +314,40 @@ pmap_l3(pmap_t pmap, vm_offset_t va) return (pmap_l2_to_l3(l2, va)); } +bool +pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l1, pd_entry_t **l2, + pt_entry_t **l3) +{ + pd_entry_t *l1p, *l2p; + + if (pmap->pm_l1 == NULL) + return (false); + + l1p = pmap_l1(pmap, va); + *l1 = l1p; + + if ((*l1p & ATTR_DESCR_MASK) == L1_BLOCK) { + *l2 = NULL; + *l3 = NULL; + return (true); + } + + if ((*l1p & ATTR_DESCR_MASK) != L1_TABLE) + return (false); + + l2p = pmap_l1_to_l2(l1p, va); + *l2 = l2p; + + if ((*l2p & ATTR_DESCR_MASK) == L2_BLOCK) { + *l3 = NULL; + return (true); + } + + *l3 = pmap_l2_to_l3(l2p, va); + + return (true); +} + /* * These load the old table data and store the new value. * They need to be atomic as the System MMU may write to the table at Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Thu Aug 20 12:05:17 2015 (r286955) +++ head/sys/arm64/include/pmap.h Thu Aug 20 12:05:42 2015 (r286956) @@ -149,6 +149,9 @@ void pmap_unmapbios(vm_offset_t, vm_size boolean_t pmap_map_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t); void pmap_unmap_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t); +bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, + pt_entry_t **); + #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Thu Aug 20 12:07:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852E29BEED7; Thu, 20 Aug 2015 12:07:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75C84975; Thu, 20 Aug 2015 12:07:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KC7jlq012854; Thu, 20 Aug 2015 12:07:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KC7jD9012852; Thu, 20 Aug 2015 12:07:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201207.t7KC7jD9012852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 12:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286957 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 12:07:45 -0000 Author: andrew Date: Thu Aug 20 12:07:44 2015 New Revision: 286957 URL: https://svnweb.freebsd.org/changeset/base/286957 Log: Remove pmap_kenter from pmap.h, the function doesn't exist. Modified: head/sys/arm64/include/md_var.h head/sys/arm64/include/pmap.h Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Thu Aug 20 12:05:42 2015 (r286956) +++ head/sys/arm64/include/md_var.h Thu Aug 20 12:07:44 2015 (r286957) @@ -36,9 +36,14 @@ extern long Maxmem; extern char sigcode[]; extern int szsigcode; +extern uint64_t *vm_page_dump; +extern int vm_page_dump_size; struct dumperinfo; -int minidumpsys(struct dumperinfo *); + void busdma_swi(void); +void dump_add_page(vm_paddr_t); +void dump_drop_page(vm_paddr_t); +int minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Thu Aug 20 12:05:42 2015 (r286956) +++ head/sys/arm64/include/pmap.h Thu Aug 20 12:07:44 2015 (r286957) @@ -135,7 +135,6 @@ extern vm_offset_t virtual_end; ((((va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE) void pmap_bootstrap(vm_offset_t, vm_paddr_t, vm_size_t); -void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); From owner-svn-src-head@freebsd.org Thu Aug 20 12:49:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F4E39BDA26; Thu, 20 Aug 2015 12:49:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4E71DEB; Thu, 20 Aug 2015 12:49:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KCnwtY029506; Thu, 20 Aug 2015 12:49:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KCnvZV029502; Thu, 20 Aug 2015 12:49:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201249.t7KCnvZV029502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 12:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286958 - in head/sys: arm64/arm64 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 12:49:58 -0000 Author: andrew Date: Thu Aug 20 12:49:56 2015 New Revision: 286958 URL: https://svnweb.freebsd.org/changeset/base/286958 Log: Add the kernel support for minidumps on arm64. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3318 Modified: head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/arm64/uma_machdep.c head/sys/vm/vm_page.c Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Thu Aug 20 12:07:44 2015 (r286957) +++ head/sys/arm64/arm64/minidump_machdep.c Thu Aug 20 12:49:56 2015 (r286958) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2006 Peter Wemm * Copyright (c) 2015 The FreeBSD Foundation * All rights reserved. * @@ -8,6 +9,7 @@ * 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 @@ -32,19 +34,434 @@ __FBSDID("$FreeBSD$"); #include "opt_watchdog.h" +#include "opt_watchdog.h" + #include #include #include +#include #include #include +#include +#include + +#include +#include +#include +#include +#include #include +#include +#include +#include +#include + +CTASSERT(sizeof(struct kerneldumpheader) == 512); + +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +uint64_t *vm_page_dump; +int vm_page_dump_size; + +static struct kerneldumpheader kdh; +static off_t dumplo; + +/* Handle chunked writes. */ +static size_t fragsz; +static void *dump_va; +static size_t counter, progress, dumpsize; + +static uint64_t tmpbuffer[PAGE_SIZE / sizeof(uint64_t)]; + +CTASSERT(sizeof(*vm_page_dump) == 8); + +static int +is_dumpable(vm_paddr_t pa) +{ + vm_page_t m; + int i; + + if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) + return ((m->flags & PG_NODUMP) == 0); + for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) + return (1); + } + return (0); +} + +static int +blk_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = dump_write(di, dump_va, 0, dumplo, fragsz); + dumplo += fragsz; + fragsz = 0; + return (error); +} + +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < nitems(progress_track); i++) { + if (sofar < progress_track[i].min_per || + sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + +static int +blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) +{ + size_t len; + int error, c; + u_int maxdumpsz; + + maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); + if (maxdumpsz == 0) /* seatbelt */ + maxdumpsz = PAGE_SIZE; + error = 0; + if ((sz % PAGE_SIZE) != 0) { + printf("size not page aligned\n"); + return (EINVAL); + } + if (ptr != NULL && pa != 0) { + printf("cant have both va and pa!\n"); + return (EINVAL); + } + if ((((uintptr_t)pa) % PAGE_SIZE) != 0) { + printf("address not page aligned %p\n", ptr); + return (EINVAL); + } + if (ptr != NULL) { + /* + * If we're doing a virtual dump, flush any + * pre-existing pa pages. + */ + error = blk_flush(di); + if (error) + return (error); + } + while (sz) { + len = maxdumpsz - fragsz; + if (len > sz) + len = sz; + counter += len; + progress -= len; + if (counter >> 22) { + report_progress(progress, dumpsize); + counter &= (1 << 22) - 1; + } + + wdog_kern_pat(WD_LASTVAL); + + if (ptr) { + error = dump_write(di, ptr, 0, dumplo, len); + if (error) + return (error); + dumplo += len; + ptr += len; + sz -= len; + } else { + dump_va = (void *)PHYS_TO_DMAP(pa); + fragsz += len; + pa += len; + sz -= len; + error = blk_flush(di); + if (error) + return (error); + } + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + + return (0); +} int minidumpsys(struct dumperinfo *di) { + pd_entry_t *l1, *l2; + pt_entry_t *l3; + uint32_t pmapsize; + vm_offset_t va; + vm_paddr_t pa; + int error; + uint64_t bits; + int i, bit; + int retry_count; + struct minidumphdr mdhdr; + + retry_count = 0; + retry: + retry_count++; + error = 0; + pmapsize = 0; + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { + pmapsize += PAGE_SIZE; + if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) + continue; + + /* We should always be using the l2 table for kvm */ + if (l2 == NULL) + continue; + + if ((*l2 & ATTR_DESCR_MASK) == L2_BLOCK) { + pa = *l2 & ~ATTR_MASK; + for (i = 0; i < Ln_ENTRIES; i++, pa += PAGE_SIZE) { + if (is_dumpable(pa)) + dump_add_page(pa); + } + } else if ((*l2 & ATTR_DESCR_MASK) == L2_TABLE) { + for (i = 0; i < Ln_ENTRIES; i++) { + if ((l3[i] & ATTR_DESCR_MASK) != L3_PAGE) + continue; + pa = l3[i] & ~ATTR_MASK; + if (is_dumpable(pa)) + dump_add_page(pa); + } + } + } + + /* Calculate dump size. */ + dumpsize = pmapsize; + dumpsize += round_page(msgbufp->msg_size); + dumpsize += round_page(vm_page_dump_size); + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffsl(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + /* Clear out undumpable pages now if needed */ + if (is_dumpable(pa)) + dumpsize += PAGE_SIZE; + else + dump_drop_page(pa); + bits &= ~(1ul << bit); + } + } + dumpsize += PAGE_SIZE; + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = E2BIG; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + progress = dumpsize; + + /* Initialize mdhdr */ + bzero(&mdhdr, sizeof(mdhdr)); + strcpy(mdhdr.magic, MINIDUMP_MAGIC); + mdhdr.version = MINIDUMP_VERSION; + mdhdr.msgbufsize = msgbufp->msg_size; + mdhdr.bitmapsize = vm_page_dump_size; + mdhdr.pmapsize = pmapsize; + mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS; + mdhdr.dmapphys = DMAP_MIN_PHYSADDR; + mdhdr.dmapbase = DMAP_MIN_ADDRESS; + mdhdr.dmapend = DMAP_MAX_ADDRESS; + + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AARCH64_VERSION, + dumpsize, di->blocksize); + + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); + + /* Dump leader */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump my header */ + bzero(&tmpbuffer, sizeof(tmpbuffer)); + bcopy(&mdhdr, &tmpbuffer, sizeof(mdhdr)); + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + + /* Dump msgbuf up front */ + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, + round_page(msgbufp->msg_size)); + if (error) + goto fail; + + /* Dump bitmap */ + error = blk_write(di, (char *)vm_page_dump, 0, + round_page(vm_page_dump_size)); + if (error) + goto fail; + + /* Dump kernel page directory pages */ + bzero(&tmpbuffer, sizeof(tmpbuffer)); + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += L2_SIZE) { + if (!pmap_get_tables(pmap_kernel(), va, &l1, &l2, &l3)) { + /* We always write a page, even if it is zero */ + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + /* flush, in case we reuse tmpbuffer in the same block*/ + error = blk_flush(di); + if (error) + goto fail; + } else if (l2 == NULL) { + pa = (*l1 & ~ATTR_MASK) | (va & L1_OFFSET); - printf("minidumpsys\n"); - while (1); + /* Generate fake l3 entries based upon the l1 entry */ + for (i = 0; i < Ln_ENTRIES; i++) { + tmpbuffer[i] = pa + (i * PAGE_SIZE) | + ATTR_DEFAULT | L3_PAGE; + } + /* We always write a page, even if it is zero */ + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + /* flush, in case we reuse tmpbuffer in the same block*/ + error = blk_flush(di); + if (error) + goto fail; + bzero(&tmpbuffer, sizeof(tmpbuffer)); + } else if ((*l2 & ATTR_DESCR_MASK) == L2_BLOCK) { + /* TODO: Handle an invalid L2 entry */ + pa = (*l2 & ~ATTR_MASK) | (va & L2_OFFSET); + + /* Generate fake l3 entries based upon the l1 entry */ + for (i = 0; i < Ln_ENTRIES; i++) { + tmpbuffer[i] = pa + (i * PAGE_SIZE) | + ATTR_DEFAULT | L3_PAGE; + } + /* We always write a page, even if it is zero */ + error = blk_write(di, (char *)&tmpbuffer, 0, PAGE_SIZE); + if (error) + goto fail; + /* flush, in case we reuse fakepd in the same block */ + error = blk_flush(di); + if (error) + goto fail; + bzero(&tmpbuffer, sizeof(tmpbuffer)); + continue; + } else { + pa = *l2 & ~ATTR_MASK; + + /* We always write a page, even if it is zero */ + error = blk_write(di, NULL, pa, PAGE_SIZE); + if (error) + goto fail; + } + } + + /* Dump memory chunks */ + /* XXX cluster it up and use blk_dump() */ + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffsl(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + error = blk_write(di, 0, pa, PAGE_SIZE); + if (error) + goto fail; + bits &= ~(1ul << bit); + } + } + + error = blk_flush(di); + if (error) + goto fail; + + /* Dump trailer */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Signal completion, signoff and exit stage left. */ + dump_write(di, NULL, 0, 0, 0); + printf("\nDump complete\n"); + return (0); + + fail: + if (error < 0) + error = -error; + + printf("\n"); + if (error == ENOSPC) { + printf("Dump map grown while dumping. "); + if (retry_count < 5) { + printf("Retrying...\n"); + goto retry; + } + printf("Dump failed.\n"); + } + else if (error == ECANCELED) + printf("Dump aborted\n"); + else if (error == E2BIG) + printf("Dump failed. Partition too small.\n"); + else + printf("** DUMP FAILED (ERROR %d) **\n", error); + return (error); } +void +dump_add_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 6; /* 2^6 = 64 */ + bit = pa & 63; + atomic_set_long(&vm_page_dump[idx], 1ul << bit); +} + +void +dump_drop_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 6; /* 2^6 = 64 */ + bit = pa & 63; + atomic_clear_long(&vm_page_dump[idx], 1ul << bit); +} Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Thu Aug 20 12:07:44 2015 (r286957) +++ head/sys/arm64/arm64/uma_machdep.c Thu Aug 20 12:49:56 2015 (r286958) @@ -61,6 +61,8 @@ uma_small_alloc(uma_zone_t zone, vm_size break; } pa = m->phys_addr; + if ((wait & M_NODUMP) == 0) + dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); @@ -74,6 +76,7 @@ uma_small_free(void *mem, vm_size_t size vm_paddr_t pa; pa = DMAP_TO_PHYS((vm_offset_t)mem); + dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); m->wire_count--; vm_page_free(m); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Aug 20 12:07:44 2015 (r286957) +++ head/sys/vm/vm_page.c Thu Aug 20 12:49:56 2015 (r286958) @@ -479,8 +479,8 @@ vm_page_startup(vm_offset_t vaddr) bzero((void *)mapped, end - new_end); uma_startup((void *)mapped, boot_pages); -#if defined(__amd64__) || defined(__i386__) || defined(__arm__) || \ - defined(__mips__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ + defined(__i386__) || defined(__mips__) /* * Allocate a bitmap to indicate that a random physical page * needs to be included in a minidump. @@ -557,12 +557,12 @@ vm_page_startup(vm_offset_t vaddr) */ new_end = vm_reserv_startup(&vaddr, new_end, high_water); #endif -#if defined(__amd64__) || defined(__mips__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) /* - * pmap_map on amd64 and mips can come out of the direct-map, not kvm - * like i386, so the pages must be tracked for a crashdump to include - * this data. This includes the vm_page_array and the early UMA - * bootstrap pages. + * pmap_map on arm64, amd64, and mips can come out of the direct-map, + * not kvm like i386, so the pages must be tracked for a crashdump to + * include this data. This includes the vm_page_array and the early + * UMA bootstrap pages. */ for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) dump_add_page(pa); From owner-svn-src-head@freebsd.org Thu Aug 20 13:11:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0136B9BE1D0; Thu, 20 Aug 2015 13:11:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5AE5127E; Thu, 20 Aug 2015 13:11:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KDBrAj041679; Thu, 20 Aug 2015 13:11:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KDBrVv041675; Thu, 20 Aug 2015 13:11:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508201311.t7KDBrVv041675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Aug 2015 13:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286959 - in head/lib/libc/aarch64: . gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 13:11:54 -0000 Author: andrew Date: Thu Aug 20 13:11:52 2015 New Revision: 286959 URL: https://svnweb.freebsd.org/changeset/base/286959 Log: Add the definitions of __infinity and __nan. Added: head/lib/libc/aarch64/gen/infinity.c - copied, changed from r286954, head/lib/libc/amd64/gen/infinity.c Modified: head/lib/libc/aarch64/Symbol.map head/lib/libc/aarch64/gen/Makefile.inc Modified: head/lib/libc/aarch64/Symbol.map ============================================================================== --- head/lib/libc/aarch64/Symbol.map Thu Aug 20 12:49:56 2015 (r286958) +++ head/lib/libc/aarch64/Symbol.map Thu Aug 20 13:11:52 2015 (r286959) @@ -17,6 +17,8 @@ FBSD_1.0 { __flt_rounds; fpgetmask; fpsetmask; + __infinity; + __nan; setjmp; longjmp; sigsetjmp; Modified: head/lib/libc/aarch64/gen/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/gen/Makefile.inc Thu Aug 20 12:49:56 2015 (r286958) +++ head/lib/libc/aarch64/gen/Makefile.inc Thu Aug 20 13:11:52 2015 (r286959) @@ -5,6 +5,7 @@ SRCS+= _ctx_start.S \ flt_rounds.c \ fpgetmask.c \ fpsetmask.c \ + infinity.c \ ldexp.c \ makecontext.c \ _setjmp.S \ Copied and modified: head/lib/libc/aarch64/gen/infinity.c (from r286954, head/lib/libc/amd64/gen/infinity.c) ============================================================================== --- head/lib/libc/amd64/gen/infinity.c Thu Aug 20 11:26:26 2015 (r286954, copy source) +++ head/lib/libc/aarch64/gen/infinity.c Thu Aug 20 13:11:52 2015 (r286959) @@ -7,7 +7,7 @@ __FBSDID("$FreeBSD$"); #include -/* bytes for +Infinity on a 387 */ +/* bytes for +Infinity on aarch64 */ const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; /* bytes for NaN */ From owner-svn-src-head@freebsd.org Thu Aug 20 13:13:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30F2A9BE267; Thu, 20 Aug 2015 13:13:45 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.53.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0DA1172D; Thu, 20 Aug 2015 13:13:44 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from global-1-26.nat.csx.cam.ac.uk ([131.111.184.26]:9094 helo=[172.16.33.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85) (envelope-from ) id 1ZSPf5-0008Ml-EM; Thu, 20 Aug 2015 09:13:43 -0400 From: "George Neville-Neil" To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286955 - in head/sys: net netinet netinet6 Date: Thu, 20 Aug 2015 14:13:28 +0100 Message-ID: <46D09C16-85BD-4E99-8600-16280AC9397A@neville-neil.com> In-Reply-To: <201508201205.t7KC5IoT012658@repo.freebsd.org> References: <201508201205.t7KC5IoT012658@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.9.2r5107) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 13:13:45 -0000 Why was this work not in Phabricator? This is a large change that has not been reviewed, as far as I can tell, by anyone else on the project. I am tempted to ask that this be backed out and reviewed BEFORE it goes into the tree. Best, George On 20 Aug 2015, at 13:05, Alexander V. Chernikov wrote: > Author: melifaro > Date: Thu Aug 20 12:05:17 2015 > New Revision: 286955 > URL: https://svnweb.freebsd.org/changeset/base/286955 > > Log: > * Split allocation and table linking for lle's. > Before that, the logic besides lle_create() was the following: > return existing if found, create if not. This behaviour was > error-prone > since we had to deal with 'sudden' static<>dynamic lle changes. > This commit fixes bunch of different issues like: > - refcount leak when lle is converted to static. > Simple check case: > console 1: > while true; > do for i in `arp -an|awk '$4~/incomp/{print$2}'|tr -d '()'`; > do arp -s $i 00:22:44:66:88:00 ; arp -d $i; > done; > done > console 2: > ping -f any-dead-host-in-L2 > console 3: > # watch for memory consumption: > vmstat -m | awk '$1~/lltable/{print$2}' > - possible problems in arptimer() / nd6_timer() when > dropping/reacquiring > lock. > New logic explicitly handles use-or-create cases in every lla_create > user. Basically, most of the changes are purely mechanical. However, > we explicitly avoid using existing lle's for interface/static LLE > records. > * While here, call lle_event handlers on all real table lle change. > * Create lltable_free_entry() calling existing per-lltable > lle_free_t callback for entry deletion > > Modified: > head/sys/net/if_llatbl.c > head/sys/net/if_llatbl.h > head/sys/netinet/if_ether.c > head/sys/netinet/in.c > head/sys/netinet/toecore.c > head/sys/netinet6/in6.c > head/sys/netinet6/nd6.c > head/sys/netinet6/nd6.h > > Modified: head/sys/net/if_llatbl.c > ============================================================================== > --- head/sys/net/if_llatbl.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/net/if_llatbl.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -228,7 +228,7 @@ htable_prefix_free(struct lltable *llt, > IF_AFDATA_WUNLOCK(llt->llt_ifp); > > LIST_FOREACH_SAFE(lle, &pmd.dchain, lle_chain, next) > - llt->llt_free_entry(llt, lle); > + lltable_free_entry(llt, lle); > } > > static void > @@ -278,10 +278,13 @@ lltable_drop_entry_queue(struct llentry > } > > /* > - * Deletes an address from the address table. > - * This function is called by the timer functions > - * such as arptimer() and nd6_llinfo_timer(), and > - * the caller does the locking. > + * > + * Performes generic cleanup routines and frees lle. > + * > + * Called for non-linked entries, with callouts and > + * other AF-specific cleanups performed. > + * > + * @lle must be passed WLOCK'ed > * > * Returns the number of held packets, if any, that were dropped. > */ > @@ -316,21 +319,35 @@ struct llentry * > llentry_alloc(struct ifnet *ifp, struct lltable *lt, > struct sockaddr_storage *dst) > { > - struct llentry *la; > + struct llentry *la, *la_tmp; > > IF_AFDATA_RLOCK(ifp); > la = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst); > IF_AFDATA_RUNLOCK(ifp); > - if ((la == NULL) && > - (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { > - IF_AFDATA_WLOCK(ifp); > - la = lla_create(lt, 0, (struct sockaddr *)dst); > - IF_AFDATA_WUNLOCK(ifp); > - } > > if (la != NULL) { > LLE_ADDREF(la); > LLE_WUNLOCK(la); > + return (la); > + } > + > + if ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { > + la = lltable_alloc_entry(lt, 0, (struct sockaddr *)dst); > + if (la == NULL) > + return (NULL); > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(la); > + /* Prefer any existing LLE over newly-created one */ > + la_tmp = lla_lookup(lt, LLE_EXCLUSIVE, (struct sockaddr *)dst); > + if (la_tmp == NULL) > + lltable_link_entry(lt, la); > + IF_AFDATA_WUNLOCK(ifp); > + if (la_tmp != NULL) { > + lltable_free_entry(lt, la); > + la = la_tmp; > + } > + LLE_ADDREF(la); > + LLE_WUNLOCK(la); > } > > return (la); > @@ -483,6 +500,21 @@ lltable_foreach_lle(struct lltable *llt, > return (llt->llt_foreach_entry(llt, f, farg)); > } > > +struct llentry * > +lltable_alloc_entry(struct lltable *llt, u_int flags, > + const struct sockaddr *l3addr) > +{ > + > + return (llt->llt_alloc_entry(llt, flags, l3addr)); > +} > + > +void > +lltable_free_entry(struct lltable *llt, struct llentry *lle) > +{ > + > + llt->llt_free_entry(llt, lle); > +} > + > void > lltable_link_entry(struct lltable *llt, struct llentry *lle) > { > @@ -531,7 +563,7 @@ lla_rt_output(struct rt_msghdr *rtm, str > struct sockaddr *dst = (struct sockaddr *)info->rti_info[RTAX_DST]; > struct ifnet *ifp; > struct lltable *llt; > - struct llentry *lle; > + struct llentry *lle, *lle_tmp; > u_int laflags = 0; > int error; > > @@ -560,13 +592,9 @@ lla_rt_output(struct rt_msghdr *rtm, str > switch (rtm->rtm_type) { > case RTM_ADD: > /* Add static LLE */ > - IF_AFDATA_WLOCK(ifp); > - lle = lla_create(llt, 0, dst); > - if (lle == NULL) { > - IF_AFDATA_WUNLOCK(ifp); > + lle = lltable_alloc_entry(llt, 0, dst); > + if (lle == NULL) > return (ENOMEM); > - } > - > > bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); > if ((rtm->rtm_flags & RTF_ANNOUNCE)) > @@ -589,8 +617,39 @@ lla_rt_output(struct rt_msghdr *rtm, str > } else > lle->la_expire = rtm->rtm_rmx.rmx_expire; > laflags = lle->la_flags; > - LLE_WUNLOCK(lle); > + > + /* Try to link new entry */ > + lle_tmp = NULL; > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(lle); > + lle_tmp = lla_lookup(llt, LLE_EXCLUSIVE, dst); > + if (lle_tmp != NULL) { > + /* Check if we are trying to replace immutable entry */ > + if ((lle_tmp->la_flags & LLE_IFADDR) != 0) { > + IF_AFDATA_WUNLOCK(ifp); > + LLE_WUNLOCK(lle_tmp); > + lltable_free_entry(llt, lle); > + return (EPERM); > + } > + /* Unlink existing entry from table */ > + lltable_unlink_entry(llt, lle_tmp); > + } > + lltable_link_entry(llt, lle); > IF_AFDATA_WUNLOCK(ifp); > + > + if (lle_tmp != NULL) { > + EVENTHANDLER_INVOKE(lle_event, lle_tmp,LLENTRY_EXPIRED); > + lltable_free_entry(llt, lle_tmp); > + } > + > + /* > + * By invoking LLE handler here we might get > + * two events on static LLE entry insertion > + * in routing socket. However, since we might have > + * other subscribers we need to generate this event. > + */ > + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_RESOLVED); > + LLE_WUNLOCK(lle); > #ifdef INET > /* gratuitous ARP */ > if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) > > Modified: head/sys/net/if_llatbl.h > ============================================================================== > --- head/sys/net/if_llatbl.h Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/net/if_llatbl.h Thu Aug 20 12:05:17 2015 (r286955) > @@ -133,7 +133,7 @@ struct llentry { > > typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags, > const struct sockaddr *l3addr); > -typedef struct llentry *(llt_create_t)(struct lltable *, u_int flags, > +typedef struct llentry *(llt_alloc_t)(struct lltable *, u_int flags, > const struct sockaddr *l3addr); > typedef int (llt_delete_t)(struct lltable *, u_int flags, > const struct sockaddr *l3addr); > @@ -161,7 +161,7 @@ struct lltable { > struct ifnet *llt_ifp; > > llt_lookup_t *llt_lookup; > - llt_create_t *llt_create; > + llt_alloc_t *llt_alloc_entry; > llt_delete_t *llt_delete; > llt_prefix_free_t *llt_prefix_free; > llt_dump_entry_t *llt_dump_entry; > @@ -209,8 +209,9 @@ struct llentry *llentry_alloc(struct if > /* helper functions */ > size_t lltable_drop_entry_queue(struct llentry *); > > -struct llentry *lltable_create_lle(struct lltable *llt, u_int flags, > - const void *paddr); > +struct llentry *lltable_alloc_entry(struct lltable *llt, u_int flags, > + const struct sockaddr *l4addr); > +void lltable_free_entry(struct lltable *llt, struct llentry *lle); > void lltable_link_entry(struct lltable *llt, struct llentry *lle); > void lltable_unlink_entry(struct lltable *llt, struct llentry *lle); > void lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr > *sa); > @@ -229,13 +230,6 @@ lla_lookup(struct lltable *llt, u_int fl > return (llt->llt_lookup(llt, flags, l3addr)); > } > > -static __inline struct llentry * > -lla_create(struct lltable *llt, u_int flags, const struct sockaddr > *l3addr) > -{ > - > - return (llt->llt_create(llt, flags, l3addr)); > -} > - > static __inline int > lla_delete(struct lltable *llt, u_int flags, const struct sockaddr > *l3addr) > { > > Modified: head/sys/netinet/if_ether.c > ============================================================================== > --- head/sys/netinet/if_ether.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet/if_ether.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -218,8 +218,8 @@ arptimer(void *arg) > > /* Guard against race with other llentry_free(). */ > if (lle->la_flags & LLE_LINKED) { > - size_t pkts_dropped; > > + size_t pkts_dropped; > LLE_REMREF(lle); > pkts_dropped = llentry_free(lle); > ARPSTAT_ADD(dropped, pkts_dropped); > @@ -323,7 +323,7 @@ static int > arpresolve_full(struct ifnet *ifp, int is_gw, int create, struct mbuf > *m, > const struct sockaddr *dst, u_char *desten, uint32_t *pflags) > { > - struct llentry *la = NULL; > + struct llentry *la = NULL, *la_tmp; > struct mbuf *curr = NULL; > struct mbuf *next = NULL; > int error, renew; > @@ -337,16 +337,28 @@ arpresolve_full(struct ifnet *ifp, int i > IF_AFDATA_RUNLOCK(ifp); > } > if (la == NULL && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) > { > - create = 1; > + la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); > + if (la == NULL) { > + log(LOG_DEBUG, > + "arpresolve: can't allocate llinfo for %s on %s\n", > + inet_ntoa(SIN(dst)->sin_addr), if_name(ifp)); > + m_freem(m); > + return (EINVAL); > + } > + > IF_AFDATA_WLOCK(ifp); > - la = lla_create(LLTABLE(ifp), 0, dst); > + LLE_WLOCK(la); > + la_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); > + /* Prefer ANY existing lle over newly-created one */ > + if (la_tmp == NULL) > + lltable_link_entry(LLTABLE(ifp), la); > IF_AFDATA_WUNLOCK(ifp); > + if (la_tmp != NULL) { > + lltable_free_entry(LLTABLE(ifp), la); > + la = la_tmp; > + } > } > if (la == NULL) { > - if (create != 0) > - log(LOG_DEBUG, > - "arpresolve: can't allocate llinfo for %s on %s\n", > - inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); > m_freem(m); > return (EINVAL); > } > @@ -608,7 +620,7 @@ in_arpinput(struct mbuf *m) > struct rm_priotracker in_ifa_tracker; > struct arphdr *ah; > struct ifnet *ifp = m->m_pkthdr.rcvif; > - struct llentry *la = NULL; > + struct llentry *la = NULL, *la_tmp; > struct rtentry *rt; > struct ifaddr *ifa; > struct in_ifaddr *ia; > @@ -620,6 +632,7 @@ in_arpinput(struct mbuf *m) > int bridged = 0, is_bridge = 0; > int carped; > struct sockaddr_in sin; > + struct sockaddr *dst; > sin.sin_len = sizeof(struct sockaddr_in); > sin.sin_family = AF_INET; > sin.sin_addr.s_addr = 0; > @@ -778,8 +791,9 @@ match: > sin.sin_len = sizeof(struct sockaddr_in); > sin.sin_family = AF_INET; > sin.sin_addr = isaddr; > + dst = (struct sockaddr *)&sin; > IF_AFDATA_RLOCK(ifp); > - la = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, (struct sockaddr > *)&sin); > + la = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); > IF_AFDATA_RUNLOCK(ifp); > if (la != NULL) > arp_check_update_lle(ah, isaddr, ifp, bridged, la); > @@ -788,15 +802,47 @@ match: > * Reply to our address, but no lle exists yet. > * do we really have to create an entry? > */ > + la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); > + if (la == NULL) > + goto drop; > + arp_update_lle(ah, ifp, la); > + > IF_AFDATA_WLOCK(ifp); > - la = lla_create(LLTABLE(ifp), 0, (struct sockaddr *)&sin); > - if (la != NULL) > - arp_update_lle(ah, ifp, la); > + LLE_WLOCK(la); > + la_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); > + > + /* > + * Check if lle still does not exists. > + * If it does, that means that we either > + * 1) have configured it explicitly, via > + * 1a) 'arp -s' static entry or > + * 1b) interface address static record > + * or > + * 2) it was the result of sending first packet to-host > + * or > + * 3) it was another arp reply packet we handled in > + * different thread. > + * > + * In all cases except 3) we definitely need to prefer > + * existing lle. For the sake of simplicity, prefer any > + * existing lle over newly-create one. > + */ > + if (la_tmp == NULL) > + lltable_link_entry(LLTABLE(ifp), la); > IF_AFDATA_WUNLOCK(ifp); > - if (la != NULL) { > + > + if (la_tmp == NULL) { > arp_mark_lle_reachable(la); > LLE_WUNLOCK(la); > + } else { > + /* Free newly-create entry and handle packet */ > + lltable_free_entry(LLTABLE(ifp), la); > + la = la_tmp; > + la_tmp = NULL; > + arp_check_update_lle(ah, isaddr, ifp, bridged, la); > + /* arp_check_update_lle() returns @la unlocked */ > } > + la = NULL; > } > reply: > if (op != ARPOP_REQUEST) > @@ -1044,30 +1090,53 @@ arp_mark_lle_reachable(struct llentry *l > void > arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) > { > - struct llentry *lle; > + struct llentry *lle, *lle_tmp; > + struct sockaddr_in *dst_in; > + struct sockaddr *dst; > > if (ifa->ifa_carp != NULL) > return; > > - if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) { > - arprequest(ifp, &IA_SIN(ifa)->sin_addr, > - &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); > - /* > - * interface address is considered static entry > - * because the output of the arp utility shows > - * that L2 entry as permanent > - */ > - IF_AFDATA_LOCK(ifp); > - lle = lla_create(LLTABLE(ifp), LLE_IFADDR | LLE_STATIC, > - (struct sockaddr *)IA_SIN(ifa)); > - IF_AFDATA_UNLOCK(ifp); > - if (lle == NULL) > - log(LOG_INFO, "arp_ifinit: cannot create arp " > - "entry for interface address\n"); > - else > - LLE_WUNLOCK(lle); > - } > ifa->ifa_rtrequest = NULL; > + > + dst_in = IA_SIN(ifa); > + dst = (struct sockaddr *)dst_in; > + > + if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) == INADDR_ANY) > + return; > + > + arprequest(ifp, &IA_SIN(ifa)->sin_addr, > + &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); > + > + /* > + * Interface address LLE record is considered static > + * because kernel code relies on LLE_STATIC flag to check > + * if these entries can be rewriten by arp updates. > + */ > + lle = lltable_alloc_entry(LLTABLE(ifp), LLE_IFADDR | LLE_STATIC, > dst); > + if (lle == NULL) { > + log(LOG_INFO, "arp_ifinit: cannot create arp " > + "entry for interface address\n"); > + return; > + } > + > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(lle); > + /* Unlink any entry if exists */ > + lle_tmp = lla_lookup(LLTABLE(ifp), LLE_EXCLUSIVE, dst); > + if (lle_tmp != NULL) > + lltable_unlink_entry(LLTABLE(ifp), lle_tmp); > + > + lltable_link_entry(LLTABLE(ifp), lle); > + IF_AFDATA_WUNLOCK(ifp); > + > + if (lle_tmp != NULL) > + EVENTHANDLER_INVOKE(lle_event, lle_tmp, LLENTRY_EXPIRED); > + > + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_RESOLVED); > + LLE_WUNLOCK(lle); > + if (lle_tmp != NULL) > + lltable_free_entry(LLTABLE(ifp), lle_tmp); > } > > void > > Modified: head/sys/netinet/in.c > ============================================================================== > --- head/sys/netinet/in.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet/in.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -1202,25 +1202,15 @@ in_lltable_delete(struct lltable *llt, u > } > > static struct llentry * > -in_lltable_create(struct lltable *llt, u_int flags, const struct > sockaddr *l3addr) > +in_lltable_alloc(struct lltable *llt, u_int flags, const struct > sockaddr *l3addr) > { > const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; > struct ifnet *ifp = llt->llt_ifp; > struct llentry *lle; > > - IF_AFDATA_WLOCK_ASSERT(ifp); > KASSERT(l3addr->sa_family == AF_INET, > ("sin_family %d", l3addr->sa_family)); > > - lle = in_lltable_find_dst(llt, sin->sin_addr); > - > - if (lle != NULL) { > - LLE_WLOCK(lle); > - return (lle); > - } > - > - /* no existing record, we need to create new one */ > - > /* > * A route that covers the given address must have > * been installed 1st because we are doing a resolution, > @@ -1241,9 +1231,6 @@ in_lltable_create(struct lltable *llt, u > lle->la_flags |= (LLE_VALID | LLE_STATIC); > } > > - lltable_link_entry(llt, lle); > - LLE_WLOCK(lle); > - > return (lle); > } > > @@ -1346,7 +1333,7 @@ in_lltattach(struct ifnet *ifp) > llt->llt_ifp = ifp; > > llt->llt_lookup = in_lltable_lookup; > - llt->llt_create = in_lltable_create; > + llt->llt_alloc_entry = in_lltable_alloc; > llt->llt_delete = in_lltable_delete; > llt->llt_dump_entry = in_lltable_dump_entry; > llt->llt_hash = in_lltable_hash; > > Modified: head/sys/netinet/toecore.c > ============================================================================== > --- head/sys/netinet/toecore.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet/toecore.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -456,7 +456,7 @@ toe_route_redirect_event(void *arg __unu > static int > toe_nd6_resolve(struct ifnet *ifp, struct sockaddr *sa, uint8_t > *lladdr) > { > - struct llentry *lle; > + struct llentry *lle, *lle_tmp; > struct sockaddr_in6 *sin6 = (void *)sa; > int rc, flags = 0; > > @@ -465,19 +465,32 @@ restart: > lle = lla_lookup(LLTABLE6(ifp), flags, sa); > IF_AFDATA_RUNLOCK(ifp); > if (lle == NULL) { > - IF_AFDATA_LOCK(ifp); > - lle = nd6_create(&sin6->sin6_addr, 0, ifp); > - IF_AFDATA_UNLOCK(ifp); > + lle = nd6_alloc(&sin6->sin6_addr, 0, ifp); > if (lle == NULL) > return (ENOMEM); /* Couldn't create entry in cache. */ > lle->ln_state = ND6_LLINFO_INCOMPLETE; > - nd6_llinfo_settimer_locked(lle, > - (long)ND_IFINFO(ifp)->retrans * hz / 1000); > - LLE_WUNLOCK(lle); > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(lle); > + lle_tmp = nd6_lookup(&sin6->sin6_addr, ND6_EXCLUSIVE, ifp); > + /* Prefer any existing lle over newly-created one */ > + if (lle_tmp == NULL) > + lltable_link_entry(LLTABLE6(ifp), lle); > + IF_AFDATA_WUNLOCK(ifp); > + if (lle_tmp == NULL) { > + /* Arm timer for newly-created entry and send NS */ > + nd6_llinfo_settimer_locked(lle, > + (long)ND_IFINFO(ifp)->retrans * hz / 1000); > + LLE_WUNLOCK(lle); > > - nd6_ns_output(ifp, NULL, &sin6->sin6_addr, NULL, 0); > + nd6_ns_output(ifp, NULL, &sin6->sin6_addr, NULL, 0); > > - return (EWOULDBLOCK); > + return (EWOULDBLOCK); > + } else { > + /* Drop newly-created lle and switch to existing one */ > + lltable_free_entry(LLTABLE6(ifp), lle); > + lle = lle_tmp; > + lle_tmp = NULL; > + } > } > > if (lle->ln_state == ND6_LLINFO_STALE) { > > Modified: head/sys/netinet6/in6.c > ============================================================================== > --- head/sys/netinet6/in6.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet6/in6.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -2239,24 +2239,16 @@ in6_lltable_delete(struct lltable *llt, > } > > static struct llentry * > -in6_lltable_create(struct lltable *llt, u_int flags, > +in6_lltable_alloc(struct lltable *llt, u_int flags, > const struct sockaddr *l3addr) > { > const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 > *)l3addr; > struct ifnet *ifp = llt->llt_ifp; > struct llentry *lle; > > - IF_AFDATA_WLOCK_ASSERT(ifp); > KASSERT(l3addr->sa_family == AF_INET6, > ("sin_family %d", l3addr->sa_family)); > > - lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); > - > - if (lle != NULL) { > - LLE_WLOCK(lle); > - return (lle); > - } > - > /* > * A route that covers the given address must have > * been installed 1st because we are doing a resolution, > @@ -2277,9 +2269,6 @@ in6_lltable_create(struct lltable *llt, > lle->la_flags |= (LLE_VALID | LLE_STATIC); > } > > - lltable_link_entry(llt, lle); > - LLE_WLOCK(lle); > - > return (lle); > } > > @@ -2382,7 +2371,7 @@ in6_lltattach(struct ifnet *ifp) > llt->llt_ifp = ifp; > > llt->llt_lookup = in6_lltable_lookup; > - llt->llt_create = in6_lltable_create; > + llt->llt_alloc_entry = in6_lltable_alloc; > llt->llt_delete = in6_lltable_delete; > llt->llt_dump_entry = in6_lltable_dump_entry; > llt->llt_hash = in6_lltable_hash; > > Modified: head/sys/netinet6/nd6.c > ============================================================================== > --- head/sys/netinet6/nd6.c Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet6/nd6.c Thu Aug 20 12:05:17 2015 (r286955) > @@ -939,12 +939,8 @@ nd6_lookup(struct in6_addr *addr6, int f > return (ln); > } > > -/* > - * the caller acquires and releases the lock on the lltbls > - * Returns the llentry wlocked > - */ > struct llentry * > -nd6_create(struct in6_addr *addr6, int flags, struct ifnet *ifp) > +nd6_alloc(struct in6_addr *addr6, int flags, struct ifnet *ifp) > { > struct sockaddr_in6 sin6; > struct llentry *ln; > @@ -954,9 +950,7 @@ nd6_create(struct in6_addr *addr6, int f > sin6.sin6_family = AF_INET6; > sin6.sin6_addr = *addr6; > > - IF_AFDATA_WLOCK_ASSERT(ifp); > - > - ln = lla_create(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6); > + ln = lltable_alloc_entry(LLTABLE6(ifp), 0, (struct sockaddr > *)&sin6); > if (ln != NULL) > ln->ln_state = ND6_LLINFO_NOSTATE; > > @@ -1640,7 +1634,7 @@ struct llentry * > nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char > *lladdr, > int lladdrlen, int type, int code) > { > - struct llentry *ln = NULL; > + struct llentry *ln = NULL, *ln_tmp; > int is_newentry; > int do_update; > int olladdr; > @@ -1674,22 +1668,33 @@ nd6_cache_lladdr(struct ifnet *ifp, stru > IF_AFDATA_RLOCK(ifp); > ln = nd6_lookup(from, flags, ifp); > IF_AFDATA_RUNLOCK(ifp); > + is_newentry = 0; > if (ln == NULL) { > flags |= ND6_EXCLUSIVE; > - IF_AFDATA_LOCK(ifp); > - ln = nd6_create(from, 0, ifp); > - IF_AFDATA_UNLOCK(ifp); > - is_newentry = 1; > - } else { > - /* do nothing if static ndp is set */ > - if (ln->la_flags & LLE_STATIC) { > + ln = nd6_alloc(from, 0, ifp); > + if (ln == NULL) > + return (NULL); > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(ln); > + /* Prefer any existing lle over newly-created one */ > + ln_tmp = nd6_lookup(from, ND6_EXCLUSIVE, ifp); > + if (ln_tmp == NULL) > + lltable_link_entry(LLTABLE6(ifp), ln); > + IF_AFDATA_WUNLOCK(ifp); > + if (ln_tmp == NULL) > + /* No existing lle, mark as new entry */ > + is_newentry = 1; > + else { > + lltable_free_entry(LLTABLE6(ifp), ln); > + ln = ln_tmp; > + ln_tmp = NULL; > + } > + } > + /* do nothing if static ndp is set */ > + if ((ln->la_flags & LLE_STATIC)) { > static_route = 1; > goto done; > - } > - is_newentry = 0; > } > - if (ln == NULL) > - return (NULL); > > olladdr = (ln->la_flags & LLE_VALID) ? 1 : 0; > if (olladdr && lladdr) { > @@ -2032,7 +2037,7 @@ static int > nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf > *m, > struct sockaddr_in6 *dst) > { > - struct llentry *lle = NULL; > + struct llentry *lle = NULL, *lle_tmp; > > KASSERT(m != NULL, ("NULL mbuf, nothing to send")); > /* discard the packet if IPv6 operation is disabled on the interface > */ > @@ -2063,19 +2068,35 @@ nd6_output_lle(struct ifnet *ifp, struct > * the condition below is not very efficient. But we believe > * it is tolerable, because this should be a rare case. > */ > - IF_AFDATA_LOCK(ifp); > - lle = nd6_create(&dst->sin6_addr, 0, ifp); > - IF_AFDATA_UNLOCK(ifp); > + lle = nd6_alloc(&dst->sin6_addr, 0, ifp); > + if (lle == NULL) { > + char ip6buf[INET6_ADDRSTRLEN]; > + log(LOG_DEBUG, > + "nd6_output: can't allocate llinfo for %s " > + "(ln=%p)\n", > + ip6_sprintf(ip6buf, &dst->sin6_addr), lle); > + m_freem(m); > + return (ENOBUFS); > + } > + lle->ln_state = ND6_LLINFO_NOSTATE; > + > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(lle); > + /* Prefer any existing entry over newly-created one */ > + lle_tmp = nd6_lookup(&dst->sin6_addr, ND6_EXCLUSIVE, ifp); > + if (lle_tmp == NULL) > + lltable_link_entry(LLTABLE6(ifp), lle); > + IF_AFDATA_WUNLOCK(ifp); > + if (lle_tmp != NULL) { > + lltable_free_entry(LLTABLE6(ifp), lle); > + lle = lle_tmp; > + lle_tmp = NULL; > + } > } > } > if (lle == NULL) { > if ((ifp->if_flags & IFF_POINTOPOINT) == 0 && > !(ND_IFINFO(ifp)->flags & ND6_IFF_PERFORMNUD)) { > - char ip6buf[INET6_ADDRSTRLEN]; > - log(LOG_DEBUG, > - "nd6_output: can't allocate llinfo for %s " > - "(ln=%p)\n", > - ip6_sprintf(ip6buf, &dst->sin6_addr), lle); > m_freem(m); > return (ENOBUFS); > } > @@ -2241,24 +2262,40 @@ int > nd6_add_ifa_lle(struct in6_ifaddr *ia) > { > struct ifnet *ifp; > - struct llentry *ln; > + struct llentry *ln, *ln_tmp; > + struct sockaddr *dst; > > ifp = ia->ia_ifa.ifa_ifp; > if (nd6_need_cache(ifp) == 0) > return (0); > - IF_AFDATA_LOCK(ifp); > + > ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; > - ln = lla_create(LLTABLE6(ifp), LLE_IFADDR, > - (struct sockaddr *)&ia->ia_addr); > - IF_AFDATA_UNLOCK(ifp); > - if (ln != NULL) { > - ln->la_expire = 0; /* for IPv6 this means permanent */ > - ln->ln_state = ND6_LLINFO_REACHABLE; > - LLE_WUNLOCK(ln); > - return (0); > - } > + dst = (struct sockaddr *)&ia->ia_addr; > + ln = lltable_alloc_entry(LLTABLE6(ifp), LLE_IFADDR, dst); > + if (ln == NULL) > + return (ENOBUFS); > > - return (ENOBUFS); > + ln->la_expire = 0; /* for IPv6 this means permanent */ > + ln->ln_state = ND6_LLINFO_REACHABLE; > + > + IF_AFDATA_WLOCK(ifp); > + LLE_WLOCK(ln); > + /* Unlink any entry if exists */ > + ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_EXCLUSIVE, dst); > + if (ln_tmp != NULL) > + lltable_unlink_entry(LLTABLE6(ifp), ln_tmp); > + lltable_link_entry(LLTABLE6(ifp), ln); > + IF_AFDATA_WUNLOCK(ifp); > + > + if (ln_tmp != NULL) > + EVENTHANDLER_INVOKE(lle_event, ln_tmp, LLENTRY_EXPIRED); > + EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); > + > + LLE_WUNLOCK(ln); > + if (ln_tmp != NULL) > + llentry_free(ln_tmp); > + > + return (0); > } > > /* > > Modified: head/sys/netinet6/nd6.h > ============================================================================== > --- head/sys/netinet6/nd6.h Thu Aug 20 11:26:26 2015 (r286954) > +++ head/sys/netinet6/nd6.h Thu Aug 20 12:05:17 2015 (r286955) > @@ -407,7 +407,7 @@ void nd6_option_init(void *, int, union > struct nd_opt_hdr *nd6_option(union nd_opts *); > int nd6_options(union nd_opts *); > struct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *); > -struct llentry *nd6_create(struct in6_addr *, int, struct ifnet *); > +struct llentry *nd6_alloc(struct in6_addr *, int, struct ifnet *); > void nd6_setmtu(struct ifnet *); > void nd6_llinfo_settimer(struct llentry *, long); > void nd6_llinfo_settimer_locked(struct llentry *, long); From owner-svn-src-head@freebsd.org Thu Aug 20 13:29:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20C49BE6B5; Thu, 20 Aug 2015 13:29:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB9E638; Thu, 20 Aug 2015 13:29:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 EA1BA25D37D1; Thu, 20 Aug 2015 13:29:22 +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 24113C76FEC; Thu, 20 Aug 2015 13:29:22 +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 gYoJ2ANSI6p7; Thu, 20 Aug 2015 13:29:20 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B1BD0C76FD1; Thu, 20 Aug 2015 13:29:19 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r286955 - in head/sys: net netinet netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <46D09C16-85BD-4E99-8600-16280AC9397A@neville-neil.com> Date: Thu, 20 Aug 2015 13:29:17 +0000 Cc: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508201205.t7KC5IoT012658@repo.freebsd.org> <46D09C16-85BD-4E99-8600-16280AC9397A@neville-neil.com> To: George Neville-Neil X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 13:29:27 -0000 > On 20 Aug 2015, at 13:13 , George Neville-Neil = wrote: >=20 > Why was this work not in Phabricator? This is a large change that has = not been reviewed, > as far as I can tell, by anyone else on the project. I am tempted to = ask that this be backed out > and reviewed BEFORE it goes into the tree. I probably wouldn=E2=80=99t go as far as backing out. Given this seems part of a larger change that seem to be streamed into = HEAD and I have probably missed a posting or heads up or something on = net@ [if someone could point me at that it would be very helpful], I = appreciate things being broken into smaller reviewable bits. I have no = clear idea of what the end goal is or will be or look like, which makes = it hard to comment on design decisions. I however, as I have stated in the past, would really really appreciate = each change in PB, with the proposed commit message, and allow a few = days of review or for people to comment on. I have spend two years on = fixing bugs on the previous rewrite of that code. I am not exactly = looking forward to see history repeat itself. Thanks, Bjoern From owner-svn-src-head@freebsd.org Thu Aug 20 13:37:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 241CA9BEA3B; Thu, 20 Aug 2015 13:37:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15235D2B; Thu, 20 Aug 2015 13:37:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KDb86m051100; Thu, 20 Aug 2015 13:37:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KDb8Ce051099; Thu, 20 Aug 2015 13:37:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508201337.t7KDb8Ce051099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 20 Aug 2015 13:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286960 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 13:37:09 -0000 Author: kib Date: Thu Aug 20 13:37:08 2015 New Revision: 286960 URL: https://svnweb.freebsd.org/changeset/base/286960 Log: Typo. Modified: head/sys/arm/include/proc.h Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Thu Aug 20 13:11:52 2015 (r286959) +++ head/sys/arm/include/proc.h Thu Aug 20 13:37:08 2015 (r286960) @@ -69,7 +69,7 @@ struct mdproc { * As some syscall arguments may be 64-bit aligned we need to ensure the * args value is 64-bit aligned. The ABI will then ensure any 64-bit * arguments are already correctly aligned, even if they were passed in - * via registers, we just need to make sure we copy them to an algned + * via registers, we just need to make sure we copy them to an aligned * buffer. */ struct syscall_args { From owner-svn-src-head@freebsd.org Thu Aug 20 14:19:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6871E9BF235; Thu, 20 Aug 2015 14:19:51 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward2h.mail.yandex.net (forward2h.mail.yandex.net [IPv6:2a02:6b8:0:f05::2]) by mx1.freebsd.org (Postfix) with ESMTP id 256C2775; Thu, 20 Aug 2015 14:19:51 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web13h.yandex.ru (web13h.yandex.ru [84.201.186.42]) by forward2h.mail.yandex.net (Yandex) with ESMTP id 6E52A701196; Thu, 20 Aug 2015 17:19:48 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web13h.yandex.ru (Yandex) with ESMTP id 434AE23C1A19; Thu, 20 Aug 2015 17:19:47 +0300 (MSK) Received: by web13h.yandex.ru with HTTP; Thu, 20 Aug 2015 17:19:46 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Bjoern A. Zeeb , George Neville-Neil Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: References: <201508201205.t7KC5IoT012658@repo.freebsd.org> <46D09C16-85BD-4E99-8600-16280AC9397A@neville-neil.com> Subject: Re: svn commit: r286955 - in head/sys: net netinet netinet6 MIME-Version: 1.0 Message-Id: <129231440080386@web13h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 20 Aug 2015 17:19:46 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 14:19:51 -0000 20.08.2015, 16:29, "Bjoern A. Zeeb" : >>  On 20 Aug 2015, at 13:13 , George Neville-Neil wrote: >> >>  Why was this work not in Phabricator? This is a large change that has not been reviewed, >>  as far as I can tell, by anyone else on the project. I am tempted to ask that this be backed out >>  and reviewed BEFORE it goes into the tree. > > I probably wouldn’t go as far as backing out. > > Given this seems part of a larger change that seem to be streamed into HEAD and I have probably missed a posting or heads up or something on net@ [if someone could point me at that it would be very helpful], I appreciate things being broken into smaller reviewable bits. I have no clear idea of what the end goal is or will be or look like, which makes it hard to comment on design decisions. This is really the part of large change. The posting itself is here: https://wiki.freebsd.org/ProjectsRoutingProposal It was actually implemented (in slightly different way) in projects/routing branch. Unfortunately, I had to postpone that until recently. HEAD changed significantly since then, so merging is a bit complex. I've got routing part merged (and I'll update projects/routing branch within a few days). However, there are bunch of "general" lle changes, related to code "cleanup". So, my plan was to merge these, update projects/routing branch so anyone can clearly see the difference on fresh HEAD and create a bunch of reviews with proposed locking / timer changes for lle (and do the same for routing changes). But currently we're here.. > > I however, as I have stated in the past, would really really appreciate each change in PB, with the proposed commit message, and allow a few days of review or for people to comment on. I have spend two years on fixing bugs on the previous rewrite of that code. I am not exactly looking forward to see history repeat itself. I see no problem in sending changes there for design changes and I actually do prefer PB for that. I actually not against using PB for everything, but here we come very close to exact definition of "a few days". My intentions on the last commits were actually to ease the review of upcoming stuff, not to push-everything-without-review. > > Thanks, > Bjoern From owner-svn-src-head@freebsd.org Thu Aug 20 14:33:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE7C9BF4F0; Thu, 20 Aug 2015 14:33:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102511084; Thu, 20 Aug 2015 14:33:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KEXUhU076279; Thu, 20 Aug 2015 14:33:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KEXUGT076278; Thu, 20 Aug 2015 14:33:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508201433.t7KEXUGT076278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Aug 2015 14:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286962 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 14:33:31 -0000 Author: jhb Date: Thu Aug 20 14:33:30 2015 New Revision: 286962 URL: https://svnweb.freebsd.org/changeset/base/286962 Log: Rework the argv and env string fetching for execve to be more robust. Before truss would fetch 100 string pointers and happily walk off the end of the array if it never found a NULL. This also means for a short argv list it could fail entirely if the 100 string pointers spanned into an unmapped page. Instead, fetch page-aligned blocks of string pointers in a loop fetching each string until a NULL is found. While here, make use of the open memstream file descriptor instead of allocating a temporary array. This allows us to fetch each string once instead of twice. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 20 14:03:03 2015 (r286961) +++ head/usr.bin/truss/syscalls.c Thu Aug 20 14:33:30 2015 (r286962) @@ -913,36 +913,54 @@ print_arg(struct syscall_args *sc, unsig break; } case StringArray: { - int num, size, i; - char *tmp2; + uintptr_t addr; + union { + char *strarray[0]; + char buf[PAGE_SIZE]; + } u; char *string; - char *strarray[100]; /* XXX This is ugly. */ + size_t len; + int first, i; - if (get_struct(pid, (void *)args[sc->offset], - (void *)&strarray, sizeof(strarray)) == -1) - err(1, "get_struct %p", (void *)args[sc->offset]); - num = 0; - size = 0; - - /* Find out how large of a buffer we'll need. */ - while (strarray[num] != NULL) { - string = get_string(pid, (void*)strarray[num], 0); - size += strlen(string); - free(string); - num++; + /* + * Read a page of pointers at a time. Punt if the top-level + * pointer is not aligned. Note that the first read is of + * a partial page. + */ + addr = args[sc->offset]; + if (addr % sizeof(char *) != 0) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + + len = PAGE_SIZE - (addr & PAGE_MASK); + if (get_struct(pid, (void *)addr, u.buf, len) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; } - size += 4 + (num * 4); - tmp = (char *)malloc(size); - tmp2 = tmp; - - tmp2 += sprintf(tmp2, " ["); - for (i = 0; i < num; i++) { - string = get_string(pid, (void*)strarray[i], 0); - tmp2 += sprintf(tmp2, " \"%s\"%c", string, - (i + 1 == num) ? ' ' : ','); + + fputc('[', fp); + first = 1; + i = 0; + while (u.strarray[i] != NULL) { + string = get_string(pid, u.strarray[i], 0); + fprintf(fp, "%s \"%s\"", first ? "" : ",", string); free(string); + first = 0; + + i++; + if (i == len / sizeof(char *)) { + addr += len; + len = PAGE_SIZE; + if (get_struct(pid, (void *)addr, u.buf, len) == + -1) { + fprintf(fp, ", "); + break; + } + i = 0; + } } - tmp2 += sprintf(tmp2, "]"); + fputs(" ]", fp); break; } #ifdef __LP64__ From owner-svn-src-head@freebsd.org Thu Aug 20 14:51:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFFC79BF83E; Thu, 20 Aug 2015 14:51:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48371A22; Thu, 20 Aug 2015 14:51:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KEpFWF084357; Thu, 20 Aug 2015 14:51:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KEpCUl084342; Thu, 20 Aug 2015 14:51:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508201451.t7KEpCUl084342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Aug 2015 14:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286963 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 14:51:15 -0000 Author: jhb Date: Thu Aug 20 14:51:11 2015 New Revision: 286963 URL: https://svnweb.freebsd.org/changeset/base/286963 Log: Handle the conditional decoding of execve() argument and environment arrays generically rather than duplicating a hack in all of the backends. - Add two new system call argument types and use them instead of StringArray for the argument and environment arguments execve and linux_execve. - Honor the -a/-e flags in the handling of these new types. - Instead of printing "" when the decoding is disabled, print the raw pointer value. Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-fbsd.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/amd64-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -233,28 +233,6 @@ amd64_syscall_entry(struct trussinfo *tr fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/amd64-fbsd32.c Thu Aug 20 14:51:11 2015 (r286963) @@ -233,28 +233,6 @@ amd64_fbsd32_syscall_entry(struct trussi fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "freebsd32_execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/amd64-linux32.c Thu Aug 20 14:51:11 2015 (r286963) @@ -206,28 +206,6 @@ amd64_linux32_syscall_entry(struct truss fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "linux_execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- head/usr.bin/truss/arm-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/arm-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -264,28 +264,6 @@ arm_syscall_entry(struct trussinfo *trus fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/i386-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -227,28 +227,6 @@ i386_syscall_entry(struct trussinfo *tru fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/i386-linux.c Thu Aug 20 14:51:11 2015 (r286963) @@ -206,28 +206,6 @@ i386_linux_syscall_entry(struct trussinf fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "linux_execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/mips-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -261,28 +261,6 @@ mips_syscall_entry(struct trussinfo *tru fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/powerpc-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -238,28 +238,6 @@ powerpc_syscall_entry(struct trussinfo * fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -226,28 +226,6 @@ powerpc64_syscall_entry(struct trussinfo fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/sparc64-fbsd.c Thu Aug 20 14:51:11 2015 (r286963) @@ -255,28 +255,6 @@ sparc64_syscall_entry(struct trussinfo * fprintf(trussinfo->outfile, "\n"); #endif - if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || - strcmp(fsc->name, "exit") == 0)) { - /* - * XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (strcmp(fsc->name, "execve") == 0) { - if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc->s_args[1]) { - free(fsc->s_args[1]); - fsc->s_args[1] = NULL; - } - } - if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc->s_args[2]) { - free(fsc->s_args[2]); - fsc->s_args[2] = NULL; - } - } - } - } trussinfo->curthread->fsc = fsc; } Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/syscall.h Thu Aug 20 14:51:11 2015 (r286963) @@ -42,7 +42,7 @@ enum Argtype { None = 1, Hex, Octal, Int Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, - Sysarch }; + Sysarch, ExecArgs, ExecEnv }; #define ARG_MASK 0xff #define OUT 0x100 Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 20 14:33:30 2015 (r286962) +++ head/usr.bin/truss/syscalls.c Thu Aug 20 14:51:11 2015 (r286963) @@ -245,11 +245,11 @@ static struct syscall syscalls[] = { .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Hex, 3 }, { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } }, { .name = "execve", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, - { StringArray | IN, 2 } } }, + .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 }, + { ExecEnv | IN, 2 } } }, { .name = "linux_execve", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, - { StringArray | IN, 2 } } }, + .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 }, + { ExecEnv | IN, 2 } } }, { .name = "kldload", .ret_type = 0, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "kldunload", .ret_type = 0, .nargs = 1, @@ -912,6 +912,8 @@ print_arg(struct syscall_args *sc, unsig } break; } + case ExecArgs: + case ExecEnv: case StringArray: { uintptr_t addr; union { @@ -923,6 +925,18 @@ print_arg(struct syscall_args *sc, unsig int first, i; /* + * Only parse argv[] and environment arrays from exec calls + * if requested. + */ + if (((sc->type & ARG_MASK) == ExecArgs && + (trussinfo->flags & EXECVEARGS) == 0) || + ((sc->type & ARG_MASK) == ExecEnv && + (trussinfo->flags & EXECVEENVS) == 0)) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + + /* * Read a page of pointers at a time. Punt if the top-level * pointer is not aligned. Note that the first read is of * a partial page. From owner-svn-src-head@freebsd.org Thu Aug 20 15:37:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C6839BE07E; Thu, 20 Aug 2015 15:37:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEB91847; Thu, 20 Aug 2015 15:37:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KFbn8e001315; Thu, 20 Aug 2015 15:37:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KFbmK6001309; Thu, 20 Aug 2015 15:37:48 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201508201537.t7KFbmK6001309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Aug 2015 15:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286964 - in head: etc/mtree usr.sbin/fstyp usr.sbin/fstyp/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 15:37:49 -0000 Author: asomers Date: Thu Aug 20 15:37:47 2015 New Revision: 286964 URL: https://svnweb.freebsd.org/changeset/base/286964 Log: Add ATF functional tests for fstyp(8). No ZFS or GELI tests yet. Reviewed by: trasz, ngie MFC after: 2 weeks Sponsored by: SpectraLogic Differential Revision: https://reviews.freebsd.org/D2801 Added: head/usr.sbin/fstyp/tests/ head/usr.sbin/fstyp/tests/Makefile (contents, props changed) head/usr.sbin/fstyp/tests/ext2.img.bz2 (contents, props changed) head/usr.sbin/fstyp/tests/ext3.img.bz2 (contents, props changed) head/usr.sbin/fstyp/tests/ext4.img.bz2 (contents, props changed) head/usr.sbin/fstyp/tests/ext4_with_label.img.bz2 (contents, props changed) head/usr.sbin/fstyp/tests/fstyp_test.sh (contents, props changed) head/usr.sbin/fstyp/tests/ntfs.img.bz2 (contents, props changed) head/usr.sbin/fstyp/tests/ntfs_with_label.img.bz2 (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/fstyp/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Aug 20 14:51:11 2015 (r286963) +++ head/etc/mtree/BSD.tests.dist Thu Aug 20 15:37:47 2015 (r286964) @@ -574,6 +574,8 @@ usr.sbin etcupdate .. + fstyp + .. newsyslog .. nmtree Modified: head/usr.sbin/fstyp/Makefile ============================================================================== --- head/usr.sbin/fstyp/Makefile Thu Aug 20 14:51:11 2015 (r286963) +++ head/usr.sbin/fstyp/Makefile Thu Aug 20 15:37:47 2015 (r286964) @@ -13,6 +13,12 @@ MAN= fstyp.8 WARNS?= 0 +.include + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .if ${MK_ZFS} != "no" IGNORE_PRAGMA= YES Added: head/usr.sbin/fstyp/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/fstyp/tests/Makefile Thu Aug 20 15:37:47 2015 (r286964) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.sbin/fstyp + +ATF_TESTS_SH= fstyp_test + +FILES= ext2.img.bz2 +FILES+= ext3.img.bz2 +FILES+= ext4.img.bz2 +FILES+= ext4_with_label.img.bz2 +FILES+= ntfs.img.bz2 +FILES+= ntfs_with_label.img.bz2 +FILESDIR= ${TESTSDIR} + +.include Added: head/usr.sbin/fstyp/tests/ext2.img.bz2 ============================================================================== Binary file. No diff available. Added: head/usr.sbin/fstyp/tests/ext3.img.bz2 ============================================================================== Binary file. No diff available. Added: head/usr.sbin/fstyp/tests/ext4.img.bz2 ============================================================================== Binary file. No diff available. Added: head/usr.sbin/fstyp/tests/ext4_with_label.img.bz2 ============================================================================== Binary file. No diff available. Added: head/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/fstyp/tests/fstyp_test.sh Thu Aug 20 15:37:47 2015 (r286964) @@ -0,0 +1,234 @@ +# $FreeBSD$ + +atf_test_case cd9660 +cd9660_head() { + atf_set "descr" "fstyp(8) should detect cd9660 filesystems" +} +cd9660_body() { + atf_check -s exit:0 mkdir -p dir/emptydir # makefs requires a nonempty directory + atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir + atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img + atf_check -s exit:0 -o inline:"cd9660\n" fstyp -l cd9660.img +} + +atf_test_case cd9660_label +cd9660_label_head() { + atf_set "descr" "fstyp(8) can read the label on a cd9660 filesystem" +} +cd9660_label_body() { + atf_check -s exit:0 mkdir -p dir/emptydir # makefs requires a nonempty directory + atf_check -s exit:0 -o ignore makefs -t cd9660 -o label=Foo -Z -s 64m cd9660.img dir + atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img + # Note: cd9660 labels are always upper case + atf_check -s exit:0 -o inline:"cd9660 FOO\n" fstyp -l cd9660.img +} + +atf_test_case dir +dir_head() { + atf_set "descr" "fstyp(8) should fail on a directory" +} +dir_body() { + atf_check -s exit:0 mkdir dir + atf_check -s exit:1 -e match:"not a disk" fstyp dir +} + +atf_test_case empty +empty_head() { + atf_set "descr" "fstyp(8) should fail on an empty file" +} +empty_body() { + atf_check -s exit:0 touch empty + atf_check -s exit:1 -e match:"filesystem not recognized" fstyp empty +} + +atf_test_case ext2 +ext2_head() { + atf_set "descr" "fstyp(8) can detect ext2 filesystems" +} +ext2_body() { + bzcat $(atf_get_srcdir)/ext2.img.bz2 > ext2.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp ext2.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp -l ext2.img +} + +atf_test_case ext3 +ext3_head() { + atf_set "descr" "fstyp(8) can detect ext3 filesystems" +} +ext3_body() { + bzcat $(atf_get_srcdir)/ext3.img.bz2 > ext3.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp ext3.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp -l ext3.img +} + +atf_test_case ext4 +ext4_head() { + atf_set "descr" "fstyp(8) can detect ext4 filesystems" +} +ext4_body() { + bzcat $(atf_get_srcdir)/ext4.img.bz2 > ext4.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp ext4.img + atf_check -s exit:0 -o inline:"ext2fs\n" fstyp -l ext4.img +} + +atf_test_case ext4_label +ext4_label_head() { + atf_set "descr" "fstyp(8) can read the label on an ext4 filesystem" +} +ext4_label_body() { + bzcat $(atf_get_srcdir)/ext4_with_label.img.bz2 > ext4_with_label.img + atf_check -s exit:0 -o inline:"ext2fs foo\n" fstyp -l ext4_with_label.img +} + +atf_test_case fat12 +fat12_head() { + atf_set "descr" "fstyp(8) can detect FAT12 filesystems" +} +fat12_body() { + atf_check -s exit:0 truncate -s 64m msdos.img + atf_check -s exit:0 -o ignore -e ignore newfs_msdos -F 12 ./msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp -l msdos.img +} + +atf_test_case fat16 +fat16_head() { + atf_set "descr" "fstyp(8) can detect FAT16 filesystems" +} +fat16_body() { + atf_check -s exit:0 truncate -s 64m msdos.img + atf_check -s exit:0 -o ignore -e ignore newfs_msdos -F 16 ./msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp -l msdos.img +} + +atf_test_case fat32 +fat32_head() { + atf_set "descr" "fstyp(8) can detect FAT32 filesystems" +} +fat32_body() { + atf_check -s exit:0 truncate -s 64m msdos.img + atf_check -s exit:0 -o ignore -e ignore newfs_msdos -F 32 -c 1 \ + ./msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp -l msdos.img +} + +atf_test_case fat32_label +fat32_label_head() { + atf_set "descr" "fstyp(8) can read the label on an msdos filesystem" +} +fat32_label_body() { + atf_check -s exit:0 truncate -s 64m msdos.img + atf_check -s exit:0 -o ignore -e ignore newfs_msdos -F 32 -L Foo -c 1 \ + ./msdos.img + atf_check -s exit:0 -o inline:"msdosfs\n" fstyp msdos.img + # Note: msdos labels are always upper case + atf_check -s exit:0 -o inline:"msdosfs FOO\n" fstyp -l msdos.img +} + +atf_test_case ntfs +ntfs_head() { + atf_set "descr" "fstyp(8) can detect ntfs filesystems" +} +ntfs_body() { + bzcat $(atf_get_srcdir)/ntfs.img.bz2 > ntfs.img + atf_check -s exit:0 -o inline:"ntfs\n" fstyp ntfs.img + atf_check -s exit:0 -o inline:"ntfs\n" fstyp -l ntfs.img +} + +atf_test_case ntfs_with_label +ntfs_with_label_head() { + atf_set "descr" "fstyp(8) can read labels on ntfs filesystems" +} +ntfs_with_label_body() { + bzcat $(atf_get_srcdir)/ntfs_with_label.img.bz2 > ntfs_with_label.img + atf_check -s exit:0 -o inline:"ntfs\n" fstyp ntfs_with_label.img + atf_check -s exit:0 -o inline:"ntfs Foo\n" fstyp -l ntfs_with_label.img +} + +atf_test_case ufs1 +ufs1_head() { + atf_set "descr" "fstyp(8) should detect UFS version 1 filesystems" +} +ufs1_body() { + atf_check -s exit:0 mkdir dir + atf_check -s exit:0 -o ignore makefs -Z -s 64m ufs.img dir + atf_check -s exit:0 -o inline:"ufs\n" fstyp ufs.img + atf_check -s exit:0 -o inline:"ufs\n" fstyp -l ufs.img +} + +atf_test_case ufs2 +ufs2_head() { + atf_set "descr" "fstyp(8) should detect UFS version 2 filesystems" +} +ufs2_body() { + atf_check -s exit:0 mkdir dir + atf_check -s exit:0 -o ignore makefs -o version=2 -Z -s 64m ufs.img dir + atf_check -s exit:0 -o inline:"ufs\n" fstyp ufs.img + atf_check -s exit:0 -o inline:"ufs\n" fstyp -l ufs.img +} + +atf_test_case ufs2_label +ufs2_label_head() { + atf_set "descr" "fstyp(8) can read the label on a UFS v2 filesystem" +} +ufs2_label_body() { + atf_check -s exit:0 mkdir dir + atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir + atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img +} + +atf_test_case ufs_on_device cleanup +ufs_on_device_head() { + atf_set "descr" "fstyp(8) should work on device nodes" + atf_set "require.user" "root" +} +ufs_on_device_body() { + mdconfig -a -t swap -s 64m > mdname + md=$(cat mdname) + if [ -z "$md" ]; then + atf_fail "Failed to create md(4) device" + fi + atf_check -s exit:0 -o ignore newfs -L foo /dev/$md + atf_check -s exit:0 -o inline:"ufs\n" fstyp /dev/$md + atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l /dev/$md +} +ufs_on_device_cleanup() { + md=$(cat mdname) + if [ -n "$md" ]; then + mdconfig -d -u "$md" + fi +} + +atf_test_case zeros +zeros_head() { + atf_set "descr" "fstyp(8) should fail on a zero-filled file" +} +zeros_body() { + atf_check -s exit:0 truncate -s 256m zeros + atf_check -s exit:1 -e match:"filesystem not recognized" fstyp zeros +} + + +atf_init_test_cases() { + atf_add_test_case cd9660 + atf_add_test_case cd9660_label + atf_add_test_case dir + atf_add_test_case empty + atf_add_test_case ext2 + atf_add_test_case ext3 + atf_add_test_case ext4 + atf_add_test_case ext4_label + atf_add_test_case fat12 + atf_add_test_case fat16 + atf_add_test_case fat32 + atf_add_test_case fat32_label + atf_add_test_case ntfs + atf_add_test_case ntfs_with_label + atf_add_test_case ufs1 + atf_add_test_case ufs2 + atf_add_test_case ufs2_label + atf_add_test_case ufs_on_device + atf_add_test_case zeros +} Added: head/usr.sbin/fstyp/tests/ntfs.img.bz2 ============================================================================== Binary file. No diff available. Added: head/usr.sbin/fstyp/tests/ntfs_with_label.img.bz2 ============================================================================== Binary file. No diff available. From owner-svn-src-head@freebsd.org Thu Aug 20 16:07:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 866AC9BE7DF; Thu, 20 Aug 2015 16:07:52 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71BD01063; Thu, 20 Aug 2015 16:07:52 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KG7qbx014605; Thu, 20 Aug 2015 16:07:52 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KG7qLm014602; Thu, 20 Aug 2015 16:07:52 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201508201607.t7KG7qLm014602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 20 Aug 2015 16:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286965 - in head: sbin/camcontrol sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 16:07:52 -0000 Author: ken Date: Thu Aug 20 16:07:51 2015 New Revision: 286965 URL: https://svnweb.freebsd.org/changeset/base/286965 Log: Revamp camcontrol(8) fwdownload support and add the opcodes subcommand. The significant changes and bugs fixed here are: 1. Fixed a bug in the progress display code: When the user's filename is too big, or his terminal width is too small, the progress code could wind up using a negative number for the length of the "stars" that it uses to indicate progress. This negative value was assigned to an unsigned variable, resulting in a very large positive value. The result is that we wound up writing garbage from memory to the user's terminal. With an 80 column terminal, a file name length of more than 35 characters would generate this problem. To address this, we now set a minimum progress bar length, and truncate the user's file name as needed. This has been tested with large filenames and small terminals, and at least produces reasonable results. If the terminal is too narrow, the progress display takes up an additional line with each update, but this is more user friendly than writing garbage to the tty. 2. SATA drives connected via a SATA controller didn't have SCSI Inquiry data populated in struct cam_device. This meant that the code in fw_get_vendor() in fwdownload.c would try to match a zero-length vendor ID, and so return the first entry in the vendor table. (Which used to be HITACHI.) Fixed by grabbing identify data, passing the identify buffer into fw_get_vendor(), and matching against the model name. 3. SATA drives connected via a SAS controller do have Inquiry data populated. The table included a couple of entries -- "ATA ST" and "ATA HDS", intended to handle Seagate and Hitachi SATA drives attached via a SAS controller. SCSI to ATA translation layers use a vendor ID of "ATA" (which is standard), and then the model name from the ATA identify data as the SCSI product name when they are returning data on SATA disks. The cam_strmatch code will match the first part of the string (because the length it is given is the length of the vendor, "ATA"), and return 0 (i.e. a match). So all SATA drives attached to a SAS controller would be programmed using the Seagate method (WRITE BUFFER mode 7) of SCSI firmware downloading. 4. Issue #2 above covered up a bug in fw_download_img() -- if the maximum packet size in the vendor table was 0, it tried to default to a packet size of 32K. But then it didn't actually succeed in doing that, because it set the packet size to the value that was in the vendor table (0). Now that we actually have ATA attached drives fall use the VENDOR_ATA case, we need a reasonable default packet size. So this is fixed to properly set the default packet size. 5. Add support for downloading firmware to IBM LTO drives, and add a firmware file validation method to make sure that the firmware file matches the drive type. IBM tape drives include a Load ID and RU name in their vendor-specific VPD page 0x3. Those should match the IDs in the header of the firmware file to insure that the proper firmware file is loaded. 6. This also adds a new -q option to the camcontrol fwdownload subcommand to suppress informational output. When -q is used in combination with -y, the firmware upgrade will happen without prompting and without output except if an error condition occurs. 7. Re-add support for printing out SCSI inquiry information when asking the user to confirm that they want to download firmware, and add printing of ATA Identify data if it is a SATA disk. This was removed in r237281 when support for flashing ATA disks was added. 8. Add a new camcontrol(8) "opcodes" subcommand, and use the underlying code to get recommended timeout values for drive firmware downloads. Many SCSI devices support the REPORT SUPPORTED OPERATION CODES command, and some support the optional timeout descriptor that specifies nominal and recommended timeouts for the commands supported by the device. The new camcontrol opcodes subcommand allows displaying all opcodes supported by a drive, information about which fields in a SCSI CDB are actually used by a given SCSI device, and the nominal and recommended timeout values for each command. Since firmware downloads can take a long time in some devices, and the time varies greatly between different types of devices, take advantage of the infrastructure used by the camcontrol opcodes subcommand to determine the best timeout to use for the WRITE BUFFER command in SCSI device firmware downloads. If the device recommends a timeout, it is likely to be more accurate than the default 50 second timeout used by the firmware download code. If the user specifies a timeout, it will override the default or device recommended timeout. If the device doesn't support timeout descriptors, we fall back to the default. 9. Instead of downloading firmware to SATA drives behind a SAS controller using WRITE BUFFER, use the SCSI ATA PASS-THROUGH command to compose an ATA DOWNLOAD MICROCODE command and it to the drive. The previous version of this code attempted to send a SCSI WRITE BUFFER command to SATA drives behind a SAS controller. Although that is part of the SAT-3 spec, it doesn't work with the parameters used with LSI controllers at least. 10.Add a new mechanism for making common ATA passthrough and ATA-behind-SCSI passthrough commands. The existing camcontrol(8) ATA command mechanism checks the device type on every command executed. That works fine for individual commands, but is cumbersome for things like a firmware download that send a number of commands. The fwdownload code detects the device type up front, and then sends the appropriate commands. 11.In simulation mode (-s), if the user specifies the -v flag, print out the SCSI CDB or ATA registers that would be sent to the drive. This will aid in debugging any firmware download issues. sbin/camcontrol/fwdownload.c: Add a device type to the fw_vendor structure, so that we can specify different download methods for different devices from the same vendor. In this case, IBM hard drives (from when they still made hard drives) and tape drives. Add a tur_status field to the fw_vendor structure so that we can specify whether the drive to be upgraded should be ready, not ready, or whether it doesn't matter. Add the corresponding capability in fw_download_img(). Add comments describing each of the vendor table fields. Add HGST and SmrtStor to the supported SCSI vendors list. In fw_get_vendor(), look at ATA identify data if we have a SATA device to try to identify what the drive vendor is. Add IBM firmware file validation. This gets VPD page 0x3, and compares the Load ID and RU name in the page to the values included in the header. The validation code will refuse to load a firmware file if the values don't match. This does allow the user to attempt a downgrade; whether or not it succeeds will likely depend on the drive settings. Add a -q option, and disable all informative output (progress bars, etc.) when this is enabled. Re-add the inquiry in the confirmation dialog so the user has a better idea of which device he is talking to. Add support for displaying ATA identify data. Don't automatically disable confirmation in simulation (-s) mode. This allows the user to see the inquiry or identify data in the dialog, and see exactly what they would see when the command actually runs. Also, in simulation mode, if the user specifies the -v flag, print out the SCSI CDB or ATA registers that would be sent to the drive. This will aid in debugging any firmware download issues. Add a timeout field and timeout type to the firmware download vendor table. This allows specifying a default timeout and allows specifying whether we should attempt to probe for a recommended timeout from the drive. Add a new fuction, fw_get_timeout(), that will determine which timeout to use for the WRITE BUFFER command. If the user specifies a timeout, we always use that. Otherwise, we will use the drive recommended timeout, if available, and fall back to the default when a drive recommended timeout isn't available. When we prompt the user, tell him what timeout we're going to use, and the source of the timeout. Revamp the way SATA devices are handled. In fwdownload(), use the new get_device_type() function to determine what kind of device we're talking to. Allow firmware downloads to any SATA device, but restrict SCSI downloads to known devices. (The latter is not a change in behavior.) Break out the "ready" check from fw_download_img() into a new subfunction, fw_check_device_ready(). This sends the appropriate command to the device in question -- a TEST UNIT READY or an IDENTIFY. The IDENTIFY for SATA devices a SAT layer is done using the SCSI ATA PASS-THROUGH command. Use the new build_ata_cmd() function to build either a SCSI or ATA I/O CCB to issue the DOWNLOAD MICROCODE command to SATA devices. build_ata_cmd() figures looks at the devtype argument and fills in the correct CCB type and CDB or ATA registers. Revamp the vendor table to remove the previous vendor-specific ATA entries and use a generic ATA vendor placeholder. We currently use the same method for all ATA drives, although we may have to add vendor-specific behavior once we test this with more drives. sbin/camcontrol/progress.c: In progress_draw(), make barlength a signed value so that we can easily detect a negative value. If barlength (the length of the progress bar) would wind up negative due to a small TTY width or a large filename, set the bar length to the new minimum (10 stars) and truncate the user's filename. We will truncate it down to 0 characters if necessary. Calculate a new prefix_len variable (user's filename length) and use it as the precision when printing the filename. sbin/camcontrol/camcontrol.c: Implement a new camcontrol(8) subcommand, "opcodes". The opcodes subcommand allows displaying the entire list of SCSI commands supported by a device, or details on an individual command. In either case, it can display nominal and recommended timeout values. Add the scsiopcodes() function, which calls the new scsigetopcodes() function to fetch opcode data from a drive. Add two new functions, scsiprintoneopcode() and scsiprintopcodes(), which print information about one opcode or all opcodes, respectively. Remove the get_disk_type() function. It is no longer used. Add a new function, dev_has_vpd_page(), that fetches the supported INQUIRY VPD list from a device and tells the caller whether the requested VPD page is available. Add a new function, get_device_type(), that returns a more precise device type than the old get_disk_type() function. The get_disk_type() function only distinguished between SCSI and ATA devices, and SATA devices behind a SCSI to ATA translation layer were considered to be "SCSI". get_device_type() offers a third type, CC_DT_ATA_BEHIND_SCSI. We need to know this to know whether to attempt to send ATA passthrough commands. If the device has the ATA Information VPD page (0x89), then it is an ATA device behind a SCSI to ATA translation layer. Remove the type argument from the fwdownload() subcommand. Add a new function, build_ata_cmd(), that will take one set of common arguments and build either a SCSI or ATA I/O CCB, depending on the device type passed in. sbin/camcontrol/camcontrol.h: Add a prototype for scsigetopcodes(). Add a new enumeration, camcontrol_devtype. Add prototypes for dev_has_vpd_page(), get_device_type() and build_ata_cmd(). Remove the type argument from the fwdownload() subcommand. sbin/camcontrol/camcontrol.8 Explain that the fwdownload subcommand will use the drive recommended timeout if available, and that the user can override the timeout. Document the new opcodes subcommand. Explain that we will attempt to download firmware to any SATA device. Document supported SCSI vendors, and models tested if known. Explain the commands used to download firmware for the three different drive and controller combinations. Document that the -v flag in simulation mode for the fwdownload subcommand will print out the SCSI CDBs or ATA registers that would be used. sys/cam/scsi/scsi_all.h: Add new bit definitions for the one opcode descriptor for the REPORT SUPPORTED OPCODES command. Add a function prototype for scsi_report_supported_opcodes(). sys/cam/scsi/scsi_all.c: Add a new CDB building function, scsi_report_supported_opcodes(). Sponsored by: Spectra Logic MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/progress.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Aug 20 15:37:47 2015 (r286964) +++ head/sbin/camcontrol/camcontrol.8 Thu Aug 20 16:07:51 2015 (r286965) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2015 +.Dd August 6, 2015 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -253,8 +253,9 @@ .Op device id .Op generic args .Aq Fl f Ar fw_image -.Op Fl y +.Op Fl q .Op Fl s +.Op Fl y .Nm .Ic security .Op device id @@ -311,6 +312,14 @@ .Op Fl T Ar elem_type .Op Fl V Ar lv_num .Nm +.Ic opcodes +.Op device id +.Op generic args +.Op Fl o Ar opcode +.Op Fl s Ar service_action +.Op Fl N +.Op Fl T +.Nm .Ic help .Sh DESCRIPTION The @@ -1516,24 +1525,41 @@ without prompting for confirmation The password for all HPA commands is limited to 32 characters, longer passwords will fail. .It Ic fwdownload -Program firmware of the named SCSI device using the image file provided. +Program firmware of the named +.Tn SCSI +or ATA device using the image file provided. .Pp -Current list of supported vendors: -.Bl -bullet -offset indent -compact -.It -HITACHI -.It -HP -.It -IBM -.It -PLEXTOR -.It -QUANTUM -.It -SAMSUNG -.It -SEAGATE +If the device is a +.Tn SCSI +device and it provides a recommended timeout for the WRITE BUFFER command +(see the +.Nm +opcodes subcommand), that timeout will be used for the firmware download. +The drive-recommended timeout value may be overridden on the command line +with the +.Fl t +option. +.Pp +Current list of supported vendors for SCSI/SAS drives: +.Bl -tag -width 10n +.It HGST +Tested with 4TB SAS drives, model number HUS724040ALS640. +.It HITACHI +.It HP +.It IBM +Tested with LTO-5 (ULTRIUM-HH5) and LTO-6 (ULTRIUM-HH6) tape drives. +There is a separate table entry for hard drives, because the update method +for hard drives is different than the method for tape drives. +.It PLEXTOR +.It QUALSTAR +.It QUANTUM +.It SAMSUNG +Tested with SM1625 SSDs. +.It SEAGATE +Tested with Constellation ES (ST32000444SS), ES.2 (ST33000651SS) and +ES.3 (ST1000NM0023) drives. +.It SmrtStor +Tested with 400GB Optimus SSDs (TXA2D20400GA6001). .El .Pp .Em WARNING! WARNING! WARNING! @@ -1547,23 +1573,81 @@ Extra caution should be taken when using guarantee it will not break a device from the listed vendors. Ensure that you have a recent backup of the data on the device before performing a firmware update. +.Pp +Note that unknown +.Tn SCSI +protocol devices will not be programmed, since there is little chance of +the firmware download succeeding. +.Pp +.Nm +will currently attempt a firmware download to any +.Tn ATA +or +.Tn SATA +device, since the standard +.Tn ATA +DOWNLOAD MICROCODE command may work. +Firmware downloads to +.Tn ATA +and +.Tn SATA +devices are supported for devices connected +to standard +.Tn ATA +and +.Tn SATA +controllers, and devices connected to SAS controllers +with +.Tn SCSI +to +.Tn ATA +translation capability. +In the latter case, +.Nm +uses the +.Tn SCSI +.Tn ATA +PASS-THROUGH command to send the +.Tn ATA +DOWNLOAD MICROCODE command to the drive. +Some +.Tn SCSI +to +.Tn ATA +translation implementations don't work fully when translating +.Tn SCSI +WRITE BUFFER commands to +.Tn ATA +DOWNLOAD MICROCODE commands, but do support +.Tn ATA +passthrough well enough to do a firmware download. .Bl -tag -width 11n .It Fl f Ar fw_image Path to the firmware image file to be downloaded to the specified device. -.It Fl y -Do not ask for confirmation. +.It Fl q +Do not print informational messages, only print errors. +This option should be used with the +.Fl y +option to suppress all output. .It Fl s Run in simulation mode. -Packet sizes that will be sent are shown, but no actual packet is sent to the -device. -No confirmation is asked in simulation mode. +Device checks are run and the confirmation dialog is shown, but no firmware +download will occur. .It Fl v -Besides showing sense information in case of a failure, the verbose option -causes -.Nm -to output a line for every firmware segment that is sent to the device by the -fwdownload command --- the same as the ones shown in simulation mode. +Show +.Tn SCSI +or +.Tn ATA +errors in the event of a failure. +.Pp +In simulation mode, print out the +.Tn SCSI +CDB +or +.Tn ATA +register values that would be used for the firmware download command. +.It Fl y +Do not ask for confirmation. .El .It Ic persist Persistent reservation support. @@ -1958,6 +2042,52 @@ and Specify the number of the logical volume to operate on. If the media has multiple logical volumes, this will allow displaying or writing attributes on the given logical volume. +.It Ic opcodes +Issue the REPORT SUPPORTED OPCODES service action of the +.Tn SCSI +MAINTENANCE IN +command. +Without arguments, this command will return a list of all +.Tn SCSI +commands supported by the device, including service actions of commands +that support service actions. +It will also include the +.Tn SCSI +CDB (Command Data Block) length for each command, and the description of +each command if it is known. +.Bl -tag -width 18n +.It Fl o Ar opcode +Request information on a specific opcode instead of the list of supported +commands. +If supported, the target will return a CDB-like structure that indicates +the opcode, service action (if any), and a mask of bits that are supported +in that CDB. +.It Fl s Ar service_action +For commands that support a service action, specify the service action to +query. +.It Fl N +If a service action is specified for a given opcode, and the device does +not support the given service action, the device should not return a +.Tn SCSI +error, but rather indicate in the returned parameter data that the command +is not supported. +By default, if a service action is specified for an opcode, and service +actions are not supported for the opcode in question, the device will +return an error. +.It Fl T +Include timeout values. +This option works with the default display, which includes all commands +supported by the device, and with the +.Fl o +and +.Fl s +options, which request information on a specific command and service +action. +This requests that the device report Nominal and Recommended timeout values +for the given command or commands. +The timeout values are in seconds. +The timeout descriptor also includes a command-specific +.El .It Ic help Print out verbose usage information. .El Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Aug 20 15:37:47 2015 (r286964) +++ head/sbin/camcontrol/camcontrol.c Thu Aug 20 16:07:51 2015 (r286965) @@ -99,7 +99,8 @@ typedef enum { CAM_CMD_PERSIST = 0x00000020, CAM_CMD_APM = 0x00000021, CAM_CMD_AAM = 0x00000022, - CAM_CMD_ATTRIB = 0x00000023 + CAM_CMD_ATTRIB = 0x00000023, + CAM_CMD_OPCODES = 0x00000024 } cam_cmdmask; typedef enum { @@ -221,11 +222,12 @@ static struct camcontrol_opts option_tab {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, {"apm", CAM_CMD_APM, CAM_ARG_NONE, "l:"}, {"aam", CAM_CMD_AAM, CAM_ARG_NONE, "l:"}, - {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, + {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"}, + {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -264,7 +266,6 @@ static int scsistart(struct cam_device * int retry_count, int timeout); static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); static int scsiserial(struct cam_device *device, int retry_count, int timeout); -static int camxferrate(struct cam_device *device); #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); @@ -319,6 +320,14 @@ static int atasecurity(struct cam_device int argc, char **argv, char *combinedopt); static int atahpa(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int scsiprintoneopcode(struct cam_device *device, int req_opcode, + int sa_set, int req_sa, uint8_t *buf, + uint32_t valid_len); +static int scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf, + uint32_t valid_len); +static int scsiopcodes(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout, + int verbose); #endif /* MINIMALISTIC */ #ifndef min @@ -1018,7 +1027,7 @@ scsiserial(struct cam_device *device, in return(0); } -static int +int camxferrate(struct cam_device *device) { struct ccb_pathinq cpi; @@ -2034,7 +2043,7 @@ atahpa_freeze_lock(struct cam_device *de } -static int +int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) { @@ -4940,26 +4949,173 @@ get_cgd_bailout: return(retval); } -/* return the type of disk (really the command type) */ -static const char * -get_disk_type(struct cam_device *device) -{ - struct ccb_getdev cgd; - - (void) memset(&cgd, 0x0, sizeof(cgd)); - get_cgd(device, &cgd); - switch(cgd.protocol) { +/* + * Returns 1 if the device has the VPD page, 0 if it does not, and -1 on an + * error. + */ +int +dev_has_vpd_page(struct cam_device *dev, uint8_t page_id, int retry_count, + int timeout, int verbosemode) +{ + union ccb *ccb = NULL; + struct scsi_vpd_supported_page_list sup_pages; + int i; + int retval = 0; + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warn("Unable to allocate CCB"); + retval = -1; + goto bailout; + } + + /* cam_getccb cleans up the header, caller has to zero the payload */ + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + + bzero(&sup_pages, sizeof(sup_pages)); + + scsi_inquiry(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /* tag_action */ MSG_SIMPLE_Q_TAG, + /* inq_buf */ (u_int8_t *)&sup_pages, + /* inq_len */ sizeof(sup_pages), + /* evpd */ 1, + /* page_code */ SVPD_SUPPORTED_PAGE_LIST, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ timeout ? timeout : 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (retry_count != 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + if (cam_send_ccb(dev, ccb) < 0) { + cam_freeccb(ccb); + retval = -1; + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (verbosemode != 0) + cam_error_print(dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + retval = -1; + goto bailout; + } + + for (i = 0; i < sup_pages.length; i++) { + if (sup_pages.list[i] == page_id) { + retval = 1; + goto bailout; + } + } +bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + return (retval); +} + +/* + * devtype is filled in with the type of device. + * Returns 0 for success, non-zero for failure. + */ +int +get_device_type(struct cam_device *dev, int retry_count, int timeout, + int verbosemode, camcontrol_devtype *devtype) +{ + struct ccb_getdev cgd; + int retval = 0; + + retval = get_cgd(dev, &cgd); + if (retval != 0) + goto bailout; + + switch (cgd.protocol) { case PROTO_SCSI: - return "scsi"; + break; case PROTO_ATA: case PROTO_ATAPI: case PROTO_SATAPM: - return "ata"; + *devtype = CC_DT_ATA; + goto bailout; + break; /*NOTREACHED*/ default: - return "unknown"; + *devtype = CC_DT_UNKNOWN; + goto bailout; + break; /*NOTREACHED*/ + } + + /* + * Check for the ATA Information VPD page (0x89). If this is an + * ATA device behind a SCSI to ATA translation layer, this VPD page + * should be present. + * + * If that VPD page isn't present, or we get an error back from the + * INQUIRY command, we'll just treat it as a normal SCSI device. + */ + retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, + timeout, verbosemode); + if (retval == 1) + *devtype = CC_DT_ATA_BEHIND_SCSI; + else + *devtype = CC_DT_SCSI; + + retval = 0; + +bailout: + return (retval); +} + +void +build_ata_cmd(union ccb *ccb, uint32_t retry_count, uint32_t flags, + uint8_t tag_action, uint8_t protocol, uint8_t ata_flags, uint16_t features, + uint16_t sector_count, uint64_t lba, uint8_t command, uint8_t *data_ptr, + uint16_t dxfer_len, uint8_t sense_len, uint32_t timeout, + int is48bit, camcontrol_devtype devtype) +{ + if (devtype == CC_DT_ATA) { + cam_fill_ataio(&ccb->ataio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*flags*/ flags, + /*tag_action*/ tag_action, + /*data_ptr*/ data_ptr, + /*dxfer_len*/ dxfer_len, + /*timeout*/ timeout); + if (is48bit || lba > ATA_MAX_28BIT_LBA) + ata_48bit_cmd(&ccb->ataio, command, features, lba, + sector_count); + else + ata_28bit_cmd(&ccb->ataio, command, features, lba, + sector_count); + } else { + if (is48bit || lba > ATA_MAX_28BIT_LBA) + protocol |= AP_EXTEND; + + scsi_ata_pass_16(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*flags*/ flags, + /*tag_action*/ tag_action, + /*protocol*/ protocol, + /*ata_flags*/ ata_flags, + /*features*/ features, + /*sector_count*/ sector_count, + /*lba*/ lba, + /*command*/ command, + /*control*/ 0, + /*data_ptr*/ data_ptr, + /*dxfer_len*/ dxfer_len, + /*sense_len*/ sense_len, + /*timeout*/ timeout); } } + static void cpi_print(struct ccb_pathinq *cpi) { @@ -8050,6 +8206,461 @@ ataaxm(struct cam_device *device, int ar return (retval); } +int +scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, + int show_sa_errors, int sa_set, int service_action, + int timeout_desc, int retry_count, int timeout, int verbosemode, + uint32_t *fill_len, uint8_t **data_ptr) +{ + union ccb *ccb = NULL; + uint8_t *buf = NULL; + uint32_t alloc_len = 0, num_opcodes; + uint32_t valid_len = 0; + uint32_t avail_len = 0; + struct scsi_report_supported_opcodes_all *all_hdr; + struct scsi_report_supported_opcodes_one *one; + int options = 0; + int retval = 0; + + /* + * Make it clear that we haven't yet allocated or filled anything. + */ + *fill_len = 0; + *data_ptr = NULL; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + retval = 1; + goto bailout; + } + + /* cam_getccb cleans up the header, caller has to zero the payload */ + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + + if (opcode_set != 0) { + options |= RSO_OPTIONS_OC; + num_opcodes = 1; + alloc_len = sizeof(*one) + CAM_MAX_CDBLEN; + } else { + num_opcodes = 256; + alloc_len = sizeof(*all_hdr) + (num_opcodes * + sizeof(struct scsi_report_supported_opcodes_descr)); + } + + if (timeout_desc != 0) { + options |= RSO_RCTD; + alloc_len += num_opcodes * + sizeof(struct scsi_report_supported_opcodes_timeout); + } + + if (sa_set != 0) { + options |= RSO_OPTIONS_OC_SA; + if (show_sa_errors != 0) + options &= ~RSO_OPTIONS_OC; + } + +retry_alloc: + if (buf != NULL) { + free(buf); + buf = NULL; + } + + buf = malloc(alloc_len); + if (buf == NULL) { + warn("Unable to allocate %u bytes", alloc_len); + retval = 1; + goto bailout; + } + bzero(buf, alloc_len); + + scsi_report_supported_opcodes(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*options*/ options, + /*req_opcode*/ opcode, + /*req_service_action*/ service_action, + /*data_ptr*/ buf, + /*dxfer_len*/ alloc_len, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 10000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (retry_count != 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + if (cam_send_ccb(device, ccb) < 0) { + perror("error sending REPORT SUPPORTED OPERATION CODES"); + retval = 1; + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (verbosemode != 0) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + + retval = 1; + goto bailout; + } + + valid_len = ccb->csio.dxfer_len - ccb->csio.resid; + + if (((options & RSO_OPTIONS_MASK) == RSO_OPTIONS_ALL) + && (valid_len >= sizeof(*all_hdr))) { + all_hdr = (struct scsi_report_supported_opcodes_all *)buf; + avail_len = scsi_4btoul(all_hdr->length) + sizeof(*all_hdr); + } else if (((options & RSO_OPTIONS_MASK) != RSO_OPTIONS_ALL) + && (valid_len >= sizeof(*one))) { + uint32_t cdb_length; + + one = (struct scsi_report_supported_opcodes_one *)buf; + cdb_length = scsi_2btoul(one->cdb_length); + avail_len = sizeof(*one) + cdb_length; + if (one->support & RSO_ONE_CTDP) { + struct scsi_report_supported_opcodes_timeout *td; + + td = (struct scsi_report_supported_opcodes_timeout *) + &buf[avail_len]; + if (valid_len >= (avail_len + sizeof(td->length))) { + avail_len += scsi_2btoul(td->length) + + sizeof(td->length); + } else { + avail_len += sizeof(*td); + } + } + } + + /* + * avail_len could be zero if we didn't get enough data back from + * thet target to determine + */ + if ((avail_len != 0) + && (avail_len > valid_len)) { + alloc_len = avail_len; + goto retry_alloc; + } + + *fill_len = valid_len; + *data_ptr = buf; +bailout: + if (retval != 0) + free(buf); + + cam_freeccb(ccb); + + return (retval); +} + +static int +scsiprintoneopcode(struct cam_device *device, int req_opcode, int sa_set, + int req_sa, uint8_t *buf, uint32_t valid_len) +{ + struct scsi_report_supported_opcodes_one *one; + struct scsi_report_supported_opcodes_timeout *td; + uint32_t cdb_len = 0, td_len = 0; + const char *op_desc = NULL; + unsigned int i; + int retval = 0; + + one = (struct scsi_report_supported_opcodes_one *)buf; + + /* + * If we don't have the full single opcode descriptor, no point in + * continuing. + */ + if (valid_len < __offsetof(struct scsi_report_supported_opcodes_one, + cdb_length)) { + warnx("Only %u bytes returned, not enough to verify support", + valid_len); + retval = 1; + goto bailout; + } + + op_desc = scsi_op_desc(req_opcode, &device->inq_data); + + printf("%s (0x%02x)", op_desc != NULL ? op_desc : "UNKNOWN", + req_opcode); + if (sa_set != 0) + printf(", SA 0x%x", req_sa); + printf(": "); + + switch (one->support & RSO_ONE_SUP_MASK) { + case RSO_ONE_SUP_UNAVAIL: + printf("No command support information currently available\n"); + break; + case RSO_ONE_SUP_NOT_SUP: + printf("Command not supported\n"); + retval = 1; + goto bailout; + break; /*NOTREACHED*/ + case RSO_ONE_SUP_AVAIL: + printf("Command is supported, complies with a SCSI standard\n"); + break; + case RSO_ONE_SUP_VENDOR: + printf("Command is supported, vendor-specific " + "implementation\n"); + break; + default: + printf("Unknown command support flags 0x%#x\n", + one->support & RSO_ONE_SUP_MASK); + break; + } + + /* + * If we don't have the CDB length, it isn't exactly an error, the + * command probably isn't supported. + */ + if (valid_len < __offsetof(struct scsi_report_supported_opcodes_one, + cdb_usage)) + goto bailout; + + cdb_len = scsi_2btoul(one->cdb_length); + + /* + * If our valid data doesn't include the full reported length, + * return. The caller should have detected this and adjusted his + * allocation length to get all of the available data. + */ + if (valid_len < sizeof(*one) + cdb_len) { + retval = 1; + goto bailout; + } + + /* + * If all we have is the opcode, there is no point in printing out + * the usage bitmap. + */ + if (cdb_len <= 1) { + retval = 1; + goto bailout; + } + + printf("CDB usage bitmap:"); + for (i = 0; i < cdb_len; i++) { + printf(" %02x", one->cdb_usage[i]); + } + printf("\n"); + + /* + * If we don't have a timeout descriptor, we're done. + */ + if ((one->support & RSO_ONE_CTDP) == 0) + goto bailout; + + /* + * If we don't have enough valid length to include the timeout + * descriptor length, we're done. + */ + if (valid_len < (sizeof(*one) + cdb_len + sizeof(td->length))) + goto bailout; + + td = (struct scsi_report_supported_opcodes_timeout *) + &buf[sizeof(*one) + cdb_len]; + td_len = scsi_2btoul(td->length); + td_len += sizeof(td->length); + + /* + * If we don't have the full timeout descriptor, we're done. + */ + if (td_len < sizeof(*td)) + goto bailout; + + /* + * If we don't have enough valid length to contain the full timeout + * descriptor, we're done. + */ + if (valid_len < (sizeof(*one) + cdb_len + td_len)) + goto bailout; + + printf("Timeout information:\n"); + printf("Command-specific: 0x%02x\n", td->cmd_specific); + printf("Nominal timeout: %u seconds\n", + scsi_4btoul(td->nominal_time)); + printf("Recommended timeout: %u seconds\n", + scsi_4btoul(td->recommended_time)); + +bailout: + return (retval); +} + +static int +scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf, + uint32_t valid_len) +{ + struct scsi_report_supported_opcodes_all *hdr; + struct scsi_report_supported_opcodes_descr *desc; + uint32_t avail_len = 0, used_len = 0; + uint8_t *cur_ptr; + int retval = 0; + + if (valid_len < sizeof(*hdr)) { + warnx("%s: not enough returned data (%u bytes) opcode list", + __func__, valid_len); + retval = 1; + goto bailout; + } + hdr = (struct scsi_report_supported_opcodes_all *)buf; + avail_len = scsi_4btoul(hdr->length); + avail_len += sizeof(hdr->length); + /* + * Take the lesser of the amount of data the drive claims is + * available, and the amount of data the HBA says was returned. + */ + avail_len = MIN(avail_len, valid_len); + + used_len = sizeof(hdr->length); + + printf("%-6s %4s %8s ", + "Opcode", "SA", "CDB len" ); + + if (td_req != 0) + printf("%5s %6s %6s ", "CS", "Nom", "Rec"); + printf(" Description\n"); + + while ((avail_len - used_len) > sizeof(*desc)) { + struct scsi_report_supported_opcodes_timeout *td; + uint32_t td_len; + const char *op_desc = NULL; + + cur_ptr = &buf[used_len]; + desc = (struct scsi_report_supported_opcodes_descr *)cur_ptr; + + op_desc = scsi_op_desc(desc->opcode, &device->inq_data); + if (op_desc == NULL) + op_desc = "UNKNOWN"; + + printf("0x%02x %#4x %8u ", desc->opcode, + scsi_2btoul(desc->service_action), + scsi_2btoul(desc->cdb_length)); + + used_len += sizeof(*desc); + + if ((desc->flags & RSO_CTDP) == 0) { + printf(" %s\n", op_desc); + continue; + } + + /* + * If we don't have enough space to fit a timeout + * descriptor, then we're done. + */ + if (avail_len - used_len < sizeof(*td)) { + used_len = avail_len; + printf(" %s\n", op_desc); + continue; + } + cur_ptr = &buf[used_len]; + td = (struct scsi_report_supported_opcodes_timeout *)cur_ptr; + td_len = scsi_2btoul(td->length); + td_len += sizeof(td->length); + + used_len += td_len; + /* + * If the given timeout descriptor length is less than what + * we understand, skip it. + */ + if (td_len < sizeof(*td)) { + printf(" %s\n", op_desc); + continue; + } + + printf(" 0x%02x %6u %6u %s\n", td->cmd_specific, + scsi_4btoul(td->nominal_time), + scsi_4btoul(td->recommended_time), op_desc); + } +bailout: + return (retval); +} + +static int +scsiopcodes(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout, int verbosemode) +{ + int c; + uint32_t opcode = 0, service_action = 0; + int td_set = 0, opcode_set = 0, sa_set = 0; + int show_sa_errors = 1; + uint32_t valid_len = 0; + uint8_t *buf = NULL; + char *endptr; + int retval = 0; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'N': + show_sa_errors = 0; + break; + case 'o': + opcode = strtoul(optarg, &endptr, 0); + if (*endptr != '\0') { + warnx("Invalid opcode \"%s\", must be a number", + optarg); + retval = 1; + goto bailout; + } + if (opcode > 0xff) { + warnx("Invalid opcode 0x%#x, must be between" + "0 and 0xff inclusive", opcode); + retval = 1; + goto bailout; + } + opcode_set = 1; + break; + case 's': + service_action = strtoul(optarg, &endptr, 0); + if (*endptr != '\0') { + warnx("Invalid service action \"%s\", must " + "be a number", optarg); + retval = 1; + goto bailout; + } + if (service_action > 0xffff) { + warnx("Invalid service action 0x%#x, must " + "be between 0 and 0xffff inclusive", + service_action); + retval = 1; + } + sa_set = 1; + break; + case 'T': + td_set = 1; + break; + default: + break; + } + } + + if ((sa_set != 0) + && (opcode_set == 0)) { + warnx("You must specify an opcode with -o if a service " + "action is given"); + retval = 1; + goto bailout; + } + retval = scsigetopcodes(device, opcode_set, opcode, show_sa_errors, + sa_set, service_action, td_set, retry_count, + timeout, verbosemode, &valid_len, &buf); + if (retval != 0) + goto bailout; + + if ((opcode_set != 0) + || (sa_set != 0)) { + retval = scsiprintoneopcode(device, opcode, sa_set, + service_action, buf, valid_len); + } else { + retval = scsiprintopcodes(device, td_set, buf, valid_len); + } + +bailout: + free(buf); + + return (retval); +} + #endif /* MINIMALISTIC */ void @@ -8109,7 +8720,8 @@ usage(int printlong) " camcontrol sleep [dev_id][generic args]\n" " camcontrol apm [dev_id][generic args][-l level]\n" " camcontrol aam [dev_id][generic args][-l level]\n" -" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" +" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-q]\n" +" [-s][-y]\n" " camcontrol security [dev_id][generic args]\n" " <-d pwd | -e pwd | -f | -h pwd | -k pwd>\n" " [-l ] [-q] [-s pwd] [-T timeout]\n" @@ -8122,6 +8734,8 @@ usage(int printlong) " camcontrol attrib [dev_id][generic args] <-r action|-w attr>\n" " [-a attr_num][-c][-e elem][-F form1,form1]\n" " [-p part][-s start][-T type][-V vol]\n" +" camcontrol opcodes [dev_id][generic args][-o opcode][-s SA]\n" +" [-N][-T]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -8162,6 +8776,7 @@ usage(int printlong) "security report or send ATA security commands to the named device\n" "persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" "attrib send the SCSI READ or WRITE ATTRIBUTE commands\n" +"opcodes send the SCSI REPORT SUPPORTED OPCODES command\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -8266,9 +8881,10 @@ usage(int printlong) "-t number of seconds before respective state.\n" "fwdownload arguments:\n" "-f fw_image path to firmware image file\n" -"-y don't ask any questions\n" +"-q don't print informational messages, only errors\n" "-s run in simulation mode\n" "-v print info for every firmware segment sent to device\n" +"-y don't ask any questions\n" "security arguments:\n" "-d pwd disable security using the given password for the selected\n" " user\n" @@ -8326,6 +8942,11 @@ usage(int printlong) "-s start_attr request attributes starting at the given number\n" "-T elem_type specify the element type (used with -e)\n" "-V logical_vol specify the logical volume ID\n" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 20 18:22:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C2F9BFE00; Thu, 20 Aug 2015 18:22:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E64FF1ECF; Thu, 20 Aug 2015 18:22:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KIM6jc072101; Thu, 20 Aug 2015 18:22:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KIM67C072100; Thu, 20 Aug 2015 18:22:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508201822.t7KIM67C072100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 20 Aug 2015 18:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286966 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 18:22:07 -0000 Author: bdrewery Date: Thu Aug 20 18:22:06 2015 New Revision: 286966 URL: https://svnweb.freebsd.org/changeset/base/286966 Log: Add link for rw_unlock(9) to rwlock(9). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Aug 20 16:07:51 2015 (r286965) +++ head/share/man/man9/Makefile Thu Aug 20 18:22:06 2015 (r286966) @@ -1355,6 +1355,7 @@ MLINKS+=rwlock.9 rw_assert.9 \ rwlock.9 rw_initialized.9 \ rwlock.9 rw_rlock.9 \ rwlock.9 rw_runlock.9 \ + rwlock.9 rw_unlock.9 \ rwlock.9 rw_sleep.9 \ rwlock.9 RW_SYSINIT.9 \ rwlock.9 rw_try_rlock.9 \ From owner-svn-src-head@freebsd.org Thu Aug 20 18:31:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7479BFF44; Thu, 20 Aug 2015 18:31:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEA592B; Thu, 20 Aug 2015 18:31:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KIV6rb076976; Thu, 20 Aug 2015 18:31:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KIV6Vn076975; Thu, 20 Aug 2015 18:31:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508201831.t7KIV6Vn076975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Aug 2015 18:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286967 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 18:31:06 -0000 Author: imp Date: Thu Aug 20 18:31:05 2015 New Revision: 286967 URL: https://svnweb.freebsd.org/changeset/base/286967 Log: The flags -mno-aes -mno-avx only exist for clang, not gcc, so add them only to the clang CFLAGS. Modified: head/sys/boot/efi/Makefile.inc Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Thu Aug 20 18:22:06 2015 (r286966) +++ head/sys/boot/efi/Makefile.inc Thu Aug 20 18:31:05 2015 (r286967) @@ -14,7 +14,8 @@ LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone -CFLAGS+= -mno-mmx -mno-sse -mno-aes -mno-avx +CFLAGS+= -mno-mmx -mno-sse +CFLAGS.clang+= -mno-aes -mno-avx .endif From owner-svn-src-head@freebsd.org Thu Aug 20 19:14:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 697409BF54D; Thu, 20 Aug 2015 19:14:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A79B1B0F; Thu, 20 Aug 2015 19:14:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KJEHnW096124; Thu, 20 Aug 2015 19:14:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KJEHlT096123; Thu, 20 Aug 2015 19:14:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508201914.t7KJEHlT096123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 20 Aug 2015 19:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286968 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 19:14:17 -0000 Author: ian Date: Thu Aug 20 19:14:16 2015 New Revision: 286968 URL: https://svnweb.freebsd.org/changeset/base/286968 Log: Minor comment and style fixes, no functional change. Submitted by: Svatopluk Kraus Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Thu Aug 20 18:31:05 2015 (r286967) +++ head/sys/arm/arm/busdma_machdep-v6.c Thu Aug 20 19:14:16 2015 (r286968) @@ -110,8 +110,8 @@ struct bounce_page { }; struct sync_list { - vm_offset_t vaddr; /* kva of bounce buffer */ - bus_addr_t busaddr; /* Physical address */ + vm_offset_t vaddr; /* kva of client data */ + bus_addr_t busaddr; /* client physical address */ bus_size_t datacount; /* client data count */ }; @@ -625,7 +625,8 @@ out: return (error); } -static int allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t mapp) +static int +allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t mapp) { struct bounce_zone *bz; int maxpages; From owner-svn-src-head@freebsd.org Thu Aug 20 19:39:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C781C9BF990; Thu, 20 Aug 2015 19:39:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89BCA0F; Thu, 20 Aug 2015 19:39:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KJdGts005444; Thu, 20 Aug 2015 19:39:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KJdG70005443; Thu, 20 Aug 2015 19:39:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508201939.t7KJdG70005443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 20 Aug 2015 19:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286969 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 19:39:16 -0000 Author: ian Date: Thu Aug 20 19:39:15 2015 New Revision: 286969 URL: https://svnweb.freebsd.org/changeset/base/286969 Log: Remove code left over from the armv4 days. On armv4, cache maintenance operations always had to be aligned and sized to cache lines. On armv6 and later, cache maintenance operates on a cache line if any part of the line is referenced in the operation, so we don't need extra code to align the edges of the sync range. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Thu Aug 20 19:14:16 2015 (r286968) +++ head/sys/arm/arm/busdma_machdep-v6.c Thu Aug 20 19:39:15 2015 (r286969) @@ -1381,22 +1381,11 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus */ if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { - vm_offset_t startv; - vm_paddr_t startp; - int len; - - startv = bpage->vaddr &~ arm_dcache_align_mask; - startp = bpage->busaddr &~ arm_dcache_align_mask; - len = bpage->datacount; - - if (startv != bpage->vaddr) - len += bpage->vaddr & arm_dcache_align_mask; - if (len & arm_dcache_align_mask) - len = (len - - (len & arm_dcache_align_mask)) + - arm_dcache_align; - l2cache_inv_range(startv, startp, len); - cpu_dcache_inv_range(startv, len); + l2cache_inv_range((vm_offset_t)bpage->vaddr, + (vm_offset_t)bpage->busaddr, + bpage->datacount); + cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, + bpage->datacount); if (bpage->datavaddr != 0) bcopy((void *)bpage->vaddr, (void *)bpage->datavaddr, From owner-svn-src-head@freebsd.org Thu Aug 20 20:28:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613F29BF11A; Thu, 20 Aug 2015 20:28:52 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3050D38E; Thu, 20 Aug 2015 20:28:52 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KKSqs1026139; Thu, 20 Aug 2015 20:28:52 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KKSqG2026138; Thu, 20 Aug 2015 20:28:52 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201508202028.t7KKSqG2026138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 20 Aug 2015 20:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286970 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 20:28:52 -0000 Author: rstone Date: Thu Aug 20 20:28:51 2015 New Revision: 286970 URL: https://svnweb.freebsd.org/changeset/base/286970 Log: Prevent ticks rollover from preventing vm_lowmem event Currently vm_pageout_scan() uses a ticks-based scheme to rate-limit the number of times that the vm_lowmem event will happen. However if no events happen for long enough for ticks to roll over, this leaves us in a long window in which vm_lowmem events will not happen. Replace the use of ticks with time_t to prevent rollover from ever being an issue. Reviewed by: ian MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3439 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Aug 20 19:39:15 2015 (r286969) +++ head/sys/vm/vm_pageout.c Thu Aug 20 20:28:51 2015 (r286970) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -171,7 +172,7 @@ static int vm_pageout_update_period; static int defer_swap_pageouts; static int disable_swap_pageouts; static int lowmem_period = 10; -static int lowmem_ticks; +static time_t lowmem_uptime; #if defined(NO_SWAPPING) static int vm_swap_enabled = 0; @@ -1034,7 +1035,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * some. We rate limit to avoid thrashing. */ if (vmd == &vm_dom[0] && pass > 0 && - (ticks - lowmem_ticks) / hz >= lowmem_period) { + (time_uptime - lowmem_uptime) >= lowmem_period) { /* * Decrease registered cache sizes. */ @@ -1045,7 +1046,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * drained above. */ uma_reclaim(); - lowmem_ticks = ticks; + lowmem_uptime = time_uptime; } /* From owner-svn-src-head@freebsd.org Thu Aug 20 21:16:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB59F9BFAB0; Thu, 20 Aug 2015 21:16:53 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x22c.google.com (mail-yk0-x22c.google.com [IPv6:2607:f8b0:4002:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BCF1671; Thu, 20 Aug 2015 21:16:53 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykdt205 with SMTP id t205so51970455ykd.1; Thu, 20 Aug 2015 14:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=g2KF43MB7/4/ZrEOjmklr36kP1qTI7ySZvExZcVsUo8=; b=D31P94uF2kIpwiZ8qqPz0O7MWP68bAlAN7xSJuisu7hNm8Wveg3xITOwqtBCKhT5J3 vwEb5/sCjRoYnZgtAL1Vuf53nBM8tFZ7nEjdhKyc6qIGOIdwLTsi0tMIwlre+ffDb8Al v8hYZOYr2mHmfIvKXfxEtIn81kiJ/Via8KBiLG1BjRE3gbxyJRJhI/th+E8LSr+wV9ng yOtsdXSF9wJg9xetRUq1fyLuHOLdspSEIooJolToqOU4i8bfPwIsXuk6zCv74j8HRh9Y J3KZQ01BGCGiUC6BRl5mohUTqY5hVgmX8qvXlT5fItI1z2tASxru5lNXnTt5FIGw0DDs 55vw== MIME-Version: 1.0 X-Received: by 10.170.125.85 with SMTP id r82mr6722941ykb.91.1440105412620; Thu, 20 Aug 2015 14:16:52 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.37.99.3 with HTTP; Thu, 20 Aug 2015 14:16:52 -0700 (PDT) In-Reply-To: <201508201831.t7KIV6Vn076975@repo.freebsd.org> References: <201508201831.t7KIV6Vn076975@repo.freebsd.org> Date: Thu, 20 Aug 2015 14:16:52 -0700 X-Google-Sender-Auth: hjHZ_WzIl-w2Tp5FY2PRS1CjrDU Message-ID: Subject: Re: svn commit: r286967 - head/sys/boot/efi From: Craig Rodrigues To: Warner Losh Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 21:16:53 -0000 On Thu, Aug 20, 2015 at 11:31 AM, Warner Losh wrote: > The flags -mno-aes -mno-avx only exist for clang, not gcc, so > add them only to the clang CFLAGS. > > It would be more accurate to say that these flags do not exist for gcc 4.2. They do exist for gcc 4.7: https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/i386-and-x86_002d64-Options.html -- Craig From owner-svn-src-head@freebsd.org Thu Aug 20 21:29:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759D29BFC98 for ; Thu, 20 Aug 2015 21:29:31 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37792D58 for ; Thu, 20 Aug 2015 21:29:30 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by qged69 with SMTP id d69so36274398qge.0 for ; Thu, 20 Aug 2015 14:29:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=e+b4iqReivGBh5PRbe8YNYSvxoCOwq+3Lf2Z/Sd0N6k=; b=fw2m5GL0FABO1Fbdpxz790f5imyxTc4iQ6kS0SOWzpAx/RE5ugPCKqBhl4oWoiy5LU WJQkZ3wiPIUBssU79SY/NFxQwQs3b/KXHXPc+oBJ1CHJwXCBp6XPSLaOTpiAaDI4HdOH aMcgBDtPygMhsErnAqlTJT2W80tMLrGP2MMvx9KZ1dLVapMVk8yLUIg+3d27gcWBixen jOpfjwmhyA0PK62FQqb2lnfNiSmQc0eDiJhe4XTfyeHN/EueIP1bFJKUk7rfyOtv4Brm hKXu5MCProwZ3kdPjosTHiE2kqRzS1p296kE40jiLiecA5pVBzLJ36ZfYf99c4Z+d0Iw zmgQ== X-Gm-Message-State: ALoCoQmjb0CHMxFuIRTB6kb/3oWAwTQcRALvAmCOdplXhOkuvVQsWvP3qzvZKBgjZmZD206xePuJ MIME-Version: 1.0 X-Received: by 10.140.147.69 with SMTP id 66mr10264872qht.57.1440105816189; Thu, 20 Aug 2015 14:23:36 -0700 (PDT) Received: by 10.55.167.133 with HTTP; Thu, 20 Aug 2015 14:23:36 -0700 (PDT) In-Reply-To: References: <201508201831.t7KIV6Vn076975@repo.freebsd.org> Date: Thu, 20 Aug 2015 23:23:36 +0200 Message-ID: Subject: Re: svn commit: r286967 - head/sys/boot/efi From: Oliver Pinter To: Craig Rodrigues Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: multipart/mixed; boundary=001a113562e49d09c2051dc4c3ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 21:29:31 -0000 --001a113562e49d09c2051dc4c3ac Content-Type: text/plain; charset=UTF-8 On 8/20/15, Craig Rodrigues wrote: > On Thu, Aug 20, 2015 at 11:31 AM, Warner Losh wrote: > >> The flags -mno-aes -mno-avx only exist for clang, not gcc, so >> add them only to the clang CFLAGS. >> >> > It would be more accurate to say that these flags do not exist for gcc 4.2. > They do exist for gcc 4.7: > https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/i386-and-x86_002d64-Options.html The attached one patch still needs to hyperv's hv_kvp_daemon with gcc. After applied this fix, I get a buildable world. The kernel still fails on aesni module, but that's a known problem with gcc 4.2.1. > > -- > Craig > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > --001a113562e49d09c2051dc4c3ac Content-Type: text/plain; charset=US-ASCII; name="hv_kvp_daeom-fix-with-gcc.diff" Content-Disposition: attachment; filename="hv_kvp_daeom-fix-with-gcc.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSA5NDY5ZDMzMjdmZTQ1ZmQ3YWUzMWI5OGZlZmZhYzk5NmZmMDg0NzFmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVk YnNkLm9yZz4KRGF0ZTogVGh1LCAyMCBBdWcgMjAxNSAyMjo0OTo0OSArMDIwMApTdWJqZWN0OiBb UEFUQ0hdIEZCU0Q6IHNpbGVuY2UgYnVpbGQgZXJyb3Igd2l0aCBnY2MKCi0tLSBodl9rdnBfZGFl bW9uLm8gLS0tCmNjMTogd2FybmluZ3MgYmVpbmcgdHJlYXRlZCBhcyBlcnJvcnMKL3Vzci9kYXRh L3NvdXJjZS9naXQvb3BCU0Qvb3BCU0QuZ2l0L3Vzci5zYmluL2h5cGVydi90b29scy8uLi8uLi8u Li9jb250cmliL2h5cGVydi90b29scy9odl9rdnBfZGFlbW9uLmM6CkluIGZ1bmN0aW9uICdrdnBf Z2V0X2lwX2luZm8nOgovdXNyL2RhdGEvc291cmNlL2dpdC9vcEJTRC9vcEJTRC5naXQvdXNyLnNi aW4vaHlwZXJ2L3Rvb2xzLy4uLy4uLy4uL2NvbnRyaWIvaHlwZXJ2L3Rvb2xzL2h2X2t2cF9kYWVt b24uYzo4MTQ6Cndhcm5pbmc6ICdpcF9idWZmZXInIG1heSBiZSB1c2VkIHVuaW5pdGlhbGl6ZWQg aW4gdGhpcyBmdW5jdGlvbgoKKioqIFtodl9rdnBfZGFlbW9uLm9dIEVycm9yIGNvZGUgMQoKU2ln bmVkLW9mZi1ieTogT2xpdmVyIFBpbnRlciA8b2xpdmVyLnBpbnRlckBoYXJkZW5lZGJzZC5vcmc+ CgpkaWZmIC0tZ2l0IGEvY29udHJpYi9oeXBlcnYvdG9vbHMvaHZfa3ZwX2RhZW1vbi5jIGIvY29u dHJpYi9oeXBlcnYvdG9vbHMvaHZfa3ZwX2RhZW1vbi5jCmluZGV4IDFjMzFkM2YuLjUwYWUzZWQg MTAwNjQ0Ci0tLSBhL2NvbnRyaWIvaHlwZXJ2L3Rvb2xzL2h2X2t2cF9kYWVtb24uYworKysgYi9j b250cmliL2h5cGVydi90b29scy9odl9rdnBfZGFlbW9uLmMKQEAgLTgxMSw3ICs4MTEsNyBAQCBr dnBfZ2V0X2lwX2luZm8oaW50IGZhbWlseSwgY2hhciAqaWZfbmFtZSwgaW50IG9wLAogCWludCBl cnJvciA9IDA7CiAJY2hhciAqYnVmZmVyOwogCXNpemVfdCBidWZmZXJfbGVuZ3RoOwotCXN0cnVj dCBodl9rdnBfaXBhZGRyX3ZhbHVlICppcF9idWZmZXI7CisJc3RydWN0IGh2X2t2cF9pcGFkZHJf dmFsdWUgKmlwX2J1ZmZlciA9IE5VTEw7CiAJY2hhciBjaWRyX21hc2tbNV07CiAJaW50IHdlaWdo dDsKIAlpbnQgaTsK --001a113562e49d09c2051dc4c3ac-- From owner-svn-src-head@freebsd.org Thu Aug 20 21:31:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 125319BFE76; Thu, 20 Aug 2015 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 037A41249; Thu, 20 Aug 2015 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KLVbKc053313; Thu, 20 Aug 2015 21:31:37 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KLVbMX053311; Thu, 20 Aug 2015 21:31:37 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508202131.t7KLVbMX053311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 20 Aug 2015 21:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286971 - head/bin/sh/tests/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 21:31:38 -0000 Author: jilles Date: Thu Aug 20 21:31:36 2015 New Revision: 286971 URL: https://svnweb.freebsd.org/changeset/base/286971 Log: sh: Add test for $'\u' without any digits. It is likely that $'\uXXXX' and $'\UXXXXXXXX' will allow fewer digits in future. However, no digits at all should still be disallowed. Added: head/bin/sh/tests/parser/dollar-quote12.0 (contents, props changed) Modified: head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Thu Aug 20 20:28:51 2015 (r286970) +++ head/bin/sh/tests/parser/Makefile Thu Aug 20 21:31:36 2015 (r286971) @@ -36,6 +36,7 @@ FILES+= dollar-quote8.0 FILES+= dollar-quote9.0 FILES+= dollar-quote10.0 FILES+= dollar-quote11.0 +FILES+= dollar-quote12.0 FILES+= empty-braces1.0 FILES+= empty-cmd1.0 FILES+= for1.0 Added: head/bin/sh/tests/parser/dollar-quote12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/dollar-quote12.0 Thu Aug 20 21:31:36 2015 (r286971) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# \u without any digits at all remains invalid. +# Our choice is a parse error. + +v=$( (eval ": \$'\u'") 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] From owner-svn-src-head@freebsd.org Thu Aug 20 21:50:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A8399BE0E9; Thu, 20 Aug 2015 21:50:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE601A91; Thu, 20 Aug 2015 21:50:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KLo0oZ059722; Thu, 20 Aug 2015 21:50:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KLo0bA059721; Thu, 20 Aug 2015 21:50:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508202150.t7KLo0bA059721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Aug 2015 21:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286972 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 21:50:00 -0000 Author: pfg Date: Thu Aug 20 21:49:59 2015 New Revision: 286972 URL: https://svnweb.freebsd.org/changeset/base/286972 Log: Appease gcc-4.2 It needs to die, but it resists mipsteriously. Submitted by: Oliver Pinter Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Aug 20 21:31:36 2015 (r286971) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Aug 20 21:49:59 2015 (r286972) @@ -811,7 +811,7 @@ kvp_get_ip_info(int family, char *if_nam int error = 0; char *buffer; size_t buffer_length; - struct hv_kvp_ipaddr_value *ip_buffer; + struct hv_kvp_ipaddr_value *ip_buffer = NULL; char cidr_mask[5]; int weight; int i; From owner-svn-src-head@freebsd.org Thu Aug 20 22:05:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243989BE3AE; Thu, 20 Aug 2015 22:05:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFBA7382; Thu, 20 Aug 2015 22:05:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KM5ukn067643; Thu, 20 Aug 2015 22:05:56 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KM5udU067640; Thu, 20 Aug 2015 22:05:56 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508202205.t7KM5udU067640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 20 Aug 2015 22:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286973 - in head/bin/sh: . tests/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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 22:05:57 -0000 Author: jilles Date: Thu Aug 20 22:05:55 2015 New Revision: 286973 URL: https://svnweb.freebsd.org/changeset/base/286973 Log: sh: Avoid negative character values from $'\Uffffffff' etc. The negative value was not expected and generated the low 8 bits as a byte, which may be an invalid character encoding. The final shift in creating the negative value was undefined as well. Make the temporary variable unsigned to fix this. Added: head/bin/sh/tests/parser/dollar-quote13.0 (contents, props changed) Modified: head/bin/sh/parser.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Aug 20 21:49:59 2015 (r286972) +++ head/bin/sh/parser.c Thu Aug 20 22:05:55 2015 (r286973) @@ -1195,7 +1195,8 @@ parsebackq(char *out, struct nodelist ** static char * readcstyleesc(char *out) { - int c, v, i, n; + int c, vc, i, n; + unsigned int v; c = pgetc(); switch (c) { @@ -1310,12 +1311,12 @@ readcstyleesc(char *out) default: synerror("Bad escape sequence"); } - v = (char)v; + vc = (char)v; /* * We can't handle NUL bytes. * POSIX says we should skip till the closing quote. */ - if (v == '\0') { + if (vc == '\0') { while ((c = pgetc()) != '\'') { if (c == '\\') c = pgetc(); @@ -1332,9 +1333,9 @@ readcstyleesc(char *out) pungetc(); return out; } - if (SQSYNTAX[v] == CCTL) + if (SQSYNTAX[vc] == CCTL) USTPUTC(CTLESC, out); - USTPUTC(v, out); + USTPUTC(vc, out); return out; } Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Thu Aug 20 21:49:59 2015 (r286972) +++ head/bin/sh/tests/parser/Makefile Thu Aug 20 22:05:55 2015 (r286973) @@ -37,6 +37,7 @@ FILES+= dollar-quote9.0 FILES+= dollar-quote10.0 FILES+= dollar-quote11.0 FILES+= dollar-quote12.0 +FILES+= dollar-quote13.0 FILES+= empty-braces1.0 FILES+= empty-cmd1.0 FILES+= for1.0 Added: head/bin/sh/tests/parser/dollar-quote13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/dollar-quote13.0 Thu Aug 20 22:05:55 2015 (r286973) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# This Unicode escape sequence that has never been in range should either +# fail to expand or expand to a fallback. + +c=$(eval printf %s \$\'\\Uffffff41\' 2>/dev/null) +r=$(($? != 0)) +[ "$r.$c" = '1.' ] || [ "$r.$c" = '0.?' ] || [ "$r.$c" = $'0.\u2222' ] From owner-svn-src-head@freebsd.org Thu Aug 20 22:14:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045EE9BE58C; Thu, 20 Aug 2015 22:14:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9760A60; Thu, 20 Aug 2015 22:14:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KMEhYv071767; Thu, 20 Aug 2015 22:14:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KMEhm5071766; Thu, 20 Aug 2015 22:14:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508202214.t7KMEhm5071766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 20 Aug 2015 22:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286974 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 22:14:44 -0000 Author: bdrewery Date: Thu Aug 20 22:14:43 2015 New Revision: 286974 URL: https://svnweb.freebsd.org/changeset/base/286974 Log: Remove reference to non-existent kern_openat(9). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/devfs_set_cdevpriv.9 Modified: head/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- head/share/man/man9/devfs_set_cdevpriv.9 Thu Aug 20 22:05:55 2015 (r286973) +++ head/share/man/man9/devfs_set_cdevpriv.9 Thu Aug 20 22:14:43 2015 (r286974) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2012 +.Dd August 20, 2015 .Dt DEVFS_CDEVPRIV 9 .Os .Sh NAME @@ -116,8 +116,7 @@ was called. .Sh SEE ALSO .Xr close 2 , .Xr open 2 , -.Xr devfs 5 , -.Xr kern_openat 9 +.Xr devfs 5 .Sh HISTORY The .Fn devfs_cdevpriv From owner-svn-src-head@freebsd.org Thu Aug 20 22:26:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8869BE88C; Thu, 20 Aug 2015 22:26:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5AD1189; Thu, 20 Aug 2015 22:26:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7KMQIde000420 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 21 Aug 2015 01:26:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7KMQIde000420 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7KMQI5D000419; Fri, 21 Aug 2015 01:26:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 21 Aug 2015 01:26:18 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286974 - head/share/man/man9 Message-ID: <20150820222618.GY2072@kib.kiev.ua> References: <201508202214.t7KMEhm5071766@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508202214.t7KMEhm5071766@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 22:26:25 -0000 On Thu, Aug 20, 2015 at 10:14:43PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Thu Aug 20 22:14:43 2015 > New Revision: 286974 > URL: https://svnweb.freebsd.org/changeset/base/286974 > > Log: > Remove reference to non-existent kern_openat(9). The man page does not exist, but the function is there. It is the right kernel-mode entrance for the high-level open machinery. As such, it is useful reference for a set of functions which needs to be aware of the open event. From owner-svn-src-head@freebsd.org Thu Aug 20 22:28:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E9DA9BE8C9; Thu, 20 Aug 2015 22:28:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 523C012FC; Thu, 20 Aug 2015 22:28:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 4AC681B19; Thu, 20 Aug 2015 22:28:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id ED783FC4B; Thu, 20 Aug 2015 22:28:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id zzPGdHjY5OcY; Thu, 20 Aug 2015 22:28:55 +0000 (UTC) Subject: Re: svn commit: r286974 - head/share/man/man9 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E49A1FC44 To: Konstantin Belousov References: <201508202214.t7KMEhm5071766@repo.freebsd.org> <20150820222618.GY2072@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <55D654A6.4060300@FreeBSD.org> Date: Thu, 20 Aug 2015 15:28:54 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150820222618.GY2072@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 22:28:58 -0000 On 8/20/15 3:26 PM, Konstantin Belousov wrote: > On Thu, Aug 20, 2015 at 10:14:43PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Thu Aug 20 22:14:43 2015 >> New Revision: 286974 >> URL: https://svnweb.freebsd.org/changeset/base/286974 >> >> Log: >> Remove reference to non-existent kern_openat(9). > The man page does not exist, but the function is there. It is the right > kernel-mode entrance for the high-level open machinery. As such, it is > useful reference for a set of functions which needs to be aware of the > open event. > I agree. However, I don't think this is the right place for it though as this is typically a man page list. I also think it is similar to commenting obvious code. The manual page already mentions the open(2) hook. Finding that code is obviously in sys_open, which chains down into kern_openat. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Thu Aug 20 22:44:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D4FF9BEC30; Thu, 20 Aug 2015 22:44:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 244E21C93; Thu, 20 Aug 2015 22:44:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7KMiSiV083909; Thu, 20 Aug 2015 22:44:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7KMiRq7083907; Thu, 20 Aug 2015 22:44:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508202244.t7KMiRq7083907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 20 Aug 2015 22:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286975 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2015 22:44:28 -0000 Author: kib Date: Thu Aug 20 22:44:26 2015 New Revision: 286975 URL: https://svnweb.freebsd.org/changeset/base/286975 Log: If process becomes reaper (procctl(PROC_REAP_ACQUIRE)) while already having some children, the children' reaper is not reset to the parent. This allows for the situation where reaper has children but not descendands and the too strict asserts in the reap_status() fire. Remove the wrong asserts, add some clarification for the situation to the procctl(2) REAP_STATUS. Reported and tested by: feld Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/sys/procctl.2 head/sys/kern/kern_procctl.c Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Thu Aug 20 22:14:43 2015 (r286974) +++ head/lib/libc/sys/procctl.2 Thu Aug 20 22:44:26 2015 (r286975) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 2014 +.Dd August 21, 2015 .Dt PROCCTL 2 .Os .Sh NAME @@ -148,7 +148,11 @@ The specified process is the root of the .Pp The .Fa rs_children -field returns the number of children of the reaper. +field returns the number of children of the reaper among the descendands. +It is possible to have a child which reaper is not the specified process, +since the reaper for the existing children is not reset on the +.Dv PROC_REAP_ACQUIRE +operation. The .Fa rs_descendants field returns the total number of descendants of the reaper(s), Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Thu Aug 20 22:14:43 2015 (r286974) +++ head/sys/kern/kern_procctl.c Thu Aug 20 22:44:26 2015 (r286975) @@ -187,8 +187,6 @@ reap_status(struct thread *td, struct pr } } else { rs->rs_pid = -1; - KASSERT(LIST_EMPTY(&reap->p_reaplist), ("reap children list")); - KASSERT(LIST_EMPTY(&reap->p_children), ("children list")); } return (0); } From owner-svn-src-head@freebsd.org Fri Aug 21 02:22:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE4A9BEE90; Fri, 21 Aug 2015 02:22:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC614113B; Fri, 21 Aug 2015 02:22:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L2Mqj8092051; Fri, 21 Aug 2015 02:22:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L2MqRb092050; Fri, 21 Aug 2015 02:22:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508210222.t7L2MqRb092050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 21 Aug 2015 02:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286976 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 02:22:52 -0000 Author: jhibbits Date: Fri Aug 21 02:22:51 2015 New Revision: 286976 URL: https://svnweb.freebsd.org/changeset/base/286976 Log: Simplify the PCI bus scanning logic. Rather than special casing on PCIC_BRIDGE || PCIC_PROCESSOR, allow all HDRTYPE_BRIDGE types. Obtained from: Semihalf Sponsored by: Alex Perez/Intertial Computing Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Thu Aug 20 22:44:26 2015 (r286975) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Fri Aug 21 02:22:51 2015 (r286976) @@ -265,7 +265,7 @@ fsl_pcib_attach(device_t dev) */ sc->sc_busnr = 0; maxslot = (sc->sc_pcie) ? 0 : PCI_SLOTMAX; - fsl_pcib_init(sc, sc->sc_busnr, maxslot); + sc->sc_busnr = fsl_pcib_init(sc, sc->sc_busnr, maxslot); if (sc->sc_pcie) { ltssm = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_LTSSM, 1); @@ -570,19 +570,8 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, PCIR_SUBCLASS, 1); - /* - * The PCI Root Complex comes up as a Processor/PowerPC, - * but is a bridge. - */ - /* Allow only proper PCI-PCI briges */ - if (class != PCIC_BRIDGE && class != PCIC_PROCESSOR) - continue; - if (subclass != PCIS_BRIDGE_PCI && - subclass != PCIS_PROCESSOR_POWERPC) - continue; - - if (subclass == PCIS_PROCESSOR_POWERPC && - hdrtype != PCIM_HDRTYPE_BRIDGE) + /* Allow all DEVTYPE 1 devices */ + if (hdrtype != PCIM_HDRTYPE_BRIDGE) continue; secbus++; From owner-svn-src-head@freebsd.org Fri Aug 21 02:41:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BA0D9BE1A1; Fri, 21 Aug 2015 02:41:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B7691910; Fri, 21 Aug 2015 02:41:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L2fadK099744; Fri, 21 Aug 2015 02:41:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L2faCC099729; Fri, 21 Aug 2015 02:41:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508210241.t7L2faCC099729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 21 Aug 2015 02:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286977 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 02:41:36 -0000 Author: jhibbits Date: Fri Aug 21 02:41:35 2015 New Revision: 286977 URL: https://svnweb.freebsd.org/changeset/base/286977 Log: Add initial boot support for e500mc and e5500. * Since r257190 the kernel must actually be loaded at a 64MB boundary, not 16MB. * Don't program HID1 register on e500mc or e5500, they don't have this SPR. * Set proper HID0 defaults for these new architectures. There is still more work to be done for the various SoCs, and the PMAP code still needs to be extended to 36-bit paddr, coming soon. Obtained from: Semihalf Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Fri Aug 21 02:22:51 2015 (r286976) +++ head/sys/powerpc/booke/locore.S Fri Aug 21 02:41:35 2015 (r286977) @@ -61,11 +61,11 @@ __start: /* * Assumptions on the boot loader: - * - system memory starts from physical address 0 - * - it's mapped by a single TBL1 entry + * - System memory starts from physical address 0 + * - It's mapped by a single TLB1 entry * - TLB1 mapping is 1:1 pa to va - * - kernel is loaded at 16MB boundary - * - all PID registers are set to the same value + * - Kernel is loaded at 64MB boundary + * - All PID registers are set to the same value * - CPU is running in AS=0 * * Registers contents provided by the loader(8): @@ -73,14 +73,14 @@ __start: * r3 : metadata pointer * * We rearrange the TLB1 layout as follows: - * - find TLB1 entry we started in - * - make sure it's protected, ivalidate other entries - * - create temp entry in the second AS (make sure it's not TLB[1]) - * - switch to temp mapping - * - map 16MB of RAM in TLB1[1] - * - use AS=1, set EPN to KERNBASE and RPN to kernel load address - * - switch to to TLB1[1] mapping - * - invalidate temp mapping + * - Find TLB1 entry we started in + * - Make sure it's protected, invalidate other entries + * - Create temp entry in the second AS (make sure it's not TLB[1]) + * - Switch to temp mapping + * - Map 64MB of RAM in TLB1[1] + * - Use AS=1, set EPN to KERNBASE and RPN to kernel load address + * - Switch to to TLB1[1] mapping + * - Invalidate temp mapping * * locore registers use: * r1 : stack pointer @@ -104,15 +104,44 @@ __start: mtmsr %r3 isync - lis %r3, HID0_E500_DEFAULT_SET@h - ori %r3, %r3, HID0_E500_DEFAULT_SET@l - mtspr SPR_HID0, %r3 + mfpvr %r3 + rlwinm %r3, %r3, 16, 16, 31 + + lis %r4, HID0_E500_DEFAULT_SET@h + ori %r4, %r4, HID0_E500_DEFAULT_SET@l + + /* Check for e500mc and e5500 */ + cmpli 0, 0, %r3, FSL_E500mc + bne 2f + + lis %r4, HID0_E500MC_DEFAULT_SET@h + ori %r4, %r4, HID0_E500MC_DEFAULT_SET@l + b 3f +2: + cmpli 0, 0, %r3, FSL_E5500 + bne 3f + + lis %r4, HID0_E5500_DEFAULT_SET@h + ori %r4, %r4, HID0_E5500_DEFAULT_SET@l + +3: + mtspr SPR_HID0, %r4 isync + +/* + * E500mc and E5500 do not have HID1 register, so skip HID1 setup on + * this core. + */ + cmpli 0, 0, %r3, FSL_E500mc + beq 1f + cmpli 0, 0, %r3, FSL_E5500 + beq 1f + lis %r3, HID1_E500_DEFAULT_SET@h ori %r3, %r3, HID1_E500_DEFAULT_SET@l mtspr SPR_HID1, %r3 isync - +1: /* Invalidate all entries in TLB0 */ li %r3, 0 bl tlb_inval_all @@ -153,10 +182,10 @@ __start: /* * Setup final mapping in TLB1[1] and switch to it */ - /* Final kernel mapping, map in 16 MB of RAM */ + /* Final kernel mapping, map in 64 MB of RAM */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ li %r4, 0 /* Entry 0 */ - rlwimi %r3, %r4, 16, 12, 15 + rlwimi %r3, %r4, 16, 10, 15 mtspr SPR_MAS0, %r3 isync @@ -176,10 +205,12 @@ __start: /* Discover phys load address */ bl 3f 3: mflr %r4 /* Use current address */ - rlwinm %r4, %r4, 0, 0, 7 /* 16MB alignment mask */ + rlwinm %r4, %r4, 0, 0, 5 /* 64MB alignment mask */ ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r4 /* Set RPN and protection */ isync + bl zero_mas7 + bl zero_mas8 tlbwe isync msync @@ -281,15 +312,40 @@ bp_tlb1_end: 1: mflr %r31 /* r31 hold the address of bp_ntlb1s */ /* Set HIDs */ - lis %r3, HID0_E500_DEFAULT_SET@h - ori %r3, %r3, HID0_E500_DEFAULT_SET@l - mtspr SPR_HID0, %r3 - isync + mfpvr %r3 + rlwinm %r3, %r3, 16, 16, 31 + + /* HID0 for E500 is default */ + lis %r4, HID0_E500_DEFAULT_SET@h + ori %r4, %r4, HID0_E500_DEFAULT_SET@l + + cmpli 0, 0, %r3, FSL_E500mc + bne 2f + lis %r4, HID0_E500MC_DEFAULT_SET@h + ori %r4, %r4, HID0_E500MC_DEFAULT_SET@l + b 3f +2: + cmpli 0, 0, %r3, FSL_E5500 + bne 3f + lis %r4, HID0_E5500_DEFAULT_SET@h + ori %r4, %r4, HID0_E5500_DEFAULT_SET@l +3: + mtspr SPR_HID0, %r4 + isync +/* + * E500mc and E5500 do not have HID1 register, so skip HID1 setup on + * this core. + */ + cmpli 0, 0, %r3, FSL_E500mc + beq 1f + cmpli 0, 0, %r3, FSL_E5500 + beq 1f + lis %r3, HID1_E500_DEFAULT_SET@h ori %r3, %r3, HID1_E500_DEFAULT_SET@l mtspr SPR_HID1, %r3 isync - +1: /* Enable branch prediction */ li %r3, BUCSR_BPEN mtspr SPR_BUCSR, %r3 @@ -429,8 +485,8 @@ bp_tlb1_end: * r3 TLBSEL */ tlb_inval_all: - rlwinm %r3, %r3, 3, 0x18 /* TLBSEL */ - ori %r3, %r3, 0x4 /* INVALL */ + rlwinm %r3, %r3, 3, (1 << 3) /* TLBSEL */ + ori %r3, %r3, (1 << 2) /* INVALL */ tlbivax 0, %r3 isync msync @@ -472,7 +528,7 @@ tlb1_find_current: */ tlb1_inval_entry: lis %r4, MAS0_TLBSEL1@h /* Select TLB1 */ - rlwimi %r4, %r3, 16, 12, 15 /* Select our entry */ + rlwimi %r4, %r3, 16, 10, 15 /* Select our entry */ mtspr SPR_MAS0, %r4 isync tlbre @@ -495,14 +551,14 @@ tlb1_temp_mapping_as1: /* Read our current translation */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - rlwimi %r3, %r29, 16, 12, 15 /* Select our current entry */ + rlwimi %r3, %r29, 16, 10, 15 /* Select our current entry */ mtspr SPR_MAS0, %r3 isync tlbre /* Prepare and write temp entry */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - rlwimi %r3, %r28, 16, 12, 15 /* Select temp entry */ + rlwimi %r3, %r28, 16, 10, 15 /* Select temp entry */ mtspr SPR_MAS0, %r3 isync mfspr %r5, SPR_MAS1 @@ -513,6 +569,10 @@ tlb1_temp_mapping_as1: oris %r5, %r5, (MAS1_VALID | MAS1_IPROT)@h mtspr SPR_MAS1, %r5 isync + mflr %r3 + bl zero_mas7 + bl zero_mas8 + mtlr %r3 tlbwe isync msync @@ -531,7 +591,7 @@ tlb1_inval_all_but_current: andi. %r3, %r3, TLBCFG_NENTRY_MASK@l li %r4, 0 /* Start from Entry 0 */ 1: lis %r5, MAS0_TLBSEL1@h - rlwimi %r5, %r4, 16, 12, 15 + rlwimi %r5, %r4, 16, 10, 15 mtspr SPR_MAS0, %r5 isync tlbre @@ -549,6 +609,38 @@ tlb1_inval_all_but_current: bne 1b blr +/* + * MAS7 and MAS8 conditional zeroing. + */ +.globl zero_mas7 +zero_mas7: + mfpvr %r20 + rlwinm %r20, %r20, 16, 16, 31 + cmpli 0, 0, %r20, FSL_E500v1 + beq 1f + + li %r20, 0 + mtspr SPR_MAS7, %r20 + isync +1: + blr + +.globl zero_mas8 +zero_mas8: + mfpvr %r20 + rlwinm %r20, %r20, 16, 16, 31 + cmpli 0, 0, %r20, FSL_E500mc + beq 1f + cmpli 0, 0, %r20, FSL_E5500 + beq 1f + + blr +1: + li %r20, 0 + mtspr SPR_MAS8, %r20 + isync + blr + #ifdef SMP __boot_page_padding: /* From owner-svn-src-head@freebsd.org Fri Aug 21 02:42:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF0D89BE1D6; Fri, 21 Aug 2015 02:42:15 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF3CC1AC5; Fri, 21 Aug 2015 02:42:15 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L2gFaX000238; Fri, 21 Aug 2015 02:42:15 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L2gFA5000236; Fri, 21 Aug 2015 02:42:15 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201508210242.t7L2gFA5000236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Fri, 21 Aug 2015 02:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286978 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 02:42:15 -0000 Author: bjk (doc committer) Date: Fri Aug 21 02:42:14 2015 New Revision: 286978 URL: https://svnweb.freebsd.org/changeset/base/286978 Log: Editing pass on procctl.2 Spell "descendant" correctly. Grammar fixes. Use correct width argument to Bl. Use Po and Pc to avoid leaving a dangling '(' on the end of a line. Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Fri Aug 21 02:41:35 2015 (r286977) +++ head/lib/libc/sys/procctl.2 Fri Aug 21 02:42:14 2015 (r286978) @@ -71,11 +71,11 @@ The control request to perform is specif .Fa cmd argument. The following commands are supported: -.Bl -tag -width "Dv PROC_REAP_GETPIDS" +.Bl -tag -width "PROC_REAP_GETPIDS" .It Dv PROC_SPROTECT Set process protection state. This is used to mark a process as protected from being killed if the system -exhausts available memory and swap. +exhausts the available memory and swap. The .Fa arg parameter must point to an integer containing an operation and zero or more @@ -89,7 +89,7 @@ Clear the protected state of selected pr .El .Pp The following optional flags are supported: -.Bl -tag -width "Dv PPROT_DESCE" +.Bl -tag -width "Dv PPROT_DESCEND" .It Dv PPROT_DESCEND Apply the requested operation to all child processes of each selected process in addition to each selected process. @@ -101,18 +101,18 @@ Future child processes will also mark al .El .It Dv PROC_REAP_ACQUIRE Acquires the reaper status for the current process. -The status means that children orphaned by the reaper's descendants -that were forked after the acquisition of the status are reparented to the -reaper. -After the system initialization, +Reaper status means that children orphaned by the reaper's descendants +that were forked after the acquisition of reaper status are reparented to the +reaper process. +After system initialization, .Xr init 8 is the default reaper. .It Dv PROC_REAP_RELEASE -Releases the reaper state for the current process. +Release the reaper state for the current process. The reaper of the current process becomes the new reaper of the current process's descendants. .It Dv PROC_REAP_STATUS -Provides the information about the reaper of the specified process, +Provides information about the reaper of the specified process, or the process itself when it is a reaper. The .Fa data @@ -133,7 +133,7 @@ The may have the following flags returned: .Bl -tag -width "Dv REAPER_STATUS_REALINIT" .It Dv REAPER_STATUS_OWNED -The specified process has acquired the reaper status and has not +The specified process has acquired reaper status and has not released it. When the flag is returned, the specified process .Fa id , @@ -142,15 +142,15 @@ pid, identifies the reaper, otherwise th field of the structure is set to the pid of the reaper for the specified process id. .It Dv REAPER_STATUS_REALINIT -The specified process is the root of the reaper tree, i.e. +The specified process is the root of the reaper tree, i.e., .Xr init 8 . .El .Pp The .Fa rs_children -field returns the number of children of the reaper among the descendands. -It is possible to have a child which reaper is not the specified process, -since the reaper for the existing children is not reset on the +field returns the number of children of the reaper among the descendants. +It is possible to have a child whose reaper is not the specified process, +since the reaper for any existing children is not reset on the .Dv PROC_REAP_ACQUIRE operation. The @@ -246,7 +246,7 @@ struct procctl_reaper_kill { The .Fa rk_sig field specifies the signal to be delivered. -Zero is not a valid signal number, unlike +Zero is not a valid signal number, unlike for .Xr kill 2 . The .Fa rk_flags @@ -275,20 +275,20 @@ field identifies the number of processes The .Fa rk_fpid field is set to the pid of the first process for which signal -delivery failed, e.g. due to the permission problems. -If no such process exist, the +delivery failed, e.g., due to permission problems. +If no such process exists, the .Fa rk_fpid field is set to -1. .It Dv PROC_TRACE_CTL Enable or disable tracing of the specified process(es), according to the value of the integer argument. -Tracing includes attachment to the process using +Tracing includes attachment to the process using the .Xr ptrace 2 and .Xr ktrace 2 , debugging sysctls, .Xr hwpmc 4 , -.Xr dtrace 1 +.Xr dtrace 1 , and core dumping. Possible values for the .Fa data @@ -301,7 +301,7 @@ Only allowed for self. .It Dv PROC_TRACE_CTL_DISABLE Disable tracing for the specified process. Tracing is re-enabled when the process changes the executing -program with +program with the .Xr execve 2 syscall. A child inherits the trace settings from the parent on @@ -309,7 +309,7 @@ A child inherits the trace settings from .It Dv PROC_TRACE_CTL_DISABLE_EXEC Same as .Dv PROC_TRACE_CTL_DISABLE , -but the setting persist for the process even after +but the setting persists for the process even after .Xr execve 2 . .El .It Dv PROC_TRACE_STATUS @@ -319,7 +319,7 @@ the integer variable pointed to by If tracing is disabled, .Fa data is set to -1. -If tracing is enabled, but no debugger is attached by +If tracing is enabled, but no debugger is attached by the .Xr ptrace 2 syscall, .Fa data @@ -332,7 +332,7 @@ is set to the pid of the debugger proces Disabling tracing on a process should not be considered a security feature, as it is bypassable both by the kernel and privileged processes, and via other system mechanisms. -As such, it should not be relied on to reliably protect cryptographic +As such, it should not be utilized to reliably protect cryptographic keying material or other confidential data. .Sh RETURN VALUES If an error occurs, a value of -1 is returned and @@ -408,9 +408,9 @@ request was issued for a process already .It Bq Er EPERM The .Dv PROC_TRACE_CTL -request to re-enable tracing of the process ( -.Dv PROC_TRACE_CTL_ENABLE ) , -or to disable persistence of the +request to re-enable tracing of the process +.Po Dv PROC_TRACE_CTL_ENABLE Pc , +or to disable persistence of .Dv PROC_TRACE_CTL_DISABLE on .Xr execve 2 From owner-svn-src-head@freebsd.org Fri Aug 21 06:16:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F30979BF951; Fri, 21 Aug 2015 06:16:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5BA5167A; Fri, 21 Aug 2015 06:16:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 45EEA1FE023; Fri, 21 Aug 2015 08:16:29 +0200 (CEST) Subject: Re: svn commit: r286170 - head/share/man/man9 To: John-Mark Gurney References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> <55C09869.2040605@selasky.org> <20150804171051.GL78154@funkthat.com> Cc: Ed Schouten , Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <55D6C291.2080606@selasky.org> Date: Fri, 21 Aug 2015 08:17:53 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150804171051.GL78154@funkthat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 06:16:32 -0000 On 08/04/15 19:10, John-Mark Gurney wrote: > Hans Petter Selasky wrote this message on Tue, Aug 04, 2015 at 12:48 +0200: >> My gut feeling is it's good practice to have those wrapper macros >> because they isolate the compiler into a consistent and coherent API. > > Except that we now have a consistent and coherent API w/ > _Static_assert... We emulate this function on all compilers (or at least > try to, see bde's other email about issues w/ the ifdef mess), and > is available to both userland and kernel... It will also be available > on other platforms, as opposed to having to port our CTASSERT macros > to other platforms and introduce #ifdef's to make it compatible... > >> Wouldn't the argument be the same for queue.3 . Once C-compilers finally >> decide to compile time support queues, we should throw queue.3 aswell? >> I'd say it is better to stay independent of what the compiler guys will >> come up with next, reminding me how hard it was to upgrade a machine >> recently from 9- to 10- because of C++11 .... > > Last I checked, they don't change their API's ever revision of the > langauge... > > Comparing this to C++11? Just wow, see above how this is properly > covered by the ifdef mess in sys/cdefs.h for all compilers, this won't > introduce any complications like the C++11... > Hi, Here is one more argument against using "_Static_assert()": According to "http://en.cppreference.com/w/c/language/_Static_assert" _Static_assert is C11 syntax only, and we compile the kernel using "-std=iso9899:1999" according to "conf/kern.mk:CFLAGS" in -current. So technically it shouldn't work, and it throws up compile errors with certain other C tools I'm using at work which are more strict than clang. Any comments? --HPS From owner-svn-src-head@freebsd.org Fri Aug 21 06:30:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044729BFBCD; Fri, 21 Aug 2015 06:30:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E951E1ECC; Fri, 21 Aug 2015 06:30:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L6UDdK094839; Fri, 21 Aug 2015 06:30:13 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L6UDxJ094838; Fri, 21 Aug 2015 06:30:13 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508210630.t7L6UDxJ094838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 21 Aug 2015 06:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286981 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 06:30:14 -0000 Author: ed Date: Fri Aug 21 06:30:13 2015 New Revision: 286981 URL: https://svnweb.freebsd.org/changeset/base/286981 Log: Don't truncate cursor arithmetic to 16 bits. When updating the row number when the cursor position escape sequence is issued, we should make sure to store the intermediate result in a 32-bit integer. If we fail to do this, the cursor may be set above the origin region, which is bad. This could cause libteken to crash when INVARIANTS is enabled, due to the strict set of assertions that libteken has. PR: 202540 Reported by: kcwu csie org MFC after: 1 month Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Fri Aug 21 05:03:03 2015 (r286980) +++ head/sys/teken/teken_subr.h Fri Aug 21 06:30:13 2015 (r286981) @@ -324,13 +324,13 @@ static void teken_subr_cursor_position(teken_t *t, unsigned int row, unsigned int col) { - t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1; - if (t->t_cursor.tp_row >= t->t_originreg.ts_end) - t->t_cursor.tp_row = t->t_originreg.ts_end - 1; - - t->t_cursor.tp_col = col - 1; - if (t->t_cursor.tp_col >= t->t_winsize.tp_col) - t->t_cursor.tp_col = t->t_winsize.tp_col - 1; + row = row - 1 + t->t_originreg.ts_begin; + t->t_cursor.tp_row = row < t->t_originreg.ts_end ? + row : t->t_originreg.ts_end - 1; + + col--; + t->t_cursor.tp_col = col < t->t_winsize.tp_col ? + col : t->t_winsize.tp_col - 1; t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); From owner-svn-src-head@freebsd.org Fri Aug 21 06:43:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 516F09BFF76 for ; Fri, 21 Aug 2015 06:43:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 208DCCB5 for ; Fri, 21 Aug 2015 06:43:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by obkg7 with SMTP id g7so51580904obk.3 for ; Thu, 20 Aug 2015 23:43:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=iDfYk7YAwIRUsvnGENjKQhkOEXzw4CZsL4gXlZDygTw=; b=drVsEO0+JhkyXOaUTG8hnxprsKcL5Cou+aYIdzWqCKWI+lZoaAuZ5426cP/yZdEyAW lsajJODRq4PeS/yogQnAf/UDe8i0lm0Crh0MQha6qYRgLVM0l48BESfPmFPGzNfBPjmG d5mAXD2O1SEJ8KgaHi6h/30a+o/qGSencP67MjvfPO+7cqBm8gRHpHeJ3QMrMEbmkJBH 8slf+4/7sNrN0agoDKqKtNINe5S9UfNl1/fmhYMXpNWNMB2am+/lKLv6TEr5zBuVfTJE tAsAFf8Qp+PNlfH3cPVODMH9QjNKlycpOTr7B4PCVt7826we++RvdkcTvOcK74FEYFTZ tp5w== X-Gm-Message-State: ALoCoQnQQvJguXdldQMITn80H+vZdgvE3ZcuCCC/5rKs8utTZNYkyTIWhVeArYR7MZtChMXqnGjU MIME-Version: 1.0 X-Received: by 10.60.74.193 with SMTP id w1mr6321690oev.33.1440139381662; Thu, 20 Aug 2015 23:43:01 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Thu, 20 Aug 2015 23:43:01 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <55D6C291.2080606@selasky.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> <55C09869.2040605@selasky.org> <20150804171051.GL78154@funkthat.com> <55D6C291.2080606@selasky.org> Date: Fri, 21 Aug 2015 08:43:01 +0200 Message-ID: Subject: Re: svn commit: r286170 - head/share/man/man9 From: Ed Schouten To: Hans Petter Selasky Cc: John-Mark Gurney , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 06:43:08 -0000 2015-08-21 8:17 GMT+02:00 Hans Petter Selasky : > Here is one more argument against using "_Static_assert()": > > According to "http://en.cppreference.com/w/c/language/_Static_assert" > _Static_assert is C11 syntax only, and we compile the kernel using > "-std=iso9899:1999" according to "conf/kern.mk:CFLAGS" in -current. So > technically it shouldn't work, and it throws up compile errors with certain > other C tools I'm using at work which are more strict than clang. In practice it does. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 21 07:09:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F2DF9BD73A; Fri, 21 Aug 2015 07:09:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC1A1C58; Fri, 21 Aug 2015 07:09:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L79scJ012999; Fri, 21 Aug 2015 07:09:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L79sAX012997; Fri, 21 Aug 2015 07:09:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508210709.t7L79sAX012997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 21 Aug 2015 07:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286982 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 07:09:54 -0000 Author: bapt Date: Fri Aug 21 07:09:53 2015 New Revision: 286982 URL: https://svnweb.freebsd.org/changeset/base/286982 Log: Fix useradd regression: Readd the function to create the parents home directory if it does not exists. if it is only a directory at the top level of the hierarchy symlink it into /usr as it used to be done before. Reported by: kevlo, adrian Modified: head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Fri Aug 21 06:30:13 2015 (r286981) +++ head/usr.sbin/pw/pw_user.c Fri Aug 21 07:09:53 2015 (r286982) @@ -38,6 +38,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -85,11 +86,76 @@ static void rmat(uid_t uid); static void rmopie(char const * name); static void +mkdir_home_parents(int dfd, const char *dir) +{ + struct stat st; + char *dirs, *tmp; + + if (*dir != '/') + errx(EX_DATAERR, "invalid base directory for home '%s'", dir); + + dir++; + + if (fstatat(dfd, dir, &st, 0) != -1) { + if (S_ISDIR(st.st_mode)) + return; + errx(EX_OSFILE, "root home `/%s' is not a directory", dir); + } + + dirs = strdup(dir); + if (dirs == NULL) + errx(EX_UNAVAILABLE, "out of memory"); + + tmp = strrchr(dirs, '/'); + if (tmp == NULL) + return; + tmp[0] = '\0'; + + /* + * This is a kludge especially for Joerg :) + * If the home directory would be created in the root partition, then + * we really create it under /usr which is likely to have more space. + * But we create a symlink from cnf->home -> "/usr" -> cnf->home + */ + if (strchr(dirs, '/') == NULL) { + asprintf(&tmp, "usr/%s", dirs); + if (tmp == NULL) + errx(EX_UNAVAILABLE, "out of memory"); + if (mkdirat(dfd, tmp, _DEF_DIRMODE) != -1 || errno == EEXIST) { + fchownat(dfd, tmp, 0, 0, 0); + symlinkat(tmp, dfd, dirs + 1); + } + free(tmp); + } + tmp = dirs; + if (fstatat(dfd, dirs, &st, 0) == -1) { + while ((tmp = strchr(tmp + 1, '/')) != NULL) { + *tmp = '\0'; + if (fstatat(dfd, dirs, &st, 0) == -1) { + if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) + err(EX_OSFILE, "'%s' (root home parent) is not a directory", dirs); + } + *tmp = '/'; + } + } + if (fstatat(dfd, dirs, &st, 0) == -1) { + if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) + err(EX_OSFILE, "'%s' (root home parent) is not a directory", dirs); + fchownat(dfd, dirs, 0, 0, 0); + } + + free(dirs); +} + +static void create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd, const char *skeldir, mode_t homemode, bool update) { int skelfd = -1; + /* Create home parents directories */ + mkdir_home_parents(conf.rootfd, pwd->pw_dir); + if (skeldir != NULL && *skeldir != '\0') { if (*skeldir == '/') skeldir++; Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 06:30:13 2015 (r286981) +++ head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 07:09:53 2015 (r286982) @@ -245,7 +245,6 @@ user_add_R_body() { populate_root_etc_skel atf_check -s exit:0 ${RPW} useradd foo - mkdir -p ${HOME}/home atf_check -s exit:0 ${RPW} useradd bar -m test -d ${HOME}/home/bar || atf_fail "Directory not created" atf_check -s exit:0 ${RPW} userdel bar @@ -260,7 +259,7 @@ user_add_skel_body() { populate_root_etc_skel mkdir ${HOME}/skel - echo "a" > ${HOME}/skel/.a + echo "a" > ${HOME}/skel/.ae echo "b" > ${HOME}/skel/b mkdir ${HOME}/skel/c mkdir ${HOME}/skel/c/d From owner-svn-src-head@freebsd.org Fri Aug 21 08:04:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC36F9BF280; Fri, 21 Aug 2015 08:04:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D560A181F; Fri, 21 Aug 2015 08:04:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L84vl5039256; Fri, 21 Aug 2015 08:04:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L84vuv039255; Fri, 21 Aug 2015 08:04:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508210804.t7L84vuv039255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 21 Aug 2015 08:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286983 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:04:58 -0000 Author: avg Date: Fri Aug 21 08:04:56 2015 New Revision: 286983 URL: https://svnweb.freebsd.org/changeset/base/286983 Log: fix a mismerge in r286539 (MFV 286538: 5562 ZFS sa_handle's violate...) PR: 202358 X-MFC with: r286539 X-MFC attn: mav Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 21 07:09:53 2015 (r286982) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 21 08:04:56 2015 (r286983) @@ -220,7 +220,6 @@ static void sa_cache_destructor(void *buf, void *unused) { sa_handle_t *hdl = buf; - hdl->sa_dbu.dbu_evict_func = NULL; mutex_destroy(&hdl->sa_lock); } @@ -1385,6 +1384,7 @@ sa_handle_get_from_db(objset_t *os, dmu_ sa_handle_t *winner = NULL; handle = kmem_cache_alloc(sa_cache, KM_SLEEP); + handle->sa_dbu.dbu_evict_func = NULL; handle->sa_userp = userp; handle->sa_bonus = db; handle->sa_os = os; From owner-svn-src-head@freebsd.org Fri Aug 21 08:06:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7760E9BF2E2; Fri, 21 Aug 2015 08:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 689721A86; Fri, 21 Aug 2015 08:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L86Jfr039495; Fri, 21 Aug 2015 08:06:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L86J5t039494; Fri, 21 Aug 2015 08:06:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508210806.t7L86J5t039494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 21 Aug 2015 08:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286984 - head/sys/modules/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:06:19 -0000 Author: avg Date: Fri Aug 21 08:06:18 2015 New Revision: 286984 URL: https://svnweb.freebsd.org/changeset/base/286984 Log: fix standalone build of zfs module Not sure if this is a proper fix, but it does the job. Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Fri Aug 21 08:04:56 2015 (r286983) +++ head/sys/modules/zfs/Makefile Fri Aug 21 08:06:18 2015 (r286984) @@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../.. KMOD= zfs -SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h +SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h opt_random.h SUNW= ${SYSDIR}/cddl/contrib/opensolaris From owner-svn-src-head@freebsd.org Fri Aug 21 08:17:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167509BF48F; Fri, 21 Aug 2015 08:17:20 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D631C1F8B; Fri, 21 Aug 2015 08:17:19 +0000 (UTC) (envelope-from mark@grondar.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ZShVl-0009CS-PM; Fri, 21 Aug 2015 09:17:17 +0100 Subject: Re: svn commit: r286984 - head/sys/modules/zfs Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <201508210806.t7L86J5t039494@repo.freebsd.org> Date: Fri, 21 Aug 2015 09:17:12 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7F30B891-8FD7-4FD7-AB53-AAEDB98CED59@grondar.org> References: <201508210806.t7L86J5t039494@repo.freebsd.org> To: Andriy Gapon X-Mailer: Apple Mail (2.2104) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:17:20 -0000 Thanks! I=E2=80=99ve been running =E2=80=9Cmake universe=E2=80=9D here as a = build-test. I wonder why this was not picked up? M > On 21 Aug 2015, at 09:06, Andriy Gapon wrote: >=20 > Author: avg > Date: Fri Aug 21 08:06:18 2015 > New Revision: 286984 > URL: https://svnweb.freebsd.org/changeset/base/286984 >=20 > Log: > fix standalone build of zfs module >=20 > Not sure if this is a proper fix, but it does the job. >=20 > Modified: > head/sys/modules/zfs/Makefile >=20 > Modified: head/sys/modules/zfs/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/modules/zfs/Makefile Fri Aug 21 08:04:56 2015 = (r286983) > +++ head/sys/modules/zfs/Makefile Fri Aug 21 08:06:18 2015 = (r286984) > @@ -4,7 +4,7 @@ SYSDIR?=3D${.CURDIR}/../.. >=20 > KMOD=3D zfs >=20 > -SRCS=3D bus_if.h device_if.h vnode_if.h opt_kstack_pages.h > +SRCS=3D bus_if.h device_if.h vnode_if.h opt_kstack_pages.h = opt_random.h >=20 > SUNW=3D ${SYSDIR}/cddl/contrib/opensolaris >=20 >=20 --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Fri Aug 21 08:17:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5459E9BF4BA; Fri, 21 Aug 2015 08:17:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C05147; Fri, 21 Aug 2015 08:17:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L8Hjph043732; Fri, 21 Aug 2015 08:17:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L8Hj26043731; Fri, 21 Aug 2015 08:17:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508210817.t7L8Hj26043731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 21 Aug 2015 08:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286985 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:17:45 -0000 Author: avg Date: Fri Aug 21 08:17:44 2015 New Revision: 286985 URL: https://svnweb.freebsd.org/changeset/base/286985 Log: try to fix lor between z_teardown_lock and spa_namespace_lock The lock order reversal and a resulting deadlock were introduced in r285021 / D2865. The problem is that zfs_register_callbacks() calls dsl_prop_get_integer() that has to acquire spa_namespace_lock. At the same time, spa_config_sync() is called with spa_namespace_lock held and then it performs ZFS vnode operations that acquire z_teardown_lock in the reader mode. So, fix the problem by using dsl_prop_get_int_ds() instead of dsl_prop_get_integer(). The former does not need to look up the pool and the dataset by name. Reported by: many Reviewed by: delphij Tested by: delphij, Jens Schweikhardt MFC after: 5 days X-MFC with: r285021 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 Fri Aug 21 08:06:18 2015 (r286984) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Aug 21 08:17:44 2015 (r286985) @@ -472,6 +472,19 @@ zfs_register_callbacks(vfs_t *vfsp) } /* + * We need to enter pool configuration here, so that we can use + * dsl_prop_get_int_ds() to handle the special nbmand property below. + * dsl_prop_get_integer() can not be used, because it has to acquire + * spa_namespace_lock and we can not do that because we already hold + * z_teardown_lock. The problem is that spa_config_sync() is called + * with spa_namespace_lock held and the function calls ZFS vnode + * operations to write the cache file and thus z_teardown_lock is + * acquired after spa_namespace_lock. + */ + ds = dmu_objset_ds(os); + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); + + /* * nbmand is a special property. It can only be changed at * mount time. * @@ -482,14 +495,9 @@ zfs_register_callbacks(vfs_t *vfsp) nbmand = B_FALSE; } else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) { nbmand = B_TRUE; - } else { - char osname[MAXNAMELEN]; - - dmu_objset_name(os, osname); - if (error = dsl_prop_get_integer(osname, "nbmand", &nbmand, - NULL)) { - return (error); - } + } else if (error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand) != 0) { + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); + return (error); } /* @@ -499,8 +507,6 @@ zfs_register_callbacks(vfs_t *vfsp) * the first prop_register(), but I guess I like to go * overboard... */ - ds = dmu_objset_ds(os); - dsl_pool_config_enter(dmu_objset_pool(os), FTAG); error = dsl_prop_register(ds, zfs_prop_to_name(ZFS_PROP_ATIME), atime_changed_cb, zfsvfs); error = error ? error : dsl_prop_register(ds, From owner-svn-src-head@freebsd.org Fri Aug 21 08:21:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E099BF560; Fri, 21 Aug 2015 08:21:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id DC0F778F; Fri, 21 Aug 2015 08:21:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA21343; Fri, 21 Aug 2015 11:21:31 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZShZq-000Da2-Ur; Fri, 21 Aug 2015 11:21:31 +0300 Subject: Re: svn commit: r286984 - head/sys/modules/zfs To: Mark R V Murray References: <201508210806.t7L86J5t039494@repo.freebsd.org> <7F30B891-8FD7-4FD7-AB53-AAEDB98CED59@grondar.org> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: <55D6DF3D.6030103@FreeBSD.org> Date: Fri, 21 Aug 2015 11:20:13 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <7F30B891-8FD7-4FD7-AB53-AAEDB98CED59@grondar.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:21:35 -0000 Precisely because it's the standalone build (cd sys/modules/zfs && make ...) that was affected. Building the module as a part of the kernel build worked just fine. On 21/08/2015 11:17, Mark R V Murray wrote: > Thanks! > > I’ve been running “make universe” here as a build-test. I wonder why this was not picked up? > > M > >> On 21 Aug 2015, at 09:06, Andriy Gapon wrote: >> >> Author: avg >> Date: Fri Aug 21 08:06:18 2015 >> New Revision: 286984 >> URL: https://svnweb.freebsd.org/changeset/base/286984 >> >> Log: >> fix standalone build of zfs module >> >> Not sure if this is a proper fix, but it does the job. >> >> Modified: >> head/sys/modules/zfs/Makefile >> >> Modified: head/sys/modules/zfs/Makefile >> ============================================================================== >> --- head/sys/modules/zfs/Makefile Fri Aug 21 08:04:56 2015 (r286983) >> +++ head/sys/modules/zfs/Makefile Fri Aug 21 08:06:18 2015 (r286984) >> @@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../.. >> >> KMOD= zfs >> >> -SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h >> +SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h opt_random.h >> >> SUNW= ${SYSDIR}/cddl/contrib/opensolaris >> >> > -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Aug 21 08:34:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F01DE9BF8A0; Fri, 21 Aug 2015 08:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CC29DDD4; Fri, 21 Aug 2015 08:34:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA21502; Fri, 21 Aug 2015 11:34:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZShmP-000Dar-5k; Fri, 21 Aug 2015 11:34:29 +0300 Subject: Re: svn commit: r286985 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201508210817.t7L8Hj26043731@repo.freebsd.org> From: Andriy Gapon Message-ID: <55D6E25E.5030007@FreeBSD.org> Date: Fri, 21 Aug 2015 11:33:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508210817.t7L8Hj26043731@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 08:34:33 -0000 On 21/08/2015 11:17, Andriy Gapon wrote: > Author: avg > Date: Fri Aug 21 08:17:44 2015 > New Revision: 286985 > URL: https://svnweb.freebsd.org/changeset/base/286985 > > Log: > try to fix lor between z_teardown_lock and spa_namespace_lock > > The lock order reversal and a resulting deadlock were introduced > in r285021 / D2865. The problem is that zfs_register_callbacks() calls > dsl_prop_get_integer() that has to acquire spa_namespace_lock. > At the same time, spa_config_sync() is called with spa_namespace_lock > held and then it performs ZFS vnode operations that acquire > z_teardown_lock in the reader mode. > > So, fix the problem by using dsl_prop_get_int_ds() instead of > dsl_prop_get_integer(). The former does not need to look up > the pool and the dataset by name. > > Reported by: many > Reviewed by: delphij > Tested by: delphij, Jens Schweikhardt > MFC after: 5 days > X-MFC with: r285021 Differential Revision: https://reviews.freebsd.org/D3281 -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Aug 21 09:28:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A4729BE39D; Fri, 21 Aug 2015 09:28:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105F9145D; Fri, 21 Aug 2015 09:28:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7L9SKq0072524; Fri, 21 Aug 2015 09:28:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7L9SKsH072522; Fri, 21 Aug 2015 09:28:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508210928.t7L9SKsH072522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 21 Aug 2015 09:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286986 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 09:28:21 -0000 Author: bapt Date: Fri Aug 21 09:28:20 2015 New Revision: 286986 URL: https://svnweb.freebsd.org/changeset/base/286986 Log: Fix /home symlink creation Add regression test about it Modified: head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Fri Aug 21 08:17:44 2015 (r286985) +++ head/usr.sbin/pw/pw_user.c Fri Aug 21 09:28:20 2015 (r286986) @@ -123,7 +123,7 @@ mkdir_home_parents(int dfd, const char * errx(EX_UNAVAILABLE, "out of memory"); if (mkdirat(dfd, tmp, _DEF_DIRMODE) != -1 || errno == EEXIST) { fchownat(dfd, tmp, 0, 0, 0); - symlinkat(tmp, dfd, dirs + 1); + symlinkat(tmp, dfd, dirs); } free(tmp); } Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 08:17:44 2015 (r286985) +++ head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 09:28:20 2015 (r286986) @@ -246,6 +246,7 @@ user_add_R_body() { atf_check -s exit:0 ${RPW} useradd foo atf_check -s exit:0 ${RPW} useradd bar -m + test -d ${HOME}/home || atf_fail "Home parent directory not created" test -d ${HOME}/home/bar || atf_fail "Directory not created" atf_check -s exit:0 ${RPW} userdel bar test -d ${HOME}/home/bar || atf_fail "Directory removed" @@ -254,6 +255,17 @@ user_add_R_body() { [ ! -d ${HOME}/home/bar ] || atf_fail "Directory not removed" } +atf_test_case user_add_R_symlink +user_add_R_symlink_body() { + populate_root_etc_skel + + mkdir ${HOME}/usr + atf_check -s exit:0 ${RPW} useradd foo -m + test -d ${HOME}/usr/home || atf_fail "Home parent directory not created" + test -h ${HOME}/home || atf_fail "/home directory is not a symlink" + atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home +} + atf_test_case user_add_skel user_add_skel_body() { populate_root_etc_skel @@ -348,6 +360,7 @@ atf_init_test_cases() { atf_add_test_case user_add_invalid_group_entry atf_add_test_case user_add_password_from_h atf_add_test_case user_add_R + atf_add_test_case user_add_R_symlink atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large From owner-svn-src-head@freebsd.org Fri Aug 21 11:25:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 466FB9BCCC2; Fri, 21 Aug 2015 11:25:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD6C1B19; Fri, 21 Aug 2015 11:25:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LBPhQN021423; Fri, 21 Aug 2015 11:25:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LBPhbf021422; Fri, 21 Aug 2015 11:25:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508211125.t7LBPhbf021422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 21 Aug 2015 11:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286991 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 11:25:43 -0000 Author: bapt Date: Fri Aug 21 11:25:42 2015 New Revision: 286991 URL: https://svnweb.freebsd.org/changeset/base/286991 Log: Fix typo in regression test Modified: head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 10:49:12 2015 (r286990) +++ head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 11:25:42 2015 (r286991) @@ -271,7 +271,7 @@ user_add_skel_body() { populate_root_etc_skel mkdir ${HOME}/skel - echo "a" > ${HOME}/skel/.ae + echo "a" > ${HOME}/skel/.a echo "b" > ${HOME}/skel/b mkdir ${HOME}/skel/c mkdir ${HOME}/skel/c/d From owner-svn-src-head@freebsd.org Fri Aug 21 14:15:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 368C09BF908; Fri, 21 Aug 2015 14:15:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 278DF1B0C; Fri, 21 Aug 2015 14:15:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LEFtMS000643; Fri, 21 Aug 2015 14:15:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LEFtOk000642; Fri, 21 Aug 2015 14:15:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508211415.t7LEFtOk000642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 14:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286992 - head/usr.sbin/hyperv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 14:15:55 -0000 Author: imp Date: Fri Aug 21 14:15:54 2015 New Revision: 286992 URL: https://svnweb.freebsd.org/changeset/base/286992 Log: Turn off gcc's uninitialized warnings for this code. They can be fixed, but really do appear to be false alarms. Modified: head/usr.sbin/hyperv/Makefile.inc Modified: head/usr.sbin/hyperv/Makefile.inc ============================================================================== --- head/usr.sbin/hyperv/Makefile.inc Fri Aug 21 11:25:42 2015 (r286991) +++ head/usr.sbin/hyperv/Makefile.inc Fri Aug 21 14:15:54 2015 (r286992) @@ -1,3 +1,4 @@ # $FreeBSD$ +CFLAGS.gcc+= -Wno-uninitialized .include "../Makefile.inc" From owner-svn-src-head@freebsd.org Fri Aug 21 14:28:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 012AD9BFCAF; Fri, 21 Aug 2015 14:28:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5CA983F; Fri, 21 Aug 2015 14:28:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LESFgg005804; Fri, 21 Aug 2015 14:28:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LESFPX005802; Fri, 21 Aug 2015 14:28:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508211428.t7LESFPX005802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 21 Aug 2015 14:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286993 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 14:28:16 -0000 Author: bapt Date: Fri Aug 21 14:28:14 2015 New Revision: 286993 URL: https://svnweb.freebsd.org/changeset/base/286993 Log: Fix err pointer not initialized to NULL resulting Reported by: "O. Hartmann" Modified: head/usr.sbin/pw/strtounum.c head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/strtounum.c ============================================================================== --- head/usr.sbin/pw/strtounum.c Fri Aug 21 14:15:54 2015 (r286992) +++ head/usr.sbin/pw/strtounum.c Fri Aug 21 14:28:14 2015 (r286993) @@ -41,6 +41,7 @@ strtounum(const char * __restrict np, ui char *endp; uintmax_t ret; + *errpp = NULL; if (minval > maxval) { errno = EINVAL; if (errpp != NULL) Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 14:15:54 2015 (r286992) +++ head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 14:28:14 2015 (r286993) @@ -338,6 +338,20 @@ user_add_w_yes_body() { grep "^foo" ${HOME}/master.passwd } +atf_test_case user_add_with_pw_conf +user_add_with_pw_conf_body() +{ + populate_etc_skel + atf_check -s exit:0 \ + ${PW} useradd -D -C ${HOME}/pw.conf \ + -u 2000,32767 -i 2000,32767 + atf_check -s exit:0 \ + -o inline:"minuid = 2000\nmaxuid = 32767\nmingid = 2000\nmaxgid = 32767\n" \ + grep "^m.*id =" ${HOME}/pw.conf + atf_check -s exit:0 \ + ${PW} useradd foo -C ${HOME}/pw.conf +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -367,4 +381,5 @@ atf_init_test_cases() { atf_add_test_case user_add_bad_shell atf_add_test_case user_add_already_exists atf_add_test_case user_add_w_yes + atf_add_test_case user_add_with_pw_conf } From owner-svn-src-head@freebsd.org Fri Aug 21 15:13:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A7099BF495; Fri, 21 Aug 2015 15:13:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 537421BB4; Fri, 21 Aug 2015 15:13:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFDQSi028107; Fri, 21 Aug 2015 15:13:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFDQri028106; Fri, 21 Aug 2015 15:13:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508211513.t7LFDQri028106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 21 Aug 2015 15:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286994 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:13:26 -0000 Author: kib Date: Fri Aug 21 15:13:25 2015 New Revision: 286994 URL: https://svnweb.freebsd.org/changeset/base/286994 Log: Automatically disable x2APIC mode on SandyBridge Lenovo machines. I believe that the bug only affects mobile CPUs, at least I did not see other reports, but it is impossible to detect it in madt_setup_local(). While there, reduce duplication in the information strings printed when x2APIC is auto-disabled, and do not print the line when user manually override the setting. Tested and reviewed by: royger (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/acpica/madt.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Fri Aug 21 14:28:14 2015 (r286993) +++ head/sys/x86/acpica/madt.c Fri Aug 21 15:13:25 2015 (r286994) @@ -132,20 +132,27 @@ madt_setup_local(void) { ACPI_TABLE_DMAR *dmartbl; vm_paddr_t dmartbl_physaddr; + const char *reason; + char *hw_vendor; u_int p[4]; madt = pmap_mapbios(madt_physaddr, madt_length); if ((cpu_feature2 & CPUID2_X2APIC) != 0) { x2apic_mode = 1; + reason = NULL; + + /* + * Automatically detect several configurations where + * x2APIC mode is known to cause troubles. User can + * override the setting with hw.x2apic_enable tunable. + */ dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); if (dmartbl_physaddr != 0) { dmartbl = acpi_map_table(dmartbl_physaddr, ACPI_SIG_DMAR); if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) { x2apic_mode = 0; - if (bootverbose) - printf( - "x2APIC available but disabled by DMAR table\n"); + reason = "by DMAR table"; } acpi_unmap_table(dmartbl); } @@ -154,14 +161,34 @@ madt_setup_local(void) if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) { x2apic_mode = 0; - if (bootverbose) - printf( - "x2APIC available but disabled inside VMWare without intr redirection\n"); + reason = "inside VMWare without intr redirection"; } } else if (vm_guest == VM_GUEST_XEN) { x2apic_mode = 0; + reason = "due to running under XEN"; + } else if (vm_guest == VM_GUEST_NO) { + hw_vendor = kern_getenv("smbios.planar.maker"); + /* + * It seems that some Lenovo SandyBridge-based + * notebook BIOSes have a bug which prevents + * booting AP in x2APIC mode. Since the only + * way to detect mobile CPU is to check + * northbridge pci id, which cannot be done + * that early, disable x2APIC for all Lenovo + * SandyBridge machines. + */ + if (hw_vendor != NULL && + !strcmp(hw_vendor, "LENOVO") && + CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) == 0x2a) { + x2apic_mode = 0; + reason = "for a suspected Lenovo SandyBridge BIOS bug"; + } + freeenv(hw_vendor); } TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode); + if (!x2apic_mode && reason != NULL && bootverbose) + printf("x2APIC available but disabled %s\n", reason); } lapic_init(madt->Address); From owner-svn-src-head@freebsd.org Fri Aug 21 15:15:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CBD9BF4E4; Fri, 21 Aug 2015 15:15:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E091D19; Fri, 21 Aug 2015 15:15:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFFMPr028323; Fri, 21 Aug 2015 15:15:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFFM0U028322; Fri, 21 Aug 2015 15:15:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508211515.t7LFFM0U028322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 15:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286995 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:15:23 -0000 Author: imp Date: Fri Aug 21 15:15:22 2015 New Revision: 286995 URL: https://svnweb.freebsd.org/changeset/base/286995 Log: Document bsd.progs.mk, including its status as being strongly discouraged and that it will be going away as soon as is practicable. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 15:13:25 2015 (r286994) +++ head/share/mk/bsd.README Fri Aug 21 15:15:22 2015 (r286995) @@ -36,6 +36,7 @@ bsd.port.post.mk - building ports bsd.port.pre.mk - building ports bsd.port.subdir.mk - targets for building subdirectories for ports bsd.prog.mk - building programs from source files +bsd.progs.mk - build multiple programs from sources (depreciated) bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd bsd.subdir.mk - targets for building subdirectories bsd.sys.mk - common settings used for building FreeBSD sources From owner-svn-src-head@freebsd.org Fri Aug 21 15:21:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C8F9BF6FA; Fri, 21 Aug 2015 15:21:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6C0389F; Fri, 21 Aug 2015 15:21:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFLvbv032851; Fri, 21 Aug 2015 15:21:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFLvAZ032848; Fri, 21 Aug 2015 15:21:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508211521.t7LFLvAZ032848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 21 Aug 2015 15:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286997 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:21:58 -0000 Author: cem Date: Fri Aug 21 15:21:56 2015 New Revision: 286997 URL: https://svnweb.freebsd.org/changeset/base/286997 Log: vt_cpulogos: Resize all terms/windows when tearing down logos PR: 202288 (partial) Tested by: Jakob Alvermark Reviewed by: ed Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3388 Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt.h Fri Aug 21 15:21:56 2015 (r286997) @@ -369,6 +369,7 @@ struct vt_driver { * Utility macro to make early vt(4) instances work. */ +extern struct vt_device vt_consdev; extern struct terminal vt_consterm; extern const struct terminal_class vt_termclass; void vt_upgrade(struct vt_device *vd); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt_core.c Fri Aug 21 15:21:56 2015 (r286997) @@ -144,7 +144,6 @@ VT_SYSCTL_INT(splash_cpu_style, 2, "Draw "(0 = Alternate beastie, 1 = Beastie, 2 = Orb)"); VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); -static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); struct vt_device *main_vd = &vt_consdev; @@ -187,7 +186,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver struct terminal vt_consterm; static struct vt_window vt_conswindow; -static struct vt_device vt_consdev = { +struct vt_device vt_consdev = { .vd_driver = NULL, .vd_softc = NULL, .vd_prev_driver = NULL, Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt_cpulogos.c Fri Aug 21 15:21:56 2015 (r286997) @@ -152,6 +152,7 @@ vt_fini_logos(void *dummy __unused) struct vt_font *vf; struct winsize wsz; term_pos_t size; + unsigned int i; if (!vt_draw_logo_cpus) return; @@ -160,44 +161,43 @@ vt_fini_logos(void *dummy __unused) if (!vt_splash_cpu) return; - tm = &vt_consterm; - vw = tm->tm_softc; - if (vw == NULL) - return; - vd = vw->vw_device; - if (vd == NULL) - return; - vf = vw->vw_font; - if (vf == NULL) - return; - + vd = &vt_consdev; VT_LOCK(vd); - if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) - goto out; - + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) { + VT_UNLOCK(vd); + return; + } vt_draw_logo_cpus = 0; VT_UNLOCK(vd); - vt_termsize(vd, vf, &size); - vt_winsize(vd, vf, &wsz); - - /* Resize screen buffer and terminal. */ - terminal_mute(tm, 1); - vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); - terminal_set_winsize_blank(tm, &wsz, 0, NULL); - terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); - terminal_mute(tm, 0); - - VT_LOCK(vd); - vt_compute_drawable_area(vw); - - if (vd->vd_curwindow == vw) { - vd->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vd, 0); + for (i = 0; i < VT_MAXWINDOWS; i++) { + vw = vd->vd_windows[i]; + if (vw == NULL) + continue; + tm = vw->vw_terminal; + vf = vw->vw_font; + if (vf == NULL) + continue; + + vt_termsize(vd, vf, &size); + vt_winsize(vd, vf, &wsz); + + /* Resize screen buffer and terminal. */ + terminal_mute(tm, 1); + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); + terminal_set_winsize_blank(tm, &wsz, 0, NULL); + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); + terminal_mute(tm, 0); + + VT_LOCK(vd); + vt_compute_drawable_area(vw); + + if (vd->vd_curwindow == vw) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vd, 0); + } + VT_UNLOCK(vd); } - -out: - VT_UNLOCK(vd); } static void From owner-svn-src-head@freebsd.org Fri Aug 21 15:22:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5466D9BF74F; Fri, 21 Aug 2015 15:22:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21615AA0; Fri, 21 Aug 2015 15:22:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodt126 with SMTP id t126so85398750iod.2; Fri, 21 Aug 2015 08:22:51 -0700 (PDT) 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=/HcHZ2ReXUgMkmksSzj3OqK29ahM6w3KwXI7XvYZFUI=; b=xqnXG7BIPReH8Gv9bgSRiY1SzI8BzFQJViVYWxY+RTC81HUZD5Z2wl3i1EzLO5Vm+S 9aVpcYqwTXaInGkCMbSEJOIZ+zgzMV2Qo7ZQJisTG1d+kQ1s7I010r7mKXJ8cu2CWfJM 7RinBUepIrvETD7U5kv6hsdNbS/v25ri9xdYCGjbvtmd3xfivRP8jkAmEZMVvvPacEw+ dTucdJ3URBQk4hKER1x8ovfRwgqIdtvw9FLzGbu7y/msG13PRKzDh7yYQUIB2fVcz0OE yM/yPdipBfU7DFRbhKuy1jU9jfJYToom+QpEPLhujWu1vANQ+uxu+oVxZ8khyxbSdJBx goOw== MIME-Version: 1.0 X-Received: by 10.107.131.196 with SMTP id n65mr7117580ioi.75.1440170571430; Fri, 21 Aug 2015 08:22:51 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Fri, 21 Aug 2015 08:22:51 -0700 (PDT) In-Reply-To: <201508211513.t7LFDQri028106@repo.freebsd.org> References: <201508211513.t7LFDQri028106@repo.freebsd.org> Date: Fri, 21 Aug 2015 08:22:51 -0700 Message-ID: Subject: Re: svn commit: r286994 - head/sys/x86/acpica From: Adrian Chadd To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:22:52 -0000 Think we could do the same for the Asus zenbooks? -a On 21 August 2015 at 08:13, Konstantin Belousov wrote: > Author: kib > Date: Fri Aug 21 15:13:25 2015 > New Revision: 286994 > URL: https://svnweb.freebsd.org/changeset/base/286994 > > Log: > Automatically disable x2APIC mode on SandyBridge Lenovo machines. I > believe that the bug only affects mobile CPUs, at least I did not see > other reports, but it is impossible to detect it in madt_setup_local(). > > While there, reduce duplication in the information strings printed > when x2APIC is auto-disabled, and do not print the line when user > manually override the setting. > > Tested and reviewed by: royger (previous version) > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/x86/acpica/madt.c > > Modified: head/sys/x86/acpica/madt.c > ============================================================================== > --- head/sys/x86/acpica/madt.c Fri Aug 21 14:28:14 2015 (r286993) > +++ head/sys/x86/acpica/madt.c Fri Aug 21 15:13:25 2015 (r286994) > @@ -132,20 +132,27 @@ madt_setup_local(void) > { > ACPI_TABLE_DMAR *dmartbl; > vm_paddr_t dmartbl_physaddr; > + const char *reason; > + char *hw_vendor; > u_int p[4]; > > madt = pmap_mapbios(madt_physaddr, madt_length); > if ((cpu_feature2 & CPUID2_X2APIC) != 0) { > x2apic_mode = 1; > + reason = NULL; > + > + /* > + * Automatically detect several configurations where > + * x2APIC mode is known to cause troubles. User can > + * override the setting with hw.x2apic_enable tunable. > + */ > dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); > if (dmartbl_physaddr != 0) { > dmartbl = acpi_map_table(dmartbl_physaddr, > ACPI_SIG_DMAR); > if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) { > x2apic_mode = 0; > - if (bootverbose) > - printf( > - "x2APIC available but disabled by DMAR table\n"); > + reason = "by DMAR table"; > } > acpi_unmap_table(dmartbl); > } > @@ -154,14 +161,34 @@ madt_setup_local(void) > if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || > (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) { > x2apic_mode = 0; > - if (bootverbose) > - printf( > - "x2APIC available but disabled inside VMWare without intr redirection\n"); > + reason = "inside VMWare without intr redirection"; > } > } else if (vm_guest == VM_GUEST_XEN) { > x2apic_mode = 0; > + reason = "due to running under XEN"; > + } else if (vm_guest == VM_GUEST_NO) { > + hw_vendor = kern_getenv("smbios.planar.maker"); > + /* > + * It seems that some Lenovo SandyBridge-based > + * notebook BIOSes have a bug which prevents > + * booting AP in x2APIC mode. Since the only > + * way to detect mobile CPU is to check > + * northbridge pci id, which cannot be done > + * that early, disable x2APIC for all Lenovo > + * SandyBridge machines. > + */ > + if (hw_vendor != NULL && > + !strcmp(hw_vendor, "LENOVO") && > + CPUID_TO_FAMILY(cpu_id) == 0x6 && > + CPUID_TO_MODEL(cpu_id) == 0x2a) { > + x2apic_mode = 0; > + reason = "for a suspected Lenovo SandyBridge BIOS bug"; > + } > + freeenv(hw_vendor); > } > TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode); > + if (!x2apic_mode && reason != NULL && bootverbose) > + printf("x2APIC available but disabled %s\n", reason); > } > > lapic_init(madt->Address); > From owner-svn-src-head@freebsd.org Fri Aug 21 15:30:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB5239BF91D; Fri, 21 Aug 2015 15:30:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6901289; Fri, 21 Aug 2015 15:30:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFUpkk034318; Fri, 21 Aug 2015 15:30:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFUp3F034317; Fri, 21 Aug 2015 15:30:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508211530.t7LFUp3F034317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 21 Aug 2015 15:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286998 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:30:51 -0000 Author: bapt Date: Fri Aug 21 15:30:50 2015 New Revision: 286998 URL: https://svnweb.freebsd.org/changeset/base/286998 Log: Mark bsd.info.mk as depreciated Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 15:21:56 2015 (r286997) +++ head/share/mk/bsd.README Fri Aug 21 15:30:50 2015 (r286998) @@ -21,7 +21,7 @@ bsd.dep.mk - handle Makefile dependenci bsd.doc.mk - building troff system documents bsd.files.mk - install of general purpose files bsd.incs.mk - install of include files -bsd.info.mk - building GNU Info hypertext system +bsd.info.mk - building GNU Info hypertext system (depreciated) bsd.init.mk - initialization for the make include files bsd.kmod.mk - building loadable kernel modules bsd.lib.mk - support for building libraries From owner-svn-src-head@freebsd.org Fri Aug 21 15:53:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B30F49BF1E2; Fri, 21 Aug 2015 15:53:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEB3AF0; Fri, 21 Aug 2015 15:53:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFrATY047238; Fri, 21 Aug 2015 15:53:10 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFr9RB047233; Fri, 21 Aug 2015 15:53:09 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201508211553.t7LFr9RB047233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Fri, 21 Aug 2015 15:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286999 - in head/sys: dev/xen/blkfront dev/xen/netfront x86/xen xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:53:10 -0000 Author: royger Date: Fri Aug 21 15:53:08 2015 New Revision: 286999 URL: https://svnweb.freebsd.org/changeset/base/286999 Log: xen: allow disabling PV disks and nics Introduce two new loader tunnables that can be used to disable PV disks and PV nics at boot time. They default to 0 and should be set to 1 (or any number different than 0) in order to disable the PV devices: hw.xen.disable_pv_disks=1 hw.xen.disable_pv_nics=1 In /boot/loader.conf will disable both PV disks and nics. Sponsored by: Citrix Systems R&D Tested by: Karl Pielorz MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/netfront/netfront.c head/sys/x86/xen/hvm.c head/sys/xen/xen-os.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Fri Aug 21 15:30:50 2015 (r286998) +++ head/sys/dev/xen/blkfront/blkfront.c Fri Aug 21 15:53:08 2015 (r286999) @@ -1366,6 +1366,9 @@ xbd_probe(device_t dev) if (strcmp(xenbus_get_type(dev), "vbd") != 0) return (ENXIO); + if (xen_hvm_domain() && xen_disable_pv_disks != 0) + return (ENXIO); + if (xen_hvm_domain()) { int error; char *type; Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Aug 21 15:30:50 2015 (r286998) +++ head/sys/dev/xen/netfront/netfront.c Fri Aug 21 15:53:08 2015 (r286999) @@ -445,6 +445,9 @@ static int netfront_probe(device_t dev) { + if (xen_hvm_domain() && xen_disable_pv_nics != 0) + return (ENXIO); + if (!strcmp(xenbus_get_type(dev), "vif")) { device_set_desc(dev, "Virtual Network Interface"); return (0); Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Fri Aug 21 15:30:50 2015 (r286998) +++ head/sys/x86/xen/hvm.c Fri Aug 21 15:53:08 2015 (r286999) @@ -100,8 +100,15 @@ DPCPU_DEFINE(struct vcpu_info *, vcpu_in shared_info_t *HYPERVISOR_shared_info; start_info_t *HYPERVISOR_start_info; + +/*------------------------------ Sysctl tunables -----------------------------*/ +int xen_disable_pv_disks = 0; +int xen_disable_pv_nics = 0; +TUNABLE_INT("hw.xen.disable_pv_disks", &xen_disable_pv_disks); +TUNABLE_INT("hw.xen.disable_pv_nics", &xen_disable_pv_nics); + #ifdef SMP -/* XEN diverged cpu operations */ +/*---------------------- XEN diverged cpu operations -------------------------*/ static void xen_hvm_cpu_resume(void) { @@ -256,21 +263,34 @@ enum { static void xen_hvm_disable_emulated_devices(void) { + u_short disable_devs = 0; if (xen_pv_domain()) { /* * No emulated devices in the PV case, so no need to unplug * anything. */ + if (xen_disable_pv_disks != 0 || xen_disable_pv_nics != 0) + printf("PV devices cannot be disabled in PV guests\n"); return; } if (inw(XEN_MAGIC_IOPORT) != XMI_MAGIC) return; - if (bootverbose) - printf("XEN: Disabling emulated block and network devices\n"); - outw(XEN_MAGIC_IOPORT, XMI_UNPLUG_IDE_DISKS|XMI_UNPLUG_NICS); + if (xen_disable_pv_disks == 0) { + if (bootverbose) + printf("XEN: disabling emulated disks\n"); + disable_devs |= XMI_UNPLUG_IDE_DISKS; + } + if (xen_disable_pv_nics == 0) { + if (bootverbose) + printf("XEN: disabling emulated nics\n"); + disable_devs |= XMI_UNPLUG_NICS; + } + + if (disable_devs != 0) + outw(XEN_MAGIC_IOPORT, disable_devs); } static void Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Fri Aug 21 15:30:50 2015 (r286998) +++ head/sys/xen/xen-os.h Fri Aug 21 15:53:08 2015 (r286999) @@ -56,6 +56,9 @@ extern start_info_t *HYPERVISOR_start_in /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ extern char *console_page; +extern int xen_disable_pv_disks; +extern int xen_disable_pv_nics; + enum xen_domain_type { XEN_NATIVE, /* running on bare hardware */ XEN_PV_DOMAIN, /* running in a PV domain */ From owner-svn-src-head@freebsd.org Fri Aug 21 15:58:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37C769BF30A; Fri, 21 Aug 2015 15:58:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24883DCD; Fri, 21 Aug 2015 15:58:00 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFw0b3047719; Fri, 21 Aug 2015 15:58:00 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFvvvv047709; Fri, 21 Aug 2015 15:57:57 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201508211557.t7LFvvvv047709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Fri, 21 Aug 2015 15:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287000 - in head/sys: amd64/amd64 arm/arm i386/i386 kern mips/beri 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:58:00 -0000 Author: royger Date: Fri Aug 21 15:57:57 2015 New Revision: 287000 URL: https://svnweb.freebsd.org/changeset/base/287000 Log: preload_search_info: make sure mod is set Add a check to preload_search_info to make sure mod is set. Most of the callers of preload_search_info don't check that the mod parameter is set, which can cause page faults. While at it, remove some now unnecessary checks before calling preload_search_info. Sponsored by: Citrix Systems R&D Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3440 Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/i386/i386/machdep.c head/sys/kern/link_elf.c head/sys/kern/subr_module.c head/sys/mips/beri/beri_machdep.c head/sys/x86/x86/fdt_machdep.c head/sys/x86/x86/nexus.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/amd64/amd64/machdep.c Fri Aug 21 15:57:57 2015 (r287000) @@ -1621,8 +1621,8 @@ hammer_time(u_int64_t modulep, u_int64_t * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) * transition). */ - if (kmdp != NULL && preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) + if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) + != NULL) vty_set_preferred(VTY_VT); identify_cpu(); /* Final stage of CPU initialization */ Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/arm/arm/machdep.c Fri Aug 21 15:57:57 2015 (r287000) @@ -1534,10 +1534,7 @@ initarm(struct arm_boot_params *abp) * Find the dtb passed in by the boot loader. */ kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); - else - dtbp = (vm_offset_t)NULL; + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); #if defined(FDT_DTB_STATIC) /* * In case the device tree blob was not retrieved (from metadata) try Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/i386/i386/machdep.c Fri Aug 21 15:57:57 2015 (r287000) @@ -2097,9 +2097,8 @@ getmemsize(int first) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); - if (kmdp != NULL) - smapbase = (struct bios_smap *)preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_SMAP); + smapbase = (struct bios_smap *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { add_smap_entries(smapbase, physmap, &physmap_idx); has_smap = 1; @@ -2778,8 +2777,6 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); - if (kmdp == NULL) - return (0); smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/kern/link_elf.c Fri Aug 21 15:57:57 2015 (r287000) @@ -400,8 +400,7 @@ link_elf_init(void* arg) modptr = preload_search_by_type("elf" __XSTRING(__ELF_WORD_SIZE) " kernel"); if (modptr == NULL) modptr = preload_search_by_type("elf kernel"); - if (modptr != NULL) - modname = (char *)preload_search_info(modptr, MODINFO_NAME); + modname = (char *)preload_search_info(modptr, MODINFO_NAME); if (modname == NULL) modname = "kernel"; linker_kernel_file = linker_make_file(modname, &link_elf_class); Modified: head/sys/kern/subr_module.c ============================================================================== --- head/sys/kern/subr_module.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/kern/subr_module.c Fri Aug 21 15:57:57 2015 (r287000) @@ -160,6 +160,9 @@ preload_search_info(caddr_t mod, int inf uint32_t type = 0; int next; + if (mod == NULL) + return (NULL); + curp = mod; for (;;) { hdr = (uint32_t *)curp; Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/mips/beri/beri_machdep.c Fri Aug 21 15:57:57 2015 (r287000) @@ -251,10 +251,7 @@ platform_start(__register_t a0, __regist * Find the dtb passed in by the boot loader (currently fictional). */ kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); - else - dtbp = (vm_offset_t)NULL; + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); #if defined(FDT_DTB_STATIC) /* Modified: head/sys/x86/x86/fdt_machdep.c ============================================================================== --- head/sys/x86/x86/fdt_machdep.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/x86/x86/fdt_machdep.c Fri Aug 21 15:57:57 2015 (r287000) @@ -54,7 +54,7 @@ x86_init_fdt(void) mdp = preload_search_by_type("elf kernel"); if (mdp == NULL) mdp = preload_search_by_type("elf32 kernel"); - dtbp = (mdp != NULL) ? MD_FETCH(mdp, MODINFOMD_DTBP, void *) : NULL; + dtbp = MD_FETCH(mdp, MODINFOMD_DTBP, void *); #if defined(FDT_DTB_STATIC) /* Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Fri Aug 21 15:53:08 2015 (r286999) +++ head/sys/x86/x86/nexus.c Fri Aug 21 15:57:57 2015 (r287000) @@ -690,11 +690,8 @@ ram_attach(device_t dev) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type(ELF_KERN_STR); - if (kmdp != NULL) - smapbase = (struct bios_smap *)preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_SMAP); - else - smapbase = NULL; + smapbase = (struct bios_smap *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); From owner-svn-src-head@freebsd.org Fri Aug 21 16:05:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10E39BF625; Fri, 21 Aug 2015 16:05:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1EC21A86; Fri, 21 Aug 2015 16:05:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LG5uI4052930; Fri, 21 Aug 2015 16:05:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LG5u7v052929; Fri, 21 Aug 2015 16:05:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508211605.t7LG5u7v052929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 16:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287001 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 16:05:57 -0000 Author: imp Date: Fri Aug 21 16:05:56 2015 New Revision: 287001 URL: https://svnweb.freebsd.org/changeset/base/287001 Log: Document bsd.arch.inc.mk. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 15:57:57 2015 (r287000) +++ head/share/mk/bsd.README Fri Aug 21 16:05:56 2015 (r287001) @@ -16,6 +16,7 @@ can not/should not be used directly but files. In most cases it is only interesting to include bsd.prog.mk or bsd.lib.mk. +bsd.arch.inc.mk - includes arch-specific Makefile.$arch bsd.cpu.mk - sets CPU/arch-related variables bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents @@ -118,6 +119,13 @@ environment or otherwise. You probably =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +The include file includes other Makefiles for specific +architectures, if they exist. It will include the first of the following +files that it finds: Makefile.${MACHINE}, Makefile.${MACHINE_ARCH}, +Makefile.${MACHINE_CPUARCH} + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + The include file handles installing manual pages and their links. From owner-svn-src-head@freebsd.org Fri Aug 21 16:48:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 649319BFEF1; Fri, 21 Aug 2015 16:48:56 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E24212FD; Fri, 21 Aug 2015 16:48:56 +0000 (UTC) (envelope-from mark@grondar.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ZSpUq-000Luf-N8; Fri, 21 Aug 2015 17:48:52 +0100 Subject: Re: svn commit: r286984 - head/sys/modules/zfs Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <55D6DF3D.6030103@FreeBSD.org> Date: Fri, 21 Aug 2015 17:48:47 +0100 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <479557ED-A997-4E04-9362-D9C0047F45E5@grondar.org> References: <201508210806.t7L86J5t039494@repo.freebsd.org> <7F30B891-8FD7-4FD7-AB53-AAEDB98CED59@grondar.org> <55D6DF3D.6030103@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.2104) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 16:48:56 -0000 > On 21 Aug 2015, at 09:20, Andriy Gapon wrote: >=20 >=20 > Precisely because it's the standalone build (cd sys/modules/zfs && = make > ...) that was affected. Building the module as a part of the kernel > build worked just fine. That makes sense. Now I need a regression test to ensure at this problem is not elsewhere and doesn=E2=80=99t return. Where do folks put these? I don=E2=80=99t mind writing one. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Fri Aug 21 17:00:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19B049BF20A; Fri, 21 Aug 2015 17:00:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E59A61C08; Fri, 21 Aug 2015 17:00:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LH0dnZ077127; Fri, 21 Aug 2015 17:00:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LH0dYM077126; Fri, 21 Aug 2015 17:00:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508211700.t7LH0dYM077126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 21 Aug 2015 17:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287002 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 17:00:40 -0000 Author: alc Date: Fri Aug 21 17:00:39 2015 New Revision: 287002 URL: https://svnweb.freebsd.org/changeset/base/287002 Log: Eliminate pointless assignments to rtvals[] in swap_pager_putpages(). Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Aug 21 16:05:56 2015 (r287001) +++ head/sys/vm/swap_pager.c Fri Aug 21 17:00:39 2015 (r287002) @@ -1404,8 +1404,6 @@ swap_pager_putpages(vm_object_t object, blk + j ); vm_page_dirty(mreq); - rtvals[i+j] = VM_PAGER_OK; - mreq->oflags |= VPO_SWAPINPROG; bp->b_pages[j] = mreq; } @@ -1421,6 +1419,16 @@ swap_pager_putpages(vm_object_t object, PCPU_ADD(cnt.v_swappgsout, bp->b_npages); /* + * We unconditionally set rtvals[] to VM_PAGER_PEND so that we + * can call the async completion routine at the end of a + * synchronous I/O operation. Otherwise, our caller would + * perform duplicate unbusy and wakeup operations on the page + * and object, respectively. + */ + for (j = 0; j < n; j++) + rtvals[i + j] = VM_PAGER_PEND; + + /* * asynchronous * * NOTE: b_blkno is destroyed by the call to swapdev_strategy @@ -1429,10 +1437,6 @@ swap_pager_putpages(vm_object_t object, bp->b_iodone = swp_pager_async_iodone; BUF_KERNPROC(bp); swp_pager_strategy(bp); - - for (j = 0; j < n; ++j) - rtvals[i+j] = VM_PAGER_PEND; - /* restart outter loop */ continue; } @@ -1445,14 +1449,10 @@ swap_pager_putpages(vm_object_t object, swp_pager_strategy(bp); /* - * Wait for the sync I/O to complete, then update rtvals. - * We just set the rtvals[] to VM_PAGER_PEND so we can call - * our async completion routine at the end, thus avoiding a - * double-free. + * Wait for the sync I/O to complete. */ bwait(bp, PVM, "swwrt"); - for (j = 0; j < n; ++j) - rtvals[i+j] = VM_PAGER_PEND; + /* * Now that we are through with the bp, we can call the * normal async completion, which frees everything up. From owner-svn-src-head@freebsd.org Fri Aug 21 17:45:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DFE9BFC10; Fri, 21 Aug 2015 17:45:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57CB9B0A; Fri, 21 Aug 2015 17:45:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LHjJPO099504; Fri, 21 Aug 2015 17:45:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LHjJaT099503; Fri, 21 Aug 2015 17:45:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508211745.t7LHjJaT099503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 21 Aug 2015 17:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287003 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 17:45:19 -0000 Author: ngie Date: Fri Aug 21 17:45:18 2015 New Revision: 287003 URL: https://svnweb.freebsd.org/changeset/base/287003 Log: Fix typos (depreciated -> deprecated) Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 17:00:39 2015 (r287002) +++ head/share/mk/bsd.README Fri Aug 21 17:45:18 2015 (r287003) @@ -22,7 +22,7 @@ bsd.dep.mk - handle Makefile dependenci bsd.doc.mk - building troff system documents bsd.files.mk - install of general purpose files bsd.incs.mk - install of include files -bsd.info.mk - building GNU Info hypertext system (depreciated) +bsd.info.mk - building GNU Info hypertext system (deprecated) bsd.init.mk - initialization for the make include files bsd.kmod.mk - building loadable kernel modules bsd.lib.mk - support for building libraries @@ -37,7 +37,7 @@ bsd.port.post.mk - building ports bsd.port.pre.mk - building ports bsd.port.subdir.mk - targets for building subdirectories for ports bsd.prog.mk - building programs from source files -bsd.progs.mk - build multiple programs from sources (depreciated) +bsd.progs.mk - build multiple programs from sources (deprecated) bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd bsd.subdir.mk - targets for building subdirectories bsd.sys.mk - common settings used for building FreeBSD sources From owner-svn-src-head@freebsd.org Fri Aug 21 17:47:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0DFF9BFC4D; Fri, 21 Aug 2015 17:47:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E29C96; Fri, 21 Aug 2015 17:47:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LHlIKC099712; Fri, 21 Aug 2015 17:47:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LHlIcj099711; Fri, 21 Aug 2015 17:47:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508211747.t7LHlIcj099711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 21 Aug 2015 17:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287004 - head/usr.bin/xargs/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 17:47:18 -0000 Author: ngie Date: Fri Aug 21 17:47:17 2015 New Revision: 287004 URL: https://svnweb.freebsd.org/changeset/base/287004 Log: Disable the -P0 test It's unreliable (sometimes it passes, sometimes it fails) Reported by: Jenkins (many times over the past few weeks) Modified: head/usr.bin/xargs/tests/regress.sh Modified: head/usr.bin/xargs/tests/regress.sh ============================================================================== --- head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:45:18 2015 (r287003) +++ head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:47:17 2015 (r287004) @@ -12,7 +12,7 @@ REGRESSION_TEST(`P1', `xargs -P1 echo <$ REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in') -REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in') +#REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in') REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in') From owner-svn-src-head@freebsd.org Fri Aug 21 17:49:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25B419BFCDB; Fri, 21 Aug 2015 17:49:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC057E80; Fri, 21 Aug 2015 17:49:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pdob1 with SMTP id b1so28945128pdo.2; Fri, 21 Aug 2015 10:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZQSvIFjQjwapM1MKiCc0tyUyUZxDavgx92u+roJlYLE=; b=nVHioNnorofL1YT1k63qtfN6pcxByT/VyhP3+i9oFroG3f88DfSVzpYwOybCfCZtsN bnRsiwoytPuwXs3+lBRLpQZPtT6q3JcLU8gxmUgrmp9EU9bcd6sC5oSgj8mqESnQP0nW QKMA+U6zns8yjI/90+Ks8uy2+e12Uelk7H/6VbnOj8IICid0Gqa7w6Gg3+u8zkTlCuYv I9ciGBkOcYu9vCgZo2Emh10keGn8LJzFulxnQ5J3s13y/Ti1uKYQ3fHwJHGlWv8AQBSu NGb+dxlTKiNXaDe++cszIMQ6Jb8tOzIeACpcffTAFUCp3aYCA7zrauPKDzBf9XO73iFD 1Rzw== X-Received: by 10.70.123.100 with SMTP id lz4mr19260183pdb.161.1440179386426; Fri, 21 Aug 2015 10:49:46 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:71f2:1e32:2820:6aca? ([2601:601:800:126d:71f2:1e32:2820:6aca]) by smtp.gmail.com with ESMTPSA id i7sm8497862pdo.84.2015.08.21.10.49.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Aug 2015 10:49:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287004 - head/usr.bin/xargs/tests From: Garrett Cooper In-Reply-To: <201508211747.t7LHlIcj099711@repo.freebsd.org> Date: Fri, 21 Aug 2015 10:49:44 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Allan Jude Content-Transfer-Encoding: quoted-printable Message-Id: <041327D3-1A37-4780-BB2E-491BD9DD537E@gmail.com> References: <201508211747.t7LHlIcj099711@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 17:49:47 -0000 > On Aug 21, 2015, at 10:47, Garrett Cooper wrote: >=20 > Author: ngie > Date: Fri Aug 21 17:47:17 2015 > New Revision: 287004 > URL: https://svnweb.freebsd.org/changeset/base/287004 >=20 > Log: > Disable the -P0 test >=20 > It's unreliable (sometimes it passes, sometimes it fails) >=20 > Reported by: Jenkins (many times over the past few weeks) I=E2=80=99ll work on fixing this by converting these tests over to ATF. = I just wanted to stop the Jenkins failure<->pass emails from spamming = current@ Thanks, -NGie= From owner-svn-src-head@freebsd.org Fri Aug 21 18:42:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26CE99BF656; Fri, 21 Aug 2015 18:42:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17B1989E; Fri, 21 Aug 2015 18:42:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LIgwi1026749; Fri, 21 Aug 2015 18:42:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LIgwam026747; Fri, 21 Aug 2015 18:42:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508211842.t7LIgwam026747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 21 Aug 2015 18:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287005 - head/usr.bin/xargs/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 18:42:59 -0000 Author: ngie Date: Fri Aug 21 18:42:57 2015 New Revision: 287005 URL: https://svnweb.freebsd.org/changeset/base/287005 Log: Fix the racy xargs -P0 -n2 test added in r286289 Sort the output obtained from xargs and the expected output to ensure the end result versus the input file is stable Differential Revision: D3432 Submitted by: Nikolai Lifanov Modified: head/usr.bin/xargs/tests/regress.n2P0.out head/usr.bin/xargs/tests/regress.sh Modified: head/usr.bin/xargs/tests/regress.n2P0.out ============================================================================== --- head/usr.bin/xargs/tests/regress.n2P0.out Fri Aug 21 17:47:17 2015 (r287004) +++ head/usr.bin/xargs/tests/regress.n2P0.out Fri Aug 21 18:42:57 2015 (r287005) @@ -1,4 +1,4 @@ -quick brown fox jumped -over the lazy dog +over the +quick brown Modified: head/usr.bin/xargs/tests/regress.sh ============================================================================== --- head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:47:17 2015 (r287004) +++ head/usr.bin/xargs/tests/regress.sh Fri Aug 21 18:42:57 2015 (r287005) @@ -12,7 +12,7 @@ REGRESSION_TEST(`P1', `xargs -P1 echo <$ REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in') -#REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in') +REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in | sort') REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in') REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in') From owner-svn-src-head@freebsd.org Fri Aug 21 19:51:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E4009BF0C5; Fri, 21 Aug 2015 19:51:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6EB63C; Fri, 21 Aug 2015 19:51:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LJpK7A056436; Fri, 21 Aug 2015 19:51:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LJpKwo056435; Fri, 21 Aug 2015 19:51:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508211951.t7LJpKwo056435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 19:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287006 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 19:51:20 -0000 Author: imp Date: Fri Aug 21 19:51:19 2015 New Revision: 287006 URL: https://svnweb.freebsd.org/changeset/base/287006 Log: Document CFLAGS_NO_SIMD. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 18:42:57 2015 (r287005) +++ head/share/mk/bsd.README Fri Aug 21 19:51:19 2015 (r287006) @@ -17,7 +17,7 @@ files. In most cases it is only interes bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch -bsd.cpu.mk - sets CPU/arch-related variables +bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents bsd.files.mk - install of general purpose files @@ -114,6 +114,14 @@ object. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +The following variables are common: + +CFLAGS_NO_SIMD Add this to CFLAGS for programs that don't want any SIMD + instructions generated. It is setup in bsd.cpu.mk to an + appropriate value for the compiler and target. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + The include file has the default rules for all makes, in the BSD environment or otherwise. You probably don't want to touch this file. From owner-svn-src-head@freebsd.org Fri Aug 21 19:51:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F449BF0EA; Fri, 21 Aug 2015 19:51:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 978177F7; Fri, 21 Aug 2015 19:51:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LJpSJk056982; Fri, 21 Aug 2015 19:51:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LJpSUg056981; Fri, 21 Aug 2015 19:51:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508211951.t7LJpSUg056981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 19:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287007 - 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.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 19:51:28 -0000 Author: imp Date: Fri Aug 21 19:51:27 2015 New Revision: 287007 URL: https://svnweb.freebsd.org/changeset/base/287007 Log: Document bsd.compiler.mk and the variables it defines. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Aug 21 19:51:19 2015 (r287006) +++ head/share/mk/bsd.README Fri Aug 21 19:51:27 2015 (r287007) @@ -17,6 +17,7 @@ files. In most cases it is only interes bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch +bsd.compiler.mk - defined based on current compiler bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents @@ -116,9 +117,29 @@ object. The following variables are common: +CFLAGS.${COMPILER_TYPE} + Flags dependent on compiler added to CXXFLAGS. +CFLAGS.${MACHINE_ARCH} + Architectural flags added to CFLAGS. CFLAGS_NO_SIMD Add this to CFLAGS for programs that don't want any SIMD instructions generated. It is setup in bsd.cpu.mk to an appropriate value for the compiler and target. +CXXFLAGS.${COMPILER_TYPE} + Flags dependent on compiler added to CXXFLAGS. +CXXFLAGS.${MACHINE_ARCH} + Architectural flags added to CXXFLAGS. +COMPILER_FEATURES + A list of features that the compiler supports. Zero or + more of: + c++11 Supports full C++ 11 standard. + +COMPILER_TYPE Type of compiler, either clang or gcc, though other + values are possible. Don't assume != clang == gcc. + +COMPILER_VERSION + A numeric constant equal to: + major * 10000 + minor * 100 + tiny + for the compiler's self-reported version. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= From owner-svn-src-head@freebsd.org Fri Aug 21 20:33:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B94FB9BF819; Fri, 21 Aug 2015 20:33:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C36C1962; Fri, 21 Aug 2015 20:33:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::f4fe:ee21:cbbc:7ab3] (unknown [IPv6:2001:7b8:3a7:0:f4fe:ee21:cbbc:7ab3]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B7C51200AF; Fri, 21 Aug 2015 22:32:58 +0200 (CEST) Subject: Re: svn commit: r287007 - head/share/mk Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A515F2F6-5B11-4D78-9F87-B00AC071A2C1"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5.1 From: Dimitry Andric In-Reply-To: <201508211951.t7LJpSUg056981@repo.freebsd.org> Date: Fri, 21 Aug 2015 22:32:50 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <513C7020-04F6-4576-A65D-140135A05A1C@FreeBSD.org> References: <201508211951.t7LJpSUg056981@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 20:33:02 -0000 --Apple-Mail=_A515F2F6-5B11-4D78-9F87-B00AC071A2C1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 21 Aug 2015, at 21:51, Warner Losh wrote: > > Author: imp > Date: Fri Aug 21 19:51:27 2015 > New Revision: 287007 > URL: https://svnweb.freebsd.org/changeset/base/287007 > > Log: > Document bsd.compiler.mk and the variables it defines. Thanks!! --Apple-Mail=_A515F2F6-5B11-4D78-9F87-B00AC071A2C1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlXXivoACgkQsF6jCi4glqPIgwCg+xLbPBUCcgF6hh1bd8ZkoZ3X rOYAoNakxKPeMjC9mAK65WiOPR7OGzcp =MMpW -----END PGP SIGNATURE----- --Apple-Mail=_A515F2F6-5B11-4D78-9F87-B00AC071A2C1-- From owner-svn-src-head@freebsd.org Fri Aug 21 21:47:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E35749C05F4; Fri, 21 Aug 2015 21:47:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49F62A9; Fri, 21 Aug 2015 21:47:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LLlTBu006834; Fri, 21 Aug 2015 21:47:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LLlTxb006833; Fri, 21 Aug 2015 21:47:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508212147.t7LLlTxb006833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Aug 2015 21:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287008 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 21:47:30 -0000 Author: imp Date: Fri Aug 21 21:47:29 2015 New Revision: 287008 URL: https://svnweb.freebsd.org/changeset/base/287008 Log: We're waiting on a struct proc *, not a struct thread *. Fix a comment that was wrong. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Fri Aug 21 19:51:27 2015 (r287007) +++ head/sys/dev/pccbb/pccbb.c Fri Aug 21 21:47:29 2015 (r287008) @@ -330,7 +330,7 @@ cbb_detach(device_t brdev) /* * Wait for the thread to die. kproc_exit will do a wakeup - * on the event thread's struct thread * so that we know it is + * on the event thread's struct proc * so that we know it is * safe to proceed. IF the thread is running, set the please * die flag and wait for it to comply. Since the wakeup on * the event thread happens only in kproc_exit, we don't From owner-svn-src-head@freebsd.org Fri Aug 21 22:02:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2CC9C08C0; Fri, 21 Aug 2015 22:02:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B34DE23; Fri, 21 Aug 2015 22:02:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LM2Qch015538; Fri, 21 Aug 2015 22:02:26 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LM2MhF015522; Fri, 21 Aug 2015 22:02:22 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508212202.t7LM2MhF015522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 21 Aug 2015 22:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287009 - in head: sbin/pfctl share/man/man4 sys/conf sys/net/altq sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 22:02:26 -0000 Author: loos Date: Fri Aug 21 22:02:22 2015 New Revision: 287009 URL: https://svnweb.freebsd.org/changeset/base/287009 Log: Add ALTQ(9) support for the CoDel algorithm. CoDel is a parameterless queue discipline that handles variable bandwidth and RTT. It can be used as the single queue discipline on an interface or as a sub discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, FAIRQ. Differential Revision: https://reviews.freebsd.org/D3272 Reviewd by: rpaulo, gnn (previous version) Obtained from: pfSense Sponsored by: Rubicon Communications (Netgate) Added: head/sys/net/altq/altq_codel.c (contents, props changed) head/sys/net/altq/altq_codel.h (contents, props changed) Modified: head/sbin/pfctl/parse.y head/sbin/pfctl/pfctl_altq.c head/sbin/pfctl/pfctl_parser.h head/sbin/pfctl/pfctl_qstats.c head/share/man/man4/altq.4 head/sys/conf/files head/sys/conf/options head/sys/net/altq/altq.h head/sys/net/altq/altq_cbq.c head/sys/net/altq/altq_cbq.h head/sys/net/altq/altq_classq.h head/sys/net/altq/altq_fairq.c head/sys/net/altq/altq_fairq.h head/sys/net/altq/altq_hfsc.c head/sys/net/altq/altq_hfsc.h head/sys/net/altq/altq_priq.c head/sys/net/altq/altq_priq.h head/sys/net/altq/altq_rmclass.c head/sys/net/altq/altq_rmclass.h head/sys/net/altq/altq_subr.c head/sys/net/altq/altq_var.h head/sys/netpfil/pf/pf_altq.h Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Fri Aug 21 21:47:29 2015 (r287008) +++ head/sbin/pfctl/parse.y Fri Aug 21 22:02:22 2015 (r287009) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -299,7 +300,7 @@ struct pool_opts { } pool_opts; - +struct codel_opts codel_opts; struct node_hfsc_opts hfsc_opts; struct node_fairq_opts fairq_opts; struct node_state_opt *keep_state_defaults = NULL; @@ -425,6 +426,7 @@ typedef struct { struct pool_opts pool_opts; struct node_hfsc_opts hfsc_opts; struct node_fairq_opts fairq_opts; + struct codel_opts codel_opts; } v; int lineno; } YYSTYPE; @@ -449,8 +451,8 @@ int parseport(char *, struct range *r, i %token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID %token ANTISPOOF FOR INCLUDE %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY -%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT -%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE +%token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME +%token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL %token LOAD RULESET_OPTIMIZATION %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY @@ -499,6 +501,7 @@ int parseport(char *, struct range *r, i %type priqflags_list priqflags_item %type hfscopts_list hfscopts_item hfsc_opts %type fairqopts_list fairqopts_item fairq_opts +%type codelopts_list codelopts_item codel_opts %type bandwidth %type filter_opts filter_opt filter_opts_l %type antispoof_opts antispoof_opt antispoof_opts_l @@ -1470,7 +1473,7 @@ altqif : ALTQ interface queue_opts QUEU a.scheduler = $3.scheduler.qtype; a.qlimit = $3.qlimit; a.tbrsize = $3.tbrsize; - if ($5 == NULL) { + if ($5 == NULL && $3.scheduler.qtype != ALTQT_CODEL) { yyerror("no child queues specified"); YYERROR; } @@ -1672,6 +1675,15 @@ scheduler : CBQ { $$.qtype = ALTQT_FAIRQ; $$.data.fairq_opts = $3; } + | CODEL { + $$.qtype = ALTQT_CODEL; + bzero(&$$.data.codel_opts, + sizeof(struct codel_opts)); + } + | CODEL '(' codel_opts ')' { + $$.qtype = ALTQT_CODEL; + $$.data.codel_opts = $3; + } ; cbqflags_list : cbqflags_item { $$ |= $1; } @@ -1689,6 +1701,8 @@ cbqflags_item : STRING { $$ = CBQCLF_RED|CBQCLF_ECN; else if (!strcmp($1, "rio")) $$ = CBQCLF_RIO; + else if (!strcmp($1, "codel")) + $$ = CBQCLF_CODEL; else { yyerror("unknown cbq flag \"%s\"", $1); free($1); @@ -1711,6 +1725,8 @@ priqflags_item : STRING { $$ = PRCF_RED|PRCF_ECN; else if (!strcmp($1, "rio")) $$ = PRCF_RIO; + else if (!strcmp($1, "codel")) + $$ = PRCF_CODEL; else { yyerror("unknown priq flag \"%s\"", $1); free($1); @@ -1811,6 +1827,8 @@ hfscopts_item : LINKSHARE bandwidth { hfsc_opts.flags |= HFCF_RED|HFCF_ECN; else if (!strcmp($1, "rio")) hfsc_opts.flags |= HFCF_RIO; + else if (!strcmp($1, "codel")) + hfsc_opts.flags |= HFCF_CODEL; else { yyerror("unknown hfsc flag \"%s\"", $1); free($1); @@ -1866,6 +1884,8 @@ fairqopts_item : LINKSHARE bandwidth fairq_opts.flags |= FARF_RED|FARF_ECN; else if (!strcmp($1, "rio")) fairq_opts.flags |= FARF_RIO; + else if (!strcmp($1, "codel")) + fairq_opts.flags |= FARF_CODEL; else { yyerror("unknown fairq flag \"%s\"", $1); free($1); @@ -1875,6 +1895,45 @@ fairqopts_item : LINKSHARE bandwidth } ; +codel_opts : { + bzero(&codel_opts, + sizeof(struct codel_opts)); + } + codelopts_list { + $$ = codel_opts; + } + ; + +codelopts_list : codelopts_item + | codelopts_list comma codelopts_item + ; + +codelopts_item : INTERVAL number { + if (codel_opts.interval) { + yyerror("interval already specified"); + YYERROR; + } + codel_opts.interval = $2; + } + | TARGET number { + if (codel_opts.target) { + yyerror("target already specified"); + YYERROR; + } + codel_opts.target = $2; + } + | STRING { + if (!strcmp($1, "ecn")) + codel_opts.ecn = 1; + else { + yyerror("unknown codel option \"%s\"", $1); + free($1); + YYERROR; + } + free($1); + } + ; + qassign : /* empty */ { $$ = NULL; } | qassign_item { $$ = $1; } | '{' optnl qassign_list '}' { $$ = $3; } @@ -4800,7 +4859,8 @@ expand_altq(struct pf_altq *a, struct no if ((pf->loadopt & PFCTL_FLAG_ALTQ) == 0) { FREE_LIST(struct node_if, interfaces); - FREE_LIST(struct node_queue, nqueues); + if (nqueues) + FREE_LIST(struct node_queue, nqueues); return (0); } @@ -4891,7 +4951,8 @@ expand_altq(struct pf_altq *a, struct no } ); FREE_LIST(struct node_if, interfaces); - FREE_LIST(struct node_queue, nqueues); + if (nqueues) + FREE_LIST(struct node_queue, nqueues); return (errs); } @@ -5297,6 +5358,7 @@ lookup(char *s) { "buckets", BUCKETS}, { "cbq", CBQ}, { "code", CODE}, + { "codelq", CODEL}, { "crop", FRAGCROP}, { "debug", DEBUG}, { "divert-reply", DIVERTREPLY}, @@ -5326,6 +5388,7 @@ lookup(char *s) { "include", INCLUDE}, { "inet", INET}, { "inet6", INET6}, + { "interval", INTERVAL}, { "keep", KEEP}, { "label", LABEL}, { "limit", LIMIT}, @@ -5395,6 +5458,7 @@ lookup(char *s) { "table", TABLE}, { "tag", TAG}, { "tagged", TAGGED}, + { "target", TARGET}, { "tbrsize", TBRSIZE}, { "timeout", TIMEOUT}, { "to", TO}, Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Fri Aug 21 21:47:29 2015 (r287008) +++ head/sbin/pfctl/pfctl_altq.c Fri Aug 21 22:02:22 2015 (r287009) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +61,9 @@ static int cbq_compute_idletime(struct p static int check_commit_cbq(int, int, struct pf_altq *); static int print_cbq_opts(const struct pf_altq *); +static int print_codel_opts(const struct pf_altq *, + const struct node_queue_opt *); + static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *); static int check_commit_priq(int, int, struct pf_altq *); static int print_priq_opts(const struct pf_altq *); @@ -185,6 +189,10 @@ print_altq(const struct pf_altq *a, unsi if (!print_fairq_opts(a, qopts)) printf("fairq "); break; + case ALTQT_CODEL: + if (!print_codel_opts(a, qopts)) + printf("codel "); + break; } if (bw != NULL && bw->bw_percent > 0) { @@ -591,6 +599,8 @@ print_cbq_opts(const struct pf_altq *a) printf(" ecn"); if (opts->flags & CBQCLF_RIO) printf(" rio"); + if (opts->flags & CBQCLF_CODEL) + printf(" codel"); if (opts->flags & CBQCLF_CLEARDSCP) printf(" cleardscp"); if (opts->flags & CBQCLF_FLOWVALVE) @@ -678,6 +688,8 @@ print_priq_opts(const struct pf_altq *a) printf(" ecn"); if (opts->flags & PRCF_RIO) printf(" rio"); + if (opts->flags & PRCF_CODEL) + printf(" codel"); if (opts->flags & PRCF_CLEARDSCP) printf(" cleardscp"); if (opts->flags & PRCF_DEFAULTCLASS) @@ -1010,6 +1022,8 @@ print_hfsc_opts(const struct pf_altq *a, printf(" ecn"); if (opts->flags & HFCF_RIO) printf(" rio"); + if (opts->flags & HFCF_CODEL) + printf(" codel"); if (opts->flags & HFCF_CLEARDSCP) printf(" cleardscp"); if (opts->flags & HFCF_DEFAULTCLASS) @@ -1032,6 +1046,28 @@ print_hfsc_opts(const struct pf_altq *a, } static int +print_codel_opts(const struct pf_altq *a, const struct node_queue_opt *qopts) +{ + const struct codel_opts *opts; + + opts = &a->pq_u.codel_opts; + if (opts->target || opts->interval || opts->ecn) { + printf("codel("); + if (opts->target) + printf(" target %d", opts->target); + if (opts->interval) + printf(" interval %d", opts->interval); + if (opts->ecn) + printf("ecn"); + printf(" ) "); + + return (1); + } + + return (0); +} + +static int print_fairq_opts(const struct pf_altq *a, const struct node_queue_opt *qopts) { const struct fairq_opts *opts; @@ -1053,6 +1089,8 @@ print_fairq_opts(const struct pf_altq *a printf(" ecn"); if (opts->flags & FARF_RIO) printf(" rio"); + if (opts->flags & FARF_CODEL) + printf(" codel"); if (opts->flags & FARF_CLEARDSCP) printf(" cleardscp"); if (opts->flags & FARF_DEFAULTCLASS) @@ -1404,6 +1442,11 @@ eval_queue_opts(struct pf_altq *pa, stru opts->data.fairq_opts.linkshare.d; } break; + case ALTQT_CODEL: + pa->pq_u.codel_opts.target = opts->data.codel_opts.target; + pa->pq_u.codel_opts.interval = opts->data.codel_opts.interval; + pa->pq_u.codel_opts.ecn = opts->data.codel_opts.ecn; + break; default: warnx("eval_queue_opts: unknown scheduler type %u", opts->qtype); Modified: head/sbin/pfctl/pfctl_parser.h ============================================================================== --- head/sbin/pfctl/pfctl_parser.h Fri Aug 21 21:47:29 2015 (r287008) +++ head/sbin/pfctl/pfctl_parser.h Fri Aug 21 22:02:22 2015 (r287009) @@ -168,6 +168,7 @@ struct node_queue_opt { int qtype; union { struct cbq_opts cbq_opts; + struct codel_opts codel_opts; struct priq_opts priq_opts; struct node_hfsc_opts hfsc_opts; struct node_fairq_opts fairq_opts; Modified: head/sbin/pfctl/pfctl_qstats.c ============================================================================== --- head/sbin/pfctl/pfctl_qstats.c Fri Aug 21 21:47:29 2015 (r287008) +++ head/sbin/pfctl/pfctl_qstats.c Fri Aug 21 22:02:22 2015 (r287009) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -48,6 +49,7 @@ union class_stats { struct priq_classstats priq_stats; struct hfsc_classstats hfsc_stats; struct fairq_classstats fairq_stats; + struct codel_ifstats codel_stats; }; #define AVGN_MAX 8 @@ -77,6 +79,7 @@ struct pf_altq_node *pfctl_find_altq_nod void pfctl_print_altq_node(int, const struct pf_altq_node *, unsigned, int); void print_cbqstats(struct queue_stats); +void print_codelstats(struct queue_stats); void print_priqstats(struct queue_stats); void print_hfscstats(struct queue_stats); void print_fairqstats(struct queue_stats); @@ -165,7 +168,7 @@ pfctl_update_qstats(int dev, struct pf_a return (-1); } #ifdef __FreeBSD__ - if (pa.altq.qid > 0 && + if ((pa.altq.qid > 0 || pa.altq.scheduler == ALTQT_CODEL) && !(pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED)) { #else if (pa.altq.qid > 0) { @@ -303,7 +306,7 @@ pfctl_print_altq_node(int dev, const str void pfctl_print_altq_nodestat(int dev, const struct pf_altq_node *a) { - if (a->altq.qid == 0) + if (a->altq.qid == 0 && a->altq.scheduler != ALTQT_CODEL) return; #ifdef __FreeBSD__ @@ -323,6 +326,9 @@ pfctl_print_altq_nodestat(int dev, const case ALTQT_FAIRQ: print_fairqstats(a->qstats); break; + case ALTQT_CODEL: + print_codelstats(a->qstats); + break; } } @@ -348,6 +354,28 @@ print_cbqstats(struct queue_stats cur) } void +print_codelstats(struct queue_stats cur) +{ + printf(" [ pkts: %10llu bytes: %10llu " + "dropped pkts: %6llu bytes: %6llu ]\n", + (unsigned long long)cur.data.codel_stats.cl_xmitcnt.packets, + (unsigned long long)cur.data.codel_stats.cl_xmitcnt.bytes, + (unsigned long long)cur.data.codel_stats.cl_dropcnt.packets + + cur.data.codel_stats.stats.drop_cnt.packets, + (unsigned long long)cur.data.codel_stats.cl_dropcnt.bytes + + cur.data.codel_stats.stats.drop_cnt.bytes); + printf(" [ qlength: %3d/%3d ]\n", + cur.data.codel_stats.qlength, cur.data.codel_stats.qlimit); + + if (cur.avgn < 2) + return; + + printf(" [ measured: %7.1f packets/s, %s/s ]\n", + cur.avg_packets / STAT_INTERVAL, + rate2str((8 * cur.avg_bytes) / STAT_INTERVAL)); +} + +void print_priqstats(struct queue_stats cur) { printf(" [ pkts: %10llu bytes: %10llu " @@ -428,7 +456,7 @@ update_avg(struct pf_altq_node *a) u_int64_t b, p; int n; - if (a->altq.qid == 0) + if (a->altq.qid == 0 && a->altq.scheduler != ALTQT_CODEL) return; qs = &a->qstats; @@ -451,6 +479,10 @@ update_avg(struct pf_altq_node *a) b = qs->data.fairq_stats.xmit_cnt.bytes; p = qs->data.fairq_stats.xmit_cnt.packets; break; + case ALTQT_CODEL: + b = qs->data.codel_stats.cl_xmitcnt.bytes; + p = qs->data.codel_stats.cl_xmitcnt.packets; + break; default: b = 0; p = 0; Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Fri Aug 21 21:47:29 2015 (r287008) +++ head/share/man/man4/altq.4 Fri Aug 21 22:02:22 2015 (r287009) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2015 +.Dd July 24, 2015 .Dt ALTQ 4 .Os .Sh NAME @@ -35,6 +35,7 @@ .Cd options ALTQ .Pp .Cd options ALTQ_CBQ +.Cd options ALTQ_CODEL .Cd options ALTQ_RED .Cd options ALTQ_RIO .Cd options ALTQ_HFSC @@ -74,6 +75,10 @@ Enable Build the .Dq "Class Based Queuing" discipline. +.It Dv ALTQ_CODEL +Build the +.Dq "Controlled Delay" +discipline. .It Dv ALTQ_RED Build the .Dq "Random Early Detection" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/conf/files Fri Aug 21 22:02:22 2015 (r287009) @@ -3429,6 +3429,7 @@ libkern/zlib.c optional crypto | geom_ ddb_ctf | gzio | geom_uncompress net/altq/altq_cbq.c optional altq net/altq/altq_cdnr.c optional altq +net/altq/altq_codel.c optional altq net/altq/altq_hfsc.c optional altq net/altq/altq_fairq.c optional altq net/altq/altq_priq.c optional altq Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/conf/options Fri Aug 21 22:02:22 2015 (r287009) @@ -388,6 +388,7 @@ ACCEPT_FILTER_HTTP ALTQ opt_global.h ALTQ_CBQ opt_altq.h ALTQ_CDNR opt_altq.h +ALTQ_CODEL opt_altq.h ALTQ_DEBUG opt_altq.h ALTQ_HFSC opt_altq.h ALTQ_FAIRQ opt_altq.h Modified: head/sys/net/altq/altq.h ============================================================================== --- head/sys/net/altq/altq.h Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/net/altq/altq.h Fri Aug 21 22:02:22 2015 (r287009) @@ -64,7 +64,8 @@ #define ALTQT_PRIQ 11 /* priority queue */ #define ALTQT_JOBS 12 /* JoBS */ #define ALTQT_FAIRQ 13 /* fairq */ -#define ALTQT_MAX 14 /* should be max discipline type + 1 */ +#define ALTQT_CODEL 14 /* CoDel */ +#define ALTQT_MAX 15 /* should be max discipline type + 1 */ #ifdef ALTQ3_COMPAT struct altqreq { Modified: head/sys/net/altq/altq_cbq.c ============================================================================== --- head/sys/net/altq/altq_cbq.c Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/net/altq/altq_cbq.c Fri Aug 21 22:02:22 2015 (r287009) @@ -237,6 +237,10 @@ get_class_stats(class_stats_t *statsp, s if (q_is_rio(cl->q_)) rio_getstats((rio_t *)cl->red_, &statsp->red[0]); #endif +#ifdef ALTQ_CODEL + if (q_is_codel(cl->q_)) + codel_getstats(cl->codel_, &statsp->codel); +#endif } int Modified: head/sys/net/altq/altq_cbq.h ============================================================================== --- head/sys/net/altq/altq_cbq.h Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/net/altq/altq_cbq.h Fri Aug 21 22:02:22 2015 (r287009) @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -52,6 +53,7 @@ extern "C" { #define CBQCLF_FLOWVALVE 0x0008 /* use flowvalve (aka penalty-box) */ #define CBQCLF_CLEARDSCP 0x0010 /* clear diffserv codepoint */ #define CBQCLF_BORROW 0x0020 /* borrow from parent */ +#define CBQCLF_CODEL 0x0040 /* use CoDel */ /* class flags only for root class */ #define CBQCLF_WRR 0x0100 /* weighted-round robin */ @@ -91,9 +93,10 @@ typedef struct _cbq_class_stats_ { int qcnt; /* # packets in queue */ int avgidle; - /* red and rio related info */ + /* codel, red and rio related info */ int qtype; struct redstats red[3]; + struct codel_stats codel; } class_stats_t; #ifdef ALTQ3_COMPAT Modified: head/sys/net/altq/altq_classq.h ============================================================================== --- head/sys/net/altq/altq_classq.h Fri Aug 21 21:47:29 2015 (r287008) +++ head/sys/net/altq/altq_classq.h Fri Aug 21 22:02:22 2015 (r287009) @@ -50,6 +50,7 @@ extern "C" { #define Q_RED 0x01 #define Q_RIO 0x02 #define Q_DROPTAIL 0x03 +#define Q_CODEL 0x04 #ifdef _KERNEL @@ -60,6 +61,7 @@ struct _class_queue_ { struct mbuf *tail_; /* Tail of packet queue */ int qlen_; /* Queue length (in number of packets) */ int qlim_; /* Queue limit (in number of packets*) */ + int qsize_; /* Queue size (in number of bytes*) */ int qtype_; /* Queue type */ }; @@ -68,10 +70,12 @@ typedef struct _class_queue_ class_queue #define qtype(q) (q)->qtype_ /* Get queue type */ #define qlimit(q) (q)->qlim_ /* Max packets to be queued */ #define qlen(q) (q)->qlen_ /* Current queue length. */ +#define qsize(q) (q)->qsize_ /* Current queue size. */ #define qtail(q) (q)->tail_ /* Tail of the queue */ #define qhead(q) ((q)->tail_ ? (q)->tail_->m_nextpkt : NULL) #define qempty(q) ((q)->qlen_ == 0) /* Is the queue empty?? */ +#define q_is_codel(q) ((q)->qtype_ == Q_CODEL) /* Is the queue a codel queue */ #define q_is_red(q) ((q)->qtype_ == Q_RED) /* Is the queue a red queue */ #define q_is_rio(q) ((q)->qtype_ == Q_RIO) /* Is the queue a rio queue */ #define q_is_red_or_rio(q) ((q)->qtype_ == Q_RED || (q)->qtype_ == Q_RIO) @@ -101,6 +105,7 @@ _addq(class_queue_t *q, struct mbuf *m) m0->m_nextpkt = m; qtail(q) = m; qlen(q)++; + qsize(q) += m_pktlen(m); } static __inline struct mbuf * @@ -115,6 +120,7 @@ _getq(class_queue_t *q) else qtail(q) = NULL; qlen(q)--; + qsize(q) -= m_pktlen(m0); m0->m_nextpkt = NULL; return (m0); } Added: head/sys/net/altq/altq_codel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/altq/altq_codel.c Fri Aug 21 22:02:22 2015 (r287009) @@ -0,0 +1,477 @@ +/* + * CoDel - The Controlled-Delay Active Queue Management algorithm + * + * Copyright (C) 2013 Ermal Luci + * Copyright (C) 2011-2012 Kathleen Nichols + * Copyright (C) 2011-2012 Van Jacobson + * Copyright (C) 2012 Michael D. Taht + * Copyright (C) 2012 Eric Dumazet + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 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. The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * Alternatively, provided that this notice is retained in full, this + * software may be distributed under the terms of the GNU General + * Public License ("GPL") version 2, in which case the provisions of the + * GPL apply INSTEAD OF those given above. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER 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$ + */ +#include "opt_altq.h" +#include "opt_inet.h" +#include "opt_inet6.h" + +#ifdef ALTQ_CODEL /* CoDel is enabled by ALTQ_CODEL option in opt_altq.h */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +static int codel_should_drop(struct codel *, class_queue_t *, + struct mbuf *, u_int64_t); +static void codel_Newton_step(struct codel_vars *); +static u_int64_t codel_control_law(u_int64_t t, u_int64_t, u_int32_t); + +#define codel_time_after(a, b) ((int64_t)(a) - (int64_t)(b) > 0) +#define codel_time_after_eq(a, b) ((int64_t)(a) - (int64_t)(b) >= 0) +#define codel_time_before(a, b) ((int64_t)(a) - (int64_t)(b) < 0) +#define codel_time_before_eq(a, b) ((int64_t)(a) - (int64_t)(b) <= 0) + +static int codel_request(struct ifaltq *, int, void *); + +static int codel_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); +static struct mbuf *codel_dequeue(struct ifaltq *, int); + +int +codel_pfattach(struct pf_altq *a) +{ + struct ifnet *ifp; + + if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) + return (EINVAL); + + return (altq_attach(&ifp->if_snd, ALTQT_CODEL, a->altq_disc, + codel_enqueue, codel_dequeue, codel_request, NULL, NULL)); +} + +int +codel_add_altq(struct pf_altq *a) +{ + struct codel_if *cif; + struct ifnet *ifp; + struct codel_opts *opts; + + if ((ifp = ifunit(a->ifname)) == NULL) + return (EINVAL); + if (!ALTQ_IS_READY(&ifp->if_snd)) + return (ENODEV); + + opts = &a->pq_u.codel_opts; + + cif = malloc(sizeof(struct codel_if), M_DEVBUF, M_NOWAIT | M_ZERO); + if (cif == NULL) + return (ENOMEM); + cif->cif_bandwidth = a->ifbandwidth; + cif->cif_ifq = &ifp->if_snd; + + cif->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO); + if (cif->cl_q == NULL) { + free(cif, M_DEVBUF); + return (ENOMEM); + } + + if (a->qlimit == 0) + a->qlimit = 50; /* use default. */ + qlimit(cif->cl_q) = a->qlimit; + qtype(cif->cl_q) = Q_CODEL; + qlen(cif->cl_q) = 0; + qsize(cif->cl_q) = 0; + + if (opts->target == 0) + opts->target = 5; + if (opts->interval == 0) + opts->interval = 100; + cif->codel.params.target = machclk_freq * opts->target / 1000; + cif->codel.params.interval = machclk_freq * opts->interval / 1000; + cif->codel.params.ecn = opts->ecn; + cif->codel.stats.maxpacket = 256; + + cif->cl_stats.qlength = qlen(cif->cl_q); + cif->cl_stats.qlimit = qlimit(cif->cl_q); + + /* keep the state in pf_altq */ + a->altq_disc = cif; + + return (0); +} + +int +codel_remove_altq(struct pf_altq *a) +{ + struct codel_if *cif; + + if ((cif = a->altq_disc) == NULL) + return (EINVAL); + a->altq_disc = NULL; + + if (cif->cl_q) + free(cif->cl_q, M_DEVBUF); + free(cif, M_DEVBUF); + + return (0); +} + +int +codel_getqstats(struct pf_altq *a, void *ubuf, int *nbytes) +{ + struct codel_if *cif; + struct codel_ifstats stats; + int error = 0; + + if ((cif = altq_lookup(a->ifname, ALTQT_CODEL)) == NULL) + return (EBADF); + + if (*nbytes < sizeof(stats)) + return (EINVAL); + + stats = cif->cl_stats; + stats.stats = cif->codel.stats; + + if ((error = copyout((caddr_t)&stats, ubuf, sizeof(stats))) != 0) + return (error); + *nbytes = sizeof(stats); + + return (0); +} + +static int +codel_request(struct ifaltq *ifq, int req, void *arg) +{ + struct codel_if *cif = (struct codel_if *)ifq->altq_disc; + struct mbuf *m; + + IFQ_LOCK_ASSERT(ifq); + + switch (req) { + case ALTRQ_PURGE: + if (!ALTQ_IS_ENABLED(cif->cif_ifq)) + break; + + if (qempty(cif->cl_q)) + break; + + while ((m = _getq(cif->cl_q)) != NULL) { + PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt, m_pktlen(m)); + m_freem(m); + IFQ_DEC_LEN(cif->cif_ifq); + } + cif->cif_ifq->ifq_len = 0; + break; + } + + return (0); +} + +static int +codel_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) +{ + + struct codel_if *cif = (struct codel_if *) ifq->altq_disc; + + IFQ_LOCK_ASSERT(ifq); + + /* grab class set by classifier */ + if ((m->m_flags & M_PKTHDR) == 0) { + /* should not happen */ + printf("altq: packet for %s does not have pkthdr\n", + ifq->altq_ifp->if_xname); + m_freem(m); + PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt, m_pktlen(m)); + return (ENOBUFS); + } + + if (codel_addq(&cif->codel, cif->cl_q, m)) { + PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt, m_pktlen(m)); + return (ENOBUFS); + } + IFQ_INC_LEN(ifq); + + return (0); +} + +static struct mbuf * +codel_dequeue(struct ifaltq *ifq, int op) +{ + struct codel_if *cif = (struct codel_if *)ifq->altq_disc; + struct mbuf *m; + + IFQ_LOCK_ASSERT(ifq); + + if (IFQ_IS_EMPTY(ifq)) + return (NULL); + + if (op == ALTDQ_POLL) + return (qhead(cif->cl_q)); + + + m = codel_getq(&cif->codel, cif->cl_q); + if (m != NULL) { + IFQ_DEC_LEN(ifq); + PKTCNTR_ADD(&cif->cl_stats.cl_xmitcnt, m_pktlen(m)); + return (m); + } + + return (NULL); +} + +struct codel * +codel_alloc(int target, int interval, int ecn) +{ + struct codel *c; + + c = malloc(sizeof(*c), M_DEVBUF, M_NOWAIT | M_ZERO); + if (c != NULL) { + c->params.target = machclk_freq * target / 1000; + c->params.interval = machclk_freq * interval / 1000; + c->params.ecn = ecn; + c->stats.maxpacket = 256; + } + + return (c); +} + +void +codel_destroy(struct codel *c) +{ + + free(c, M_DEVBUF); +} + +#define MTAG_CODEL 1438031249 +int +codel_addq(struct codel *c, class_queue_t *q, struct mbuf *m) +{ + struct m_tag *mtag; + uint64_t *enqueue_time; + + if (qlen(q) < qlimit(q)) { + mtag = m_tag_locate(m, MTAG_CODEL, 0, NULL); + if (mtag == NULL) + mtag = m_tag_alloc(MTAG_CODEL, 0, sizeof(uint64_t), + M_NOWAIT); + if (mtag == NULL) { + m_freem(m); + return (-1); + } + enqueue_time = (uint64_t *)(mtag + 1); + *enqueue_time = read_machclk(); + m_tag_prepend(m, mtag); + _addq(q, m); + return (0); + } + c->drop_overlimit++; + m_freem(m); + + return (-1); +} + +static int +codel_should_drop(struct codel *c, class_queue_t *q, struct mbuf *m, + u_int64_t now) +{ + struct m_tag *mtag; + uint64_t *enqueue_time; + + if (m == NULL) { + c->vars.first_above_time = 0; + return (0); + } + + mtag = m_tag_locate(m, MTAG_CODEL, 0, NULL); + if (mtag == NULL) { + /* Only one warning per second. */ + if (ppsratecheck(&c->last_log, &c->last_pps, 1)) + printf("%s: could not found the packet mtag!\n", + __func__); + c->vars.first_above_time = 0; + return (0); + } + enqueue_time = (uint64_t *)(mtag + 1); + c->vars.ldelay = now - *enqueue_time; + c->stats.maxpacket = MAX(c->stats.maxpacket, m_pktlen(m)); + + if (codel_time_before(c->vars.ldelay, c->params.target) || + qsize(q) <= c->stats.maxpacket) { + /* went below - stay below for at least interval */ + c->vars.first_above_time = 0; + return (0); + } + if (c->vars.first_above_time == 0) { + /* just went above from below. If we stay above + * for at least interval we'll say it's ok to drop + */ + c->vars.first_above_time = now + c->params.interval; + return (0); + } + if (codel_time_after(now, c->vars.first_above_time)) + return (1); + + return (0); +} + +/* + * Run a Newton method step: + * new_invsqrt = (invsqrt / 2) * (3 - count * invsqrt^2) + * + * Here, invsqrt is a fixed point number (< 1.0), 32bit mantissa, aka Q0.32 + */ +static void +codel_Newton_step(struct codel_vars *vars) +{ + uint32_t invsqrt, invsqrt2; + uint64_t val; + +/* sizeof_in_bits(rec_inv_sqrt) */ +#define REC_INV_SQRT_BITS (8 * sizeof(u_int16_t)) +/* needed shift to get a Q0.32 number from rec_inv_sqrt */ +#define REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS) + + invsqrt = ((u_int32_t)vars->rec_inv_sqrt) << REC_INV_SQRT_SHIFT; + invsqrt2 = ((u_int64_t)invsqrt * invsqrt) >> 32; + val = (3LL << 32) - ((u_int64_t)vars->count * invsqrt2); + val >>= 2; /* avoid overflow in following multiply */ + val = (val * invsqrt) >> (32 - 2 + 1); + + vars->rec_inv_sqrt = val >> REC_INV_SQRT_SHIFT; +} + +static u_int64_t +codel_control_law(u_int64_t t, u_int64_t interval, u_int32_t rec_inv_sqrt) +{ + + return (t + (u_int32_t)(((u_int64_t)interval * + (rec_inv_sqrt << REC_INV_SQRT_SHIFT)) >> 32)); +} + +struct mbuf * +codel_getq(struct codel *c, class_queue_t *q) +{ + struct mbuf *m; + u_int64_t now; + int drop; + + if ((m = _getq(q)) == NULL) { + c->vars.dropping = 0; + return (m); + } + + now = read_machclk(); + drop = codel_should_drop(c, q, m, now); + if (c->vars.dropping) { + if (!drop) { + /* sojourn time below target - leave dropping state */ + c->vars.dropping = 0; + } else if (codel_time_after_eq(now, c->vars.drop_next)) { + /* It's time for the next drop. Drop the current + * packet and dequeue the next. The dequeue might + * take us out of dropping state. + * If not, schedule the next drop. + * A large backlog might result in drop rates so high + * that the next drop should happen now, + * hence the while loop. + */ + while (c->vars.dropping && + codel_time_after_eq(now, c->vars.drop_next)) { + c->vars.count++; /* don't care of possible wrap + * since there is no more + * divide */ + codel_Newton_step(&c->vars); + /* TODO ECN */ + PKTCNTR_ADD(&c->stats.drop_cnt, m_pktlen(m)); + m_freem(m); + m = _getq(q); + if (!codel_should_drop(c, q, m, now)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 22 03:29:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E376E9BF232; Sat, 22 Aug 2015 03:29:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAAA712B6; Sat, 22 Aug 2015 03:29:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M3TD1w047546; Sat, 22 Aug 2015 03:29:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M3TDdr047544; Sat, 22 Aug 2015 03:29:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508220329.t7M3TDdr047544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Aug 2015 03:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287011 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 03:29:14 -0000 Author: jhibbits Date: Sat Aug 22 03:29:12 2015 New Revision: 287011 URL: https://svnweb.freebsd.org/changeset/base/287011 Log: Make the mpc85xx platform a kobj base class. Summary: Some systems are based around mpc85xx, but need special initialization. By making the mpc85xx platform a base class, these systems can be platform subclasses, and perform board-specific initialization in addition to the mpc85xx initialization. Test Plan: Tested on my RB800. A platform class was created, and will be committed separately. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D3305 Modified: head/sys/powerpc/mpc85xx/mpc85xx.h head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Sat Aug 22 00:47:05 2015 (r287010) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Sat Aug 22 03:29:12 2015 (r287011) @@ -30,6 +30,8 @@ #ifndef _MPC85XX_H_ #define _MPC85XX_H_ +#include + /* * Configuration control and status registers */ @@ -84,4 +86,7 @@ int law_disable(int trgt, u_long addr, u int law_getmax(void); int law_pci_target(struct resource *, int *, int *); +DECLARE_CLASS(mpc85xx_platform); +int mpc85xx_attach(platform_t); + #endif /* _MPC85XX_H_ */ Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 22 00:47:05 2015 (r287010) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 22 03:29:12 2015 (r287011) @@ -71,7 +71,6 @@ vm_offset_t ccsrbar_va; static int cpu, maxcpu; static int mpc85xx_probe(platform_t); -static int mpc85xx_attach(platform_t); static void mpc85xx_mem_regions(platform_t, struct mem_region *phys, int *physsz, struct mem_region *avail, int *availsz); static u_long mpc85xx_timebase_freq(platform_t, struct cpuref *cpuref); @@ -98,11 +97,7 @@ static platform_method_t mpc85xx_methods PLATFORMMETHOD_END }; -static platform_def_t mpc85xx_platform = { - "mpc85xx", - mpc85xx_methods, - 0 -}; +DEFINE_CLASS_0(mpc85xx, mpc85xx_platform, mpc85xx_methods, 0); PLATFORM_DEF(mpc85xx_platform); @@ -117,7 +112,7 @@ mpc85xx_probe(platform_t plat) return (ENXIO); } -static int +int mpc85xx_attach(platform_t plat) { phandle_t cpus, child, ccsr; From owner-svn-src-head@freebsd.org Sat Aug 22 05:04:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B73059C00F1; Sat, 22 Aug 2015 05:04:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7AD81E7F; Sat, 22 Aug 2015 05:04:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M54c9O092686; Sat, 22 Aug 2015 05:04:38 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M54blH092677; Sat, 22 Aug 2015 05:04:37 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201508220504.t7M54blH092677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 22 Aug 2015 05:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287012 - in head/bin/pkill: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 05:04:38 -0000 Author: jamie Date: Sat Aug 22 05:04:36 2015 New Revision: 287012 URL: https://svnweb.freebsd.org/changeset/base/287012 Log: Make pkill/pgrep -j ARG take jname, not just jid. PR: 201588 Submitted by: Daniel Shahaf MFC after: 3 days Modified: head/bin/pkill/Makefile head/bin/pkill/Makefile.depend head/bin/pkill/pkill.1 head/bin/pkill/pkill.c head/bin/pkill/tests/pgrep-j_test.sh head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/Makefile ============================================================================== --- head/bin/pkill/Makefile Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/Makefile Sat Aug 22 05:04:36 2015 (r287012) @@ -5,7 +5,7 @@ PROG= pkill -LIBADD= kvm +LIBADD= kvm jail LINKS= ${BINDIR}/pkill ${BINDIR}/pgrep MLINKS= pkill.1 pgrep.1 Modified: head/bin/pkill/Makefile.depend ============================================================================== --- head/bin/pkill/Makefile.depend Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/Makefile.depend Sat Aug 22 05:04:36 2015 (r287012) @@ -9,6 +9,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libjail \ lib/libkvm \ Modified: head/bin/pkill/pkill.1 ============================================================================== --- head/bin/pkill/pkill.1 Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/pkill.1 Sat Aug 22 05:04:36 2015 (r287012) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 9, 2013 +.Dd August 21, 2015 .Dt PKILL 1 .Os .Sh NAME @@ -47,7 +47,7 @@ .Op Fl c Ar class .Op Fl d Ar delim .Op Fl g Ar pgrp -.Op Fl j Ar jid +.Op Fl j Ar jail .Op Fl s Ar sid .Op Fl t Ar tty .Op Fl u Ar euid @@ -63,7 +63,7 @@ .Op Fl U Ar uid .Op Fl c Ar class .Op Fl g Ar pgrp -.Op Fl j Ar jid +.Op Fl j Ar jail .Op Fl s Ar sid .Op Fl t Ar tty .Op Fl u Ar euid @@ -149,16 +149,16 @@ or command. .It Fl i Ignore case distinctions in both the process table and the supplied pattern. -.It Fl j Ar jid -Restrict matches to processes inside jails with a jail ID in the comma-separated -list -.Ar jid . -The value +.It Fl j Ar jail +Restrict matches to processes inside the specified jails. +The argument +.Ar jail +may be .Dq Li any -matches processes in any jail. -The value +to match processes in any jail, .Dq Li none -matches processes not in jail. +to match processes not in jail, +or a comma-separated list of jail IDs or names. .It Fl l Long output. For Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/pkill.c Sat Aug 22 05:04:36 2015 (r287012) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define STATUS_MATCH 0 #define STATUS_NOMATCH 1 @@ -78,7 +79,7 @@ enum listtype { LT_GROUP, LT_TTY, LT_PGRP, - LT_JID, + LT_JAIL, LT_SID, LT_CLASS }; @@ -245,7 +246,7 @@ main(int argc, char **argv) cflags |= REG_ICASE; break; case 'j': - makelist(&jidlist, LT_JID, optarg); + makelist(&jidlist, LT_JAIL, optarg); criteria = 1; break; case 'l': @@ -585,7 +586,7 @@ usage(void) fprintf(stderr, "usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n" - " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid]\n" + " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jail]\n" " [-s sid] [-t tty] [-u euid] pattern ...\n", getprogname(), ustr); @@ -700,7 +701,7 @@ makelist(struct listhead *head, enum lis if (li->li_number == 0) li->li_number = getsid(mypid); break; - case LT_JID: + case LT_JAIL: if (li->li_number < 0) errx(STATUS_BADUSAGE, "Negative jail ID `%s'", sp); @@ -766,15 +767,20 @@ foundtty: if ((st.st_mode & S_IFCHR) == li->li_number = st.st_rdev; break; - case LT_JID: + case LT_JAIL: { + int jid; + if (strcmp(sp, "none") == 0) li->li_number = 0; else if (strcmp(sp, "any") == 0) li->li_number = -1; + else if ((jid = jail_getid(sp)) != -1) + li->li_number = jid; else if (*ep != '\0') errx(STATUS_BADUSAGE, - "Invalid jail ID `%s'", sp); + "Invalid jail ID or name `%s'", sp); break; + } case LT_CLASS: li->li_number = -1; li->li_name = strdup(sp); Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/tests/pgrep-j_test.sh Sat Aug 22 05:04:36 2015 (r287012) @@ -14,7 +14,7 @@ if [ `id -u` -ne 0 ]; then exit 0 fi -echo "1..3" +echo "1..4" sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep @@ -87,5 +87,30 @@ else fi [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid) +wait + +# test 4 is like test 1 except with jname instead of jid. +name="pgrep -j " +sleep_amount=8 +jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & + +jail -c path=/ name=${base}_4_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_4_2.pid $sleep $sleep_amount & + +sleep 0.5 + +jname="${base}_4_1,${base}_4_2" +pid1="$(pgrep -f -x -j "$jname" "$sleep $sleep_amount" | sort)" +pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_4_1.pid)" \ + $(cat ${PWD}/${base}_4_2.pid) | sort) +if [ "$pid1" = "$pid2" ]; then + echo "ok 4 - $name" +else + echo "not ok 4 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" +fi +[ -f ${PWD}/${base}_4_1.pid ] && kill $(cat ${PWD}/${base}_4_1.pid) +[ -f ${PWD}/${base}_4_2.pid ] && kill $(cat ${PWD}/${base}_4_2.pid) +wait rm -f $sleep Modified: head/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- head/bin/pkill/tests/pkill-j_test.sh Sat Aug 22 03:29:12 2015 (r287011) +++ head/bin/pkill/tests/pkill-j_test.sh Sat Aug 22 05:04:36 2015 (r287012) @@ -14,7 +14,7 @@ if [ `id -u` -ne 0 ]; then exit 0 fi -echo "1..3" +echo "1..4" sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep @@ -90,5 +90,31 @@ else fi 2>/dev/null [ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid) [ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid) +wait + +# test 4 is like test 1 except with jname instead of jid. +name="pkill -j " +sleep_amount=8 +jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & + +jail -c path=/ name=${base}_4_2 ip4.addr=127.0.0.1 \ + command=daemon -p ${PWD}/${base}_4_2.pid $sleep $sleep_amount & + +$sleep $sleep_amount & + +sleep 0.5 + +jname="${base}_4_1,${base}_4_2" +if pkill -f -j "$jname" $sleep && sleep 0.5 && + ! -f ${PWD}/${base}_4_1.pid && + ! -f ${PWD}/${base}_4_2.pid ; then + echo "ok 4 - $name" +else + echo "not ok 4 - $name" +fi 2>/dev/null +[ -f ${PWD}/${base}_4_1.pid ] && kill $(cat ${PWD}/${base}_4_1.pid) +[ -f ${PWD}/${base}_4_2.pid ] && kill $(cat ${PWD}/${base}_4_2.pid) +wait rm -f $sleep From owner-svn-src-head@freebsd.org Sat Aug 22 05:50:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0F79C05F9; Sat, 22 Aug 2015 05:50:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F33D9F28; Sat, 22 Aug 2015 05:50:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M5oKTS010006; Sat, 22 Aug 2015 05:50:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M5oJ9E009998; Sat, 22 Aug 2015 05:50:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508220550.t7M5oJ9E009998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Aug 2015 05:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287013 - in head/sys: conf dev/fdt geom powerpc/mikrotik sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 05:50:21 -0000 Author: jhibbits Date: Sat Aug 22 05:50:18 2015 New Revision: 287013 URL: https://svnweb.freebsd.org/changeset/base/287013 Log: Create a RouterBoard platform and use it to create a flash map Summary: The RouterBoard uses a predefined partition map which doesn't exist in the fdt. This change allows overriding the fdt slicer with a custom slicer, and uses this custom slicer to define the flash map on the RouterBoard RB800. D3305 converts the mpc85xx platform into a base class, so that systems based on the mpc85xx platform can add their own overrides. This change builds on D3305, and creates a RouterBoard (RB800) platform to initialize the slicer override. Reviewed By: nwhitehorn, imp Differential Revision: https://reviews.freebsd.org/D3345 Added: head/sys/powerpc/mikrotik/ head/sys/powerpc/mikrotik/platform_rb.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc head/sys/dev/fdt/fdt_slicer.c head/sys/geom/geom_flashmap.c head/sys/sys/slicer.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Aug 22 05:04:36 2015 (r287012) +++ head/sys/conf/files.powerpc Sat Aug 22 05:50:18 2015 (r287013) @@ -129,6 +129,7 @@ powerpc/mambo/mambocall.S optional mambo powerpc/mambo/mambo.c optional mambo powerpc/mambo/mambo_console.c optional mambo powerpc/mambo/mambo_disk.c optional mambo +powerpc/mikrotik/platform_rb.c optional mikrotik powerpc/mpc85xx/atpic.c optional mpc85xx isa powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Sat Aug 22 05:04:36 2015 (r287012) +++ head/sys/conf/options.powerpc Sat Aug 22 05:50:18 2015 (r287013) @@ -32,3 +32,4 @@ OFWCONS_POLL_HZ opt_ofw.h # AGP debugging support AGP_DEBUG opt_agp.h +MIKROTIK Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Sat Aug 22 05:04:36 2015 (r287012) +++ head/sys/dev/fdt/fdt_slicer.c Sat Aug 22 05:50:18 2015 (r287013) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #endif int -flash_fill_slices(device_t dev, struct flash_slice *slices, int *slices_num) +fdt_flash_fill_slices(device_t dev, struct flash_slice *slices, int *slices_num) { char *slice_name; phandle_t dt_node, dt_child; Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Sat Aug 22 05:04:36 2015 (r287012) +++ head/sys/geom/geom_flashmap.c Sat Aug 22 05:50:18 2015 (r287013) @@ -70,6 +70,8 @@ static struct g_geom *g_flashmap_taste(s static void g_flashmap_config(struct gctl_req *, struct g_class *, const char *); static int g_flashmap_load(device_t, struct g_flashmap_head *); +static int (*flash_fill_slices)(device_t, struct flash_slice *, int *) = + fdt_flash_fill_slices; MALLOC_DECLARE(M_FLASHMAP); MALLOC_DEFINE(M_FLASHMAP, "geom_flashmap", "GEOM flash memory slicer class"); @@ -230,7 +232,8 @@ g_flashmap_load(device_t dev, struct g_f buf_size = sizeof(struct flash_slice) * FLASH_SLICES_MAX_NUM; slices = malloc(buf_size, M_FLASHMAP, M_WAITOK | M_ZERO); - if (flash_fill_slices(dev, slices, &nslices) == 0) { + if (flash_fill_slices && + flash_fill_slices(dev, slices, &nslices) == 0) { for (i = 0; i < nslices; i++) { slice = malloc(sizeof(struct g_flashmap_slice), M_FLASHMAP, M_WAITOK); @@ -247,6 +250,12 @@ g_flashmap_load(device_t dev, struct g_f return (nslices); } +void flash_register_slicer(int (*slicer)(device_t, struct flash_slice *, int *)) +{ + + flash_fill_slices = slicer; +} + static struct g_class g_flashmap_class = { .name = FLASHMAP_CLASS_NAME, .version = G_VERSION, Added: head/sys/powerpc/mikrotik/platform_rb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mikrotik/platform_rb.c Sat Aug 22 05:50:18 2015 (r287013) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2015 Justin Hibbits + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "platform_if.h" + +static int rb_probe(platform_t); +static int rb_attach(platform_t); + +static platform_method_t rb_methods[] = { + PLATFORMMETHOD(platform_probe, rb_probe), + PLATFORMMETHOD(platform_attach, rb_attach), + PLATFORMMETHOD_END +}; + +DEFINE_CLASS_1(rb, rb_platform, rb_methods, 0, mpc85xx_platform); + +PLATFORM_DEF(rb_platform); + +/* Slicer operates on the NAND controller, so we have to find the chip. */ +static int +rb_nand_slicer(device_t dev, struct flash_slice *slices, int *nslices) +{ + struct nand_chip *chip; + device_t *children; + int n; + + if (device_get_children(dev, &children, &n) != 0) { + panic("Slicer called on controller with no child!"); + } + dev = children[0]; + free(children, M_TEMP); + + if (device_get_children(dev, &children, &n) != 0) { + panic("Slicer called on controller with nandbus but no child!"); + } + dev = children[0]; + free(children, M_TEMP); + + chip = device_get_softc(dev); + *nslices = 2; + slices[0].base = 0; + slices[0].size = 4 * 1024 * 1024; + slices[0].label = "boot"; + + slices[1].base = 4 * 1024 * 1024; + slices[1].size = chip->ndisk->d_mediasize - slices[0].size; + slices[1].label = "rootfs"; + + return (0); +} + +static int +rb_probe(platform_t plat) +{ + phandle_t rootnode; + char model[32]; + + rootnode = OF_finddevice("/"); + + if (OF_getprop(rootnode, "model", model, sizeof(model)) > 0) { + if (strcmp(model, "RB800") == 0) + return (BUS_PROBE_SPECIFIC); + } + + return (ENXIO); +} + +static int +rb_attach(platform_t plat) +{ + int error; + + error = mpc85xx_attach(plat); + if (error) + return (error); + + flash_register_slicer(rb_nand_slicer); + + return (0); +} Modified: head/sys/sys/slicer.h ============================================================================== --- head/sys/sys/slicer.h Sat Aug 22 05:04:36 2015 (r287012) +++ head/sys/sys/slicer.h Sat Aug 22 05:50:18 2015 (r287013) @@ -45,7 +45,8 @@ struct flash_slice { }; #ifdef _KERNEL -int flash_fill_slices(device_t, struct flash_slice *, int *); +int fdt_flash_fill_slices(device_t, struct flash_slice *, int *) __weak_symbol; +void flash_register_slicer(int (*)(device_t, struct flash_slice *, int *)); #endif /* _KERNEL */ #endif /* _FLASH_SLICER_H_ */ From owner-svn-src-head@freebsd.org Sat Aug 22 07:20:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0240E9BE482; Sat, 22 Aug 2015 07:20:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE66FD4; Sat, 22 Aug 2015 07:20:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M7K3TH046678; Sat, 22 Aug 2015 07:20:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M7K3P4046677; Sat, 22 Aug 2015 07:20:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508220720.t7M7K3P4046677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Aug 2015 07:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287014 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 07:20:04 -0000 Author: jhibbits Date: Sat Aug 22 07:20:03 2015 New Revision: 287014 URL: https://svnweb.freebsd.org/changeset/base/287014 Log: Enhance book-e pmap for 36-bit physaddr Summary: This is (probably step 1) of enhancing the book-e pmap to support the full 36-bit physical address space on Freescale e500 and e5500 cores. Thus far it has only been regression tested on one platform. Since I only have one other Book-E platform (e5500), that needs work beyond this, I haven't yet tested it on this. Test Plan: Regression tested on my RouterBoard RB800. Reviewed By: marcel Differential Revision: https://reviews.freebsd.org/D3027 Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Aug 22 05:50:18 2015 (r287013) +++ head/sys/powerpc/booke/pmap.c Sat Aug 22 07:20:03 2015 (r287014) @@ -966,7 +966,7 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_pag pmap->pm_pdir[pdir_idx] = ptbl; } pte = &(pmap->pm_pdir[pdir_idx][ptbl_idx]); - pte->rpn = VM_PAGE_TO_PHYS(m) & ~PTE_PA_MASK; + pte->rpn = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); pte->flags |= (PTE_VALID | flags); tlb_miss_unlock(); @@ -1129,7 +1129,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Calculate corresponding physical addresses for the kernel region. */ phys_kernelend = kernload + kernsize; debugf("kernel image and allocated data:\n"); - debugf(" kernload = 0x%08x\n", kernload); + debugf(" kernload = 0x%09llx\n", (uint64_t)kernload); debugf(" kernstart = 0x%08x\n", kernstart); debugf(" kernsize = 0x%08x\n", kernsize); @@ -1282,7 +1282,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset kernel_pmap->pm_tid[i] = TID_KERNEL; /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ - tidbusy[i][0] = kernel_pmap; + tidbusy[i][TID_KERNEL] = kernel_pmap; } /* @@ -1315,7 +1315,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset thread0.td_kstack_pages = kstack_pages; debugf("kstack_sz = 0x%08x\n", kstack0_sz); - debugf("kstack0_phys at 0x%08x - 0x%08x\n", + debugf("kstack0_phys at 0x%09llx - 0x%09llx\n", kstack0_phys, kstack0_phys + kstack0_sz); debugf("kstack0 at 0x%08x - 0x%08x\n", kstack0, kstack0 + kstack0_sz); @@ -1512,7 +1512,7 @@ mmu_booke_kenter_attr(mmu_t mmu, vm_offs tlb0_flush_entry(va); } - pte->rpn = pa & ~PTE_PA_MASK; + pte->rpn = PTE_RPN_FROM_PA(pa); pte->flags = flags; //debugf("mmu_booke_kenter: pdir_idx = %d ptbl_idx = %d va=0x%08x " @@ -2632,7 +2632,7 @@ mmu_booke_dumpsys_map(mmu_t mmu, vm_padd /* Minidumps are based on virtual memory addresses. */ if (do_minidump) { - *va = (void *)pa; + *va = (void *)(vm_offset_t)pa; return; } @@ -2776,7 +2776,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd if (pa >= tlb1[i].phys && (pa + size) <= (tlb1[i].phys + tlb1[i].size)) return (void *)(tlb1[i].virt + - (pa - tlb1[i].phys)); + (vm_offset_t)(pa - tlb1[i].phys)); } } @@ -2804,7 +2804,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd do { sz = 1 << (ilog2(size) & ~1); if (bootverbose) - printf("Wiring VA=%x to PA=%x (size=%x), " + printf("Wiring VA=%x to PA=%llx (size=%x), " "using TLB1[%d]\n", va, pa, sz, tlb1_idx); tlb1_set_entry(va, pa, sz, tlb_calc_wimg(pa, ma)); size -= sz; @@ -3026,13 +3026,10 @@ tlb0_print_tlbentries(void) static void tlb1_write_entry(unsigned int idx) { - uint32_t mas0, mas7; + uint32_t mas0; //debugf("tlb1_write_entry: s\n"); - /* Clear high order RPN bits */ - mas7 = 0; - /* Select entry */ mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(idx); //debugf("tlb1_write_entry: mas0 = 0x%08x\n", mas0); @@ -3045,7 +3042,7 @@ tlb1_write_entry(unsigned int idx) __asm __volatile("isync"); mtspr(SPR_MAS3, tlb1[idx].mas3); __asm __volatile("isync"); - mtspr(SPR_MAS7, mas7); + mtspr(SPR_MAS7, tlb1[idx].mas7); __asm __volatile("isync; tlbwe; isync; msync"); //debugf("tlb1_write_entry: e\n"); @@ -3128,6 +3125,7 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_ /* Set supervisor RWX permission bits */ tlb1[index].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; + tlb1[index].mas7 = (pa >> 32) & MAS7_RPN; tlb1_write_entry(index); @@ -3191,7 +3189,7 @@ tlb1_mapin_region(vm_offset_t va, vm_pad for (idx = 0; idx < nents; idx++) { pgsz = pgs[idx]; - debugf("%u: %x -> %x, size=%x\n", idx, pa, va, pgsz); + debugf("%u: %llx -> %x, size=%x\n", idx, pa, va, pgsz); tlb1_set_entry(va, pa, pgsz, _TLB_ENTRY_MEM); pa += pgsz; va += pgsz; @@ -3210,7 +3208,7 @@ tlb1_mapin_region(vm_offset_t va, vm_pad void tlb1_init() { - uint32_t mas0, mas1, mas2, mas3; + uint32_t mas0, mas1, mas2, mas3, mas7; uint32_t tsz; u_int i; @@ -3231,12 +3229,15 @@ tlb1_init() mas2 = mfspr(SPR_MAS2); mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); tlb1[i].mas1 = mas1; tlb1[i].mas2 = mfspr(SPR_MAS2); tlb1[i].mas3 = mas3; + tlb1[i].mas7 = mas7; tlb1[i].virt = mas2 & MAS2_EPN_MASK; - tlb1[i].phys = mas3 & MAS3_RPN; + tlb1[i].phys = ((vm_paddr_t)(mas7 & MAS7_RPN) << 32) | + (mas3 & MAS3_RPN); if (i == 0) kernload = tlb1[i].phys; @@ -3350,7 +3351,8 @@ tlb1_print_entries(void) debugf("tlb1[] table entries:\n"); for (i = 0; i < TLB1_ENTRIES; i++) - tlb_print_entry(i, tlb1[i].mas1, tlb1[i].mas2, tlb1[i].mas3, 0); + tlb_print_entry(i, tlb1[i].mas1, tlb1[i].mas2, tlb1[i].mas3, + tlb1[i].mas7); } /* @@ -3389,8 +3391,9 @@ tlb1_iomapped(int i, vm_paddr_t pa, vm_s KASSERT((entry_tsize), ("tlb1_iomapped: invalid entry tsize")); entry_size = tsize2size(entry_tsize); - pa_start = tlb1[i].mas3 & MAS3_RPN; - pa_end = pa_start + entry_size - 1; + pa_start = (((vm_paddr_t)tlb1[i].mas7 & MAS7_RPN) << 32) | + (tlb1[i].mas3 & MAS3_RPN); + pa_end = pa_start + entry_size; if ((pa < pa_start) || ((pa + size) > pa_end)) return (ERANGE); From owner-svn-src-head@freebsd.org Sat Aug 22 07:27:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEDD29BE627; Sat, 22 Aug 2015 07:27:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97C19139D; Sat, 22 Aug 2015 07:27:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M7R8j3049955; Sat, 22 Aug 2015 07:27:08 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M7R79J049949; Sat, 22 Aug 2015 07:27:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508220727.t7M7R79J049949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Aug 2015 07:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287015 - in head/sys/powerpc: booke include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 07:27:08 -0000 Author: jhibbits Date: Sat Aug 22 07:27:06 2015 New Revision: 287015 URL: https://svnweb.freebsd.org/changeset/base/287015 Log: Follow up to r287014 Missed these files, from the original diff. Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D3027 Modified: head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/_types.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/tlb.h head/sys/powerpc/powerpc/uma_machdep.c Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Sat Aug 22 07:20:03 2015 (r287014) +++ head/sys/powerpc/booke/trap_subr.S Sat Aug 22 07:27:06 2015 (r287015) @@ -697,8 +697,10 @@ tlb_fill_entry: /* Setup MAS3 value in r23. */ lwz %r23, PTE_RPN(%r25) /* get pte->rpn */ + rlwinm %r22, %r23, 12, 0, 20 /* extract MAS3 portion of RPN */ - rlwimi %r23, %r21, 24, 26, 31 /* insert protection bits from pte */ + rlwimi %r22, %r21, 24, 26, 31 /* insert protection bits from pte */ + rlwinm %r23, %r23, 12, 28, 31 /* MAS7 portion of RPN */ /* Load MAS registers. */ mtspr SPR_MAS0, %r29 @@ -707,7 +709,9 @@ tlb_fill_entry: isync mtspr SPR_MAS2, %r27 isync - mtspr SPR_MAS3, %r23 + mtspr SPR_MAS3, %r22 + isync + mtspr SPR_MAS7, %r23 isync tlbwe Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Sat Aug 22 07:20:03 2015 (r287014) +++ head/sys/powerpc/include/_types.h Sat Aug 22 07:27:06 2015 (r287015) @@ -128,7 +128,11 @@ typedef __uint64_t __vm_size_t; #else typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; +#ifdef BOOKE +typedef __uint64_t __vm_paddr_t; +#else typedef __uint32_t __vm_paddr_t; +#endif typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Sat Aug 22 07:20:03 2015 (r287014) +++ head/sys/powerpc/include/pte.h Sat Aug 22 07:27:06 2015 (r287015) @@ -207,10 +207,13 @@ typedef struct lpte lpte_t; /* * Page Table Entry definitions and macros. + * + * RPN need only be 32-bit because Book-E has 36-bit addresses, and the smallest + * page size is 4k (12-bit mask), so RPN can really fit into 24 bits. */ #ifndef LOCORE struct pte { - vm_paddr_t rpn; + vm_offset_t rpn; uint32_t flags; }; typedef struct pte pte_t; @@ -266,7 +269,9 @@ typedef struct pte pte_t; #define PTE_REFERENCED 0x04000000 /* Referenced */ /* Macro argument must of pte_t type. */ -#define PTE_PA(pte) ((pte)->rpn & ~PTE_PA_MASK) +#define PTE_PA_SHIFT 12 +#define PTE_RPN_FROM_PA(pa) ((pa) >> PTE_PA_SHIFT) +#define PTE_PA(pte) ((vm_paddr_t)((pte)->rpn) << PTE_PA_SHIFT) #define PTE_ISVALID(pte) ((pte)->flags & PTE_VALID) #define PTE_ISWIRED(pte) ((pte)->flags & PTE_WIRED) #define PTE_ISMANAGED(pte) ((pte)->flags & PTE_MANAGED) Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Sat Aug 22 07:20:03 2015 (r287014) +++ head/sys/powerpc/include/tlb.h Sat Aug 22 07:27:06 2015 (r287015) @@ -106,6 +106,8 @@ #define MAS6_SPID0_SHIFT 16 #define MAS6_SAS 0x00000001 +#define MAS7_RPN 0x0000000F + #define MAS1_GETTID(mas1) (((mas1) & MAS1_TID_MASK) >> MAS1_TID_SHIFT) #define MAS2_TLB0_ENTRY_IDX_MASK 0x0007f000 @@ -132,6 +134,7 @@ typedef struct tlb_entry { uint32_t mas1; uint32_t mas2; uint32_t mas3; + uint32_t mas7; } tlb_entry_t; void tlb0_print_tlbentries(void); Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Sat Aug 22 07:20:03 2015 (r287014) +++ head/sys/powerpc/powerpc/uma_machdep.c Sat Aug 22 07:27:06 2015 (r287015) @@ -53,6 +53,7 @@ void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) { void *va; + vm_paddr_t pa; vm_page_t m; int pflags; @@ -69,7 +70,13 @@ uma_small_alloc(uma_zone_t zone, vm_size break; } - va = (void *) VM_PAGE_TO_PHYS(m); + pa = VM_PAGE_TO_PHYS(m); + + /* On book-e sizeof(void *) < sizeof(vm_paddr_t) */ + if ((vm_offset_t)pa != pa) + return (NULL); + + va = (void *)(vm_offset_t)pa; if (!hw_direct_map) pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); From owner-svn-src-head@freebsd.org Sat Aug 22 07:37:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 374639BEA8C; Sat, 22 Aug 2015 07:37:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9F91DCD; Sat, 22 Aug 2015 07:37:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M7bRDG054308; Sat, 22 Aug 2015 07:37:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M7bREb054307; Sat, 22 Aug 2015 07:37:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508220737.t7M7bREb054307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 22 Aug 2015 07:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287018 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 07:37:28 -0000 Author: delphij Date: Sat Aug 22 07:37:27 2015 New Revision: 287018 URL: https://svnweb.freebsd.org/changeset/base/287018 Log: Fixup mergeinfo. Modified: Directory Properties: head/contrib/tzdata/ (props changed) From owner-svn-src-head@freebsd.org Sat Aug 22 07:40:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA6B99BEB58; Sat, 22 Aug 2015 07:40:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D95E11AC; Sat, 22 Aug 2015 07:40:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M7eqZ6056911; Sat, 22 Aug 2015 07:40:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M7eqF6056894; Sat, 22 Aug 2015 07:40:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508220740.t7M7eqF6056894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 22 Aug 2015 07:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287020 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2015 07:40:52 -0000 Author: delphij Date: Sat Aug 22 07:40:51 2015 New Revision: 287020 URL: https://svnweb.freebsd.org/changeset/base/287020 Log: MFV r287019: leapseconds from tzdata2015f. MFC after: 2 weeks Modified: head/contrib/tzdata/leapseconds Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/leapseconds ============================================================================== --- head/contrib/tzdata/leapseconds Sat Aug 22 07:38:32 2015 (r287019) +++ head/contrib/tzdata/leapseconds Sat Aug 22 07:40:51 2015 (r287020) @@ -1,14 +1,20 @@ -#
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
+# Allowance for leap seconds added to each time zone file.
 
-# Allowance for leapseconds added to each timezone file.
+# This file is in the public domain.
 
-# The International Earth Rotation Service periodically uses leap seconds
-# to keep UTC to within 0.9 s of UT1
+# This file is generated automatically from the data in the public-domain
+# leap-seconds.list file available from most NIST time servers.
+# If the URL  does not work,
+# you should be able to pick up leap-seconds.list from a secondary NIST server.
+# For more about leap-seconds.list, please see
+# The NTP Timescale and Leap Seconds
+# http://www.eecis.udel.edu/~mills/leap.html
+
+# The International Earth Rotation and Reference Systems Service
+# periodically uses leap seconds to keep UTC to within 0.9 s of UT1
 # (which measures the true angular orientation of the earth in space); see
 # Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905.
+# Proc IEEE 79, 7 (July 1991), 894-905 .
 # There were no leap seconds before 1972, because the official mechanism
 # accounting for the discrepancy between atomic time and the earth's rotation
 # did not exist until the early 1970s.
@@ -19,8 +25,8 @@
 # or
 #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
 
-# If the leapsecond is Rolling (R) the given time is local time
-# If the leapsecond is Stationary (S) the given time is UTC
+# If the leapsecond is Rolling (R) the given time is local time.
+# If the leapsecond is Stationary (S) the given time is UTC.
 
 # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
 Leap	1972	Jun	30	23:59:60	+	S
@@ -48,53 +54,7 @@ Leap	1998	Dec	31	23:59:60	+	S
 Leap	2005	Dec	31	23:59:60	+	S
 Leap	2008	Dec	31	23:59:60	+	S
 Leap	2012	Jun	30	23:59:60	+	S
+Leap	2015	Jun	30	23:59:60	+	S
 
-# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
-#
-# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
-#
-#
-# SERVICE DE LA ROTATION TERRESTRE
-# OBSERVATOIRE DE PARIS
-# 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
-# FAX       : 33 (0) 1 40 51 22 91
-# e-mail    : (E-Mail Removed)
-# http://hpiers.obspm.fr/eop-pc
-#
-# Paris, 5 January 2012
-#
-#
-# Bulletin C 43
-#
-# To authorities responsible
-# for the measurement and
-# distribution of time
-#
-#
-# UTC TIME STEP
-# on the 1st of July 2012
-#
-#
-# A positive leap second will be introduced at the end of June 2012.
-# The sequence of dates of the UTC second markers will be:
-#
-#                          2012 June 30,     23h 59m 59s
-#                          2012 June 30,     23h 59m 60s
-#                          2012 July  1,      0h  0m  0s
-#
-# The difference between UTC and the International Atomic Time TAI is:
-#
-# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
-# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
-#
-# Leap seconds can be introduced in UTC at the end of the months of December
-# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
-# six months, either to announce a time step in UTC or to confirm that there
-# will be no time step at the next possible date.
-#
-#
-# Daniel GAMBIS
-# Head
-# Earth Orientation Center of IERS
-# Observatoire de Paris, France
+#	Updated through IERS Bulletin C50
+#	File expires on:  28 June 2016

From owner-svn-src-head@freebsd.org  Sat Aug 22 07:41:29 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31EE59BEC72;
 Sat, 22 Aug 2015 07:41:29 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 232481360;
 Sat, 22 Aug 2015 07:41:29 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.70])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7M7fT0f058372;
 Sat, 22 Aug 2015 07:41:29 GMT (envelope-from delphij@FreeBSD.org)
Received: (from delphij@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7M7fTf4058371;
 Sat, 22 Aug 2015 07:41:29 GMT (envelope-from delphij@FreeBSD.org)
Message-Id: <201508220741.t7M7fTf4058371@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: delphij set sender to
 delphij@FreeBSD.org using -f
From: Xin LI 
Date: Sat, 22 Aug 2015 07:41:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r287021 - head/share/zoneinfo
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 07:41:29 -0000

Author: delphij
Date: Sat Aug 22 07:41:28 2015
New Revision: 287021
URL: https://svnweb.freebsd.org/changeset/base/287021

Log:
  Fix build when LEAPSECONDS is enabled.
  
  MFC after:	2 weeks

Modified:
  head/share/zoneinfo/Makefile

Modified: head/share/zoneinfo/Makefile
==============================================================================
--- head/share/zoneinfo/Makefile	Sat Aug 22 07:40:51 2015	(r287020)
+++ head/share/zoneinfo/Makefile	Sat Aug 22 07:41:28 2015	(r287021)
@@ -34,7 +34,7 @@ CONTRIBDIR=	${.CURDIR}/../../contrib/tzd
 .PATH:		${CONTRIBDIR}
 
 .if defined(LEAPSECONDS)
-LEAPFILE=	-L leapseconds
+LEAPFILE=	-L ${CONTRIBDIR}leapseconds
 .else
 LEAPFILE=
 .endif

From owner-svn-src-head@freebsd.org  Sat Aug 22 09:18:38 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1DC69C0248;
 Sat, 22 Aug 2015 09:18:38 +0000 (UTC)
 (envelope-from ermal.luci@gmail.com)
Received: from mail-yk0-x22a.google.com (mail-yk0-x22a.google.com
 [IPv6:2607:f8b0:4002:c07::22a])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 81E94C06;
 Sat, 22 Aug 2015 09:18:38 +0000 (UTC)
 (envelope-from ermal.luci@gmail.com)
Received: by ykll84 with SMTP id l84so92797818ykl.0;
 Sat, 22 Aug 2015 02:18:37 -0700 (PDT)
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=4uB3SvSOkZcemSimAZaMewefPljtBPvn35OaUWUQRtI=;
 b=bSVmW3F9/bRWoD+k+iolWXq2YzbSzzUVC1L13uCPhjQA2qPOk4xp6EC++pV8ZOX/Do
 BWe1879rzzzM3t7OhqgzAutfczgWFc2V4foIE4LZnPdosHHSlJ304Q3N6DKLojf11OIz
 lDe65a7yCtD1pN1zXngCmMRuAzn3Z3Ohgbv6rGgSw5OKecK4YaoR93iqu9e0cROV6jV8
 /BDk+7Qlr2IZTRPEFJYzmvKiF2CaywXbUH5dRR8mR0e7uvmQOegW9dgEQCXvgbBQF9AL
 GrzTsNUUUBgZ8bYbm7JG+s5L/XhoAdCFgAtd2lD5ltPKAudqcyTPMUSejOpEk89YpWTU
 4kDQ==
MIME-Version: 1.0
X-Received: by 10.129.117.4 with SMTP id q4mr18100212ywc.15.1440235117513;
 Sat, 22 Aug 2015 02:18:37 -0700 (PDT)
Received: by 10.129.73.205 with HTTP; Sat, 22 Aug 2015 02:18:37 -0700 (PDT)
In-Reply-To: <201508212202.t7LM2MhF015522@repo.freebsd.org>
References: <201508212202.t7LM2MhF015522@repo.freebsd.org>
Date: Sat, 22 Aug 2015 11:18:37 +0200
Message-ID: 
Subject: Re: svn commit: r287009 - in head: sbin/pfctl share/man/man4 sys/conf
 sys/net/altq sys/netpfil/pf
From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= 
To: Luiz Otavio O Souza 
Cc: src-committers ,
 svn-src-all , 
 svn-src-head 
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.20
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 09:18:39 -0000

On Sat, Aug 22, 2015 at 12:02 AM, Luiz Otavio O Souza 
wrote:

> Author: loos
> Date: Fri Aug 21 22:02:22 2015
> New Revision: 287009
> URL: https://svnweb.freebsd.org/changeset/base/287009
>
> Log:
>   Add ALTQ(9) support for the CoDel algorithm.
>
>   CoDel is a parameterless queue discipline that handles variable bandwidth
>   and RTT.
>
>   It can be used as the single queue discipline on an interface or as a sub
>   discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, FAIRQ.
>
>   Differential Revision:        https://reviews.freebsd.org/D3272
>   Reviewd by:   rpaulo, gnn (previous version)
>

I thought part of this commit message was taken from me as a reviewer, no?


>   Obtained from:        pfSense
>   Sponsored by: Rubicon Communications (Netgate)
>
> Added:
>   head/sys/net/altq/altq_codel.c   (contents, props changed)
>   head/sys/net/altq/altq_codel.h   (contents, props changed)
> Modified:
>   head/sbin/pfctl/parse.y
>   head/sbin/pfctl/pfctl_altq.c
>   head/sbin/pfctl/pfctl_parser.h
>   head/sbin/pfctl/pfctl_qstats.c
>   head/share/man/man4/altq.4
>   head/sys/conf/files
>   head/sys/conf/options
>   head/sys/net/altq/altq.h
>   head/sys/net/altq/altq_cbq.c
>   head/sys/net/altq/altq_cbq.h
>   head/sys/net/altq/altq_classq.h
>   head/sys/net/altq/altq_fairq.c
>   head/sys/net/altq/altq_fairq.h
>   head/sys/net/altq/altq_hfsc.c
>   head/sys/net/altq/altq_hfsc.h
>   head/sys/net/altq/altq_priq.c
>   head/sys/net/altq/altq_priq.h
>   head/sys/net/altq/altq_rmclass.c
>   head/sys/net/altq/altq_rmclass.h
>   head/sys/net/altq/altq_subr.c
>   head/sys/net/altq/altq_var.h
>   head/sys/netpfil/pf/pf_altq.h
>
> Modified: head/sbin/pfctl/parse.y
>
> ==============================================================================
> --- head/sbin/pfctl/parse.y     Fri Aug 21 21:47:29 2015        (r287008)
> +++ head/sbin/pfctl/parse.y     Fri Aug 21 22:02:22 2015        (r287009)
> @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -299,7 +300,7 @@ struct pool_opts {
>
>  } pool_opts;
>
> -
> +struct codel_opts       codel_opts;
>  struct node_hfsc_opts   hfsc_opts;
>  struct node_fairq_opts  fairq_opts;
>  struct node_state_opt  *keep_state_defaults = NULL;
> @@ -425,6 +426,7 @@ typedef struct {
>                 struct pool_opts         pool_opts;
>                 struct node_hfsc_opts    hfsc_opts;
>                 struct node_fairq_opts   fairq_opts;
> +               struct codel_opts        codel_opts;
>         } v;
>         int lineno;
>  } YYSTYPE;
> @@ -449,8 +451,8 @@ int parseport(char *, struct range *r, i
>  %token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID
>  %token ANTISPOOF FOR INCLUDE
>  %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY
> -%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME
> UPPERLIMIT
> -%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE
> +%token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME
> +%token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET
> INTERVAL
>  %token LOAD RULESET_OPTIMIZATION
>  %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE
>  %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY
> @@ -499,6 +501,7 @@ int parseport(char *, struct range *r, i
>  %type                priqflags_list priqflags_item
>  %type             hfscopts_list hfscopts_item hfsc_opts
>  %type            fairqopts_list fairqopts_item fairq_opts
> +%type            codelopts_list codelopts_item codel_opts
>  %type          bandwidth
>  %type           filter_opts filter_opt filter_opts_l
>  %type        antispoof_opts antispoof_opt
> antispoof_opts_l
> @@ -1470,7 +1473,7 @@ altqif            : ALTQ interface queue_opts QUEU
>                         a.scheduler = $3.scheduler.qtype;
>                         a.qlimit = $3.qlimit;
>                         a.tbrsize = $3.tbrsize;
> -                       if ($5 == NULL) {
> +                       if ($5 == NULL && $3.scheduler.qtype !=
> ALTQT_CODEL) {
>                                 yyerror("no child queues specified");
>                                 YYERROR;
>                         }
> @@ -1672,6 +1675,15 @@ scheduler        : CBQ                           {
>                         $$.qtype = ALTQT_FAIRQ;
>                         $$.data.fairq_opts = $3;
>                 }
> +               | CODEL                         {
> +                       $$.qtype = ALTQT_CODEL;
> +                       bzero(&$$.data.codel_opts,
> +                               sizeof(struct codel_opts));
> +               }
> +               | CODEL '(' codel_opts ')'      {
> +                       $$.qtype = ALTQT_CODEL;
> +                       $$.data.codel_opts = $3;
> +               }
>                 ;
>
>  cbqflags_list  : cbqflags_item                         { $$ |= $1; }
> @@ -1689,6 +1701,8 @@ cbqflags_item     : STRING        {
>                                 $$ = CBQCLF_RED|CBQCLF_ECN;
>                         else if (!strcmp($1, "rio"))
>                                 $$ = CBQCLF_RIO;
> +                       else if (!strcmp($1, "codel"))
> +                               $$ = CBQCLF_CODEL;
>                         else {
>                                 yyerror("unknown cbq flag \"%s\"", $1);
>                                 free($1);
> @@ -1711,6 +1725,8 @@ priqflags_item    : STRING        {
>                                 $$ = PRCF_RED|PRCF_ECN;
>                         else if (!strcmp($1, "rio"))
>                                 $$ = PRCF_RIO;
> +                       else if (!strcmp($1, "codel"))
> +                               $$ = PRCF_CODEL;
>                         else {
>                                 yyerror("unknown priq flag \"%s\"", $1);
>                                 free($1);
> @@ -1811,6 +1827,8 @@ hfscopts_item     : LINKSHARE bandwidth
>              {
>                                 hfsc_opts.flags |= HFCF_RED|HFCF_ECN;
>                         else if (!strcmp($1, "rio"))
>                                 hfsc_opts.flags |= HFCF_RIO;
> +                       else if (!strcmp($1, "codel"))
> +                               hfsc_opts.flags |= HFCF_CODEL;
>                         else {
>                                 yyerror("unknown hfsc flag \"%s\"", $1);
>                                 free($1);
> @@ -1866,6 +1884,8 @@ fairqopts_item    : LINKSHARE bandwidth
>                                 fairq_opts.flags |= FARF_RED|FARF_ECN;
>                         else if (!strcmp($1, "rio"))
>                                 fairq_opts.flags |= FARF_RIO;
> +                       else if (!strcmp($1, "codel"))
> +                               fairq_opts.flags |= FARF_CODEL;
>                         else {
>                                 yyerror("unknown fairq flag \"%s\"", $1);
>                                 free($1);
> @@ -1875,6 +1895,45 @@ fairqopts_item   : LINKSHARE bandwidth
>                 }
>                 ;
>
> +codel_opts     :       {
> +                               bzero(&codel_opts,
> +                                   sizeof(struct codel_opts));
> +                       }
> +                   codelopts_list                              {
> +                       $$ = codel_opts;
> +               }
> +               ;
> +
> +codelopts_list : codelopts_item
> +               | codelopts_list comma codelopts_item
> +               ;
> +
> +codelopts_item : INTERVAL number                               {
> +                       if (codel_opts.interval) {
> +                               yyerror("interval already specified");
> +                               YYERROR;
> +                       }
> +                       codel_opts.interval = $2;
> +               }
> +               | TARGET number                                 {
> +                       if (codel_opts.target) {
> +                               yyerror("target already specified");
> +                               YYERROR;
> +                       }
> +                       codel_opts.target = $2;
> +               }
> +               | STRING                                        {
> +                       if (!strcmp($1, "ecn"))
> +                               codel_opts.ecn = 1;
> +                       else {
> +                               yyerror("unknown codel option \"%s\"", $1);
> +                               free($1);
> +                               YYERROR;
> +                       }
> +                       free($1);
> +               }
> +               ;
> +
>  qassign                : /* empty */           { $$ = NULL; }
>                 | qassign_item          { $$ = $1; }
>                 | '{' optnl qassign_list '}'    { $$ = $3; }
> @@ -4800,7 +4859,8 @@ expand_altq(struct pf_altq *a, struct no
>
>         if ((pf->loadopt & PFCTL_FLAG_ALTQ) == 0) {
>                 FREE_LIST(struct node_if, interfaces);
> -               FREE_LIST(struct node_queue, nqueues);
> +               if (nqueues)
> +                       FREE_LIST(struct node_queue, nqueues);
>                 return (0);
>         }
>
> @@ -4891,7 +4951,8 @@ expand_altq(struct pf_altq *a, struct no
>                 }
>         );
>         FREE_LIST(struct node_if, interfaces);
> -       FREE_LIST(struct node_queue, nqueues);
> +       if (nqueues)
> +               FREE_LIST(struct node_queue, nqueues);
>
>         return (errs);
>  }
> @@ -5297,6 +5358,7 @@ lookup(char *s)
>                 { "buckets",            BUCKETS},
>                 { "cbq",                CBQ},
>                 { "code",               CODE},
> +               { "codelq",             CODEL},
>                 { "crop",               FRAGCROP},
>                 { "debug",              DEBUG},
>                 { "divert-reply",       DIVERTREPLY},
> @@ -5326,6 +5388,7 @@ lookup(char *s)
>                 { "include",            INCLUDE},
>                 { "inet",               INET},
>                 { "inet6",              INET6},
> +               { "interval",           INTERVAL},
>                 { "keep",               KEEP},
>                 { "label",              LABEL},
>                 { "limit",              LIMIT},
> @@ -5395,6 +5458,7 @@ lookup(char *s)
>                 { "table",              TABLE},
>                 { "tag",                TAG},
>                 { "tagged",             TAGGED},
> +               { "target",             TARGET},
>                 { "tbrsize",            TBRSIZE},
>                 { "timeout",            TIMEOUT},
>                 { "to",                 TO},
>
> Modified: head/sbin/pfctl/pfctl_altq.c
>
> ==============================================================================
> --- head/sbin/pfctl/pfctl_altq.c        Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sbin/pfctl/pfctl_altq.c        Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -60,6 +61,9 @@ static int    cbq_compute_idletime(struct p
>  static int     check_commit_cbq(int, int, struct pf_altq *);
>  static int     print_cbq_opts(const struct pf_altq *);
>
> +static int     print_codel_opts(const struct pf_altq *,
> +                   const struct node_queue_opt *);
> +
>  static int     eval_pfqueue_priq(struct pfctl *, struct pf_altq *);
>  static int     check_commit_priq(int, int, struct pf_altq *);
>  static int     print_priq_opts(const struct pf_altq *);
> @@ -185,6 +189,10 @@ print_altq(const struct pf_altq *a, unsi
>                 if (!print_fairq_opts(a, qopts))
>                         printf("fairq ");
>                 break;
> +       case ALTQT_CODEL:
> +               if (!print_codel_opts(a, qopts))
> +                       printf("codel ");
> +               break;
>         }
>
>         if (bw != NULL && bw->bw_percent > 0) {
> @@ -591,6 +599,8 @@ print_cbq_opts(const struct pf_altq *a)
>                         printf(" ecn");
>                 if (opts->flags & CBQCLF_RIO)
>                         printf(" rio");
> +               if (opts->flags & CBQCLF_CODEL)
> +                       printf(" codel");
>                 if (opts->flags & CBQCLF_CLEARDSCP)
>                         printf(" cleardscp");
>                 if (opts->flags & CBQCLF_FLOWVALVE)
> @@ -678,6 +688,8 @@ print_priq_opts(const struct pf_altq *a)
>                         printf(" ecn");
>                 if (opts->flags & PRCF_RIO)
>                         printf(" rio");
> +               if (opts->flags & PRCF_CODEL)
> +                       printf(" codel");
>                 if (opts->flags & PRCF_CLEARDSCP)
>                         printf(" cleardscp");
>                 if (opts->flags & PRCF_DEFAULTCLASS)
> @@ -1010,6 +1022,8 @@ print_hfsc_opts(const struct pf_altq *a,
>                         printf(" ecn");
>                 if (opts->flags & HFCF_RIO)
>                         printf(" rio");
> +               if (opts->flags & HFCF_CODEL)
> +                       printf(" codel");
>                 if (opts->flags & HFCF_CLEARDSCP)
>                         printf(" cleardscp");
>                 if (opts->flags & HFCF_DEFAULTCLASS)
> @@ -1032,6 +1046,28 @@ print_hfsc_opts(const struct pf_altq *a,
>  }
>
>  static int
> +print_codel_opts(const struct pf_altq *a, const struct node_queue_opt
> *qopts)
> +{
> +       const struct codel_opts *opts;
> +
> +       opts = &a->pq_u.codel_opts;
> +       if (opts->target || opts->interval || opts->ecn) {
> +               printf("codel(");
> +               if (opts->target)
> +                       printf(" target %d", opts->target);
> +               if (opts->interval)
> +                       printf(" interval %d", opts->interval);
> +               if (opts->ecn)
> +                       printf("ecn");
> +               printf(" ) ");
> +
> +               return (1);
> +       }
> +
> +       return (0);
> +}
> +
> +static int
>  print_fairq_opts(const struct pf_altq *a, const struct node_queue_opt
> *qopts)
>  {
>         const struct fairq_opts         *opts;
> @@ -1053,6 +1089,8 @@ print_fairq_opts(const struct pf_altq *a
>                         printf(" ecn");
>                 if (opts->flags & FARF_RIO)
>                         printf(" rio");
> +               if (opts->flags & FARF_CODEL)
> +                       printf(" codel");
>                 if (opts->flags & FARF_CLEARDSCP)
>                         printf(" cleardscp");
>                 if (opts->flags & FARF_DEFAULTCLASS)
> @@ -1404,6 +1442,11 @@ eval_queue_opts(struct pf_altq *pa, stru
>                             opts->data.fairq_opts.linkshare.d;
>                 }
>                 break;
> +       case ALTQT_CODEL:
> +               pa->pq_u.codel_opts.target = opts->data.codel_opts.target;
> +               pa->pq_u.codel_opts.interval =
> opts->data.codel_opts.interval;
> +               pa->pq_u.codel_opts.ecn = opts->data.codel_opts.ecn;
> +               break;
>         default:
>                 warnx("eval_queue_opts: unknown scheduler type %u",
>                     opts->qtype);
>
> Modified: head/sbin/pfctl/pfctl_parser.h
>
> ==============================================================================
> --- head/sbin/pfctl/pfctl_parser.h      Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sbin/pfctl/pfctl_parser.h      Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -168,6 +168,7 @@ struct node_queue_opt {
>         int                      qtype;
>         union {
>                 struct cbq_opts         cbq_opts;
> +               struct codel_opts       codel_opts;
>                 struct priq_opts        priq_opts;
>                 struct node_hfsc_opts   hfsc_opts;
>                 struct node_fairq_opts  fairq_opts;
>
> Modified: head/sbin/pfctl/pfctl_qstats.c
>
> ==============================================================================
> --- head/sbin/pfctl/pfctl_qstats.c      Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sbin/pfctl/pfctl_qstats.c      Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -48,6 +49,7 @@ union class_stats {
>         struct priq_classstats  priq_stats;
>         struct hfsc_classstats  hfsc_stats;
>         struct fairq_classstats fairq_stats;
> +       struct codel_ifstats    codel_stats;
>  };
>
>  #define AVGN_MAX       8
> @@ -77,6 +79,7 @@ struct pf_altq_node   *pfctl_find_altq_nod
>  void                    pfctl_print_altq_node(int, const struct
> pf_altq_node *,
>                             unsigned, int);
>  void                    print_cbqstats(struct queue_stats);
> +void                    print_codelstats(struct queue_stats);
>  void                    print_priqstats(struct queue_stats);
>  void                    print_hfscstats(struct queue_stats);
>  void                    print_fairqstats(struct queue_stats);
> @@ -165,7 +168,7 @@ pfctl_update_qstats(int dev, struct pf_a
>                         return (-1);
>                 }
>  #ifdef __FreeBSD__
> -               if (pa.altq.qid > 0 &&
> +               if ((pa.altq.qid > 0 || pa.altq.scheduler == ALTQT_CODEL)
> &&
>                     !(pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED)) {
>  #else
>                 if (pa.altq.qid > 0) {
> @@ -303,7 +306,7 @@ pfctl_print_altq_node(int dev, const str
>  void
>  pfctl_print_altq_nodestat(int dev, const struct pf_altq_node *a)
>  {
> -       if (a->altq.qid == 0)
> +       if (a->altq.qid == 0 && a->altq.scheduler != ALTQT_CODEL)
>                 return;
>
>  #ifdef __FreeBSD__
> @@ -323,6 +326,9 @@ pfctl_print_altq_nodestat(int dev, const
>         case ALTQT_FAIRQ:
>                 print_fairqstats(a->qstats);
>                 break;
> +       case ALTQT_CODEL:
> +               print_codelstats(a->qstats);
> +               break;
>         }
>  }
>
> @@ -348,6 +354,28 @@ print_cbqstats(struct queue_stats cur)
>  }
>
>  void
> +print_codelstats(struct queue_stats cur)
> +{
> +       printf("  [ pkts: %10llu  bytes: %10llu  "
> +           "dropped pkts: %6llu bytes: %6llu ]\n",
> +           (unsigned long long)cur.data.codel_stats.cl_xmitcnt.packets,
> +           (unsigned long long)cur.data.codel_stats.cl_xmitcnt.bytes,
> +           (unsigned long long)cur.data.codel_stats.cl_dropcnt.packets +
> +           cur.data.codel_stats.stats.drop_cnt.packets,
> +           (unsigned long long)cur.data.codel_stats.cl_dropcnt.bytes +
> +           cur.data.codel_stats.stats.drop_cnt.bytes);
> +       printf("  [ qlength: %3d/%3d ]\n",
> +           cur.data.codel_stats.qlength, cur.data.codel_stats.qlimit);
> +
> +       if (cur.avgn < 2)
> +               return;
> +
> +       printf("  [ measured: %7.1f packets/s, %s/s ]\n",
> +           cur.avg_packets / STAT_INTERVAL,
> +           rate2str((8 * cur.avg_bytes) / STAT_INTERVAL));
> +}
> +
> +void
>  print_priqstats(struct queue_stats cur)
>  {
>         printf("  [ pkts: %10llu  bytes: %10llu  "
> @@ -428,7 +456,7 @@ update_avg(struct pf_altq_node *a)
>         u_int64_t                b, p;
>         int                      n;
>
> -       if (a->altq.qid == 0)
> +       if (a->altq.qid == 0 && a->altq.scheduler != ALTQT_CODEL)
>                 return;
>
>         qs = &a->qstats;
> @@ -451,6 +479,10 @@ update_avg(struct pf_altq_node *a)
>                 b = qs->data.fairq_stats.xmit_cnt.bytes;
>                 p = qs->data.fairq_stats.xmit_cnt.packets;
>                 break;
> +       case ALTQT_CODEL:
> +               b = qs->data.codel_stats.cl_xmitcnt.bytes;
> +               p = qs->data.codel_stats.cl_xmitcnt.packets;
> +               break;
>         default:
>                 b = 0;
>                 p = 0;
>
> Modified: head/share/man/man4/altq.4
>
> ==============================================================================
> --- head/share/man/man4/altq.4  Fri Aug 21 21:47:29 2015        (r287008)
> +++ head/share/man/man4/altq.4  Fri Aug 21 22:02:22 2015        (r287009)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd June 24, 2015
> +.Dd July 24, 2015
>  .Dt ALTQ 4
>  .Os
>  .Sh NAME
> @@ -35,6 +35,7 @@
>  .Cd options ALTQ
>  .Pp
>  .Cd options ALTQ_CBQ
> +.Cd options ALTQ_CODEL
>  .Cd options ALTQ_RED
>  .Cd options ALTQ_RIO
>  .Cd options ALTQ_HFSC
> @@ -74,6 +75,10 @@ Enable
>  Build the
>  .Dq "Class Based Queuing"
>  discipline.
> +.It Dv ALTQ_CODEL
> +Build the
> +.Dq "Controlled Delay"
> +discipline.
>  .It Dv ALTQ_RED
>  Build the
>  .Dq "Random Early Detection"
>
> Modified: head/sys/conf/files
>
> ==============================================================================
> --- head/sys/conf/files Fri Aug 21 21:47:29 2015        (r287008)
> +++ head/sys/conf/files Fri Aug 21 22:02:22 2015        (r287009)
> @@ -3429,6 +3429,7 @@ libkern/zlib.c                    optional crypto |
> geom_
>                                          ddb_ctf | gzio | geom_uncompress
>  net/altq/altq_cbq.c            optional altq
>  net/altq/altq_cdnr.c           optional altq
> +net/altq/altq_codel.c          optional altq
>  net/altq/altq_hfsc.c           optional altq
>  net/altq/altq_fairq.c          optional altq
>  net/altq/altq_priq.c           optional altq
>
> Modified: head/sys/conf/options
>
> ==============================================================================
> --- head/sys/conf/options       Fri Aug 21 21:47:29 2015        (r287008)
> +++ head/sys/conf/options       Fri Aug 21 22:02:22 2015        (r287009)
> @@ -388,6 +388,7 @@ ACCEPT_FILTER_HTTP
>  ALTQ                   opt_global.h
>  ALTQ_CBQ               opt_altq.h
>  ALTQ_CDNR              opt_altq.h
> +ALTQ_CODEL             opt_altq.h
>  ALTQ_DEBUG             opt_altq.h
>  ALTQ_HFSC              opt_altq.h
>  ALTQ_FAIRQ             opt_altq.h
>
> Modified: head/sys/net/altq/altq.h
>
> ==============================================================================
> --- head/sys/net/altq/altq.h    Fri Aug 21 21:47:29 2015        (r287008)
> +++ head/sys/net/altq/altq.h    Fri Aug 21 22:02:22 2015        (r287009)
> @@ -64,7 +64,8 @@
>  #define        ALTQT_PRIQ              11      /* priority queue */
>  #define        ALTQT_JOBS              12      /* JoBS */
>  #define        ALTQT_FAIRQ             13      /* fairq */
> -#define        ALTQT_MAX               14      /* should be max
> discipline type + 1 */
> +#define        ALTQT_CODEL             14      /* CoDel */
> +#define        ALTQT_MAX               15      /* should be max
> discipline type + 1 */
>
>  #ifdef ALTQ3_COMPAT
>  struct altqreq {
>
> Modified: head/sys/net/altq/altq_cbq.c
>
> ==============================================================================
> --- head/sys/net/altq/altq_cbq.c        Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sys/net/altq/altq_cbq.c        Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -237,6 +237,10 @@ get_class_stats(class_stats_t *statsp, s
>         if (q_is_rio(cl->q_))
>                 rio_getstats((rio_t *)cl->red_, &statsp->red[0]);
>  #endif
> +#ifdef ALTQ_CODEL
> +       if (q_is_codel(cl->q_))
> +               codel_getstats(cl->codel_, &statsp->codel);
> +#endif
>  }
>
>  int
>
> Modified: head/sys/net/altq/altq_cbq.h
>
> ==============================================================================
> --- head/sys/net/altq/altq_cbq.h        Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sys/net/altq/altq_cbq.h        Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -36,6 +36,7 @@
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>
> @@ -52,6 +53,7 @@ extern "C" {
>  #define        CBQCLF_FLOWVALVE        0x0008  /* use flowvalve (aka
> penalty-box) */
>  #define        CBQCLF_CLEARDSCP        0x0010  /* clear diffserv
> codepoint */
>  #define        CBQCLF_BORROW           0x0020  /* borrow from parent */
> +#define        CBQCLF_CODEL            0x0040  /* use CoDel */
>
>  /* class flags only for root class */
>  #define        CBQCLF_WRR              0x0100  /* weighted-round robin */
> @@ -91,9 +93,10 @@ typedef struct _cbq_class_stats_ {
>         int             qcnt;           /* # packets in queue */
>         int             avgidle;
>
> -       /* red and rio related info */
> +       /* codel, red and rio related info */
>         int             qtype;
>         struct redstats red[3];
> +       struct codel_stats codel;
>  } class_stats_t;
>
>  #ifdef ALTQ3_COMPAT
>
> Modified: head/sys/net/altq/altq_classq.h
>
> ==============================================================================
> --- head/sys/net/altq/altq_classq.h     Fri Aug 21 21:47:29 2015
> (r287008)
> +++ head/sys/net/altq/altq_classq.h     Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -50,6 +50,7 @@ extern "C" {
>  #define        Q_RED           0x01
>  #define        Q_RIO           0x02
>  #define        Q_DROPTAIL      0x03
> +#define        Q_CODEL         0x04
>
>  #ifdef _KERNEL
>
> @@ -60,6 +61,7 @@ struct _class_queue_ {
>         struct mbuf     *tail_; /* Tail of packet queue */
>         int     qlen_;          /* Queue length (in number of packets) */
>         int     qlim_;          /* Queue limit (in number of packets*) */
> +       int     qsize_;         /* Queue size (in number of bytes*) */
>         int     qtype_;         /* Queue type */
>  };
>
> @@ -68,10 +70,12 @@ typedef struct _class_queue_        class_queue
>  #define        qtype(q)        (q)->qtype_             /* Get queue type
> */
>  #define        qlimit(q)       (q)->qlim_              /* Max packets to
> be queued */
>  #define        qlen(q)         (q)->qlen_              /* Current queue
> length. */
> +#define        qsize(q)        (q)->qsize_             /* Current queue
> size. */
>  #define        qtail(q)        (q)->tail_              /* Tail of the
> queue */
>  #define        qhead(q)        ((q)->tail_ ? (q)->tail_->m_nextpkt : NULL)
>
>  #define        qempty(q)       ((q)->qlen_ == 0)       /* Is the queue
> empty?? */
> +#define        q_is_codel(q)   ((q)->qtype_ == Q_CODEL) /* Is the queue a
> codel queue */
>  #define        q_is_red(q)     ((q)->qtype_ == Q_RED)  /* Is the queue a
> red queue */
>  #define        q_is_rio(q)     ((q)->qtype_ == Q_RIO)  /* Is the queue a
> rio queue */
>  #define        q_is_red_or_rio(q)      ((q)->qtype_ == Q_RED ||
> (q)->qtype_ == Q_RIO)
> @@ -101,6 +105,7 @@ _addq(class_queue_t *q, struct mbuf *m)
>         m0->m_nextpkt = m;
>         qtail(q) = m;
>         qlen(q)++;
> +       qsize(q) += m_pktlen(m);
>  }
>
>  static __inline struct mbuf *
> @@ -115,6 +120,7 @@ _getq(class_queue_t *q)
>         else
>                 qtail(q) = NULL;
>         qlen(q)--;
> +       qsize(q) -= m_pktlen(m0);
>         m0->m_nextpkt = NULL;
>         return (m0);
>  }
>
> Added: head/sys/net/altq/altq_codel.c
>
> ==============================================================================
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/net/altq/altq_codel.c      Fri Aug 21 22:02:22 2015
> (r287009)
> @@ -0,0 +1,477 @@
> +/*
> + * CoDel - The Controlled-Delay Active Queue Management algorithm
> + *
> + *  Copyright (C) 2013 Ermal Luci 
>

Can you correct my name?


> + *  Copyright (C) 2011-2012 Kathleen Nichols 
> + *  Copyright (C) 2011-2012 Van Jacobson 
> + *  Copyright (C) 2012 Michael D. Taht 
> + *  Copyright (C) 2012 Eric Dumazet 
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions, and the following disclaimer,
> + *    without modification.
> + * 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. The names of the authors may not be used to endorse or promote
> products
> + *    derived from this software without specific prior written
> permission.
> + *
> + * Alternatively, provided that this notice is retained in full, this
> + * software may be distributed under the terms of the GNU General
> + * Public License ("GPL") version 2, in which case the provisions of the
> + * GPL apply INSTEAD OF those given above.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER 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$
> + */
> +#include "opt_altq.h"
> +#include "opt_inet.h"
> +#include "opt_inet6.h"
> +
> +#ifdef ALTQ_CODEL  /* CoDel is enabled by ALTQ_CODEL option in opt_altq.h
> */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static int              codel_should_drop(struct codel *, class_queue_t *,
> +                           struct mbuf *, u_int64_t);
> +static void             codel_Newton_step(struct codel_vars *);
> +static u_int64_t        codel_control_law(u_int64_t t, u_int64_t,
> u_int32_t);
> +
> +#define        codel_time_after(a, b)          ((int64_t)(a) -
> (int64_t)(b) > 0)
> +#define        codel_time_after_eq(a, b)       ((int64_t)(a) -
> (int64_t)(b) >= 0)
> +#define        codel_time_before(a, b)         ((int64_t)(a) -
> (int64_t)(b) < 0)
> +#define        codel_time_before_eq(a, b)      ((int64_t)(a) -
> (int64_t)(b) <= 0)
> +
> +static int codel_request(struct ifaltq *, int, void *);
> +
> +static int codel_enqueue(struct ifaltq *, struct mbuf *, struct
> altq_pktattr *);
> +static struct mbuf *codel_dequeue(struct ifaltq *, int);
> +
> +int
> +codel_pfattach(struct pf_altq *a)
> +{
> +       struct ifnet *ifp;
> +
> +       if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL)
> +               return (EINVAL);
> +
> +       return (altq_attach(&ifp->if_snd, ALTQT_CODEL, a->altq_disc,
> +           codel_enqueue, codel_dequeue, codel_request, NULL, NULL));
> +}
> +
> +int
> +codel_add_altq(struct pf_altq *a)
> +{
> +       struct codel_if *cif;
> +       struct ifnet    *ifp;
> +       struct codel_opts       *opts;
> +
> +       if ((ifp = ifunit(a->ifname)) == NULL)
> +               return (EINVAL);
> +       if (!ALTQ_IS_READY(&ifp->if_snd))
> +               return (ENODEV);
> +
> +       opts = &a->pq_u.codel_opts;
> +
> +       cif = malloc(sizeof(struct codel_if), M_DEVBUF, M_NOWAIT | M_ZERO);
> +       if (cif == NULL)
> +               return (ENOMEM);
> +       cif->cif_bandwidth = a->ifbandwidth;
> +       cif->cif_ifq = &ifp->if_snd;
> +
> +       cif->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT |
> M_ZERO);
> +       if (cif->cl_q == NULL) {
> +               free(cif, M_DEVBUF);
> +               return (ENOMEM);
> +       }
> +
> +       if (a->qlimit == 0)
> +               a->qlimit = 50; /* use default. */
> +       qlimit(cif->cl_q) = a->qlimit;
> +       qtype(cif->cl_q) = Q_CODEL;
> +       qlen(cif->cl_q) = 0;
> +       qsize(cif->cl_q) = 0;
> +
> +       if (opts->target == 0)
> +               opts->target = 5;
> +       if (opts->interval == 0)
> +               opts->interval = 100;
> +       cif->codel.params.target = machclk_freq * opts->target / 1000;
> +       cif->codel.params.interval = machclk_freq * opts->interval / 1000;
> +       cif->codel.params.ecn = opts->ecn;
> +       cif->codel.stats.maxpacket = 256;
> +
> +       cif->cl_stats.qlength = qlen(cif->cl_q);
> +       cif->cl_stats.qlimit = qlimit(cif->cl_q);
> +
> +       /* keep the state in pf_altq */
> +       a->altq_disc = cif;
> +
> +       return (0);
> +}
> +
> +int
> +codel_remove_altq(struct pf_altq *a)
> +{
> +       struct codel_if *cif;
> +
> +       if ((cif = a->altq_disc) == NULL)
> +               return (EINVAL);
> +       a->altq_disc = NULL;
> +
> +       if (cif->cl_q)
> +               free(cif->cl_q, M_DEVBUF);
> +       free(cif, M_DEVBUF);
> +
> +       return (0);
> +}
> +
> +int
> +codel_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
> +{
> +       struct codel_if *cif;
> +       struct codel_ifstats stats;
> +       int error = 0;
> +
> +       if ((cif = altq_lookup(a->ifname, ALTQT_CODEL)) == NULL)
> +               return (EBADF);
> +
> +       if (*nbytes < sizeof(stats))
> +               return (EINVAL);
> +
> +       stats = cif->cl_stats;
> +       stats.stats = cif->codel.stats;
> +
> +       if ((error = copyout((caddr_t)&stats, ubuf, sizeof(stats))) != 0)
> +               return (error);
> +       *nbytes = sizeof(stats);
> +
> +       return (0);
> +}
> +
> +static int
> +codel_request(struct ifaltq *ifq, int req, void *arg)
> +{
> +       struct codel_if *cif = (struct codel_if *)ifq->altq_disc;
> +       struct mbuf *m;
> +
> +       IFQ_LOCK_ASSERT(ifq);
> +
> +       switch (req) {
> +       case ALTRQ_PURGE:
> +               if (!ALTQ_IS_ENABLED(cif->cif_ifq))
> +                       break;
> +
> +               if (qempty(cif->cl_q))
> +                       break;
> +
> +               while ((m = _getq(cif->cl_q)) != NULL) {
> +                       PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt,
> m_pktlen(m));
> +                       m_freem(m);
> +                       IFQ_DEC_LEN(cif->cif_ifq);
> +               }
> +               cif->cif_ifq->ifq_len = 0;
> +               break;
> +       }
> +
> +       return (0);
> +}
> +
> +static int
> +codel_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr
> *pktattr)
> +{
> +
> +       struct codel_if *cif = (struct codel_if *) ifq->altq_disc;
> +
> +       IFQ_LOCK_ASSERT(ifq);
> +
> +       /* grab class set by classifier */
> +       if ((m->m_flags & M_PKTHDR) == 0) {
> +               /* should not happen */
> +               printf("altq: packet for %s does not have pkthdr\n",
> +                  ifq->altq_ifp->if_xname);
> +               m_freem(m);
> +               PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt, m_pktlen(m));
> +               return (ENOBUFS);
> +       }
> +
> +       if (codel_addq(&cif->codel, cif->cl_q, m)) {
> +               PKTCNTR_ADD(&cif->cl_stats.cl_dropcnt, m_pktlen(m));
> +               return (ENOBUFS);
> +       }
> +       IFQ_INC_LEN(ifq);
> +
> +       return (0);
> +}
> +
> +static struct mbuf *
> +codel_dequeue(struct ifaltq *ifq, int op)
> +{
> +       struct codel_if *cif = (struct codel_if *)ifq->altq_disc;
> +       struct mbuf *m;
> +
> +       IFQ_LOCK_ASSERT(ifq);
> +
> +       if (IFQ_IS_EMPTY(ifq))
> +               return (NULL);
> +
> +       if (op == ALTDQ_POLL)
> +               return (qhead(cif->cl_q));
> +
> +
> +       m = codel_getq(&cif->codel, cif->cl_q);
> +       if (m != NULL) {
> +               IFQ_DEC_LEN(ifq);
> +               PKTCNTR_ADD(&cif->cl_stats.cl_xmitcnt, m_pktlen(m));
> +               return (m);
> +       }
> +
> +       return (NULL);
> +}
> +
> +struct codel *
> +codel_alloc(int target, int interval, int ecn)
> +{
> +       struct codel *c;
> +
> +       c = malloc(sizeof(*c), M_DEVBUF, M_NOWAIT | M_ZERO);
> +       if (c != NULL) {
> +               c->params.target = machclk_freq * target / 1000;
> +               c->params.interval = machclk_freq * interval / 1000;
> +               c->params.ecn = ecn;
> +               c->stats.maxpacket = 256;
> +       }
> +
> +       return (c);
> +}
> +
> +void
> +codel_destroy(struct codel *c)
> +{
> +
> +       free(c, M_DEVBUF);
> +}
> +
> +#define        MTAG_CODEL      1438031249
> +int
> +codel_addq(struct codel *c, class_queue_t *q, struct mbuf *m)
> +{
> +       struct m_tag *mtag;
> +       uint64_t *enqueue_time;
> +
> +       if (qlen(q) < qlimit(q)) {
> +               mtag = m_tag_locate(m, MTAG_CODEL, 0, NULL);
> +               if (mtag == NULL)
> +                       mtag = m_tag_alloc(MTAG_CODEL, 0, sizeof(uint64_t),
> +                           M_NOWAIT);
> +               if (mtag == NULL) {
> +                       m_freem(m);
> +                       return (-1);
> +               }
> +               enqueue_time = (uint64_t *)(mtag + 1);
> +               *enqueue_time = read_machclk();
> +               m_tag_prepend(m, mtag);
> +               _addq(q, m);
> +               return (0);
> +       }
> +       c->drop_overlimit++;
> +       m_freem(m);
> +
> +       return (-1);
> +}
> +
> +static int
> +codel_should_drop(struct codel *c, class_queue_t *q, struct mbuf *m,
> +    u_int64_t now)
> +{
> +       struct m_tag *mtag;
> +       uint64_t *enqueue_time;
> +
> +       if (m == NULL) {
> +               c->vars.first_above_time = 0;
> +               return (0);
> +       }
> +
> +       mtag = m_tag_locate(m, MTAG_CODEL, 0, NULL);
> +       if (mtag == NULL) {
> +               /* Only one warning per second. */
> +               if (ppsratecheck(&c->last_log, &c->last_pps, 1))
> +                       printf("%s: could not found the packet mtag!\n",
> +                           __func__);
> +               c->vars.first_above_time = 0;
> +               return (0);
> +       }
> +       enqueue_time = (uint64_t *)(mtag + 1);
> +       c->vars.ldelay = now - *enqueue_time;
> +       c->stats.maxpacket = MAX(c->stats.maxpacket, m_pktlen(m));
> +
> +       if (codel_time_before(c->vars.ldelay, c->params.target) ||
> +           qsize(q) <= c->stats.maxpacket) {
> +               /* went below - stay below for at least interval */
> +               c->vars.first_above_time = 0;
> +               return (0);
> +       }
> +       if (c->vars.first_above_time == 0) {
> +               /* just went above from below. If we stay above
> +                * for at least interval we'll say it's ok to drop
> +                */
> +               c->vars.first_above_time = now + c->params.interval;
> +               return (0);
> +       }
> +       if (codel_time_after(now, c->vars.first_above_time))
> +               return (1);
> +
> +       return (0);
> +}
> +
> +/*
> + * Run a Newton method step:
> + * new_invsqrt = (invsqrt / 2) * (3 - count * invsqrt^2)
> + *
> + * Here, invsqrt is a fixed point number (< 1.0), 32bit mantissa, aka
> Q0.32
> + */
> +static void
> +codel_Newton_step(struct codel_vars *vars)
> +{
> +       uint32_t invsqrt, invsqrt2;
> +       uint64_t val;
> +
> +/* sizeof_in_bits(rec_inv_sqrt) */
> +#define        REC_INV_SQRT_BITS (8 * sizeof(u_int16_t))
> +/* needed shift to get a Q0.32 number from rec_inv_sqrt */
> +#define        REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS)
> +
> +       invsqrt = ((u_int32_t)vars->rec_inv_sqrt) << REC_INV_SQRT_SHIFT;
> +       invsqrt2 = ((u_int64_t)invsqrt * invsqrt) >> 32;
> +       val = (3LL << 32) - ((u_int64_t)vars->count * invsqrt2);
> +       val >>= 2; /* avoid overflow in following multiply */
> +       val = (val * invsqrt) >> (32 - 2 + 1);
> +
> +       vars->rec_inv_sqrt = val >> REC_INV_SQRT_SHIFT;
> +}
> +
> +static u_int64_t
> +codel_control_law(u_int64_t t, u_int64_t interval, u_int32_t rec_inv_sqrt)
> +{
> +
> +       return (t + (u_int32_t)(((u_int64_t)interval *
> +           (rec_inv_sqrt << REC_INV_SQRT_SHIFT)) >> 32));
> +}
> +
> +struct mbuf *
> +codel_getq(struct codel *c, class_queue_t *q)
> +{
> +       struct mbuf     *m;
> +       u_int64_t        now;
> +       int              drop;
> +
> +       if ((m = _getq(q)) == NULL) {
> +               c->vars.dropping = 0;
> +               return (m);
> +       }
> +
> +       now = read_machclk();
> +       drop = codel_should_drop(c, q, m, now);
> +       if (c->vars.dropping) {
> +               if (!drop) {
> +                       /* sojourn time below target - leave dropping
> state */
> +                       c->vars.dropping = 0;
> +               } else if (codel_time_after_eq(now, c->vars.drop_next)) {
> +                       /* It's time for the next drop. Drop the current
> +                        * packet and dequeue the next. The dequeue might
> +                        * take us out of dropping state.
> +                        * If not, schedule the next drop.
> +                        * A large backlog might result in drop rates so
> high
> +                        * that the next drop should happen now,
> +                        * hence the while loop.
> +                        */
> +                       while (c->vars.dropping &&
> +                           codel_time_after_eq(now, c->vars.drop_next)) {
> +                               c->vars.count++; /* don't care of possible
> wrap
> +                                                 * since there is no more
> +                                                 * divide */
> +                               codel_Newton_step(&c->vars);
> +                               /* TODO ECN */
> +                               PKTCNTR_ADD(&c->stats.drop_cnt,
> m_pktlen(m));
> +                               m_freem(m);
> +                               m = _getq(q);
> +                               if (!codel_should_drop(c, q, m, now))
>
> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>
>


-- 
Ermal

From owner-svn-src-head@freebsd.org  Sat Aug 22 12:59:09 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C36D9BD0EB;
 Sat, 22 Aug 2015 12:59:09 +0000 (UTC)
 (envelope-from markm@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3AE913A6;
 Sat, 22 Aug 2015 12:59:09 +0000 (UTC)
 (envelope-from markm@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.70])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7MCx9Br093714;
 Sat, 22 Aug 2015 12:59:09 GMT (envelope-from markm@FreeBSD.org)
Received: (from markm@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7MCx6bn093702;
 Sat, 22 Aug 2015 12:59:06 GMT (envelope-from markm@FreeBSD.org)
Message-Id: <201508221259.t7MCx6bn093702@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markm set sender to
 markm@FreeBSD.org using -f
From: Mark Murray 
Date: Sat, 22 Aug 2015 12:59:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r287023 - in head: share/man/man4 sys/conf sys/dev/random
 sys/sys sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 12:59:09 -0000

Author: markm
Date: Sat Aug 22 12:59:05 2015
New Revision: 287023
URL: https://svnweb.freebsd.org/changeset/base/287023

Log:
  Make the UMA harvesting go away completely if not wanted. Default to "not wanted".
  Provide and document the RANDOM_ENABLE_UMA option.
  
  Change RANDOM_FAST to RANDOM_UMA to clarify the harvesting.
  
  Remove RANDOM_DEBUG option, replace with SDT probes. These will be of
  use to folks measuring the harvesting effect when deciding whether to
  use RANDOM_ENABLE_UMA.
  
  Requested by:	scottl and others.
  Approved by:	so (/dev/random blanket)
  Differential Revision:    https://reviews.freebsd.org/D3197

Modified:
  head/share/man/man4/random.4
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/random/build.sh
  head/sys/dev/random/fortuna.c
  head/sys/dev/random/random_harvestq.c
  head/sys/dev/random/unit_test.c
  head/sys/dev/random/yarrow.c
  head/sys/sys/random.h
  head/sys/vm/uma_core.c

Modified: head/share/man/man4/random.4
==============================================================================
--- head/share/man/man4/random.4	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/share/man/man4/random.4	Sat Aug 22 12:59:05 2015	(r287023)
@@ -32,6 +32,7 @@
 .Sh SYNOPSIS
 .Cd "device random"
 .Cd "options RANDOM_LOADABLE"
+.Cd "options RANDOM_ENABLE_UMA"
 .Sh DESCRIPTION
 The
 .Nm
@@ -177,6 +178,24 @@ must be locked against
 load and unload events,
 and also must be indirect calls
 to allow for removal.
+.Pp
+When
+.Cd "options RANDOM_ENABLE_UMA"
+is used,
+the
+.Pa /dev/random
+device will obtain entropy
+from the zone allocator.
+This is potentially very high rate,
+and if so will be of questionable use.
+If this is the case,
+use of this option
+is not recommended.
+Determining this is not trivial,
+so experimenting and measurement
+using tools such as
+.Xr dtrace 1
+will be required.
 .Sh RANDOMNESS
 The use of randomness in the field of computing
 is a rather subtle issue because randomness means

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/conf/NOTES	Sat Aug 22 12:59:05 2015	(r287023)
@@ -2985,8 +2985,10 @@ options 	MAXFILES=999
 #options 	RANDOM_YARROW	# Yarrow CSPRNG (old default)
 #options 	RANDOM_LOADABLE	# Allow the algorithm to be loaded as
 				# a module.
-# For developers.
-options 	RANDOM_DEBUG	# Extra debugging messages
+# Select this to allow high-rate but potentially expensive
+# harvesting of Slab-Allocator entropy. In very high-rate
+# situations the value of doing this is dubious at best.
+options 	RANDOM_ENABLE_UMA	# slab allocator
 
 # Module to enable execution of application via emulators like QEMU
 options         IMAGACT_BINMISC

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/conf/options	Sat Aug 22 12:59:05 2015	(r287023)
@@ -945,17 +945,16 @@ RACCT_DEFAULT_TO_DISABLED	opt_global.h
 RCTL		opt_global.h
 
 # Random number generator(s)
-# The DEBUG option is in global.h as the random harvesting
-# puts probes all over the place, and it makes little sense
-# to pollute these headers with an extra include.
-RANDOM_DEBUG	opt_random.h
-# Which CSPRNG hashes we get.
+# Which CSPRNG hash we get.
 # If Yarrow is not chosen, Fortuna is selected.
 RANDOM_YARROW	opt_random.h
 # With this, no entropy processor is loaded, but the entropy
 # harvesting infrastructure is present. This means an entropy
 # processor may be loaded as a module.
 RANDOM_LOADABLE	opt_random.h
+# This turns on high-rate and potentially expensive harvesting in
+# the uma slab allocator.
+RANDOM_ENABLE_UMA	opt_global.h
 
 # Intel em(4) driver
 EM_MULTIQUEUE	opt_em.h

Modified: head/sys/dev/random/build.sh
==============================================================================
--- head/sys/dev/random/build.sh	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/dev/random/build.sh	Sat Aug 22 12:59:05 2015	(r287023)
@@ -35,7 +35,7 @@
 #              <(sed -e 's/fortuna/wombat/g' \
 #                    -e 's/FORTUNA/WOMBAT/g' fortuna.c) | less
 #
-cc -g -O0 -pthread -DRANDOM_DEBUG \
+cc -g -O0 -pthread \
 	-I../.. -lstdthreads -Wall \
 	unit_test.c \
 	yarrow.c \
@@ -46,7 +46,7 @@ cc -g -O0 -pthread -DRANDOM_DEBUG \
 	../../crypto/sha2/sha256c.c \
 	-lz \
 	-o yunit_test
-cc -g -O0 -pthread -DRANDOM_DEBUG \
+cc -g -O0 -pthread \
 	-I../.. -lstdthreads -Wall \
 	unit_test.c \
 	fortuna.c \

Modified: head/sys/dev/random/fortuna.c
==============================================================================
--- head/sys/dev/random/fortuna.c	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/dev/random/fortuna.c	Sat Aug 22 12:59:05 2015	(r287023)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -94,6 +95,11 @@ CTASSERT(RANDOM_FORTUNA_DEFPOOLSIZE <= R
 CTASSERT(RANDOM_BLOCKSIZE == sizeof(uint128_t));
 CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE);
 
+/* Probes for dtrace(1) */
+SDT_PROVIDER_DECLARE(random);
+SDT_PROVIDER_DEFINE(random);
+SDT_PROBE_DEFINE2(random, fortuna, event_processor, debug, "u_int", "struct fs_pool *");
+
 /*
  * This is the beastie that needs protecting. It contains all of the
  * state that we are excited about. Exactly one is instantiated.
@@ -379,16 +385,7 @@ random_fortuna_pre_read(void)
 			} else
 				break;
 		}
-#ifdef RANDOM_DEBUG
-		{
-			u_int j;
-
-			printf("random: reseedcount [%d]", fortuna_state.fs_reseedcount);
-			for (j = 0; j < RANDOM_FORTUNA_NPOOLS; j++)
-				printf(" %X", fortuna_state.fs_pool[j].fsp_length);
-			printf("\n");
-		}
-#endif
+		SDT_PROBE2(random, fortuna, event_processor, debug, fortuna_state.fs_reseedcount, fortuna_state.fs_pool);
 		/* FS&K */
 		random_fortuna_reseed_internal(s, i < RANDOM_FORTUNA_NPOOLS ? i + 1 : RANDOM_FORTUNA_NPOOLS);
 		/* Clean up and secure */

Modified: head/sys/dev/random/random_harvestq.c
==============================================================================
--- head/sys/dev/random/random_harvestq.c	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/dev/random/random_harvestq.c	Sat Aug 22 12:59:05 2015	(r287023)
@@ -170,7 +170,7 @@ random_kthread(void)
 		/* XXX: FIX!! Increase the high-performance data rate? Need some measurements first. */
 		for (i = 0; i < RANDOM_ACCUM_MAX; i++) {
 			if (harvest_context.hc_entropy_fast_accumulator.buf[i]) {
-				random_harvest_direct(harvest_context.hc_entropy_fast_accumulator.buf + i, sizeof(harvest_context.hc_entropy_fast_accumulator.buf[0]), 4, RANDOM_FAST);
+				random_harvest_direct(harvest_context.hc_entropy_fast_accumulator.buf + i, sizeof(harvest_context.hc_entropy_fast_accumulator.buf[0]), 4, RANDOM_UMA);
 				harvest_context.hc_entropy_fast_accumulator.buf[i] = 0;
 			}
 		}
@@ -261,7 +261,7 @@ static const char *(random_source_descr[
 	"INTERRUPT",
 	"SWI",
 	"FS_ATIME",
-	"HIGH_PERFORMANCE", /* ENVIRONMENTAL_END */
+	"UMA", /* ENVIRONMENTAL_END */
 	"PURE_OCTEON",
 	"PURE_SAFE",
 	"PURE_GLXSB",

Modified: head/sys/dev/random/unit_test.c
==============================================================================
--- head/sys/dev/random/unit_test.c	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/dev/random/unit_test.c	Sat Aug 22 12:59:05 2015	(r287023)
@@ -29,7 +29,7 @@
 /*
  Build this by going:
 
-cc -g -O0 -pthread -DRANDOM_ -DRANDOM_DEBUG -I../.. -lstdthreads -Wall \
+cc -g -O0 -pthread -DRANDOM_ -I../.. -lstdthreads -Wall \
 	unit_test.c \
 	yarrow.c \
 	fortuna.c \

Modified: head/sys/dev/random/yarrow.c
==============================================================================
--- head/sys/dev/random/yarrow.c	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/dev/random/yarrow.c	Sat Aug 22 12:59:05 2015	(r287023)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -77,6 +78,11 @@ __FBSDID("$FreeBSD$");
 CTASSERT(RANDOM_BLOCKSIZE == sizeof(uint128_t));
 CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE);
 
+/* Probes for dtrace(1) */
+SDT_PROVIDER_DECLARE(random);
+SDT_PROVIDER_DEFINE(random);
+SDT_PROBE_DEFINE3(random, yarrow, event_processor, debug, "boolean", "u_int", "struct ys_pool *");
+
 /*
  * This is the beastie that needs protecting. It contains all of the
  * state that we are excited about. Exactly one is instantiated.
@@ -261,20 +267,7 @@ random_yarrow_reseed_internal(u_int fast
 	KASSERT(yarrow_state.ys_pool[RANDOM_YARROW_FAST].ysp_thresh > 0, ("random: Yarrow fast threshold = 0"));
 	KASSERT(yarrow_state.ys_pool[RANDOM_YARROW_SLOW].ysp_thresh > 0, ("random: Yarrow slow threshold = 0"));
 	RANDOM_RESEED_ASSERT_LOCK_OWNED();
-#ifdef RANDOM_DEBUG
-	/* WARNING! This is dangerously tedious to do with mutexes held! */
-	printf("random: %s ", __func__);
-	printf("type/pool = %s ", fastslow == RANDOM_YARROW_FAST ? "RANDOM_YARROW_FAST" : "RANDOM_YARROW_SLOW");
-	printf("seeded = %s\n", yarrow_state.ys_seeded ? "true" : "false");
-	printf("random: fast - thresh %d,1 - ", yarrow_state.ys_pool[RANDOM_YARROW_FAST].ysp_thresh);
-	for (i = RANDOM_START; i < ENTROPYSOURCE; i++)
-		printf(" %d", yarrow_state.ys_pool[RANDOM_YARROW_FAST].ysp_source_bits[i]);
-	printf("\n");
-	printf("random: slow - thresh %d,%d - ", yarrow_state.ys_pool[RANDOM_YARROW_SLOW].ysp_thresh, yarrow_state.ys_slowoverthresh);
-	for (i = RANDOM_START; i < ENTROPYSOURCE; i++)
-		printf(" %d", yarrow_state.ys_pool[RANDOM_YARROW_SLOW].ysp_source_bits[i]);
-	printf("\n");
-#endif
+	SDT_PROBE3(random, yarrow, event_processor, debug, yarrow_state.ys_seeded, yarrow_state.ys_slowoverthresh, yarrow_state.ys_pool);
 	/* 1. Hash the accumulated entropy into v[0] */
 	randomdev_hash_init(&context);
 	/* Feed the slow pool hash in if slow */

Modified: head/sys/sys/random.h
==============================================================================
--- head/sys/sys/random.h	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/sys/random.h	Sat Aug 22 12:59:05 2015	(r287023)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2000-2013 Mark R. V. Murray
+ * Copyright (c) 2000-2015 Mark R. V. Murray
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,9 +35,11 @@
 
 #include "opt_random.h"
 
+#if !defined(KLD_MODULE)
 #if defined(RANDOM_LOADABLE) && defined(RANDOM_YARROW)
 #error "Cannot define both RANDOM_LOADABLE and RANDOM_YARROW"
 #endif
+#endif
 
 struct uio;
 
@@ -78,8 +80,8 @@ enum random_entropy_source {
 	RANDOM_INTERRUPT,
 	RANDOM_SWI,
 	RANDOM_FS_ATIME,
-	RANDOM_FAST,	/* Special!! Miscellaneous high performance stuff, like UMA/SLAB Allocator */
-	RANDOM_ENVIRONMENTAL_END = RANDOM_FAST,
+	RANDOM_UMA,	/* Special!! UMA/SLAB Allocator */
+	RANDOM_ENVIRONMENTAL_END = RANDOM_UMA,
 	/* Fast hardware random-number sources from here on. */
 	RANDOM_PURE_OCTEON,
 	RANDOM_PURE_SAFE,
@@ -105,6 +107,12 @@ void random_harvest_direct(const void *,
 #define random_harvest_direct(a, b, c, d) do {} while (0)
 #endif
 
+#if defined(RANDOM_ENABLE_UMA)
+#define random_harvest_fast_uma(a, b, c, d)	random_harvest_fast(a, b, c, d)
+#else /* !defined(RANDOM_ENABLE_UMA) */
+#define random_harvest_fast_uma(a, b, c, d)	do {} while (0)
+#endif /* defined(RANDOM_ENABLE_UMA) */
+
 #endif /* _KERNEL */
 
 #endif /* _SYS_RANDOM_H_ */

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Sat Aug 22 07:45:49 2015	(r287022)
+++ head/sys/vm/uma_core.c	Sat Aug 22 12:59:05 2015	(r287023)
@@ -2135,8 +2135,8 @@ uma_zalloc_arg(uma_zone_t zone, void *ud
 	int lockfail;
 	int cpu;
 
-	/* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */
-	random_harvest_fast(&zone, sizeof(zone), 1, RANDOM_FAST);
+	/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */
+	random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA);
 
 	/* This is the fast path allocation */
 #ifdef UMA_DEBUG_ALLOC_1
@@ -2677,8 +2677,8 @@ uma_zfree_arg(uma_zone_t zone, void *ite
 	int lockfail;
 	int cpu;
 
-	/* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */
-	random_harvest_fast(&zone, sizeof(zone), 1, RANDOM_FAST);
+	/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */
+	random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA);
 
 #ifdef UMA_DEBUG_ALLOC_1
 	printf("Freeing item %p to %s(%p)\n", item, zone->uz_name, zone);

From owner-svn-src-head@freebsd.org  Sat Aug 22 15:58:36 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A23449BF1E2;
 Sat, 22 Aug 2015 15:58:36 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 93BA81472;
 Sat, 22 Aug 2015 15:58:36 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.70])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7MFwaFj076082;
 Sat, 22 Aug 2015 15:58:36 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7MFwaug076081;
 Sat, 22 Aug 2015 15:58:36 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201508221558.t7MFwaug076081@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Sat, 22 Aug 2015 15:58:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r287025 - head/sys/cam/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.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 15:58:36 -0000

Author: mav
Date: Sat Aug 22 15:58:35 2015
New Revision: 287025
URL: https://svnweb.freebsd.org/changeset/base/287025

Log:
  Remove some code duplication by using biofinish().
  
  Submitted by:	imp
  MFC after:	1 week

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sat Aug 22 15:36:20 2015	(r287024)
+++ head/sys/cam/ata/ata_da.c	Sat Aug 22 15:58:35 2015	(r287025)
@@ -1542,9 +1542,7 @@ adastart(struct cam_periph *periph, unio
 			} else {
 				/* This can happen if DMA was disabled. */
 				bioq_remove(&softc->trim_queue, bp);
-				bp->bio_error = EOPNOTSUPP;
-				bp->bio_flags |= BIO_ERROR;
-				biodone(bp);
+				biofinish(bp, NULL, EOPNOTSUPP);
 				xpt_release_ccb(start_ccb);
 				adaschedule(periph);
 				return;
@@ -1609,9 +1607,7 @@ adastart(struct cam_periph *periph, unio
 				}
 			}
 			if (fail) {
-				bp->bio_error = EIO;
-				bp->bio_flags |= BIO_ERROR;
-				biodone(bp);
+				biofinish(bp, NULL, EIO);
 				xpt_release_ccb(start_ccb);
 				adaschedule(periph);
 				return;

From owner-svn-src-head@freebsd.org  Sat Aug 22 16:46:01 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC9BB9BFAB1
 for ;
 Sat, 22 Aug 2015 16:46:00 +0000 (UTC)
 (envelope-from nobody@ws1.emirates.net.ae)
Received: from dsrmail2.emirates.net.ae (dsrmail2.emirates.net.ae
 [194.170.201.252])
 by mx1.freebsd.org (Postfix) with ESMTP id 45AB8F0C
 for ; Sat, 22 Aug 2015 16:45:59 +0000 (UTC)
 (envelope-from nobody@ws1.emirates.net.ae)
Received: from ws1.emirates.net.ae ([194.170.187.5])
 by dsrmail2.emirates.net.ae (I&ES Mail Server 4.2)
 with ESMTP id <0NTH007X8T8EWS10@dsrmail2.emirates.net.ae> for
 svn-src-head@freebsd.org; Sat, 22 Aug 2015 20:45:50 +0400 (GST)
Received: from ws1.emirates.net.ae (localhost [127.0.0.1])
 by ws1.emirates.net.ae (8.14.5+Sun/8.14.5) with ESMTP id t7MGjoK7013249	for
 ; Sat, 22 Aug 2015 20:45:50 +0400 (GST)
Received: (from nobody@localhost)
 by ws1.emirates.net.ae (8.14.5+Sun/8.14.5/Submit) id t7MGjnNU013214;	Sat,
 22 Aug 2015 20:45:49 +0400 (GST)
To: svn-src-head@freebsd.org
Subject: Problems with item delivery, n.000733353
Date: Sat, 22 Aug 2015 20:45:49 +0400
From: FedEx 2Day 
Reply-to: FedEx 2Day 
Message-id: <3ddbf67f78a292166e57cfd2b7795d57@wmc-e.ae>
X-Priority: 3
MIME-version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Content-Filtered-By: Mailman/MimeDel 2.1.20
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 16:46:01 -0000

Dear Customer,

This is to confirm that one or more of your parcels has been shipped.
Please, open email attachment to print shipment label.

Thank you for choosing FedEx,
Jim Howard,
Sr. Support Agent.


From owner-svn-src-head@freebsd.org  Sat Aug 22 18:46:52 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5B9D9BFF5F;
 Sat, 22 Aug 2015 18:46:51 +0000 (UTC)
 (envelope-from jmg@gold.funkthat.com)
Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id BE773B97;
 Sat, 22 Aug 2015 18:46:51 +0000 (UTC)
 (envelope-from jmg@gold.funkthat.com)
Received: from gold.funkthat.com (localhost [127.0.0.1])
 by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t7MIkoLu086876
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Sat, 22 Aug 2015 11:46:50 -0700 (PDT)
 (envelope-from jmg@gold.funkthat.com)
Received: (from jmg@localhost)
 by gold.funkthat.com (8.14.5/8.14.5/Submit) id t7MIkmx6086875;
 Sat, 22 Aug 2015 11:46:48 -0700 (PDT) (envelope-from jmg)
Date: Sat, 22 Aug 2015 11:46:48 -0700
From: John-Mark Gurney 
To: Hans Petter Selasky 
Cc: Ed Schouten , Bruce Evans ,
 src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r286170 - head/share/man/man9
Message-ID: <20150822184647.GF33167@funkthat.com>
References: <201508020022.t720MFqp023071@repo.freebsd.org>
 <20150802145434.V1128@besplex.bde.org>
 
 <55C09869.2040605@selasky.org>
 <20150804171051.GL78154@funkthat.com>
 <55D6C291.2080606@selasky.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <55D6C291.2080606@selasky.org>
X-Operating-System: FreeBSD 9.1-PRERELEASE amd64
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-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
 (gold.funkthat.com [127.0.0.1]); Sat, 22 Aug 2015 11:46:50 -0700 (PDT)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 18:46:52 -0000

Hans Petter Selasky wrote this message on Fri, Aug 21, 2015 at 08:17 +0200:
> On 08/04/15 19:10, John-Mark Gurney wrote:
> > Hans Petter Selasky wrote this message on Tue, Aug 04, 2015 at 12:48 +0200:
> >> My gut feeling is it's good practice to have those wrapper macros
> >> because they isolate the compiler into a consistent and coherent API.
> >
> > Except that we now have a consistent and coherent API w/
> > _Static_assert...  We emulate this function on all compilers (or at least
> > try to, see bde's other email about issues w/ the ifdef mess), and
> > is available to both userland and kernel...  It will also be available
> > on other platforms, as opposed to having to port our CTASSERT macros
> > to other platforms and introduce #ifdef's to make it compatible...
> >
> >> Wouldn't the argument be the same for queue.3 . Once C-compilers finally
> >> decide to compile time support queues, we should throw queue.3 aswell?
> >> I'd say it is better to stay independent of what the compiler guys will
> >> come up with next, reminding me how hard it was to upgrade a machine
> >> recently from 9- to 10- because of C++11 ....
> >
> > Last I checked, they don't change their API's ever revision of the
> > langauge...
> >
> > Comparing this to C++11?  Just wow, see above how this is properly
> > covered by the ifdef mess in sys/cdefs.h for all compilers, this won't
> > introduce any complications like the C++11...
> 
> Here is one more argument against using "_Static_assert()":
> 
> According to "http://en.cppreference.com/w/c/language/_Static_assert" 
> _Static_assert is C11 syntax only, and we compile the kernel using 
> "-std=iso9899:1999" according to "conf/kern.mk:CFLAGS" in -current. So 
> technically it shouldn't work, and it throws up compile errors with 
> certain other C tools I'm using at work which are more strict than clang.
> 
> Any comments?

As stated before, cdefs.h provides glue for support for pre-C11
compilers, so I don't see a problem...  Do you have documented cases
of the glue not working on pre-C11 compilers?

-- 
  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  Sat Aug 22 22:34:52 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB06F9BF464;
 Sat, 22 Aug 2015 22:34:52 +0000 (UTC)
 (envelope-from loos.br@gmail.com)
Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com
 [IPv6:2a00:1450:4010:c03::22e])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 71DB56C1;
 Sat, 22 Aug 2015 22:34:52 +0000 (UTC)
 (envelope-from loos.br@gmail.com)
Received: by laba3 with SMTP id a3so58782306lab.1;
 Sat, 22 Aug 2015 15:34:49 -0700 (PDT)
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:content-transfer-encoding;
 bh=xPCFxGcScqe+G6TIfhFfYq2OdFTdKRbr0oL2OMOMed8=;
 b=yx2wy/41lB58oOvEgv0rUdtwuX7Lt8Bnc41g4dd1qQrEEUJL3U+dFXwAoFZ0C/Ul/2
 A1z/ESzki7MXp1PwjqzzLhH3BGFP2kn9Q5CA6z6zPfuz06eMbSf2YXI4HSJHx9usRg0x
 nbAqhw8+uHIMrzFLx/4RalavnW7bd9QsdvknreCskbAGsi8/ylOjiO52bN7YqCePuTqo
 by+bek5z43GrFbN94+ZVwH7qWrm5qxYSaJAfXeahsF2VfXPXHTd0zGeglx+rUkSLVa3Z
 OwJ0NeGsWhfHCIJLpXvBRX6Del5F94zYQqz1t7imdfXtxeDYoElwaHGwNDe1LRoYDdMl
 vohg==
MIME-Version: 1.0
X-Received: by 10.112.167.202 with SMTP id zq10mr13737179lbb.69.1440282889473; 
 Sat, 22 Aug 2015 15:34:49 -0700 (PDT)
Received: by 10.112.12.234 with HTTP; Sat, 22 Aug 2015 15:34:49 -0700 (PDT)
In-Reply-To: 
References: <201508212202.t7LM2MhF015522@repo.freebsd.org>
 
Date: Sat, 22 Aug 2015 19:34:49 -0300
Message-ID: 
Subject: Re: svn commit: r287009 - in head: sbin/pfctl share/man/man4 sys/conf
 sys/net/altq sys/netpfil/pf
From: Luiz Otavio O Souza 
To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= 
Cc: Luiz Otavio O Souza ,
 src-committers , 
 svn-src-all , svn-src-head 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 22:34:53 -0000

On Sat, Aug 22, 2015 at 6:18 AM, Ermal Lu=C3=A7i wrote:
>
>
> On Sat, Aug 22, 2015 at 12:02 AM, Luiz Otavio O Souza
> wrote:
>>
>> Author: loos
>> Date: Fri Aug 21 22:02:22 2015
>> New Revision: 287009
>> URL: https://svnweb.freebsd.org/changeset/base/287009
>>
>> Log:
>>   Add ALTQ(9) support for the CoDel algorithm.
>>
>>   CoDel is a parameterless queue discipline that handles variable
>> bandwidth
>>   and RTT.
>>
>>   It can be used as the single queue discipline on an interface or as a
>> sub
>>   discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, FAIR=
Q.
>>
>>   Differential Revision:        https://reviews.freebsd.org/D3272
>>   Reviewd by:   rpaulo, gnn (previous version)
>
>
> I thought part of this commit message was taken from me as a reviewer, no=
?

Sorry Ermal, my bad. As you only commented and not accepted the review
I thought you don't want to be implied with a reviewed by.

[...]

>> Added: head/sys/net/altq/altq_codel.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
>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>> +++ head/sys/net/altq/altq_codel.c      Fri Aug 21 22:02:22 2015
>> (r287009)
>> @@ -0,0 +1,477 @@
>> +/*
>> + * CoDel - The Controlled-Delay Active Queue Management algorithm
>> + *
>> + *  Copyright (C) 2013 Ermal Luci 
>
>
> Can you correct my name?
>

Sure, I'll commit the fix soon (probably on monday) I'm AFK this weekend.

I really appreciate your work on Codel.

Regards,
Luiz

From owner-svn-src-head@freebsd.org  Sat Aug 22 23:09:21 2015
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470499BFA4F;
 Sat, 22 Aug 2015 23:09:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 350561262;
 Sat, 22 Aug 2015 23:09:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.70])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7MN9Lvm063366;
 Sat, 22 Aug 2015 23:09:21 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7MN9K5q063363;
 Sat, 22 Aug 2015 23:09:20 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201508222309.t7MN9K5q063363@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Sat, 22 Aug 2015 23:09:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r287028 - in head/tools/tools/nanobsd: . pcengines rescue
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 22 Aug 2015 23:09:21 -0000

Author: imp
Date: Sat Aug 22 23:09:19 2015
New Revision: 287028
URL: https://svnweb.freebsd.org/changeset/base/287028

Log:
  Remove cust_pkg() not that pkg_foo(1) has been removed.

Modified:
  head/tools/tools/nanobsd/defaults.sh   (contents, props changed)
  head/tools/tools/nanobsd/pcengines/common.conf
  head/tools/tools/nanobsd/rescue/common

Modified: head/tools/tools/nanobsd/defaults.sh
==============================================================================
--- head/tools/tools/nanobsd/defaults.sh	Sat Aug 22 21:35:35 2015	(r287027)
+++ head/tools/tools/nanobsd/defaults.sh	Sat Aug 22 23:09:19 2015	(r287028)
@@ -45,7 +45,7 @@ NANO_SRC=/usr/src
 # Where nanobsd additional files live under the source tree
 NANO_TOOLS=tools/tools/nanobsd
 
-# Where cust_pkg() finds packages to install
+# Where cust_pkgng() finds packages to install
 NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
 NANO_PACKAGE_LIST="*"
 
@@ -762,55 +762,6 @@ cust_install_files () (
 #######################################################################
 # Install packages from ${NANO_PACKAGE_DIR}
 
-cust_pkg () (
-
-	# If the package directory doesn't exist, we're done.
-	if [ ! -d ${NANO_PACKAGE_DIR} ]; then
-		echo "DONE 0 packages"
-		return 0
-	fi
-
-	# Copy packages into chroot
-	mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg
-	(
-		cd ${NANO_PACKAGE_DIR}
-		find ${NANO_PACKAGE_LIST} -print |
-		    cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
-	)
-
-	# Count & report how many we have to install
-	todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
-	echo "=== TODO: $todo"
-	ls ${NANO_WORLDDIR}/Pkg
-	echo "==="
-	while true
-	do
-		# Record how many we have now
-		have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l`
-
-		# Attempt to install more packages
-		# ...but no more than 200 at a time due to pkg_add's internal
-		# limitations.
-		CR0 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F'
-
-		# See what that got us
-		now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l`
-		echo "=== NOW $now"
-		ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg
-		echo "==="
-
-
-		if [ $now -eq $todo ] ; then
-			echo "DONE $now packages"
-			break
-		elif [ $now -eq $have ] ; then
-			echo "FAILED: Nothing happened on this pass"
-			exit 2
-		fi
-	done
-	nano_rm -rf ${NANO_WORLDDIR}/Pkg
-)
-
 cust_pkgng () (
 
 	# If the package directory doesn't exist, we're done.

Modified: head/tools/tools/nanobsd/pcengines/common.conf
==============================================================================
--- head/tools/tools/nanobsd/pcengines/common.conf	Sat Aug 22 21:35:35 2015	(r287027)
+++ head/tools/tools/nanobsd/pcengines/common.conf	Sat Aug 22 23:09:19 2015	(r287028)
@@ -66,7 +66,7 @@ cust_boot_cfg () (
   echo "hint.acpi.0.disabled=\"1\"" >> boot/loader.conf
 )
 customize_cmd cust_boot_cfg
-customize_cmd cust_pkg
+customize_cmd cust_pkgng
 cust_etc_cfg () (
   cd ${NANO_WORLDDIR}
   mkdir -pv z/scratch

Modified: head/tools/tools/nanobsd/rescue/common
==============================================================================
--- head/tools/tools/nanobsd/rescue/common	Sat Aug 22 21:35:35 2015	(r287027)
+++ head/tools/tools/nanobsd/rescue/common	Sat Aug 22 23:09:19 2015	(r287028)
@@ -65,7 +65,7 @@ customize_cmd cust_ld32_cfg
 #)
 #customize_cmd cust_boot_cfg
 
-customize_cmd cust_pkg
+customize_cmd cust_pkgng
 
 cust_etc_cfg () (
   cd ${NANO_WORLDDIR}