From owner-svn-src-head@freebsd.org Sun Jul 23 05:54:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B29C7D40E; Sun, 23 Jul 2017 05:54:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3E874FDD; Sun, 23 Jul 2017 05:54:56 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6N5su9P032379; Sun, 23 Jul 2017 05:54:56 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6N5su45032378; Sun, 23 Jul 2017 05:54:56 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707230554.v6N5su45032378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 23 Jul 2017 05:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321377 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 05:54:57 -0000 Author: alc Date: Sun Jul 23 05:54:56 2017 New Revision: 321377 URL: https://svnweb.freebsd.org/changeset/base/321377 Log: In vm_page_ps_test(), always check that the base pages within the specified superpage all belong to the same object. To date, that check has not been needed, but upcoming changes require it. (See the Differential Revision.) Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11556 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jul 22 21:29:44 2017 (r321376) +++ head/sys/vm/vm_page.c Sun Jul 23 05:54:56 2017 (r321377) @@ -3478,9 +3478,11 @@ vm_page_is_valid(vm_page_t m, int base, int size) bool vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m) { + vm_object_t object; int i, npages; - VM_OBJECT_ASSERT_LOCKED(m->object); + object = m->object; + VM_OBJECT_ASSERT_LOCKED(object); npages = atop(pagesizes[m->psind]); /* @@ -3489,6 +3491,9 @@ vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip * occupy adjacent entries in vm_page_array[]. */ for (i = 0; i < npages; i++) { + /* Always test object consistency, including "skip_m". */ + if (m[i].object != object) + return (false); if (&m[i] == skip_m) continue; if ((flags & PS_NONE_BUSY) != 0 && vm_page_busied(&m[i])) From owner-svn-src-head@freebsd.org Sun Jul 23 06:34:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A227C7DBCF; Sun, 23 Jul 2017 06:34:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16AD475D4D; Sun, 23 Jul 2017 06:34:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6N6XxD4048783; Sun, 23 Jul 2017 06:33:59 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6N6XxDN048780; Sun, 23 Jul 2017 06:33:59 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707230633.v6N6XxDN048780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 23 Jul 2017 06:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321378 - in head/sys: amd64/amd64 amd64/include vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include vm X-SVN-Commit-Revision: 321378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 06:34:00 -0000 Author: alc Date: Sun Jul 23 06:33:58 2017 New Revision: 321378 URL: https://svnweb.freebsd.org/changeset/base/321378 Log: Add support for pmap_enter(..., psind=1) to the amd64 pmap. In other words, add support for explicitly requesting that pmap_enter() create a 2MB page mapping. (Essentially, this feature allows the machine-independent layer to create superpage mappings preemptively, and not wait for automatic promotion to occur.) Export pmap_ps_enabled() to the machine-independent layer. Add a flag to pmap_pv_insert_pde() that specifies whether it should fail or reclaim a PV entry when one is not available. Refactor pmap_enter_pde() into two functions, one by the same name, that is a general-purpose function for creating PDE PG_PS mappings, and another, pmap_enter_2mpage(), that is used to prefault 2MB read- and/or execute-only mappings for execve(2), mmap(2), and shmat(2). Submitted by: Yufeng Zhou (an earlier version) Reviewed by: kib, markj Tested by: pho MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D11556 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/vm/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jul 23 05:54:56 2017 (r321377) +++ head/sys/amd64/amd64/pmap.c Sun Jul 23 06:33:58 2017 (r321378) @@ -582,6 +582,12 @@ pmap_delayed_invl_page(vm_page_t m) */ static caddr_t crashdumpmap; +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); @@ -591,8 +597,8 @@ static void reserve_pv_entries(pmap_t pmap, int needed struct rwlock **lockp); static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, struct rwlock **lockp); -static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, - struct rwlock **lockp); +static bool pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pde, + u_int flags, struct rwlock **lockp); static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, struct rwlock **lockp); static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); @@ -605,8 +611,10 @@ static boolean_t pmap_demote_pde_locked(pmap_t pmap, p vm_offset_t va, struct rwlock **lockp); static boolean_t pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va); -static boolean_t pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_prot_t prot, struct rwlock **lockp); +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, struct rwlock **lockp); +static int pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, + u_int flags, vm_page_t m, struct rwlock **lockp); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); @@ -1389,7 +1397,7 @@ pmap_cache_mask(pmap_t pmap, boolean_t is_pde) return (mask); } -static __inline boolean_t +bool pmap_ps_enabled(pmap_t pmap) { @@ -3393,27 +3401,30 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, } /* - * Conditionally create the PV entry for a 2MB page mapping if the required - * memory can be allocated without resorting to reclamation. + * Create the PV entry for a 2MB page mapping. Always returns true unless the + * flag PMAP_ENTER_NORECLAIM is specified. If that flag is specified, returns + * false if the PV entry cannot be allocated without resorting to reclamation. */ -static boolean_t -pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, +static bool +pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pde, u_int flags, struct rwlock **lockp) { struct md_page *pvh; pv_entry_t pv; + vm_paddr_t pa; PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* Pass NULL instead of the lock pointer to disable reclamation. */ - if ((pv = get_pv_entry(pmap, NULL)) != NULL) { - pv->pv_va = va; - CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); - pvh = pa_to_pvh(pa); - TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); - pvh->pv_gen++; - return (TRUE); - } else - return (FALSE); + if ((pv = get_pv_entry(pmap, (flags & PMAP_ENTER_NORECLAIM) != 0 ? + NULL : lockp)) == NULL) + return (false); + pv->pv_va = va; + pa = pde & PG_PS_FRAME; + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + pvh = pa_to_pvh(pa); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + return (true); } /* @@ -4323,7 +4334,7 @@ setpte: */ int pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - u_int flags, int8_t psind __unused) + u_int flags, int8_t psind) { struct rwlock *lock; pd_entry_t *pde; @@ -4351,6 +4362,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v ("pmap_enter: managed mapping within the clean submap")); if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) VM_OBJECT_ASSERT_LOCKED(m->object); + KASSERT((flags & PMAP_ENTER_RESERVED) == 0, + ("pmap_enter: flags %u has reserved bits set", flags)); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); if ((flags & VM_PROT_WRITE) != 0) @@ -4367,7 +4380,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v newpte |= PG_U; if (pmap == kernel_pmap) newpte |= PG_G; - newpte |= pmap_cache_bits(pmap, m->md.pat_mode, 0); + newpte |= pmap_cache_bits(pmap, m->md.pat_mode, psind > 0); /* * Set modified bit gratuitously for writeable mappings if @@ -4380,10 +4393,16 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v } else newpte |= PG_MANAGED; - mpte = NULL; - lock = NULL; PMAP_LOCK(pmap); + if (psind == 1) { + /* Assert the required virtual and physical alignment. */ + KASSERT((va & PDRMASK) == 0, ("pmap_enter: va unaligned")); + KASSERT(m->psind > 0, ("pmap_enter: m->psind < psind")); + rv = pmap_enter_pde(pmap, va, newpte | PG_PS, flags, m, &lock); + goto out; + } + mpte = NULL; /* * In the case that a page table page is not @@ -4543,48 +4562,118 @@ out: } /* - * Tries to create a 2MB page mapping. Returns TRUE if successful and FALSE - * otherwise. Fails if (1) a page table page cannot be allocated without - * blocking, (2) a mapping already exists at the specified virtual address, or - * (3) a pv entry cannot be allocated without reclaiming another pv entry. + * Tries to create a read- and/or execute-only 2MB page mapping. Returns true + * if successful. Returns false if (1) a page table page cannot be allocated + * without sleeping, (2) a mapping already exists at the specified virtual + * address, or (3) a PV entry cannot be allocated without reclaiming another + * PV entry. */ -static boolean_t -pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, +static bool +pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, struct rwlock **lockp) { - pd_entry_t *pde, newpde; + pd_entry_t newpde; pt_entry_t PG_V; - vm_page_t pdpg; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + PG_V = pmap_valid_bit(pmap); + newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) | + PG_PS | PG_V; + if ((m->oflags & VPO_UNMANAGED) == 0) + newpde |= PG_MANAGED; + if ((prot & VM_PROT_EXECUTE) == 0) + newpde |= pg_nx; + if (va < VM_MAXUSER_ADDRESS) + newpde |= PG_U; + return (pmap_enter_pde(pmap, va, newpde, PMAP_ENTER_NOSLEEP | + PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL, lockp) == + KERN_SUCCESS); +} + +/* + * Tries to create the specified 2MB page mapping. Returns KERN_SUCCESS if + * the mapping was created, and either KERN_FAILURE or KERN_RESOURCE_SHORTAGE + * otherwise. Returns KERN_FAILURE if PMAP_ENTER_NOREPLACE was specified and + * a mapping already exists at the specified virtual address. Returns + * KERN_RESOURCE_SHORTAGE if PMAP_ENTER_NOSLEEP was specified and a page table + * page allocation failed. Returns KERN_RESOURCE_SHORTAGE if + * PMAP_ENTER_NORECLAIM was specified and a PV entry allocation failed. + * + * The parameter "m" is only used when creating a managed, writeable mapping. + */ +static int +pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, + vm_page_t m, struct rwlock **lockp) +{ struct spglist free; + pd_entry_t oldpde, *pde; + pt_entry_t PG_G, PG_RW, PG_V; + vm_page_t mt, pdpg; + PG_G = pmap_global_bit(pmap); + PG_RW = pmap_rw_bit(pmap); + KASSERT((newpde & (pmap_modified_bit(pmap) | PG_RW)) != PG_RW, + ("pmap_enter_pde: newpde is missing PG_M")); PG_V = pmap_valid_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((pdpg = pmap_allocpde(pmap, va, NULL)) == NULL) { + if ((pdpg = pmap_allocpde(pmap, va, (flags & PMAP_ENTER_NOSLEEP) != 0 ? + NULL : lockp)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); - return (FALSE); + return (KERN_RESOURCE_SHORTAGE); } pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); pde = &pde[pmap_pde_index(va)]; - if ((*pde & PG_V) != 0) { + oldpde = *pde; + if ((oldpde & PG_V) != 0) { KASSERT(pdpg->wire_count > 1, ("pmap_enter_pde: pdpg's wire count is too low")); - pdpg->wire_count--; - CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" - " in pmap %p", va, pmap); - return (FALSE); + if ((flags & PMAP_ENTER_NOREPLACE) != 0) { + pdpg->wire_count--; + CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" + " in pmap %p", va, pmap); + return (KERN_FAILURE); + } + /* Break the existing mapping(s). */ + SLIST_INIT(&free); + if ((oldpde & PG_PS) != 0) { + /* + * The reference to the PD page that was acquired by + * pmap_allocpde() ensures that it won't be freed. + * However, if the PDE resulted from a promotion, then + * a reserved PT page could be freed. + */ + (void)pmap_remove_pde(pmap, pde, va, &free, lockp); + if ((oldpde & PG_G) == 0) + pmap_invalidate_pde_page(pmap, va, oldpde); + } else { + pmap_delayed_invl_started(); + if (pmap_remove_ptes(pmap, va, va + NBPDR, pde, &free, + lockp)) + pmap_invalidate_all(pmap); + pmap_delayed_invl_finished(); + } + pmap_free_zero_pages(&free); + if (va >= VM_MAXUSER_ADDRESS) { + mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); + if (pmap_insert_pt_page(pmap, mt)) { + /* + * XXX Currently, this can't happen because + * we do not perform pmap_enter(psind == 1) + * on the kernel pmap. + */ + panic("pmap_enter_pde: trie insert failed"); + } + } else + KASSERT(*pde == 0, ("pmap_enter_pde: non-zero pde %p", + pde)); } - newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) | - PG_PS | PG_V; - if ((m->oflags & VPO_UNMANAGED) == 0) { - newpde |= PG_MANAGED; - + if ((newpde & PG_MANAGED) != 0) { /* * Abort this mapping if its PV entry could not be created. */ - if (!pmap_pv_insert_pde(pmap, va, VM_PAGE_TO_PHYS(m), - lockp)) { + if (!pmap_pv_insert_pde(pmap, va, newpde, flags, lockp)) { SLIST_INIT(&free); if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { /* @@ -4598,17 +4687,19 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t } CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); - return (FALSE); + return (KERN_RESOURCE_SHORTAGE); } + if ((newpde & PG_RW) != 0) { + for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) + vm_page_aflag_set(mt, PGA_WRITEABLE); + } } - if ((prot & VM_PROT_EXECUTE) == 0) - newpde |= pg_nx; - if (va < VM_MAXUSER_ADDRESS) - newpde |= PG_U; /* * Increment counters. */ + if ((newpde & PG_W) != 0) + pmap->pm_stats.wired_count += NBPDR / PAGE_SIZE; pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); /* @@ -4620,7 +4711,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t atomic_add_long(&pmap_pde_mappings, 1); CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx" " in pmap %p", va, pmap); - return (TRUE); + return (KERN_SUCCESS); } /* @@ -4655,7 +4746,7 @@ pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_o va = start + ptoa(diff); if ((va & PDRMASK) == 0 && va + NBPDR <= end && m->psind == 1 && pmap_ps_enabled(pmap) && - pmap_enter_pde(pmap, va, m, prot, &lock)) + pmap_enter_2mpage(pmap, va, m, prot, &lock)) m = &m[NBPDR / PAGE_SIZE - 1]; else mpte = pmap_enter_quick_locked(pmap, va, m, prot, @@ -5088,8 +5179,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dst_pdpg)); pde = &pde[pmap_pde_index(addr)]; if (*pde == 0 && ((srcptepaddr & PG_MANAGED) == 0 || - pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr & - PG_PS_FRAME, &lock))) { + pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr, + PMAP_ENTER_NORECLAIM, &lock))) { *pde = srcptepaddr & ~PG_W; pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE); atomic_add_long(&pmap_pde_mappings, 1); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Sun Jul 23 05:54:56 2017 (r321377) +++ head/sys/amd64/include/pmap.h Sun Jul 23 06:33:58 2017 (r321378) @@ -408,6 +408,7 @@ void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); boolean_t pmap_page_is_mapped(vm_page_t m); void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); void pmap_pinit_pml4(vm_page_t); +bool pmap_ps_enabled(pmap_t pmap); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_invalidate_page(pmap_t, vm_offset_t); void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t); Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Sun Jul 23 05:54:56 2017 (r321377) +++ head/sys/vm/pmap.h Sun Jul 23 06:33:58 2017 (r321378) @@ -100,9 +100,11 @@ extern vm_offset_t kernel_vm_end; /* * Flags for pmap_enter(). The bits in the low-order byte are reserved * for the protection code (vm_prot_t) that describes the fault type. + * Bits 24 through 31 are reserved for the pmap's internal use. */ -#define PMAP_ENTER_NOSLEEP 0x0100 -#define PMAP_ENTER_WIRED 0x0200 +#define PMAP_ENTER_NOSLEEP 0x00000100 +#define PMAP_ENTER_WIRED 0x00000200 +#define PMAP_ENTER_RESERVED 0xFF000000 /* * Define the maximum number of machine-dependent reference bits that are From owner-svn-src-head@freebsd.org Sun Jul 23 07:02:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F663C7E45F; Sun, 23 Jul 2017 07:02:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C5BC76924; Sun, 23 Jul 2017 07:02:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6N72A7a060762; Sun, 23 Jul 2017 07:02:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6N72Asg060761; Sun, 23 Jul 2017 07:02:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707230702.v6N72Asg060761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 23 Jul 2017 07:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321379 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 321379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 07:02:11 -0000 Author: adrian Date: Sun Jul 23 07:02:10 2017 New Revision: 321379 URL: https://svnweb.freebsd.org/changeset/base/321379 Log: [ar933x] re-add the ar71xx_apb device for AR933x. This prevents the console from working! Tested: * carambola2, AR933x Modified: head/sys/mips/conf/std.AR933X Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Sun Jul 23 06:33:58 2017 (r321378) +++ head/sys/mips/conf/std.AR933X Sun Jul 23 07:02:10 2017 (r321379) @@ -33,6 +33,11 @@ options TCP_HHOOK # hhook(9) framework for TCP options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +# Enable boot time calibration hints +options AR71XX_ATH_EEPROM +device ar71xx_caldata +device firmware + # PMC options HWPMC_HOOKS @@ -61,5 +66,6 @@ device scbus device umass device da -device uart_ar933x +device ar71xx_apb +device uart_ar933x From owner-svn-src-head@freebsd.org Sun Jul 23 07:10:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69519C7E4F7; Sun, 23 Jul 2017 07:10:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C69476B00; Sun, 23 Jul 2017 07:10:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6N7AfT5061077; Sun, 23 Jul 2017 07:10:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6N7Af4T061075; Sun, 23 Jul 2017 07:10:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707230710.v6N7Af4T061075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 23 Jul 2017 07:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321380 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 321380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 07:10:42 -0000 Author: adrian Date: Sun Jul 23 07:10:41 2017 New Revision: 321380 URL: https://svnweb.freebsd.org/changeset/base/321380 Log: [ar933x] make carambola2 work again! * Add in the hints needed for AR933x ath(4) support - this is the nicer way that allows ath to be a module; * ATH_EEPROM_FIRMWARE is also required for all AR933x chipsets. Tested: * Carambola2, AR933x Modified: head/sys/mips/conf/CARAMBOLA2.hints head/sys/mips/conf/std.AR933X Modified: head/sys/mips/conf/CARAMBOLA2.hints ============================================================================== --- head/sys/mips/conf/CARAMBOLA2.hints Sun Jul 23 07:02:10 2017 (r321379) +++ head/sys/mips/conf/CARAMBOLA2.hints Sun Jul 23 07:10:41 2017 (r321380) @@ -31,10 +31,16 @@ hint.arge.1.media=1000 hint.arge.1.fduplex=1 hint.arge.1.eeprommac=0x1fff0006 -# Where the ART is - last 64k in the flash -# 0x9fff1000 ? -hint.ath.0.eepromaddr=0x1fff0000 -hint.ath.0.eepromsize=16384 + +# ART calibration data mapping +hint.ar71xx_caldata.0.at="nexus0" +hint.ar71xx_caldata.0.order=0 +# Where the ART is - last 64k in the first 8MB of flash +hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000 +hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384 + +# And now tell the ath(4) driver where to look! +hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware" # The AP121 16MB flash layout: # Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Sun Jul 23 07:02:10 2017 (r321379) +++ head/sys/mips/conf/std.AR933X Sun Jul 23 07:10:41 2017 (r321380) @@ -57,7 +57,10 @@ include "std.AR_MIPS_BASE" makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" +# AR9330 support - everything shipping uses EEPROM for calibration data, +# so always include this. option AH_SUPPORT_AR9330 # Chipset support +option ATH_EEPROM_FIRMWARE # Use EEPROM from flash device usb device ehci From owner-svn-src-head@freebsd.org Sun Jul 23 14:04:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C98D7EF76; Sun, 23 Jul 2017 14:04:48 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8152F1B; Sun, 23 Jul 2017 14:04:48 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NE4lXv033202; Sun, 23 Jul 2017 14:04:47 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NE4kBv033188; Sun, 23 Jul 2017 14:04:46 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707231404.v6NE4kBv033188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 23 Jul 2017 14:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321381 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 321381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 14:04:48 -0000 Author: pstef Date: Sun Jul 23 14:04:45 2017 New Revision: 321381 URL: https://svnweb.freebsd.org/changeset/base/321381 Log: indent(1): don't produce unneeded space character in function declarators. Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/indent_globs.h head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/binary.0.stdout head/usr.bin/indent/tests/comments.0.stdout head/usr.bin/indent/tests/declarations.0 head/usr.bin/indent/tests/declarations.0.stdout head/usr.bin/indent/tests/elsecomment.0.stdout head/usr.bin/indent/tests/float.0.stdout head/usr.bin/indent/tests/label.0.stdout head/usr.bin/indent/tests/nsac.0.stdout head/usr.bin/indent/tests/offsetof.0.stdout head/usr.bin/indent/tests/sac.0.stdout Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/indent.c Sun Jul 23 14:04:45 2017 (r321381) @@ -535,11 +535,12 @@ check_type: ps.p_l_follow--; } if (ps.want_blank && *token != '[' && - (ps.last_token != ident || proc_calls_space || + ((ps.last_token != ident && ps.last_token != funcname) || + proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets * one iff -bs; all other keywords (>2) always get a space * before lparen */ - (ps.keyword + Bill_Shannon > 2))) + ps.keyword + Bill_Shannon > 2)) *e_code++ = ' '; ps.want_blank = false; if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && @@ -576,7 +577,6 @@ check_type: break; case rparen: /* got a ')' or ']' */ - rparen_count--; if (ps.cast_mask & (1 << ps.p_l_follow) & ~ps.not_cast_mask) { ps.last_u_d = true; ps.cast_mask &= (1 << ps.p_l_follow) - 1; @@ -738,7 +738,7 @@ check_type: * structure declaration */ scase = false; /* these will only need resetting in an error */ squest = 0; - if (ps.last_token == rparen && rparen_count == 0) + if (ps.last_token == rparen) ps.in_parameter_declaration = 0; ps.cast_mask = 0; ps.not_cast_mask = 0; @@ -838,6 +838,7 @@ check_type: && ps.in_parameter_declaration) postfix_blankline_requested = 1; ps.in_parameter_declaration = 0; + ps.in_decl = false; } dec_ind = 0; parse(lbrace); /* let parser know about this */ @@ -935,7 +936,6 @@ check_type: case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { - ps.in_parameter_declaration = 1; if (s_code != e_code) { dump_line(); ps.want_blank = 0; @@ -964,10 +964,11 @@ check_type: } goto copy_id; + case funcname: case ident: /* got an identifier or constant */ if (ps.in_decl) { /* if we are in a declaration, we must indent * identifier */ - if (is_procname == 0 || !procnames_start_line) { + if (type_code != funcname || !procnames_start_line) { if (!ps.block_init && !ps.dumped_decl_indent) { if (troff) { if (ps.want_blank) @@ -980,7 +981,8 @@ check_type: ps.want_blank = false; } } else { - if (ps.want_blank) + if (ps.want_blank && !(procnames_start_line && + type_code == funcname)) *e_code++ = ' '; ps.want_blank = false; if (dec_ind && s_code != e_code) { @@ -1014,7 +1016,8 @@ check_type: CHECK_SIZE_CODE; *e_code++ = *t_ptr; } - ps.want_blank = true; + if (type_code != funcname) + ps.want_blank = true; break; case strpfx: Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/indent_codes.h Sun Jul 23 14:04:45 2017 (r321381) @@ -70,3 +70,4 @@ #define period 32 #define strpfx 33 #define storage 34 +#define funcname 35 Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/indent_globs.h Sun Jul 23 14:04:45 2017 (r321381) @@ -330,6 +330,5 @@ struct parser_state { } ps; int ifdef_level; -int rparen_count; struct parser_state state_stack[5]; struct parser_state match_state[5]; Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/lexi.c Sun Jul 23 14:04:45 2017 (r321381) @@ -353,7 +353,8 @@ lexi(void) return (ident); } /* end of switch */ } /* end of if (found_it) */ - if (*buf_ptr == '(' && ps.tos <= 1 && ps.ind_level == 0) { + if (*buf_ptr == '(' && ps.tos <= 1 && ps.ind_level == 0 && + ps.in_parameter_declaration == 0 && ps.block_init == 0) { char *tp = buf_ptr; while (tp < buf_end) if (*tp++ == ')' && (*tp == ';' || *tp == ',')) @@ -361,7 +362,7 @@ lexi(void) strncpy(ps.procname, token, sizeof ps.procname - 1); if (ps.in_decl) ps.in_parameter_declaration = 1; - rparen_count = 1; + return (last_code = funcname); not_proc:; } /* Modified: head/usr.bin/indent/tests/binary.0.stdout ============================================================================== --- head/usr.bin/indent/tests/binary.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/binary.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ #define b00101010 -1 -void +void t(void) { unsigned a[] = {0b00101010, 0x00005678, 02, 17U}; Modified: head/usr.bin/indent/tests/comments.0.stdout ============================================================================== --- head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* See r303597, r303598, r309219, and r309343 */ -void +void t(void) { /* Modified: head/usr.bin/indent/tests/declarations.0 ============================================================================== --- head/usr.bin/indent/tests/declarations.0 Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/declarations.0 Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,32 @@ /* $FreeBSD$ */ /* See r303570 */ -void t(void) { + +static const struct +{ + double x; + double y, z; +} n[m + 1] = +{ + { + .0, + .9, + 5 + } +}; + +typedef struct Complex +{ + double x; + double y; +} Complex; + +void +t1 (char *a, int b, + void (*fn)(void)) +{} + +void t2 (char *x, int y) +{ int a, b, c; @@ -18,4 +44,33 @@ void t(void) { ,n ,o ; +} + +const int int_minimum_size = +MAXALIGN(offsetof(int, test)) + MAXIMUM_ALIGNOF; + +int *int_create(void) +{ + +} + +static +_attribute_printf(1, 2) +void +print_error(const char *fmt,...) +{ + +} + +static LIST_HEAD(, alq) ald_active; +static int ald_shutingdown = 0; +struct thread *ald_thread; + +static int +do_execve(td, args, mac_p) + struct thread *td; + struct image_args *args; + struct mac *mac_p; +{ + } Modified: head/usr.bin/indent/tests/declarations.0.stdout ============================================================================== --- head/usr.bin/indent/tests/declarations.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/declarations.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,8 +1,32 @@ /* $FreeBSD$ */ /* See r303570 */ -void -t(void) + +static const struct { + double x; + double y, z; +} n[m + 1] = { + { + .0, + .9, + 5 + } +}; + +typedef struct Complex { + double x; + double y; +} Complex; + +void +t1(char *a, int b, + void (*fn) (void)) +{ +} + +void +t2(char *x, int y) +{ int a, b, c; int *d, *e, *f; @@ -12,4 +36,34 @@ t(void) ,n ,o ; +} + +const int int_minimum_size = +MAXALIGN(offsetof(int, test)) + MAXIMUM_ALIGNOF; + +int * +int_create(void) +{ + +} + +static +_attribute_printf(1, 2) +void +print_error(const char *fmt,...) +{ + +} + +static LIST_HEAD(, alq) ald_active; +static int ald_shutingdown = 0; +struct thread *ald_thread; + +static int +do_execve(td, args, mac_p) + struct thread *td; + struct image_args *args; + struct mac *mac_p; +{ + } Modified: head/usr.bin/indent/tests/elsecomment.0.stdout ============================================================================== --- head/usr.bin/indent/tests/elsecomment.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/elsecomment.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* See r303484 and r309342 */ -void +void t(void) { if (0) Modified: head/usr.bin/indent/tests/float.0.stdout ============================================================================== --- head/usr.bin/indent/tests/float.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/float.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* See r303499 */ -void +void t(void) { unsigned long x = 314UL; Modified: head/usr.bin/indent/tests/label.0.stdout ============================================================================== --- head/usr.bin/indent/tests/label.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/label.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* See r303489 */ -void +void t(void) { switch (1) { Modified: head/usr.bin/indent/tests/nsac.0.stdout ============================================================================== --- head/usr.bin/indent/tests/nsac.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/nsac.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -void +void t(void) { int a = (double)8; Modified: head/usr.bin/indent/tests/offsetof.0.stdout ============================================================================== --- head/usr.bin/indent/tests/offsetof.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/offsetof.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* See r303718 */ -void +void t(void) { int n = malloc(offsetof(struct s, f) + 1); Modified: head/usr.bin/indent/tests/sac.0.stdout ============================================================================== --- head/usr.bin/indent/tests/sac.0.stdout Sun Jul 23 07:10:41 2017 (r321380) +++ head/usr.bin/indent/tests/sac.0.stdout Sun Jul 23 14:04:45 2017 (r321381) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -void +void t(void) { int a = (double) 8; From owner-svn-src-head@freebsd.org Sun Jul 23 14:33:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB379D7F73B; Sun, 23 Jul 2017 14:33:05 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1BA3F05; Sun, 23 Jul 2017 14:33:05 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NEX4XJ045806; Sun, 23 Jul 2017 14:33:04 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NEX4E2045804; Sun, 23 Jul 2017 14:33:04 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707231433.v6NEX4E2045804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 23 Jul 2017 14:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321382 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 321382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 14:33:05 -0000 Author: pstef Date: Sun Jul 23 14:33:04 2017 New Revision: 321382 URL: https://svnweb.freebsd.org/changeset/base/321382 Log: indent(1): don't produce unnecessary blank lines. Don't force a blank line between an opening brace and a block comment -- not even if -bbb (blank lines before block comments) is on. Added: head/usr.bin/indent/tests/comments.pro (contents, props changed) Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jul 23 14:04:45 2017 (r321381) +++ head/usr.bin/indent/pr_comment.c Sun Jul 23 14:33:04 2017 (r321382) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "indent_globs.h" +#include "indent_codes.h" #include "indent.h" /* * NAME: @@ -187,7 +188,7 @@ pr_comment(void) char *t = e_com; e_com = s_com + 2; *e_com = 0; - if (blanklines_before_blockcomments) + if (blanklines_before_blockcomments && ps.last_token != lbrace) prefix_blankline_requested = 1; dump_line(); e_com = s_com = t; Added: head/usr.bin/indent/tests/comments.pro ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/comments.pro Sun Jul 23 14:33:04 2017 (r321382) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +-bbb From owner-svn-src-head@freebsd.org Sun Jul 23 15:07:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C5AED9A34A; Sun, 23 Jul 2017 15:07:53 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5996664312; Sun, 23 Jul 2017 15:07:53 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NF7q7L058981; Sun, 23 Jul 2017 15:07:52 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NF7q21058980; Sun, 23 Jul 2017 15:07:52 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707231507.v6NF7q21058980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 23 Jul 2017 15:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321383 - head/usr.bin/indent/tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent/tests X-SVN-Commit-Revision: 321383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 15:07:53 -0000 Author: pstef Date: Sun Jul 23 15:07:52 2017 New Revision: 321383 URL: https://svnweb.freebsd.org/changeset/base/321383 Log: indent(1): rename the profile file. Currently, indent's testing mechanism will attempt to apply options from a file named ${test}.pro - and this test's filename is comments.0. Added: head/usr.bin/indent/tests/comments.0.pro - copied unchanged from r321382, head/usr.bin/indent/tests/comments.pro Deleted: head/usr.bin/indent/tests/comments.pro Copied: head/usr.bin/indent/tests/comments.0.pro (from r321382, head/usr.bin/indent/tests/comments.pro) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/comments.0.pro Sun Jul 23 15:07:52 2017 (r321383, copy of r321382, head/usr.bin/indent/tests/comments.pro) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +-bbb From owner-svn-src-head@freebsd.org Sun Jul 23 16:03:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C80FDA4704; Sun, 23 Jul 2017 16:03:52 +0000 (UTC) (envelope-from srs0=g7wu=62=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3764D65C8E; Sun, 23 Jul 2017 16:03:51 +0000 (UTC) (envelope-from srs0=g7wu=62=freebsd.org=kp@codepro.be) Received: from [169.254.11.67] (ptr-8ripyyhttb1guvlwhwm.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:e18d:18af:2910:13a6]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 529C1B2C9; Sun, 23 Jul 2017 18:03:49 +0200 (CEST) From: "Kristof Provost" To: "Ngie Cooper" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321370 - head/lib/libsysdecode Date: Sun, 23 Jul 2017 18:03:48 +0200 Message-ID: <8FA5355F-E374-49BE-B2B2-25351ED827A9@FreeBSD.org> In-Reply-To: References: <201707221251.v6MCpKn4014224@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (2.0BETAr6088) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 16:03:52 -0000 On 22 Jul 2017, at 17:42, Ngie Cooper (yaneurabeya) wrote: > > On Jul 22, 2017, at 5:51 AM, Kristof Provost wrote: >> >> Author: kp >> Date: Sat Jul 22 12:51:19 2017 >> New Revision: 321370 >> URL: https://svnweb.freebsd.org/changeset/base/321370 >> >> Log: >> Handle WITH/WITHOUT_PF in libsysdecode >> >> Only filter out the PF ioctls if we're building without pf support. >> Until now those were always filtered out, so truss did not show = >> symbolic >> names for pf ioctls. > > > Hi Kristof! > 'MFC after: 1 week=E2=80=9D should have probably be added to this comm= it. > This change should be MFCed to ^/stable/11 and probably ^/stable/10 = > (in usr.sbin/kdump on 10: = > https://svnweb.freebsd.org/base/stable/10/usr.bin/kdump/mkioctls?revisi= on=3D291815&view=3Dmarkup#l25 = > ). To be honest I wasn=E2=80=99t planning on MFCing this, because it=E2=80=99= s not a = terribly important issue. That said, if it=E2=80=99d be useful to you (or anyone else) I=E2=80=99m = certainly = willing to do so. I=E2=80=99m not sure how much the code changed between 10 and 11, but MFC= to = 11 should be easy, and if the changes are not too extensive I can do the = merge to 10 as well. Regards, Kristof From owner-svn-src-head@freebsd.org Sun Jul 23 16:11:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5921ADA4AC6; Sun, 23 Jul 2017 16:11:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F00C16656E; Sun, 23 Jul 2017 16:11:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NGBmK2087627; Sun, 23 Jul 2017 16:11:48 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NGBm1o087624; Sun, 23 Jul 2017 16:11:48 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707231611.v6NGBm1o087624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 23 Jul 2017 16:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321385 - in head/sys/dev: mmc sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in head/sys/dev: mmc sdhci X-SVN-Commit-Revision: 321385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 16:11:49 -0000 Author: marius Date: Sun Jul 23 16:11:47 2017 New Revision: 321385 URL: https://svnweb.freebsd.org/changeset/base/321385 Log: o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to sdhci(4), mmc(4) and mmcsd(4). For the most part, this consists of: - Correcting and extending the infrastructure for negotiating and enabling post-DDR52 modes already added as part of r315598. In fact, HS400ES now should work as well but hasn't been activated due to lack of corresponding hardware. - Adding support executing standard SDHCI initial tuning as well as re-tuning as required for eMMC HS200/HS400 and the fast UHS-I SD card modes. Currently, corresponding methods are only hooked up to the ACPI and PCI front-ends of sdhci(4), though. Moreover, sdhci(4) won't offer any modes requiring (re-)tuning to the MMC/SD layer in order to not break operations with other sdhci(4) front- ends. Likewise, sdhci(4) now no longer offers modes requiring the set_uhs_timing method introduced in r315598 to be implemented/ hooked up (previously, this method was used with DDR52 only, which in turn is only available with Intel controllers so far, i. e. no such limitation was necessary before). Similarly for 1.2/1.8 V VCCQ support and the switch_vccq method. - Addition of locking to the IOCTL half of mmcsd(4) to prevent races with detachment and suspension, especially since it's required to immediately switch away from RPMB partitions again after an access to these (so re-tuning can take place anew, given that the current eMMC specification v5.1 doesn't allow tuning commands to be issued with a RPMB partition selected). Therefore, the existing part_mtx lock in the mmcsd(4) softc is additionally renamed to disk_mtx in order to denote that it only refers to the disk(9) half, likewise for corresponding macros. On the system where the addition of DDR52 support increased the read throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than quadrupled compared to pre-r315598. Also, with the advent of (re-)tuning support, most infrastructure necessary for SD card UHS-I modes up to SDR104 now is also in place. Note, though, that the standard SDHCI way of (re-)tuning is special in several ways, which also is why sending the actual tuning requests to the device is part of sdhci(4). SDHCI implementations not following the specification, MMC and non-SDHCI SD card controllers likely will use a generic implementation in the MMC/SD layer for executing tuning, which hasn't been written so far, though. However, in fact this isn't a feature-only change; there are boards based on Intel Bay Trail where DDR52 is problematic and the suggested workaround is to use HS200 mode instead. So far exact details are unknown, however, i. e. whether that's due to a defect in these SoCs or on the boards. Moreover, due to the above changes requiring to be aware of possible MMC siblings in the fast path of mmc(4), corresponding information now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(), mmc_delete_cards(), mmc_discover_cards() and mmc_rescan_cards() now all are guaranteed to operate on the same set of devices as there no longer is any use of device_get_children(9), which can fail in low memory situations. Likewise, mmc_calculate_clock() now longer will trigger a panic due to the latter. o Fix a bug in the failure reporting of mmcsd_delete(); in case of an error when the starting block of a previously stored erase request is used (in order to be able to erase a full erase sector worth of data), the starting block of the newly supplied bio_pblkno has to be returned for indicating no progress. Otherwise, upper layers might be told that a negative number of BIOs have been completed, leading to a panic. o Fix 2 bugs on resume: - Things done in fork1(9) like the acquisition of an SX lock or the sleepable memory allocation are incompatible with a MTX_DEF taken. Thus, mmcsd_resume() must not call kproc_create(9), which in turn uses fork1(9), with the disk_mtx (formerly part_mtx) held. - In mmc_suspend(), the bus is powered down, which in the typical case of a device being selected at the time of suspension, causes the device deselection as part of the bus acquisition by mmc(4) in mmc_scan() to fail as the bus isn't powered up again before later in mmc_go_discovery(). Thus, power down with the bus acquired in mmc_suspend(), which will trigger the deselection up-front. o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1] o Fix missing variable initialization in mmc_switch_status(). [2] o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3] o Handle the case of device_add_child(9) failing, for example due to a memory shortage, gracefully in mmc(4) and sdhci(4), including not leaking memory for the instance variables in case of mmc(4) (which might or might not fix [4] as the latter problem has been discovered independently). o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd() gracefully instead of calling panic(9). o Again, check and handle the return values of some additional function calls in mmc(4) instead of assuming that everything went right or mark non-fatal errors by casting the return value to void. o Correct a typo in the Linux IOCTL compatibility; it should have been MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI. o Now that we are reaching ever faster speeds (more improvement in this regard is to be expected when adding ADMA support to sdhci(4)), apply a few micro-optimizations like predicting mmc(4) and sdhci(4) debugging to be off or caching erase sector and maximum data sizes as well support of block addressing in mmsd(4) (instead of doing 2 indirections on every read/write request for determining the maximum data size for example). Reported by: Coverity CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4] Modified: head/sys/dev/mmc/bridge.h head/sys/dev/mmc/mmc.c head/sys/dev/mmc/mmc_ioctl.h head/sys/dev/mmc/mmc_private.h head/sys/dev/mmc/mmc_subr.c head/sys/dev/mmc/mmcbr_if.m head/sys/dev/mmc/mmcbrvar.h head/sys/dev/mmc/mmcbus_if.m head/sys/dev/mmc/mmcreg.h head/sys/dev/mmc/mmcsd.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_if.m head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/mmc/bridge.h ============================================================================== --- head/sys/dev/mmc/bridge.h Sun Jul 23 15:22:06 2017 (r321384) +++ head/sys/dev/mmc/bridge.h Sun Jul 23 16:11:47 2017 (r321385) @@ -137,6 +137,10 @@ enum mmc_card_mode { mode_mmc, mode_sd }; +enum mmc_retune_req { + retune_req_none = 0, retune_req_normal, retune_req_reset +}; + struct mmc_host { int f_min; int f_max; @@ -178,7 +182,7 @@ struct mmc_host { extern driver_t mmc_driver; extern devclass_t mmc_devclass; -#define MMC_VERSION 3 +#define MMC_VERSION 4 #define MMC_DECLARE_BRIDGE(name) \ DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL); \ Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sun Jul 23 15:22:06 2017 (r321384) +++ head/sys/dev/mmc/mmc.c Sun Jul 23 16:11:47 2017 (r321385) @@ -88,14 +88,14 @@ struct mmc_ivars { uint8_t raw_ext_csd[MMC_EXTCSD_SIZE]; /* Raw bits of the EXT_CSD */ uint32_t raw_sd_status[16]; /* Raw bits of the SD_STATUS */ uint16_t rca; + u_char read_only; /* True when the device is read-only */ + u_char high_cap; /* High Capacity device (block addressed) */ enum mmc_card_mode mode; + enum mmc_bus_width bus_width; /* Bus width to use */ struct mmc_cid cid; /* cid decoded */ struct mmc_csd csd; /* csd decoded */ struct mmc_scr scr; /* scr decoded */ struct mmc_sd_status sd_status; /* SD_STATUS decoded */ - u_char read_only; /* True when the device is read-only */ - u_char bus_width; /* Bus width to use */ - u_char high_cap; /* High Capacity card (block addressed) */ uint32_t sec_count; /* Card capacity in 512byte blocks */ uint32_t timings; /* Mask of bus timings supported */ uint32_t vccq_120; /* Mask of bus timings at VCCQ of 1.2 V */ @@ -127,8 +127,10 @@ static int mmc_read_ivar(device_t bus, device_t child, uintptr_t *result); static int mmc_release_bus(device_t busdev, device_t dev); static int mmc_resume(device_t dev); +static void mmc_retune_pause(device_t busdev, device_t dev, bool retune); +static void mmc_retune_unpause(device_t busdev, device_t dev); static int mmc_suspend(device_t dev); -static int mmc_wait_for_request(device_t brdev, device_t reqdev, +static int mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req); static int mmc_write_ivar(device_t bus, device_t child, int which, uintptr_t value); @@ -155,21 +157,23 @@ static void mmc_decode_cid_mmc(uint32_t *raw_cid, stru bool is_4_41p); static void mmc_decode_cid_sd(uint32_t *raw_cid, struct mmc_cid *cid); static void mmc_decode_csd_mmc(uint32_t *raw_csd, struct mmc_csd *csd); -static void mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd); static void mmc_delayed_attach(void *xsc); -static int mmc_delete_cards(struct mmc_softc *sc); +static int mmc_delete_cards(struct mmc_softc *sc, bool final); static void mmc_discover_cards(struct mmc_softc *sc); static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_go_discovery(struct mmc_softc *sc); static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, int size); static int mmc_highest_voltage(uint32_t ocr); +static bool mmc_host_timing(device_t dev, enum mmc_bus_timing timing); static void mmc_idle_cards(struct mmc_softc *sc); static void mmc_ms_delay(int ms); static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard); static void mmc_power_down(struct mmc_softc *sc); static void mmc_power_up(struct mmc_softc *sc); static void mmc_rescan_cards(struct mmc_softc *sc); +static int mmc_retune(device_t busdev, device_t dev, bool reset); static void mmc_scan(struct mmc_softc *sc); static int mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res); @@ -183,15 +187,23 @@ static int mmc_send_op_cond(struct mmc_softc *sc, uint uint32_t *rocr); static int mmc_send_relative_addr(struct mmc_softc *sc, uint32_t *resp); static int mmc_set_blocklen(struct mmc_softc *sc, uint32_t len); -static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar); +static int mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); static int mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar); static int mmc_set_relative_addr(struct mmc_softc *sc, uint16_t resp); static int mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars *ivar, enum mmc_bus_timing timing); +static int mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing); +static int mmc_switch_to_hs200(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t clock); +static int mmc_switch_to_hs400(struct mmc_softc *sc, struct mmc_ivars *ivar, + uint32_t max_dtr, enum mmc_bus_timing max_timing); static int mmc_test_bus_width(struct mmc_softc *sc); static uint32_t mmc_timing_to_dtr(struct mmc_ivars *ivar, enum mmc_bus_timing timing); static const char *mmc_timing_to_string(enum mmc_bus_timing timing); +static void mmc_update_child_list(struct mmc_softc *sc); static int mmc_wait_for_command(struct mmc_softc *sc, uint32_t opcode, uint32_t arg, uint32_t flags, uint32_t *resp, int retries); static int mmc_wait_for_req(struct mmc_softc *sc, struct mmc_request *req); @@ -235,7 +247,8 @@ mmc_detach(device_t dev) struct mmc_softc *sc = device_get_softc(dev); int err; - if ((err = mmc_delete_cards(sc)) != 0) + err = mmc_delete_cards(sc, true); + if (err != 0) return (err); mmc_power_down(sc); MMC_LOCK_DESTROY(sc); @@ -250,10 +263,21 @@ mmc_suspend(device_t dev) int err; err = bus_generic_suspend(dev); - if (err) + if (err != 0) return (err); + /* + * We power down with the bus acquired here, mainly so that no device + * is selected any longer and sc->last_rca gets set to 0. Otherwise, + * the deselect as part of the bus acquisition in mmc_scan() may fail + * during resume, as the bus isn't powered up again before later in + * mmc_go_discovery(). + */ + err = mmc_acquire_bus(dev, dev); + if (err != 0) + return (err); mmc_power_down(sc); - return (0); + err = mmc_release_bus(dev, dev); + return (err); } static int @@ -270,7 +294,8 @@ mmc_acquire_bus(device_t busdev, device_t dev) { struct mmc_softc *sc; struct mmc_ivars *ivar; - int err, rca; + int err; + uint16_t rca; enum mmc_bus_timing timing; err = MMCBR_ACQUIRE_HOST(device_get_parent(busdev), busdev); @@ -294,12 +319,27 @@ mmc_acquire_bus(device_t busdev, device_t dev) rca = ivar->rca; if (sc->last_rca != rca) { if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to select.\n", rca); + device_printf(busdev, "Card at relative " + "address %d failed to select\n", rca); return (ENXIO); } sc->last_rca = rca; timing = mmcbr_get_timing(busdev); + /* + * For eMMC modes, setting/updating bus width and VCCQ + * only really is necessary if there actually is more + * than one device on the bus as generally that already + * had to be done by mmc_calculate_clock() or one of + * its calees. Moreover, setting the bus width anew + * can trigger re-tuning (via a CRC error on the next + * CMD), even if not switching between devices an the + * previously selected one is still tuned. Obviously, + * we need to re-tune the host controller if devices + * are actually switched, though. + */ + if (timing >= bus_timing_mmc_ddr52 && + sc->child_count == 1) + return (0); /* Prepare bus width for the new card. */ if (bootverbose || mmc_debug) { device_printf(busdev, @@ -308,38 +348,34 @@ mmc_acquire_bus(device_t busdev, device_t dev) (ivar->bus_width == bus_width_8) ? 8 : 1, mmc_timing_to_string(timing)); } - if (mmc_set_card_bus_width(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set bus width.\n", + if (mmc_set_card_bus_width(sc, ivar, timing) != + MMC_ERR_NONE) { + device_printf(busdev, "Card at relative " + "address %d failed to set bus width\n", rca); return (ENXIO); } - if (isset(&ivar->vccq_120, timing)) - mmcbr_set_vccq(busdev, vccq_120); - else if (isset(&ivar->vccq_180, timing)) - mmcbr_set_vccq(busdev, vccq_180); - else - mmcbr_set_vccq(busdev, vccq_330); - if (mmcbr_switch_vccq(busdev) != 0) { - device_printf(sc->dev, "Failed to set VCCQ " - "for card at relative address %d.\n", rca); + mmcbr_set_bus_width(busdev, ivar->bus_width); + mmcbr_update_ios(busdev); + if (mmc_set_vccq(sc, ivar, timing) != MMC_ERR_NONE) { + device_printf(busdev, "Failed to set VCCQ " + "for card at relative address %d\n", rca); return (ENXIO); } - if (mmc_set_power_class(sc, ivar) != MMC_ERR_NONE) { - device_printf(sc->dev, "Card at relative " - "address %d failed to set power class.\n", - rca); + if (timing >= bus_timing_mmc_hs200 && + mmc_retune(busdev, dev, true) != 0) { + device_printf(busdev, "Card at relative " + "address %d failed to re-tune\n", rca); return (ENXIO); } - mmcbr_set_bus_width(busdev, ivar->bus_width); - mmcbr_update_ios(busdev); } } else { /* * If there's a card selected, stand down. */ if (sc->last_rca != 0) { - mmc_select_card(sc, 0); + if (mmc_select_card(sc, 0) != MMC_ERR_NONE) + return (ENXIO); sc->last_rca = 0; } } @@ -407,7 +443,7 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ req->done = mmc_wakeup; req->done_data = sc; - if (mmc_debug > 1) { + if (__predict_false(mmc_debug > 1)) { device_printf(sc->dev, "REQUEST: CMD%d arg %#x flags %#x", req->cmd->opcode, req->cmd->arg, req->cmd->flags); if (req->cmd->data) { @@ -420,18 +456,66 @@ mmc_wait_for_req(struct mmc_softc *sc, struct mmc_requ while ((req->flags & MMC_REQ_DONE) == 0) msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); - if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) + if (__predict_false(mmc_debug > 2 || (mmc_debug > 0 && + req->cmd->error != MMC_ERR_NONE))) device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } static int -mmc_wait_for_request(device_t brdev, device_t reqdev __unused, - struct mmc_request *req) +mmc_wait_for_request(device_t busdev, device_t dev, struct mmc_request *req) { - struct mmc_softc *sc = device_get_softc(brdev); + struct mmc_softc *sc; + struct mmc_ivars *ivar; + int err, i; + enum mmc_retune_req retune_req; + sc = device_get_softc(busdev); + KASSERT(sc->owner != NULL, + ("%s: Request from %s without bus being acquired.", __func__, + device_get_nameunit(dev))); + + /* + * Unless no device is selected or re-tuning is already ongoing, + * execute re-tuning if a) the bridge is requesting to do so and + * re-tuning hasn't been otherwise paused, or b) if a child asked + * to be re-tuned prior to pausing (see also mmc_retune_pause()). + */ + if (__predict_false(sc->last_rca != 0 && sc->retune_ongoing == 0 && + (((retune_req = mmcbr_get_retune_req(busdev)) != retune_req_none && + sc->retune_paused == 0) || sc->retune_needed == 1))) { + if (__predict_false(mmc_debug > 1)) { + device_printf(busdev, + "Re-tuning with%s circuit reset required\n", + retune_req == retune_req_reset ? "" : "out"); + } + if (device_get_parent(dev) == busdev) + ivar = device_get_ivars(dev); + else { + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (ivar->rca == sc->last_rca) + break; + } + if (ivar->rca != sc->last_rca) + return (EINVAL); + } + sc->retune_ongoing = 1; + err = mmc_retune(busdev, dev, retune_req == retune_req_reset); + sc->retune_ongoing = 0; + switch (err) { + case MMC_ERR_NONE: + case MMC_ERR_FAILED: /* Re-tune error but still might work */ + break; + case MMC_ERR_BADCRC: /* Switch failure on HS400 recovery */ + return (ENXIO); + case MMC_ERR_INVALID: /* Driver implementation b0rken */ + default: /* Unknown error, should not happen */ + return (EINVAL); + } + sc->retune_needed = 0; + } return (mmc_wait_for_req(sc, req)); } @@ -599,11 +683,14 @@ mmc_power_down(struct mmc_softc *sc) static int mmc_select_card(struct mmc_softc *sc, uint16_t rca) { - int flags; + int err, flags; flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC; - return (mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, - flags, NULL, CMD_RETRIES)); + sc->retune_paused++; + err = mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16, + flags, NULL, CMD_RETRIES); + sc->retune_paused--; + return (err); } static int @@ -635,7 +722,8 @@ mmc_sd_switch(struct mmc_softc *sc, uint8_t mode, uint } static int -mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar) +mmc_set_card_bus_width(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) { struct mmc_command cmd; int err; @@ -668,28 +756,33 @@ mmc_set_card_bus_width(struct mmc_softc *sc, struct mm } else { switch (ivar->bus_width) { case bus_width_1: + if (timing == bus_timing_mmc_hs400 || + timing == bus_timing_mmc_hs400es) + return (MMC_ERR_INVALID); value = EXT_CSD_BUS_WIDTH_1; break; case bus_width_4: - switch (mmcbr_get_timing(sc->dev)) { + switch (timing) { case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: - case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: value = EXT_CSD_BUS_WIDTH_4_DDR; break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + return (MMC_ERR_INVALID); default: value = EXT_CSD_BUS_WIDTH_4; break; } break; case bus_width_8: - switch (mmcbr_get_timing(sc->dev)) { + value = 0; + switch (timing) { + case bus_timing_mmc_hs400es: + value = EXT_CSD_BUS_WIDTH_ES; + /* FALLTHROUGH */ case bus_timing_mmc_ddr52: - case bus_timing_mmc_hs200: case bus_timing_mmc_hs400: - case bus_timing_mmc_hs400es: - value = EXT_CSD_BUS_WIDTH_8_DDR; + value |= EXT_CSD_BUS_WIDTH_8_DDR; break; default: value = EXT_CSD_BUS_WIDTH_8; @@ -814,6 +907,13 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars case bus_timing_mmc_ddr52: value = EXT_CSD_HS_TIMING_HS; break; + case bus_timing_mmc_hs200: + value = EXT_CSD_HS_TIMING_HS200; + break; + case bus_timing_mmc_hs400: + case bus_timing_mmc_hs400es: + value = EXT_CSD_HS_TIMING_HS400; + break; default: return (MMC_ERR_INVALID); } @@ -830,6 +930,23 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars return (err); } +static int +mmc_set_vccq(struct mmc_softc *sc, struct mmc_ivars *ivar, + enum mmc_bus_timing timing) +{ + + if (isset(&ivar->vccq_120, timing)) + mmcbr_set_vccq(sc->dev, vccq_120); + else if (isset(&ivar->vccq_180, timing)) + mmcbr_set_vccq(sc->dev, vccq_180); + else + mmcbr_set_vccq(sc->dev, vccq_330); + if (mmcbr_switch_vccq(sc->dev) != 0) + return (MMC_ERR_INVALID); + else + return (MMC_ERR_NONE); +} + static const uint8_t p8[8] = { 0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -1037,7 +1154,7 @@ static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; -static void +static int mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) { int v; @@ -1078,6 +1195,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + return (MMC_ERR_NONE); } else if (v == 1) { m = mmc_get_bits(raw_csd, 128, 115, 4); e = mmc_get_bits(raw_csd, 128, 112, 3); @@ -1101,8 +1219,9 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *c csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else - panic("unknown SD CSD version"); + return (MMC_ERR_NONE); + } + return (MMC_ERR_INVALID); } static void @@ -1366,6 +1485,53 @@ mmc_timing_to_string(enum mmc_bus_timing timing) return (""); } +static bool +mmc_host_timing(device_t dev, enum mmc_bus_timing timing) +{ + int host_caps; + + host_caps = mmcbr_get_caps(dev); + +#define HOST_TIMING_CAP(host_caps, cap) ({ \ + bool retval; \ + if (((host_caps) & (cap)) == (cap)) \ + retval = true; \ + else \ + retval = false; \ + retval; \ +}) + + switch (timing) { + case bus_timing_normal: + return (true); + case bus_timing_hs: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_HSPEED)); + case bus_timing_uhs_sdr12: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR12)); + case bus_timing_uhs_sdr25: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR25)); + case bus_timing_uhs_ddr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_DDR50)); + case bus_timing_uhs_sdr50: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR50)); + case bus_timing_uhs_sdr104: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_UHS_SDR104)); + case bus_timing_mmc_ddr52: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_DDR52)); + case bus_timing_mmc_hs200: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200)); + case bus_timing_mmc_hs400: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400)); + case bus_timing_mmc_hs400es: + return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400 | + MMC_CAP_MMC_ENH_STROBE)); + } + +#undef HOST_TIMING_CAP + + return (false); +} + static void mmc_log_card(device_t dev, struct mmc_ivars *ivar, int newcard) { @@ -1397,9 +1563,8 @@ mmc_discover_cards(struct mmc_softc *sc) u_char switch_res[64]; uint32_t raw_cid[4]; struct mmc_ivars *ivar = NULL; - device_t *devlist; device_t child; - int devcount, err, host_caps, i, newcard; + int err, host_caps, i, newcard; uint32_t resp, sec_count, status; uint16_t rca = 2; @@ -1407,6 +1572,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (bootverbose || mmc_debug) device_printf(sc->dev, "Probing cards\n"); while (1) { + child = NULL; sc->squelched++; /* Errors are expected, squelch reporting. */ err = mmc_all_send_cid(sc, raw_cid); sc->squelched--; @@ -1417,18 +1583,14 @@ mmc_discover_cards(struct mmc_softc *sc) break; } newcard = 1; - if ((err = device_get_children(sc->dev, &devlist, - &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (memcmp(ivar->raw_cid, raw_cid, sizeof(raw_cid)) == 0) { newcard = 0; break; } } - free(devlist, M_TEMP); if (bootverbose || mmc_debug) { device_printf(sc->dev, "%sard detected (CID %08x%08x%08x%08x)\n", @@ -1451,7 +1613,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting RCA %d\n", err); - break; + goto free_ivar; } ivar->rca = resp >> 16; /* Get card CSD. */ @@ -1459,7 +1621,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1467,7 +1629,11 @@ mmc_discover_cards(struct mmc_softc *sc) newcard ? "New c" : "C", ivar->raw_csd[0], ivar->raw_csd[1], ivar->raw_csd[2], ivar->raw_csd[3]); - mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + err = mmc_decode_csd_sd(ivar->raw_csd, &ivar->csd); + if (err != MMC_ERR_NONE) { + device_printf(sc->dev, "Error decoding CSD\n"); + goto free_ivar; + } ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; @@ -1480,12 +1646,12 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } /* Get card SCR. Card must be selected to fetch it. */ @@ -1493,13 +1659,13 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } err = mmc_app_send_scr(sc, ivar->rca, ivar->raw_scr); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading SCR %d\n", err); - break; + goto free_ivar; } mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); /* Get card switch capabilities (command class 10). */ @@ -1527,7 +1693,7 @@ mmc_discover_cards(struct mmc_softc *sc) * use from the sd_status is the erase sector size, but * it is still nice to get that right. */ - mmc_select_card(sc, 0); + (void)mmc_select_card(sc, 0); (void)mmc_select_card(sc, ivar->rca); (void)mmc_app_sd_status(sc, ivar->rca, ivar->raw_sd_status); @@ -1537,47 +1703,24 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->erase_sector = 16 << ivar->sd_status.au_size; } - /* Find max supported bus width. */ + /* Find maximum supported bus width. */ if ((host_caps & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; - /* - * Some cards that report maximum I/O block sizes - * greater than 512 require the block length to be - * set to 512, even though that is supposed to be - * the default. Example: - * - * Transcend 2GB SDSC card, CID: - * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=00.2000 - */ - if (ivar->csd.read_bl_len != MMC_SECTOR_SIZE || - ivar->csd.write_bl_len != MMC_SECTOR_SIZE) - mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - - mmc_format_card_id_string(ivar); - - if (bootverbose || mmc_debug) - mmc_log_card(sc->dev, ivar, newcard); - if (newcard) { - /* Add device. */ - child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); - } - mmc_select_card(sc, 0); - return; + goto child_common; } ivar->rca = rca++; err = mmc_set_relative_addr(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error setting RCA %d\n", err); - break; + goto free_ivar; } /* Get card CSD. */ err = mmc_send_csd(sc, ivar->rca, ivar->raw_csd); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error getting CSD %d\n", err); - break; + goto free_ivar; } if (bootverbose || mmc_debug) device_printf(sc->dev, @@ -1596,19 +1739,19 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading card status %d\n", err); - break; + goto free_ivar; } if ((status & R1_CARD_IS_LOCKED) != 0) { device_printf(sc->dev, - "Card is password protected, skipping.\n"); - break; + "Card is password protected, skipping\n"); + goto free_ivar; } err = mmc_select_card(sc, ivar->rca); if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error selecting card %d\n", err); - break; + goto free_ivar; } /* Only MMC >= 4.x devices support EXT_CSD. */ @@ -1618,7 +1761,7 @@ mmc_discover_cards(struct mmc_softc *sc) if (err != MMC_ERR_NONE) { device_printf(sc->dev, "Error reading EXT_CSD %d\n", err); - break; + goto free_ivar; } /* Handle extended capacity from EXT_CSD */ sec_count = ivar->raw_ext_csd[EXT_CSD_SEC_CNT] + @@ -1629,6 +1772,8 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->sec_count = sec_count; ivar->high_cap = 1; } + /* Find maximum supported bus width. */ + ivar->bus_width = mmc_test_bus_width(sc); /* Get device speeds beyond normal mode. */ if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_HS_52) != 0) { @@ -1651,6 +1796,50 @@ mmc_discover_cards(struct mmc_softc *sc) setbit(&ivar->timings, bus_timing_mmc_ddr52); setbit(&ivar->vccq_180, bus_timing_mmc_ddr52); } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_120, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0) { + setbit(&ivar->timings, bus_timing_mmc_hs200); + setbit(&ivar->vccq_180, bus_timing_mmc_hs200); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_2V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_120) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_120, bus_timing_mmc_hs400es); + } + if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] & + EXT_CSD_CARD_TYPE_HS400_1_8V) != 0 && + (ivar->raw_ext_csd[EXT_CSD_STROBE_SUPPORT] & + EXT_CSD_STROBE_SUPPORT_EN) != 0 && + (host_caps & MMC_CAP_SIGNALING_180) != 0 && + ivar->bus_width == bus_width_8) { + setbit(&ivar->timings, bus_timing_mmc_hs400es); + setbit(&ivar->vccq_180, bus_timing_mmc_hs400es); + } /* * Determine generic switch timeout (provided in * units of 10 ms), defaulting to 500 ms. @@ -1659,8 +1848,6 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.spec_vers >= 6) ivar->cmd6_time = 10 * ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME]; - /* Find max supported bus width. */ - ivar->bus_width = mmc_test_bus_width(sc); /* Handle HC erase sector size. */ if (ivar->raw_ext_csd[EXT_CSD_ERASE_GRP_SIZE] != 0) { ivar->erase_sector = 1024 * @@ -1674,11 +1861,15 @@ mmc_discover_cards(struct mmc_softc *sc) device_printf(sc->dev, "Error setting erase group %d\n", err); - break; + goto free_ivar; } } } + mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, + ivar->raw_ext_csd[EXT_CSD_REV] >= 5); + +child_common: /* * Some cards that report maximum I/O block sizes greater * than 512 require the block length to be set to 512, even @@ -1691,8 +1882,6 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->csd.write_bl_len != MMC_SECTOR_SIZE) mmc_set_blocklen(sc, MMC_SECTOR_SIZE); - mmc_decode_cid_mmc(ivar->raw_cid, &ivar->cid, - ivar->raw_ext_csd[EXT_CSD_REV] >= 5); mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) @@ -1700,56 +1889,111 @@ mmc_discover_cards(struct mmc_softc *sc) if (newcard) { /* Add device. */ child = device_add_child(sc->dev, NULL, -1); - device_set_ivars(child, ivar); + if (child != NULL) { + device_set_ivars(child, ivar); + sc->child_list = realloc(sc->child_list, + sizeof(device_t *) * sc->child_count + 1, + M_DEVBUF, M_WAITOK); + sc->child_list[sc->child_count++] = child; + } else + device_printf(sc->dev, "Error adding child\n"); } - mmc_select_card(sc, 0); + +free_ivar: + if (newcard && child == NULL) + free(ivar, M_DEVBUF); + (void)mmc_select_card(sc, 0); + /* + * Not returning here when one MMC device could no be added + * potentially would mean looping forever when that device + * is broken (in which case it also may impact the remainder + * of the bus anyway, though). + */ + if ((newcard && child == NULL) || + mmcbr_get_mode(sc->dev) == mode_sd) + return; } } static void +mmc_update_child_list(struct mmc_softc *sc) +{ + device_t child; + int i, j; + + if (sc->child_count == 0) { + free(sc->child_list, M_DEVBUF); + return; + } + for (i = j = 0; i < sc->child_count; i++) { + for (;;) { + child = sc->child_list[j++]; + if (child != NULL) + break; + } + if (i != j) + sc->child_list[i] = child; + } + sc->child_list = realloc(sc->child_list, sizeof(device_t *) * + sc->child_count, M_DEVBUF, M_WAITOK); +} + +static void mmc_rescan_cards(struct mmc_softc *sc) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return; - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (mmc_select_card(sc, ivar->rca) != MMC_ERR_NONE) { if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d lost.\n", + "Card at relative address %d lost\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + continue; + } free(ivar, M_DEVBUF); - } + } else + j++; } - free(devlist, M_TEMP); - mmc_select_card(sc, 0); + if (sc->child_count == j) + goto out; + sc->child_count = j; + mmc_update_child_list(sc); +out: + (void)mmc_select_card(sc, 0); } static int -mmc_delete_cards(struct mmc_softc *sc) +mmc_delete_cards(struct mmc_softc *sc, bool final) { struct mmc_ivars *ivar; - device_t *devlist; - int err, i, devcount; + int err, i, j; - if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) - return (err); - for (i = 0; i < devcount; i++) { - ivar = device_get_ivars(devlist[i]); + err = 0; + for (i = j = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); if (bootverbose || mmc_debug) device_printf(sc->dev, - "Card at relative address %d deleted.\n", + "Card at relative address %d deleted\n", ivar->rca); - device_delete_child(sc->dev, devlist[i]); + err = device_delete_child(sc->dev, sc->child_list[i]); + if (err != 0) { + j++; + if (final == false) + continue; + else + break; + } free(ivar, M_DEVBUF); } - free(devlist, M_TEMP); - return (0); + sc->child_count = j; + mmc_update_child_list(sc); + return (err); } static void @@ -1813,7 +2057,7 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_get_ocr(dev)); if (mmcbr_get_ocr(dev) == 0) { device_printf(sc->dev, "No compatible cards found on bus\n"); - mmc_delete_cards(sc); + (void)mmc_delete_cards(sc, false); mmc_power_down(sc); return; } @@ -1837,31 +2081,27 @@ mmc_go_discovery(struct mmc_softc *sc) static int mmc_calculate_clock(struct mmc_softc *sc) { - device_t *kids; + device_t dev; struct mmc_ivars *ivar; - int host_caps, i, nkid; + int i; uint32_t dtr, max_dtr; + uint16_t rca; enum mmc_bus_timing max_timing, timing; - bool changed; + bool changed, hs400; - max_dtr = mmcbr_get_f_max(sc->dev); - host_caps = mmcbr_get_caps(sc->dev); - if ((host_caps & MMC_CAP_MMC_DDR52) != 0) - max_timing = bus_timing_mmc_ddr52; - else if ((host_caps & MMC_CAP_HSPEED) != 0) - max_timing = bus_timing_hs; - else - max_timing = bus_timing_normal; - if (device_get_children(sc->dev, &kids, &nkid) != 0) - panic("can't get children"); + dev = sc->dev; + max_dtr = mmcbr_get_f_max(dev); + max_timing = bus_timing_max; do { changed = false; - for (i = 0; i < nkid; i++) { - ivar = device_get_ivars(kids[i]); - if (isclr(&ivar->timings, max_timing)) { - for (timing = max_timing; timing >= + for (i = 0; i < sc->child_count; i++) { + ivar = device_get_ivars(sc->child_list[i]); + if (isclr(&ivar->timings, max_timing) || + !mmc_host_timing(dev, max_timing)) { + for (timing = max_timing - 1; timing >= bus_timing_normal; timing--) { - if (isset(&ivar->timings, timing)) { + if (isset(&ivar->timings, timing) && + mmc_host_timing(dev, timing)) { max_timing = timing; break; } @@ -1875,38 +2115,316 @@ mmc_calculate_clock(struct mmc_softc *sc) } } } while (changed == true); + if (bootverbose || mmc_debug) { - device_printf(sc->dev, + device_printf(dev, "setting transfer rate to %d.%03dMHz (%s timing)\n", max_dtr / 1000000, (max_dtr / 1000) % 1000, mmc_timing_to_string(max_timing)); } - for (i = 0; i < nkid; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Jul 23 16:28:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075F8DA4EED; Sun, 23 Jul 2017 16:28:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B2466A66; Sun, 23 Jul 2017 16:28:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NGSDdH092421; Sun, 23 Jul 2017 16:28:13 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NGSDoa092418; Sun, 23 Jul 2017 16:28:13 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707231628.v6NGSDoa092418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 23 Jul 2017 16:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321386 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 16:28:15 -0000 Author: alc Date: Sun Jul 23 16:28:13 2017 New Revision: 321386 URL: https://svnweb.freebsd.org/changeset/base/321386 Log: Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The Differential Revision discusses the benefits of this change.) Add a function, vm_reserv_to_superpage(), that returns the superpage containing the specified base page. Reviewed by: kib, markj Tested by: pho MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D11556 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jul 23 16:11:47 2017 (r321385) +++ head/sys/vm/vm_fault.c Sun Jul 23 16:28:13 2017 (r321386) @@ -266,8 +266,11 @@ static int vm_fault_soft_fast(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot, int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) { - vm_page_t m; - int rv; + vm_page_t m, m_map; +#if defined(__amd64__) && VM_NRESERVLEVEL > 0 + vm_page_t m_super; +#endif + int flags, psind, rv; MPASS(fs->vp == NULL); m = vm_page_lookup(fs->first_object, fs->first_pindex); @@ -275,14 +278,46 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t if (m == NULL || ((prot & VM_PROT_WRITE) != 0 && vm_page_busied(m)) || m->valid != VM_PAGE_BITS_ALL) return (KERN_FAILURE); - rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | - PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED : 0), 0); + m_map = m; + psind = 0; +#if defined(__amd64__) && VM_NRESERVLEVEL > 0 + if ((m->flags & PG_FICTITIOUS) == 0 && + (m_super = vm_reserv_to_superpage(m)) != NULL && + rounddown2(vaddr, pagesizes[m_super->psind]) >= fs->entry->start && + roundup2(vaddr + 1, pagesizes[m_super->psind]) <= fs->entry->end && + (vaddr & (pagesizes[m_super->psind] - 1)) == (VM_PAGE_TO_PHYS(m) & + (pagesizes[m_super->psind] - 1)) && + pmap_ps_enabled(fs->map->pmap)) { + flags = PS_ALL_VALID; + if ((prot & VM_PROT_WRITE) != 0) { + /* + * Create a superpage mapping allowing write access + * only if none of the constituent pages are busy and + * all of them are already dirty (except possibly for + * the page that was faulted on). + */ + flags |= PS_NONE_BUSY; + if ((fs->first_object->flags & OBJ_UNMANAGED) == 0) + flags |= PS_ALL_DIRTY; + } + if (vm_page_ps_test(m_super, flags, m)) { + m_map = m_super; + psind = m_super->psind; + vaddr = rounddown2(vaddr, pagesizes[psind]); + /* Preset the modified bit for dirty superpages. */ + if ((flags & PS_ALL_DIRTY) != 0) + fault_type |= VM_PROT_WRITE; + } + } +#endif + rv = pmap_enter(fs->map->pmap, vaddr, m_map, prot, fault_type | + PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED : 0), psind); if (rv != KERN_SUCCESS) return (rv); vm_fault_fill_hold(m_hold, m); vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, false); VM_OBJECT_RUNLOCK(fs->first_object); - if (!wired) + if (psind == 0 && !wired) vm_fault_prefault(fs, vaddr, PFBAK, PFFOR); vm_map_lookup_done(fs->map, fs->entry); curthread->td_ru.ru_minflt++; Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sun Jul 23 16:11:47 2017 (r321385) +++ head/sys/vm/vm_reserv.c Sun Jul 23 16:28:13 2017 (r321386) @@ -1121,4 +1121,18 @@ vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end, return (new_end); } +/* + * Returns the superpage containing the given page. + */ +vm_page_t +vm_reserv_to_superpage(vm_page_t m) +{ + vm_reserv_t rv; + + VM_OBJECT_ASSERT_LOCKED(m->object); + rv = vm_reserv_from_page(m); + return (rv->object == m->object && rv->popcnt == VM_LEVEL_0_NPAGES ? + rv->pages : NULL); +} + #endif /* VM_NRESERVLEVEL > 0 */ Modified: head/sys/vm/vm_reserv.h ============================================================================== --- head/sys/vm/vm_reserv.h Sun Jul 23 16:11:47 2017 (r321385) +++ head/sys/vm/vm_reserv.h Sun Jul 23 16:28:13 2017 (r321386) @@ -64,6 +64,7 @@ void vm_reserv_rename(vm_page_t m, vm_object_t new_ob int vm_reserv_size(int level); vm_paddr_t vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end, vm_paddr_t high_water); +vm_page_t vm_reserv_to_superpage(vm_page_t m); #endif /* VM_NRESERVLEVEL > 0 */ #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Sun Jul 23 17:57:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34165DA984C; Sun, 23 Jul 2017 17:57:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBDA369359; Sun, 23 Jul 2017 17:57:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NHv06f030493; Sun, 23 Jul 2017 17:57:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NHv08W030492; Sun, 23 Jul 2017 17:57:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707231757.v6NHv08W030492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 23 Jul 2017 17:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321387 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Commit-Revision: 321387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 17:57:02 -0000 Author: ngie Date: Sun Jul 23 17:57:00 2017 New Revision: 321387 URL: https://svnweb.freebsd.org/changeset/base/321387 Log: Don't use incorrect hardcoded path to ksh -- use /usr/bin/env to find ksh instead MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d Sun Jul 23 16:28:13 2017 (r321386) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d Sun Jul 23 17:57:00 2017 (r321387) @@ -1,4 +1,4 @@ -#!/bin/ksh -p +#!/usr/bin/env ksh -p /* * CDDL HEADER START From owner-svn-src-head@freebsd.org Sun Jul 23 18:10:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96714DA9E2A; Sun, 23 Jul 2017 18:10:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C0169D65; Sun, 23 Jul 2017 18:10:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NIAlX4034990; Sun, 23 Jul 2017 18:10:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NIAljj034987; Sun, 23 Jul 2017 18:10:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707231810.v6NIAljj034987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 23 Jul 2017 18:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321390 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 321390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 18:10:48 -0000 Author: np Date: Sun Jul 23 18:10:47 2017 New Revision: 321390 URL: https://svnweb.freebsd.org/changeset/base/321390 Log: cxgbe(4): Install the firmware bundled with the driver to the card if it doesn't seem to have one. This lets the driver recover automatically from incomplete firmware upgrades (panic, reboot, power loss, etc. in the middle of an upgrade). MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sun Jul 23 18:00:11 2017 (r321389) +++ head/sys/dev/cxgbe/common/common.h Sun Jul 23 18:10:47 2017 (r321390) @@ -693,6 +693,8 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, const u8 *fw_data, unsigned int size, int force); +int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, + unsigned int size); int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Jul 23 18:00:11 2017 (r321389) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Jul 23 18:10:47 2017 (r321390) @@ -6745,6 +6745,31 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int m return t4_fw_restart(adap, mbox, reset); } +/* + * Card doesn't have a firmware, install one. + */ +int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, + unsigned int size) +{ + const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; + unsigned int bootstrap = + be32_to_cpu(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; + int ret; + + if (!t4_fw_matches_chip(adap, fw_hdr) || bootstrap) + return -EINVAL; + + t4_set_reg_field(adap, A_CIM_BOOT_CFG, F_UPCRST, F_UPCRST); + t4_write_reg(adap, A_PCIE_FW, 0); /* Clobber internal state */ + ret = t4_load_fw(adap, fw_data, size); + if (ret < 0) + return ret; + t4_write_reg(adap, A_PL_RST, F_PIORST | F_PIORSTMODE); + msleep(1000); + + return (0); +} + /** * t4_fw_initialize - ask FW to initialize the device * @adap: the adapter Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Jul 23 18:00:11 2017 (r321389) +++ head/sys/dev/cxgbe/t4_main.c Sun Jul 23 18:10:47 2017 (r321390) @@ -2968,6 +2968,7 @@ install: return (1); } + /* * Establish contact with the firmware and determine if we are the master driver * or not, and whether we are responsible for chip initialization. @@ -2984,28 +2985,6 @@ prep_firmware(struct adapter *sc) const struct fw_hdr *drv_fw; /* fw header the driver was compiled against */ - /* Contact firmware. */ - rc = t4_fw_hello(sc, sc->mbox, sc->mbox, MASTER_MAY, &state); - if (rc < 0 || state == DEV_STATE_ERR) { - rc = -rc; - device_printf(sc->dev, - "failed to connect to the firmware: %d, %d.\n", rc, state); - return (rc); - } - pf = rc; - if (pf == sc->mbox) - sc->flags |= MASTER_PF; - else if (state == DEV_STATE_UNINIT) { - /* - * We didn't get to be the master so we definitely won't be - * configuring the chip. It's a bug if someone else hasn't - * configured it already. - */ - device_printf(sc->dev, "couldn't be master(%d), " - "device not already initialized either(%d).\n", rc, state); - return (EDOOFUS); - } - /* This is the firmware whose headers the driver was compiled against */ fw_info = find_fw_info(chip_id(sc)); if (fw_info == NULL) { @@ -3022,26 +3001,82 @@ prep_firmware(struct adapter *sc) */ default_cfg = firmware_get(fw_info->kld_name); + /* This is the firmware in the KLD */ + fw = firmware_get(fw_info->fw_mod_name); + if (fw != NULL) { + kld_fw = (const void *)fw->data; + kld_fw_usable = fw_compatible(drv_fw, kld_fw); + } else { + kld_fw = NULL; + kld_fw_usable = 0; + } + /* Read the header of the firmware on the card */ card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK); rc = -t4_read_flash(sc, FLASH_FW_START, sizeof (*card_fw) / sizeof (uint32_t), (uint32_t *)card_fw, 1); - if (rc == 0) + if (rc == 0) { card_fw_usable = fw_compatible(drv_fw, (const void*)card_fw); - else { + if (card_fw->fw_ver == be32toh(0xffffffff)) { + uint32_t d = be32toh(kld_fw->fw_ver); + + if (!kld_fw_usable) { + device_printf(sc->dev, + "no firmware on the card and no usable " + "firmware bundled with the driver.\n"); + rc = EIO; + goto done; + } else if (t4_fw_install == 0) { + device_printf(sc->dev, + "no firmware on the card and the driver " + "is prohibited from installing new " + "firmware.\n"); + rc = EIO; + goto done; + } + + device_printf(sc->dev, "no firmware on the card, " + "installing firmware %d.%d.%d.%d\n", + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); + rc = t4_fw_forceinstall(sc, fw->data, fw->datasize); + if (rc < 0) { + rc = -rc; + device_printf(sc->dev, + "firmware install failed: %d.\n", rc); + goto done; + } + memcpy(card_fw, kld_fw, sizeof(*card_fw)); + card_fw_usable = 1; + need_fw_reset = 0; + } + } else { device_printf(sc->dev, "Unable to read card's firmware header: %d\n", rc); card_fw_usable = 0; } - /* This is the firmware in the KLD */ - fw = firmware_get(fw_info->fw_mod_name); - if (fw != NULL) { - kld_fw = (const void *)fw->data; - kld_fw_usable = fw_compatible(drv_fw, kld_fw); - } else { - kld_fw = NULL; - kld_fw_usable = 0; + /* Contact firmware. */ + rc = t4_fw_hello(sc, sc->mbox, sc->mbox, MASTER_MAY, &state); + if (rc < 0 || state == DEV_STATE_ERR) { + rc = -rc; + device_printf(sc->dev, + "failed to connect to the firmware: %d, %d.\n", rc, state); + goto done; + } + pf = rc; + if (pf == sc->mbox) + sc->flags |= MASTER_PF; + else if (state == DEV_STATE_UNINIT) { + /* + * We didn't get to be the master so we definitely won't be + * configuring the chip. It's a bug if someone else hasn't + * configured it already. + */ + device_printf(sc->dev, "couldn't be master(%d), " + "device not already initialized either(%d).\n", rc, state); + rc = EPROTO; + goto done; } if (card_fw_usable && card_fw->fw_ver == drv_fw->fw_ver && From owner-svn-src-head@freebsd.org Sun Jul 23 18:14:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C207DDAA0ED; Sun, 23 Jul 2017 18:14:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 8E3BB6A290; Sun, 23 Jul 2017 18:14:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id y25so1403808pfk.4; Sun, 23 Jul 2017 11:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=L7P7bmD5yDkrDFbJEfaOTnwIc8ZGwo1xJrJ04znXZ18=; b=qFf1pZbIiFfF4A5QOyzNv1/39Nc3Fr1GdkYWYlMheTGey6u7A2eze5h8pRw/o7hBnt fDDXhJxlI9egzWxD+pF1/cYrc46fXVNFJNXISvS8FpPkFJ1e0HchnAsEAYqgXnBvO3e4 XKVphsJvfuCalTD+H+eejuvyEYUxFheH/y74RUei62SxlbRXlr5u+Ryni4lcgVRA99zs tO11snQEmtd2IdLUjDPazDBELsiMKrNTe2adShp1vU/SN2QylTSvTEwWImomGNeFT15X ZniIO3BewmNjYEddHpSkUN/4d2SjNSJqMz8nBPJox0PiDnHHZicvCU6jdcPF9H7eyFSY zxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=L7P7bmD5yDkrDFbJEfaOTnwIc8ZGwo1xJrJ04znXZ18=; b=nKl8HpgM7YIgp9gcNOI4qUJoyksX4CXhC1AE5pdfBqTdNsC4dEjrlvADei1IbwBz6Y IIL3eK0ffmRiiIpkHxBAI6T29ABtmKZzvFdV6b3PwY8I4Lr70E4vqURKf4cDajjAYaUQ lIm7sbuyamLUYW4dsjN10SCsFMpOjakvxiNZ1YqQUhrs9zcYJoUzEeJvk0sAT9+4GJqm BSgQjXewxxII070gQcZbIgNwKV3q+zO57k67o1JBNgdRuSpftLewIfFY9sZcjxgVu1No oWGJsXIYJjubhc5RaAsRiFCr7/z0r0/EaEnLg29dKyZjYEdY+7BeXR++olW/J8dMftyz tojQ== X-Gm-Message-State: AIVw112vtYYbXiKq+hm5/V7Z5mkRIX2T34YYxSa0RynrDLLPFEPdZvTi 5107MBG6B8PJ3SGEcDc= X-Received: by 10.99.119.139 with SMTP id s133mr13371215pgc.256.1500833697518; Sun, 23 Jul 2017 11:14:57 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p8sm1487089pfj.101.2017.07.23.11.14.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Jul 2017 11:14:56 -0700 (PDT) Subject: Re: svn commit: r321331 - head/share/mk Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_54C233BD-B295-481F-9FD1-882D1305D4AF"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201707211450.v6LEoWCO064640@repo.freebsd.org> Date: Sun, 23 Jul 2017 11:14:54 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <12D1C1EF-EC00-459F-844E-E5EA342EEDF2@gmail.com> References: <201707211450.v6LEoWCO064640@repo.freebsd.org> To: Ruslan Bukin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 18:14:58 -0000 --Apple-Mail=_54C233BD-B295-481F-9FD1-882D1305D4AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 21, 2017, at 07:50, Ruslan Bukin wrote: >=20 > Author: br > Date: Fri Jul 21 14:50:32 2017 > New Revision: 321331 > URL: https://svnweb.freebsd.org/changeset/base/321331 >=20 > Log: > Add warning flags for GCC 7.1.0 compiler. >=20 > Sponsored by: DARPA, AFRL >=20 > Modified: > head/share/mk/bsd.sys.mk >=20 > Modified: head/share/mk/bsd.sys.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/mk/bsd.sys.mk Fri Jul 21 14:14:47 2017 = (r321330) > +++ head/share/mk/bsd.sys.mk Fri Jul 21 14:50:32 2017 = (r321331) > @@ -145,6 +145,23 @@ CWARNFLAGS+=3D = -Wno-error=3Dmisleading-indentation \ > -Wno-error=3Dunused-const-variable > .endif >=20 > +# GCC 7.1.0 > +.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 70100 > +CWARNFLAGS+=3D -Wno-error=3Ddeprecated \ > + -Wno-error=3Dpointer-compare \ > + -Wno-error=3Dformat-truncation \ > + -Wno-error=3Dimplicit-fallthrough \ > + -Wno-error=3Dexpansion-to-defined \ > + -Wno-error=3Dint-in-bool-context \ > + -Wno-error=3Dbool-operation \ > + -Wno-error=3Dformat-overflow \ > + -Wno-error=3Dstringop-overflow \ > + -Wno-error=3Dmemset-elt-size \ > + -Wno-error=3Dint-in-bool-context \ > + -Wno-error=3Dunused-const-variable \ > + -Wno-error=3Dnonnull > +.endif Hi Ruslan, 1. Fixing some of these warnings make sense =E2=80=94 why are we = ignoring them? 2. Why isn=E2=80=99t this being MFCed? gcc 7.1.0 is available on = ^/stable/11 as well. Thanks, -Ngie --Apple-Mail=_54C233BD-B295-481F-9FD1-882D1305D4AF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZdOefAAoJEPWDqSZpMIYVWCIP/iNveEEqws2D7gMNrwPMBA27 jZ1Jn2wQUmyAWao47fPnODX20qGBuJJZWhc6D0pwGp7nVeNOyFFs+v8DzwLNvhRO wucODiaAOUyZs229aAiDz8/K5CfYQ7aEYln+E654K0jFBS8cxTXGQEPSheiwtQg8 2KmjpCrwk7wVOGFPABPfutQS23ABXFYrhetmv367/GKxexnavg+3NZvf7RsdhWPr CCB6DFjcjaBQ8XEKtchpPVb2XclrtEe7kfjxc1BrnXoVyaep4CLbY07Z/pbyBb74 P0iwkmPZOmUR9lqaN1QRdaIv0xNm9rrRx3cj6PWwKwd1RT9IgEf0STB/bY+cCV1H 6bv/VQ2vso0xTAWAXldFuSHCg+BQH1F4DJi+o56IQK/kEgrlGRnIedX5zL53SxgR DBVruMTX9otcomAd/VP7w0TyZvpSxzog++YhispdxMcC5Kl/BsaC4tlOxUkQBx0m 80Yq05uRMXpCIhtOm7OprR5031UOm/iGJ2JHksILs2tTCJBx4NJ2feCFRc1ogeKP 7Mip1AMpZkJ5h/D3zmO5KyvNFrEdrlTyDwZohLOL80+fYq7PUPto7/lQxGGoOSfs i6+5xcLvfivTGd4ynSzZ004sbYbYN6PsgFBofPoX7zUM9h5PWSDn48O7oQJcRh3I 6u3g374TqCqxFHlIqDvc =Orh7 -----END PGP SIGNATURE----- --Apple-Mail=_54C233BD-B295-481F-9FD1-882D1305D4AF-- From owner-svn-src-head@freebsd.org Sun Jul 23 19:00:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF46DAAA79; Sun, 23 Jul 2017 19:00:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED9F86B100; Sun, 23 Jul 2017 19:00:29 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NJ0TSK055241; Sun, 23 Jul 2017 19:00:29 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NJ0TQj055240; Sun, 23 Jul 2017 19:00:29 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201707231900.v6NJ0TQj055240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 23 Jul 2017 19:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321392 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 19:00:30 -0000 Author: mw Date: Sun Jul 23 19:00:28 2017 New Revision: 321392 URL: https://svnweb.freebsd.org/changeset/base/321392 Log: Add myself (mw) as a src committer and cognet as my mentor. Reviewed by: cognet (mentor) Approved by: cognet (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jul 23 18:13:19 2017 (r321391) +++ head/share/misc/committers-src.dot Sun Jul 23 19:00:28 2017 (r321392) @@ -250,6 +250,7 @@ mmel [label="Michal Meloun\nmmel@FreeBSD.org\n2015/11/ monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mp [label="Mark Peek\nmp@FreeBSD.org\n2001/07/27"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] +mw [label="Marcin Wojtas\nmw@FreeBSD.org\n2017/07/18"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] ngie [label="Ngie Cooper\nngie@FreeBSD.org\n2014/07/27"] @@ -420,6 +421,7 @@ cognet -> jceel cognet -> kevlo cognet -> ian cognet -> manu +cognet -> mw cognet -> wkoszek cognet -> wma cognet -> zbb From owner-svn-src-head@freebsd.org Sun Jul 23 19:09:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 929A7DAACE6 for ; Sun, 23 Jul 2017 19:09:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5186B52E for ; Sun, 23 Jul 2017 19:09:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8489506a-6fda-11e7-bfd0-afd4446ba3af X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 8489506a-6fda-11e7-bfd0-afd4446ba3af; Sun, 23 Jul 2017 19:09:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6NJ9iPf006426; Sun, 23 Jul 2017 13:09:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1500836984.24226.316.camel@freebsd.org> Subject: Re: svn commit: r321386 - head/sys/vm From: Ian Lepore To: Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 23 Jul 2017 13:09:44 -0600 In-Reply-To: <201707231628.v6NGSDoa092418@repo.freebsd.org> References: <201707231628.v6NGSDoa092418@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 19:09:53 -0000 On Sun, 2017-07-23 at 16:28 +0000, Alan Cox wrote: > Author: alc > Date: Sun Jul 23 16:28:13 2017 > New Revision: 321386 > URL: https://svnweb.freebsd.org/changeset/base/321386 > > Log: >   Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on > amd64.  (The >   Differential Revision discusses the benefits of this change.) >    >   Add a function, vm_reserv_to_superpage(), that returns the > superpage >   containing the specified base page. >    >   Reviewed by: kib, markj >   Tested by: pho >   MFC after: 10 days >   Differential Revision: https://reviews.freebsd.org/D11556 > > Modified: >   head/sys/vm/vm_fault.c >   head/sys/vm/vm_reserv.c >   head/sys/vm/vm_reserv.h > Arches that build with old gcc 4.2.1 are complaining: /b/staging/freebsd/head/src/sys/vm/vm_fault.c:273:6: error: unused variable 'flags' [-Werror,-Wunused-variable] -- Ian From owner-svn-src-head@freebsd.org Sun Jul 23 19:21:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3021EDAB2C1; Sun, 23 Jul 2017 19:21:58 +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 0084F6BD14; Sun, 23 Jul 2017 19:21:57 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v6NIpHNG022929; Sun, 23 Jul 2017 14:21:49 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 2bv1rj88bv-1; Sun, 23 Jul 2017 14:21:49 -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 B4E0F4003F; Sun, 23 Jul 2017 14:21:48 -0500 (CDT) Subject: Re: svn commit: r321386 - head/sys/vm To: Ian Lepore , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707231628.v6NGSDoa092418@repo.freebsd.org> <1500836984.24226.316.camel@freebsd.org> From: Alan Cox Message-ID: Date: Sun, 23 Jul 2017 14:21:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1500836984.24226.316.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 19:21:58 -0000 On 07/23/2017 14:09, Ian Lepore wrote: > On Sun, 2017-07-23 at 16:28 +0000, Alan Cox wrote: >> Author: alc >> Date: Sun Jul 23 16:28:13 2017 >> New Revision: 321386 >> URL: https://svnweb.freebsd.org/changeset/base/321386 >> >> Log: >> Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on >> amd64. (The >> Differential Revision discusses the benefits of this change.) >> >> Add a function, vm_reserv_to_superpage(), that returns the >> superpage >> containing the specified base page. >> >> Reviewed by: kib, markj >> Tested by: pho >> MFC after: 10 days >> Differential Revision: https://reviews.freebsd.org/D11556 >> >> Modified: >> head/sys/vm/vm_fault.c >> head/sys/vm/vm_reserv.c >> head/sys/vm/vm_reserv.h >> > Arches that build with old gcc 4.2.1 are complaining: > > /b/staging/freebsd/head/src/sys/vm/vm_fault.c:273:6: error: unused > variable 'flags' [-Werror,-Wunused-variable] I see. I'll commit a fix in a few minutes. Thanks. From owner-svn-src-head@freebsd.org Sun Jul 23 19:35:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD6A9DAB75C; Sun, 23 Jul 2017 19:35:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB0A6C354; Sun, 23 Jul 2017 19:35:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NJZEPD071106; Sun, 23 Jul 2017 19:35:14 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NJZEZt071105; Sun, 23 Jul 2017 19:35:14 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707231935.v6NJZEZt071105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 23 Jul 2017 19:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321393 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 321393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 19:35:15 -0000 Author: alc Date: Sun Jul 23 19:35:14 2017 New Revision: 321393 URL: https://svnweb.freebsd.org/changeset/base/321393 Log: Address a compilation warning on some architectures that was introduced by the previous change, r321386. Reported by: ian MFC after: 10 days X-MFC after: r321386 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jul 23 19:00:28 2017 (r321392) +++ head/sys/vm/vm_fault.c Sun Jul 23 19:35:14 2017 (r321393) @@ -269,8 +269,9 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t vm_page_t m, m_map; #if defined(__amd64__) && VM_NRESERVLEVEL > 0 vm_page_t m_super; + int flags; #endif - int flags, psind, rv; + int psind, rv; MPASS(fs->vp == NULL); m = vm_page_lookup(fs->first_object, fs->first_pindex); From owner-svn-src-head@freebsd.org Sun Jul 23 19:44:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71279DABA00 for ; Sun, 23 Jul 2017 19:44:57 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56EAC6C9BC for ; Sun, 23 Jul 2017 19:44:57 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OTK00C006RMPN00@mr11p00im-asmtp001.me.com> for svn-src-head@freebsd.org; Sun, 23 Jul 2017 19:44:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1500839091; bh=sIi6w8MQnPZPCX89ON73YvuvlpZkt6dXb8UUn3G81pU=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=G6H5Xf6PyrXTXb/13pSODE8efzfiX1S9FGEQhK03yrCUJzinLOhTZpttQscZP4znS sjRrQN9jU0KT7QY4Y2/nWZMLov3R+yNov5coW2ZvoAVPqoP/F2sLgeajlmHU4eNXuo cBg2Oouf2Kck/1/gyQrY/mx7GUDEp2Tlhwk0iQp8HYiaoOx4cRWp5rAWEipGgSjGhf G91JxMwbJd+8uT67mDABFNQhKfd/Yqcv6tQvTnD5kjwFUKNXMHxxCJMPGZp7JuZRve ZBClAouLxn8vA12ZmG1v31NjSUOghEsXS4iRsGJ+Fh2cJF3SSvvFQyWMVt9rz8p4IB Sx0d2cZvcjerA== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OTK007DA6UOE630@mr11p00im-asmtp001.me.com> for svn-src-head@freebsd.org; Sun, 23 Jul 2017 19:44:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-23_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1707230314 User-Agent: Microsoft-MacOutlook/f.24.1.170721 Date: Sun, 23 Jul 2017 12:44:48 -0700 Subject: libstdc++ build failures on MIPS, PowerPC, Sparc From: Ravi Pokala To: "svn-src-head@freebsd.org" Message-id: <526FA7D8-746D-45AD-B224-72183D967A73@mac.com> Thread-topic: libstdc++ build failures on MIPS, PowerPC, Sparc MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 19:44:57 -0000 Hi all, I did a tinderbox build of -HEAD as of r321376; there were failures like this (paths shortened): c++ -isystem ${OUTDIR}/tmp/usr/include/c++/v1 -std=c++11 -nostdinc++ -isystem ${OUTDIR}/tmp/usr/include -L${OUTDIR}/tmp/usr/lib -B${OUTDIR}/tmp/usr/lib --sysroot=${OUTDIR}/tmp -B${OUTDIR}/tmp/usr/bin -O -pipe -G0 -EB -mabi=32 -msoft-float -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -I${SRCDIR}/gnu/lib/libstdc++ -I${SRCDIR}/contrib/libstdc++/libsupc++ -I${SRCDIR}/contrib/gcc -I${SRCDIR}/contrib/libstdc++/include -I${SRCDIR}/contrib/gcclibs/include -I${SRCDIR}/contrib/libstdc++/include -I. -frandom-seed=RepeatabilityConsideredGood -fno-implicit-templates -ffunction-sections -fdata-sections -Wno-deprecated -c ${SRCDIR}/contrib/libstdc++/src/bitmap_allocator.cc -o bitmap_allocator.o cc1plus: error: unrecognized command line option "-std=c++11" *** [bitmap_allocator.o] Error code 1 on multiple worlds: [threepio:clean/base/head] rpokala% egrep -l 'stopped in .*libstdc' _.*buildworld _.mips.mips.buildworld _.mips.mips64.buildworld _.mips.mips64el.buildworld _.mips.mips64elhf.buildworld _.mips.mips64hf.buildworld _.mips.mipsel.buildworld _.mips.mipselhf.buildworld _.mips.mipshf.buildworld _.mips.mipsn32.buildworld _.powerpc.powerpc.buildworld _.powerpc.powerpc64.buildworld _.powerpc.powerpcspe.buildworld _.sparc64.sparc64.buildworld No interesting build environment, just MAKEOBJDIRPREFIX and JFLAGS; clean sources and empty output directory. Thanks, Ravi From owner-svn-src-head@freebsd.org Sun Jul 23 20:25:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB34DAC7A9; Sun, 23 Jul 2017 20:25:54 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99DFA6E275; Sun, 23 Jul 2017 20:25:54 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NKPrDP091559; Sun, 23 Jul 2017 20:25:53 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NKPrOe091556; Sun, 23 Jul 2017 20:25:53 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707232025.v6NKPrOe091556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 23 Jul 2017 20:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321396 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 321396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 20:25:54 -0000 Author: pstef Date: Sun Jul 23 20:25:53 2017 New Revision: 321396 URL: https://svnweb.freebsd.org/changeset/base/321396 Log: indent(1): better alignment of comments on code. If aligning the beginning of a comment to -cn would mean no space between code and the comment, align it to the next tab stop. Modified: head/usr.bin/indent/pr_comment.c head/usr.bin/indent/tests/comments.0 head/usr.bin/indent/tests/comments.0.stdout Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/pr_comment.c Sun Jul 23 20:25:53 2017 (r321396) @@ -141,7 +141,7 @@ pr_comment(void) target_col = count_spaces(compute_label_target(), s_lab); } ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind; - if (ps.com_col < target_col) + if (ps.com_col <= target_col) ps.com_col = ((target_col + 7) & ~7) + 1; if (ps.com_col + 24 > adj_max_col) adj_max_col = ps.com_col + 24; Modified: head/usr.bin/indent/tests/comments.0 ============================================================================== --- head/usr.bin/indent/tests/comments.0 Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/tests/comments.0 Sun Jul 23 20:25:53 2017 (r321396) @@ -1,4 +1,11 @@ /* $FreeBSD$ */ +typedef enum x { + aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ + bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ + cccccccccccccc = 1 << 1, /* test c */ + dddddddddddddddddddddddddddddd = 1 << 2 /* test d */ +} x; + /* See r303597, r303598, r309219, and r309343 */ void t(void) { /* Modified: head/usr.bin/indent/tests/comments.0.stdout ============================================================================== --- head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 20:25:53 2017 (r321396) @@ -1,4 +1,11 @@ /* $FreeBSD$ */ +typedef enum x { + aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ + bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ + cccccccccccccc = 1 << 1, /* test c */ + dddddddddddddddddddddddddddddd = 1 << 2 /* test d */ +} x; + /* See r303597, r303598, r309219, and r309343 */ void t(void) From owner-svn-src-head@freebsd.org Sun Jul 23 20:32:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82837DACB7B; Sun, 23 Jul 2017 20:32:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54CA06E6C5; Sun, 23 Jul 2017 20:32:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NKWtGY095663; Sun, 23 Jul 2017 20:32:55 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NKWsMv095656; Sun, 23 Jul 2017 20:32:54 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201707232032.v6NKWsMv095656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 23 Jul 2017 20:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321397 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 321397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 20:32:56 -0000 Author: wulf Date: Sun Jul 23 20:32:54 2017 New Revision: 321397 URL: https://svnweb.freebsd.org/changeset/base/321397 Log: evdev: style(9), sort headers alphabetically Pointed out by: bde Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Modified: head/sys/dev/evdev/cdev.c head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev_mt.c head/sys/dev/evdev/evdev_private.h head/sys/dev/evdev/evdev_utils.c head/sys/dev/evdev/input.h head/sys/dev/evdev/uinput.c Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/cdev.c Sun Jul 23 20:32:54 2017 (r321397) @@ -29,24 +29,23 @@ #include "opt_evdev.h" -#include -#include -#include #include -#include +#include #include -#include -#include -#include #include #include -#include +#include #include +#include +#include +#include +#include #include +#include -#include #include #include +#include #ifdef EVDEV_DEBUG #define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args) Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/evdev.c Sun Jul 23 20:32:54 2017 (r321397) @@ -29,19 +29,18 @@ #include "opt_evdev.h" -#include -#include #include -#include -#include +#include #include +#include #include -#include +#include #include +#include -#include #include #include +#include #ifdef EVDEV_DEBUG #define debugf(evdev, fmt, args...) printf("evdev: " fmt "\n", ##args) Modified: head/sys/dev/evdev/evdev_mt.c ============================================================================== --- head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:32:54 2017 (r321397) @@ -27,14 +27,14 @@ */ #include -#include #include +#include #include #include -#include #include #include +#include #ifdef DEBUG #define debugf(fmt, args...) printf("evdev: " fmt "\n", ##args) Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:32:54 2017 (r321397) @@ -31,10 +31,11 @@ #define _DEV_EVDEV_EVDEV_PRIVATE_H #include -#include -#include #include +#include +#include #include + #include #include #include Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/evdev_utils.c Sun Jul 23 20:32:54 2017 (r321397) @@ -27,17 +27,16 @@ * $FreeBSD$ */ -#include -#include #include #include -#include #include -#include #include +#include +#include +#include -#include #include +#include #include Modified: head/sys/dev/evdev/input.h ============================================================================== --- head/sys/dev/evdev/input.h Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/input.h Sun Jul 23 20:32:54 2017 (r321397) @@ -31,8 +31,8 @@ #define _EVDEV_INPUT_H #ifndef __KERNEL__ -#include #include +#include #include #endif Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Sun Jul 23 20:25:53 2017 (r321396) +++ head/sys/dev/evdev/uinput.c Sun Jul 23 20:32:54 2017 (r321397) @@ -29,25 +29,24 @@ #include "opt_evdev.h" -#include -#include #include +#include #include #include +#include +#include #include -#include -#include -#include #include +#include #include -#include -#include +#include #include +#include -#include -#include #include #include +#include +#include #ifdef UINPUT_DEBUG #define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args) From owner-svn-src-head@freebsd.org Sun Jul 23 20:35:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EEC1DACC7A; Sun, 23 Jul 2017 20:35:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E6E6E85B; Sun, 23 Jul 2017 20:35:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NKZRVP095816; Sun, 23 Jul 2017 20:35:27 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NKZRm8095812; Sun, 23 Jul 2017 20:35:27 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201707232035.v6NKZRm8095812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 23 Jul 2017 20:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321398 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 321398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 20:35:28 -0000 Author: wulf Date: Sun Jul 23 20:35:26 2017 New Revision: 321398 URL: https://svnweb.freebsd.org/changeset/base/321398 Log: evdev: Macroize common locking sequences Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Modified: head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev_mt.c head/sys/dev/evdev/evdev_private.h Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sun Jul 23 20:32:54 2017 (r321397) +++ head/sys/dev/evdev/evdev.c Sun Jul 23 20:35:26 2017 (r321398) @@ -757,14 +757,11 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ int32_t value) { - if (evdev->ev_lock_type != EV_LOCK_INTERNAL) - EVDEV_LOCK_ASSERT(evdev); - if (evdev_check_event(evdev, type, code, value) != 0) return (EINVAL); - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_LOCK(evdev); + EVDEV_ENTER(evdev); + evdev_modify_event(evdev, type, code, &value); if (type == EV_SYN && code == SYN_REPORT && bit_test(evdev->ev_flags, EVDEV_FLAG_MT_AUTOREL)) @@ -773,8 +770,8 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ bit_test(evdev->ev_flags, EVDEV_FLAG_MT_STCOMPAT)) evdev_send_mt_compat(evdev); evdev_send_event(evdev, type, code, value); - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_UNLOCK(evdev); + + EVDEV_EXIT(evdev); return (0); } Modified: head/sys/dev/evdev/evdev_mt.c ============================================================================== --- head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:32:54 2017 (r321397) +++ head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:35:26 2017 (r321398) @@ -224,13 +224,9 @@ void evdev_push_nfingers(struct evdev_dev *evdev, int32_t nfingers) { - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_LOCK(evdev); - else - EVDEV_LOCK_ASSERT(evdev); + EVDEV_ENTER(evdev); evdev_send_nfingers(evdev, nfingers); - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_UNLOCK(evdev); + EVDEV_EXIT(evdev); } void @@ -264,13 +260,9 @@ void evdev_push_mt_compat(struct evdev_dev *evdev) { - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_LOCK(evdev); - else - EVDEV_LOCK_ASSERT(evdev); + EVDEV_ENTER(evdev); evdev_send_mt_compat(evdev); - if (evdev->ev_lock_type == EV_LOCK_INTERNAL) - EVDEV_UNLOCK(evdev); + EVDEV_EXIT(evdev); } void Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:32:54 2017 (r321397) +++ head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:35:26 2017 (r321398) @@ -135,6 +135,16 @@ struct evdev_dev #define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock) #define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock) #define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED) +#define EVDEV_ENTER(evdev) do { \ + if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \ + EVDEV_LOCK(evdev); \ + else \ + EVDEV_LOCK_ASSERT(evdev); \ +} while (0) +#define EVDEV_EXIT(evdev) do { \ + if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \ + EVDEV_UNLOCK(evdev); \ +} while (0) struct evdev_client { From owner-svn-src-head@freebsd.org Sun Jul 23 20:42:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F90DDACFD5; Sun, 23 Jul 2017 20:42:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4526EDA3; Sun, 23 Jul 2017 20:42:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NKfxGP096890; Sun, 23 Jul 2017 20:41:59 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NKfw9Q096880; Sun, 23 Jul 2017 20:41:58 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201707232041.v6NKfw9Q096880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 23 Jul 2017 20:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321399 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 321399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 20:42:00 -0000 Author: wulf Date: Sun Jul 23 20:41:58 2017 New Revision: 321399 URL: https://svnweb.freebsd.org/changeset/base/321399 Log: Change my email address to wulf@FreeBSD.org in copyright headers. Approved by: gonzo (mentor) MFC after: 2 weeks Modified: head/sys/dev/evdev/cdev.c head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev_mt.c head/sys/dev/evdev/evdev_private.h head/sys/dev/evdev/evdev_utils.c head/sys/dev/evdev/input-event-codes.h head/sys/dev/evdev/input.h head/sys/dev/evdev/uinput.c head/sys/dev/evdev/uinput.h Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/cdev.c Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Jakub Wojciech Klama - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/evdev.c Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Jakub Wojciech Klama - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/evdev_mt.c ============================================================================== --- head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/evdev_mt.c Sun Jul 23 20:41:58 2017 (r321399) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Vladimir Kondratyev + * Copyright (c) 2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/evdev_private.h Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Jakub Wojciech Klama - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/evdev_utils.c Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Jakub Wojciech Klama - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/input-event-codes.h ============================================================================== --- head/sys/dev/evdev/input-event-codes.h Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/input-event-codes.h Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2016 Oleksandr Tymoshenko - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/input.h ============================================================================== --- head/sys/dev/evdev/input.h Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/input.h Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2016 Oleksandr Tymoshenko - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/uinput.c Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Jakub Wojciech Klama - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/evdev/uinput.h ============================================================================== --- head/sys/dev/evdev/uinput.h Sun Jul 23 20:35:26 2017 (r321398) +++ head/sys/dev/evdev/uinput.h Sun Jul 23 20:41:58 2017 (r321399) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2016 Oleksandr Tymoshenko - * Copyright (c) 2015-2016 Vladimir Kondratyev + * Copyright (c) 2015-2016 Vladimir Kondratyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Sun Jul 23 21:28:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C09DAE0FA; Sun, 23 Jul 2017 21:28:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9A9C705D8; Sun, 23 Jul 2017 21:28:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NLS0tJ016214; Sun, 23 Jul 2017 21:28:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NLS0Gs016213; Sun, 23 Jul 2017 21:28:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707232128.v6NLS0Gs016213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Jul 2017 21:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321400 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 21:28:02 -0000 Author: ian Date: Sun Jul 23 21:28:00 2017 New Revision: 321400 URL: https://svnweb.freebsd.org/changeset/base/321400 Log: Add common code to support realtime clocks that store year without century. Most realtime clocks store the year as 2 BCD digits. Some add a century bit to extend the range another hundred years. Every clock driver has its own code to determine the century and pass a full year value to clock_ct_to_ts(). Now clock drivers can just convert BCD to bin and store the result in the clocktime struct and let the common code figure out the century. Clocks with a century bit can just add 100 to year if the century bit is on. Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Sun Jul 23 20:41:58 2017 (r321399) +++ head/sys/kern/subr_clock.c Sun Jul 23 21:28:00 2017 (r321400) @@ -142,18 +142,27 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * { int i, year, days; - year = ct->year; - if (ct_debug) { printf("ct_to_ts("); print_ct(ct); printf(")"); } + /* + * Many realtime clocks store the year as 2-digit BCD; pivot on 70 to + * determine century. Some clocks have a "century bit" and drivers do + * year += 100, so interpret values between 70-199 as relative to 1900. + */ + year = ct->year; + if (year < 70) + year += 2000; + else if (year < 200) + year += 1900; + /* Sanity checks. */ if (ct->mon < 1 || ct->mon > 12 || ct->day < 1 || ct->day > days_in_month(year, ct->mon) || - ct->hour > 23 || ct->min > 59 || ct->sec > 59 || + ct->hour > 23 || ct->min > 59 || ct->sec > 59 || year < 1970 || (sizeof(time_t) == 4 && year > 2037)) { /* time_t overflow */ if (ct_debug) printf(" = EINVAL\n"); From owner-svn-src-head@freebsd.org Sun Jul 23 22:10:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D35DAEB69; Sun, 23 Jul 2017 22:10:50 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 859AC71638; Sun, 23 Jul 2017 22:10:50 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:15823) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1dZP5L-000rLX-dC (Exim 4.89) (return-path ); Sun, 23 Jul 2017 23:10:47 +0100 Date: Sun, 23 Jul 2017 22:05:57 +0000 From: Ruslan Bukin To: "Ngie Cooper (yaneurabeya)" Cc: Ruslan Bukin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321331 - head/share/mk Message-ID: <20170723220557.GA79777@bsdpad.com> References: <201707211450.v6LEoWCO064640@repo.freebsd.org> <12D1C1EF-EC00-459F-844E-E5EA342EEDF2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12D1C1EF-EC00-459F-844E-E5EA342EEDF2@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 22:10:50 -0000 On Sun, Jul 23, 2017 at 11:14:54AM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Jul 21, 2017, at 07:50, Ruslan Bukin wrote: > > > > Author: br > > Date: Fri Jul 21 14:50:32 2017 > > New Revision: 321331 > > URL: https://svnweb.freebsd.org/changeset/base/321331 > > > > Log: > > Add warning flags for GCC 7.1.0 compiler. > > > > Sponsored by: DARPA, AFRL > > > > Modified: > > head/share/mk/bsd.sys.mk > > > > Modified: head/share/mk/bsd.sys.mk > > ============================================================================== > > --- head/share/mk/bsd.sys.mk Fri Jul 21 14:14:47 2017 (r321330) > > +++ head/share/mk/bsd.sys.mk Fri Jul 21 14:50:32 2017 (r321331) > > @@ -145,6 +145,23 @@ CWARNFLAGS+= -Wno-error=misleading-indentation \ > > -Wno-error=unused-const-variable > > .endif > > > > +# GCC 7.1.0 > > +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100 > > +CWARNFLAGS+= -Wno-error=deprecated \ > > + -Wno-error=pointer-compare \ > > + -Wno-error=format-truncation \ > > + -Wno-error=implicit-fallthrough \ > > + -Wno-error=expansion-to-defined \ > > + -Wno-error=int-in-bool-context \ > > + -Wno-error=bool-operation \ > > + -Wno-error=format-overflow \ > > + -Wno-error=stringop-overflow \ > > + -Wno-error=memset-elt-size \ > > + -Wno-error=int-in-bool-context \ > > + -Wno-error=unused-const-variable \ > > + -Wno-error=nonnull > > +.endif > > Hi Ruslan, > 1. Fixing some of these warnings make sense — why are we ignoring them? > 2. Why isn’t this being MFCed? gcc 7.1.0 is available on ^/stable/11 as well. This is mostly for upcoming RISC-V update to support new privilege specification. I did not try this on other architectures as my current goal is to support latest RISC-V. Ruslan From owner-svn-src-head@freebsd.org Sun Jul 23 22:38:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90F85DAF1D7; Sun, 23 Jul 2017 22:38:01 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 600CF71F94; Sun, 23 Jul 2017 22:38:01 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NMc0lG044200; Sun, 23 Jul 2017 22:38:00 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NMc0jD044198; Sun, 23 Jul 2017 22:38:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707232238.v6NMc0jD044198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 23 Jul 2017 22:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321401 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 321401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Jul 2017 22:38:01 -0000 Author: avos Date: Sun Jul 23 22:38:00 2017 New Revision: 321401 URL: https://svnweb.freebsd.org/changeset/base/321401 Log: net80211: do not allow to unload rate control module if it is still in use. Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active wlan(4) interface will not lead to kernel panic. MFC after: 5 days Modified: head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_rssadapt.c Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Sun Jul 23 21:28:00 2017 (r321400) +++ head/sys/net80211/ieee80211_amrr.c Sun Jul 23 22:38:00 2017 (r321401) @@ -117,6 +117,7 @@ amrr_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__)); + nrefs++; /* XXX locking */ amrr = vap->iv_rs = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (amrr == NULL) { @@ -133,6 +134,8 @@ static void amrr_deinit(struct ieee80211vap *vap) { IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } /* Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Sun Jul 23 21:28:00 2017 (r321400) +++ head/sys/net80211/ieee80211_rssadapt.c Sun Jul 23 22:38:00 2017 (r321401) @@ -130,7 +130,8 @@ rssadapt_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s: iv_rs already initialized", __func__)); - + + nrefs++; /* XXX locking */ vap->iv_rs = rs = IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (rs == NULL) { @@ -146,6 +147,8 @@ static void rssadapt_deinit(struct ieee80211vap *vap) { IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static void From owner-svn-src-head@freebsd.org Mon Jul 24 03:32:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A39EDB582F; Mon, 24 Jul 2017 03:32:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF9F77E125; Mon, 24 Jul 2017 03:32:11 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O3WAxo064359; Mon, 24 Jul 2017 03:32:10 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O3WAbh064357; Mon, 24 Jul 2017 03:32:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707240332.v6O3WAbh064357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 24 Jul 2017 03:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321406 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 03:32:12 -0000 Author: sephe Date: Mon Jul 24 03:32:10 2017 New Revision: 321406 URL: https://svnweb.freebsd.org/changeset/base/321406 Log: ethernet: Add ethernet interface attached event and devctl notification. ifnet_arrival_event may not be adequate under certain situation; e.g. when the LLADDR is needed. So the ethernet ifattach event is announced after all necessary bits are setup. MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11617 Modified: head/sys/net/ethernet.h head/sys/net/if_ethersubr.c Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Mon Jul 24 02:13:46 2017 (r321405) +++ head/sys/net/ethernet.h Mon Jul 24 03:32:10 2017 (r321406) @@ -406,6 +406,12 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); +#ifdef _SYS_EVENTHANDLER_H_ +/* new ethernet interface attached event */ +typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); +EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); +#endif + #else /* _KERNEL */ #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Jul 24 02:13:46 2017 (r321405) +++ head/sys/net/if_ethersubr.c Mon Jul 24 03:32:10 2017 (r321406) @@ -38,6 +38,8 @@ #include #include +#include +#include #include #include #include @@ -931,6 +933,11 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); uuid_ether_add(LLADDR(sdl)); + + /* Add necessary bits are setup; announce it now. */ + EVENTHANDLER_INVOKE(ether_ifattach_event, ifp); + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("ETHERNET", ifp->if_xname, "IFATTACH", NULL); } /* From owner-svn-src-head@freebsd.org Mon Jul 24 03:52:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C24ECDB5FB6; Mon, 24 Jul 2017 03:52:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5817EB95; Mon, 24 Jul 2017 03:52:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O3qW1M074723; Mon, 24 Jul 2017 03:52:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O3qWEN074721; Mon, 24 Jul 2017 03:52:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707240352.v6O3qWEN074721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 24 Jul 2017 03:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321407 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 03:52:33 -0000 Author: sephe Date: Mon Jul 24 03:52:32 2017 New Revision: 321407 URL: https://svnweb.freebsd.org/changeset/base/321407 Log: hyperv/hn: Export VF list and VF-HN mapping The VF-HN map will be used later on to implement "transparent VF". MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11618 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 24 03:32:10 2017 (r321406) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 24 03:52:32 2017 (r321407) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -119,6 +121,8 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX 8 +#define HN_VFMAP_SIZE_DEF 8 + /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 @@ -255,6 +259,11 @@ static int hn_ifmedia_upd(struct ifnet *); static void hn_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void hn_ifnet_event(void *, struct ifnet *, int); +static void hn_ifaddr_event(void *, struct ifnet *); +static void hn_ifnet_attevent(void *, struct ifnet *); +static void hn_ifnet_detevent(void *, struct ifnet *); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -303,6 +312,9 @@ static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARG static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vflist_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -502,9 +514,21 @@ static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); +/* VF list */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vflist_sysctl, "A", "VF list"); + +/* VF mapping */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); + static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +static struct rmlock hn_vfmap_lock; +static int hn_vfmap_size; +static struct ifnet **hn_vfmap; + #ifndef RSS static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { @@ -971,7 +995,7 @@ hn_update_vf_task(void *arg, int pending __unused) { struct hn_update_vf *uv = arg; - uv->rxr->hn_vf = uv->vf; + uv->rxr->hn_rxvf_ifp = uv->vf; } static void @@ -994,37 +1018,50 @@ hn_update_vf(struct hn_softc *sc, struct ifnet *vf) uv.vf = vf; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_vf = vf; + rxr->hn_rxvf_ifp = vf; } } } -static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +static __inline bool +hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { - struct ifnet *hn_ifp; + const struct ifnet *hn_ifp; - HN_LOCK(sc); - - if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) - goto out; - hn_ifp = sc->hn_ifp; if (ifp == hn_ifp) - goto out; + return (false); if (ifp->if_alloctype != IFT_ETHER) - goto out; + return (false); /* Ignore lagg/vlan interfaces */ if (strcmp(ifp->if_dname, "lagg") == 0 || strcmp(ifp->if_dname, "vlan") == 0) - goto out; + return (false); if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + return (false); + + return (true); +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) goto out; + if (!hn_ismyvf(sc, ifp)) + goto out; + + hn_ifp = sc->hn_ifp; + /* Now we're sure 'ifp' is a real VF device. */ if (vf) { if (sc->hn_flags & HN_FLAG_VF) @@ -1037,7 +1074,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool goto out; sc->hn_flags &= ~HN_FLAG_VF; - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); @@ -1052,7 +1089,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); - if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { hn_resume_mgmt(sc); } @@ -1082,6 +1119,85 @@ hn_ifaddr_event(void *arg, struct ifnet *ifp) hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); } +static void +hn_ifnet_attevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + if (sc->hn_vf_ifp != NULL) { + if_printf(sc->hn_ifp, "%s was attached as VF\n", + sc->hn_vf_ifp->if_xname); + goto done; + } + + rm_wlock(&hn_vfmap_lock); + + if (ifp->if_index >= hn_vfmap_size) { + struct ifnet **newmap; + int newsize; + + newsize = ifp->if_index + HN_VFMAP_SIZE_DEF; + newmap = malloc(sizeof(struct ifnet *) * newsize, M_DEVBUF, + M_WAITOK | M_ZERO); + + memcpy(newmap, hn_vfmap, + sizeof(struct ifnet *) * hn_vfmap_size); + free(hn_vfmap, M_DEVBUF); + hn_vfmap = newmap; + hn_vfmap_size = newsize; + } + KASSERT(hn_vfmap[ifp->if_index] == NULL, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = sc->hn_ifp; + + rm_wunlock(&hn_vfmap_lock); + + sc->hn_vf_ifp = ifp; +done: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_detevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (sc->hn_vf_ifp == NULL) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + sc->hn_vf_ifp = NULL; + + rm_wlock(&hn_vfmap_lock); + + KASSERT(ifp->if_index < hn_vfmap_size, + ("ifindex %d, vfmapsize %d", ifp->if_index, hn_vfmap_size)); + if (hn_vfmap[ifp->if_index] != NULL) { + KASSERT(hn_vfmap[ifp->if_index] == sc->hn_ifp, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, + hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = NULL; + } + + rm_wunlock(&hn_vfmap_lock); +done: + HN_UNLOCK(sc); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1322,6 +1438,9 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_vf_sysctl, "A", "Virtual Function's name"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxvf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rxvf_sysctl, "A", "activated Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -1412,10 +1531,14 @@ hn_attach(device_t dev) sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); - sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, + hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, + hn_ifnet_detevent, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1428,13 +1551,26 @@ static int hn_detach(device_t dev) { struct hn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp = sc->hn_ifp, *vf_ifp; if (sc->hn_ifaddr_evthand != NULL) EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); if (sc->hn_ifnet_evthand != NULL) EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_ifnet_atthand != NULL) { + EVENTHANDLER_DEREGISTER(ether_ifattach_event, + sc->hn_ifnet_atthand); + } + if (sc->hn_ifnet_dethand != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + sc->hn_ifnet_dethand); + } + vf_ifp = sc->hn_vf_ifp; + __compiler_membar(); + if (vf_ifp != NULL) + hn_ifnet_detevent(sc, vf_ifp); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -2326,7 +2462,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int int hash_type; /* If the VF is active, inject the packet through the VF */ - ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : rxr->hn_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3301,12 +3437,12 @@ static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - char vf_name[128]; + char vf_name[IFNAMSIZ + 1]; struct ifnet *vf; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_vf; + vf = sc->hn_vf_ifp; if (vf != NULL) snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); HN_UNLOCK(sc); @@ -3314,6 +3450,110 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[IFNAMSIZ + 1]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int +hn_vflist_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp; + + if (hn_vfmap[i] == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) + sbuf_printf(sb, "%s", ifp->if_xname); + else + sbuf_printf(sb, " %s", ifp->if_xname); + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int +hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp, *hn_ifp; + + hn_ifp = hn_vfmap[i]; + if (hn_ifp == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) { + sbuf_printf(sb, "%s:%s", ifp->if_xname, + hn_ifp->if_xname); + } else { + sbuf_printf(sb, " %s:%s", ifp->if_xname, + hn_ifp->if_xname); + } + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -5829,11 +6069,19 @@ hn_chan_callback(struct vmbus_channel *chan, void *xrx } static void -hn_tx_taskq_create(void *arg __unused) +hn_sysinit(void *arg __unused) { int i; /* + * Initialize VF map. + */ + rm_init_flags(&hn_vfmap_lock, "hn_vfmap", RM_SLEEPABLE); + hn_vfmap_size = HN_VFMAP_SIZE_DEF; + hn_vfmap = malloc(sizeof(struct ifnet *) * hn_vfmap_size, M_DEVBUF, + M_WAITOK | M_ZERO); + + /* * Fix the # of TX taskqueues. */ if (hn_tx_taskq_cnt <= 0) @@ -5869,11 +6117,10 @@ hn_tx_taskq_create(void *arg __unused) "hn tx%d", i); } } -SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_create, NULL); +SYSINIT(hn_sysinit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysinit, NULL); static void -hn_tx_taskq_destroy(void *arg __unused) +hn_sysuninit(void *arg __unused) { if (hn_tx_taskque != NULL) { @@ -5883,6 +6130,9 @@ hn_tx_taskq_destroy(void *arg __unused) taskqueue_free(hn_tx_taskque[i]); free(hn_tx_taskque, M_DEVBUF); } + + if (hn_vfmap != NULL) + free(hn_vfmap, M_DEVBUF); + rm_destroy(&hn_vfmap_lock); } -SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_destroy, NULL); +SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 24 03:32:10 2017 (r321406) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 24 03:52:32 2017 (r321407) @@ -59,7 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct ifnet *hn_vf; /* SR-IOV VF */ + struct ifnet *hn_rxvf_ifp; /* SR-IOV VF for RX */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -174,6 +174,7 @@ struct hn_tx_ring { */ struct hn_softc { struct ifnet *hn_ifp; + struct ifnet *hn_vf_ifp; /* SR-IOV VF */ struct ifmedia hn_media; device_t hn_dev; int hn_if_flags; @@ -238,6 +239,8 @@ struct hn_softc { eventhandler_tag hn_ifaddr_evthand; eventhandler_tag hn_ifnet_evthand; + eventhandler_tag hn_ifnet_atthand; + eventhandler_tag hn_ifnet_dethand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 From owner-svn-src-head@freebsd.org Mon Jul 24 03:59:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F2F7DB611C; Mon, 24 Jul 2017 03:59:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A507B7EDEB; Mon, 24 Jul 2017 03:59:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O3xoFb075019; Mon, 24 Jul 2017 03:59:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O3xoAL075018; Mon, 24 Jul 2017 03:59:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707240359.v6O3xoAL075018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 24 Jul 2017 03:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321408 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 03:59:52 -0000 Author: sephe Date: Mon Jul 24 03:59:50 2017 New Revision: 321408 URL: https://svnweb.freebsd.org/changeset/base/321408 Log: rndis: Add LINK_SPEED_CHANGE status Reviewed by: hselasky MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11650 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Mon Jul 24 03:52:32 2017 (r321407) +++ head/sys/net/rndis.h Mon Jul 24 03:59:50 2017 (r321408) @@ -31,6 +31,7 @@ #define RNDIS_STATUS_PENDING 0x00000103L #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L #define RNDIS_STATUS_NETWORK_CHANGE 0x40010018L #define RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG 0x40020006L #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L From owner-svn-src-head@freebsd.org Mon Jul 24 04:00:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7838DB619B; Mon, 24 Jul 2017 04:00:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755C27EF94; Mon, 24 Jul 2017 04:00:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O40hON075865; Mon, 24 Jul 2017 04:00:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O40htX075864; Mon, 24 Jul 2017 04:00:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707240400.v6O40htX075864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 24 Jul 2017 04:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321409 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 04:00:44 -0000 Author: sephe Date: Mon Jul 24 04:00:43 2017 New Revision: 321409 URL: https://svnweb.freebsd.org/changeset/base/321409 Log: hyperv/hn: Ignore LINK_SPEED_CHANGE status. This status will be reported if the backend NIC is wireless; it's not useful. Due to the high frequency of the reporting, this could be pretty annoying; ignore it. MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11651 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 24 03:59:50 2017 (r321408) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 24 04:00:43 2017 (r321409) @@ -5574,6 +5574,7 @@ hn_rndis_rx_status(struct hn_softc *sc, const void *da break; case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: + case RNDIS_STATUS_LINK_SPEED_CHANGE: /* Not really useful; ignore. */ break; From owner-svn-src-head@freebsd.org Mon Jul 24 04:38:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3992DDB67E8; Mon, 24 Jul 2017 04:38:07 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0675B7FB79; Mon, 24 Jul 2017 04:38:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O4c6d6090969; Mon, 24 Jul 2017 04:38:06 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O4c5fR090961; Mon, 24 Jul 2017 04:38:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201707240438.v6O4c5fR090961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 24 Jul 2017 04:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321410 - in head: contrib/bmake usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake usr.bin/bmake X-SVN-Commit-Revision: 321410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 04:38:07 -0000 Author: sjg Date: Mon Jul 24 04:38:05 2017 New Revision: 321410 URL: https://svnweb.freebsd.org/changeset/base/321410 Log: Import bmake-20170720 Includes fix for compat handling of interrupts. Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/compat.c head/contrib/bmake/job.c head/contrib/bmake/make.h head/contrib/bmake/nonints.h head/usr.bin/bmake/Makefile head/usr.bin/bmake/Makefile.inc Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/ChangeLog Mon Jul 24 04:38:05 2017 (r321410) @@ -1,3 +1,10 @@ +2017-07-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170720 + Merge with NetBSD make, pick up + o compat.c: pass SIGINT etc onto child and wait for it to exit + before we self-terminate. + 2017-07-11 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170711 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/Makefile Mon Jul 24 04:38:05 2017 (r321410) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.94 2017/07/15 18:22:14 sjg Exp $ +# $Id: Makefile,v 1.95 2017/07/20 19:36:13 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170711 +_MAKE_VERSION= 20170720 PROG= bmake Modified: head/contrib/bmake/compat.c ============================================================================== --- head/contrib/bmake/compat.c Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/compat.c Mon Jul 24 04:38:05 2017 (r321410) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */ +/* $NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"); +__RCSID("$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -118,6 +118,8 @@ __RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 static GNode *curTarg = NULL; static GNode *ENDNode; static void CompatInterrupt(int); +static pid_t compatChild; +static int compatSigno; /* * CompatDeleteTarget -- delete a failed, interrupted, or otherwise @@ -176,8 +178,17 @@ CompatInterrupt(int signo) } if (signo == SIGQUIT) _exit(signo); - bmake_signal(signo, SIG_DFL); - kill(myPid, signo); + /* + * If there is a child running, pass the signal on + * we will exist after it has exited. + */ + compatSigno = signo; + if (compatChild > 0) { + KILLPG(compatChild, signo); + } else { + bmake_signal(signo, SIG_DFL); + kill(myPid, signo); + } } /*- @@ -370,7 +381,7 @@ again: /* * Fork and execute the single command. If the fork fails, we abort. */ - cpid = vFork(); + compatChild = cpid = vFork(); if (cpid < 0) { Fatal("Could not fork"); } @@ -483,7 +494,12 @@ again: } } free(cmdStart); - + compatChild = 0; + if (compatSigno) { + bmake_signal(compatSigno, SIG_DFL); + kill(myPid, compatSigno); + } + return (status); } Modified: head/contrib/bmake/job.c ============================================================================== --- head/contrib/bmake/job.c Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/job.c Mon Jul 24 04:38:05 2017 (r321410) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $ */ +/* $NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"); +__RCSID("$NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -364,11 +364,6 @@ static Job childExitJob; /* child exit pseudo-job */ (void)fprintf(fp, TARG_FMT, targPrefix, gn->name) static sigset_t caught_signals; /* Set of signals we handle */ -#if defined(SYSV) -#define KILLPG(pid, sig) kill(-(pid), (sig)) -#else -#define KILLPG(pid, sig) killpg((pid), (sig)) -#endif static void JobChildSig(int); static void JobContinueSig(int); Modified: head/contrib/bmake/make.h ============================================================================== --- head/contrib/bmake/make.h Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/make.h Mon Jul 24 04:38:05 2017 (r321410) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.102 2016/12/07 15:00:46 christos Exp $ */ +/* $NetBSD: make.h,v 1.103 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -541,6 +541,12 @@ int cached_stat(const char *, void *); #endif #ifndef PATH_MAX #define PATH_MAX MAXPATHLEN +#endif + +#if defined(SYSV) +#define KILLPG(pid, sig) kill(-(pid), (sig)) +#else +#define KILLPG(pid, sig) killpg((pid), (sig)) #endif #endif /* _MAKE_H_ */ Modified: head/contrib/bmake/nonints.h ============================================================================== --- head/contrib/bmake/nonints.h Mon Jul 24 04:00:43 2017 (r321409) +++ head/contrib/bmake/nonints.h Mon Jul 24 04:38:05 2017 (r321410) @@ -143,6 +143,11 @@ int Str_Match(const char *, const char *); char *Str_SYSVMatch(const char *, const char *, int *len); void Str_SYSVSubst(Buffer *, char *, char *, int); +#ifndef HAVE_STRLCPY +/* strlcpy.c */ +size_t strlcpy(char *, const char *, size_t); +#endif + /* suff.c */ void Suff_ClearSuffixes(void); Boolean Suff_IsTransform(char *); Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Mon Jul 24 04:00:43 2017 (r321409) +++ head/usr.bin/bmake/Makefile Mon Jul 24 04:38:05 2017 (r321410) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.94 2017/07/15 18:22:14 sjg Exp $ +# $Id: Makefile,v 1.95 2017/07/20 19:36:13 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170711 +_MAKE_VERSION= 20170720 PROG?= ${.CURDIR:T} Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Mon Jul 24 04:00:43 2017 (r321409) +++ head/usr.bin/bmake/Makefile.inc Mon Jul 24 04:38:05 2017 (r321410) @@ -24,3 +24,9 @@ SUBDIR+= tests WARNS=3 CFLAGS+= -DNO_PWD_OVERRIDE + +.if make(after-import) +# use our preferred value +DEFAULT_SYS_PATH= .../share/mk:/usr/share/mk +.export DEFAULT_SYS_PATH +.endif From owner-svn-src-head@freebsd.org Mon Jul 24 15:39:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3F1CFCB12; Mon, 24 Jul 2017 15:39:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1556C0CC; Mon, 24 Jul 2017 15:39:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OFd9Nm059018; Mon, 24 Jul 2017 15:39:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OFd9Ze059017; Mon, 24 Jul 2017 15:39:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707241539.v6OFd9Ze059017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 24 Jul 2017 15:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321417 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 15:39:10 -0000 Author: emaste Date: Mon Jul 24 15:39:09 2017 New Revision: 321417 URL: https://svnweb.freebsd.org/changeset/base/321417 Log: lld 5.0 supports filter libraries, so enable linker feature flag Also switch the logic to enable this for any non-lld linker, since filter library support is fairly simple and is very likely supported by any other linker capable of linking the FreeBSD base system. MFC after: 2 months MFC with: r321369 Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Mon Jul 24 14:42:45 2017 (r321416) +++ head/share/mk/bsd.linker.mk Mon Jul 24 15:39:09 2017 (r321417) @@ -70,7 +70,7 @@ ${X_}LINKER_FEATURES= .if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750 ${X_}LINKER_FEATURES+= build-id .endif -.if ${${X_}LINKER_TYPE} == "bfd" +.if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter .endif .endif From owner-svn-src-head@freebsd.org Mon Jul 24 16:33:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4159CFE0C1; Mon, 24 Jul 2017 16:33:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 719266E72B; Mon, 24 Jul 2017 16:33:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OGX6l3084074; Mon, 24 Jul 2017 16:33:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OGX6Qu084073; Mon, 24 Jul 2017 16:33:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707241633.v6OGX6Qu084073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 24 Jul 2017 16:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321420 - head/lib/clang/liblldb X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang/liblldb X-SVN-Commit-Revision: 321420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 16:33:07 -0000 Author: dim Date: Mon Jul 24 16:33:06 2017 New Revision: 321420 URL: https://svnweb.freebsd.org/changeset/base/321420 Log: Add a few more object files to liblldb, which should solve errors when linking the lldb executable in some cases. In particular, when the -ffunction-sections -fdata-sections options are turned off, or ineffective. Reported by: Shawn Webb, Mark Millard MFC after: 2 months X-MFC-With: r308421 Modified: head/lib/clang/liblldb/Makefile Modified: head/lib/clang/liblldb/Makefile ============================================================================== --- head/lib/clang/liblldb/Makefile Mon Jul 24 16:24:22 2017 (r321419) +++ head/lib/clang/liblldb/Makefile Mon Jul 24 16:33:06 2017 (r321420) @@ -61,6 +61,7 @@ SRCS+= API/SBTarget.cpp SRCS+= API/SBThread.cpp SRCS+= API/SBThreadCollection.cpp SRCS+= API/SBThreadPlan.cpp +SRCS+= API/SBTrace.cpp SRCS+= API/SBType.cpp SRCS+= API/SBTypeCategory.cpp SRCS+= API/SBTypeEnumMember.cpp @@ -348,6 +349,9 @@ SRCS+= Plugins/Language/ObjC/NSSet.cpp SRCS+= Plugins/Language/ObjC/NSString.cpp SRCS+= Plugins/Language/ObjC/ObjCLanguage.cpp SRCS+= Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +SRCS+= Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp SRCS+= Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp SRCS+= Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp SRCS+= Plugins/ObjectFile/ELF/ELFHeader.cpp From owner-svn-src-head@freebsd.org Mon Jul 24 16:37:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C484CFE1D7 for ; Mon, 24 Jul 2017 16:37:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 011066E93F for ; Mon, 24 Jul 2017 16:37:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x236.google.com with SMTP id q130so13721330qka.4 for ; Mon, 24 Jul 2017 09:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WfKDLYKQQoFjLE490iwo6WHRUsbW2JmNUuRuKVrLAE0=; b=l6d0JTV7gvJezvyhl66JoBJeOmXSrEmA+OYN+1lHZyTzw6gWiUeH1bCtgOYodCPmKx +a3J60gKgHlze7wACgUgOdQaVDQ921yVxqp/o3B0+FvQHe7tTv0cTE/jZVJb2NB4zHly 3ZTZ5BmyGjftvQqEhrwNqZpmwuw7rwvesMQWPqFn5ZnnszZR71oB1c14l3jdfBLheTv3 FBSiJWrUyHehqrdYbIfbF129tRWjRh7DtvTlq6RRYJHlk7meYIDTXiwD60j0l62tUJgU DR2JLeur5XnPHb2naMNVh6MFzRoLp1AzU1V9fTKoP5mJ6f/o++i/hX5+NzNbTWvn6SWl Ivyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WfKDLYKQQoFjLE490iwo6WHRUsbW2JmNUuRuKVrLAE0=; b=tdQya7bYeC6256qqz/7F3s0TdWdMNO+3vhJkw0LFDc3wa2VsSk3MdjtF5/GWMM7V7e G2IG9/pPj2B7j1u1AiUgPQyaNtL5hI2gTe6jJR7ZUl0IdDU6jlSP2OHlIud1eqzZ07pM Aq4H6AiV7Q7whVEYP74MANyX/6ec9nJck59BAF++lp80k2WbwWFowMjWfNoDez8Mhex2 Gr8V0os8WhsxB0HUa40rfNhmTmzleJw5EqpJZnXh2uknbOJ7jhM8F5rVTZGuTAXw17zh +jYoMTHrLF6mg6AYcwLxW8jzL+yCWdp+swOGJl3AnBTuNJw5JZXgvAWmOq87qVifAOsP Yl4w== X-Gm-Message-State: AIVw110DGbPIRpqs/h7n3KfXigUvzoCmxm/KsTLWD0kQg96/Kgv/ZYxM FIULWHKBWLW5/cdr X-Received: by 10.55.94.69 with SMTP id s66mr5671161qkb.99.1500914246924; Mon, 24 Jul 2017 09:37:26 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id e3sm8170996qkd.90.2017.07.24.09.37.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jul 2017 09:37:26 -0700 (PDT) Date: Mon, 24 Jul 2017 12:37:25 -0400 From: Shawn Webb To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321420 - head/lib/clang/liblldb Message-ID: <20170724163725.xw74daf5i2mlnveq@mutt-hbsd> References: <201707241633.v6OGX6Qu084073@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z2ggjx3hzxmqrytn" Content-Disposition: inline In-Reply-To: <201707241633.v6OGX6Qu084073@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170609 (1.8.3) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 16:37:28 -0000 --z2ggjx3hzxmqrytn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 24, 2017 at 04:33:06PM +0000, Dimitry Andric wrote: > Author: dim > Date: Mon Jul 24 16:33:06 2017 > New Revision: 321420 > URL: https://svnweb.freebsd.org/changeset/base/321420 >=20 > Log: > Add a few more object files to liblldb, which should solve errors when > linking the lldb executable in some cases. In particular, when the > -ffunction-sections -fdata-sections options are turned off, or > ineffective. > =20 > Reported by: Shawn Webb, Mark Millard > MFC after: 2 months > X-MFC-With: r308421 >=20 > Modified: > head/lib/clang/liblldb/Makefile Thanks for the quick turnaround! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --z2ggjx3hzxmqrytn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAll2IkMACgkQaoRlj1JF bu4y8BAApDvNjaTKssUqDW929F5nYfzvP+OroHZyQEw3aLX3iH84Y5Dj7TnWJ8M4 qvAb7/33jzKrw5yCfDFagLdvzwYqWGbnzSRI9wGbxwd02ld62OUBFs/+5oTGEHL0 R8RLZJc4Cy+MWscmtdUhYv9SWPCucJptN6XFUm7+Kj1kZxK1jGA297cwOlXAU4eR S+L7X8sqrp1k3sEIjT1H1QVVbZ66X4s4BRrY8LZxAsYALKzYg68u7NIC2/jCr25/ kllsQNCUUpzIyEqEsAlLnddmtqJVfD7lZO3mKSg1ifdEg7skXEJBBSclWN1CeiHJ tZsXgoi9tNdDUyDrcDRdefkA8rTU4irnuPmDR4wIkOtmed8gONFVdrp+l5cWoIRh BNfqtNcvmkibyM3TB4Gox3wOfy19LWlmSTZFfotnCQIfQE3t7xmI0WvaH3jIed8f q7/ZqWBIfUMuBBoppuji5fbHa0kmIAORmcTS5kWgCzZUXbkArADPgqxMz0n54UEW b5TBQYq90wfml8XwRSa80H7zR9/moIio6Gttqs/l79unTXmfoaRrhS8DV+IZZfzF x+ZCOdHZTVGU80ek+Kj/lxa1K+Fu75fMDeOpIc6VJ+8SsZHbB2iwKCVzcGkwiA9j WFp/r/4VOImdXKDZXZe1pDbJ2PK1lm6vWLHboFUw6OU1I0A0SMY= =ewfK -----END PGP SIGNATURE----- --z2ggjx3hzxmqrytn-- From owner-svn-src-head@freebsd.org Mon Jul 24 16:58:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFF44CFE77E; Mon, 24 Jul 2017 16:58:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3D66F3B0; Mon, 24 Jul 2017 16:58:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OGwst3092290; Mon, 24 Jul 2017 16:58:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OGwsc2092289; Mon, 24 Jul 2017 16:58:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201707241658.v6OGwsc2092289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 24 Jul 2017 16:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321422 - head/usr.bin/ktrace X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/ktrace X-SVN-Commit-Revision: 321422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 16:58:55 -0000 Author: trasz Date: Mon Jul 24 16:58:54 2017 New Revision: 321422 URL: https://svnweb.freebsd.org/changeset/base/321422 Log: Improve the ktrace(1) man page to make it slightly more obvious that there are _two_ options that control its behaviour wrt child processes; slightly improve the example[1], and add Xrefs. Discussed with: wblock [1] MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/usr.bin/ktrace/ktrace.1 Modified: head/usr.bin/ktrace/ktrace.1 ============================================================================== --- head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:45:38 2017 (r321421) +++ head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:58:54 2017 (r321422) @@ -85,6 +85,9 @@ Clear the specified trace points associated with the g .It Fl d Descendants; perform the operation for all current children of the designated processes. +See also the +.Fl i +option. .It Fl f Ar trfile Log trace records to .Ar trfile @@ -97,6 +100,9 @@ flag is permitted). .It Fl i Inherit; pass the trace flags to all future children of the designated processes. +See also the +.Fl d +option. .It Fl p Ar pid Enable (disable) tracing on the indicated process id (only one .Fl p @@ -148,6 +154,9 @@ and .Ar command options are mutually exclusive. .Sh EXAMPLES +Run "make", then trace it and any child processes: +.Dl $ ktrace -i make +.Pp Trace all kernel operations of process id 34: .Dl $ ktrace -p 34 .Pp @@ -166,16 +175,15 @@ Enable tracing of on process 67: .Dl $ ktrace -ti -p 67 .Pp -Run the command "w", tracing only system calls: -.Dl $ ktrace -tc w -.Pp Disable all tracing to the file "tracedata": .Dl $ ktrace -c -f tracedata .Pp Disable tracing of all user-owned processes: .Dl $ ktrace -C .Sh SEE ALSO +.Xr dtrace 1 , .Xr kdump 1 , +.Xr truss 1 , .Xr ktrace 2 .Sh HISTORY The From owner-svn-src-head@freebsd.org Mon Jul 24 17:17:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A00C4CFEDDC; Mon, 24 Jul 2017 17:17:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (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 6B8386FF1F; Mon, 24 Jul 2017 17:17:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::c995:48cf:5934:883a] (unknown [IPv6:2001:470:7a58:0:c995:48cf:5934:883a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6FF2E262B7; Mon, 24 Jul 2017 19:17:34 +0200 (CEST) From: Dimitry Andric Content-Type: multipart/signed; boundary="Apple-Mail=_56DF5048-EF6A-4ABB-9643-4AF02F81D909"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r321420 - head/lib/clang/liblldb Date: Mon, 24 Jul 2017 19:17:24 +0200 References: <201707241633.v6OGX6Qu084073@repo.freebsd.org> To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201707241633.v6OGX6Qu084073@repo.freebsd.org> Message-Id: <35EFA134-0D52-4DCF-996E-ED4800F375CD@FreeBSD.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:17:35 -0000 --Apple-Mail=_56DF5048-EF6A-4ABB-9643-4AF02F81D909 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 24 Jul 2017, at 18:33, Dimitry Andric wrote: > > Author: dim > Date: Mon Jul 24 16:33:06 2017 > New Revision: 321420 > URL: https://svnweb.freebsd.org/changeset/base/321420 > > Log: > Add a few more object files to liblldb, which should solve errors when > linking the lldb executable in some cases. In particular, when the > -ffunction-sections -fdata-sections options are turned off, or > ineffective. > > Reported by: Shawn Webb, Mark Millard > MFC after: 2 months > X-MFC-With: r308421 Ugh, that should have been our r321369 of course. :) r308321 is the llvm upstream revision. Now if only there was a version control system which used unique hashes... ;) -Dimitry --Apple-Mail=_56DF5048-EF6A-4ABB-9643-4AF02F81D909 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWXYrpAAKCRCwXqMKLiCW o37AAKDdW/PWoDFKFktCjvEASCNQLEU5vwCePY65gCIixAB0HTZgPLGt0iyOUuM= =hN8u -----END PGP SIGNATURE----- --Apple-Mail=_56DF5048-EF6A-4ABB-9643-4AF02F81D909-- From owner-svn-src-head@freebsd.org Mon Jul 24 17:23:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99495CFF0EA; Mon, 24 Jul 2017 17:23:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 750A370476; Mon, 24 Jul 2017 17:23:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OHNrkJ004594; Mon, 24 Jul 2017 17:23:53 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OHNrS0004593; Mon, 24 Jul 2017 17:23:53 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707241723.v6OHNrS0004593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 24 Jul 2017 17:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321423 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:23:54 -0000 Author: alc Date: Mon Jul 24 17:23:53 2017 New Revision: 321423 URL: https://svnweb.freebsd.org/changeset/base/321423 Log: Change the interactions of the interface functions with the "meta" and "leaf" functions for alloc, free, and fill. After the change, the interface functions call "meta" unconditionally, and the "meta" functions recur unconditionally in looping over their descendants. The "meta" functions start with a validity test, and then a test for the "leaf" case, before falling into the general recursive case. This simplifies and shrinks the code, and, for "free" and "fill" moves panic tests that check the same meta node repeatedly in a loop to a place that will have each node tested once. Remove irrelevant null checks from blist_free and blist_fill. Make the code that initializes a meta node the same in blist_meta_alloc and blist_meta_fill. Parenthesize return expressions in blst_meta_fill. Submitted by: Doug Moore MFC after: 1 week Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon Jul 24 16:58:54 2017 (r321422) +++ head/sys/kern/subr_blist.c Mon Jul 24 17:23:53 2017 (r321423) @@ -224,12 +224,8 @@ blist_alloc(blist_t bl, daddr_t count) * reduce the hint, stopping further iterations. */ while (count <= bl->bl_root->bm_bighint) { - if (bl->bl_radix == BLIST_BMAP_RADIX) - blk = blst_leaf_alloc(bl->bl_root, 0, count, - bl->bl_cursor); - else - blk = blst_meta_alloc(bl->bl_root, 0, count, - bl->bl_radix, bl->bl_skip, bl->bl_cursor); + blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, + bl->bl_skip, bl->bl_cursor); if (blk != SWAPBLK_NONE) { bl->bl_cursor = blk + count; return (blk); @@ -260,13 +256,8 @@ blist_avail(blist_t bl) void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { - if (bl) { - if (bl->bl_radix == BLIST_BMAP_RADIX) - blst_leaf_free(bl->bl_root, blkno, count); - else - blst_meta_free(bl->bl_root, blkno, count, - bl->bl_radix, bl->bl_skip, 0); - } + + blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); } /* @@ -278,17 +269,9 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { - daddr_t filled; - if (bl) { - if (bl->bl_radix == BLIST_BMAP_RADIX) - filled = blst_leaf_fill(bl->bl_root, blkno, count); - else - filled = blst_meta_fill(bl->bl_root, blkno, count, - bl->bl_radix, bl->bl_skip, 0); - return (filled); - } - return (0); + return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, + bl->bl_skip, 0)); } /* @@ -449,6 +432,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c int child; bool scan_from_start; + if (radix == BLIST_BMAP_RADIX) + return (blst_leaf_alloc(scan, blk, count, cursor)); if (scan->u.bmu_avail < count) { /* * The meta node's hint must be too large if the allocation @@ -497,14 +482,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c /* * The allocation might fit in the i'th subtree. */ - if (next_skip == 1) { - r = blst_leaf_alloc(&scan[i], blk, count, - cursor > blk ? cursor : blk); - } else { - r = blst_meta_alloc(&scan[i], blk, count, - radix, next_skip - 1, cursor > blk ? - cursor : blk); - } + r = blst_meta_alloc(&scan[i], blk, count, radix, + next_skip - 1, cursor > blk ? cursor : blk); if (r != SWAPBLK_NONE) { scan->u.bmu_avail -= count; return (r); @@ -578,6 +557,10 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ daddr_t i, next_skip, v; int child; + if (scan->bm_bighint == (daddr_t)-1) + panic("freeing invalid range"); + if (radix == BLIST_BMAP_RADIX) + return (blst_leaf_free(scan, freeBlk, count)); next_skip = skip / BLIST_META_RADIX; if (scan->u.bmu_avail == 0) { @@ -630,17 +613,9 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ v = blk + radix - freeBlk; if (v > count) v = count; - - if (scan->bm_bighint == (daddr_t)-1) - panic("blst_meta_free: freeing unexpected range"); - - if (next_skip == 1) { - blst_leaf_free(&scan[i], freeBlk, v); - } else { - blst_meta_free(&scan[i], freeBlk, v, radix, next_skip - 1, blk); - } + blst_meta_free(&scan[i], freeBlk, v, radix, next_skip - 1, blk); if (scan->bm_bighint < scan[i].bm_bighint) - scan->bm_bighint = scan[i].bm_bighint; + scan->bm_bighint = scan[i].bm_bighint; count -= v; freeBlk += v; blk += radix; @@ -763,13 +738,17 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr daddr_t i, nblks, next_skip, v; int child; + if (scan->bm_bighint == (daddr_t)-1) + panic("filling invalid range"); if (count > radix) { /* * The allocation exceeds the number of blocks that are - * managed by this meta node. + * managed by this node. */ - panic("allocation too large"); + panic("fill too large"); } + if (radix == BLIST_BMAP_RADIX) + return (blst_leaf_fill(scan, allocBlk, count)); if (count == radix || scan->u.bmu_avail == 0) { /* * ALL-ALLOCATED special case @@ -777,7 +756,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr nblks = scan->u.bmu_avail; scan->u.bmu_avail = 0; scan->bm_bighint = 0; - return nblks; + return (nblks); } next_skip = skip / BLIST_META_RADIX; @@ -793,13 +772,11 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr * meta node cannot have a terminator in any subtree. */ for (i = 1; i <= skip; i += next_skip) { - if (next_skip == 1) { + if (next_skip == 1) scan[i].u.bmu_bitmap = (u_daddr_t)-1; - scan[i].bm_bighint = BLIST_BMAP_RADIX; - } else { - scan[i].bm_bighint = radix; + else scan[i].u.bmu_avail = radix; - } + scan[i].bm_bighint = radix; } } else { radix /= BLIST_META_RADIX; @@ -813,23 +790,15 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr v = blk + radix - allocBlk; if (v > count) v = count; - - if (scan->bm_bighint == (daddr_t)-1) - panic("blst_meta_fill: filling unexpected range"); - - if (next_skip == 1) { - nblks += blst_leaf_fill(&scan[i], allocBlk, v); - } else { - nblks += blst_meta_fill(&scan[i], allocBlk, v, - radix, next_skip - 1, blk); - } + nblks += blst_meta_fill(&scan[i], allocBlk, v, radix, + next_skip - 1, blk); count -= v; allocBlk += v; blk += radix; i += next_skip; } scan->u.bmu_avail -= nblks; - return nblks; + return (nblks); } /* From owner-svn-src-head@freebsd.org Mon Jul 24 17:27:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7BD7CFF28C; Mon, 24 Jul 2017 17:27:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74BDF70746; Mon, 24 Jul 2017 17:27:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OHRLqx004754; Mon, 24 Jul 2017 17:27:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OHRLrt004753; Mon, 24 Jul 2017 17:27:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707241727.v6OHRLrt004753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 24 Jul 2017 17:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321424 - head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts X-SVN-Commit-Revision: 321424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:27:22 -0000 Author: ngie Date: Mon Jul 24 17:27:21 2017 New Revision: 321424 URL: https://svnweb.freebsd.org/changeset/base/321424 Log: Style cleanup: delete spurious trailing whitespace MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Jul 24 17:23:53 2017 (r321423) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Jul 24 17:27:21 2017 (r321424) @@ -250,7 +250,7 @@ sub run_tests { $name = $1; $base = $2; $ext = $3; - + $dir = dirname($file); $isksh = 0; $tag = 0; @@ -372,7 +372,7 @@ sub run_tests { "modunload -i 0"); if (!system("modinfo | grep dtrace")) { warn "ERROR: couldn't unload dtrace\n"; - system("svcadm enable " . + system("svcadm enable " . "-s svc:/network/nfs/mapid:default"); exit(124); } @@ -387,7 +387,7 @@ sub run_tests { "modunload -i 0"); if (!system("modinfo | grep dtrace")) { warn "ERROR: couldn't unload dtrace\n"; - system("svcadm enable " . + system("svcadm enable " . "-s svc:/network/nfs/mapid:default"); exit(124); } @@ -679,7 +679,7 @@ if ($opt_b) { # # Run all the tests specified on the command-line (the entire test suite # by default) once for each dtrace command tested, skipping any tests -# not valid for that command. +# not valid for that command. # foreach $dtrace_cmd (@dtrace_cmds) { run_tests($dtrace_cmd, $exception_lists{$dtrace_cmd}); From owner-svn-src-head@freebsd.org Mon Jul 24 17:29:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6259CFF34B; Mon, 24 Jul 2017 17:29:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93179708EC; Mon, 24 Jul 2017 17:29:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OHTukI004884; Mon, 24 Jul 2017 17:29:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OHTu2Q004883; Mon, 24 Jul 2017 17:29:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707241729.v6OHTu2Q004883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 24 Jul 2017 17:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321425 - head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts X-SVN-Commit-Revision: 321425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:29:57 -0000 Author: ngie Date: Mon Jul 24 17:29:56 2017 New Revision: 321425 URL: https://svnweb.freebsd.org/changeset/base/321425 Log: Fix whitespace on a line in fix(..) accidentally missed in r321424 MFC after: 1 month MFC with: r321424 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Jul 24 17:27:21 2017 (r321424) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Jul 24 17:29:56 2017 (r321425) @@ -116,7 +116,7 @@ sub fail open(README, ">$opt_d/failure.$n/README"); print README "ERROR: " . $file . " " . $msg; - + if (scalar @parms > 1) { print README "; see $errfile\n"; } else { From owner-svn-src-head@freebsd.org Mon Jul 24 17:53:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61195CFFE4E; Mon, 24 Jul 2017 17:53:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3042771C94; Mon, 24 Jul 2017 17:53:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OHrj1p016914; Mon, 24 Jul 2017 17:53:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OHrjuV016913; Mon, 24 Jul 2017 17:53:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707241753.v6OHrjuV016913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 17:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321426 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:53:46 -0000 Author: bdrewery Date: Mon Jul 24 17:53:45 2017 New Revision: 321426 URL: https://svnweb.freebsd.org/changeset/base/321426 Log: cleanobj: Unhide removal of directory. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Mon Jul 24 17:29:56 2017 (r321425) +++ head/share/mk/bsd.obj.mk Mon Jul 24 17:53:45 2017 (r321426) @@ -159,7 +159,7 @@ whereobj: .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) cleanobj: - @-rm -rf ${CANONICALOBJDIR} + -rm -rf ${CANONICALOBJDIR} .else cleanobj: clean cleandepend .endif From owner-svn-src-head@freebsd.org Mon Jul 24 17:54:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC366CFFE9C; Mon, 24 Jul 2017 17:54:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88C3F71DC2; Mon, 24 Jul 2017 17:54:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OHs3Ru016973; Mon, 24 Jul 2017 17:54:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OHs3L5016971; Mon, 24 Jul 2017 17:54:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707241754.v6OHs3L5016971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 17:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321427 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:54:04 -0000 Author: bdrewery Date: Mon Jul 24 17:54:03 2017 New Revision: 321427 URL: https://svnweb.freebsd.org/changeset/base/321427 Log: PROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS. - Only recurse on cleanobj/cleandir if there is no .OBJDIR being used. If we don't recurse then bsd.obj.mk will just rm -rf the OBJDIR dir. - When recursing on cleanobj/cleandir don't remove dependfiles/dirs redundantly from the child and main processes. Meaning '.depend', and 'tags', and '.depend.*' will now only be removed from the main process. - Stop recursing on 'cleandepend' since the main process can handle removing all files via the default glob patterns in CLEANDEPENDFILES. - This reverts r288201, by readding recursion on 'cleanobj', due to r291635 changing how bsd.subdir.mk handles recursion. This is primarily targeting ESTALE NFS errors from rm(1) during a buildworld but is also a performance optimization as both issues fixed were redundant anyway. Reported by: cperciva, scottl MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.obj.mk head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Mon Jul 24 17:53:45 2017 (r321426) +++ head/share/mk/bsd.obj.mk Mon Jul 24 17:54:03 2017 (r321427) @@ -157,6 +157,7 @@ whereobj: @echo ${.OBJDIR} .endif +# Same check in bsd.progs.mk .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) cleanobj: -rm -rf ${CANONICALOBJDIR} Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Mon Jul 24 17:53:45 2017 (r321426) +++ head/share/mk/bsd.progs.mk Mon Jul 24 17:54:03 2017 (r321427) @@ -116,7 +116,16 @@ ${_PROGS_COMMON_OBJS}: .NOMETA .if !empty(PROGS) && !defined(_RECURSING_PROGS) && !defined(PROG) # tell progs.mk we might want to install things -PROGS_TARGETS+= checkdpadd clean cleandepend cleandir depend install +PROGS_TARGETS+= checkdpadd clean depend install +# Only handle removing depend files from the main process. +_PROG_MK.cleandir= CLEANDEPENDFILES= CLEANDEPENDDIRS= +_PROG_MK.cleanobj= CLEANDEPENDFILES= CLEANDEPENDDIRS= +# Only recurse on these if there is no objdir, meaning a normal +# 'clean' gets ran via the target defined in bsd.obj.mk. +# Same check from cleanobj: in bsd.obj.mk +.if ${CANONICALOBJDIR} == ${.CURDIR} || !exists(${CANONICALOBJDIR}/) +PROGS_TARGETS+= cleandir cleanobj +.endif # Ensure common objects are built before recursing. .if !empty(_PROGS_COMMON_OBJS) @@ -142,7 +151,7 @@ $p.$t: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \ - PROG=$p ${x.$p} ${@:E}) + ${_PROG_MK.${t}} PROG=$p ${x.$p} ${@:E}) .endfor .endfor From owner-svn-src-head@freebsd.org Mon Jul 24 17:55:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B55CFFF7B; Mon, 24 Jul 2017 17:55:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4ADE71F5D; Mon, 24 Jul 2017 17:55:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x229.google.com with SMTP id 125so60172587pgi.3; Mon, 24 Jul 2017 10:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Jyk/cezc12dTj18k9YIvJ0s4G0+G4mW637cuONyNOPU=; b=VRYD8AVLnTBzZP3s3tr2VvQ/c3b1RjEsiiXdoiIGHQmKAlCjbQupP3YjlU4BXHdBTx +Kn3XKegkSyPnm6WTAUkngfMZYGR7u58qsTl/O3GvY+y2+rQyW7Jy4wHnSpxKJbVsmMz 2TOlcnFsczuep/hYlHs73Dk4c5fug67UhogxrDsEKTZlW8lb6PqcaId0a3duUcIw2cIJ ONwTovB6SwmOn2jQeOztGCL8894uYMxLuEzV4BXQSohnWwA3jrFOPI+9LBo3m8Vly/Vc fFDcv8zuIXlDidZlkW8hUVD/O6w1AGf9EcBNYf7cyIW4N0jnfnZRbEn2ho9vgqeJHRpp MNOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Jyk/cezc12dTj18k9YIvJ0s4G0+G4mW637cuONyNOPU=; b=JphPTVIv5IAiNLIIE9sLhAlv/0YpwXUDMH+A04I8nwMUx1fIWYKWkIeQaEjgUlC5iE MWUJQ1RlzH1uHWi4n/7Q7HG/phQ+RHxmSw8jfuTQPiLbl3/fiKpS+taoF4UB3pLxIklm JZdiH4WurWPA+NTuGfp39lXEfscRLthpEFb65Rpwr/Y8MJEzm4wJ2LjmPK/8K4AcKErn tB7FnJlQE7EAl0F2RIABPRP1Gr3IjuCNg7ZwYHFNFs3qhINlwHLLA4C4e2c9+yhytX5D 2GTugFJIBXrGCbjDnzrgR+NU8KTKfvvsR/kvxAtTeI8gGJ8oEiQKuwVn9BiB0OUecRk5 wjEg== X-Gm-Message-State: AIVw112pcN1SEoE1OTILjxRT/YrDOZMrEyLMiuvi9pjGpZh91pPJHddG nPl4UGTxwh8z4P17XZg= X-Received: by 10.98.202.12 with SMTP id n12mr17110022pfg.187.1500918956191; Mon, 24 Jul 2017 10:55:56 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c62sm23531493pfb.93.2017.07.24.10.55.54 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 10:55:55 -0700 (PDT) Subject: Re: svn commit: r321426 - head/share/mk Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_66A1CFDB-FFD4-4871-9DF0-E7F4D290CADC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201707241753.v6OHrjuV016913@repo.freebsd.org> Date: Mon, 24 Jul 2017 10:55:54 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <44CBBFE1-7C38-41AA-AABD-0FE7027AE938@gmail.com> References: <201707241753.v6OHrjuV016913@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:55:57 -0000 --Apple-Mail=_66A1CFDB-FFD4-4871-9DF0-E7F4D290CADC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 24, 2017, at 10:53, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Mon Jul 24 17:53:45 2017 > New Revision: 321426 > URL: https://svnweb.freebsd.org/changeset/base/321426 >=20 > Log: > cleanobj: Unhide removal of directory. >=20 > MFC after: 2 weeks > Sponsored by: Dell EMC Isilon >=20 > Modified: > head/share/mk/bsd.obj.mk Why? Dumping output of things like this is why =E2=80=9Cmake -d l=E2=80=9D= is helpful. -Ngie --Apple-Mail=_66A1CFDB-FFD4-4871-9DF0-E7F4D290CADC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZdjSqAAoJEPWDqSZpMIYV+3kP/jqZ3w1GwrbWbF9OBq2Fp4fT pnMpII+5RSQymP18rnmBN3VQ9NnTgZMpCTPk9VbRqOajAKrjI9wgJoCESJySNJEI MIPxmmBU7M/2Uxh7ljG73ZO0OklgXS23EiEdvi3lVs4K2EtY0RdCioSHQtfCNJQP 5IX++NUqcHbrM+wnwMpEWHX+xk3CFRkynkX8aVccx6JhQpSvO//x47INu+9oyh9f mrZBdjUU3kDjxT2vbvtLnsQc7WGk5y5Mdbs2nSXqJ9aN/0Imr42FpzcGSWghJ/4X RHlF1J+BMB6lKKst/SpI1WLbiTj6+YvwS27ginQq44p+B+74zOu38KHawOxeweiS 9uuivNi+feMNk7mqU/yn/wDQI/tvrEqioGC3LCS120zcJe9xG9GVV4et+x2YBkYp nQwmIPIwb4pR+MZQCRDF00+oOYS5VveEgc7lxdD5k1A1G2sAGuYBVVhrmXZd+fKQ 9aX922+51ziLhhyFxU/j1XAfpFqfac1gGRDKNNJyF1TW2ht4nUlinfOOVE6vwfpz Opsu14o/BRuivhjRH8Isf6sbV0YsH5arstazPwwHfXT9SvEDgkspOhfNpTkjBzuw uKt5O22JW8d7B/oT7v87HboYIZTiI87DSQQmw8T5YpxqvQiwjZsVMZKqjfFpHj5V JWLD/FHNkqzEDG96MMfB =8Aa+ -----END PGP SIGNATURE----- --Apple-Mail=_66A1CFDB-FFD4-4871-9DF0-E7F4D290CADC-- From owner-svn-src-head@freebsd.org Mon Jul 24 17:57:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B428D7C009; Mon, 24 Jul 2017 17:57:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17116720B1; Mon, 24 Jul 2017 17:57:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 4544FA273; Mon, 24 Jul 2017 17:57:41 +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 2CEB88DF6; Mon, 24 Jul 2017 17:57:40 +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 Kzt4q2713EYh; Mon, 24 Jul 2017 17:57:37 +0000 (UTC) Subject: Re: svn commit: r321426 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7AB598DF1 To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707241753.v6OHrjuV016913@repo.freebsd.org> <44CBBFE1-7C38-41AA-AABD-0FE7027AE938@gmail.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <7fad1f9c-b0d0-79c4-24a8-2b40dbf5b0de@FreeBSD.org> Date: Mon, 24 Jul 2017 10:57:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <44CBBFE1-7C38-41AA-AABD-0FE7027AE938@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bFvNwR09qDC3xAIR0fftDMTRKnLe6r3Gj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 17:57:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bFvNwR09qDC3xAIR0fftDMTRKnLe6r3Gj Content-Type: multipart/mixed; boundary="Iu6bderJPpOaPiGQsGtMV6uRrDknfm8vj"; protected-headers="v1" From: Bryan Drewery To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7fad1f9c-b0d0-79c4-24a8-2b40dbf5b0de@FreeBSD.org> Subject: Re: svn commit: r321426 - head/share/mk References: <201707241753.v6OHrjuV016913@repo.freebsd.org> <44CBBFE1-7C38-41AA-AABD-0FE7027AE938@gmail.com> In-Reply-To: <44CBBFE1-7C38-41AA-AABD-0FE7027AE938@gmail.com> --Iu6bderJPpOaPiGQsGtMV6uRrDknfm8vj Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/24/2017 10:55 AM, Ngie Cooper (yaneurabeya) wrote: >=20 >> On Jul 24, 2017, at 10:53, Bryan Drewery wrote:= >> >> Author: bdrewery >> Date: Mon Jul 24 17:53:45 2017 >> New Revision: 321426 >> URL: https://svnweb.freebsd.org/changeset/base/321426 >> >> Log: >> cleanobj: Unhide removal of directory. >> >> MFC after: 2 weeks >> Sponsored by: Dell EMC Isilon >> >> Modified: >> head/share/mk/bsd.obj.mk >=20 > Why? Dumping output of things like this is why =E2=80=9Cmake -d l=E2=80= =9D is helpful. > -Ngie >=20 There's no output for this one clean operation, while all other clean operations have output. The opposite, 'make obj', has output as well. This was doing something with no affirmation that anything was actually being done. --=20 Regards, Bryan Drewery --Iu6bderJPpOaPiGQsGtMV6uRrDknfm8vj-- --bFvNwR09qDC3xAIR0fftDMTRKnLe6r3Gj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZdjUAAAoJEDXXcbtuRpfP15wIAI5AqBZENvUffUlg9oOLen9v mRapKenXI4Fzog+t9NePcARJkolSI2OSvuWnqpkpGHVJQ3EgseB61N2+sbHNNh8X KIuHDEgxi0fnBLKn2Ay4yBtKDetde6ViAxX0wSEUwx3XzMBqt3Xu4oi/8W8uJm68 q0CN1NLmdm6+3o0prSKIuCjXYd6fTDn2QgS+z2GMTNl4PZAV67LqBym4F3k8rHA0 7Nv8YJ5S3IoctyEfoiVSmPMPshBXm1YeI23+gjHj5AS2wh0IkpanLg1Zii/gnDSO Hqsa1/3xesABcZrZ5Psaf6R9onUyxM2X6t6FlYCf5L9SqmFcF/uLw8sZEdDMR80= =6MeT -----END PGP SIGNATURE----- --bFvNwR09qDC3xAIR0fftDMTRKnLe6r3Gj-- From owner-svn-src-head@freebsd.org Mon Jul 24 18:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3C20D7C475; Mon, 24 Jul 2017 18:10:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8331472805; Mon, 24 Jul 2017 18:10:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OIAgqW022553; Mon, 24 Jul 2017 18:10:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OIAg13022552; Mon, 24 Jul 2017 18:10:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707241810.v6OIAg13022552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jul 2017 18:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321429 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 321429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 18:10:43 -0000 Author: imp Date: Mon Jul 24 18:10:42 2017 New Revision: 321429 URL: https://svnweb.freebsd.org/changeset/base/321429 Log: fix typo Modified: head/lib/libefivar/uefi-dputil.c Modified: head/lib/libefivar/uefi-dputil.c ============================================================================== --- head/lib/libefivar/uefi-dputil.c Mon Jul 24 18:02:13 2017 (r321428) +++ head/lib/libefivar/uefi-dputil.c Mon Jul 24 18:10:42 2017 (r321429) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "uefi-dplib.h" -/* XXX maybe I sould include the entire DevicePathUtiltiies.c and ifdef out what we don't use */ +/* XXX maybe I should include the entire DevicePathUtiltiies.c and ifdef out what we don't use */ /* * Taken from MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c From owner-svn-src-head@freebsd.org Mon Jul 24 18:21:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF62D7C854; Mon, 24 Jul 2017 18:21:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0E673101; Mon, 24 Jul 2017 18:21:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OIL116025412; Mon, 24 Jul 2017 18:21:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OIL1uE025411; Mon, 24 Jul 2017 18:21:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707241821.v6OIL1uE025411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 24 Jul 2017 18:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321431 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 18:21:02 -0000 Author: ngie Date: Mon Jul 24 18:21:01 2017 New Revision: 321431 URL: https://svnweb.freebsd.org/changeset/base/321431 Log: Use __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship between MK_STALE_STAGED and MK_STAGING instead of using equivalent ad hoc logic. MFC after: 1 month Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Mon Jul 24 18:16:54 2017 (r321430) +++ head/share/mk/bsd.opts.mk Mon Jul 24 18:21:01 2017 (r321431) @@ -76,6 +76,7 @@ __DEFAULT_NO_OPTIONS = \ __DEFAULT_DEPENDENT_OPTIONS = \ STAGING_MAN/STAGING \ STAGING_PROG/STAGING \ + STALE_STAGED/STAGING \ .include @@ -98,10 +99,6 @@ __DEFAULT_DEPENDENT_OPTIONS = \ MK_${var}:=no .endif .endfor - -.if ${MK_STAGING} == "no" -MK_STALE_STAGED= no -.endif .include From owner-svn-src-head@freebsd.org Mon Jul 24 18:52:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC10D7D680; Mon, 24 Jul 2017 18:52:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0557743FA; Mon, 24 Jul 2017 18:52:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OIqepo041499; Mon, 24 Jul 2017 18:52:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OIqe3F041498; Mon, 24 Jul 2017 18:52:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707241852.v6OIqe3F041498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 24 Jul 2017 18:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321433 - head X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 18:52:42 -0000 Author: dim Date: Mon Jul 24 18:52:40 2017 New Revision: 321433 URL: https://svnweb.freebsd.org/changeset/base/321433 Log: Cleanup stale Options.inc files from the previous libllvm build for clang 4.0.0. Otherwise, these can get included before the two newly generated ones (which are different) for clang 5.0.0. Reported by: Mark Millard MFC after: 2 months X-MFC-With: r321369 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 24 18:25:08 2017 (r321432) +++ head/Makefile.inc1 Mon Jul 24 18:52:40 2017 (r321433) @@ -813,6 +813,16 @@ _worldtmp: .PHONY ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* .endif .endfor +# 20170724 remove stale lib/clang/libllvm/Options.inc file, of which there are +# two different versions after r308421, one for llvm-lib, one for llvm-dlltool +.for d in ${OBJTREE} ${WORLDTMP} +.for f in ${d}${.CURDIR}/lib/clang/libllvm/Options.inc +.if exists(${f}) || exists(${f}.d) + @echo Removing stale generated ${f} files + @rm -f ${f} ${f}.d +.endif +.endfor +.endfor .for _dir in \ lib lib/casper usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} From owner-svn-src-head@freebsd.org Mon Jul 24 18:54:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 024BED7D76E; Mon, 24 Jul 2017 18:54:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3DF974655; Mon, 24 Jul 2017 18:54:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OIsuIb041711; Mon, 24 Jul 2017 18:54:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OIsumD041710; Mon, 24 Jul 2017 18:54:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707241854.v6OIsumD041710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 18:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321434 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 18:54:58 -0000 Author: bdrewery Date: Mon Jul 24 18:54:56 2017 New Revision: 321434 URL: https://svnweb.freebsd.org/changeset/base/321434 Log: Add some .ORDER for distrib-dirs, distribute, distribution and distributeworld. Reported by: Mark Millard MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Jul 24 18:52:40 2017 (r321433) +++ head/Makefile Mon Jul 24 18:54:56 2017 (r321434) @@ -158,8 +158,18 @@ META_TGT_WHITELIST+= \ toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld +.ORDER: buildworld distrib-dirs +.ORDER: buildworld distribution +.ORDER: buildworld distribute .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel +.ORDER: distrib-dirs distribute +.ORDER: distrib-dirs distributeworld +.ORDER: distrib-dirs installworld +.ORDER: distribution distribute +.ORDER: distributeworld distribute +.ORDER: distributeworld distribution +.ORDER: installworld distribute .ORDER: installworld distribution .ORDER: installworld installkernel .ORDER: buildkernel installkernel From owner-svn-src-head@freebsd.org Mon Jul 24 19:04:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46DAAD7DBC2; Mon, 24 Jul 2017 19:04:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07EBC74E26; Mon, 24 Jul 2017 19:04:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 33B0DB9C0; Mon, 24 Jul 2017 19:04:44 +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 4A6A38FBB; Mon, 24 Jul 2017 19:04:43 +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 ayhwpjbNbTSy; Mon, 24 Jul 2017 19:04:40 +0000 (UTC) Subject: Re: svn commit: r321433 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 18C6A8FB6 To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707241852.v6OIqe3F041498@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <2fba04e9-520b-d36d-b038-25fe694724fb@FreeBSD.org> Date: Mon, 24 Jul 2017 12:04:38 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201707241852.v6OIqe3F041498@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="K5Mcgt46Eb5BnIkprugWUaucDngeJI1Rb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 19:04:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K5Mcgt46Eb5BnIkprugWUaucDngeJI1Rb Content-Type: multipart/mixed; boundary="j4GKjoH4WxG1P8UmEVb1DaHSp0MuId5lG"; protected-headers="v1" From: Bryan Drewery To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2fba04e9-520b-d36d-b038-25fe694724fb@FreeBSD.org> Subject: Re: svn commit: r321433 - head References: <201707241852.v6OIqe3F041498@repo.freebsd.org> In-Reply-To: <201707241852.v6OIqe3F041498@repo.freebsd.org> --j4GKjoH4WxG1P8UmEVb1DaHSp0MuId5lG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/24/2017 11:52 AM, Dimitry Andric wrote: > Author: dim > Date: Mon Jul 24 18:52:40 2017 > New Revision: 321433 > URL: https://svnweb.freebsd.org/changeset/base/321433 >=20 > Log: > Cleanup stale Options.inc files from the previous libllvm build for > clang 4.0.0. Otherwise, these can get included before the two newly > generated ones (which are different) for clang 5.0.0. > =20 > Reported by: Mark Millard > MFC after: 2 months > X-MFC-With: r321369 >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Mon Jul 24 18:25:08 2017 (r321432) > +++ head/Makefile.inc1 Mon Jul 24 18:52:40 2017 (r321433) > @@ -813,6 +813,16 @@ _worldtmp: .PHONY > ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* > .endif > .endfor > +# 20170724 remove stale lib/clang/libllvm/Options.inc file, of which t= here are > +# two different versions after r308421, one for llvm-lib, one for llvm= -dlltool > +.for d in ${OBJTREE} ${WORLDTMP} > +.for f in ${d}${.CURDIR}/lib/clang/libllvm/Options.inc The 2nd .for is not needed, there's only 1 item. It could probably be f=3D${d}${.CURDIR}/lib/clang/libllvm/Options.inc instead. > +.if exists(${f}) || exists(${f}.d) > + @echo Removing stale generated ${f} files > + @rm -f ${f} ${f}.d > +.endif > +.endfor > +.endfor > .for _dir in \ > lib lib/casper usr legacy/bin legacy/usr > mkdir -p ${WORLDTMP}/${_dir} >=20 --=20 Regards, Bryan Drewery --j4GKjoH4WxG1P8UmEVb1DaHSp0MuId5lG-- --K5Mcgt46Eb5BnIkprugWUaucDngeJI1Rb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZdkTGAAoJEDXXcbtuRpfP7hYH/01qC73rpHHZGy7hazlNiIQM 3gs3k1Bn12wbMkD7cdXhy6n1iKP4iMW5dHrRgxlJ1S3r83Jj1RJtDpzVhNLP97hi xzq0RnZd1dzEIKPUF8oCKknX/zZsZCMKufBmxsQYA5Vh+wrIRxp3tZNKq7O/Ukr3 vB5GFimsy8G1Gy8JItdx1SS9A6fLpKk5kF5rGsZlCVw/ABlukGkNJrKdS+9dV1pB mjwOTfDE7bXLX6YvULYPSCb9x6/WBoQxdxVuoRsWADYsav0wwX0YKFWXvVRtYy9R nSjTHmJc+43MTLihBsKyT9AJmgPcZjOcqw0Pod0bv+RzGiLoGOqQnFzVxy+FYdI= =Mp9Q -----END PGP SIGNATURE----- --K5Mcgt46Eb5BnIkprugWUaucDngeJI1Rb-- From owner-svn-src-head@freebsd.org Mon Jul 24 19:14:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509DDD7DEA0; Mon, 24 Jul 2017 19:14:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 097D37530F; Mon, 24 Jul 2017 19:14:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::c995:48cf:5934:883a] (unknown [IPv6:2001:470:7a58:0:c995:48cf:5934:883a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BCF50262C4; Mon, 24 Jul 2017 21:14:17 +0200 (CEST) From: Dimitry Andric Message-Id: <2EB128F7-BBFB-4BCC-87FF-BE416D461994@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_D96225B1-FCD2-4DDD-9A7C-656326D615F3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r321433 - head Date: Mon, 24 Jul 2017 21:14:12 +0200 In-Reply-To: <2fba04e9-520b-d36d-b038-25fe694724fb@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Bryan Drewery References: <201707241852.v6OIqe3F041498@repo.freebsd.org> <2fba04e9-520b-d36d-b038-25fe694724fb@FreeBSD.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 19:14:25 -0000 --Apple-Mail=_D96225B1-FCD2-4DDD-9A7C-656326D615F3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 24 Jul 2017, at 21:04, Bryan Drewery wrote: >=20 > On 7/24/2017 11:52 AM, Dimitry Andric wrote: >> Author: dim >> Date: Mon Jul 24 18:52:40 2017 >> New Revision: 321433 >> URL: https://svnweb.freebsd.org/changeset/base/321433 >>=20 >> Log: >> Cleanup stale Options.inc files from the previous libllvm build for >> clang 4.0.0. Otherwise, these can get included before the two newly >> generated ones (which are different) for clang 5.0.0. >>=20 >> Reported by: Mark Millard >> MFC after: 2 months >> X-MFC-With: r321369 >>=20 >> Modified: >> head/Makefile.inc1 >>=20 >> Modified: head/Makefile.inc1 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/Makefile.inc1 Mon Jul 24 18:25:08 2017 = (r321432) >> +++ head/Makefile.inc1 Mon Jul 24 18:52:40 2017 = (r321433) >> @@ -813,6 +813,16 @@ _worldtmp: .PHONY >> = ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* >> .endif >> .endfor >> +# 20170724 remove stale lib/clang/libllvm/Options.inc file, of which = there are >> +# two different versions after r308421, one for llvm-lib, one for = llvm-dlltool >> +.for d in ${OBJTREE} ${WORLDTMP} >> +.for f in ${d}${.CURDIR}/lib/clang/libllvm/Options.inc >=20 > The 2nd .for is not needed, there's only 1 item. It could probably be > f=3D${d}${.CURDIR}/lib/clang/libllvm/Options.inc instead. I never fully understand how assignments work in bmake, this always goes wrong for me in for loops. Feel free to correct it so that it works, I'm afraid to touch this. :) -Dimitry --Apple-Mail=_D96225B1-FCD2-4DDD-9A7C-656326D615F3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWXZHBAAKCRCwXqMKLiCW oxnkAKDUzuDIOjipWs4s7XPDfBNH5/dSxQCfdX8Us1N7h4Rpyru7qLdLURNDcsc= =DKVx -----END PGP SIGNATURE----- --Apple-Mail=_D96225B1-FCD2-4DDD-9A7C-656326D615F3-- From owner-svn-src-head@freebsd.org Mon Jul 24 19:17:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4392AD7DF53; Mon, 24 Jul 2017 19:17:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ACB2754B6; Mon, 24 Jul 2017 19:17:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OJHEJL050538; Mon, 24 Jul 2017 19:17:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OJHDRj050536; Mon, 24 Jul 2017 19:17:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707241917.v6OJHDRj050536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 24 Jul 2017 19:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321435 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 321435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 19:17:15 -0000 Author: np Date: Mon Jul 24 19:17:13 2017 New Revision: 321435 URL: https://svnweb.freebsd.org/changeset/base/321435 Log: cxgbe(4): Display some more TOE parameters related to retransmission and keepalive in the sysctl MIB. Provide tunables to change some of these parameters. These are supposed to be setup by the firmware so these tunables are for experimentation only. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Mon Jul 24 18:54:56 2017 (r321434) +++ head/sys/dev/cxgbe/common/common.h Mon Jul 24 19:17:13 2017 (r321435) @@ -501,6 +501,15 @@ static inline unsigned int dack_ticks_to_usec(const st return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap); } +static inline u_int ms_to_tcp_ticks(const struct adapter *adap, u_int ms) +{ + u_long l; + + l = (u_long)ms * adap->params.vpd.cclk >> adap->params.tp.tre; + + return (l); +} + void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jul 24 18:54:56 2017 (r321434) +++ head/sys/dev/cxgbe/t4_main.c Mon Jul 24 19:17:13 2017 (r321435) @@ -551,6 +551,8 @@ static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); static int sysctl_tp_timer(SYSCTL_HANDLER_ARGS); +static int sysctl_tp_shift_cnt(SYSCTL_HANDLER_ARGS); +static int sysctl_tp_backoff(SYSCTL_HANDLER_ARGS); #endif static uint32_t fconf_iconf_to_mode(uint32_t, uint32_t); static uint32_t mode_to_fconf(uint32_t); @@ -3607,12 +3609,62 @@ static int set_params__post_init(struct adapter *sc) { uint32_t param, val; + int i, v, shift; + char s[32]; /* ask for encapsulated CPLs */ param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); val = 1; (void)t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + /* + * Override the TOE timers with user provided tunables. This is not the + * recommended way to change the timers (the firmware config file is) so + * these tunables are not documented. + * + * All the timer tunables are in milliseconds. + */ + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_idle", &v)) { + t4_set_reg_field(sc, A_TP_KEEP_IDLE, + V_KEEPALIVEIDLE(M_KEEPALIVEIDLE), + V_KEEPALIVEIDLE(ms_to_tcp_ticks(sc, v))); + } + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_interval", &v)) { + t4_set_reg_field(sc, A_TP_KEEP_INTVL, + V_KEEPALIVEINTVL(M_KEEPALIVEINTVL), + V_KEEPALIVEINTVL(ms_to_tcp_ticks(sc, v))); + } + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_count", &v)) { + v &= M_KEEPALIVEMAXR1; + t4_set_reg_field(sc, A_TP_SHIFT_CNT, + V_KEEPALIVEMAXR1(M_KEEPALIVEMAXR1) | + V_KEEPALIVEMAXR2(M_KEEPALIVEMAXR2), + V_KEEPALIVEMAXR1(1) | V_KEEPALIVEMAXR2(v)); + } + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_min", &v)) { + t4_set_reg_field(sc, A_TP_RXT_MIN, + V_RXTMIN(M_RXTMIN), V_RXTMIN(ms_to_tcp_ticks(sc, v))); + } + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_max", &v)) { + t4_set_reg_field(sc, A_TP_RXT_MAX, + V_RXTMAX(M_RXTMAX), V_RXTMAX(ms_to_tcp_ticks(sc, v))); + } + if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_count", &v)) { + v &= M_RXTSHIFTMAXR1; + t4_set_reg_field(sc, A_TP_SHIFT_CNT, + V_RXTSHIFTMAXR1(M_RXTSHIFTMAXR1) | + V_RXTSHIFTMAXR2(M_RXTSHIFTMAXR2), + V_RXTSHIFTMAXR1(1) | V_RXTSHIFTMAXR2(v)); + } + for (i = 0; i < 16; i++) { + snprintf(s, sizeof(s), "hw.cxgbe.toe.rexmt_backoff.%d", i); + if (TUNABLE_INT_FETCH(s, &v)) { + v &= M_TIMERBACKOFFINDEX0; + shift = (i & 3) << 3; + t4_set_reg_field(sc, A_TP_TCP_BACKOFF_REG0 + (i & ~3), + M_TIMERBACKOFFINDEX0 << shift, v << shift); + } + } return (0); } @@ -5255,6 +5307,9 @@ t4_sysctls(struct adapter *sc) #ifdef TCP_OFFLOAD if (is_offload(sc)) { + int i; + char s[4]; + /* * dev.t4nex.X.toe. */ @@ -5301,11 +5356,11 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_min", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_RXT_MIN, - sysctl_tp_timer, "LU", "Retransmit min (us)"); + sysctl_tp_timer, "LU", "Minimum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_max", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_RXT_MAX, - sysctl_tp_timer, "LU", "Retransmit max (us)"); + sysctl_tp_timer, "LU", "Maximum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "persist_min", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_PERS_MIN, @@ -5317,11 +5372,11 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_idle", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_KEEP_IDLE, - sysctl_tp_timer, "LU", "Keepidle idle timer (us)"); + sysctl_tp_timer, "LU", "Keepalive idle timer (us)"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_intvl", + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_interval", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_KEEP_INTVL, - sysctl_tp_timer, "LU", "Keepidle interval (us)"); + sysctl_tp_timer, "LU", "Keepalive interval timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "initial_srtt", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_INIT_SRTT, @@ -5330,6 +5385,31 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "finwait2_timer", CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_FINWAIT2_TIMER, sysctl_tp_timer, "LU", "FINWAIT2 timer (us)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "syn_rexmt_count", + CTLTYPE_UINT | CTLFLAG_RD, sc, S_SYNSHIFTMAX, + sysctl_tp_shift_cnt, "IU", + "Number of SYN retransmissions before abort"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_count", + CTLTYPE_UINT | CTLFLAG_RD, sc, S_RXTSHIFTMAXR2, + sysctl_tp_shift_cnt, "IU", + "Number of retransmissions before abort"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_count", + CTLTYPE_UINT | CTLFLAG_RD, sc, S_KEEPALIVEMAXR2, + sysctl_tp_shift_cnt, "IU", + "Number of keepalive probes before abort"); + + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "rexmt_backoff", + CTLFLAG_RD, NULL, "TOE retransmit backoffs"); + children = SYSCTL_CHILDREN(oid); + for (i = 0; i < 16; i++) { + snprintf(s, sizeof(s), "%u", i); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, s, + CTLTYPE_UINT | CTLFLAG_RD, sc, i, sysctl_tp_backoff, + "IU", "TOE retransmit backoff"); + } } #endif } @@ -8148,6 +8228,40 @@ sysctl_tp_timer(SYSCTL_HANDLER_ARGS) v = tp_tick_us * t4_read_reg(sc, reg); return (sysctl_handle_long(oidp, &v, 0, req)); +} + +/* + * All fields in TP_SHIFT_CNT are 4b and the starting location of the field is + * passed to this function. + */ +static int +sysctl_tp_shift_cnt(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int idx = arg2; + u_int v; + + MPASS(idx >= 0 && idx <= 24); + + v = (t4_read_reg(sc, A_TP_SHIFT_CNT) >> idx) & 0xf; + + return (sysctl_handle_int(oidp, &v, 0, req)); +} + +static int +sysctl_tp_backoff(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int idx = arg2; + u_int shift, v, r; + + MPASS(idx >= 0 && idx < 16); + + r = A_TP_TCP_BACKOFF_REG0 + (idx & ~3); + shift = (idx & 3) << 3; + v = (t4_read_reg(sc, r) >> shift) & M_TIMERBACKOFFINDEX0; + + return (sysctl_handle_int(oidp, &v, 0, req)); } #endif From owner-svn-src-head@freebsd.org Mon Jul 24 19:21:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B7C5D7E140; Mon, 24 Jul 2017 19:21:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com [IPv6:2607:f8b0:400e:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAB26757C9; Mon, 24 Jul 2017 19:21:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x236.google.com with SMTP id 123so61051266pgj.1; Mon, 24 Jul 2017 12:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=L8qjweKuRhgNUPIRyduoKoPIagU9oEB9tfLMsYBoUrA=; b=lfYup6rwtr0eXd8hfRDZrc+TQO5nCRptnwKhwMpriq/DZ3FrcFDYUyebCpfv+A8vIe O8g6Sn/3pwK+0GWj2qtSS8z+ZDo4Z8EoPAclYREfULd25TwvqBielB/4Dxgd20QkUXVp WFBt9qN1UrpO338zRvnZKihMGjNT6MtdDnyuDeKOVKuNwHcynL4M1wd3beN4cV7DaMyx buyr9NlbpAFLUwVYFzkP57RsnvI64mnIWaZV9LOJuz0r1047ekHYh6OdTEcIRW8NvKR+ iWBTa2+YoEBkvhptjKRxDI8RsVxNtrWyVFmTXTb/4jLQbOEV+VmE1lpdZ5etmT4VE7oE o/FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=L8qjweKuRhgNUPIRyduoKoPIagU9oEB9tfLMsYBoUrA=; b=rg2bESn7R7BYlWoS7VUjMcSwB4B/82eLrSmZvy+rGh8lkm5CMA5mmm2VOXcqhS/Nxr sxcWAm/ZS3yhTlw5YDe8NMsfIX96FCghHepp0WBMOwGVGdshXPzbxKPd5BBc+1j8vLA8 DLOX82+/gOF2r+srgMukw3AcoSESDIkqrgYRSOQVfS/RHG54jaOyNy9Pqs1xSi0zfHjT F2532HQwOsWuWC61V3+QdrK8FOY3NuiSKMNH5r5ZQE39IMWX+hceIDYMUkAmhfrAwmE8 XLKYcWzfQdLB1L/3PUntIZncoG9DkTDxxFakqxVmCBAY68t7NMHeNcPyq410+Erm9qYY i1tQ== X-Gm-Message-State: AIVw112W49cj2GIt9i4glhM3h78qIOLGQlvLAR8RwccAxGtaDPFjM7zW SgjPBWHiT4ICbx8/IQQ= X-Received: by 10.98.31.201 with SMTP id l70mr17366871pfj.128.1500924070174; Mon, 24 Jul 2017 12:21:10 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j1sm21240688pgs.77.2017.07.24.12.21.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 12:21:09 -0700 (PDT) Subject: Re: svn commit: r321434 - head Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9AC419B1-619E-43F6-B2F3-1B6100293EF6"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201707241854.v6OIsumD041710@repo.freebsd.org> Date: Mon, 24 Jul 2017 12:21:07 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <747A1C1C-43F4-4E91-B3B8-B23473BCE571@gmail.com> References: <201707241854.v6OIsumD041710@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 19:21:11 -0000 --Apple-Mail=_9AC419B1-619E-43F6-B2F3-1B6100293EF6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 24, 2017, at 11:54, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Mon Jul 24 18:54:56 2017 > New Revision: 321434 > URL: https://svnweb.freebsd.org/changeset/base/321434 >=20 > Log: > Add some .ORDER for distrib-dirs, distribute, distribution and = distribute world. The why could have helped explain this: 'This helps fix parallel =E2=80=9Cmake installworld=E2=80=9D with newly = created directories=E2=80=9D Thanks for fixing this ;)! -Ngie --Apple-Mail=_9AC419B1-619E-43F6-B2F3-1B6100293EF6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZdkikAAoJEPWDqSZpMIYVR/IP/iNy1d1mMN7OqjxD6WlrYm0D jXHuXw9Kktv8UMYQ2Nfn9fVMzmPacu79dFHLQlXAYHa2B4GOZMpdMWfassz0x1Sn gVTMEoNp41nJ4WHnfuali+RDIy09yrPf+0r5ZgMSYPntPJnq123mfk+/P+4MQrcL 4QX+3NviGjUoTXmvjL8yhXIIBm5ES85tFRhg8Uv0GdM6028p1SfLjHTdKY7x9rum IZMtz9Y2ZXegredXhr+fuHrkpgVeJqEdKHn68Asx5Lbae9+zb5BgZHqB7QWb09sL gyQipDjdQ51LW83aifZ0/eBKm0yT3Zpm8UlH+FIm50Oao4FtO9aDwLKpzXnPou0e R1osnAjihxX/qx/S1STcDEvMBFtCwsC53Zd/Rm2veNbKDYnNJ9//WztCZPIPPPCS nzObQ1DWMN+SmGeohzarkVXJq2xw2vIUkkznhvIQqkTZMBXRicLY3nP2NEdJxS4Q Dj6ZiXItCV2/6FAfL0R/Yx4GGSNeABEPZrA0bkMZMY9m8JYLo2lXj6kZgPE8kp2D N5ton30s/A5Ran3nBrjVTwB1EqoPgAa7mk3Ngf7GKCGSR9EEmEOF25uAVhbV+VbR WnYzo0fosMA+Iqh2fr5byYSEC0wvIHYI3Ifyrya30Fl2HjTbatxc/aqPs2lc5ovz KbEE5o1MjY116Tf8AodJ =0ewn -----END PGP SIGNATURE----- --Apple-Mail=_9AC419B1-619E-43F6-B2F3-1B6100293EF6-- From owner-svn-src-head@freebsd.org Mon Jul 24 21:25:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F75FDA45CB; Mon, 24 Jul 2017 21:25:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F087D12A; Mon, 24 Jul 2017 21:25:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OLPngS002623; Mon, 24 Jul 2017 21:25:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OLPnNN002622; Mon, 24 Jul 2017 21:25:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707242125.v6OLPnNN002622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 24 Jul 2017 21:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321436 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 321436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 21:25:51 -0000 Author: emaste Date: Mon Jul 24 21:25:49 2017 New Revision: 321436 URL: https://svnweb.freebsd.org/changeset/base/321436 Log: ar: handle partial writes from archive_write_data libarchive may limit a single archive_write_data call to handling 0x7fffffff bytes. Add a loop to handle partial writes. Reviewed by: kib, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11715 Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Mon Jul 24 19:17:13 2017 (r321435) +++ head/usr.bin/ar/write.c Mon Jul 24 21:25:49 2017 (r321436) @@ -586,10 +586,17 @@ prefault_buffer(const char *buf, size_t s) static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + ssize_t written; + prefault_buffer(buf, s); - if (archive_write_data(a, buf, s) != (ssize_t)s) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", - archive_error_string(a)); + while (s > 0) { + written = archive_write_data(a, buf, s); + if (written < 0) + bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + archive_error_string(a)); + buf = (const char *)buf + written; + s -= written; + } } /* From owner-svn-src-head@freebsd.org Mon Jul 24 21:51:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99FF8DA94C6; Mon, 24 Jul 2017 21:51:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C9337E2CC; Mon, 24 Jul 2017 21:51:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6OLpfv5013846; Mon, 24 Jul 2017 21:51:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6OLpfkR013845; Mon, 24 Jul 2017 21:51:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707242151.v6OLpfkR013845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 24 Jul 2017 21:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321437 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 321437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 21:51:42 -0000 Author: markj Date: Mon Jul 24 21:51:41 2017 New Revision: 321437 URL: https://svnweb.freebsd.org/changeset/base/321437 Log: Fix style and wrap lines to 80 columns in savecore.c. No functional change intended. MFC after: 3 days Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Mon Jul 24 21:25:49 2017 (r321436) +++ head/sbin/savecore/savecore.c Mon Jul 24 21:51:41 2017 (r321437) @@ -101,30 +101,39 @@ static sig_atomic_t got_siginfo; static void infohandler(int); static void -printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *device, - int bounds, const int status) +printheader(xo_handle_t *xo, const struct kerneldumpheader *h, + const char *device, int bounds, const int status) { uint64_t dumplen; time_t t; const char *stat_str; xo_flush_h(xo); - xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", device); - xo_emit_h(xo, "{P: }{Lwc:Architecture}{:architecture/%s}\n", h->architecture); - xo_emit_h(xo, "{P: }{Lwc:Architecture Version}{:architecture_version/%u}\n", dtoh32(h->architectureversion)); + xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", + device); + xo_emit_h(xo, "{P: }{Lwc:Architecture}{:architecture/%s}\n", + h->architecture); + xo_emit_h(xo, + "{P: }{Lwc:Architecture Version}{:architecture_version/%u}\n", + dtoh32(h->architectureversion)); dumplen = dtoh64(h->dumplength); - xo_emit_h(xo, "{P: }{Lwc:Dump Length}{:dump_length_bytes/%lld}\n", (long long)dumplen); - xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", dtoh32(h->blocksize)); + xo_emit_h(xo, "{P: }{Lwc:Dump Length}{:dump_length_bytes/%lld}\n", + (long long)dumplen); + xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", + dtoh32(h->blocksize)); + t = dtoh64(h->dumptime); xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); - xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); - xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", + h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", + h->panicstring); xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); - switch(status) { + switch (status) { case STATUS_BAD: stat_str = "bad"; break; @@ -133,13 +142,15 @@ printheader(xo_handle_t *xo, const struct kerneldumphe break; default: stat_str = "unknown"; + break; } xo_emit_h(xo, "{P: }{Lwc:Dump Status}{:dump_status/%s}\n", stat_str); xo_flush_h(xo); } static int -getbounds(void) { +getbounds(void) +{ FILE *fp; char buf[6]; int ret; @@ -170,7 +181,8 @@ getbounds(void) { } static void -writebounds(int bounds) { +writebounds(int bounds) +{ FILE *fp; if ((fp = fopen("bounds", "w")) == NULL) { @@ -397,8 +409,8 @@ DoRegularFile(int fd, bool isencrypted, off_t dumpsize /* * At this point, we have a partial ordering: * nw <= hs <= he <= nr - * If hs > nw, buf[nw..hs] contains non-zero data. - * If he > hs, buf[hs..he] is all zeroes. + * If hs > nw, buf[nw..hs] contains non-zero + * data. If he > hs, buf[hs..he] is all zeroes. */ if (hs > nw) if (fwrite(buf + nw, hs - nw, 1, fp) @@ -705,7 +717,7 @@ DoFile(const char *savedir, const char *device) goto closefd; } - oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/ + oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file. */ isencrypted = (dumpkeysize > 0); if (compress) { snprintf(corename, sizeof(corename), "%s.%d.gz", @@ -960,7 +972,8 @@ main(int argc, char **argv) } else if (nsaved == 0) { if (nerr != 0) { if (verbose) - syslog(LOG_WARNING, "unsaved dumps found but not saved"); + syslog(LOG_WARNING, + "unsaved dumps found but not saved"); exit(1); } else if (verbose) syslog(LOG_WARNING, "no unsaved dumps found"); From owner-svn-src-head@freebsd.org Mon Jul 24 23:32:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58F3DAB6C9; Mon, 24 Jul 2017 23:32:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A355381040; Mon, 24 Jul 2017 23:32:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONWO1e055287; Mon, 24 Jul 2017 23:32:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONWOdo055285; Mon, 24 Jul 2017 23:32:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707242332.v6ONWOdo055285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 23:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321439 - in head: . lib/clang/libllvm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . lib/clang/libllvm X-SVN-Commit-Revision: 321439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:32:25 -0000 Author: bdrewery Date: Mon Jul 24 23:32:24 2017 New Revision: 321439 URL: https://svnweb.freebsd.org/changeset/base/321439 Log: Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm. The files are only ever generated to .OBJDIR, not to WORLDTMP (as a sysroot) and are only ever included from a compilation. So using a beforebuild target here removes the file before the compilation tries to include it. MFC after: 2 months X-MFC-With: r321369 Modified: head/Makefile.inc1 head/lib/clang/libllvm/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 24 22:26:48 2017 (r321438) +++ head/Makefile.inc1 Mon Jul 24 23:32:24 2017 (r321439) @@ -813,16 +813,6 @@ _worldtmp: .PHONY ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* .endif .endfor -# 20170724 remove stale lib/clang/libllvm/Options.inc file, of which there are -# two different versions after r308421, one for llvm-lib, one for llvm-dlltool -.for d in ${OBJTREE} ${WORLDTMP} -.for f in ${d}${.CURDIR}/lib/clang/libllvm/Options.inc -.if exists(${f}) || exists(${f}.d) - @echo Removing stale generated ${f} files - @rm -f ${f} ${f}.d -.endif -.endfor -.endfor .for _dir in \ lib lib/casper usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Mon Jul 24 22:26:48 2017 (r321438) +++ head/lib/clang/libllvm/Makefile Mon Jul 24 23:32:24 2017 (r321439) @@ -1302,6 +1302,16 @@ llvm-dlltool/Options.inc: ${LLVM_SRCS}/lib/ToolDrivers TGHDRS+= llvm-dlltool/Options.inc CFLAGS.DlltoolDriver.cpp+= -I${.OBJDIR}/llvm-dlltool +beforebuild: +# 20170724 remove stale Options.inc file, of which there are two different +# versions after r308421, one for llvm-lib, one for llvm-dlltool +.for f in Options.inc +.if exists(${f}) || exists(${f}.d) + @echo Removing stale generated ${f} files + @rm -f ${f} ${f}.d +.endif +.endfor + # Note: some rules are superfluous, not every combination is valid. .for arch in \ AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 From owner-svn-src-head@freebsd.org Mon Jul 24 23:32:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD896DAB712; Mon, 24 Jul 2017 23:32:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7748A81138; Mon, 24 Jul 2017 23:32:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONWe0o055385; Mon, 24 Jul 2017 23:32:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONWeJO055383; Mon, 24 Jul 2017 23:32:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707242332.v6ONWeJO055383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 23:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321441 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 321441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:32:41 -0000 Author: bdrewery Date: Mon Jul 24 23:32:40 2017 New Revision: 321441 URL: https://svnweb.freebsd.org/changeset/base/321441 Log: Allow disabling dependency tracking if DEPEND_CFLAGS is empty. This falls back on using the guesssed dependencies if so. Also remove a pre-bmake check while here. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Jul 24 23:32:36 2017 (r321440) +++ head/share/mk/bsd.dep.mk Mon Jul 24 23:32:40 2017 (r321441) @@ -195,13 +195,11 @@ ${DEPENDFILE}: .NOMETA DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} .if !defined(_meta_filemon) -.if defined(.PARSEDIR) +.if !empty(DEPEND_CFLAGS) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS # as those are the only ones we will include. DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:${DEPEND_FILTER}:M${.TARGET:${DEPEND_FILTER}}}" != "" CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} -.else -CFLAGS+= ${DEPEND_CFLAGS} .endif .for __depend_obj in ${DEPENDFILES_OBJS} .if ${MAKE_VERSION} < 20160220 Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Jul 24 23:32:36 2017 (r321440) +++ head/sys/conf/kern.post.mk Mon Jul 24 23:32:40 2017 (r321441) @@ -232,13 +232,11 @@ ${DEPENDOBJS}: .NOMETA DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} .if !defined(_meta_filemon) -.if defined(.PARSEDIR) +.if !empty(DEPEND_CFLAGS) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS # as those are the only ones we will include. DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:M${.TARGET}}" != "" CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} -.else -CFLAGS+= ${DEPEND_CFLAGS} .endif .for __depend_obj in ${DEPENDFILES_OBJS} .if ${MAKE_VERSION} < 20160220 From owner-svn-src-head@freebsd.org Mon Jul 24 23:32:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FDBBDAB6F5; Mon, 24 Jul 2017 23:32:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3D0810F8; Mon, 24 Jul 2017 23:32:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONWbLF055338; Mon, 24 Jul 2017 23:32:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONWa1G055336; Mon, 24 Jul 2017 23:32:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707242332.v6ONWa1G055336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 23:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321440 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 321440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:32:38 -0000 Author: bdrewery Date: Mon Jul 24 23:32:36 2017 New Revision: 321440 URL: https://svnweb.freebsd.org/changeset/base/321440 Log: Slightly simplify logic for which depend file is expected. This is a NOP. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Jul 24 23:32:24 2017 (r321439) +++ head/share/mk/bsd.dep.mk Mon Jul 24 23:32:36 2017 (r321440) @@ -240,8 +240,12 @@ _meta_obj= ${.OBJDIR:C,/,_,g}_${__obj:C,/,_,g}.meta _meta_obj= ${__obj}.meta .endif _dep_obj= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} -.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${_meta_obj})) || \ - (!defined(_meta_filemon) && !exists(${.OBJDIR}/${_dep_obj})) +.if defined(_meta_filemon) +_depfile= ${.OBJDIR}/${_meta_obj} +.else +_depfile= ${.OBJDIR}/${_dep_obj} +.endif +.if !exists(${_depfile}) ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .elif defined(_meta_filemon) @@ -252,7 +256,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} # guesses do include headers though since they may not be in SRCS. ${__obj}: ${OBJS_DEPEND_GUESS:N*.h} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} -.endif +.endif # !exists(${_depfile}) .endfor # Always run 'make depend' to generate dependencies early and to avoid the Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Jul 24 23:32:24 2017 (r321439) +++ head/sys/conf/kern.post.mk Mon Jul 24 23:32:36 2017 (r321440) @@ -259,8 +259,12 @@ beforebuild: kernel-depend # For meta+filemon the .meta file is checked for since it is the dependency # file used. .for __obj in ${DEPENDOBJS:O:u} -.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ - (!defined(_meta_filemon) && !exists(${.OBJDIR}/.depend.${__obj})) +.if defined(_meta_filemon) +_depfile= ${.OBJDIR}/${__obj}.meta +.else +_depfile= ${.OBJDIR}/.depend.${__obj} +.endif +.if !exists(${_depfile}) .if ${SYSTEM_OBJS:M${__obj}} ${__obj}: ${OBJS_DEPEND_GUESS} .endif @@ -275,7 +279,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} ${__obj}: ${OBJS_DEPEND_GUESS:N*.h} .endif ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} -.endif +.endif # !exists(${_depfile}) .endfor .NOPATH: .depend ${DEPENDFILES_OBJS} From owner-svn-src-head@freebsd.org Mon Jul 24 23:32:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5927DAB733; Mon, 24 Jul 2017 23:32:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A07C68119C; Mon, 24 Jul 2017 23:32:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONWhFW055431; Mon, 24 Jul 2017 23:32:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONWhmA055430; Mon, 24 Jul 2017 23:32:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707242332.v6ONWhmA055430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 23:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321442 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:32:45 -0000 Author: bdrewery Date: Mon Jul 24 23:32:43 2017 New Revision: 321442 URL: https://svnweb.freebsd.org/changeset/base/321442 Log: The .depend.obj cleanup hacks are only needed with -DNO_CLEAN. Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 24 23:32:40 2017 (r321441) +++ head/Makefile.inc1 Mon Jul 24 23:32:43 2017 (r321442) @@ -770,7 +770,6 @@ _worldtmp: .PHONY fi .endfor .endif # ${USING_SYSTEM_COMPILER} == "yes" -.endif # !defined(NO_CLEAN) # Our current approach to dependency tracking cannot cope with certain source # tree changes, particularly with respect to removing source files and @@ -813,6 +812,9 @@ _worldtmp: .PHONY ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* .endif .endfor + +.endif # !defined(NO_CLEAN) + .for _dir in \ lib lib/casper usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} From owner-svn-src-head@freebsd.org Mon Jul 24 23:32:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0103BDAB758; Mon, 24 Jul 2017 23:32:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2E94811FF; Mon, 24 Jul 2017 23:32:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONWkZE055477; Mon, 24 Jul 2017 23:32:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONWkn7055476; Mon, 24 Jul 2017 23:32:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707242332.v6ONWkn7055476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 24 Jul 2017 23:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321443 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:32:48 -0000 Author: bdrewery Date: Mon Jul 24 23:32:46 2017 New Revision: 321443 URL: https://svnweb.freebsd.org/changeset/base/321443 Log: NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP. This prevents situations with -DNO_CLEAN from finding stale headers or libraries in places that no longer exist or have moved. It avoids the need to remove all of WORLDTMP by reusing what we already know is obsolete. MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 24 23:32:43 2017 (r321442) +++ head/Makefile.inc1 Mon Jul 24 23:32:46 2017 (r321443) @@ -761,6 +761,13 @@ _worldtmp: .PHONY rm -rf ${LIBCOMPATTMP} .endif .else + ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + delete-old delete-old-libs +.if defined(LIBCOMPAT) + ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + DESTDIR=${LIBCOMPATTMP} \ + delete-old delete-old-libs +.endif rm -rf ${WORLDTMP}/legacy/usr/include .if ${USING_SYSTEM_COMPILER} == "yes" .for cc in cc c++ From owner-svn-src-head@freebsd.org Mon Jul 24 23:57:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFADDABF4C; Mon, 24 Jul 2017 23:57:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86E581E01; Mon, 24 Jul 2017 23:57:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ONvh3Z063825; Mon, 24 Jul 2017 23:57:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ONvhJA063824; Mon, 24 Jul 2017 23:57:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707242357.v6ONvhJA063824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 24 Jul 2017 23:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321444 - head/etc X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 321444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Jul 2017 23:57:45 -0000 Author: ngie Date: Mon Jul 24 23:57:43 2017 New Revision: 321444 URL: https://svnweb.freebsd.org/changeset/base/321444 Log: Remove ${MTREE} and leverage etc/mtree/Makefile instead with "make distribution". This also fixes the fact that BSD.debug.dist was being installed if/when ${MK_DEBUG_FILES} != "no" before this commit. MFC after: 2 months Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jul 24 23:32:46 2017 (r321443) +++ head/etc/Makefile Mon Jul 24 23:57:43 2017 (r321444) @@ -152,20 +152,6 @@ BIN1+= regdomain.xml # -rwxr-xr-x root:wheel, for the new cron root:wheel BIN2= netstart pccard_ether rc.suspend rc.resume -MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist -.if ${MK_LIB32} != "no" -MTREE+= BSD.lib32.dist -.endif -.if ${MK_LIBSOFT} != "no" -MTREE+= BSD.libsoft.dist -.endif -.if ${MK_TESTS} != "no" -MTREE+= BSD.tests.dist -.endif -.if ${MK_SENDMAIL} != "no" -MTREE+= BSD.sendmail.dist -.endif - PPPCNF= ppp.conf .if ${MK_SENDMAIL} == "no" @@ -254,6 +240,7 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install .if ${MK_NTP} != "no" ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install @@ -308,8 +295,6 @@ distribution: rm -f ${DESTDIR}/.cshrc; \ ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc .endif - cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${MTREE} ${DESTDIR}/etc/mtree .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail From owner-svn-src-head@freebsd.org Tue Jul 25 00:12:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C3E2DAC28B; Tue, 25 Jul 2017 00:12:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2909A82492; Tue, 25 Jul 2017 00:12:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P0CmXJ071728; Tue, 25 Jul 2017 00:12:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P0Cm9b071727; Tue, 25 Jul 2017 00:12:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707250012.v6P0Cm9b071727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 00:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321445 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 00:12:49 -0000 Author: bdrewery Date: Tue Jul 25 00:12:48 2017 New Revision: 321445 URL: https://svnweb.freebsd.org/changeset/base/321445 Log: cleandir: Fix ESTALE errors from parallel removals. This fixes 'make cleandir' to use the same ordering as 'make cleanobj'. Meaning that SUBDIR will be recursed before the current directory is handled. This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next, or even removing the current directory and then recursing into a child and using the 'missing OBJDIR' logic to remove files rather than the directory. The most ideal ordering here would be for 'cleanobj' and 'cleandir' to simply remove the .OBJDIR and then not recurse at all. This is only safe if it is guaranteed that all children directories have no orphaned files in their source checkout and are only using obj directories. This is usually safe from the top-level build targets and when using WITH_AUTO_OBJ. Improving the build for those cases is coming. Reported by: cperciva, scottl X-MFC-With: r321427 MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Mon Jul 24 23:57:43 2017 (r321444) +++ head/share/mk/bsd.obj.mk Tue Jul 25 00:12:48 2017 (r321445) @@ -183,9 +183,9 @@ clean: .endif .ORDER: clean all -cleandir: cleanobj - .include + +cleandir: .WAIT cleanobj .if make(destroy*) && defined(OBJROOT) # this (rm -rf objdir) is much faster and more reliable than cleaning. From owner-svn-src-head@freebsd.org Tue Jul 25 00:17:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21692DAC394; Tue, 25 Jul 2017 00:17:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7E9A82656; Tue, 25 Jul 2017 00:17:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 14A50F458; Tue, 25 Jul 2017 00:17:27 +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 E79EF951B; Tue, 25 Jul 2017 00:17:25 +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 wnl870F9KYEB; Tue, 25 Jul 2017 00:17:22 +0000 (UTC) Subject: Re: svn commit: r321444 - head/etc DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 68DEC9516 To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707242357.v6ONvhJA063824@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5890e09f-8983-f458-34cf-3107f288edc1@FreeBSD.org> Date: Mon, 24 Jul 2017 17:17:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201707242357.v6ONvhJA063824@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="flwt2961UI6eu2NGGbsGPu309DjCNILcG" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 00:17:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --flwt2961UI6eu2NGGbsGPu309DjCNILcG Content-Type: multipart/mixed; boundary="BG3wdHEtclulSP5bGKhejlFhf1JbFMC21"; protected-headers="v1" From: Bryan Drewery To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5890e09f-8983-f458-34cf-3107f288edc1@FreeBSD.org> Subject: Re: svn commit: r321444 - head/etc References: <201707242357.v6ONvhJA063824@repo.freebsd.org> In-Reply-To: <201707242357.v6ONvhJA063824@repo.freebsd.org> --BG3wdHEtclulSP5bGKhejlFhf1JbFMC21 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/24/2017 4:57 PM, Ngie Cooper wrote: > Author: ngie > Date: Mon Jul 24 23:57:43 2017 > New Revision: 321444 > URL: https://svnweb.freebsd.org/changeset/base/321444 >=20 > Log: > Remove ${MTREE} and leverage etc/mtree/Makefile instead with > "make distribution". > =20 > This also fixes the fact that BSD.debug.dist was being installed if/w= hen > ${MK_DEBUG_FILES} !=3D "no" before this commit. This was intentional, see r279248. > =20 > MFC after: 2 months >=20 > Modified: > head/etc/Makefile >=20 > Modified: head/etc/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/etc/Makefile Mon Jul 24 23:32:46 2017 (r321443) > +++ head/etc/Makefile Mon Jul 24 23:57:43 2017 (r321444) > @@ -152,20 +152,6 @@ BIN1+=3D regdomain.xml > # -rwxr-xr-x root:wheel, for the new cron root:wheel > BIN2=3D netstart pccard_ether rc.suspend rc.resume > =20 > -MTREE=3D BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BS= D.var.dist > -.if ${MK_LIB32} !=3D "no" > -MTREE+=3D BSD.lib32.dist > -.endif > -.if ${MK_LIBSOFT} !=3D "no" > -MTREE+=3D BSD.libsoft.dist > -.endif > -.if ${MK_TESTS} !=3D "no" > -MTREE+=3D BSD.tests.dist > -.endif > -.if ${MK_SENDMAIL} !=3D "no" > -MTREE+=3D BSD.sendmail.dist > -.endif > - > PPPCNF=3D ppp.conf > =20 > .if ${MK_SENDMAIL} =3D=3D "no" > @@ -254,6 +240,7 @@ distribution: > ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install > ${_+_}cd ${.CURDIR}/devd; ${MAKE} install > ${_+_}cd ${.CURDIR}/gss; ${MAKE} install > + ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install > ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install > .if ${MK_NTP} !=3D "no" > ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install > @@ -308,8 +295,6 @@ distribution: > rm -f ${DESTDIR}/.cshrc; \ > ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc > .endif > - cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ > - ${MTREE} ${DESTDIR}/etc/mtree > .if ${MK_MAIL} !=3D "no" > cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > ${ETCMAIL} ${DESTDIR}/etc/mail >=20 --=20 Regards, Bryan Drewery --BG3wdHEtclulSP5bGKhejlFhf1JbFMC21-- --flwt2961UI6eu2NGGbsGPu309DjCNILcG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZdo3/AAoJEDXXcbtuRpfPUc0H/1mj7Eq6qOqCZ3qaTcgmrniq sIAusYtlG2H87MHEWqlkA/Uj2VZ1h8I7gPkkkUk3BDEicQ96+od6NTvbme3v/D+x 36aXmN0zb8bnliqqMqpXr/K+eU7gUuTY9Va6iv85zp60gSvVPkP40T9E6lS4tu3S 2tg4lNpujsnDv24sL+LqOmGo+Wmxou0CJYNifa21izD8W7ldWJHXyGK+c7alR/7a H6cHsOMcENYsqxDGJlMt8lunnw8Kh6yQa9hBnoIomnSuO+WKTBOB4w9psfkYwa7p SGMhG0piPEYxoOrya/TvwPfZBmUCu2k7tQmtpltkr7It+ycLHLP1l0Oq6f0BaMI= =32SH -----END PGP SIGNATURE----- --flwt2961UI6eu2NGGbsGPu309DjCNILcG-- From owner-svn-src-head@freebsd.org Tue Jul 25 00:20:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD005DAC42B; Tue, 25 Jul 2017 00:20:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78792827A2; Tue, 25 Jul 2017 00:20:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id y129so13032723pgy.3; Mon, 24 Jul 2017 17:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=o+EZU7J30xq6GwzbQ9EbxUPFiAWPTWeqNPG4aGQxVYU=; b=DYI9feirtkh5QUc8dy4gOlGhUIEDyOOrvYDYmok9WmBqc1oLlCW7IXuxxrX33+jkId Z2SisGb7P88bFmr5oyIAoIiMqMN/olxrTqC3w6Nva5SJIsxCL2rrPEXmmcKfvNwz3cgt qQHH+sAPJ9UGak4JgCenV+yP6j5ap+EejyAu65zw4ycJJq8Kktlkg0FomqrKbjCsmdJ1 curtoBkNa7DYOHXlZ4wlmWW401GeftlLGv3/5bNHurLt/pvL3AB3GYM6AFoynJ3R86Q2 zcnDkomI931qwMhmW8FLnxvexmjscaOnK3uMTp7lyQqKSaGhk1HN3U2GinCn1+V7Dyka 7Mrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=o+EZU7J30xq6GwzbQ9EbxUPFiAWPTWeqNPG4aGQxVYU=; b=g5ialeanTaMtnfUuIfq5Dj0xPSoNXfrpZn/1SnYLjAUt4EAgDP1d9JFaeAtYD6BeK1 qCGT8QXBZWP0MIUXnMPjiR4rsFrUrEC1M4glblA1MkWbrpMIw8oaieoyD8FDIbIHTpX0 3ad5xUKd2bqbkvLGcAa0asT2FgPLRZWp/ZrKz6nJL6R7DfgUfAk87U/IdPxjT95GWsUX dUzbg4CcTt/kk6L632qurXbjIB06IO0ZRJDcTiCxAK1tm1xCnbY2NHxABuf2CUFCq3sP 2YH8n19IAOE+dDnVlCGMq6C3Q6eb7qECrXPTcHbRAAo3r6mAx/GWnIzI4wwSO1OSlCnz 52lA== X-Gm-Message-State: AIVw113GdhmtcB3pt7s/VDdlA2tMWB2D9OqIMJm1vKljYsjO4TXXMnCG twvo+yT2WE0SffeZOdM= X-Received: by 10.98.129.3 with SMTP id t3mr17691370pfd.167.1500942003680; Mon, 24 Jul 2017 17:20:03 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e24sm1071802pfk.180.2017.07.24.17.20.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 17:20:02 -0700 (PDT) Subject: Re: svn commit: r321444 - head/etc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_12DCF526-51C1-4587-97BB-6BAD3F69993B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <5890e09f-8983-f458-34cf-3107f288edc1@FreeBSD.org> Date: Mon, 24 Jul 2017 17:20:01 -0700 Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201707242357.v6ONvhJA063824@repo.freebsd.org> <5890e09f-8983-f458-34cf-3107f288edc1@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 00:20:04 -0000 --Apple-Mail=_12DCF526-51C1-4587-97BB-6BAD3F69993B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 24, 2017, at 17:17, Bryan Drewery wrote: >=20 > On 7/24/2017 4:57 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Mon Jul 24 23:57:43 2017 >> New Revision: 321444 >> URL: https://svnweb.freebsd.org/changeset/base/321444 >>=20 >> Log: >> Remove ${MTREE} and leverage etc/mtree/Makefile instead with >> "make distribution". >>=20 >> This also fixes the fact that BSD.debug.dist was being installed = if/when >> ${MK_DEBUG_FILES} !=3D "no" before this commit. >=20 > This was intentional, see r279248. Ok. It would have been nice if there had been a comment added noting = that it was being unconditionally installed for a reason. I=E2=80=99ll add a relevant comment to etc/mtree/Makefile and restore = the previous behavior (it was silly having duplicative logic in two = places, since etc/mtree/Makefile wasn=E2=80=99t actually being used). Thanks, -Ngie --Apple-Mail=_12DCF526-51C1-4587-97BB-6BAD3F69993B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZdo6xAAoJEPWDqSZpMIYVJZgP/RQuVoCF6bw1DvbM5P799khr VsVov5H+T8NjTBOvMSyrV0GYQNSE+G1JNQXnY30Lo6AQWfKyxmIOiFbSpbiEqnN6 /kcRDTCUcwTr5pxd78XTztWWaPfYWf6S0ZuSmHJAqgUNQSq9Kqk9AdEcyFuW09GI uNu2+kaLBh77gtPvB86TuLmx6clD/dyXfxSK5kitcJfpALvEky4VTq29/Zs6gu6b wYmkGj6tOmxTEK2ghTaH4JTzcXcq6U/I/j1aYWXWwQAiw2ABfQmON7NreEaRdeDN yuYFdLm6O05yb6cgprDJT9jUc4Yw4cTBl/xnGwpxxZrWdsGI2ZKu5Hvik5qtoIyc gelnaT1KHqW05WEzMLK+6bNUYYrIFxpVYNtkeBOvTZiKZtIAn5b/h6KexittZs4x gDRAVMF7caQsVuhGAlUEHvLHSclQa591MBQa4SL2r6/1bYtkscWx4g4hlRYilHb/ wOwm5HSfL0WTXF467bzhdAdyVhWYRp34Zv4BG48b0X0KgVhYwltJH9HRpL3AAOc5 KqqJsxMGaBW1X/Fi5hp1D18bJYxLklD1LB6h/mJXTGO+BnMoy3lcS7BmnCkz+Qdc 49+kgZcsxDncTjKPlBuNkcSbFchPYRelCEmpocpMBDO8AmXM0DBl+2nXFkXXcFbg Fs1MItDHEKutU+czLaPx =X+6O -----END PGP SIGNATURE----- --Apple-Mail=_12DCF526-51C1-4587-97BB-6BAD3F69993B-- From owner-svn-src-head@freebsd.org Tue Jul 25 00:28:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C1EDAC66A; Tue, 25 Jul 2017 00:28:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0A9E82B85; Tue, 25 Jul 2017 00:28:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P0SNcA076027; Tue, 25 Jul 2017 00:28:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P0SNlW076026; Tue, 25 Jul 2017 00:28:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707250028.v6P0SNlW076026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 00:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321446 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 321446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 00:28:25 -0000 Author: ngie Date: Tue Jul 25 00:28:23 2017 New Revision: 321446 URL: https://svnweb.freebsd.org/changeset/base/321446 Log: Unconditionally install etc/mtree/BSD.debug.dist again r279248 unconditionally installed BSD.debug.dist for ease-of-developer-use. Restore the previous behavior. While here, add a comment to note that this is intentional to avoid accidental future removal. MFC after: 2 months MFC with: r321444 Modified: head/etc/mtree/Makefile Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Tue Jul 25 00:12:48 2017 (r321445) +++ head/etc/mtree/Makefile Tue Jul 25 00:28:23 2017 (r321446) @@ -2,7 +2,9 @@ .include -FILES= ${_BSD.debug.dist} \ +# NOTE: BSD.debug.dist is unconditionally installed for developer ease-of-use. +FILES= \ + BSD.debug.dist \ BSD.include.dist \ BSD.root.dist \ ${_BSD.lib32.dist} \ @@ -12,9 +14,6 @@ FILES= ${_BSD.debug.dist} \ BSD.usr.dist \ BSD.var.dist -.if ${MK_DEBUG_FILES} != "no" -_BSD.debug.dist= BSD.debug.dist -.endif .if ${MK_LIB32} != "no" _BSD.lib32.dist= BSD.lib32.dist .endif From owner-svn-src-head@freebsd.org Tue Jul 25 01:50:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84D99DAF1AE; Tue, 25 Jul 2017 01:50:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53B5020C4; Tue, 25 Jul 2017 01:50:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P1obH0008858; Tue, 25 Jul 2017 01:50:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P1obZg008856; Tue, 25 Jul 2017 01:50:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201707250150.v6P1obZg008856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 25 Jul 2017 01:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321450 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Commit-Revision: 321450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 01:50:38 -0000 Author: kevans Date: Tue Jul 25 01:50:37 2017 New Revision: 321450 URL: https://svnweb.freebsd.org/changeset/base/321450 Log: bsdgrep(1): Don't exit before processing every file Given an empty pattern (i.e. grep "" A B), bsdgrep(1) would previously exit() with the appropriate exit code upon encountering an empty file. Likely intended as an optimization, but this behavior is technically incorrect since an empty pattern should match every line. PR: 220924 Reviewed by: emaste, cem (earlier version), ngie Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D11698 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/util.c Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Jul 25 00:33:53 2017 (r321449) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Jul 25 01:50:37 2017 (r321450) @@ -669,6 +669,24 @@ mmap_eof_not_eol_body() atf_check -s exit:0 -o not-empty \ env MALLOC_CONF="redzone:true" grep --mmap -e " " test2 } + +atf_test_case matchall +matchall_head() +{ + atf_set "descr" "Check proper behavior of matching all with an empty string" +} +matchall_body() +{ + printf "" > test1 + printf "A" > test2 + printf "A\nB" > test3 + + atf_check -o inline:"test2:A\ntest3:A\ntest3:B\n" grep "" test1 test2 test3 + atf_check -o inline:"test3:A\ntest3:B\ntest2:A\n" grep "" test3 test1 test2 + atf_check -o inline:"test2:A\ntest3:A\ntest3:B\n" grep "" test2 test3 test1 + + atf_check -s exit:1 grep "" test1 +} # End FreeBSD atf_init_test_cases() @@ -709,5 +727,6 @@ atf_init_test_cases() atf_add_test_case badcontext atf_add_test_case mmap atf_add_test_case mmap_eof_not_eol + atf_add_test_case matchall # End FreeBSD } Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Tue Jul 25 00:33:53 2017 (r321449) +++ head/usr.bin/grep/util.c Tue Jul 25 01:50:37 2017 (r321450) @@ -259,16 +259,8 @@ procfile(const char *fn) pc.ln.boff = 0; pc.ln.off += pc.ln.len + 1; if ((pc.ln.dat = grep_fgetln(f, &pc.ln.len)) == NULL || - pc.ln.len == 0) { - if (pc.ln.line_no == 0 && matchall) - /* - * An empty file with an empty pattern and the - * -w flag does not match - */ - exit(matchall && wflag ? 1 : 0); - else - break; - } + pc.ln.len == 0) + break; if (pc.ln.len > 0 && pc.ln.dat[pc.ln.len - 1] == fileeol) --pc.ln.len; From owner-svn-src-head@freebsd.org Tue Jul 25 03:54:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E7EBDB442E; Tue, 25 Jul 2017 03:54:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E185665D90; Tue, 25 Jul 2017 03:54:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P3sZBP062112; Tue, 25 Jul 2017 03:54:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P3sZtu062111; Tue, 25 Jul 2017 03:54:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707250354.v6P3sZtu062111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 03:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321455 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 03:54:37 -0000 Author: ngie Date: Tue Jul 25 03:54:35 2017 New Revision: 321455 URL: https://svnweb.freebsd.org/changeset/base/321455 Log: Raise WARNS to 1 This will enable warnings with the msun tests. MFC after: 1 month Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Tue Jul 25 03:48:24 2017 (r321454) +++ head/lib/msun/tests/Makefile Tue Jul 25 03:54:35 2017 (r321455) @@ -4,8 +4,6 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libm -WARNS?= 0 - # All architectures on FreeBSD have fenv.h CFLAGS+= -DHAVE_FENV_H @@ -85,6 +83,8 @@ IGNORE_PRAGMA= SRCS.ilogb2_test= ilogb_test.c LIBADD+= m + +WARNS?= 1 # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" From owner-svn-src-head@freebsd.org Tue Jul 25 03:55:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26DD4DB44D4; Tue, 25 Jul 2017 03:55:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0316965EF7; Tue, 25 Jul 2017 03:55:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P3tjYO062232; Tue, 25 Jul 2017 03:55:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P3tjVq062230; Tue, 25 Jul 2017 03:55:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707250355.v6P3tjVq062230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 03:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321456 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 03:55:46 -0000 Author: ngie Date: Tue Jul 25 03:55:44 2017 New Revision: 321456 URL: https://svnweb.freebsd.org/changeset/base/321456 Log: Convert lib/msun/trig_test from TAP to ATF format Only expose :accuracy and :reduction if !i386, similar to before, but more holistically to avoid future -Wunused issue with the unused functions. MFC after: 1 month Modified: head/lib/msun/tests/Makefile head/lib/msun/tests/trig_test.c Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Tue Jul 25 03:54:35 2017 (r321455) +++ head/lib/msun/tests/Makefile Tue Jul 25 03:55:44 2017 (r321456) @@ -68,7 +68,7 @@ TAP_TESTS_C+= nan_test TAP_TESTS_C+= nearbyint_test TAP_TESTS_C+= next_test TAP_TESTS_C+= rem_test -TAP_TESTS_C+= trig_test +ATF_TESTS_C+= trig_test .if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) CFLAGS+= -O0 Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Tue Jul 25 03:54:35 2017 (r321455) +++ head/lib/msun/tests/trig_test.c Tue Jul 25 03:55:44 2017 (r321456) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "test-utils.h" #pragma STDC FENV_ACCESS ON @@ -63,9 +65,9 @@ __FBSDID("$FreeBSD$"); */ #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ - assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(fpequal((func)(_d), (result))); \ - assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ + ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ + ATF_CHECK(fpequal((func)(_d), (result))); \ + ATF_CHECK(((void)(func), fetestexcept(exceptmask) == (excepts))); \ } while (0) #define testall(prefix, x, result, exceptmask, excepts) do { \ @@ -79,13 +81,16 @@ __FBSDID("$FreeBSD$"); test(prefix##f, x, (float)result, exceptmask, excepts); \ } while (0) -/* - * Test special cases in sin(), cos(), and tan(). - */ -static void -run_special_tests(void) +ATF_TC(special); +ATF_TC_HEAD(special, tc) { + atf_tc_set_md_var(tc, "descr", + "test special cases in sin(), cos(), and tan()"); +} +ATF_TC_BODY(special, tc) +{ + /* Values at 0 should be exact. */ testall(tan, 0.0, 0.0, ALL_STD_EXCEPT, 0); testall(tan, -0.0, -0.0, ALL_STD_EXCEPT, 0); @@ -108,12 +113,16 @@ run_special_tests(void) testall(cos, NAN, NAN, ALL_STD_EXCEPT, 0); } -/* - * Tests to ensure argument reduction for large arguments is accurate. - */ -static void -run_reduction_tests(void) +#ifndef __i386__ +ATF_TC(reduction); +ATF_TC_HEAD(reduction, tc) { + + atf_tc_set_md_var(tc, "descr", + "tests to ensure argument reduction for large arguments is accurate"); +} +ATF_TC_BODY(reduction, tc) +{ /* floats very close to odd multiples of pi */ static const float f_pi_odd[] = { 85563208.0f, @@ -156,69 +165,72 @@ run_reduction_tests(void) unsigned i; for (i = 0; i < nitems(f_pi_odd); i++) { - assert(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON); - assert(cosf(f_pi_odd[i]) == -1.0); - assert(fabs(tan(f_pi_odd[i])) < FLT_EPSILON); + ATF_CHECK(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON); + ATF_CHECK(cosf(f_pi_odd[i]) == -1.0); + ATF_CHECK(fabs(tan(f_pi_odd[i])) < FLT_EPSILON); - assert(fabs(sinf(-f_pi_odd[i])) < FLT_EPSILON); - assert(cosf(-f_pi_odd[i]) == -1.0); - assert(fabs(tanf(-f_pi_odd[i])) < FLT_EPSILON); + ATF_CHECK(fabs(sinf(-f_pi_odd[i])) < FLT_EPSILON); + ATF_CHECK(cosf(-f_pi_odd[i]) == -1.0); + ATF_CHECK(fabs(tanf(-f_pi_odd[i])) < FLT_EPSILON); - assert(fabs(sinf(f_pi_odd[i] * 2)) < FLT_EPSILON); - assert(cosf(f_pi_odd[i] * 2) == 1.0); - assert(fabs(tanf(f_pi_odd[i] * 2)) < FLT_EPSILON); + ATF_CHECK(fabs(sinf(f_pi_odd[i] * 2)) < FLT_EPSILON); + ATF_CHECK(cosf(f_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabs(tanf(f_pi_odd[i] * 2)) < FLT_EPSILON); - assert(fabs(sinf(-f_pi_odd[i] * 2)) < FLT_EPSILON); - assert(cosf(-f_pi_odd[i] * 2) == 1.0); - assert(fabs(tanf(-f_pi_odd[i] * 2)) < FLT_EPSILON); + ATF_CHECK(fabs(sinf(-f_pi_odd[i] * 2)) < FLT_EPSILON); + ATF_CHECK(cosf(-f_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabs(tanf(-f_pi_odd[i] * 2)) < FLT_EPSILON); } for (i = 0; i < nitems(d_pi_odd); i++) { - assert(fabs(sin(d_pi_odd[i])) < 2 * DBL_EPSILON); - assert(cos(d_pi_odd[i]) == -1.0); - assert(fabs(tan(d_pi_odd[i])) < 2 * DBL_EPSILON); + ATF_CHECK(fabs(sin(d_pi_odd[i])) < 2 * DBL_EPSILON); + ATF_CHECK(cos(d_pi_odd[i]) == -1.0); + ATF_CHECK(fabs(tan(d_pi_odd[i])) < 2 * DBL_EPSILON); - assert(fabs(sin(-d_pi_odd[i])) < 2 * DBL_EPSILON); - assert(cos(-d_pi_odd[i]) == -1.0); - assert(fabs(tan(-d_pi_odd[i])) < 2 * DBL_EPSILON); + ATF_CHECK(fabs(sin(-d_pi_odd[i])) < 2 * DBL_EPSILON); + ATF_CHECK(cos(-d_pi_odd[i]) == -1.0); + ATF_CHECK(fabs(tan(-d_pi_odd[i])) < 2 * DBL_EPSILON); - assert(fabs(sin(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); - assert(cos(d_pi_odd[i] * 2) == 1.0); - assert(fabs(tan(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); + ATF_CHECK(fabs(sin(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); + ATF_CHECK(cos(d_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabs(tan(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); - assert(fabs(sin(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); - assert(cos(-d_pi_odd[i] * 2) == 1.0); - assert(fabs(tan(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); + ATF_CHECK(fabs(sin(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); + ATF_CHECK(cos(-d_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabs(tan(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); } #if LDBL_MANT_DIG > 53 for (i = 0; i < nitems(ld_pi_odd); i++) { - assert(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON); - assert(cosl(ld_pi_odd[i]) == -1.0); - assert(fabsl(tanl(ld_pi_odd[i])) < LDBL_EPSILON); + ATF_CHECK(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON); + ATF_CHECK(cosl(ld_pi_odd[i]) == -1.0); + ATF_CHECK(fabsl(tanl(ld_pi_odd[i])) < LDBL_EPSILON); - assert(fabsl(sinl(-ld_pi_odd[i])) < LDBL_EPSILON); - assert(cosl(-ld_pi_odd[i]) == -1.0); - assert(fabsl(tanl(-ld_pi_odd[i])) < LDBL_EPSILON); + ATF_CHECK(fabsl(sinl(-ld_pi_odd[i])) < LDBL_EPSILON); + ATF_CHECK(cosl(-ld_pi_odd[i]) == -1.0); + ATF_CHECK(fabsl(tanl(-ld_pi_odd[i])) < LDBL_EPSILON); - assert(fabsl(sinl(ld_pi_odd[i] * 2)) < LDBL_EPSILON); - assert(cosl(ld_pi_odd[i] * 2) == 1.0); - assert(fabsl(tanl(ld_pi_odd[i] * 2)) < LDBL_EPSILON); + ATF_CHECK(fabsl(sinl(ld_pi_odd[i] * 2)) < LDBL_EPSILON); + ATF_CHECK(cosl(ld_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabsl(tanl(ld_pi_odd[i] * 2)) < LDBL_EPSILON); - assert(fabsl(sinl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON); - assert(cosl(-ld_pi_odd[i] * 2) == 1.0); - assert(fabsl(tanl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON); + ATF_CHECK(fabsl(sinl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON); + ATF_CHECK(cosl(-ld_pi_odd[i] * 2) == 1.0); + ATF_CHECK(fabsl(tanl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON); } #endif } -/* - * Tests the accuracy of these functions over the primary range. - */ -static void -run_accuracy_tests(void) +ATF_TC(accuracy); +ATF_TC_HEAD(accuracy, tc) { + atf_tc_set_md_var(tc, "descr", + "tests the accuracy of these functions over the primary range"); +} +ATF_TC_BODY(accuracy, tc) +{ + /* For small args, sin(x) = tan(x) = x, and cos(x) = 1. */ testall(sin, 0xd.50ee515fe4aea16p-114L, 0xd.50ee515fe4aea16p-114L, ALL_STD_EXCEPT, FE_INEXACT); @@ -256,25 +268,17 @@ run_accuracy_tests(void) * - tests for large numbers that get reduced to hi+lo with lo!=0 */ } +#endif -int -main(void) +ATF_TP_ADD_TCS(tp) { - printf("1..3\n"); + ATF_TP_ADD_TC(tp, special); - run_special_tests(); - printf("ok 1 - trig\n"); - #ifndef __i386__ - run_reduction_tests(); + ATF_TP_ADD_TC(tp, accuracy); + ATF_TP_ADD_TC(tp, reduction); #endif - printf("ok 2 - trig\n"); -#ifndef __i386__ - run_accuracy_tests(); -#endif - printf("ok 3 - trig\n"); - - return (0); + return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue Jul 25 03:56:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73222DB4564; Tue, 25 Jul 2017 03:56:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42ABC66055; Tue, 25 Jul 2017 03:56:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P3ugSk062322; Tue, 25 Jul 2017 03:56:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P3ugDo062321; Tue, 25 Jul 2017 03:56:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707250356.v6P3ugDo062321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 03:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321457 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 03:56:43 -0000 Author: ngie Date: Tue Jul 25 03:56:42 2017 New Revision: 321457 URL: https://svnweb.freebsd.org/changeset/base/321457 Log: Mark :reduction as an expected failure It fails with clang 5.0+. PR: 220989 MFC after: 2 months MFC with: r321369 Reported by: Jenkins Modified: head/lib/msun/tests/trig_test.c Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Tue Jul 25 03:55:44 2017 (r321456) +++ head/lib/msun/tests/trig_test.c Tue Jul 25 03:56:42 2017 (r321457) @@ -162,6 +162,11 @@ ATF_TC_BODY(reduction, tc) }; #endif +#if defined(__clang__) && \ + ((__clang_major__ >= 5)) + atf_tc_expect_fail("test fails with clang 5.0+ - bug 220989"); +#endif + unsigned i; for (i = 0; i < nitems(f_pi_odd); i++) { From owner-svn-src-head@freebsd.org Tue Jul 25 06:59:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2494FDBC25B; Tue, 25 Jul 2017 06:59:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E28F56B0A3; Tue, 25 Jul 2017 06:59:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P6xaoB035800; Tue, 25 Jul 2017 06:59:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P6xa88035799; Tue, 25 Jul 2017 06:59:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707250659.v6P6xa88035799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 25 Jul 2017 06:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321460 - head/sys/fs/fdescfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/fs/fdescfs X-SVN-Commit-Revision: 321460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 06:59:37 -0000 Author: dchagin Date: Tue Jul 25 06:59:35 2017 New Revision: 321460 URL: https://svnweb.freebsd.org/changeset/base/321460 Log: Replace unnecessary _KERNEL by double-include protection. MFC after: 2 week Modified: head/sys/fs/fdescfs/fdesc.h Modified: head/sys/fs/fdescfs/fdesc.h ============================================================================== --- head/sys/fs/fdescfs/fdesc.h Tue Jul 25 04:13:43 2017 (r321459) +++ head/sys/fs/fdescfs/fdesc.h Tue Jul 25 06:59:35 2017 (r321460) @@ -34,7 +34,9 @@ * $FreeBSD$ */ -#ifdef _KERNEL +#ifndef _FS_FDESC_H_ +#define _FS_FDESC_H_ + /* Private mount flags for fdescfs. */ #define FMNT_UNMOUNTF 0x01 struct fdescmount { @@ -66,4 +68,4 @@ extern vfs_init_t fdesc_init; extern vfs_uninit_t fdesc_uninit; extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *, struct vnode **); -#endif /* _KERNEL */ +#endif /* !_FS_FDESC_H_ */ From owner-svn-src-head@freebsd.org Tue Jul 25 09:48:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0509C0886E; Tue, 25 Jul 2017 09:48:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC696FD59; Tue, 25 Jul 2017 09:48:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P9mXhi005492; Tue, 25 Jul 2017 09:48:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P9mXWs005491; Tue, 25 Jul 2017 09:48:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707250948.v6P9mXWs005491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 25 Jul 2017 09:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321461 - head/lib/libc/x86/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/x86/sys X-SVN-Commit-Revision: 321461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 09:48:34 -0000 Author: kib Date: Tue Jul 25 09:48:33 2017 New Revision: 321461 URL: https://svnweb.freebsd.org/changeset/base/321461 Log: Fix indent. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/x86/sys/__vdso_gettc.c Modified: head/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/x86/sys/__vdso_gettc.c Tue Jul 25 06:59:35 2017 (r321460) +++ head/lib/libc/x86/sys/__vdso_gettc.c Tue Jul 25 09:48:33 2017 (r321461) @@ -158,7 +158,7 @@ __vdso_init_hpet(uint32_t u) if (atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], (uintptr_t)old_map, (uintptr_t)new_map) == 0 && new_map != MAP_FAILED) - munmap((void *)new_map, PAGE_SIZE); + munmap((void *)new_map, PAGE_SIZE); return; fail: From owner-svn-src-head@freebsd.org Tue Jul 25 10:41:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAFCC31A2D; Tue, 25 Jul 2017 10:41:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 693BC715E6; Tue, 25 Jul 2017 10:41:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PAfYra026256; Tue, 25 Jul 2017 10:41:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PAfYIT026255; Tue, 25 Jul 2017 10:41:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707251041.v6PAfYIT026255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 25 Jul 2017 10:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321462 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 10:41:35 -0000 Author: andrew Date: Tue Jul 25 10:41:34 2017 New Revision: 321462 URL: https://svnweb.freebsd.org/changeset/base/321462 Log: Build the 32-bit ARM libstand and loader parts with -fPIC. Many of them are already built with this flag so libstand should also be build as such. This will be needed when moving to lld as it refuses to link due to incompatible relocations. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.stand.mk Modified: head/share/mk/bsd.stand.mk ============================================================================== --- head/share/mk/bsd.stand.mk Tue Jul 25 09:48:33 2017 (r321461) +++ head/share/mk/bsd.stand.mk Tue Jul 25 10:41:34 2017 (r321462) @@ -21,6 +21,9 @@ CFLAGS+= -fPIC -mno-red-zone .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -fPIC -mgeneral-regs-only .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -G0 -fno-pic -mno-abicalls .endif From owner-svn-src-head@freebsd.org Tue Jul 25 11:05:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6F70C7829D; Tue, 25 Jul 2017 11:05:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B947207C; Tue, 25 Jul 2017 11:05:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PB5rk4037985; Tue, 25 Jul 2017 11:05:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PB5r4W037984; Tue, 25 Jul 2017 11:05:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201707251105.v6PB5r4W037984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 25 Jul 2017 11:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321463 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 321463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 11:05:54 -0000 Author: tuexen Date: Tue Jul 25 11:05:53 2017 New Revision: 321463 URL: https://svnweb.freebsd.org/changeset/base/321463 Log: Remove duplicate statement. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Jul 25 10:41:34 2017 (r321462) +++ head/sys/netinet/sctp_indata.c Tue Jul 25 11:05:53 2017 (r321463) @@ -2074,7 +2074,6 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc struct mbuf *mm; control->data = dmbuf; - mm = control->data; for (mm = control->data; mm; mm = mm->m_next) { control->length += SCTP_BUF_LEN(mm); } From owner-svn-src-head@freebsd.org Tue Jul 25 12:52:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF7AC7B993; Tue, 25 Jul 2017 12:52:34 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014A375A9B; Tue, 25 Jul 2017 12:52:33 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PCqX9n084131; Tue, 25 Jul 2017 12:52:33 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PCqW4V084128; Tue, 25 Jul 2017 12:52:32 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251252.v6PCqW4V084128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 12:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321464 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/probes usr.sbin/dtrace/tests/common/probes X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/probes usr.sbin/dtrace/tests/common/probes X-SVN-Commit-Revision: 321464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 12:52:34 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 12:52:32 2017 New Revision: 321464 URL: https://svnweb.freebsd.org/changeset/base/321464 Log: Add a simple program which calls sigtimedwait(2) to generate events for testing This test timeout on a quiet system because there is nobody triggers 'syscall::*wait*:entry' probe while test execution. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11668 Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c (contents, props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c Tue Jul 25 12:52:32 2017 (r321464) @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2017 Li-Wen Hsu + */ + +#include +#include +#include + +int +main(void) +{ + + sigset_t set; + siginfo_t info; + struct timespec timeout; + + (void)sigemptyset(&set); + (void)sigaddset(&set, SIGHUP); + timeout.tv_sec = 1; + timeout.tv_nsec = 0; + + for (;;) + (void)sigtimedwait(&set, &info, &timeout); + + return (0); +} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d Tue Jul 25 11:05:53 2017 (r321463) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d Tue Jul 25 12:52:32 2017 (r321464) @@ -45,6 +45,7 @@ BEGIN } syscall::*wait*:entry +/pid == $1/ { exit(0); } Modified: head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile Tue Jul 25 11:05:53 2017 (r321463) +++ head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile Tue Jul 25 12:52:32 2017 (r321464) @@ -32,6 +32,7 @@ TESTEXES= \ CFILES= \ + tst.probestar.c \ From owner-svn-src-head@freebsd.org Tue Jul 25 12:58:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E44C7BA66; Tue, 25 Jul 2017 12:58:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE33B75D15; Tue, 25 Jul 2017 12:58:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PCw3ls084435; Tue, 25 Jul 2017 12:58:03 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PCw3Bv084432; Tue, 25 Jul 2017 12:58:03 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251258.v6PCw3Bv084432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 12:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321465 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/speculation usr.sbin/dtrace/tests/common/speculation X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/speculation usr.sbin/dtrace/tests/common/speculation X-SVN-Commit-Revision: 321465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 12:58:05 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 12:58:03 2017 New Revision: 321465 URL: https://svnweb.freebsd.org/changeset/base/321465 Log: Add a simple script which calls open(2) and others to generate events for testing. This test times-out on a quiet system because there is nobody triggers syscall::open:entry or syscall::: probe while test execution. Reviewed by: gnn, markj (earlier version) Differential Revision: https://reviews.freebsd.org/D11671 Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe (contents, props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d Tue Jul 25 12:52:32 2017 (r321464) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d Tue Jul 25 12:58:03 2017 (r321465) @@ -39,6 +39,7 @@ BEGIN { i = 0; + notused = $1; } syscall::open:entry Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Tue Jul 25 12:58:03 2017 (r321465) @@ -0,0 +1,30 @@ +#!/usr/bin/env ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2017 Li-Wen Hsu + +while true +do + sleep 0.1 + cat /etc/motd > /dev/null +done Modified: head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile Tue Jul 25 12:52:32 2017 (r321464) +++ head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile Tue Jul 25 12:58:03 2017 (r321465) @@ -68,6 +68,7 @@ ${PACKAGE}FILES= \ tst.zerosize.d \ TESTEXES= \ + tst.NoSpecBuffer.exe \ CFILES= \ From owner-svn-src-head@freebsd.org Tue Jul 25 13:01:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FD90C7BC7D; Tue, 25 Jul 2017 13:01:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C53B76022; Tue, 25 Jul 2017 13:01:11 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PD1ARu085444; Tue, 25 Jul 2017 13:01:10 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PD1A2b085443; Tue, 25 Jul 2017 13:01:10 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251301.v6PD1A2b085443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321466 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Commit-Revision: 321466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:01:11 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:01:10 2017 New Revision: 321466 URL: https://svnweb.freebsd.org/changeset/base/321466 Log: Add an auxiliary subroutine to generate read(2) event while testing. Reviewed by: gnn, ngie Differential Revision: https://reviews.freebsd.org/D11673 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Tue Jul 25 12:58:03 2017 (r321465) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Tue Jul 25 13:01:10 2017 (r321466) @@ -38,6 +38,14 @@ ## +reader() +{ + while true + do + sleep 0.1 + cat /etc/motd > /dev/null + done +} if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' @@ -46,11 +54,16 @@ fi dtrace=$1 +reader & +child=$! + $dtrace -qwf read'{chill(15); printf("Done chilling"); exit(0);}' status=$? if [ "$status" -ne 0 ]; then echo $tst: dtrace failed fi + +kill $child exit $status From owner-svn-src-head@freebsd.org Tue Jul 25 13:04:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E43CC7BD30; Tue, 25 Jul 2017 13:04:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BAB3763C7; Tue, 25 Jul 2017 13:04:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PD4OZG088669; Tue, 25 Jul 2017 13:04:24 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PD4OSB088668; Tue, 25 Jul 2017 13:04:24 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251304.v6PD4OSB088668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321467 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Commit-Revision: 321467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:04:25 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:04:24 2017 New Revision: 321467 URL: https://svnweb.freebsd.org/changeset/base/321467 Log: Explicitly set dynamic variable buffer size. We added too many variable assignments in BEGIN block, which will run out of default auto-configured variable buffer space. The test VM has 4G RAM which should be enough for most cases so it's reasonable to increase limitation to these case. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11674 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d Tue Jul 25 13:01:10 2017 (r321466) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d Tue Jul 25 13:04:24 2017 (r321467) @@ -27,6 +27,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" #pragma D option quiet +#pragma D option dynvarsize=2m BEGIN { From owner-svn-src-head@freebsd.org Tue Jul 25 13:07:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB8C7C7BE02; Tue, 25 Jul 2017 13:07:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4DCB7657D; Tue, 25 Jul 2017 13:07:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PD76iC088813; Tue, 25 Jul 2017 13:07:06 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PD76uq088812; Tue, 25 Jul 2017 13:07:06 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251307.v6PD76uq088812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321468 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Commit-Revision: 321468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:07:08 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:07:06 2017 New Revision: 321468 URL: https://svnweb.freebsd.org/changeset/base/321468 Log: Explicitly set dynamic variable buffer size. We added too many variable assignments in BEGIN block, which will run out of default auto-configured variable buffer space. The test VM has 4G RAM which should be enough for most cases so it's reasonable to increase limitation to these case. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D11676 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d Tue Jul 25 13:04:24 2017 (r321467) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d Tue Jul 25 13:07:06 2017 (r321468) @@ -27,6 +27,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" #pragma D option quiet +#pragma D option dynvarsize=2m /* * This test verifies that the basename() and dirname() functions are working From owner-svn-src-head@freebsd.org Tue Jul 25 13:11:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1595C7BF79; Tue, 25 Jul 2017 13:11:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4DB7688B; Tue, 25 Jul 2017 13:11:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PDBKO8089034; Tue, 25 Jul 2017 13:11:20 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PDBKgC089032; Tue, 25 Jul 2017 13:11:20 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251311.v6PDBKgC089032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321469 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Commit-Revision: 321469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:11:22 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:11:20 2017 New Revision: 321469 URL: https://svnweb.freebsd.org/changeset/base/321469 Log: Make this test case accepts basename() in D script returns "" or "." In Solaris, basename(1) and basename(3) both return "." while being given an empty string (""), while in BSD (and Linux) basename(1) returns "" and basename(3) returns "." While here, also change #!/usr/bin/ksh to #!/usr/bin/env ksh to find ksh in $PATH Reviewed by: gnn, markj (earlier version), ngie (earlier version) Differential Revision: https://reviews.freebsd.org/D11707 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d Tue Jul 25 13:07:06 2017 (r321468) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d Tue Jul 25 13:11:20 2017 (r321469) @@ -55,12 +55,16 @@ BEGIN dir[i++] = "f"; dir[i++] = "f/"; dir[i++] = "/////"; + /* + * basename(3) and basename(1) return different results for the empty + * string on FreeBSD, so we need special handling. dir[i++] = ""; + */ end = i; i = 0; - printf("#!/usr/bin/ksh\n\n"); + printf("#!/usr/bin/env ksh\n\n"); } tick-1ms @@ -84,5 +88,19 @@ tick-1ms tick-1ms /i == end/ { + dir[i] = ""; + printf("if [ \"`basename \"%s\"`\" != \"%s\" -a \".\" != \"%s\" ]; then\n", + dir[i], basename(dir[i]), basename(dir[i])); + printf(" echo \"basename(\\\"%s\\\") is \\\"%s\\\"; ", + dir[i], basename(dir[i])); + printf("expected \\\"`basename \"%s\"`\\\" or \\\".\\\"\"\n", dir[i]); + printf("fi\n\n"); + printf("if [ `dirname \"%s\"` != \"%s\" ]; then\n", + dir[i], dirname(dir[i])); + printf(" echo \"dirname(\\\"%s\\\") is \\\"%s\\\"; ", + dir[i], dirname(dir[i])); + printf("expected \\\"`dirname \"%s\"`\"\\\"\n", dir[i]); + printf("fi\n\n"); + exit(0); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out Tue Jul 25 13:07:06 2017 (r321468) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out Tue Jul 25 13:11:20 2017 (r321469) @@ -1,4 +1,4 @@ -#!/usr/bin/ksh +#!/usr/bin/env ksh if [ `basename "/foo/bar/baz"` != "baz" ]; then echo "basename(\"/foo/bar/baz\") is \"baz\"; expected \"`basename "/foo/bar/baz"`"\" @@ -152,8 +152,8 @@ if [ `dirname "/////"` != "/" ]; then echo "dirname(\"/////\") is \"/\"; expected \"`dirname "/////"`"\" fi -if [ `basename ""` != "." ]; then - echo "basename(\"\") is \".\"; expected \"`basename ""`"\" +if [ "`basename ""`" != "." -a "." != "." ]; then + echo "basename(\"\") is \".\"; expected \"`basename ""`\" or \".\"" fi if [ `dirname ""` != "." ]; then From owner-svn-src-head@freebsd.org Tue Jul 25 13:14:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5267C7C154; Tue, 25 Jul 2017 13:14:03 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8208C76BC8; Tue, 25 Jul 2017 13:14:03 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PDE2WI092686; Tue, 25 Jul 2017 13:14:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PDE26v092684; Tue, 25 Jul 2017 13:14:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251314.v6PDE26v092684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321470 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc X-SVN-Commit-Revision: 321470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:14:03 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:14:02 2017 New Revision: 321470 URL: https://svnweb.freebsd.org/changeset/base/321470 Log: Modify glob patterns and expected output to match FreeBSD's implementation. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11713 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh Tue Jul 25 13:11:20 2017 (r321469) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh Tue Jul 25 13:14:02 2017 (r321470) @@ -31,11 +31,12 @@ fi dtrace=$1 -$dtrace -ln 'syscall::*$1:entry' read | awk '{print $(NF-1),$NF}' | sort -$dtrace -ln 'syscall::$1*:entry' read | awk '{print $(NF-1),$NF}' | sort -$dtrace -ln 'syscall::re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort -$dtrace -ln 'syscall::$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort -$dtrace -ln 'syscall::p$1[0-9][0-9]:entry' read | awk '{print $(NF-1),$NF}' | \ - sort +$dtrace -ln 'syscall:freebsd:*$1:entry' read | \ + awk '{print $(NF-1),$NF}' | grep -v -E 'compat.\.' | sort +$dtrace -ln 'syscall:freebsd:$1*:entry' read | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall:freebsd:re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall:freebsd:$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall:freebsd:w$1[0-9]:entry' ait | \ + awk '{print $(NF-1),$NF}' | sort exit $status Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out Tue Jul 25 13:11:20 2017 (r321469) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out Tue Jul 25 13:14:02 2017 (r321470) @@ -1,15 +1,22 @@ FUNCTION NAME +aio_read entry +obs_vread entry pread entry read entry +rtprio_thread entry FUNCTION NAME read entry readlink entry +readlinkat entry readv entry FUNCTION NAME read entry readlink entry +readlinkat entry readv entry FUNCTION NAME readlink entry +readlinkat entry FUNCTION NAME -pread64 entry +wait4 entry +wait6 entry From owner-svn-src-head@freebsd.org Tue Jul 25 13:17:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 735A6C7C268; Tue, 25 Jul 2017 13:17:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40E1E76DB7; Tue, 25 Jul 2017 13:17:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PDH60A092909; Tue, 25 Jul 2017 13:17:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PDH63E092908; Tue, 25 Jul 2017 13:17:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201707251317.v6PDH63E092908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 25 Jul 2017 13:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321471 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 321471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:17:07 -0000 Author: avg Date: Tue Jul 25 13:17:06 2017 New Revision: 321471 URL: https://svnweb.freebsd.org/changeset/base/321471 Log: spa_import_rootpool should be able to handle an imported root pool That is required to support reboot -r with a new root filesystem being on an already imported pool. PR: 210721 Reported by: Jan Bramkamp MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 25 13:14:02 2017 (r321470) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 25 13:17:06 2017 (r321471) @@ -4270,6 +4270,16 @@ spa_import_rootpool(const char *name) if ((spa = spa_lookup(pname)) != NULL) { /* + * The pool could already be imported, + * e.g., after reboot -r. + */ + if (spa->spa_state == POOL_STATE_ACTIVE) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); + return (0); + } + + /* * Remove the existing root pool from the namespace so * that we can replace it with the correct config * we just read in. From owner-svn-src-head@freebsd.org Tue Jul 25 13:18:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BBBEC7C2FF; Tue, 25 Jul 2017 13:18:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 689E076F19; Tue, 25 Jul 2017 13:18:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PDISvI093013; Tue, 25 Jul 2017 13:18:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PDISfa093012; Tue, 25 Jul 2017 13:18:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707251318.v6PDISfa093012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 25 Jul 2017 13:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321472 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 321472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 13:18:29 -0000 Author: lwhsu (ports committer) Date: Tue Jul 25 13:18:28 2017 New Revision: 321472 URL: https://svnweb.freebsd.org/changeset/base/321472 Log: The test case common.funcs.t_dtrace_contrib.tst_basename_d generates a verifying script which needs being run to complete the test. While here, add missing shebang. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11716 Modified: head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Tue Jul 25 13:17:06 2017 (r321471) +++ head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Tue Jul 25 13:18:28 2017 (r321472) @@ -1,3 +1,5 @@ +#!/bin/sh + # $FreeBSD$ usage() @@ -83,6 +85,12 @@ runtest() retval=1 ;; esac + + if [ $retval -eq 0 ] && \ + head -n 1 $STDOUT | grep -q -E '^#!/.*ksh$'; then + ksh $STDOUT + retval=$? + fi return $retval } From owner-svn-src-head@freebsd.org Tue Jul 25 14:38:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC62C7DA20; Tue, 25 Jul 2017 14:38:31 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0B17D8FE; Tue, 25 Jul 2017 14:38:31 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PEcUPX026284; Tue, 25 Jul 2017 14:38:30 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PEcUAC026283; Tue, 25 Jul 2017 14:38:30 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251438.v6PEcUAC026283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 14:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321476 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 321476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 14:38:31 -0000 Author: sbruno Date: Tue Jul 25 14:38:30 2017 New Revision: 321476 URL: https://svnweb.freebsd.org/changeset/base/321476 Log: Drop ixgbe RX lock during TCP_LRO processing. This eliminates a "storm" of LOR detection and a bit of lock release/acquire collision when using LRO. Submitted by: Kevin Bowling MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D11712 Modified: head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Tue Jul 25 14:35:44 2017 (r321475) +++ head/sys/dev/ixgbe/ix_txrx.c Tue Jul 25 14:38:30 2017 (r321476) @@ -1593,9 +1593,7 @@ ixgbe_rx_input(struct rx_ring *rxr, struct ifnet *ifp, if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } - IXGBE_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); - IXGBE_RX_LOCK(rxr); } /* ixgbe_rx_input */ /************************************************************************ @@ -1880,7 +1878,9 @@ next_desc: /* Now send to the stack or do LRO */ if (sendmp != NULL) { rxr->next_to_check = i; + IXGBE_RX_UNLOCK(rxr); ixgbe_rx_input(rxr, ifp, sendmp, ptype); + IXGBE_RX_LOCK(rxr); i = rxr->next_to_check; } @@ -1897,12 +1897,12 @@ next_desc: rxr->next_to_check = i; + IXGBE_RX_UNLOCK(rxr); + /* * Flush any outstanding LRO work */ tcp_lro_flush_all(lro); - - IXGBE_RX_UNLOCK(rxr); /* * Still have cleaning to do? From owner-svn-src-head@freebsd.org Tue Jul 25 14:41:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 603EEC7DD6C; Tue, 25 Jul 2017 14:41:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8C857DE76; Tue, 25 Jul 2017 14:41:51 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PEfogn030335; Tue, 25 Jul 2017 14:41:50 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PEfocM030334; Tue, 25 Jul 2017 14:41:50 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251441.v6PEfocM030334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 14:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321477 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 14:41:52 -0000 Author: sbruno Date: Tue Jul 25 14:41:50 2017 New Revision: 321477 URL: https://svnweb.freebsd.org/changeset/base/321477 Log: Don't hold the RM lock during lagg_proto_addport() to avoid an LOR. Submitted by: Kevin Bowling Reviewed by: mav MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11711 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Jul 25 14:38:30 2017 (r321476) +++ head/sys/net/if_lagg.c Tue Jul 25 14:41:50 2017 (r321477) @@ -738,14 +738,15 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * lagg_setmulti(lp); + LAGG_WUNLOCK(sc); + if ((error = lagg_proto_addport(sc, lp)) != 0) { /* Remove the port, without calling pr_delport. */ + LAGG_WLOCK(sc); lagg_port_destroy(lp, 0); LAGG_UNLOCK_ASSERT(sc); return (error); } - - LAGG_WUNLOCK(sc); /* Update lagg capabilities */ lagg_capabilities(sc); From owner-svn-src-head@freebsd.org Tue Jul 25 15:03:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A7CC7E6C3; Tue, 25 Jul 2017 15:03:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91D257ECE1; Tue, 25 Jul 2017 15:03:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PF367m038787; Tue, 25 Jul 2017 15:03:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PF35cf038781; Tue, 25 Jul 2017 15:03:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251503.v6PF35cf038781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 15:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321479 - in head/sys/netinet: . cc X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/netinet: . cc X-SVN-Commit-Revision: 321479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 15:03:07 -0000 Author: sbruno Date: Tue Jul 25 15:03:05 2017 New Revision: 321479 URL: https://svnweb.freebsd.org/changeset/base/321479 Log: Revert r308180 - Set slow start threshold more accurrately on loss ... This was discussed between various transport@ members and it was requested to be reverted and discussed. Submitted by: kevin Reported by: lawerence Reviewed by: hiren Modified: head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_cdg.c Tue Jul 25 15:03:05 2017 (r321479) @@ -474,9 +474,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty ENTER_RECOVERY(CCV(ccv, t_flags)); break; case CC_RTO: - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); CCV(ccv, snd_cwnd) = mss; break; default: Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_chd.c Tue Jul 25 15:03:05 2017 (r321479) @@ -330,11 +330,13 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty struct ertt *e_t; struct chd *chd_data; int qdly; + uint32_t cwin; u_int mss; e_t = khelp_get_osd(CCV(ccv, osd), ertt_id); chd_data = ccv->cc_data; qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; + cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); switch(signal_type) { @@ -376,9 +378,7 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty ENTER_FASTRECOVERY(CCV(ccv, t_flags)); break; case CC_RTO: - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); CCV(ccv, snd_cwnd) = mss; break; Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 15:03:05 2017 (r321479) @@ -230,21 +230,19 @@ static void dctcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct dctcp *dctcp_data; - uint32_t cwin, ssthresh_on_loss; + uint32_t cwin; u_int mss; dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); - ssthresh_on_loss = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; switch (type) { case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = mss * + max(cwin / 2 / mss, 2); dctcp_data->num_cong_events++; } else { /* cwnd has already updated as congestion @@ -252,7 +250,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) * snd_cwnd_prev and recalculate snd_ssthresh */ cwin = CCV(ccv, snd_cwnd_prev); - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = + max(cwin / 2 / mss, 2) * mss; } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -266,7 +265,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { if (V_dctcp_slowstart && dctcp_data->num_cong_events++ == 0) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = + mss * max(cwin / 2 / mss, 2); dctcp_data->alpha = MAX_ALPHA_VALUE; dctcp_data->bytes_ecn = 0; dctcp_data->bytes_total = 0; @@ -285,7 +285,7 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); CCV(ccv, snd_cwnd) = mss; } break; Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_htcp.c Tue Jul 25 15:03:05 2017 (r321479) @@ -325,9 +325,7 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) */ if (CCV(ccv, t_rxtshift) >= 2) htcp_data->t_last_cong = ticks; - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); CCV(ccv, snd_cwnd) = mss; break; } @@ -520,10 +518,6 @@ htcp_ssthresh_update(struct cc_var *ccv) CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) * htcp_data->beta) >> HTCP_SHIFT; } - - /* Align ssthresh to MSS boundary */ - CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_ssthresh) / CCV(ccv, t_maxseg)) - * CCV(ccv, t_maxseg); } Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_newreno.c Tue Jul 25 15:03:05 2017 (r321479) @@ -182,26 +182,23 @@ newreno_after_idle(struct cc_var *ccv) static void newreno_cong_signal(struct cc_var *ccv, uint32_t type) { - uint32_t cwin, ssthresh_on_loss; + uint32_t cwin; u_int mss; cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); - ssthresh_on_loss = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; /* Catch algos which mistakenly leak private signal types. */ KASSERT((type & CC_SIGPRIVMASK) == 0, ("%s: congestion signal type 0x%08x is private\n", __func__, type)); - cwin = max(cwin / 2 / mss, 2) * mss; + cwin = max(2*mss, cwin/2); switch (type) { case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = cwin; } ENTER_RECOVERY(CCV(ccv, t_flags)); @@ -209,13 +206,13 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_ECN: if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = cwin; ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } break; case CC_RTO: - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = mss; break; } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/tcp_input.c Tue Jul 25 15:03:05 2017 (r321479) @@ -441,8 +441,7 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui * ssthresh = max (FlightSize / 2, 2*SMSS) eq (4) */ tp->snd_ssthresh = - max((tp->snd_max - tp->snd_una) / 2 / maxseg, 2) - * maxseg; + max((tp->snd_max - tp->snd_una) / 2, 2 * maxseg); tp->snd_cwnd = maxseg; } break; From owner-svn-src-head@freebsd.org Tue Jul 25 15:08:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF181C7E871; Tue, 25 Jul 2017 15:08:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1B47F138; Tue, 25 Jul 2017 15:08:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PF8rNa039346; Tue, 25 Jul 2017 15:08:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PF8qQ8039338; Tue, 25 Jul 2017 15:08:52 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251508.v6PF8qQ8039338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 15:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321480 - in head/sys/netinet: . cc tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 321480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 15:08:54 -0000 Author: sbruno Date: Tue Jul 25 15:08:52 2017 New Revision: 321480 URL: https://svnweb.freebsd.org/changeset/base/321480 Log: Revert r307901 - Inform CC modules about loss events. This was discussed between various transport@ members and it was requested to be reverted and discussed. Submitted by: Kevin Bowling Reported by: lawrence Reviewed by: hiren Sponsored by: Limelight Networks Modified: head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_cdg.c Tue Jul 25 15:08:52 2017 (r321480) @@ -431,12 +431,7 @@ static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) { struct cdg *cdg_data = ccv->cc_data; - uint32_t cwin; - u_int mss; - cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); - switch(signal_type) { case CC_CDG_DELAY: CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, @@ -453,7 +448,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty */ if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || cdg_data->queue_state < CDG_Q_FULL) { - CCV(ccv, snd_ssthresh) = cwin; + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); CCV(ccv, snd_recover) = CCV(ccv, snd_max); } else { /* @@ -466,16 +461,12 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty cdg_data->shadow_w, RENO_BETA); CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w, - cdg_window_decrease(ccv, cwin, V_cdg_beta_loss)); - CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), + V_cdg_beta_loss)); cdg_data->window_incr = cdg_data->rtt_count = 0; } ENTER_RECOVERY(CCV(ccv, t_flags)); - break; - case CC_RTO: - CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); - CCV(ccv, snd_cwnd) = mss; break; default: newreno_cc_algo.cong_signal(ccv, signal_type); Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_chd.c Tue Jul 25 15:08:52 2017 (r321480) @@ -330,14 +330,10 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty struct ertt *e_t; struct chd *chd_data; int qdly; - uint32_t cwin; - u_int mss; e_t = khelp_get_osd(CCV(ccv, osd), ertt_id); chd_data = ccv->cc_data; qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; - cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); switch(signal_type) { case CC_CHD_DELAY: @@ -376,10 +372,6 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty CCV(ccv, t_maxseg) / 2, 2) * CCV(ccv, t_maxseg); } ENTER_FASTRECOVERY(CCV(ccv, t_flags)); - break; - case CC_RTO: - CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); - CCV(ccv, snd_cwnd) = mss; break; default: Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_cubic.c Tue Jul 25 15:08:52 2017 (r321480) @@ -225,12 +225,8 @@ static void cubic_cong_signal(struct cc_var *ccv, uint32_t type) { struct cubic *cubic_data; - uint32_t cwin; - u_int mss; cubic_data = ccv->cc_data; - cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); switch (type) { case CC_NDUPACK: @@ -239,8 +235,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_ssthresh_update(ccv); cubic_data->num_cong_events++; cubic_data->prev_max_cwnd = cubic_data->max_cwnd; - cubic_data->max_cwnd = cwin; - CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -251,7 +246,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_ssthresh_update(ccv); cubic_data->num_cong_events++; cubic_data->prev_max_cwnd = cubic_data->max_cwnd; - cubic_data->max_cwnd = cwin; + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); cubic_data->t_last_cong = ticks; CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); @@ -266,13 +261,9 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) * chance the first one is a false alarm and may not indicate * congestion. */ - if (CCV(ccv, t_rxtshift) >= 2) { + if (CCV(ccv, t_rxtshift) >= 2) cubic_data->num_cong_events++; cubic_data->t_last_cong = ticks; - cubic_ssthresh_update(ccv); - cubic_data->max_cwnd = cwin; - CCV(ccv, snd_cwnd) = mss; - } break; } } Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 15:08:52 2017 (r321480) @@ -230,11 +230,10 @@ static void dctcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct dctcp *dctcp_data; - uint32_t cwin; - u_int mss; + u_int win, mss; dctcp_data = ccv->cc_data; - cwin = CCV(ccv, snd_cwnd); + win = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); switch (type) { @@ -242,16 +241,16 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { CCV(ccv, snd_ssthresh) = mss * - max(cwin / 2 / mss, 2); + max(win / 2 / mss, 2); dctcp_data->num_cong_events++; } else { /* cwnd has already updated as congestion * recovery. Reverse cwnd value using * snd_cwnd_prev and recalculate snd_ssthresh */ - cwin = CCV(ccv, snd_cwnd_prev); + win = CCV(ccv, snd_cwnd_prev); CCV(ccv, snd_ssthresh) = - max(cwin / 2 / mss, 2) * mss; + max(win / 2 / mss, 2) * mss; } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -261,18 +260,18 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) * Save current snd_cwnd when the host encounters both * congestion recovery and fast recovery. */ - CCV(ccv, snd_cwnd_prev) = cwin; + CCV(ccv, snd_cwnd_prev) = win; if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { if (V_dctcp_slowstart && dctcp_data->num_cong_events++ == 0) { CCV(ccv, snd_ssthresh) = - mss * max(cwin / 2 / mss, 2); + mss * max(win / 2 / mss, 2); dctcp_data->alpha = MAX_ALPHA_VALUE; dctcp_data->bytes_ecn = 0; dctcp_data->bytes_total = 0; dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); } else - CCV(ccv, snd_ssthresh) = max((cwin - ((cwin * + CCV(ccv, snd_ssthresh) = max((win - ((win * dctcp_data->alpha) >> 11)) / mss, 2) * mss; CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); @@ -285,8 +284,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; - CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); - CCV(ccv, snd_cwnd) = mss; } break; } Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_htcp.c Tue Jul 25 15:08:52 2017 (r321480) @@ -271,12 +271,8 @@ static void htcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct htcp *htcp_data; - uint32_t cwin; - u_int mss; htcp_data = ccv->cc_data; - cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); switch (type) { case CC_NDUPACK: @@ -291,9 +287,8 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) (htcp_data->maxrtt - htcp_data->minrtt) * 95) / 100; htcp_ssthresh_update(ccv); - CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); htcp_data->t_last_cong = ticks; - htcp_data->prev_cwnd = cwin; + htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -310,7 +305,7 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) htcp_ssthresh_update(ccv); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); htcp_data->t_last_cong = ticks; - htcp_data->prev_cwnd = cwin; + htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } break; @@ -325,8 +320,6 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) */ if (CCV(ccv, t_rxtshift) >= 2) htcp_data->t_last_cong = ticks; - CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); - CCV(ccv, snd_cwnd) = mss; break; } } Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/cc/cc_newreno.c Tue Jul 25 15:08:52 2017 (r321480) @@ -182,38 +182,29 @@ newreno_after_idle(struct cc_var *ccv) static void newreno_cong_signal(struct cc_var *ccv, uint32_t type) { - uint32_t cwin; - u_int mss; + u_int win; - cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); - /* Catch algos which mistakenly leak private signal types. */ KASSERT((type & CC_SIGPRIVMASK) == 0, ("%s: congestion signal type 0x%08x is private\n", __func__, type)); - cwin = max(2*mss, cwin/2); + win = max(CCV(ccv, snd_cwnd) / 2 / CCV(ccv, t_maxseg), 2) * + CCV(ccv, t_maxseg); switch (type) { case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { - if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = cwin; - CCV(ccv, snd_cwnd) = cwin; - } + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) + CCV(ccv, snd_ssthresh) = win; ENTER_RECOVERY(CCV(ccv, t_flags)); } break; case CC_ECN: if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = cwin; - CCV(ccv, snd_cwnd) = cwin; + CCV(ccv, snd_ssthresh) = win; + CCV(ccv, snd_cwnd) = win; ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } - break; - case CC_RTO: - CCV(ccv, snd_ssthresh) = cwin; - CCV(ccv, snd_cwnd) = mss; break; } } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/tcp_input.c Tue Jul 25 15:08:52 2017 (r321480) @@ -435,15 +435,9 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui tp->t_dupacks = 0; tp->t_bytes_acked = 0; EXIT_RECOVERY(tp->t_flags); - if (CC_ALGO(tp)->cong_signal == NULL) { - /* - * RFC5681 Section 3.1 - * ssthresh = max (FlightSize / 2, 2*SMSS) eq (4) - */ - tp->snd_ssthresh = - max((tp->snd_max - tp->snd_una) / 2, 2 * maxseg); - tp->snd_cwnd = maxseg; - } + tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / + maxseg) * maxseg; + tp->snd_cwnd = maxseg; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); @@ -2612,15 +2606,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if (awnd < tp->snd_ssthresh) { tp->snd_cwnd += maxseg; - /* - * RFC5681 Section 3.2 talks about cwnd - * inflation on additional dupacks and - * deflation on recovering from loss. - * - * We keep cwnd into check so that - * we don't have to 'deflate' it when we - * get out of recovery. - */ if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; } @@ -2660,22 +2645,19 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru TCPSTAT_INC( tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = maxseg; + tp->snd_cwnd = maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } tp->snd_nxt = th->th_ack; - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = maxseg; + tp->snd_cwnd = maxseg; (void) tp->t_fb->tfb_tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", __func__)); - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = tp->snd_ssthresh + - maxseg * - (tp->t_dupacks - tp->snd_limited); + tp->snd_cwnd = tp->snd_ssthresh + + maxseg * + (tp->t_dupacks - tp->snd_limited); if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; goto drop; Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Tue Jul 25 15:03:05 2017 (r321479) +++ head/sys/netinet/tcp_stacks/fastpath.c Tue Jul 25 15:08:52 2017 (r321480) @@ -1052,15 +1052,6 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, str if (awnd < tp->snd_ssthresh) { tp->snd_cwnd += tp->t_maxseg; - /* - * RFC5681 Section 3.2 talks about cwnd - * inflation on additional dupacks and - * deflation on recovering from loss. - * - * We keep cwnd into check so that - * we don't have to 'deflate' it when we - * get out of recovery. - */ if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; } @@ -1100,22 +1091,19 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, str TCPSTAT_INC( tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = tp->t_maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } tp->snd_nxt = th->th_ack; - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = tp->t_maxseg; (void) tp->t_fb->tfb_tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", __func__)); - if (CC_ALGO(tp)->cong_signal == NULL) - tp->snd_cwnd = tp->snd_ssthresh + - tp->t_maxseg * - (tp->t_dupacks - tp->snd_limited); + tp->snd_cwnd = tp->snd_ssthresh + + tp->t_maxseg * + (tp->t_dupacks - tp->snd_limited); if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; goto drop; From owner-svn-src-head@freebsd.org Tue Jul 25 15:33:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0046C7EF22; Tue, 25 Jul 2017 15:33:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7277FE11; Tue, 25 Jul 2017 15:33:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PFXY8D051422; Tue, 25 Jul 2017 15:33:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PFXYG7051417; Tue, 25 Jul 2017 15:33:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251533.v6PFXYG7051417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 15:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321481 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 321481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 15:33:35 -0000 Author: sbruno Date: Tue Jul 25 15:33:34 2017 New Revision: 321481 URL: https://svnweb.freebsd.org/changeset/base/321481 Log: bnxt: Implement interrupt coalescing options using sysctl. Submitted by: bhargava.marreddy@broadcom.com Differential Revision: https://reviews.freebsd.org/D11702 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/bnxt_sysctl.c head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Tue Jul 25 15:08:52 2017 (r321480) +++ head/sys/dev/bnxt/bnxt.h Tue Jul 25 15:33:34 2017 (r321481) @@ -214,6 +214,18 @@ __FBSDID("$FreeBSD$"); /* Chip info */ #define BNXT_TSO_SIZE UINT16_MAX +#define min_t(type, x, y) ({ \ + type __min1 = (x); \ + type __min2 = (y); \ + __min1 < __min2 ? __min1 : __min2; }) + +#define max_t(type, x, y) ({ \ + type __max1 = (x); \ + type __max2 = (y); \ + __max1 > __max2 ? __max1 : __max2; }) + +#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) + /* NVRAM access */ enum bnxt_nvm_directory_type { BNX_DIR_TYPE_UNUSED = 0, @@ -569,6 +581,20 @@ struct bnxt_softc { struct bnxt_nvram_info *nvm_info; bool wol; uint8_t wol_filter_id; + uint16_t rx_coal_usecs; + uint16_t rx_coal_usecs_irq; + uint16_t rx_coal_frames; + uint16_t rx_coal_frames_irq; + uint16_t tx_coal_usecs; + uint16_t tx_coal_usecs_irq; + uint16_t tx_coal_frames; + uint16_t tx_coal_frames_irq; + +#define BNXT_USEC_TO_COAL_TIMER(x) ((x) * 25 / 2) +#define BNXT_DEF_STATS_COAL_TICKS 1000000 +#define BNXT_MIN_STATS_COAL_TICKS 250000 +#define BNXT_MAX_STATS_COAL_TICKS 1000000 + }; struct bnxt_filter_info { Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Tue Jul 25 15:08:52 2017 (r321480) +++ head/sys/dev/bnxt/bnxt_hwrm.c Tue Jul 25 15:33:34 2017 (r321481) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include "bnxt.h" #include "bnxt_hwrm.h" @@ -1547,3 +1548,131 @@ bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc) req.wol_filter_id = softc->wol_filter_id; return hwrm_send_message(softc, &req, sizeof(req)); } + +static void bnxt_hwrm_set_coal_params(struct bnxt_softc *softc, uint32_t max_frames, + uint32_t buf_tmrs, uint16_t flags, + struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req) +{ + req->flags = htole16(flags); + req->num_cmpl_dma_aggr = htole16((uint16_t)max_frames); + req->num_cmpl_dma_aggr_during_int = htole16(max_frames >> 16); + req->cmpl_aggr_dma_tmr = htole16((uint16_t)buf_tmrs); + req->cmpl_aggr_dma_tmr_during_int = htole16(buf_tmrs >> 16); + /* Minimum time between 2 interrupts set to buf_tmr x 2 */ + req->int_lat_tmr_min = htole16((uint16_t)buf_tmrs * 2); + req->int_lat_tmr_max = htole16((uint16_t)buf_tmrs * 4); + req->num_cmpl_aggr_int = htole16((uint16_t)max_frames * 4); +} + + +int bnxt_hwrm_set_coal(struct bnxt_softc *softc) +{ + int i, rc = 0; + struct hwrm_ring_cmpl_ring_cfg_aggint_params_input req_rx = {0}, + req_tx = {0}, *req; + uint16_t max_buf, max_buf_irq; + uint16_t buf_tmr, buf_tmr_irq; + uint32_t flags; + + bnxt_hwrm_cmd_hdr_init(softc, &req_rx, + HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS); + bnxt_hwrm_cmd_hdr_init(softc, &req_tx, + HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS); + + /* Each rx completion (2 records) should be DMAed immediately. + * DMA 1/4 of the completion buffers at a time. + */ + max_buf = min_t(uint16_t, softc->rx_coal_frames / 4, 2); + /* max_buf must not be zero */ + max_buf = clamp_t(uint16_t, max_buf, 1, 63); + max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63); + buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs); + /* buf timer set to 1/4 of interrupt timer */ + buf_tmr = max_t(uint16_t, buf_tmr / 4, 1); + buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs_irq); + buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1); + + flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET; + + /* RING_IDLE generates more IRQs for lower latency. Enable it only + * if coal_usecs is less than 25 us. + */ + if (softc->rx_coal_usecs < 25) + flags |= HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE; + + bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf, + buf_tmr_irq << 16 | buf_tmr, flags, &req_rx); + + /* max_buf must not be zero */ + max_buf = clamp_t(uint16_t, softc->tx_coal_frames, 1, 63); + max_buf_irq = clamp_t(uint16_t, softc->tx_coal_frames_irq, 1, 63); + buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs); + /* buf timer set to 1/4 of interrupt timer */ + buf_tmr = max_t(uint16_t, buf_tmr / 4, 1); + buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs_irq); + buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1); + flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET; + bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf, + buf_tmr_irq << 16 | buf_tmr, flags, &req_tx); + + for (i = 0; i < softc->nrxqsets; i++) { + + + req = &req_rx; + /* + * TBD: + * Check if Tx also needs to be done + * So far, Tx processing has been done in softirq contest + * + * req = &req_tx; + */ + req->ring_id = htole16(softc->grp_info[i].cp_ring_id); + + rc = hwrm_send_message(softc, req, sizeof(*req)); + if (rc) + break; + } + return rc; +} + + + +int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap, + int bmap_size) +{ + struct hwrm_func_drv_rgtr_input req = {0}; + bitstr_t *async_events_bmap; + uint32_t *events; + int i; + + async_events_bmap = bit_alloc(256, M_DEVBUF, M_WAITOK|M_ZERO); + events = (uint32_t *)async_events_bmap; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR); + + req.enables = + htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); + + memset(async_events_bmap, 0, sizeof(256 / 8)); + + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE); + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD); + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED); + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE); + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE); + + if (bmap && bmap_size) { + for (i = 0; i < bmap_size; i++) { + if (bit_test(bmap, i)) + bit_set(async_events_bmap, i); + } + } + + for (i = 0; i < 8; i++) + req.async_event_fwd[i] |= htole32(events[i]); + + free(async_events_bmap, M_DEVBUF); + + return hwrm_send_message(softc, &req, sizeof(req)); +} + Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Tue Jul 25 15:08:52 2017 (r321480) +++ head/sys/dev/bnxt/bnxt_hwrm.h Tue Jul 25 15:33:34 2017 (r321481) @@ -101,5 +101,7 @@ int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc); uint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle); int bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc); int bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc); - +int bnxt_hwrm_set_coal(struct bnxt_softc *softc); +int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap, + int bmap_size); #endif Modified: head/sys/dev/bnxt/bnxt_sysctl.c ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.c Tue Jul 25 15:08:52 2017 (r321480) +++ head/sys/dev/bnxt/bnxt_sysctl.c Tue Jul 25 15:33:34 2017 (r321481) @@ -549,6 +549,166 @@ bnxt_vlan_strip_sysctl(SYSCTL_HANDLER_ARGS) { return rc; } +static int +bnxt_set_coal_rx_usecs(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->rx_coal_usecs; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->rx_coal_usecs = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_rx_frames(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->rx_coal_frames; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->rx_coal_frames = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_rx_usecs_irq(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->rx_coal_usecs_irq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->rx_coal_usecs_irq = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_rx_frames_irq(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->rx_coal_frames_irq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->rx_coal_frames_irq = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_tx_usecs(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->tx_coal_usecs; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->tx_coal_usecs = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_tx_frames(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->tx_coal_frames; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->tx_coal_frames = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_tx_usecs_irq(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->tx_coal_usecs_irq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->tx_coal_usecs_irq = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + +static int +bnxt_set_coal_tx_frames_irq(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc; + int val; + + if (softc == NULL) + return EBUSY; + + val = softc->tx_coal_frames_irq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc || !req->newptr) + return rc; + + softc->tx_coal_frames_irq = val; + rc = bnxt_hwrm_set_coal(softc); + + return rc; +} + int bnxt_create_config_sysctls_pre(struct bnxt_softc *softc) { @@ -571,6 +731,31 @@ bnxt_create_config_sysctls_pre(struct bnxt_softc *soft "strip VLAN tag in the RX path"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD, iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs, + "I", "interrupt coalescing Rx Usecs"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames, + "I", "interrupt coalescing Rx Frames"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs_irq", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs_irq, + "I", "interrupt coalescing Rx Usecs IRQ"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames_irq", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames_irq, + "I", "interrupt coalescing Rx Frames IRQ"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs, + "I", "interrupt coalescing Tx Usces"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames, + "I", "interrupt coalescing Tx Frames"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs_irq", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs_irq, + "I", "interrupt coalescing Tx Usecs IRQ"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames_irq", + CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames_irq, + "I", "interrupt coalescing Tx Frames IRQ"); return 0; } Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Jul 25 15:08:52 2017 (r321480) +++ head/sys/dev/bnxt/if_bnxt.c Tue Jul 25 15:33:34 2017 (r321481) @@ -691,6 +691,12 @@ bnxt_attach_pre(if_ctx_t ctx) goto drv_rgtr_fail; } + rc = bnxt_hwrm_func_rgtr_async_events(softc, NULL, 0); + if (rc) { + device_printf(softc->dev, "attach: hwrm rgtr async evts failed\n"); + goto drv_rgtr_fail; + } + /* Get the HW capabilities */ rc = bnxt_hwrm_func_qcaps(softc); if (rc) @@ -2286,11 +2292,11 @@ bnxt_report_link(struct bnxt_softc *softc) HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) flow_ctrl = "FC - receive"; else - flow_ctrl = "none"; + flow_ctrl = "FC - none"; iflib_link_state_change(softc->ctx, LINK_STATE_UP, IF_Gbps(100)); - device_printf(softc->dev, "Link is UP %s, %s\n", duplex, - flow_ctrl); + device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex, + flow_ctrl, (softc->link_info.link_speed * 100)); } else { iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, bnxt_get_baudrate(&softc->link_info)); From owner-svn-src-head@freebsd.org Tue Jul 25 16:11:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77566C7FB25; Tue, 25 Jul 2017 16:11:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD658134A; Tue, 25 Jul 2017 16:11:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PGBaGM064338; Tue, 25 Jul 2017 16:11:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PGBaB7064337; Tue, 25 Jul 2017 16:11:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707251611.v6PGBaB7064337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 16:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321483 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 16:11:37 -0000 Author: ngie Date: Tue Jul 25 16:11:36 2017 New Revision: 321483 URL: https://svnweb.freebsd.org/changeset/base/321483 Log: Mask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on i386 by ignoring -Wmacro-redefined. This is a bandaid until the code is fixed and will be reverted before MFC. Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Tue Jul 25 15:58:44 2017 (r321482) +++ head/lib/msun/tests/Makefile Tue Jul 25 16:11:36 2017 (r321483) @@ -84,6 +84,10 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD+= m +.if ${MACHINE_CPUARCH} == "i386" +# XXX: __fldcw macro mismatch between fenv.h and ieeefp.h . +CWARNFLAGS.clang+= -Wno-error=macro-redefined +.endif WARNS?= 1 # Copied from lib/msun/Makefile From owner-svn-src-head@freebsd.org Tue Jul 25 16:21:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2804C7FDF6; Tue, 25 Jul 2017 16:21:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDBE819A8; Tue, 25 Jul 2017 16:21:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PGLMY6070738; Tue, 25 Jul 2017 16:21:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PGLMmg070737; Tue, 25 Jul 2017 16:21:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707251621.v6PGLMmg070737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 16:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321484 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 16:21:23 -0000 Author: ngie Date: Tue Jul 25 16:21:22 2017 New Revision: 321484 URL: https://svnweb.freebsd.org/changeset/base/321484 Log: Only test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build The empty (unimplemented) test inputs for sparc64 trigger a -Wtype-limits build failure because nitems of an empty array is always false, i.e., deadcode. MFC after: 1 month MFC with: r321455 Reported by: Jenkins (sparc64 job) Modified: head/lib/msun/tests/trig_test.c Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Tue Jul 25 16:11:36 2017 (r321483) +++ head/lib/msun/tests/trig_test.c Tue Jul 25 16:21:22 2017 (r321484) @@ -156,11 +156,6 @@ ATF_TC_BODY(reduction, tc) 9.8477555741888350649e+4314L, 1.6061597222105160737e+4326L, }; -#elif LDBL_MANT_DIG == 113 - static const long double ld_pi_odd[] = { - /* XXX */ - }; -#endif #if defined(__clang__) && \ ((__clang_major__ >= 5)) @@ -205,7 +200,7 @@ ATF_TC_BODY(reduction, tc) ATF_CHECK(fabs(tan(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON); } -#if LDBL_MANT_DIG > 53 +#if LDBL_MANT_DIG == 64 /* XXX: || LDBL_MANT_DIG == 113 */ for (i = 0; i < nitems(ld_pi_odd); i++) { ATF_CHECK(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON); ATF_CHECK(cosl(ld_pi_odd[i]) == -1.0); From owner-svn-src-head@freebsd.org Tue Jul 25 16:46:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E8ACFCA64; Tue, 25 Jul 2017 16:46:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C300183279; Tue, 25 Jul 2017 16:46:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PGkCR2082760; Tue, 25 Jul 2017 16:46:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PGkCAQ082758; Tue, 25 Jul 2017 16:46:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707251646.v6PGkCAQ082758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 16:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321485 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 321485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 16:46:14 -0000 Author: bdrewery Date: Tue Jul 25 16:46:12 2017 New Revision: 321485 URL: https://svnweb.freebsd.org/changeset/base/321485 Log: Allow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Jul 25 16:21:22 2017 (r321484) +++ head/share/mk/bsd.dep.mk Tue Jul 25 16:46:12 2017 (r321485) @@ -88,7 +88,7 @@ _meta_filemon= 1 # Also skip generating or including .depend.* files if in meta+filemon mode # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used # for _meta_filemon but not for _SKIP_DEPEND. -.if defined(_SKIP_BUILD) +.if !defined(NO_SKIP_DEPEND) && defined(_SKIP_BUILD) _SKIP_DEPEND= 1 .endif .if ${MK_DIRDEPS_BUILD} == "no" Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 25 16:21:22 2017 (r321484) +++ head/sys/conf/kern.post.mk Tue Jul 25 16:46:12 2017 (r321485) @@ -201,9 +201,9 @@ _meta_filemon= 1 # Also skip generating or including .depend.* files if in meta+filemon mode # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used # for _meta_filemon but not for _SKIP_DEPEND. -.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(*obj) || \ +.if !defined(NO_SKIP_DEPEND) && (make(*obj) || \ ${.TARGETS:M*clean*} == ${.TARGETS} || \ - ${.TARGETS:M*install*} == ${.TARGETS} + ${.TARGETS:M*install*} == ${.TARGETS}) _SKIP_DEPEND= 1 .endif .if defined(_SKIP_DEPEND) || defined(_meta_filemon) From owner-svn-src-head@freebsd.org Tue Jul 25 16:57:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6253FCFCCC9; Tue, 25 Jul 2017 16:57:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26E08837D3; Tue, 25 Jul 2017 16:57:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PGvPgR086705; Tue, 25 Jul 2017 16:57:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PGvPo7086704; Tue, 25 Jul 2017 16:57:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707251657.v6PGvPo7086704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 25 Jul 2017 16:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321486 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 321486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 16:57:26 -0000 Author: ngie Date: Tue Jul 25 16:57:25 2017 New Revision: 321486 URL: https://svnweb.freebsd.org/changeset/base/321486 Log: Re-add #endif accidentally deleted in r321484 MFC after: 1 month MFC with: r321455, r321484 Modified: head/lib/msun/tests/trig_test.c Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Tue Jul 25 16:46:12 2017 (r321485) +++ head/lib/msun/tests/trig_test.c Tue Jul 25 16:57:25 2017 (r321486) @@ -156,6 +156,7 @@ ATF_TC_BODY(reduction, tc) 9.8477555741888350649e+4314L, 1.6061597222105160737e+4326L, }; +#endif #if defined(__clang__) && \ ((__clang_major__ >= 5)) From owner-svn-src-head@freebsd.org Tue Jul 25 17:04:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D2E1CFD175; Tue, 25 Jul 2017 17:04:37 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCE1083CD3; Tue, 25 Jul 2017 17:04:36 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PH4a9i090929; Tue, 25 Jul 2017 17:04:36 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PH4ZLP090923; Tue, 25 Jul 2017 17:04:35 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707251704.v6PH4ZLP090923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Tue, 25 Jul 2017 17:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321487 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 321487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 17:04:37 -0000 Author: pstef Date: Tue Jul 25 17:04:35 2017 New Revision: 321487 URL: https://svnweb.freebsd.org/changeset/base/321487 Log: indent(1): add option -tsn for setting tab size. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/args.c Tue Jul 25 17:04:35 2017 (r321487) @@ -166,6 +166,7 @@ struct pro { {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines}, {"st", PRO_SPECIAL, 0, STDIN, 0}, {"ta", PRO_BOOL, false, ON, &auto_typedefs}, + {"ts", PRO_INT, 8, 0, &tabsize}, {"troff", PRO_BOOL, false, ON, &troff}, {"ut", PRO_BOOL, true, ON, &use_tabs}, {"v", PRO_BOOL, false, ON, &verbose}, Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/indent.1 Tue Jul 25 17:04:35 2017 (r321487) @@ -30,7 +30,7 @@ .\" @(#)indent.1 8.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd July 25, 2017 .Dt INDENT 1 .Os .Sh NAME @@ -85,6 +85,7 @@ .Op Fl \&st .Op Fl \&ta .Op Fl troff +.Op Fl ts Ns Ar n .Op Fl U Ns Ar file .Op Fl ut | Fl nut .Op Fl v | Fl \&nv @@ -459,13 +460,15 @@ listing in much the same spirit as .Xr vgrind 1 . If the output file is not specified, the default is standard output, rather than formatting in place. +.It Fl ts Ns Ar n +Assumed distance between tab stops. +The default is 8. .It Fl U Ns Ar file Adds type names from .Ar file to the list of type keywords. .It Fl ut , nut Enables (disables) the use of tab characters in the output. -Tabs are assumed to be aligned on columns divisible by 8. The default is .Fl ut . .It Fl v , \&nv Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/indent.c Tue Jul 25 17:04:35 2017 (r321487) @@ -292,7 +292,7 @@ main(int argc, char **argv) if (*p == ' ') col++; else if (*p == '\t') - col = ((col - 1) & ~7) + 9; + col = tabsize * (1 + (col - 1) / tabsize) + 1; else break; p++; @@ -1050,7 +1050,7 @@ check_type: if (ps.p_l_follow == 0) { if (ps.block_init_level <= 0) ps.block_init = 0; - if (break_comma && (!ps.leave_comma || compute_code_target() + (e_code - s_code) > max_col - 8)) + if (break_comma && (!ps.leave_comma || compute_code_target() + (e_code - s_code) > max_col - tabsize)) force_nl = true; } break; @@ -1267,18 +1267,21 @@ indent_declaration(int cur_dec_ind, int tabs_to_var) char *startpos = e_code; /* - * get the tab math right for indentations that are not multiples of 8 + * get the tab math right for indentations that are not multiples of tabsize */ - if ((ps.ind_level * ps.ind_size) % 8 != 0) { - pos += (ps.ind_level * ps.ind_size) % 8; - cur_dec_ind += (ps.ind_level * ps.ind_size) % 8; + if ((ps.ind_level * ps.ind_size) % tabsize != 0) { + pos += (ps.ind_level * ps.ind_size) % tabsize; + cur_dec_ind += (ps.ind_level * ps.ind_size) % tabsize; } - if (tabs_to_var) - while ((pos & ~7) + 8 <= cur_dec_ind) { + if (tabs_to_var) { + int tpos; + + while ((tpos = tabsize * (1 + pos / tabsize)) <= cur_dec_ind) { CHECK_SIZE_CODE; *e_code++ = '\t'; - pos = (pos & ~7) + 8; + pos = tpos; } + } while (pos < cur_dec_ind) { CHECK_SIZE_CODE; *e_code++ = ' '; Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/indent_globs.h Tue Jul 25 17:04:35 2017 (r321487) @@ -42,11 +42,7 @@ #define label_offset 2 /* number of levels a label is placed to left * of code */ -#define tabsize 8 /* the size of a tab */ -#define tabmask 0177770 /* mask used when figuring length of lines - * with tabs */ - #define false 0 #define true 1 @@ -213,6 +209,7 @@ int use_tabs; /* set true to use tabs for spacin int auto_typedefs; /* set true to recognize identifiers * ending in "_t" like typedefs */ int space_after_cast; /* "b = (int) a" vs "b = (int)a" */ +int tabsize; /* the size of a tab */ /* -troff font state information */ Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/io.c Tue Jul 25 17:04:35 2017 (r321487) @@ -227,12 +227,12 @@ dump_line(void) target += ps.comment_delta; while (*com_st == '\t') /* consider original indentation in * case this is a box comment */ - com_st++, target += 8; + com_st++, target += tabsize; while (target <= 0) if (*com_st == ' ') target++, com_st++; else if (*com_st == '\t') - target = ((target - 1) & ~7) + 9, com_st++; + target = tabsize * (1 + (target - 1) / tabsize) + 1, com_st++; else target = 1; if (cur_col > target) { /* if comment can't fit on this line, @@ -458,17 +458,19 @@ pad_output(int current, int target) /* current: the current column value */ /* target: position we want it at */ { - int curr; /* internal column pointer */ - int tcur; if (troff) fprintf(output, "\\h'|%dp'", (target - 1) * 7); else { + int curr; /* internal column pointer */ + if (current >= target) return (current); /* line is already long enough */ curr = current; if (use_tabs) { - while ((tcur = ((curr - 1) & tabmask) + tabsize + 1) <= target) { + int tcur; + + while ((tcur = tabsize * (1 + (curr - 1) / tabsize) + 1) <= target) { putc('\t', output); curr = tcur; } @@ -517,7 +519,7 @@ count_spaces_until(int cur, char *buffer, char *end) break; case '\t': - cur = ((cur - 1) & tabmask) + tabsize + 1; + cur = tabsize * (1 + (cur - 1) / tabsize) + 1; break; case 010: /* backspace */ Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Tue Jul 25 16:57:25 2017 (r321486) +++ head/usr.bin/indent/pr_comment.c Tue Jul 25 17:04:35 2017 (r321487) @@ -142,7 +142,7 @@ pr_comment(void) } ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind; if (ps.com_col <= target_col) - ps.com_col = ((target_col + 7) & ~7) + 1; + ps.com_col = tabsize * (1 + (target_col - 1) / tabsize) + 1; if (ps.com_col + 24 > adj_max_col) adj_max_col = ps.com_col + 24; } From owner-svn-src-head@freebsd.org Tue Jul 25 17:27:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF74CFDB33; Tue, 25 Jul 2017 17:27:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 A3FEF848BA; Tue, 25 Jul 2017 17:27:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4C84810AF01; Tue, 25 Jul 2017 13:27:33 -0400 (EDT) From: John Baldwin To: Kristof Provost Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321370 - head/lib/libsysdecode Date: Tue, 25 Jul 2017 10:25:29 -0700 Message-ID: <2783492.qOfDobczBC@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <8FA5355F-E374-49BE-B2B2-25351ED827A9@FreeBSD.org> References: <201707221251.v6MCpKn4014224@repo.freebsd.org> <8FA5355F-E374-49BE-B2B2-25351ED827A9@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 25 Jul 2017 13:27:33 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 17:27:40 -0000 On Sunday, July 23, 2017 06:03:48 PM Kristof Provost wrote: > On 22 Jul 2017, at 17:42, Ngie Cooper (yaneurabeya) wrote: > > > On Jul 22, 2017, at 5:51 AM, Kristof Provost wro= te: > >> > >> Author: kp > >> Date: Sat Jul 22 12:51:19 2017 > >> New Revision: 321370 > >> URL: https://svnweb.freebsd.org/changeset/base/321370 > >> > >> Log: > >> Handle WITH/WITHOUT_PF in libsysdecode > >> > >> Only filter out the PF ioctls if we're building without pf suppor= t. > >> Until now those were always filtered out, so truss did not show=20= > >> symbolic > >> names for pf ioctls. > > > > > > Hi Kristof! > > =09'MFC after:=091 week=E2=80=9D should have probably be added to t= his commit. > > =09This change should be MFCed to ^/stable/11 and probably ^/stable= /10=20 > > (in usr.sbin/kdump on 10:=20 > > https://svnweb.freebsd.org/base/stable/10/usr.bin/kdump/mkioctls?re= vision=3D291815&view=3Dmarkup#l25=20 > > ). >=20 > To be honest I wasn=E2=80=99t planning on MFCing this, because it=E2=80= =99s not a=20 > terribly important issue. > That said, if it=E2=80=99d be useful to you (or anyone else) I=E2=80=99= m certainly=20 > willing to do so. >=20 > I=E2=80=99m not sure how much the code changed between 10 and 11, but= MFC to=20 > 11 should be easy, and if the changes are not too extensive I can do = the=20 > merge to 10 as well. libsysdecode is not present in 10. In 10 you'd have to patch the kdump= mkioctls script and the truss and kdump Makefile's. I think it's proba= bly not worth the trouble to MFC to 10. 11 should probably merge fine, tho= ugh you'll have to tweak it since the previous change to remove the disk ha= ck can't be MFC'.d :( Your original version of the patch would be fine fo= r 11 though. --=20 John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 25 17:27:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B546FCFDB40; Tue, 25 Jul 2017 17:27:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 91524848C3; Tue, 25 Jul 2017 17:27:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8AECC10AF07; Tue, 25 Jul 2017 13:27:34 -0400 (EDT) From: John Baldwin To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321422 - head/usr.bin/ktrace Date: Tue, 25 Jul 2017 10:02:36 -0700 Message-ID: <1562826.93kvieM9Pp@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201707241658.v6OGwsc2092289@repo.freebsd.org> References: <201707241658.v6OGwsc2092289@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 25 Jul 2017 13:27:34 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 17:27:41 -0000 On Monday, July 24, 2017 04:58:54 PM Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Jul 24 16:58:54 2017 > New Revision: 321422 > URL: https://svnweb.freebsd.org/changeset/base/321422 > > Log: > Improve the ktrace(1) man page to make it slightly more obvious that there > are _two_ options that control its behaviour wrt child processes; slightly > improve the example[1], and add Xrefs. > > Discussed with: wblock [1] > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/usr.bin/ktrace/ktrace.1 > > Modified: head/usr.bin/ktrace/ktrace.1 > ============================================================================== > --- head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:45:38 2017 (r321421) > +++ head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:58:54 2017 (r321422) > @@ -166,16 +175,15 @@ Enable tracing of > on process 67: > .Dl $ ktrace -ti -p 67 > .Pp > -Run the command "w", tracing only system calls: > -.Dl $ ktrace -tc w > -.Pp Did you mean to remove this example? -- John Baldwin From owner-svn-src-head@freebsd.org Tue Jul 25 17:39:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B5ECFE084; Tue, 25 Jul 2017 17:39:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C047A371; Tue, 25 Jul 2017 17:39:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PHd6dd003745; Tue, 25 Jul 2017 17:39:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PHd6Uo003744; Tue, 25 Jul 2017 17:39:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707251739.v6PHd6Uo003744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 25 Jul 2017 17:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321489 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 321489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 17:39:08 -0000 Author: ian Date: Tue Jul 25 17:39:06 2017 New Revision: 321489 URL: https://svnweb.freebsd.org/changeset/base/321489 Log: Use the MD __size_t to avoid a dependency on/include of non-MD header files. This should fix the compilation of the lua 5.3.4 port, among others. Reported by: Russell Haley Modified: head/sys/arm/include/ucontext.h Modified: head/sys/arm/include/ucontext.h ============================================================================== --- head/sys/arm/include/ucontext.h Tue Jul 25 17:24:50 2017 (r321488) +++ head/sys/arm/include/ucontext.h Tue Jul 25 17:39:06 2017 (r321489) @@ -78,7 +78,7 @@ typedef struct { * Originally, rest of this structure was named __fpu, 35 * 4 bytes * long, never accessed from kernel. */ - size_t mc_vfp_size; + __size_t mc_vfp_size; void *mc_vfp_ptr; unsigned int mc_spare[33]; } mcontext_t; From owner-svn-src-head@freebsd.org Tue Jul 25 20:24:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51535D7D5F4; Tue, 25 Jul 2017 20:24:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::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 DBE7F651C5; Tue, 25 Jul 2017 20:24:34 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x235.google.com with SMTP id k71so70063420wrc.2; Tue, 25 Jul 2017 13:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ec26lT2p0XRMv98WQt0vcZFxtztkZizGfdw4zsCVm/w=; b=BqfcpZF6p9v+Cxt6qhW19k2IqIYK/TWkD6as8aQbC6HzUImWBCVCYFW+KZudnxo9YL OM2n6PJYa8mBOxcF0iYk5WYsJr+XEpeCqeFll98N/DpTFuOyaD2Ms7i50xux9G6+93Io yU3oUCJDGTD/c/E6R/EGcPI18OV+pNSeB3kKmEU0k7uU1DjEhH7cVHdKbFSu64dlrnsz A9UQKaeDwcONxUJUC5pXkPViX+g5+osXVVLcUyWUWDeSpD8d6d2YsIeQNqCXjqLHn75E zUsAXlN/6DOvUBiCsLxsY56ieiSTDAu0RUIqY5KULg8AlNR9OzKMbTz9L0QZxoRkruPh GmVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ec26lT2p0XRMv98WQt0vcZFxtztkZizGfdw4zsCVm/w=; b=YyI4bNRF/8V160HkfEFBDWUdM9Ms5KbyulfT104vC4GuKedZBSJ8k7DMGe++o6j2QN 4r4Xa9BFE8OLAw0/7N9VJv/vuzzmlekT9+Cr5Q9A/rKNlCkx98dI9g9CwBJ8dGa9wdAV Vqp+LDnlIYy7jkZDJ6W3GaRxlyhnZcGpuTGDJFud4GQFtEq9JKkH3pnbTH048IciT0M1 S9DJ5nQaRXtDp5ZA45dVNOtGcOScWeqt+quGHTdNZstkmTEnICcm0S9N1SLQI6jLYkDw uyGMhKEHB+pMP1NbDqWAkz4EspQej73/HjQ237ie8xYRimktrxCW1/FvdDq5P8YTbctB gf7Q== X-Gm-Message-State: AIVw111eAAl4P903t2KZM5e74W4O8xWQv7UHwkiYPLIOYG4vebcQZJBL 1ma8OXE+2haJSUBz X-Received: by 10.223.178.84 with SMTP id y20mr19755223wra.240.1501014271890; Tue, 25 Jul 2017 13:24:31 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id e17sm11532831wma.19.2017.07.25.13.24.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jul 2017 13:24:31 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 25 Jul 2017 21:24:29 +0100 From: Edward Tomasz Napierala To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321422 - head/usr.bin/ktrace Message-ID: <20170725202429.GA4589@brick> Mail-Followup-To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707241658.v6OGwsc2092289@repo.freebsd.org> <1562826.93kvieM9Pp@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1562826.93kvieM9Pp@ralph.baldwin.cx> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 20:24:35 -0000 On 0725T1002, John Baldwin wrote: > On Monday, July 24, 2017 04:58:54 PM Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Mon Jul 24 16:58:54 2017 > > New Revision: 321422 > > URL: https://svnweb.freebsd.org/changeset/base/321422 > > > > Log: > > Improve the ktrace(1) man page to make it slightly more obvious that there > > are _two_ options that control its behaviour wrt child processes; slightly > > improve the example[1], and add Xrefs. > > > > Discussed with: wblock [1] > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > > > Modified: > > head/usr.bin/ktrace/ktrace.1 > > > > Modified: head/usr.bin/ktrace/ktrace.1 > > ============================================================================== > > --- head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:45:38 2017 (r321421) > > +++ head/usr.bin/ktrace/ktrace.1 Mon Jul 24 16:58:54 2017 (r321422) > > @@ -166,16 +175,15 @@ Enable tracing of > > on process 67: > > .Dl $ ktrace -ti -p 67 > > .Pp > > -Run the command "w", tracing only system calls: > > -.Dl $ ktrace -tc w > > -.Pp > > Did you mean to remove this example? I've replaced it with a new one, at the top, showing something more commonly used. From owner-svn-src-head@freebsd.org Tue Jul 25 20:36:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6636FD7DAC8; Tue, 25 Jul 2017 20:36:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3445C65979; Tue, 25 Jul 2017 20:36:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PKaiMM077239; Tue, 25 Jul 2017 20:36:44 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PKaiLp077238; Tue, 25 Jul 2017 20:36:44 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707252036.v6PKaiLp077238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 25 Jul 2017 20:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321490 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 321490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 20:36:45 -0000 Author: marius Date: Tue Jul 25 20:36:44 2017 New Revision: 321490 URL: https://svnweb.freebsd.org/changeset/base/321490 Log: Improve the clarity of a comment added in r321385 by not referring to volatile SDHCI specification lingo. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Tue Jul 25 17:39:06 2017 (r321489) +++ head/sys/dev/mmc/mmcsd.c Tue Jul 25 20:36:44 2017 (r321490) @@ -235,7 +235,7 @@ mmcsd_attach(device_t dev) * insertion that results in switches to/from a transfer mode involving * re-tuning, iff there are multiple devices on a given bus. Until now * mmc(4) lacks support for rescanning already attached buses, however, - * and sdhci(4) has no support for embedded/shared buses in the first + * and sdhci(4) to date has no support for shared buses in the first * place either. */ sc->max_data = mmc_get_max_data(dev); From owner-svn-src-head@freebsd.org Tue Jul 25 20:43:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 793C0D7DEFB; Tue, 25 Jul 2017 20:43:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 468DB6601D; Tue, 25 Jul 2017 20:43:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PKhQfM081356; Tue, 25 Jul 2017 20:43:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PKhQ2g081355; Tue, 25 Jul 2017 20:43:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707252043.v6PKhQ2g081355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 20:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321491 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 20:43:27 -0000 Author: bdrewery Date: Tue Jul 25 20:43:26 2017 New Revision: 321491 URL: https://svnweb.freebsd.org/changeset/base/321491 Log: Remove unneeded dependency for libzfs. This dependency does nothing since cddl/lib/libzfs is never added into the 'make libraries' dependency chain directly. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 25 20:36:44 2017 (r321490) +++ head/Makefile.inc1 Tue Jul 25 20:43:26 2017 (r321491) @@ -2340,7 +2340,6 @@ _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L -cddl/lib/libzfs__L: lib/libgeom__L cddl/lib/libctf__L: lib/libz__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built From owner-svn-src-head@freebsd.org Tue Jul 25 20:43:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BBA5D7DF36; Tue, 25 Jul 2017 20:43:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6C2660CC; Tue, 25 Jul 2017 20:43:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PKhbs4081404; Tue, 25 Jul 2017 20:43:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PKhbt0081403; Tue, 25 Jul 2017 20:43:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707252043.v6PKhbt0081403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 20:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321492 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 20:43:39 -0000 Author: bdrewery Date: Tue Jul 25 20:43:37 2017 New Revision: 321492 URL: https://svnweb.freebsd.org/changeset/base/321492 Log: Only build libzfs_core in 'make libraries' if needed. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 25 20:43:26 2017 (r321491) +++ head/Makefile.inc1 Tue Jul 25 20:43:37 2017 (r321492) @@ -2336,10 +2336,12 @@ _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil +.if ${MK_ZFS} != "no" _cddl_lib_libzfs_core= cddl/lib/libzfs_core +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L +.endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib -cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libctf__L: lib/libz__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built From owner-svn-src-head@freebsd.org Tue Jul 25 20:51:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A885D7E0DD; Tue, 25 Jul 2017 20:51:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FAE1664C2; Tue, 25 Jul 2017 20:51:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PKp6XK082379; Tue, 25 Jul 2017 20:51:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PKp6HZ082378; Tue, 25 Jul 2017 20:51:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707252051.v6PKp6HZ082378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 20:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321493 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Jul 2017 20:51:07 -0000 Author: bdrewery Date: Tue Jul 25 20:51:06 2017 New Revision: 321493 URL: https://svnweb.freebsd.org/changeset/base/321493 Log: NO_CLEAN: Hide delete-old output. It is full of distracting noise about UPDATING and may confuse the user about what is actually being deleted. It is also possible to have directories removed on every run with use of WITHOUT_ knobs that the mtree files do not account for and for which the directories are incorrectly in OLD_DIRS currently. X-MFC-With: r321443 MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 25 20:43:37 2017 (r321492) +++ head/Makefile.inc1 Tue Jul 25 20:51:06 2017 (r321493) @@ -761,12 +761,13 @@ _worldtmp: .PHONY rm -rf ${LIBCOMPATTMP} .endif .else + @echo ">>> Deleting stale files in build tree..." ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ - delete-old delete-old-libs + delete-old delete-old-libs >/dev/null .if defined(LIBCOMPAT) ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ DESTDIR=${LIBCOMPATTMP} \ - delete-old delete-old-libs + delete-old delete-old-libs >/dev/null .endif rm -rf ${WORLDTMP}/legacy/usr/include .if ${USING_SYSTEM_COMPILER} == "yes" From owner-svn-src-head@freebsd.org Wed Jul 26 01:48:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD337DAE043; Wed, 26 Jul 2017 01:48:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C51A703F5; Wed, 26 Jul 2017 01:48:14 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q1mDiJ004732; Wed, 26 Jul 2017 01:48:13 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q1mD6u004731; Wed, 26 Jul 2017 01:48:13 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707260148.v6Q1mD6u004731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 26 Jul 2017 01:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321502 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 321502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 01:48:14 -0000 Author: scottl Date: Wed Jul 26 01:48:13 2017 New Revision: 321502 URL: https://svnweb.freebsd.org/changeset/base/321502 Log: Quiet a message that sounds far more dire than it really is. Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Wed Jul 26 01:46:25 2017 (r321501) +++ head/sys/dev/mpr/mpr_sas.c Wed Jul 26 01:48:13 2017 (r321502) @@ -2677,7 +2677,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mp if ((sassc->flags & MPRSAS_QUEUE_FROZEN) == 0) { xpt_freeze_simq(sassc->sim, 1); sassc->flags |= MPRSAS_QUEUE_FROZEN; - mpr_dprint(sc, MPR_INFO, "Error sending command, " + mpr_dprint(sc, MPR_XINFO, "Error sending command, " "freezing SIM queue\n"); } } From owner-svn-src-head@freebsd.org Wed Jul 26 02:05:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E871DAE4E4; Wed, 26 Jul 2017 02:05:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEC470BAC; Wed, 26 Jul 2017 02:05:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q259NJ012655; Wed, 26 Jul 2017 02:05:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q259L3012654; Wed, 26 Jul 2017 02:05:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201707260205.v6Q259L3012654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Jul 2017 02:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321504 - head/kerberos5/lib/libkafs5 X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/kerberos5/lib/libkafs5 X-SVN-Commit-Revision: 321504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 02:05:10 -0000 Author: cy Date: Wed Jul 26 02:05:09 2017 New Revision: 321504 URL: https://svnweb.freebsd.org/changeset/base/321504 Log: Remove trailing slash (/) for consistency. Modified: head/kerberos5/lib/libkafs5/Makefile Modified: head/kerberos5/lib/libkafs5/Makefile ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile Wed Jul 26 01:48:57 2017 (r321503) +++ head/kerberos5/lib/libkafs5/Makefile Wed Jul 26 02:05:09 2017 (r321504) @@ -26,7 +26,7 @@ SRCS= afssys.c afskrb5.c common.c krb5_err.h CFLAGS+= -I${KRB5DIR}/lib/kafs \ -I${KRB5DIR}/lib/krb5 \ - -I${.OBJDIR:H}/libkrb5/ \ + -I${.OBJDIR:H}/libkrb5 \ -I${KRB5DIR}/lib/roken CLEANFILES= kafs5.3 From owner-svn-src-head@freebsd.org Wed Jul 26 05:26:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 152A4DB1BC8; Wed, 26 Jul 2017 05:26:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E616C759DD; Wed, 26 Jul 2017 05:26:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5Q2QM094323; Wed, 26 Jul 2017 05:26:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5Q2FP094322; Wed, 26 Jul 2017 05:26:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260526.v6Q5Q2FP094322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321507 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 05:26:03 -0000 Author: adrian Date: Wed Jul 26 05:26:01 2017 New Revision: 321507 URL: https://svnweb.freebsd.org/changeset/base/321507 Log: [iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels. * Limiting the channel list with "ifconfig wlan0 chanlist ..." now will actually set the list of channels scanned by iwm. Tested: * Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what it should! Modified: head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Wed Jul 26 05:01:46 2017 (r321506) +++ head/sys/dev/iwm/if_iwm_scan.c Wed Jul 26 05:26:01 2017 (r321507) @@ -307,15 +307,13 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { - c = &ic->ic_channels[j]; - /* For 2GHz, only populate 11b channels */ - /* For 5GHz, only populate 11a channels */ + j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or * something in the chanlist. */ - if (iwm_mvm_scan_skip_channel(c)) { + if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) { IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM, "%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n", __func__, c->ic_freq, c->ic_ieee, c->ic_flags); @@ -346,20 +344,19 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, struct iwm_scan_channel_cfg_umac *chan, int n_ssids) { struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_scan_state *ss = ic->ic_scan; struct ieee80211_channel *c; uint8_t nchan; int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { - c = &ic->ic_channels[j]; - /* For 2GHz, only populate 11b channels */ - /* For 5GHz, only populate 11a channels */ + j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or * something in the chanlist. */ - if (iwm_mvm_scan_skip_channel(c)) { + if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) { IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM, "%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n", __func__, c->ic_freq, c->ic_ieee, c->ic_flags); @@ -726,7 +723,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) if (iwm_mvm_rrm_scan_needed(sc)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); - req->flags = iwm_mvm_scan_rxon_flags(&sc->sc_ic.ic_channels[0]); + req->flags = iwm_mvm_scan_rxon_flags(sc->sc_ic.ic_scan->ss_chans[0]); req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON); From owner-svn-src-head@freebsd.org Wed Jul 26 05:29:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F18FDB1CBC; Wed, 26 Jul 2017 05:29:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2EE75B59; Wed, 26 Jul 2017 05:29:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5T8mk094496; Wed, 26 Jul 2017 05:29:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5T8q6094494; Wed, 26 Jul 2017 05:29:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260529.v6Q5T8q6094494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321508 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 05:29:09 -0000 Author: adrian Date: Wed Jul 26 05:29:08 2017 New Revision: 321508 URL: https://svnweb.freebsd.org/changeset/base/321508 Log: [iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4). * iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible memory leak, compared to using just mbufq_drain(). * Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be handled in the caller. Obtained from: dragonflybsd.git 339d45fda40072e0aca5ece639173204716f11fe Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_sta.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:26:01 2017 (r321507) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:29:08 2017 (r321508) @@ -388,6 +388,7 @@ static struct ieee80211vap * const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void iwm_vap_delete(struct ieee80211vap *); +static void iwm_xmit_queue_drain(struct iwm_softc *); static void iwm_scan_start(struct ieee80211com *); static void iwm_scan_end(struct ieee80211com *); static void iwm_update_mcast(struct ieee80211com *); @@ -4103,7 +4104,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * get here from RUN state. */ tfd_msk = 0xf; - mbufq_drain(&sc->sc_snd); + iwm_xmit_queue_drain(sc); iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); /* * We seem to get away with just synchronously sending the @@ -6214,6 +6215,19 @@ iwm_vap_delete(struct ieee80211vap *vap) } static void +iwm_xmit_queue_drain(struct iwm_softc *sc) +{ + struct mbuf *m; + struct ieee80211_node *ni; + + while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + ieee80211_free_node(ni); + m_freem(m); + } +} + +static void iwm_scan_start(struct ieee80211com *ic) { struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -6372,6 +6386,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 callout_drain(&sc->sc_watchdog_to); iwm_stop_device(sc); if (do_net80211) { + IWM_LOCK(sc); + iwm_xmit_queue_drain(sc); + IWM_UNLOCK(sc); ieee80211_ifdetach(&sc->sc_ic); } @@ -6405,7 +6422,6 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 sc->sc_notif_wait = NULL; } - mbufq_drain(&sc->sc_snd); IWM_LOCK_DESTROY(sc); return (0); Modified: head/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- head/sys/dev/iwm/if_iwm_sta.c Wed Jul 26 05:26:01 2017 (r321507) +++ head/sys/dev/iwm/if_iwm_sta.c Wed Jul 26 05:29:08 2017 (r321508) @@ -283,7 +283,6 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE); if (ret) return ret; - mbufq_drain(&sc->sc_snd); /* XXX needed ? */ for (ac = 0; ac < WME_NUM_AC; ac++) { tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); } From owner-svn-src-head@freebsd.org Wed Jul 26 05:40:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8414DB1EC7; Wed, 26 Jul 2017 05:40:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3CB0760C4; Wed, 26 Jul 2017 05:40:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5erTg099402; Wed, 26 Jul 2017 05:40:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5erqv099399; Wed, 26 Jul 2017 05:40:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260540.v6Q5erqv099399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321509 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 05:40:54 -0000 Author: adrian Date: Wed Jul 26 05:40:52 2017 New Revision: 321509 URL: https://svnweb.freebsd.org/changeset/base/321509 Log: [iwm] Sync statistics API definitions with Linux iwlwifi. Obtained from: dragonflybsd.git 75895a53a9c1ba60d75be9b4bf6e49a37f91a7cf Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:29:08 2017 (r321508) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:40:52 2017 (r321509) @@ -325,8 +325,10 @@ static int iwm_mvm_get_signal_strength(struct iwm_soft struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); -static int iwm_get_noise(struct iwm_softc *sc, +static int iwm_get_noise(struct iwm_softc *, const struct iwm_mvm_statistics_rx_non_phy *); +static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, + struct iwm_rx_packet *); static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, uint32_t, boolean_t); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, @@ -3159,6 +3161,15 @@ iwm_get_noise(struct iwm_softc *sc, #endif } +static void +iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +{ + struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data; + + memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); + sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); +} + /* * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * @@ -5292,13 +5303,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_CALIB_RES_NOTIF_PHY_DB: break; - case IWM_STATISTICS_NOTIFICATION: { - struct iwm_notif_statistics *stats; - stats = (void *)pkt->data; - memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); - sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); + case IWM_STATISTICS_NOTIFICATION: + iwm_mvm_handle_rx_statistics(sc, pkt); break; - } case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Wed Jul 26 05:29:08 2017 (r321508) +++ head/sys/dev/iwm/if_iwmreg.h Wed Jul 26 05:40:52 2017 (r321509) @@ -2898,6 +2898,18 @@ struct iwm_mcast_filter_cmd { uint8_t addr_list[0]; } __packed; /* IWM_MCAST_FILTERING_CMD_API_S_VER_1 */ +/* + * The first MAC indices (starting from 0) + * are available to the driver, AUX follows + */ +#define IWM_MAC_INDEX_AUX 4 +#define IWM_MAC_INDEX_MIN_DRIVER 0 +#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX +#define IWM_NUM_MAC_INDEX (IWM_MAC_INDEX_AUX + 1) + +/*********************************** + * Statistics API + ***********************************/ struct iwm_mvm_statistics_dbg { uint32_t burst_check; uint32_t burst_count; @@ -2914,24 +2926,6 @@ struct iwm_mvm_statistics_div { uint32_t reserved2; } __packed; /* IWM_STATISTICS_SLOW_DIV_API_S_VER_2 */ -struct iwm_mvm_statistics_general_common { - uint32_t temperature; /* radio temperature */ - uint32_t temperature_m; /* radio voltage */ - struct iwm_mvm_statistics_dbg dbg; - uint32_t sleep_time; - uint32_t slots_out; - uint32_t slots_idle; - uint32_t ttl_timestamp; - struct iwm_mvm_statistics_div div; - uint32_t rx_enable_counter; - /* - * num_of_sos_states: - * count the number of times we have to re-tune - * in order to get out of bad PHY status - */ - uint32_t num_of_sos_states; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ - struct iwm_mvm_statistics_rx_non_phy { uint32_t bogus_cts; /* CTS received when not expecting CTS */ uint32_t bogus_ack; /* ACK received when not expecting ACK */ @@ -3002,6 +2996,23 @@ struct iwm_mvm_statistics_rx_ht_phy { uint32_t unsupport_mcs; } __packed; /* IWM_STATISTICS_HT_RX_PHY_API_S_VER_1 */ +struct iwm_mvm_statistics_tx_non_phy { + uint32_t preamble_cnt; + uint32_t rx_detected_cnt; + uint32_t bt_prio_defer_cnt; + uint32_t bt_prio_kill_cnt; + uint32_t few_bytes_cnt; + uint32_t cts_timeout; + uint32_t ack_timeout; + uint32_t expected_ack_cnt; + uint32_t actual_ack_cnt; + uint32_t dump_msdu_cnt; + uint32_t burst_abort_next_frame_mismatch_cnt; + uint32_t burst_abort_missing_next_frame_cnt; + uint32_t cts_timeout_collision; + uint32_t ack_or_ba_timeout_collision; +} __packed; /* IWM_STATISTICS_TX_NON_PHY_API_S_VER_3 */ + #define IWM_MAX_CHAINS 3 struct iwm_mvm_statistics_tx_non_phy_agg { @@ -3032,20 +3043,7 @@ struct iwm_mvm_statistics_tx_channel_width { }; /* IWM_STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */ struct iwm_mvm_statistics_tx { - uint32_t preamble_cnt; - uint32_t rx_detected_cnt; - uint32_t bt_prio_defer_cnt; - uint32_t bt_prio_kill_cnt; - uint32_t few_bytes_cnt; - uint32_t cts_timeout; - uint32_t ack_timeout; - uint32_t expected_ack_cnt; - uint32_t actual_ack_cnt; - uint32_t dump_msdu_cnt; - uint32_t burst_abort_next_frame_mismatch_cnt; - uint32_t burst_abort_missing_next_frame_cnt; - uint32_t cts_timeout_collision; - uint32_t ack_or_ba_timeout_collision; + struct iwm_mvm_statistics_tx_non_phy general; struct iwm_mvm_statistics_tx_non_phy_agg agg; struct iwm_mvm_statistics_tx_channel_width channel_width; } __packed; /* IWM_STATISTICS_TX_API_S_VER_4 */ @@ -3062,17 +3060,38 @@ struct iwm_mvm_statistics_bt_activity { uint32_t lo_priority_rx_denied_cnt; } __packed; /* IWM_STATISTICS_BT_ACTIVITY_API_S_VER_1 */ -struct iwm_mvm_statistics_general { - struct iwm_mvm_statistics_general_common common; +struct iwm_mvm_statistics_general_v8 { + uint32_t radio_temperature; + uint32_t radio_voltage; + struct iwm_mvm_statistics_dbg dbg; + uint32_t sleep_time; + uint32_t slots_out; + uint32_t slots_idle; + uint32_t ttl_timestamp; + struct iwm_mvm_statistics_div slow_div; + uint32_t rx_enable_counter; + /* + * num_of_sos_states: + * count the number of times we have to re-tune + * in order to get out of bad PHY status + */ + uint32_t num_of_sos_states; uint32_t beacon_filtered; uint32_t missed_beacons; - int8_t beacon_filter_average_energy; - int8_t beacon_filter_reason; - int8_t beacon_filter_current_energy; - int8_t beacon_filter_reserved; + uint8_t beacon_filter_average_energy; + uint8_t beacon_filter_reason; + uint8_t beacon_filter_current_energy; + uint8_t beacon_filter_reserved; uint32_t beacon_filter_delta_time; struct iwm_mvm_statistics_bt_activity bt_activity; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ + uint64_t rx_time; + uint64_t on_time_rf; + uint64_t on_time_scan; + uint64_t tx_time; + uint32_t beacon_counter[IWM_NUM_MAC_INDEX]; + uint8_t beacon_average_energy[IWM_NUM_MAC_INDEX]; + uint8_t reserved[4 - (IWM_NUM_MAC_INDEX % 4)]; +} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_8 */ struct iwm_mvm_statistics_rx { struct iwm_mvm_statistics_rx_phy ofdm; @@ -3086,24 +3105,23 @@ struct iwm_mvm_statistics_rx { * * By default, uCode issues this notification after receiving a beacon * while associated. To disable this behavior, set DISABLE_NOTIF flag in the - * IWM_REPLY_STATISTICS_CMD 0x9c, above. - * - * Statistics counters continue to increment beacon after beacon, but are - * cleared when changing channels or when driver issues IWM_REPLY_STATISTICS_CMD - * 0x9c with CLEAR_STATS bit set (see above). - * - * uCode also issues this notification during scans. uCode clears statistics - * appropriately so that each notification contains statistics for only the - * one channel that has just been scanned. + * IWM_STATISTICS_CMD (0x9c), below. */ -struct iwm_notif_statistics { /* IWM_STATISTICS_NTFY_API_S_VER_8 */ +struct iwm_notif_statistics_v10 { uint32_t flag; struct iwm_mvm_statistics_rx rx; struct iwm_mvm_statistics_tx tx; - struct iwm_mvm_statistics_general general; -} __packed; + struct iwm_mvm_statistics_general_v8 general; +} __packed; /* IWM_STATISTICS_NTFY_API_S_VER_10 */ +#define IWM_STATISTICS_FLG_CLEAR 0x1 +#define IWM_STATISTICS_FLG_DISABLE_NOTIF 0x2 + +struct iwm_statistics_cmd { + uint32_t flags; +} __packed; /* IWM_STATISTICS_CMD_API_S_VER_1 */ + /*********************************** * Smart Fifo API ***********************************/ @@ -3186,14 +3204,6 @@ struct iwm_sf_cfg_cmd { /* * BEGIN mvm/fw-api-mac.h */ - -/* - * The first MAC indices (starting from 0) - * are available to the driver, AUX follows - */ -#define IWM_MAC_INDEX_AUX 4 -#define IWM_MAC_INDEX_MIN_DRIVER 0 -#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX enum iwm_ac { IWM_AC_BK, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Wed Jul 26 05:29:08 2017 (r321508) +++ head/sys/dev/iwm/if_iwmvar.h Wed Jul 26 05:40:52 2017 (r321509) @@ -529,7 +529,7 @@ struct iwm_softc { /* phy contexts. we only use the first one */ struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; - struct iwm_notif_statistics sc_stats; + struct iwm_notif_statistics_v10 sc_stats; int sc_noise; caddr_t sc_drvbpf; From owner-svn-src-head@freebsd.org Wed Jul 26 05:51:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1BC5DB223A; Wed, 26 Jul 2017 05:51:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 761F676459; Wed, 26 Jul 2017 05:51:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5pVS2005672; Wed, 26 Jul 2017 05:51:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5pVUh005669; Wed, 26 Jul 2017 05:51:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260551.v6Q5pVUh005669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321510 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 05:51:32 -0000 Author: adrian Date: Wed Jul 26 05:51:31 2017 New Revision: 321510 URL: https://svnweb.freebsd.org/changeset/base/321510 Log: [iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c. Obtained from: dragonflybsd.git 8a5dd7783e407856754093f5b1c9c757c64534b7 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_util.c head/sys/dev/iwm/if_iwm_util.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:40:52 2017 (r321509) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 26 05:51:31 2017 (r321510) @@ -4451,13 +4451,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ break; case IEEE80211_S_RUN: - { - struct iwm_host_cmd cmd = { - .id = IWM_LQ_CMD, - .len = { sizeof(in->in_lq), }, - .flags = IWM_CMD_SYNC, - }; - in = IWM_NODE(vap->iv_bss); /* Update the association state, now we have it all */ /* (eg associd comes in at this point */ @@ -4482,15 +4475,13 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); - cmd.data[0] = &in->in_lq; - if ((error = iwm_send_cmd(sc, &cmd)) != 0) { + if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_LQ_CMD failed\n", __func__); + "%s: IWM_LQ_CMD failed: %d\n", __func__, error); } iwm_mvm_led_enable(sc); break; - } default: break; Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Wed Jul 26 05:40:52 2017 (r321509) +++ head/sys/dev/iwm/if_iwm_util.c Wed Jul 26 05:51:31 2017 (r321510) @@ -489,6 +489,32 @@ iwm_dma_contig_free(struct iwm_dma_info *dma) } } +/** + * iwm_mvm_send_lq_cmd() - Send link quality command + * @init: This command is sent as part of station initialization right + * after station has been added. + * + * The link quality command is sent as the last step of station creation. + * This is the special case in which init is set and we call a callback in + * this case to clear the state indicating that station creation is in + * progress. + */ +int +iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, boolean_t init) +{ + struct iwm_host_cmd cmd = { + .id = IWM_LQ_CMD, + .len = { sizeof(struct iwm_lq_cmd), }, + .flags = init ? 0 : IWM_CMD_ASYNC, + .data = { lq, }, + }; + + if (lq->sta_id == IWM_MVM_STATION_COUNT) + return EINVAL; + + return iwm_send_cmd(sc, &cmd); +} + boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc) { Modified: head/sys/dev/iwm/if_iwm_util.h ============================================================================== --- head/sys/dev/iwm/if_iwm_util.h Wed Jul 26 05:40:52 2017 (r321509) +++ head/sys/dev/iwm/if_iwm_util.h Wed Jul 26 05:51:31 2017 (r321510) @@ -120,6 +120,9 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern int iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, + boolean_t init); + extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); From owner-svn-src-head@freebsd.org Wed Jul 26 05:52:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12192DB22E9; Wed, 26 Jul 2017 05:52:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C913476753; Wed, 26 Jul 2017 05:52:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5qc39006586; Wed, 26 Jul 2017 05:52:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5qcqM006585; Wed, 26 Jul 2017 05:52:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260552.v6Q5qcqM006585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321511 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 05:52:39 -0000 Author: adrian Date: Wed Jul 26 05:52:37 2017 New Revision: 321511 URL: https://svnweb.freebsd.org/changeset/base/321511 Log: [iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi. * While there clean up alignments and line wrapping in existing definitions for rs API in if_iwmreg.h Obtained from: dragonflybsd.git 085e37a042bdb17081e495e46919359ce43aa118 Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Wed Jul 26 05:51:31 2017 (r321510) +++ head/sys/dev/iwm/if_iwmreg.h Wed Jul 26 05:52:37 2017 (r321511) @@ -3981,12 +3981,12 @@ enum { * Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz * 0 and 1 are valid for HT and VHT, 2 and 3 only for VHT */ -#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 -#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 +#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) /* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */ #define IWM_RATE_MCS_SGI_POS 13 @@ -3999,7 +3999,7 @@ enum { #define IWM_RATE_MCS_ANT_C_MSK (4 << IWM_RATE_MCS_ANT_POS) #define IWM_RATE_MCS_ANT_AB_MSK (IWM_RATE_MCS_ANT_A_MSK | \ IWM_RATE_MCS_ANT_B_MSK) -#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ +#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ IWM_RATE_MCS_ANT_C_MSK) #define IWM_RATE_MCS_ANT_MSK IWM_RATE_MCS_ANT_ABC_MSK #define IWM_RATE_MCS_ANT_NUM 3 @@ -4009,8 +4009,8 @@ enum { #define IWM_RATE_MCS_STBC_MSK (1 << IWM_RATE_MCS_STBC_POS) /* Bit 19: (0) Beamforming is off, (1) Beamforming is on */ -#define IWM_RATE_MCS_BF_POS 19 -#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) +#define IWM_RATE_MCS_BF_POS 19 +#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) /* Bit 20: (0) ZLF is off, (1) ZLF is on */ #define IWM_RATE_MCS_ZLF_POS 20 @@ -4033,29 +4033,65 @@ enum { /* Link quality command flags bit fields */ /* Bit 0: (0) Don't use RTS (1) Use RTS */ -#define IWM_LQ_FLAG_USE_RTS_POS 0 -#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) +#define IWM_LQ_FLAG_USE_RTS_POS 0 +#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) /* Bit 1-3: LQ command color. Used to match responses to LQ commands */ -#define IWM_LQ_FLAG_COLOR_POS 1 -#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) +#define IWM_LQ_FLAG_COLOR_POS 1 +#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) /* Bit 4-5: Tx RTS BW Signalling * (0) No RTS BW signalling * (1) Static BW signalling * (2) Dynamic BW signalling */ -#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 -#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 +#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) /* Bit 6: (0) No dynamic BW selection (1) Allow dynamic BW selection * Dyanmic BW selection allows Tx with narrower BW then requested in rates */ -#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 -#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 +#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +/* Single Stream Tx Parameters (lq_cmd->ss_params) + * Flags to control a smart FW decision about whether BFER/STBC/SISO will be + * used for single stream Tx. + */ + +/* Bit 0-1: Max STBC streams allowed. Can be 0-3. + * (0) - No STBC allowed + * (1) - 2x1 STBC allowed (HT/VHT) + * (2) - 4x2 STBC allowed (HT/VHT) + * (3) - 3x2 STBC allowed (HT only) + * All our chips are at most 2 antennas so only (1) is valid for now. + */ +#define IWM_LQ_SS_STBC_ALLOWED_POS 0 +#define IWM_LQ_SS_STBC_ALLOWED_MSK (3 << IWM_LQ_SS_STBC_ALLOWED_MSK) + +/* 2x1 STBC is allowed */ +#define IWM_LQ_SS_STBC_1SS_ALLOWED (1 << IWM_LQ_SS_STBC_ALLOWED_POS) + +/* Bit 2: Beamformer (VHT only) is allowed */ +#define IWM_LQ_SS_BFER_ALLOWED_POS 2 +#define IWM_LQ_SS_BFER_ALLOWED (1 << IWM_LQ_SS_BFER_ALLOWED_POS) + +/* Bit 3: Force BFER or STBC for testing + * If this is set: + * If BFER is allowed then force the ucode to choose BFER else + * If STBC is allowed then force the ucode to choose STBC over SISO + */ +#define IWM_LQ_SS_FORCE_POS 3 +#define IWM_LQ_SS_FORCE (1 << IWM_LQ_SS_FORCE_POS) + +/* Bit 31: ss_params field is valid. Used for FW backward compatibility + * with other drivers which don't support the ss_params API yet + */ +#define IWM_LQ_SS_PARAMS_VALID_POS 31 +#define IWM_LQ_SS_PARAMS_VALID (1 << IWM_LQ_SS_PARAMS_VALID_POS) + /** * struct iwm_lq_cmd - link quality command * @sta_id: station to update @@ -4078,11 +4114,11 @@ enum { * 2 - 0x3f: maximal number of frames (up to 3f == 63) * @rs_table: array of rates for each TX try, each is rate_n_flags, * meaning it is a combination of IWM_RATE_MCS_* and IWM_RATE_*_PLCP - * @bf_params: beam forming params, currently not used + * @ss_params: single stream features. declare whether STBC or BFER are allowed. */ struct iwm_lq_cmd { uint8_t sta_id; - uint8_t reserved1; + uint8_t reduced_tpc; uint16_t control; /* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */ uint8_t flags; @@ -4096,7 +4132,7 @@ struct iwm_lq_cmd { uint8_t agg_frame_cnt_limit; uint32_t reserved2; uint32_t rs_table[IWM_LQ_MAX_RETRY_NUM]; - uint32_t bf_params; + uint32_t ss_params; }; /* LINK_QUALITY_CMD_API_S_VER_1 */ /* @@ -4533,7 +4569,8 @@ struct iwm_mvm_tx_resp { uint8_t pa_integ_res_b[3]; uint8_t pa_integ_res_c[3]; uint16_t measurement_req_id; - uint16_t reserved; + uint8_t reduced_tpc; + uint8_t reserved; uint32_t tfd_info; uint16_t seq_ctl; From owner-svn-src-head@freebsd.org Wed Jul 26 06:42:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03EADDB2CFE; Wed, 26 Jul 2017 06:42:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C23A6777E0; Wed, 26 Jul 2017 06:42:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q6g1cL026599; Wed, 26 Jul 2017 06:42:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q6g1K8026598; Wed, 26 Jul 2017 06:42:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707260642.v6Q6g1K8026598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 26 Jul 2017 06:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321512 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 321512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 06:42:03 -0000 Author: kib Date: Wed Jul 26 06:42:01 2017 New Revision: 321512 URL: https://svnweb.freebsd.org/changeset/base/321512 Log: Mark name_PCTRIE_LOOKUP_LE() generated function unused. The PCTRIE macro will be shortly applied in a situation where LOOKUP_LE is not needed. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D11435 Modified: head/sys/sys/pctrie.h Modified: head/sys/sys/pctrie.h ============================================================================== --- head/sys/sys/pctrie.h Wed Jul 26 05:52:37 2017 (r321511) +++ head/sys/sys/pctrie.h Wed Jul 26 06:42:01 2017 (r321512) @@ -76,7 +76,7 @@ name##_PCTRIE_LOOKUP(struct pctrie *ptree, uint64_t ke return name##_PCTRIE_VAL2PTR(pctrie_lookup(ptree, key)); \ } \ \ -static __inline struct type * \ +static __inline __unused struct type * \ name##_PCTRIE_LOOKUP_LE(struct pctrie *ptree, uint64_t key) \ { \ \ From owner-svn-src-head@freebsd.org Wed Jul 26 06:57:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83BF2DB303F; Wed, 26 Jul 2017 06:57:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261AD77E19; Wed, 26 Jul 2017 06:57:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q6vGqB030756; Wed, 26 Jul 2017 06:57:16 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q6vFWM030745; Wed, 26 Jul 2017 06:57:15 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201707260657.v6Q6vFWM030745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 26 Jul 2017 06:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321514 - in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Commit-Revision: 321514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 06:57:17 -0000 Author: ed Date: Wed Jul 26 06:57:15 2017 New Revision: 321514 URL: https://svnweb.freebsd.org/changeset/base/321514 Log: Upgrade to the latest sources generated from the CloudABI specification. The CloudABI specification has had some minor changes over the last half year. No substantial features have been added, but some features that are deemed unnecessary in retrospect have been removed: - mlock()/munlock(): These calls tend to be used for two different purposes: real-time support and handling of sensitive (cryptographic) material that shouldn't end up in swap. The former use case is out of scope for CloudABI. The latter may also be handled by encrypting swap. Removing this has the advantage that we no longer need to worry about having resource limits put in place. - SOCK_SEQPACKET: Support for SOCK_SEQPACKET is rather inconsistent across various operating systems. Some operating systems supported by CloudABI (e.g., macOS) don't support it at all. Considering that they are rarely used, remove support for the time being. - getsockname(), getpeername(), etc.: A shortcoming of the sockets API is that it doesn't allow you to create socket(pair)s, having fake socket addresses associated with them. This makes it harder to test applications or transparently forward (proxy) connections to them. With CloudABI, we're slowly moving networking connectivity into a separate daemon called Flower. In addition to passing around socket file descriptors, this daemon provides address information in the form of arbitrary string labels. There is thus no longer any need for requesting socket address information from the kernel itself. This change also updates consumers of the generated code accordingly. Even though system calls end up getting renumbered, this won't cause any problems in practice. CloudABI programs always call into the kernel through a kernel-supplied vDSO that has the numbers updated as well. Obtained from: https://github.com/NuxiNL/cloudabi Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_mem.c head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi/cloudabi_util.h head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_sock.c head/sys/compat/cloudabi32/cloudabi32_syscall.h head/sys/compat/cloudabi32/cloudabi32_syscalls.c head/sys/compat/cloudabi32/cloudabi32_sysent.c head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_sock.c head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi32_types.h head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S head/sys/contrib/cloudabi/cloudabi_vdso_i686.S head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S head/sys/contrib/cloudabi/syscalls32.master head/sys/contrib/cloudabi/syscalls64.master head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Jul 26 06:57:15 2017 (r321514) @@ -111,8 +111,6 @@ cloudabi_sys_fd_create1(struct thread *td, return (kern_shm_open(td, SHM_ANON, O_RDWR, 0, &fcaps)); case CLOUDABI_FILETYPE_SOCKET_DGRAM: return (kern_socket(td, AF_UNIX, SOCK_DGRAM, 0)); - case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: - return (kern_socket(td, AF_UNIX, SOCK_SEQPACKET, 0)); case CLOUDABI_FILETYPE_SOCKET_STREAM: return (kern_socket(td, AF_UNIX, SOCK_STREAM, 0)); default: @@ -145,9 +143,6 @@ cloudabi_sys_fd_create2(struct thread *td, case CLOUDABI_FILETYPE_SOCKET_DGRAM: error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds); break; - case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: - error = kern_socketpair(td, AF_UNIX, SOCK_SEQPACKET, 0, fds); - break; case CLOUDABI_FILETYPE_SOCKET_STREAM: error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds); break; @@ -245,8 +240,6 @@ cloudabi_convert_filetype(const struct file *fp) switch (so->so_type) { case SOCK_DGRAM: return (CLOUDABI_FILETYPE_SOCKET_DGRAM); - case SOCK_SEQPACKET: - return (CLOUDABI_FILETYPE_SOCKET_SEQPACKET); case SOCK_STREAM: return (CLOUDABI_FILETYPE_SOCKET_STREAM); default: @@ -400,7 +393,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t *inheriting = 0; break; case CLOUDABI_FILETYPE_SOCKET_DGRAM: - case CLOUDABI_FILETYPE_SOCKET_SEQPACKET: case CLOUDABI_FILETYPE_SOCKET_STREAM: *base &= CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | Modified: head/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_mem.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi/cloudabi_mem.c Wed Jul 26 06:57:15 2017 (r321514) @@ -90,14 +90,6 @@ cloudabi_sys_mem_advise(struct thread *td, } int -cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap) -{ - - return (kern_mlock(td->td_proc, td->td_ucred, - __DECONST(uintptr_t, uap->mapping), uap->mapping_len)); -} - -int cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap) { int error, flags, prot; @@ -158,15 +150,6 @@ cloudabi_sys_mem_sync(struct thread *td, struct clouda return (kern_msync(td, (uintptr_t)uap->mapping, uap->mapping_len, flags)); -} - -int -cloudabi_sys_mem_unlock(struct thread *td, - struct cloudabi_sys_mem_unlock_args *uap) -{ - - return (kern_munlock(td, __DECONST(uintptr_t, uap->mapping), - uap->mapping_len)); } int Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi/cloudabi_sock.c Wed Jul 26 06:57:15 2017 (r321514) @@ -49,43 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* Converts FreeBSD's struct sockaddr to CloudABI's cloudabi_sockaddr_t. */ -static void -cloudabi_convert_sockaddr(const struct sockaddr *sa, socklen_t sal, - cloudabi_sockaddr_t *rsa) -{ - const struct sockaddr_in *sin; - const struct sockaddr_in6 *sin6; - - /* Zero-sized socket address. */ - if (sal < offsetof(struct sockaddr, sa_family) + sizeof(sa->sa_family)) - return; - - switch (sa->sa_family) { - case AF_INET: - if (sal < sizeof(struct sockaddr_in)) - return; - sin = (const struct sockaddr_in *)sa; - rsa->sa_family = CLOUDABI_AF_INET; - memcpy(&rsa->sa_inet.addr, &sin->sin_addr, - sizeof(rsa->sa_inet.addr)); - rsa->sa_inet.port = ntohs(sin->sin_port); - return; - case AF_INET6: - if (sal < sizeof(struct sockaddr_in6)) - return; - sin6 = (const struct sockaddr_in6 *)sa; - rsa->sa_family = CLOUDABI_AF_INET6; - memcpy(&rsa->sa_inet6.addr, &sin6->sin6_addr, - sizeof(rsa->sa_inet6.addr)); - rsa->sa_inet6.port = ntohs(sin6->sin6_port); - return; - case AF_UNIX: - rsa->sa_family = CLOUDABI_AF_UNIX; - return; - } -} - /* Copies a pathname into a UNIX socket address structure. */ static int copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun) @@ -112,27 +75,8 @@ int cloudabi_sys_sock_accept(struct thread *td, struct cloudabi_sys_sock_accept_args *uap) { - struct sockaddr *sa; - cloudabi_sockstat_t ss = {}; - socklen_t sal; - int error; - if (uap->buf == NULL) { - /* Only return the new file descriptor number. */ - return (kern_accept(td, uap->sock, NULL, NULL, NULL)); - } else { - /* Also return properties of the new socket descriptor. */ - sal = MAX(sizeof(struct sockaddr_in), - sizeof(struct sockaddr_in6)); - error = kern_accept(td, uap->sock, (void *)&sa, &sal, NULL); - if (error != 0) - return (error); - - /* TODO(ed): Fill the other members of cloudabi_sockstat_t. */ - cloudabi_convert_sockaddr(sa, sal, &ss.ss_peername); - free(sa, M_SONAME); - return (copyout(&ss, uap->buf, sizeof(ss))); - } + return (kern_accept(td, uap->sock, NULL, NULL, NULL)); } int @@ -200,7 +144,6 @@ cloudabi_sys_sock_stat_get(struct thread *td, cloudabi_sockstat_t ss = {}; cap_rights_t rights; struct file *fp; - struct sockaddr *sa; struct socket *so; int error; @@ -210,27 +153,6 @@ cloudabi_sys_sock_stat_get(struct thread *td, return (error); so = fp->f_data; - CURVNET_SET(so->so_vnet); - - /* Set ss_sockname. */ - error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); - if (error == 0) { - cloudabi_convert_sockaddr(sa, sa->sa_len, &ss.ss_sockname); - free(sa, M_SONAME); - } - - /* Set ss_peername. */ - if ((so->so_state & (SS_ISCONNECTED | SS_ISCONFIRMING)) != 0) { - error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); - if (error == 0) { - cloudabi_convert_sockaddr(sa, sa->sa_len, - &ss.ss_peername); - free(sa, M_SONAME); - } - } - - CURVNET_RESTORE(); - /* Set ss_error. */ SOCK_LOCK(so); ss.ss_error = cloudabi_convert_errno(so->so_error); @@ -249,8 +171,8 @@ cloudabi_sys_sock_stat_get(struct thread *td, int cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data, size_t datalen, cloudabi_fd_t *fds, size_t fdslen, - cloudabi_msgflags_t flags, size_t *rdatalen, size_t *rfdslen, - cloudabi_sockaddr_t *peername, cloudabi_msgflags_t *rflags) + cloudabi_riflags_t flags, size_t *rdatalen, size_t *rfdslen, + cloudabi_roflags_t *rflags) { struct sockaddr_storage ss; struct msghdr hdr = { @@ -263,9 +185,9 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd int error; /* Convert flags. */ - if (flags & CLOUDABI_MSG_PEEK) + if (flags & CLOUDABI_SOCK_RECV_PEEK) hdr.msg_flags |= MSG_PEEK; - if (flags & CLOUDABI_MSG_WAITALL) + if (flags & CLOUDABI_SOCK_RECV_WAITALL) hdr.msg_flags |= MSG_WAITALL; control = NULL; @@ -278,13 +200,9 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd *rdatalen = td->td_retval[0]; td->td_retval[0] = 0; *rfdslen = 0; - cloudabi_convert_sockaddr((struct sockaddr *)&ss, - MIN(hdr.msg_namelen, sizeof(ss)), peername); *rflags = 0; - if (hdr.msg_flags & MSG_EOR) - *rflags |= CLOUDABI_MSG_EOR; if (hdr.msg_flags & MSG_TRUNC) - *rflags |= CLOUDABI_MSG_TRUNC; + *rflags |= CLOUDABI_SOCK_RECV_DATA_TRUNCATED; /* Extract file descriptors from SCM_RIGHTS messages. */ if (control != NULL) { @@ -303,7 +221,8 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd if (nfds > fdslen) { /* Unable to store file descriptors. */ nfds = fdslen; - *rflags |= CLOUDABI_MSG_CTRUNC; + *rflags |= + CLOUDABI_SOCK_RECV_FDS_TRUNCATED; } error = copyout(CMSG_DATA(chdr), fds, nfds * sizeof(int)); @@ -323,21 +242,15 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd int cloudabi_sock_send(struct thread *td, cloudabi_fd_t fd, struct iovec *data, - size_t datalen, const cloudabi_fd_t *fds, size_t fdslen, - cloudabi_msgflags_t flags, size_t *rdatalen) + size_t datalen, const cloudabi_fd_t *fds, size_t fdslen, size_t *rdatalen) { struct msghdr hdr = { .msg_iov = data, .msg_iovlen = datalen, }; struct mbuf *control; - int error, mflags; + int error; - /* Convert flags. */ - mflags = MSG_NOSIGNAL; - if (flags & CLOUDABI_MSG_EOR) - mflags |= MSG_EOR; - /* Convert file descriptor array to an SCM_RIGHTS message. */ if (fdslen > MCLBYTES || CMSG_SPACE(fdslen * sizeof(int)) > MCLBYTES) { return (EINVAL); @@ -361,7 +274,7 @@ cloudabi_sock_send(struct thread *td, cloudabi_fd_t fd control = NULL; } - error = kern_sendit(td, fd, &hdr, mflags, control, UIO_USERSPACE); + error = kern_sendit(td, fd, &hdr, MSG_NOSIGNAL, control, UIO_USERSPACE); if (error != 0) return (error); *rdatalen = td->td_retval[0]; Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi/cloudabi_util.h Wed Jul 26 06:57:15 2017 (r321514) @@ -75,10 +75,10 @@ int cloudabi_futex_lock_wrlock(struct thread *, clouda /* Socket operations. */ int cloudabi_sock_recv(struct thread *, cloudabi_fd_t, struct iovec *, size_t, - cloudabi_fd_t *, size_t, cloudabi_msgflags_t, size_t *, size_t *, - cloudabi_sockaddr_t *, cloudabi_msgflags_t *); + cloudabi_fd_t *, size_t, cloudabi_riflags_t, size_t *, size_t *, + cloudabi_roflags_t *); int cloudabi_sock_send(struct thread *, cloudabi_fd_t, struct iovec *, size_t, - const cloudabi_fd_t *, size_t, cloudabi_msgflags_t, size_t *); + const cloudabi_fd_t *, size_t, size_t *); /* vDSO setup and teardown. */ void cloudabi_vdso_init(struct sysentvec *, char *, char *); Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Jul 26 06:57:15 2017 (r321514) @@ -200,10 +200,6 @@ struct cloudabi_sys_mem_advise_args { char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; -struct cloudabi_sys_mem_lock_args { - char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; - char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; -}; struct cloudabi_sys_mem_map_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; @@ -222,10 +218,6 @@ struct cloudabi_sys_mem_sync_args { char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; }; -struct cloudabi_sys_mem_unlock_args { - char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; - char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; -}; struct cloudabi_sys_mem_unmap_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; @@ -265,7 +257,7 @@ struct cloudabi_sys_random_get_args { }; struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; + char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)]; }; struct cloudabi_sys_sock_bind_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; @@ -345,11 +337,9 @@ int cloudabi_sys_file_symlink(struct thread *, struct int cloudabi_sys_file_unlink(struct thread *, struct cloudabi_sys_file_unlink_args *); int cloudabi_sys_lock_unlock(struct thread *, struct cloudabi_sys_lock_unlock_args *); int cloudabi_sys_mem_advise(struct thread *, struct cloudabi_sys_mem_advise_args *); -int cloudabi_sys_mem_lock(struct thread *, struct cloudabi_sys_mem_lock_args *); int cloudabi_sys_mem_map(struct thread *, struct cloudabi_sys_mem_map_args *); int cloudabi_sys_mem_protect(struct thread *, struct cloudabi_sys_mem_protect_args *); int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); -int cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi32_sys_poll(struct thread *, struct cloudabi32_sys_poll_args *); int cloudabi32_sys_poll_fd(struct thread *, struct cloudabi32_sys_poll_fd_args *); @@ -399,6 +389,12 @@ int cloudabi_sys_thread_yield(struct thread *, struct #endif /* COMPAT_FREEBSD10 */ + +#ifdef COMPAT_FREEBSD11 + + +#endif /* COMPAT_FREEBSD11 */ + #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL @@ -432,11 +428,9 @@ int cloudabi_sys_thread_yield(struct thread *, struct #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_unlink AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_lock_unlock AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_advise AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_lock AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_map AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_protect AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unlock AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll_fd AUE_NULL Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sock.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Wed Jul 26 06:57:15 2017 (r321514) @@ -75,7 +75,7 @@ cloudabi32_sys_sock_recv(struct thread *td, error = cloudabi_sock_recv(td, uap->sock, iov, ri.ri_data_len, TO_PTR(ri.ri_fds), ri.ri_fds_len, ri.ri_flags, &rdatalen, - &rfdslen, &ro.ro_peername, &ro.ro_flags); + &rfdslen, &ro.ro_flags); free(iov, M_SOCKET); if (error != 0) return (error); @@ -118,7 +118,7 @@ cloudabi32_sys_sock_send(struct thread *td, } error = cloudabi_sock_send(td, uap->sock, iov, si.si_data_len, - TO_PTR(si.si_fds), si.si_fds_len, si.si_flags, &datalen); + TO_PTR(si.si_fds), si.si_fds_len, &datalen); free(iov, M_SOCKET); if (error != 0) return (error); Modified: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Wed Jul 26 06:57:15 2017 (r321514) @@ -38,28 +38,26 @@ #define CLOUDABI32_SYS_cloudabi_sys_file_unlink 30 #define CLOUDABI32_SYS_cloudabi_sys_lock_unlock 31 #define CLOUDABI32_SYS_cloudabi_sys_mem_advise 32 -#define CLOUDABI32_SYS_cloudabi_sys_mem_lock 33 -#define CLOUDABI32_SYS_cloudabi_sys_mem_map 34 -#define CLOUDABI32_SYS_cloudabi_sys_mem_protect 35 -#define CLOUDABI32_SYS_cloudabi_sys_mem_sync 36 -#define CLOUDABI32_SYS_cloudabi_sys_mem_unlock 37 -#define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 38 -#define CLOUDABI32_SYS_cloudabi32_sys_poll 39 -#define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 40 -#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 41 -#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 42 -#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 43 -#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 44 -#define CLOUDABI32_SYS_cloudabi_sys_random_get 45 -#define CLOUDABI32_SYS_cloudabi_sys_sock_accept 46 -#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 47 -#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 48 -#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 49 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 50 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 51 -#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 52 -#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 53 -#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 54 -#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 55 -#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 56 -#define CLOUDABI32_SYS_MAXSYSCALL 57 +#define CLOUDABI32_SYS_cloudabi_sys_mem_map 33 +#define CLOUDABI32_SYS_cloudabi_sys_mem_protect 34 +#define CLOUDABI32_SYS_cloudabi_sys_mem_sync 35 +#define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 36 +#define CLOUDABI32_SYS_cloudabi32_sys_poll 37 +#define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 38 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 39 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 40 +#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 41 +#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 42 +#define CLOUDABI32_SYS_cloudabi_sys_random_get 43 +#define CLOUDABI32_SYS_cloudabi_sys_sock_accept 44 +#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 45 +#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 46 +#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 47 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 48 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 49 +#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 50 +#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 51 +#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 52 +#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 53 +#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 54 +#define CLOUDABI32_SYS_MAXSYSCALL 55 Modified: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Wed Jul 26 06:57:15 2017 (r321514) @@ -39,28 +39,26 @@ const char *cloudabi32_syscallnames[] = { "cloudabi_sys_file_unlink", /* 30 = cloudabi_sys_file_unlink */ "cloudabi_sys_lock_unlock", /* 31 = cloudabi_sys_lock_unlock */ "cloudabi_sys_mem_advise", /* 32 = cloudabi_sys_mem_advise */ - "cloudabi_sys_mem_lock", /* 33 = cloudabi_sys_mem_lock */ - "cloudabi_sys_mem_map", /* 34 = cloudabi_sys_mem_map */ - "cloudabi_sys_mem_protect", /* 35 = cloudabi_sys_mem_protect */ - "cloudabi_sys_mem_sync", /* 36 = cloudabi_sys_mem_sync */ - "cloudabi_sys_mem_unlock", /* 37 = cloudabi_sys_mem_unlock */ - "cloudabi_sys_mem_unmap", /* 38 = cloudabi_sys_mem_unmap */ - "cloudabi32_sys_poll", /* 39 = cloudabi32_sys_poll */ - "cloudabi32_sys_poll_fd", /* 40 = cloudabi32_sys_poll_fd */ - "cloudabi_sys_proc_exec", /* 41 = cloudabi_sys_proc_exec */ - "cloudabi_sys_proc_exit", /* 42 = cloudabi_sys_proc_exit */ - "cloudabi_sys_proc_fork", /* 43 = cloudabi_sys_proc_fork */ - "cloudabi_sys_proc_raise", /* 44 = cloudabi_sys_proc_raise */ - "cloudabi_sys_random_get", /* 45 = cloudabi_sys_random_get */ - "cloudabi_sys_sock_accept", /* 46 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 47 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 48 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 49 = cloudabi_sys_sock_listen */ - "cloudabi32_sys_sock_recv", /* 50 = cloudabi32_sys_sock_recv */ - "cloudabi32_sys_sock_send", /* 51 = cloudabi32_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */ - "cloudabi32_sys_thread_create", /* 54 = cloudabi32_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */ + "cloudabi_sys_mem_map", /* 33 = cloudabi_sys_mem_map */ + "cloudabi_sys_mem_protect", /* 34 = cloudabi_sys_mem_protect */ + "cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */ + "cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */ + "cloudabi32_sys_poll", /* 37 = cloudabi32_sys_poll */ + "cloudabi32_sys_poll_fd", /* 38 = cloudabi32_sys_poll_fd */ + "cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ + "cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */ + "cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */ + "cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */ + "cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */ + "cloudabi32_sys_sock_recv", /* 48 = cloudabi32_sys_sock_recv */ + "cloudabi32_sys_sock_send", /* 49 = cloudabi32_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */ + "cloudabi32_sys_thread_create", /* 52 = cloudabi32_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Wed Jul 26 06:57:15 2017 (r321514) @@ -47,28 +47,26 @@ struct sysent cloudabi32_sysent[] = { { AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */ { AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */ { AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */ - { AS(cloudabi_sys_mem_lock_args), (sy_call_t *)cloudabi_sys_mem_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_lock */ - { AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_map */ - { AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_protect */ - { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_sync */ - { AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */ - { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */ - { AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi32_sys_poll */ - { AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi32_sys_poll_fd */ - { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */ - { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */ - { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */ - { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */ - { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */ - { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */ - { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi32_sys_sock_recv */ - { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi32_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi32_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */ + { AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_map */ + { AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_protect */ + { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */ + { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */ + { AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi32_sys_poll */ + { AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi32_sys_poll_fd */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ + { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */ + { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */ + { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */ + { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */ + { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi32_sys_sock_recv */ + { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi32_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Jul 26 06:52:45 2017 (r321513) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Jul 26 06:57:15 2017 (r321514) @@ -310,16 +310,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* cloudabi_sys_mem_lock */ - case 33: { - struct cloudabi_sys_mem_lock_args *p = params; - uarg[0] = (intptr_t) p->mapping; /* const void * */ - uarg[1] = p->mapping_len; /* size_t */ - *n_args = 2; - break; - } /* cloudabi_sys_mem_map */ - case 34: { + case 33: { struct cloudabi_sys_mem_map_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ @@ -331,7 +323,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_mem_protect */ - case 35: { + case 34: { struct cloudabi_sys_mem_protect_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ @@ -340,7 +332,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_mem_sync */ - case 36: { + case 35: { struct cloudabi_sys_mem_sync_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ @@ -348,16 +340,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* cloudabi_sys_mem_unlock */ - case 37: { - struct cloudabi_sys_mem_unlock_args *p = params; - uarg[0] = (intptr_t) p->mapping; /* const void * */ - uarg[1] = p->mapping_len; /* size_t */ - *n_args = 2; - break; - } /* cloudabi_sys_mem_unmap */ - case 38: { + case 36: { struct cloudabi_sys_mem_unmap_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ @@ -365,7 +349,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_poll */ - case 39: { + case 37: { struct cloudabi32_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ uarg[1] = (intptr_t) p->out; /* cloudabi32_event_t * */ @@ -374,7 +358,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_poll_fd */ - case 40: { + case 38: { struct cloudabi32_sys_poll_fd_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ @@ -386,7 +370,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_proc_exec */ - case 41: { + case 39: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ @@ -397,26 +381,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_proc_exit */ - case 42: { + case 40: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ - case 43: { + case 41: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ - case 44: { + case 42: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ - case 45: { + case 43: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->buf_len; /* size_t */ @@ -424,15 +408,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_accept */ - case 46: { + case 44: { struct cloudabi_sys_sock_accept_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ + uarg[1] = (intptr_t) p->unused; /* void * */ *n_args = 2; break; } /* cloudabi_sys_sock_bind */ - case 47: { + case 45: { struct cloudabi_sys_sock_bind_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -442,7 +426,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_connect */ - case 48: { + case 46: { struct cloudabi_sys_sock_connect_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -452,7 +436,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_listen */ - case 49: { + case 47: { struct cloudabi_sys_sock_listen_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->backlog; /* cloudabi_backlog_t */ @@ -460,7 +444,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_sock_recv */ - case 50: { + case 48: { struct cloudabi32_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_recv_in_t * */ @@ -469,7 +453,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_sock_send */ - case 51: { + case 49: { struct cloudabi32_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_send_in_t * */ @@ -478,7 +462,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_shutdown */ - case 52: { + case 50: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -486,7 +470,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_stat_get */ - case 53: { + case 51: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -495,14 +479,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_thread_create */ - case 54: { + case 52: { struct cloudabi32_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi32_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 55: { + case 53: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ @@ -510,7 +494,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_thread_yield */ - case 56: { + case 54: { *n_args = 0; break; } @@ -1058,23 +1042,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi_sys_mem_lock */ + /* cloudabi_sys_mem_map */ case 33: switch(ndx) { case 0: - p = "userland const void *"; - break; - case 1: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_mem_map */ - case 34: - switch(ndx) { - case 0: p = "userland void *"; break; case 1: @@ -1097,7 +1068,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_mem_protect */ - case 35: + case 34: switch(ndx) { case 0: p = "userland void *"; @@ -1113,7 +1084,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_mem_sync */ - case 36: + case 35: switch(ndx) { case 0: p = "userland void *"; @@ -1128,21 +1099,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi_sys_mem_unlock */ - case 37: - switch(ndx) { - case 0: - p = "userland const void *"; - break; - case 1: - p = "size_t"; - break; - default: - break; - }; - break; /* cloudabi_sys_mem_unmap */ - case 38: + case 36: switch(ndx) { case 0: p = "userland void *"; @@ -1155,7 +1113,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_poll */ - case 39: + case 37: switch(ndx) { case 0: p = "userland const cloudabi32_subscription_t *"; @@ -1171,7 +1129,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_poll_fd */ - case 40: + case 38: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1196,7 +1154,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_exec */ - case 41: + case 39: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1218,7 +1176,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_exit */ - case 42: + case 40: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; @@ -1228,10 +1186,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_fork */ - case 43: + case 41: break; /* cloudabi_sys_proc_raise */ - case 44: + case 42: switch(ndx) { case 0: p = "cloudabi_signal_t"; @@ -1241,7 +1199,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_random_get */ - case 45: + case 43: switch(ndx) { case 0: p = "userland void *"; @@ -1254,20 +1212,20 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_accept */ - case 46: + case 44: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "userland cloudabi_sockstat_t *"; + p = "userland void *"; break; default: break; }; break; /* cloudabi_sys_sock_bind */ - case 47: + case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1286,7 +1244,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_connect */ - case 48: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1305,7 +1263,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_listen */ - case 49: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1318,7 +1276,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_sock_recv */ - case 50: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1334,7 +1292,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_sock_send */ - case 51: + case 49: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1350,7 +1308,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_shutdown */ - case 52: + case 50: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1363,7 +1321,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_stat_get */ - case 53: + case 51: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1379,7 +1337,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_thread_create */ - case 54: + case 52: switch(ndx) { case 0: p = "userland cloudabi32_threadattr_t *"; @@ -1389,7 +1347,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_exit */ - case 55: + case 53: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; @@ -1402,7 +1360,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_yield */ - case 56: + case 54: break; default: break; @@ -1580,120 +1538,110 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_mem_lock */ + /* cloudabi_sys_mem_map */ case 33: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_mem_map */ + /* cloudabi_sys_mem_protect */ case 34: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_mem_protect */ + /* cloudabi_sys_mem_sync */ case 35: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_mem_sync */ + /* cloudabi_sys_mem_unmap */ case 36: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_mem_unlock */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jul 26 12:07:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FB30DBCF3F; Wed, 26 Jul 2017 12:07:47 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AFFF77; Wed, 26 Jul 2017 12:07:47 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QC7kEr057834; Wed, 26 Jul 2017 12:07:46 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QC7kgO057833; Wed, 26 Jul 2017 12:07:46 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201707261207.v6QC7kgO057833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 26 Jul 2017 12:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321518 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil X-SVN-Commit-Revision: 321518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 12:07:47 -0000 Author: lwhsu (ports committer) Date: Wed Jul 26 12:07:46 2017 New Revision: 321518 URL: https://svnweb.freebsd.org/changeset/base/321518 Log: Add an auxiliary subroutine to generate some events for testing This test is also timeout on a quiet system because there is nobody triggering read probefunc while test execution. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11731 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Wed Jul 26 11:04:30 2017 (r321517) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Wed Jul 26 12:07:46 2017 (r321518) @@ -39,6 +39,15 @@ ## +reader() +{ + while true + do + sleep 0.1 + cat /etc/motd > /dev/null + done +} + if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 @@ -46,6 +55,9 @@ fi dtrace=$1 +reader & +child=$! + $dtrace -qZf wassup'{printf("Iamkool");}' \ -qf read'{printf("I am done"); exit(0);}' @@ -54,5 +66,7 @@ status=$? if [ "$status" -ne 0 ]; then echo $tst: dtrace failed fi + +kill $child exit $status From owner-svn-src-head@freebsd.org Wed Jul 26 15:09:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 936B0DC0041; Wed, 26 Jul 2017 15:09:10 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-ua0-f178.google.com (mail-ua0-f178.google.com [209.85.217.178]) (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 5251865EA6; Wed, 26 Jul 2017 15:09:09 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-ua0-f178.google.com with SMTP id q25so100188698uah.1; Wed, 26 Jul 2017 08:09:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VjF/2004FgQZrqLKJJ7pgWJ7Pko0fKoazVGBiT91YAc=; b=ukCtHEc/s7Mc2Fk7YqEfhUDhBwdcHuoW6PeBjgmrvbubSER5ZjmGikxCPMep0hNtAq J9S/6YpsJEt6669zRH95Cv4N0WaY2ZMh8iPmFM+OgbL0fbDEhDOchamoqex5WwIt3tLw SITRCmmgUBMdexpgb0sgripboPb4XO1V9motMeOiFvd4B1aqc4lKtDsUIVBnAVqWeoec lkU17Cngsd9u9UOJiA+E/OdFb0haGlM9WPjw5qlBEDvtixXyLlFhRYd0J2VdEvB0eTBG 0EqgiZcoXrS8cMku8wMM2O58xdZy/xxGguxzkPlVLaulYfXhSnAgkQzJzpOqye2RIn0M Zd/g== X-Gm-Message-State: AIVw111RiAnHJBG8jVeECzJu/E88rts8sGEc6F3BEPEsxrxG6aMoerPZ rHxOgzZzgpRpDkmvOYIC3g== X-Received: by 10.176.79.155 with SMTP id m27mr730604uah.66.1501081742753; Wed, 26 Jul 2017 08:09:02 -0700 (PDT) Received: from mail-ua0-f182.google.com (mail-ua0-f182.google.com. [209.85.217.182]) by smtp.gmail.com with ESMTPSA id 71sm3763200vkh.56.2017.07.26.08.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 08:09:02 -0700 (PDT) Received: by mail-ua0-f182.google.com with SMTP id f9so119219125uaf.4; Wed, 26 Jul 2017 08:09:01 -0700 (PDT) X-Received: by 10.176.79.43 with SMTP id n43mr791361uah.101.1501081741519; Wed, 26 Jul 2017 08:09:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.32.75 with HTTP; Wed, 26 Jul 2017 08:09:00 -0700 (PDT) In-Reply-To: <201705191304.v4JD45Sn021851@repo.freebsd.org> References: <201705191304.v4JD45Sn021851@repo.freebsd.org> From: Michael Zhilin Date: Wed, 26 Jul 2017 18:09:00 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r318539 - head/lib/libthr/thread To: Eric van Gyzen , kib@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Michael Zhilin Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 15:09:10 -0000 Hi Eric, Konstantin, This commit breaks libthread_db a bit, particular change is: -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; In libthread_db there is check if _thread_keytable is found in symbols of debugged process: https://svnweb.freebsd.org/base/head/lib/libthread_db/libthr_db.c?revision=241720&view=markup#l148 LOOKUP_SYM(ph, "_thread_keytable", &ta->thread_keytable_addr); If symbol is not found, pt_ta_new returns "TD_NOLIBTHREAD", even if process uses libthr. It impacts sysutils/pstack port, it doesn't work for multithreaded processes anymore. Eric, Konstantin, Could you please advise what is best way to fix it: - rollback change of "_thread_keytable" (it looks easy) - or remove "_thread_keytable" from libthread_db ? Thanks! On Fri, May 19, 2017 at 4:04 PM, Eric van Gyzen wrote: > Author: vangyzen > Date: Fri May 19 13:04:05 2017 > New Revision: 318539 > URL: https://svnweb.freebsd.org/changeset/base/318539 > > Log: > libthr: fix warnings at WARNS=6 > > Fix warnings about the following when WARNS=6 (which I will commit soon): > > - casting away const > - no previous 'extern' declaration for non-static variable > - others as explained by #pragmas and comments > - unused parameters > > The last is the only functional change. > > Reviewed by: kib > MFC after: 3 days > Sponsored by: Dell EMC > Differential Revision: https://reviews.freebsd.org/D10808 > > Modified: > head/lib/libthr/thread/thr_attr.c > head/lib/libthr/thread/thr_exit.c > head/lib/libthr/thread/thr_sig.c > head/lib/libthr/thread/thr_spec.c > head/lib/libthr/thread/thr_stack.c > head/lib/libthr/thread/thr_symbols.c > head/lib/libthr/thread/thr_umtx.c > head/lib/libthr/thread/thr_umtx.h > > Modified: head/lib/libthr/thread/thr_attr.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_attr.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_attr.c Fri May 19 13:04:05 2017 > (r318539) > @@ -607,7 +607,7 @@ _pthread_attr_setaffinity_np(pthread_att > /* Kernel checks invalid bits, we check it here > too. */ > size_t i; > for (i = kern_size; i < cpusetsize; ++i) { > - if (((char *)cpusetp)[i]) > + if (((const char *)cpusetp)[i]) > return (EINVAL); > } > } > > Modified: head/lib/libthr/thread/thr_exit.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_exit.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_exit.c Fri May 19 13:04:05 2017 > (r318539) > @@ -119,7 +119,8 @@ _Unwind_GetCFA(struct _Unwind_Context *c > #endif /* PIC */ > > static void > -thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception > *e) > +thread_unwind_cleanup(_Unwind_Reason_Code code __unused, > + struct _Unwind_Exception *e __unused) > { > /* > * Specification said that _Unwind_Resume should not be used here, > @@ -130,10 +131,10 @@ thread_unwind_cleanup(_Unwind_Reason_Cod > } > > static _Unwind_Reason_Code > -thread_unwind_stop(int version, _Unwind_Action actions, > - int64_t exc_class, > - struct _Unwind_Exception *exc_obj, > - struct _Unwind_Context *context, void *stop_parameter) > +thread_unwind_stop(int version __unused, _Unwind_Action actions, > + int64_t exc_class __unused, > + struct _Unwind_Exception *exc_obj __unused, > + struct _Unwind_Context *context, void *stop_parameter __unused) > { > struct pthread *curthread = _get_curthread(); > struct pthread_cleanup *cur; > > Modified: head/lib/libthr/thread/thr_sig.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_sig.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_sig.c Fri May 19 13:04:05 2017 > (r318539) > @@ -441,7 +441,7 @@ _thr_signal_init(int dlopened) > } > > void > -_thr_sigact_unload(struct dl_phdr_info *phdr_info) > +_thr_sigact_unload(struct dl_phdr_info *phdr_info __unused) > { > #if 0 > struct pthread *curthread = _get_curthread(); > > Modified: head/lib/libthr/thread/thr_spec.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_spec.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_spec.c Fri May 19 13:04:05 2017 > (r318539) > @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); > > #include "thr_private.h" > > -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > > __weak_reference(_pthread_key_create, pthread_key_create); > __weak_reference(_pthread_key_delete, pthread_key_delete); > > Modified: head/lib/libthr/thread/thr_stack.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_stack.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_stack.c Fri May 19 13:04:05 2017 > (r318539) > @@ -290,6 +290,19 @@ _thr_stack_alloc(struct pthread_attr *at > return (-1); > } > > +/* > + * Disable this warning from clang: > + * > + * cast from 'char *' to > + * 'struct stack *' increases required alignment from 1 to 8 > + * [-Werror,-Wcast-align] > + * spare_stack = (struct stack *) > + */ > +#ifdef __clang__ > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wcast-align" > +#endif > + > /* This function must be called with _thread_list_lock held. */ > void > _thr_stack_free(struct pthread_attr *attr) > @@ -316,3 +329,7 @@ _thr_stack_free(struct pthread_attr *att > attr->stackaddr_attr = NULL; > } > } > + > +#ifdef __clang__ > +#pragma GCC diagnostic pop > +#endif > > Modified: head/lib/libthr/thread/thr_symbols.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_symbols.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_symbols.c Fri May 19 13:04:05 2017 > (r318539) > @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); > > #include "thr_private.h" > > +#ifdef __clang__ > +#pragma GCC diagnostic ignored "-Wmissing-variable-declarations" > +#endif > + > /* A collection of symbols needed by debugger */ > > /* int _libthr_debug */ > > Modified: head/lib/libthr/thread/thr_umtx.c > ============================================================ > ================== > --- head/lib/libthr/thread/thr_umtx.c Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_umtx.c Fri May 19 13:04:05 2017 > (r318539) > @@ -168,7 +168,7 @@ __thr_umutex_timedlock(struct umutex *mt > } > > int > -__thr_umutex_unlock(struct umutex *mtx, uint32_t id) > +__thr_umutex_unlock(struct umutex *mtx) > { > > return (_umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0)); > > Modified: head/lib/libthr/thread/thr_umtx.h > ============================================================ > ================== > --- head/lib/libthr/thread/thr_umtx.h Fri May 19 13:02:19 2017 > (r318538) > +++ head/lib/libthr/thread/thr_umtx.h Fri May 19 13:04:05 2017 > (r318539) > @@ -44,7 +44,7 @@ int __thr_umutex_lock(struct umutex *mtx > int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden; > int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id, > const struct timespec *timeout) __hidden; > -int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) __hidden; > +int __thr_umutex_unlock(struct umutex *mtx) __hidden; > int __thr_umutex_trylock(struct umutex *mtx) __hidden; > int __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling, > uint32_t *oldceiling) __hidden; > @@ -155,7 +155,7 @@ _thr_umutex_unlock2(struct umutex *mtx, > if (atomic_cmpset_rel_32(&mtx->m_owner, id, noncst ? > UMUTEX_RB_NOTRECOV : UMUTEX_UNOWNED)) > return (0); > - return (__thr_umutex_unlock(mtx, id)); > + return (__thr_umutex_unlock(mtx)); > } > > do { > > From owner-svn-src-head@freebsd.org Wed Jul 26 15:23:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325ACDC05C2; Wed, 26 Jul 2017 15:23:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 BBF9866B1D; Wed, 26 Jul 2017 15:23:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v6QFNDtx039892 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Jul 2017 18:23:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6QFNDtx039892 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6QFNDwj039891; Wed, 26 Jul 2017 18:23:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 26 Jul 2017 18:23:13 +0300 From: Konstantin Belousov To: Michael Zhilin Cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Michael Zhilin Subject: Re: svn commit: r318539 - head/lib/libthr/thread Message-ID: <20170726152313.GF1700@kib.kiev.ua> References: <201705191304.v4JD45Sn021851@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: 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, 26 Jul 2017 15:23:24 -0000 On Wed, Jul 26, 2017 at 06:09:00PM +0300, Michael Zhilin wrote: > Hi Eric, Konstantin, > > This commit breaks libthread_db a bit, particular change is: > -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > > In libthread_db there is check if _thread_keytable is found in symbols of > debugged process: > https://svnweb.freebsd.org/base/head/lib/libthread_db/libthr_db.c?revision=241720&view=markup#l148 > > LOOKUP_SYM(ph, "_thread_keytable", &ta->thread_keytable_addr); > > If symbol is not found, pt_ta_new returns "TD_NOLIBTHREAD", even if process > uses libthr. > It impacts sysutils/pstack port, it doesn't work for multithreaded > processes anymore. > > Eric, Konstantin, > Could you please advise what is best way to fix it: > > - rollback change of "_thread_keytable" (it looks easy) > - or remove "_thread_keytable" from libthread_db > > ? The td_ta_tsd_iter() API implementation for libthr depends on the ability to lookup the symbol. I think that the change should be reverted, it is easiest solution. Perhaps a comment should be added noting that the symbol is used by libthread_db so that the mistake is not repeated. From owner-svn-src-head@freebsd.org Wed Jul 26 16:08:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C1ED98168; Wed, 26 Jul 2017 16:08:46 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-ua0-f178.google.com (mail-ua0-f178.google.com [209.85.217.178]) (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 383036806E; Wed, 26 Jul 2017 16:08:45 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-ua0-f178.google.com with SMTP id q25so101597607uah.1; Wed, 26 Jul 2017 09:08:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g9PN1BrZ+otLND06NKhr2fRszLKvveqN+jgCTsYYCs4=; b=WfHYY5WL376It/NSuJVec2FoQmXXj9uqcXN1K5IK5tt4js/Yt7mALkS+y/AgFNpB46 pFnrnQ9avSWq4YXVN21pLLx4mLxqtv/Qen/qr7cYUBjFWWKWwFwehDhIyCgmjB/XS0pS +6C5DHS5+PySM40kNKIME4FvY7DJuV8mwahrHHXVf0Ata65tNnWR8xVtPaNBMv+gjfHu fwa6w0fBDY19keeYORYSaOXcqwyDqq5IFld3wSLgETyLDpxBipOPBnOhmdjxPhRQqgB9 3uOOCiNdZFDl7tW5mbrOUhITCZ/B4nmXR627qTiBAtphAV3UhOwJ5OjaVwF7QDjazNh0 Z29g== X-Gm-Message-State: AIVw113hPQ5bq148FWJVU+PQRzHJscnZBdbhLWPRUuiGCDhbztvAievp rlgAGSdqBhkDZq0h64DOGg== X-Received: by 10.176.84.153 with SMTP id p25mr970993uaa.174.1501083540916; Wed, 26 Jul 2017 08:39:00 -0700 (PDT) Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com. [209.85.217.169]) by smtp.gmail.com with ESMTPSA id 34sm3922455uai.50.2017.07.26.08.39.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 08:39:00 -0700 (PDT) Received: by mail-ua0-f169.google.com with SMTP id k43so83030668uaf.3; Wed, 26 Jul 2017 08:39:00 -0700 (PDT) X-Received: by 10.31.13.78 with SMTP id 75mr775435vkn.121.1501083540311; Wed, 26 Jul 2017 08:39:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.32.75 with HTTP; Wed, 26 Jul 2017 08:38:59 -0700 (PDT) In-Reply-To: <20170726152313.GF1700@kib.kiev.ua> References: <201705191304.v4JD45Sn021851@repo.freebsd.org> <20170726152313.GF1700@kib.kiev.ua> From: Michael Zhilin Date: Wed, 26 Jul 2017 18:38:59 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r318539 - head/lib/libthr/thread To: Konstantin Belousov Cc: Eric van Gyzen , 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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 16:08:46 -0000 Konstantin, Thank you for quick reply. Here is review request to revert field change: https://reviews.freebsd.org/D11738 Thanks! On Wed, Jul 26, 2017 at 6:23 PM, Konstantin Belousov wrote: > On Wed, Jul 26, 2017 at 06:09:00PM +0300, Michael Zhilin wrote: > > Hi Eric, Konstantin, > > > > This commit breaks libthread_db a bit, particular change is: > > -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > > +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > > > > In libthread_db there is check if _thread_keytable is found in symbols of > > debugged process: > > https://svnweb.freebsd.org/base/head/lib/libthread_db/ > libthr_db.c?revision=241720&view=markup#l148 > > > > LOOKUP_SYM(ph, "_thread_keytable", &ta->thread_keytable_addr); > > > > If symbol is not found, pt_ta_new returns "TD_NOLIBTHREAD", even if > process > > uses libthr. > > It impacts sysutils/pstack port, it doesn't work for multithreaded > > processes anymore. > > > > Eric, Konstantin, > > Could you please advise what is best way to fix it: > > > > - rollback change of "_thread_keytable" (it looks easy) > > - or remove "_thread_keytable" from libthread_db > > > > ? > > The td_ta_tsd_iter() API implementation for libthr depends on the ability > to lookup the symbol. I think that the change should be reverted, it is > easiest solution. > > Perhaps a comment should be added noting that the symbol is used by > libthread_db so that the mistake is not repeated. > From owner-svn-src-head@freebsd.org Wed Jul 26 17:39:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9F7DAB7BF; Wed, 26 Jul 2017 17:39:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB6536E652; Wed, 26 Jul 2017 17:39:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QHdBYp099181; Wed, 26 Jul 2017 17:39:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QHdBJ3099180; Wed, 26 Jul 2017 17:39:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707261739.v6QHdBJ3099180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Jul 2017 17:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321571 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 321571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 17:39:12 -0000 Author: andrew Date: Wed Jul 26 17:39:10 2017 New Revision: 321571 URL: https://svnweb.freebsd.org/changeset/base/321571 Log: Pass the last exception trap frame to kdb_trap. This allows show registers in ddb to show the traps registers, and not the registers from within the panic call. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Jul 26 17:38:29 2017 (r321570) +++ head/sys/arm64/arm64/trap.c Wed Jul 26 17:39:10 2017 (r321571) @@ -265,6 +265,7 @@ print_registers(struct trapframe *frame) void do_el1h_sync(struct thread *td, struct trapframe *frame) { + struct trapframe *oframe; uint32_t exception; uint64_t esr, far; @@ -281,6 +282,18 @@ do_el1h_sync(struct thread *td, struct trapframe *fram "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); + oframe = td->td_frame; + + switch (exception) { + case EXCP_BRK: + case EXCP_WATCHPT_EL1: + case EXCP_SOFTSTP_EL1: + break; + default: + td->td_frame = frame; + break; + } + switch(exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: @@ -313,7 +326,8 @@ do_el1h_sync(struct thread *td, struct trapframe *fram case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB - kdb_trap(exception, 0, frame); + kdb_trap(exception, 0, + (td->td_frame != NULL) ? td->td_frame : frame); #else panic("No debugger in kernel.\n"); #endif @@ -323,6 +337,8 @@ do_el1h_sync(struct thread *td, struct trapframe *fram panic("Unknown kernel exception %x esr_el1 %lx\n", exception, esr); } + + td->td_frame = oframe; } /* From owner-svn-src-head@freebsd.org Wed Jul 26 20:01:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE170DAF199; Wed, 26 Jul 2017 20:01:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB38E74B07; Wed, 26 Jul 2017 20:01:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QK1VJX062070; Wed, 26 Jul 2017 20:01:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QK1VOI062069; Wed, 26 Jul 2017 20:01:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707262001.v6QK1VOI062069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 26 Jul 2017 20:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321580 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 321580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 20:01:33 -0000 Author: kib Date: Wed Jul 26 20:01:31 2017 New Revision: 321580 URL: https://svnweb.freebsd.org/changeset/base/321580 Log: Move rtvals initialization out of the region protected by NFS node lock. Noted by: alc Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D11697 Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 26 19:01:15 2017 (r321579) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 26 20:01:31 2017 (r321580) @@ -306,10 +306,6 @@ ncl_putpages(struct vop_putpages_args *ap) printf("ncl_putpages: called on noncache-able vnode\n"); mtx_lock(&np->n_mtx); } - - for (i = 0; i < npages; i++) - rtvals[i] = VM_PAGER_ERROR; - /* * When putting pages, do not extend file past EOF. */ @@ -319,6 +315,9 @@ ncl_putpages(struct vop_putpages_args *ap) count = 0; } mtx_unlock(&np->n_mtx); + + for (i = 0; i < npages; i++) + rtvals[i] = VM_PAGER_ERROR; VM_CNT_INC(v_vnodeout); VM_CNT_ADD(v_vnodepgsout, count); From owner-svn-src-head@freebsd.org Wed Jul 26 20:07:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C12DAF27C; Wed, 26 Jul 2017 20:07:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3E8374E96; Wed, 26 Jul 2017 20:07:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QK75mQ062955; Wed, 26 Jul 2017 20:07:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QK752X062951; Wed, 26 Jul 2017 20:07:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707262007.v6QK752X062951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 26 Jul 2017 20:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321581 - in head/sys: fs/nfsclient fs/smbfs vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: fs/nfsclient fs/smbfs vm X-SVN-Commit-Revision: 321581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 20:07:07 -0000 Author: kib Date: Wed Jul 26 20:07:05 2017 New Revision: 321581 URL: https://svnweb.freebsd.org/changeset/base/321581 Log: Mark pages after EOF as clean after pageout. Suppose that a file on NFS has partially filled last page, and this page is dirty. NFS VOP_PAGEOUT() method only marks the the page clean up to the block of the last written byte, leaving other blocks dirty. Also any page which erronously exists in the vnode vm_object past EOF is also left marked as dirty. With the introduction of the buf-cache coherent pager, each pass of syncer over the object with such page results in creation of B_DELWRI buffer due to VOP_WRITE() call. This buffer is noted on next syncer pass, which results e.g. a visible manifestation of shutdown never finishing vnode sync. Note that before buf-cache coherency commit, a dirty page might left never synced to server if a partial writes occur. Fix this by clearing dirty bits after EOF. Only blocks of the partial page which are completely after EOF are marked clean, to avoid possible user data loss. Reported by: mav Reviewed by: alc, markj Tested by: mav, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11697 Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/smbfs/smbfs_io.c head/sys/vm/vnode_pager.c head/sys/vm/vnode_pager.h Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 26 20:01:31 2017 (r321580) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Jul 26 20:07:05 2017 (r321581) @@ -336,8 +336,10 @@ ncl_putpages(struct vop_putpages_args *ap) cred); crfree(cred); - if (error == 0 || !nfs_keep_dirty_on_error) - vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid); + if (error == 0 || !nfs_keep_dirty_on_error) { + vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, + np->n_size - offset, npages * PAGE_SIZE); + } return (rtvals[0]); } Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Wed Jul 26 20:01:31 2017 (r321580) +++ head/sys/fs/smbfs/smbfs_io.c Wed Jul 26 20:07:05 2017 (r321581) @@ -621,9 +621,11 @@ smbfs_putpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - if (!error) - vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid); - return rtvals[0]; + if (error == 0) { + vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, + npages * PAGE_SIZE, npages * PAGE_SIZE); + } + return (rtvals[0]); #endif /* SMBFS_RWGENERIC */ } Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed Jul 26 20:01:31 2017 (r321580) +++ head/sys/vm/vnode_pager.c Wed Jul 26 20:07:05 2017 (r321581) @@ -1315,13 +1315,24 @@ vnode_pager_putpages_ioflags(int pager_flags) return (ioflags); } +/* + * vnode_pager_undirty_pages(). + * + * A helper to mark pages as clean after pageout that was possibly + * done with a short write. The lpos argument specifies the page run + * length in bytes, and the written argument specifies how many bytes + * were actually written. eof is the offset past the last valid byte + * in the vnode using the absolute file position of the first byte in + * the run as the base from which it is computed. + */ void -vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written) +vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written, off_t eof, + int lpos) { vm_object_t obj; - int i, pos; + int i, pos, pos_devb; - if (written == 0) + if (written == 0 && eof >= lpos) return; obj = ma[0]->object; VM_OBJECT_WLOCK(obj); @@ -1335,6 +1346,37 @@ vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, vm_page_clear_dirty(ma[i], 0, written & PAGE_MASK); } } + if (eof >= lpos) /* avoid truncation */ + goto done; + for (pos = eof, i = OFF_TO_IDX(trunc_page(pos)); pos < lpos; i++) { + if (pos != trunc_page(pos)) { + /* + * The page contains the last valid byte in + * the vnode, mark the rest of the page as + * clean, potentially making the whole page + * clean. + */ + pos_devb = roundup2(pos & PAGE_MASK, DEV_BSIZE); + vm_page_clear_dirty(ma[i], pos_devb, PAGE_SIZE - + pos_devb); + + /* + * If the page was cleaned, report the pageout + * on it as successful. msync() no longer + * needs to write out the page, endlessly + * creating write requests and dirty buffers. + */ + if (ma[i]->dirty == 0) + rtvals[i] = VM_PAGER_OK; + + pos = round_page(pos); + } else { + /* vm_pageout_flush() clears dirty */ + rtvals[i] = VM_PAGER_BAD; + pos += PAGE_SIZE; + } + } +done: VM_OBJECT_WUNLOCK(obj); } Modified: head/sys/vm/vnode_pager.h ============================================================================== --- head/sys/vm/vnode_pager.h Wed Jul 26 20:01:31 2017 (r321580) +++ head/sys/vm/vnode_pager.h Wed Jul 26 20:07:05 2017 (r321581) @@ -50,7 +50,8 @@ int vnode_pager_local_getpages_async(struct vop_getpag int vnode_pager_putpages_ioflags(int pager_flags); void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); -void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written); +void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written, + off_t eof, int lpos); void vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); From owner-svn-src-head@freebsd.org Wed Jul 26 20:20:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C605CDAF6C2; Wed, 26 Jul 2017 20:20:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 908BF7575D; Wed, 26 Jul 2017 20:20:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QKKwum067705; Wed, 26 Jul 2017 20:20:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QKKwgj067702; Wed, 26 Jul 2017 20:20:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707262020.v6QKKwgj067702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 26 Jul 2017 20:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321582 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 321582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 20:20:59 -0000 Author: np Date: Wed Jul 26 20:20:58 2017 New Revision: 321582 URL: https://svnweb.freebsd.org/changeset/base/321582 Log: cxgbe(4): Some updates to the common code. - Updated register ranges. - Helper routines for access to TP registers. - Updated routine to read flash parameters. Obtained from: Chelsio Communications MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Jul 26 20:07:05 2017 (r321581) +++ head/sys/dev/cxgbe/common/common.h Wed Jul 26 20:20:58 2017 (r321582) @@ -587,7 +587,7 @@ int t4_prep_adapter(struct adapter *adapter, u8 *buf); int t4_shutdown_adapter(struct adapter *adapter); int t4_init_devlog_params(struct adapter *adapter, int fw_attach); int t4_init_sge_params(struct adapter *adapter); -int t4_init_tp_params(struct adapter *adap); +int t4_init_tp_params(struct adapter *adap, bool sleep_ok); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); void t4_fatal_err(struct adapter *adapter); @@ -605,20 +605,21 @@ int t4_config_vi_rss(struct adapter *adapter, int mbox unsigned int flags, unsigned int defq, unsigned int skeyidx, unsigned int skey); int t4_read_rss(struct adapter *adapter, u16 *entries); -void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, - unsigned int start_index, unsigned int rw); -void t4_read_rss_key(struct adapter *adapter, u32 *key); -void t4_write_rss_key(struct adapter *adap, u32 *key, int idx); -void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, u32 *valp); -void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, u32 val); +void t4_read_rss_key(struct adapter *adapter, u32 *key, bool sleep_ok); +void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx, + bool sleep_ok); +void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 *valp, bool sleep_ok); +void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 val, bool sleep_ok); void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 *vfl, u32 *vfh); + u32 *vfl, u32 *vfh, bool sleep_ok); void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 vfl, u32 vfh); -u32 t4_read_rss_pf_map(struct adapter *adapter); -void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap); -u32 t4_read_rss_pf_mask(struct adapter *adapter); -void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask); + u32 vfl, u32 vfh, bool sleep_ok); +u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok); +u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok); int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); @@ -664,19 +665,24 @@ void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]); void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]); void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps, - unsigned int *ipg); + unsigned int *ipg, bool sleep_ok); void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr, unsigned int mask, unsigned int val); void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr); -void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st); -void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st); -void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st); -void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st); -void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st); +void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st, + bool sleep_ok); +void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st, + bool sleep_ok); +void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st, + bool sleep_ok); +void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st, + bool sleep_ok); +void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st, + bool sleep_ok); void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, - struct tp_tcp_stats *v6); + struct tp_tcp_stats *v6, bool sleep_ok); void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, - struct tp_fcoe_stats *st); + struct tp_fcoe_stats *st, bool sleep_ok); void t4_load_mtus(struct adapter *adap, const unsigned short *mtus, const unsigned short *alpha, const unsigned short *beta); @@ -687,7 +693,8 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals, unsigned int start, unsigned int n); void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate); -int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map); +int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map, + bool sleep_ok); void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid); void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr); @@ -801,6 +808,15 @@ int t4_config_watchdog(struct adapter *adapter, unsign int t4_get_devlog_level(struct adapter *adapter, unsigned int *level); int t4_set_devlog_level(struct adapter *adapter, unsigned int level); void t4_sge_decode_idma_state(struct adapter *adapter, int state); + +void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); static inline int t4vf_query_params(struct adapter *adapter, unsigned int nparams, const u32 *params, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Jul 26 20:07:05 2017 (r321581) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Jul 26 20:20:58 2017 (r321582) @@ -469,7 +469,7 @@ static int t4_edc_err_read(struct adapter *adap, int i CH_WARN(adap, "%s: T4 NOT supported.\n", __func__); return 0; } - if (idx != 0 && idx != 1) { + if (idx != MEM_EDC0 && idx != MEM_EDC1) { CH_WARN(adap, "%s: idx %d NOT supported.\n", __func__, idx); return 0; } @@ -886,7 +886,8 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0xd010, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0xea7c, - 0xf000, 0x11190, + 0xf000, 0x11110, + 0x11118, 0x11190, 0x19040, 0x1906c, 0x19078, 0x19080, 0x1908c, 0x190e4, @@ -1424,8 +1425,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, 0x30100, 0x30144, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -1536,8 +1535,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c3c, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, 0x34100, 0x34144, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -1648,8 +1645,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x37c3c, 0x37c50, 0x37cf0, 0x37cfc, 0x38000, 0x38030, - 0x38038, 0x38038, - 0x38040, 0x38040, 0x38100, 0x38144, 0x38190, 0x381a0, 0x381a8, 0x381b8, @@ -1760,8 +1755,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x3bc3c, 0x3bc50, 0x3bcf0, 0x3bcfc, 0x3c000, 0x3c030, - 0x3c038, 0x3c038, - 0x3c040, 0x3c040, 0x3c100, 0x3c144, 0x3c190, 0x3c1a0, 0x3c1a8, 0x3c1b8, @@ -2254,13 +2247,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, - 0x30048, 0x30048, - 0x30050, 0x30050, - 0x3005c, 0x30060, - 0x30068, 0x30068, - 0x30070, 0x30070, 0x30100, 0x30168, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -2323,13 +2309,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x326a8, 0x326a8, 0x326ec, 0x326ec, 0x32a00, 0x32abc, - 0x32b00, 0x32b38, + 0x32b00, 0x32b18, + 0x32b20, 0x32b38, 0x32b40, 0x32b58, 0x32b60, 0x32b78, 0x32c00, 0x32c00, 0x32c08, 0x32c3c, - 0x32e00, 0x32e2c, - 0x32f00, 0x32f2c, 0x33000, 0x3302c, 0x33034, 0x33050, 0x33058, 0x33058, @@ -2394,13 +2379,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c38, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, - 0x34048, 0x34048, - 0x34050, 0x34050, - 0x3405c, 0x34060, - 0x34068, 0x34068, - 0x34070, 0x34070, 0x34100, 0x34168, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -2463,13 +2441,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x366a8, 0x366a8, 0x366ec, 0x366ec, 0x36a00, 0x36abc, - 0x36b00, 0x36b38, + 0x36b00, 0x36b18, + 0x36b20, 0x36b38, 0x36b40, 0x36b58, 0x36b60, 0x36b78, 0x36c00, 0x36c00, 0x36c08, 0x36c3c, - 0x36e00, 0x36e2c, - 0x36f00, 0x36f2c, 0x37000, 0x3702c, 0x37034, 0x37050, 0x37058, 0x37058, @@ -2700,6 +2677,7 @@ struct t4_vpd_hdr { #define EEPROM_MAX_POLL 5000 /* x 5000 == 50ms */ #define EEPROM_STAT_ADDR 0x7bfc +#define VPD_SIZE 0x800 #define VPD_BASE 0x400 #define VPD_BASE_OLD 0 #define VPD_LEN 1024 @@ -3040,13 +3018,13 @@ enum { SF_ATTEMPTS = 10, /* max retries for SF operations */ /* flash command opcodes */ - SF_PROG_PAGE = 2, /* program page */ + SF_PROG_PAGE = 2, /* program 256B page */ SF_WR_DISABLE = 4, /* disable writes */ SF_RD_STATUS = 5, /* read status register */ SF_WR_ENABLE = 6, /* enable writes */ SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ - SF_ERASE_SECTOR = 0xd8, /* erase sector */ + SF_ERASE_SECTOR = 0xd8, /* erase 64KB sector */ }; /** @@ -3994,6 +3972,9 @@ static void sge_intr_handler(struct adapter *adapter) "SGE too many priority ingress contexts", -1, 0 }, { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID", -1, 0 }, { F_EGRESS_SIZE_ERR, "SGE illegal egress QID", -1, 0 }, + { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1 | + F_ERR_PCIE_ERROR2 | F_ERR_PCIE_ERROR3, + "SGE PCIe error for a DBP thread", -1, 0 }, { 0 } }; @@ -4009,8 +3990,6 @@ static void sge_intr_handler(struct adapter *adapter) * For now, treat below interrupts as fatal so that we disable SGE and * get better debug */ static const struct intr_info t6_sge_intr_info[] = { - { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1, - "SGE PCIe error for a DBP thread", -1, 1 }, { F_FATAL_WRE_LEN, "SGE Actual WRE packet is less than advertized length", -1, 1 }, @@ -4065,6 +4044,7 @@ static void cim_intr_handler(struct adapter *adapter) { F_MBHOSTPARERR, "CIM mailbox host parity error", -1, 1 }, { F_TIEQINPARERRINT, "CIM TIEQ outgoing parity error", -1, 1 }, { F_TIEQOUTPARERRINT, "CIM TIEQ incoming parity error", -1, 1 }, + { F_TIMER0INT, "CIM TIMER0 interrupt", -1, 1 }, { 0 } }; static const struct intr_info cim_upintr_info[] = { @@ -4098,11 +4078,26 @@ static void cim_intr_handler(struct adapter *adapter) { F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 }, { 0 } }; + u32 val, fw_err; int fat; - if (t4_read_reg(adapter, A_PCIE_FW) & F_PCIE_FW_ERR) + fw_err = t4_read_reg(adapter, A_PCIE_FW); + if (fw_err & F_PCIE_FW_ERR) t4_report_fw_error(adapter); + /* When the Firmware detects an internal error which normally wouldn't + * raise a Host Interrupt, it forces a CIM Timer0 interrupt in order + * to make sure the Host sees the Firmware Crash. So if we have a + * Timer0 interrupt and don't see a Firmware Crash, ignore the Timer0 + * interrupt. + */ + val = t4_read_reg(adapter, A_CIM_HOST_INT_CAUSE); + if (val & F_TIMER0INT) + if (!(fw_err & F_PCIE_FW_ERR) || + (G_PCIE_FW_EVAL(fw_err) != PCIE_FW_EVAL_CRASH)) + t4_write_reg(adapter, A_CIM_HOST_INT_CAUSE, + F_TIMER0INT); + fat = t4_handle_intr_status(adapter, A_CIM_HOST_INT_CAUSE, cim_intr_info) + t4_handle_intr_status(adapter, A_CIM_HOST_UPACC_INT_CAUSE, @@ -4850,55 +4845,177 @@ int t4_read_rss(struct adapter *adapter, u16 *map) } /** - * t4_fw_tp_pio_rw - Access TP PIO through LDST - * @adap: the adapter - * @vals: where the indirect register values are stored/written - * @nregs: how many indirect registers to read/write - * @start_idx: index of first indirect register to read/write - * @rw: Read (1) or Write (0) + * t4_tp_fw_ldst_rw - Access TP indirect register through LDST + * @adap: the adapter + * @cmd: TP fw ldst address space type + * @vals: where the indirect register values are stored/written + * @nregs: how many indirect registers to read/write + * @start_idx: index of first indirect register to read/write + * @rw: Read (1) or Write (0) + * @sleep_ok: if true we may sleep while awaiting command completion * - * Access TP PIO registers through LDST - */ -void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, - unsigned int start_index, unsigned int rw) + * Access TP indirect registers through LDST + **/ +static int t4_tp_fw_ldst_rw(struct adapter *adap, int cmd, u32 *vals, + unsigned int nregs, unsigned int start_index, + unsigned int rw, bool sleep_ok) { - int ret, i; - int cmd = FW_LDST_ADDRSPC_TP_PIO; + int ret = 0; + unsigned int i; struct fw_ldst_cmd c; - for (i = 0 ; i < nregs; i++) { + for (i = 0; i < nregs; i++) { memset(&c, 0, sizeof(c)); c.op_to_addrspace = cpu_to_be32(V_FW_CMD_OP(FW_LDST_CMD) | F_FW_CMD_REQUEST | (rw ? F_FW_CMD_READ : - F_FW_CMD_WRITE) | + F_FW_CMD_WRITE) | V_FW_LDST_CMD_ADDRSPACE(cmd)); c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); c.u.addrval.addr = cpu_to_be32(start_index + i); c.u.addrval.val = rw ? 0 : cpu_to_be32(vals[i]); - ret = t4_wr_mbox(adap, adap->mbox, &c, sizeof(c), &c); - if (ret == 0) { - if (rw) - vals[i] = be32_to_cpu(c.u.addrval.val); - } + ret = t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, + sleep_ok); + if (ret) + return ret; + + if (rw) + vals[i] = be32_to_cpu(c.u.addrval.val); } + return 0; } /** + * t4_tp_indirect_rw - Read/Write TP indirect register through LDST or backdoor + * @adap: the adapter + * @reg_addr: Address Register + * @reg_data: Data register + * @buff: where the indirect register values are stored/written + * @nregs: how many indirect registers to read/write + * @start_index: index of first indirect register to read/write + * @rw: READ(1) or WRITE(0) + * @sleep_ok: if true we may sleep while awaiting command completion + * + * Read/Write TP indirect registers through LDST if possible. + * Else, use backdoor access + **/ +static void t4_tp_indirect_rw(struct adapter *adap, u32 reg_addr, u32 reg_data, + u32 *buff, u32 nregs, u32 start_index, int rw, + bool sleep_ok) +{ + int rc = -EINVAL; + int cmd; + + switch (reg_addr) { + case A_TP_PIO_ADDR: + cmd = FW_LDST_ADDRSPC_TP_PIO; + break; + case A_TP_TM_PIO_ADDR: + cmd = FW_LDST_ADDRSPC_TP_TM_PIO; + break; + case A_TP_MIB_INDEX: + cmd = FW_LDST_ADDRSPC_TP_MIB; + break; + default: + goto indirect_access; + } + + if (t4_use_ldst(adap)) + rc = t4_tp_fw_ldst_rw(adap, cmd, buff, nregs, start_index, rw, + sleep_ok); + +indirect_access: + + if (rc) { + if (rw) + t4_read_indirect(adap, reg_addr, reg_data, buff, nregs, + start_index); + else + t4_write_indirect(adap, reg_addr, reg_data, buff, nregs, + start_index); + } +} + +/** + * t4_tp_pio_read - Read TP PIO registers + * @adap: the adapter + * @buff: where the indirect register values are written + * @nregs: how many indirect registers to read + * @start_index: index of first indirect register to read + * @sleep_ok: if true we may sleep while awaiting command completion + * + * Read TP PIO Registers + **/ +void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok) +{ + t4_tp_indirect_rw(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, buff, nregs, + start_index, 1, sleep_ok); +} + +/** + * t4_tp_pio_write - Write TP PIO registers + * @adap: the adapter + * @buff: where the indirect register values are stored + * @nregs: how many indirect registers to write + * @start_index: index of first indirect register to write + * @sleep_ok: if true we may sleep while awaiting command completion + * + * Write TP PIO Registers + **/ +void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok) +{ + t4_tp_indirect_rw(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + __DECONST(u32 *, buff), nregs, start_index, 0, sleep_ok); +} + +/** + * t4_tp_tm_pio_read - Read TP TM PIO registers + * @adap: the adapter + * @buff: where the indirect register values are written + * @nregs: how many indirect registers to read + * @start_index: index of first indirect register to read + * @sleep_ok: if true we may sleep while awaiting command completion + * + * Read TP TM PIO Registers + **/ +void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok) +{ + t4_tp_indirect_rw(adap, A_TP_TM_PIO_ADDR, A_TP_TM_PIO_DATA, buff, + nregs, start_index, 1, sleep_ok); +} + +/** + * t4_tp_mib_read - Read TP MIB registers + * @adap: the adapter + * @buff: where the indirect register values are written + * @nregs: how many indirect registers to read + * @start_index: index of first indirect register to read + * @sleep_ok: if true we may sleep while awaiting command completion + * + * Read TP MIB Registers + **/ +void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, + bool sleep_ok) +{ + t4_tp_indirect_rw(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, buff, nregs, + start_index, 1, sleep_ok); +} + +/** * t4_read_rss_key - read the global RSS key * @adap: the adapter * @key: 10-entry array holding the 320-bit RSS key + * @sleep_ok: if true we may sleep while awaiting command completion * * Reads the global 320-bit RSS key. */ -void t4_read_rss_key(struct adapter *adap, u32 *key) +void t4_read_rss_key(struct adapter *adap, u32 *key, bool sleep_ok) { - if (t4_use_ldst(adap)) - t4_fw_tp_pio_rw(adap, key, 10, A_TP_RSS_SECRET_KEY0, 1); - else - t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, key, 10, - A_TP_RSS_SECRET_KEY0); + t4_tp_pio_read(adap, key, 10, A_TP_RSS_SECRET_KEY0, sleep_ok); } /** @@ -4906,12 +5023,14 @@ void t4_read_rss_key(struct adapter *adap, u32 *key) * @adap: the adapter * @key: 10-entry array holding the 320-bit RSS key * @idx: which RSS key to write + * @sleep_ok: if true we may sleep while awaiting command completion * * Writes one of the RSS keys with the given 320-bit value. If @idx is * 0..15 the corresponding entry in the RSS key table is written, * otherwise the global RSS key is written. */ -void t4_write_rss_key(struct adapter *adap, u32 *key, int idx) +void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx, + bool sleep_ok) { u8 rss_key_addr_cnt = 16; u32 vrt = t4_read_reg(adap, A_TP_RSS_CONFIG_VRT); @@ -4925,11 +5044,7 @@ void t4_write_rss_key(struct adapter *adap, u32 *key, (vrt & F_KEYEXTEND) && (G_KEYMODE(vrt) == 3)) rss_key_addr_cnt = 32; - if (t4_use_ldst(adap)) - t4_fw_tp_pio_rw(adap, key, 10, A_TP_RSS_SECRET_KEY0, 0); - else - t4_write_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, key, 10, - A_TP_RSS_SECRET_KEY0); + t4_tp_pio_write(adap, key, 10, A_TP_RSS_SECRET_KEY0, sleep_ok); if (idx >= 0 && idx < rss_key_addr_cnt) { if (rss_key_addr_cnt > 16) @@ -4947,19 +5062,15 @@ void t4_write_rss_key(struct adapter *adap, u32 *key, * @adapter: the adapter * @index: the entry in the PF RSS table to read * @valp: where to store the returned value + * @sleep_ok: if true we may sleep while awaiting command completion * * Reads the PF RSS Configuration Table at the specified index and returns * the value found there. */ void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, - u32 *valp) + u32 *valp, bool sleep_ok) { - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, valp, 1, - A_TP_RSS_PF0_CONFIG + index, 1); - else - t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - valp, 1, A_TP_RSS_PF0_CONFIG + index); + t4_tp_pio_read(adapter, valp, 1, A_TP_RSS_PF0_CONFIG + index, sleep_ok); } /** @@ -4967,19 +5078,16 @@ void t4_read_rss_pf_config(struct adapter *adapter, un * @adapter: the adapter * @index: the entry in the VF RSS table to read * @val: the value to store + * @sleep_ok: if true we may sleep while awaiting command completion * * Writes the PF RSS Configuration Table at the specified index with the * specified value. */ void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, - u32 val) + u32 val, bool sleep_ok) { - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, &val, 1, - A_TP_RSS_PF0_CONFIG + index, 0); - else - t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &val, 1, A_TP_RSS_PF0_CONFIG + index); + t4_tp_pio_write(adapter, &val, 1, A_TP_RSS_PF0_CONFIG + index, + sleep_ok); } /** @@ -4988,12 +5096,13 @@ void t4_write_rss_pf_config(struct adapter *adapter, u * @index: the entry in the VF RSS table to read * @vfl: where to store the returned VFL * @vfh: where to store the returned VFH + * @sleep_ok: if true we may sleep while awaiting command completion * * Reads the VF RSS Configuration Table at the specified index and returns * the (VFL, VFH) values found there. */ void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 *vfl, u32 *vfh) + u32 *vfl, u32 *vfh, bool sleep_ok) { u32 vrt, mask, data; @@ -5015,15 +5124,8 @@ void t4_read_rss_vf_config(struct adapter *adapter, un /* * Grab the VFL/VFH values ... */ - if (t4_use_ldst(adapter)) { - t4_fw_tp_pio_rw(adapter, vfl, 1, A_TP_RSS_VFL_CONFIG, 1); - t4_fw_tp_pio_rw(adapter, vfh, 1, A_TP_RSS_VFH_CONFIG, 1); - } else { - t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - vfl, 1, A_TP_RSS_VFL_CONFIG); - t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - vfh, 1, A_TP_RSS_VFH_CONFIG); - } + t4_tp_pio_read(adapter, vfl, 1, A_TP_RSS_VFL_CONFIG, sleep_ok); + t4_tp_pio_read(adapter, vfh, 1, A_TP_RSS_VFH_CONFIG, sleep_ok); } /** @@ -5038,7 +5140,7 @@ void t4_read_rss_vf_config(struct adapter *adapter, un * specified (VFL, VFH) values. */ void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 vfl, u32 vfh) + u32 vfl, u32 vfh, bool sleep_ok) { u32 vrt, mask, data; @@ -5053,15 +5155,8 @@ void t4_write_rss_vf_config(struct adapter *adapter, u /* * Load up VFL/VFH with the values to be written ... */ - if (t4_use_ldst(adapter)) { - t4_fw_tp_pio_rw(adapter, &vfl, 1, A_TP_RSS_VFL_CONFIG, 0); - t4_fw_tp_pio_rw(adapter, &vfh, 1, A_TP_RSS_VFH_CONFIG, 0); - } else { - t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &vfl, 1, A_TP_RSS_VFL_CONFIG); - t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &vfh, 1, A_TP_RSS_VFH_CONFIG); - } + t4_tp_pio_write(adapter, &vfl, 1, A_TP_RSS_VFL_CONFIG, sleep_ok); + t4_tp_pio_write(adapter, &vfh, 1, A_TP_RSS_VFH_CONFIG, sleep_ok); /* * Write the VFL/VFH into the VF Table at index'th location. @@ -5075,18 +5170,16 @@ void t4_write_rss_vf_config(struct adapter *adapter, u /** * t4_read_rss_pf_map - read PF RSS Map * @adapter: the adapter + * @sleep_ok: if true we may sleep while awaiting command completion * * Reads the PF RSS Map register and returns its value. */ -u32 t4_read_rss_pf_map(struct adapter *adapter) +u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok) { u32 pfmap; - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, 1); - else - t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &pfmap, 1, A_TP_RSS_PF_MAP); + t4_tp_pio_read(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, sleep_ok); + return pfmap; } @@ -5097,30 +5190,24 @@ u32 t4_read_rss_pf_map(struct adapter *adapter) * * Writes the specified value to the PF RSS Map register. */ -void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap) +void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok) { - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, 0); - else - t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &pfmap, 1, A_TP_RSS_PF_MAP); + t4_tp_pio_write(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, sleep_ok); } /** * t4_read_rss_pf_mask - read PF RSS Mask * @adapter: the adapter + * @sleep_ok: if true we may sleep while awaiting command completion * * Reads the PF RSS Mask register and returns its value. */ -u32 t4_read_rss_pf_mask(struct adapter *adapter) +u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok) { u32 pfmask; - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, 1); - else - t4_read_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &pfmask, 1, A_TP_RSS_PF_MSK); + t4_tp_pio_read(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, sleep_ok); + return pfmask; } @@ -5131,13 +5218,9 @@ u32 t4_read_rss_pf_mask(struct adapter *adapter) * * Writes the specified value to the PF RSS Mask register. */ -void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask) +void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok) { - if (t4_use_ldst(adapter)) - t4_fw_tp_pio_rw(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, 0); - else - t4_write_indirect(adapter, A_TP_PIO_ADDR, A_TP_PIO_DATA, - &pfmask, 1, A_TP_RSS_PF_MSK); + t4_tp_pio_write(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, sleep_ok); } /** @@ -5145,12 +5228,13 @@ void t4_write_rss_pf_mask(struct adapter *adapter, u32 * @adap: the adapter * @v4: holds the TCP/IP counter values * @v6: holds the TCP/IPv6 counter values + * @sleep_ok: if true we may sleep while awaiting command completion * * Returns the values of TP's TCP/IP and TCP/IPv6 MIB counters. * Either @v4 or @v6 may be %NULL to skip the corresponding stats. */ void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, - struct tp_tcp_stats *v6) + struct tp_tcp_stats *v6, bool sleep_ok) { u32 val[A_TP_MIB_TCP_RXT_SEG_LO - A_TP_MIB_TCP_OUT_RST + 1]; @@ -5159,16 +5243,16 @@ void t4_tp_get_tcp_stats(struct adapter *adap, struct #define STAT64(x) (((u64)STAT(x##_HI) << 32) | STAT(x##_LO)) if (v4) { - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, val, - ARRAY_SIZE(val), A_TP_MIB_TCP_OUT_RST); + t4_tp_mib_read(adap, val, ARRAY_SIZE(val), + A_TP_MIB_TCP_OUT_RST, sleep_ok); v4->tcp_out_rsts = STAT(OUT_RST); v4->tcp_in_segs = STAT64(IN_SEG); v4->tcp_out_segs = STAT64(OUT_SEG); v4->tcp_retrans_segs = STAT64(RXT_SEG); } if (v6) { - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, val, - ARRAY_SIZE(val), A_TP_MIB_TCP_V6OUT_RST); + t4_tp_mib_read(adap, val, ARRAY_SIZE(val), + A_TP_MIB_TCP_V6OUT_RST, sleep_ok); v6->tcp_out_rsts = STAT(OUT_RST); v6->tcp_in_segs = STAT64(IN_SEG); v6->tcp_out_segs = STAT64(OUT_SEG); @@ -5183,32 +5267,41 @@ void t4_tp_get_tcp_stats(struct adapter *adap, struct * t4_tp_get_err_stats - read TP's error MIB counters * @adap: the adapter * @st: holds the counter values + * @sleep_ok: if true we may sleep while awaiting command completion * * Returns the values of TP's error counters. */ -void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st) +void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st, + bool sleep_ok) { int nchan = adap->chip_params->nchan; - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->mac_in_errs, nchan, A_TP_MIB_MAC_IN_ERR_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->hdr_in_errs, nchan, A_TP_MIB_HDR_IN_ERR_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->tcp_in_errs, nchan, A_TP_MIB_TCP_IN_ERR_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->tnl_cong_drops, nchan, A_TP_MIB_TNL_CNG_DROP_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->ofld_chan_drops, nchan, A_TP_MIB_OFD_CHN_DROP_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->tnl_tx_drops, nchan, A_TP_MIB_TNL_DROP_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->ofld_vlan_drops, nchan, A_TP_MIB_OFD_VLN_DROP_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - st->tcp6_in_errs, nchan, A_TP_MIB_TCP_V6IN_ERR_0); + t4_tp_mib_read(adap, st->mac_in_errs, nchan, A_TP_MIB_MAC_IN_ERR_0, + sleep_ok); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, - &st->ofld_no_neigh, 2, A_TP_MIB_OFD_ARP_DROP); + t4_tp_mib_read(adap, st->hdr_in_errs, nchan, A_TP_MIB_HDR_IN_ERR_0, + sleep_ok); + + t4_tp_mib_read(adap, st->tcp_in_errs, nchan, A_TP_MIB_TCP_IN_ERR_0, + sleep_ok); + + t4_tp_mib_read(adap, st->tnl_cong_drops, nchan, + A_TP_MIB_TNL_CNG_DROP_0, sleep_ok); + + t4_tp_mib_read(adap, st->ofld_chan_drops, nchan, + A_TP_MIB_OFD_CHN_DROP_0, sleep_ok); + + t4_tp_mib_read(adap, st->tnl_tx_drops, nchan, A_TP_MIB_TNL_DROP_0, + sleep_ok); + + t4_tp_mib_read(adap, st->ofld_vlan_drops, nchan, + A_TP_MIB_OFD_VLN_DROP_0, sleep_ok); + + t4_tp_mib_read(adap, st->tcp6_in_errs, nchan, + A_TP_MIB_TCP_V6IN_ERR_0, sleep_ok); + + t4_tp_mib_read(adap, &st->ofld_no_neigh, 2, A_TP_MIB_OFD_ARP_DROP, + sleep_ok); } /** @@ -5218,29 +5311,30 @@ void t4_tp_get_err_stats(struct adapter *adap, struct * * Returns the values of TP's proxy counters. */ -void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st) +void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st, + bool sleep_ok) { int nchan = adap->chip_params->nchan; - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, st->proxy, - nchan, A_TP_MIB_TNL_LPBK_0); + t4_tp_mib_read(adap, st->proxy, nchan, A_TP_MIB_TNL_LPBK_0, sleep_ok); } /** * t4_tp_get_cpl_stats - read TP's CPL MIB counters * @adap: the adapter * @st: holds the counter values + * @sleep_ok: if true we may sleep while awaiting command completion * * Returns the values of TP's CPL counters. */ -void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st) +void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st, + bool sleep_ok) { int nchan = adap->chip_params->nchan; - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, st->req, - nchan, A_TP_MIB_CPL_IN_REQ_0); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, st->rsp, - nchan, A_TP_MIB_CPL_OUT_RSP_0); + t4_tp_mib_read(adap, st->req, nchan, A_TP_MIB_CPL_IN_REQ_0, sleep_ok); + + t4_tp_mib_read(adap, st->rsp, nchan, A_TP_MIB_CPL_OUT_RSP_0, sleep_ok); } /** @@ -5250,10 +5344,11 @@ void t4_tp_get_cpl_stats(struct adapter *adap, struct * * Returns the values of TP's RDMA counters. */ -void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st) +void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st, + bool sleep_ok) { - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, &st->rqe_dfr_pkt, - 2, A_TP_MIB_RQE_DFR_PKT); + t4_tp_mib_read(adap, &st->rqe_dfr_pkt, 2, A_TP_MIB_RQE_DFR_PKT, + sleep_ok); } /** @@ -5261,20 +5356,24 @@ void t4_tp_get_rdma_stats(struct adapter *adap, struct * @adap: the adapter * @idx: the port index * @st: holds the counter values + * @sleep_ok: if true we may sleep while awaiting command completion * * Returns the values of TP's FCoE counters for the selected port. */ void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, - struct tp_fcoe_stats *st) + struct tp_fcoe_stats *st, bool sleep_ok) { u32 val[2]; - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, &st->frames_ddp, - 1, A_TP_MIB_FCOE_DDP_0 + idx); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, &st->frames_drop, - 1, A_TP_MIB_FCOE_DROP_0 + idx); - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, val, - 2, A_TP_MIB_FCOE_BYTE_0_HI + 2 * idx); + t4_tp_mib_read(adap, &st->frames_ddp, 1, A_TP_MIB_FCOE_DDP_0 + idx, + sleep_ok); + + t4_tp_mib_read(adap, &st->frames_drop, 1, + A_TP_MIB_FCOE_DROP_0 + idx, sleep_ok); + + t4_tp_mib_read(adap, val, 2, A_TP_MIB_FCOE_BYTE_0_HI + 2 * idx, + sleep_ok); + st->octets_ddp = ((u64)val[0] << 32) | val[1]; } @@ -5282,15 +5381,17 @@ void t4_get_fcoe_stats(struct adapter *adap, unsigned * t4_get_usm_stats - read TP's non-TCP DDP MIB counters * @adap: the adapter * @st: holds the counter values + * @sleep_ok: if true we may sleep while awaiting command completion * * Returns the values of TP's counters for non-TCP directly-placed packets. */ -void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st) +void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st, + bool sleep_ok) { u32 val[4]; - t4_read_indirect(adap, A_TP_MIB_INDEX, A_TP_MIB_DATA, val, 4, - A_TP_MIB_USM_PKTS); + t4_tp_mib_read(adap, val, 4, A_TP_MIB_USM_PKTS, sleep_ok); + st->frames = val[0]; st->drops = val[1]; st->octets = ((u64)val[2] << 32) | val[3]; @@ -5869,7 +5970,7 @@ void t4_get_port_stats_offset(struct adapter *adap, in void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) { u32 bgmap = t4_get_mps_bg_map(adap, idx); - u32 stat_ctl; + u32 stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); #define GET_STAT(name) \ t4_read_reg64(adap, \ @@ -5877,8 +5978,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, T5_PORT_REG(idx, A_MPS_PORT_STAT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) - stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); - p->tx_pause = GET_STAT(TX_PORT_PAUSE); p->tx_octets = GET_STAT(TX_PORT_BYTES); p->tx_frames = GET_STAT(TX_PORT_FRAMES); @@ -7676,51 +7775,120 @@ struct flash_desc { int t4_get_flash_params(struct adapter *adapter) { /* - * Table for non-Numonix supported flash parts. Numonix parts are left - * to the preexisting well-tested code. All flash parts have 64KB - * sectors. + * Table for non-standard supported Flash parts. Note, all Flash + * parts must have 64KB sectors. */ static struct flash_desc supported_flash[] = { - { 0x150201, 4 << 20 }, /* Spansion 4MB S25FL032P */ + { 0x00150201, 4 << 20 }, /* Spansion 4MB S25FL032P */ }; int ret; - u32 info = 0; + u32 flashid = 0; + unsigned int part, manufacturer; + unsigned int density, size; + + /* + * Issue a Read ID Command to the Flash part. We decode supported + * Flash parts and their sizes from this. There's a newer Query + * Command which can retrieve detailed geometry information but many + * Flash parts don't support it. + */ ret = sf1_write(adapter, 1, 1, 0, SF_RD_ID); if (!ret) - ret = sf1_read(adapter, 3, 0, 1, &info); + ret = sf1_read(adapter, 3, 0, 1, &flashid); t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ if (ret < 0) return ret; - for (ret = 0; ret < ARRAY_SIZE(supported_flash); ++ret) - if (supported_flash[ret].vendor_and_model_id == info) { - adapter->params.sf_size = supported_flash[ret].size_mb; + /* + * Check to see if it's one of our non-standard supported Flash parts. + */ + for (part = 0; part < ARRAY_SIZE(supported_flash); part++) + if (supported_flash[part].vendor_and_model_id == flashid) { + adapter->params.sf_size = + supported_flash[part].size_mb; adapter->params.sf_nsec = adapter->params.sf_size / SF_SEC_SIZE; - return 0; + goto found; } - if ((info & 0xff) != 0x20) /* not a Numonix flash */ + /* + * Decode Flash part size. The code below looks repetative with + * common encodings, but that's not guaranteed in the JEDEC + * specification for the Read JADEC ID command. The only thing that + * we're guaranteed by the JADEC specification is where the + * Manufacturer ID is in the returned result. After that each + * Manufacturer ~could~ encode things completely differently. + * Note, all Flash parts must have 64KB sectors. + */ + manufacturer = flashid & 0xff; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jul 26 20:40:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C1BDDAFEBA; Wed, 26 Jul 2017 20:40:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63284761E9; Wed, 26 Jul 2017 20:40:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QKeOiN075762; Wed, 26 Jul 2017 20:40:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QKeOJl075760; Wed, 26 Jul 2017 20:40:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707262040.v6QKeOJl075760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jul 2017 20:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321583 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 20:40:25 -0000 Author: ian Date: Wed Jul 26 20:40:24 2017 New Revision: 321583 URL: https://svnweb.freebsd.org/changeset/base/321583 Log: Add a pair of convenience routines for doing simple "register" read/writes on i2c devices, where the "register" can be any length. Many (perhaps most) common i2c devices are organized as a collection of (usually 1-byte-wide) registers, and are accessed by first writing a 1-byte register index/offset number, then by reading or writing the data. Generally there is an auto-increment feature so the when multiple bytes are read or written, multiple contiguous registers are accessed. Most existing slave device drivers allocate an array of iic_msg structures, fill in all the transfer info, and invoke iicbus_transfer(). These new functions commonize all that and reduce register access to a simple call with a few arguments. Modified: head/sys/dev/iicbus/iiconf.c head/sys/dev/iicbus/iiconf.h Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Wed Jul 26 20:20:58 2017 (r321582) +++ head/sys/dev/iicbus/iiconf.c Wed Jul 26 20:40:24 2017 (r321583) @@ -470,3 +470,55 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs iicbus_stop(bus); return (error); } + +int +iicdev_readfrom(device_t slavedev, uint8_t regaddr, void *buffer, + uint16_t buflen, int waithow) +{ + struct iic_msg msgs[2]; + uint8_t slaveaddr; + + /* + * Two transfers back to back with a repeat-start between them; first we + * write the address-within-device, then we read from the device. + */ + slaveaddr = iicbus_get_addr(slavedev); + + msgs[0].slave = slaveaddr; + msgs[0].flags = IIC_M_WR | IIC_M_NOSTOP; + msgs[0].len = 1; + msgs[0].buf = ®addr; + + msgs[1].slave = slaveaddr; + msgs[1].flags = IIC_M_RD; + msgs[1].len = buflen; + msgs[1].buf = buffer; + + return (iicbus_transfer_excl(slavedev, msgs, nitems(msgs), waithow)); +} + +int iicdev_writeto(device_t slavedev, uint8_t regaddr, void *buffer, + uint16_t buflen, int waithow) +{ + struct iic_msg msgs[2]; + uint8_t slaveaddr; + + /* + * Two transfers back to back with no stop or start between them; first + * we write the address then we write the data to that address, all in a + * single transfer from two scattered buffers. + */ + slaveaddr = iicbus_get_addr(slavedev); + + msgs[0].slave = slaveaddr; + msgs[0].flags = IIC_M_WR | IIC_M_NOSTOP; + msgs[0].len = 1; + msgs[0].buf = ®addr; + + msgs[1].slave = slaveaddr; + msgs[1].flags = IIC_M_WR | IIC_M_NOSTART; + msgs[1].len = buflen; + msgs[1].buf = buffer; + + return (iicbus_transfer_excl(slavedev, msgs, nitems(msgs), waithow)); +} Modified: head/sys/dev/iicbus/iiconf.h ============================================================================== --- head/sys/dev/iicbus/iiconf.h Wed Jul 26 20:20:58 2017 (r321582) +++ head/sys/dev/iicbus/iiconf.h Wed Jul 26 20:40:24 2017 (r321583) @@ -133,6 +133,16 @@ int iicbus_transfer_excl(device_t bus, struct iic_msg int how); int iicbus_transfer_gen(device_t bus, struct iic_msg *msgs, uint32_t nmsgs); +/* + * Simple register read/write routines, but the "register" can be any size. + * The transfers are done with iicbus_transfer_excl(). Reads use a repeat-start + * between sending the address and reading; writes use a single start/stop. + */ +int iicdev_readfrom(device_t _slavedev, uint8_t _regaddr, void *_buffer, + uint16_t _buflen, int _waithow); +int iicdev_writeto(device_t _slavedev, uint8_t _regaddr, void *_buffer, + uint16_t _buflen, int _waithow); + #define IICBUS_MODVER 1 #define IICBUS_MINVER 1 #define IICBUS_MAXVER 1 From owner-svn-src-head@freebsd.org Wed Jul 26 21:06:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3914CDB04D4; Wed, 26 Jul 2017 21:06:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA9276D7E; Wed, 26 Jul 2017 21:06:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QL6RCt087704; Wed, 26 Jul 2017 21:06:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QL6RaR087702; Wed, 26 Jul 2017 21:06:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707262106.v6QL6RaR087702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jul 2017 21:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321584 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 21:06:28 -0000 Author: ian Date: Wed Jul 26 21:06:26 2017 New Revision: 321584 URL: https://svnweb.freebsd.org/changeset/base/321584 Log: Add support for tracking nested calls to iicbus_request/release_bus(). Usually it is sufficient to use iicbus_transfer_excl(), or one of the higher-level convenience functions that use it, to reserve the bus for the duration of each register access. Occasionally it is important that a series of accesses or read-modify-write operations must be done without any other intervening access to the device, to prevent corrupting state. Without support for nested request/release, slave device drivers would have to stop using high-level convenience functions and resort to working with arrays of iic_msg structs just for a few operations (often involving one-time device setup or infrequent configuration changes). The changes here appear large from a glance at the diff, but in fact they're nearly trivial, and the large diff is because of changes in indentation and the re-wrapping of comments caused by that. One notable change is that iicbus_release_bus() now ignores the IICBUS_CALLBACK(IIC_RELEASE_BUS) return value. The old error handling left the bus in a kind of limbo state where it was still owned at the iicbus layer, but drivers rarely check the return of the release call, and it's unclear what they would do to recover from an error return anyway. No existing low-level drivers return any kind of error from IIC_RELEASE_BUS except one EINVAL for "you don't own the bus", to which the right response is probably to carry on with the process of releasing the reference to the bus anyway. Modified: head/sys/dev/iicbus/iicbus.h head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Wed Jul 26 20:40:24 2017 (r321583) +++ head/sys/dev/iicbus/iicbus.h Wed Jul 26 21:06:26 2017 (r321584) @@ -39,6 +39,7 @@ struct iicbus_softc { device_t dev; /* Myself */ device_t owner; /* iicbus owner device structure */ + u_int owncount; /* iicbus ownership nesting count */ u_char started; /* address of the 'started' slave * 0 if no start condition succeeded */ u_char strict; /* deny operations that violate the Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Wed Jul 26 20:40:24 2017 (r321583) +++ head/sys/dev/iicbus/iiconf.c Wed Jul 26 21:06:26 2017 (r321584) @@ -113,26 +113,30 @@ iicbus_request_bus(device_t bus, device_t dev, int how IICBUS_LOCK(sc); - while ((error == 0) && (sc->owner != NULL)) + while (error == 0 && sc->owner != NULL && sc->owner != dev) error = iicbus_poll(sc, how); if (error == 0) { - sc->owner = dev; - /* - * Drop the lock around the call to the bus driver. - * This call should be allowed to sleep in the IIC_WAIT case. - * Drivers might also need to grab locks that would cause LOR - * if our lock is held. - */ - IICBUS_UNLOCK(sc); - /* Ask the underlying layers if the request is ok */ - error = IICBUS_CALLBACK(device_get_parent(bus), - IIC_REQUEST_BUS, (caddr_t)&how); - IICBUS_LOCK(sc); - - if (error != 0) { - sc->owner = NULL; - wakeup_one(sc); + ++sc->owncount; + if (sc->owner == NULL) { + sc->owner = dev; + /* + * Drop the lock around the call to the bus driver, it + * should be allowed to sleep in the IIC_WAIT case. + * Drivers might also need to grab locks that would + * cause a LOR if our lock is held. + */ + IICBUS_UNLOCK(sc); + /* Ask the underlying layers if the request is ok */ + error = IICBUS_CALLBACK(device_get_parent(bus), + IIC_REQUEST_BUS, (caddr_t)&how); + IICBUS_LOCK(sc); + + if (error != 0) { + sc->owner = NULL; + sc->owncount = 0; + wakeup_one(sc); + } } } @@ -150,7 +154,6 @@ int iicbus_release_bus(device_t bus, device_t dev) { struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); - int error; IICBUS_LOCK(sc); @@ -159,26 +162,16 @@ iicbus_release_bus(device_t bus, device_t dev) return (IIC_EBUSBSY); } - /* - * Drop the lock around the call to the bus driver. - * This call should be allowed to sleep in the IIC_WAIT case. - * Drivers might also need to grab locks that would cause LOR - * if our lock is held. - */ - IICBUS_UNLOCK(sc); - /* Ask the underlying layers if the release is ok */ - error = IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL); - - if (error == 0) { + if (--sc->owncount == 0) { + /* Drop the lock while informing the low-level driver. */ + IICBUS_UNLOCK(sc); + IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL); IICBUS_LOCK(sc); sc->owner = NULL; - - /* wakeup a waiting thread */ wakeup_one(sc); - IICBUS_UNLOCK(sc); } - - return (error); + IICBUS_UNLOCK(sc); + return (0); } /* From owner-svn-src-head@freebsd.org Wed Jul 26 21:20:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D1EBDB08A3; Wed, 26 Jul 2017 21:20:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED32F774AF; Wed, 26 Jul 2017 21:20:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QLKwGk092977; Wed, 26 Jul 2017 21:20:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QLKwZA092976; Wed, 26 Jul 2017 21:20:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707262120.v6QLKwZA092976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 26 Jul 2017 21:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321586 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 321586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 21:20:59 -0000 Author: ian Date: Wed Jul 26 21:20:57 2017 New Revision: 321586 URL: https://svnweb.freebsd.org/changeset/base/321586 Log: Add a debug sysctl that lets you see i2c bus traffic through this device. Modified: head/sys/arm/freescale/imx/imx_i2c.c Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Wed Jul 26 21:09:10 2017 (r321585) +++ head/sys/arm/freescale/imx/imx_i2c.c Wed Jul 26 21:20:57 2017 (r321586) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -138,8 +139,18 @@ struct i2c_softc { int rb_pinctl_idx; gpio_pin_t rb_sclpin; gpio_pin_t rb_sdapin; + u_int debug; + u_int slave; }; +#define DEVICE_DEBUGF(sc, lvl, fmt, args...) \ + if ((lvl) <= (sc)->debug) \ + device_printf((sc)->dev, fmt, ##args) + +#define DEBUGF(sc, lvl, fmt, args...) \ + if ((lvl) <= (sc)->debug) \ + printf(fmt, ##args) + static phandle_t i2c_get_node(device_t, device_t); static int i2c_probe(device_t); static int i2c_attach(device_t); @@ -383,6 +394,12 @@ i2c_attach(device_t dev) return (ENXIO); } + /* Set up debug-enable sysctl. */ + SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->debug, 0, + "Enable debug; 1=reads/writes, 2=add starts/stops"); + /* * Set up for bus recovery using gpio pins, if the pinctrl and gpio * properties are present. This is optional. If all the config data is @@ -450,6 +467,8 @@ i2c_repeated_start(device_t dev, u_char slave, int tim DELAY(1); i2c_write_reg(sc, I2C_STATUS_REG, 0x0); i2c_write_reg(sc, I2C_DATA_REG, slave); + sc->slave = slave; + DEVICE_DEBUGF(sc, 2, "rstart 0x%02x\n", sc->slave); error = wait_for_xfer(sc, true); return (i2c_error_handler(sc, error)); } @@ -472,6 +491,8 @@ i2c_start_ll(device_t dev, u_char slave, int timeout) return (i2c_error_handler(sc, error)); i2c_write_reg(sc, I2C_STATUS_REG, 0); i2c_write_reg(sc, I2C_DATA_REG, slave); + sc->slave = slave; + DEVICE_DEBUGF(sc, 2, "start 0x%02x\n", sc->slave); error = wait_for_xfer(sc, true); return (i2c_error_handler(sc, error)); } @@ -511,6 +532,7 @@ i2c_stop(device_t dev) i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); wait_for_busbusy(sc, false); i2c_write_reg(sc, I2C_CONTROL_REG, 0); + DEVICE_DEBUGF(sc, 2, "stop 0x%02x\n", sc->slave); return (IIC_NOERR); } @@ -522,6 +544,8 @@ i2c_reset(device_t dev, u_char speed, u_char addr, u_c sc = device_get_softc(dev); + DEVICE_DEBUGF(sc, 1, "reset\n"); + /* * Look up the divisor that gives the nearest speed that doesn't exceed * the configured value for the bus. @@ -567,6 +591,7 @@ i2c_read(device_t dev, char *buf, int len, int *read, sc = device_get_softc(dev); *read = 0; + DEVICE_DEBUGF(sc, 1, "read 0x%02x len %d: ", sc->slave, len); if (len) { if (len == 1) i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | @@ -598,9 +623,11 @@ i2c_read(device_t dev, char *buf, int len, int *read, } } reg = i2c_read_reg(sc, I2C_DATA_REG); + DEBUGF(sc, 1, "0x%02x ", reg); *buf++ = reg; (*read)++; } + DEBUGF(sc, 1, "\n"); return (i2c_error_handler(sc, error)); } @@ -615,13 +642,15 @@ i2c_write(device_t dev, const char *buf, int len, int error = 0; *sent = 0; + DEVICE_DEBUGF(sc, 1, "write 0x%02x len %d: ", sc->slave, len); while (*sent < len) { + DEBUGF(sc, 1, "0x%02x ", *buf); i2c_write_reg(sc, I2C_STATUS_REG, 0x0); i2c_write_reg(sc, I2C_DATA_REG, *buf++); if ((error = wait_for_xfer(sc, true)) != IIC_NOERR) break; (*sent)++; } - + DEBUGF(sc, 1, "\n"); return (i2c_error_handler(sc, error)); } From owner-svn-src-head@freebsd.org Wed Jul 26 21:23:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134BDDB0B1E; Wed, 26 Jul 2017 21:23:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6F51778B6; Wed, 26 Jul 2017 21:23:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QLN9dm096101; Wed, 26 Jul 2017 21:23:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QLN9Fu096100; Wed, 26 Jul 2017 21:23:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707262123.v6QLN9Fu096100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 26 Jul 2017 21:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321587 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 321587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 21:23:11 -0000 Author: emaste Date: Wed Jul 26 21:23:09 2017 New Revision: 321587 URL: https://svnweb.freebsd.org/changeset/base/321587 Log: cc_cubic: restore braces around if-condition block r307901 was reverted in r321480, restoring an incorrect block delimitation bug present in the original cc_cubic commit. Restore only the bugfix (brace addition) from r307901. CID: 1090182 Approved by: sbruno Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Wed Jul 26 21:20:57 2017 (r321586) +++ head/sys/netinet/cc/cc_cubic.c Wed Jul 26 21:23:09 2017 (r321587) @@ -261,9 +261,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) * chance the first one is a false alarm and may not indicate * congestion. */ - if (CCV(ccv, t_rxtshift) >= 2) + if (CCV(ccv, t_rxtshift) >= 2) { cubic_data->num_cong_events++; cubic_data->t_last_cong = ticks; + } break; } } From owner-svn-src-head@freebsd.org Wed Jul 26 21:59:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481A6DB19A7; Wed, 26 Jul 2017 21:59:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 179387CDA1; Wed, 26 Jul 2017 21:59:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QLxbOF008682; Wed, 26 Jul 2017 21:59:37 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QLxb6F008681; Wed, 26 Jul 2017 21:59:37 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707262159.v6QLxb6F008681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 26 Jul 2017 21:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321588 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 321588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 21:59:38 -0000 Author: marius Date: Wed Jul 26 21:59:37 2017 New Revision: 321588 URL: https://svnweb.freebsd.org/changeset/base/321588 Log: Correctly use the size of a pointer rather than that of a pointer to a pointer. Reported by: Coverity CID: 1378432 Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jul 26 21:23:09 2017 (r321587) +++ head/sys/dev/mmc/mmc.c Wed Jul 26 21:59:37 2017 (r321588) @@ -1892,7 +1892,7 @@ child_common: if (child != NULL) { device_set_ivars(child, ivar); sc->child_list = realloc(sc->child_list, - sizeof(device_t *) * sc->child_count + 1, + sizeof(device_t) * sc->child_count + 1, M_DEVBUF, M_WAITOK); sc->child_list[sc->child_count++] = child; } else @@ -1934,7 +1934,7 @@ mmc_update_child_list(struct mmc_softc *sc) if (i != j) sc->child_list[i] = child; } - sc->child_list = realloc(sc->child_list, sizeof(device_t *) * + sc->child_list = realloc(sc->child_list, sizeof(device_t) * sc->child_count, M_DEVBUF, M_WAITOK); } From owner-svn-src-head@freebsd.org Wed Jul 26 22:04:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DACCFDB1C74; Wed, 26 Jul 2017 22:04:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97F227D1E3; Wed, 26 Jul 2017 22:04:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QM4Nbn012614; Wed, 26 Jul 2017 22:04:23 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QM4Nto012610; Wed, 26 Jul 2017 22:04:23 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707262204.v6QM4Nto012610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 26 Jul 2017 22:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321589 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 321589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Jul 2017 22:04:25 -0000 Author: marius Date: Wed Jul 26 22:04:23 2017 New Revision: 321589 URL: https://svnweb.freebsd.org/changeset/base/321589 Log: - Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE} for embedded slots. Fail in the sdhci(4) initialization for slot type shared, which is completely unsupported by this driver at the moment. [1] For Intel eMMC controllers, taking the embedded slot type into account obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk entries. - Hide the 1.8 V VDD capability when the slot is detected as non-embedded, as the SDHCI specification explicitly states that 1.8 V VDD is applicable to embedded slots only. [2] - Define some easy bits of the SDHCI specification v4.20. [3] - Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot(). Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3] Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Wed Jul 26 21:59:37 2017 (r321588) +++ head/sys/dev/sdhci/sdhci.c Wed Jul 26 22:04:23 2017 (r321589) @@ -742,6 +742,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, BUS_DMA_NOWAIT, &slot->dmamap); if (err != 0) { device_printf(dev, "Can't alloc DMA memory\n"); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); return (err); } @@ -751,6 +752,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, sdhci_getaddr, &slot->paddr, 0); if (err != 0 || slot->paddr == 0) { device_printf(dev, "Can't load DMA memory\n"); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); if (err) return (err); @@ -770,6 +773,22 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, else caps2 = 0; } + if (slot->version >= SDHCI_SPEC_300) { + if ((caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_REMOVABLE && + (caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_EMBEDDED) { + device_printf(dev, + "Driver doesn't support shared bus slots\n"); + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, + slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); + SDHCI_LOCK_DESTROY(slot); + return (ENXIO); + } else if ((caps & SDHCI_SLOTTYPE_MASK) == + SDHCI_SLOTTYPE_EMBEDDED) { + slot->opt |= SDHCI_SLOT_EMBEDDED | SDHCI_NON_REMOVABLE; + } + } /* Calculate base clock frequency. */ if (slot->version >= SDHCI_SPEC_300) freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> @@ -819,7 +838,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; if (caps & SDHCI_CAN_VDD_300) slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; - if (caps & SDHCI_CAN_VDD_180) + /* 1.8V VDD is not supposed to be used for removable cards. */ + if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED)) slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; if (slot->host.host_ocr == 0) { device_printf(dev, "Hardware doesn't report any " @@ -966,20 +986,24 @@ no_tuning: if (bootverbose || sdhci_debug) { slot_printf(slot, - "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s\n", + "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", (host_caps & MMC_CAP_8_BIT_DATA) ? "8bits" : ((host_caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", - (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", + ((caps & SDHCI_CAN_VDD_180) && + (slot->opt & SDHCI_SLOT_EMBEDDED)) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", (host_caps & MMC_CAP_DRIVER_TYPE_A) ? "A" : "", (host_caps & MMC_CAP_DRIVER_TYPE_C) ? "C" : "", (host_caps & MMC_CAP_DRIVER_TYPE_D) ? "D" : "", - (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO", + (slot->opt & SDHCI_SLOT_EMBEDDED) ? "embedded" : + (slot->opt & SDHCI_NON_REMOVABLE) ? "non-removable" : + "removable"); if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) slot_printf(slot, "eMMC:%s%s%s%s\n", Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Wed Jul 26 21:59:37 2017 (r321588) +++ head/sys/dev/sdhci/sdhci.h Wed Jul 26 22:04:23 2017 (r321589) @@ -237,6 +237,11 @@ #define SDHCI_HOST_CONTROL2 0x3E #define SDHCI_CTRL2_PRESET_VALUE 0x8000 #define SDHCI_CTRL2_ASYNC_INTR 0x4000 +#define SDHCI_CTRL2_64BIT_ENABLE 0x2000 +#define SDHCI_CTRL2_HOST_V4_ENABLE 0x1000 +#define SDHCI_CTRL2_CMD23_ENABLE 0x0800 +#define SDHCI_CTRL2_ADMA2_LENGTH_MODE 0x0400 +#define SDHCI_CTRL2_UHS2_IFACE_ENABLE 0x0100 #define SDHCI_CTRL2_SAMPLING_CLOCK 0x0080 #define SDHCI_CTRL2_EXEC_TUNING 0x0040 #define SDHCI_CTRL2_DRIVER_TYPE_MASK 0x0030 @@ -321,6 +326,8 @@ #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 #define SDHCI_SPEC_400 3 +#define SDHCI_SPEC_410 4 +#define SDHCI_SPEC_420 5 SYSCTL_DECL(_hw_sdhci); @@ -342,6 +349,7 @@ struct sdhci_slot { #define SDHCI_TUNING_SUPPORTED 0x08 #define SDHCI_TUNING_ENABLED 0x10 #define SDHCI_SDR50_NEEDS_TUNING 0x20 +#define SDHCI_SLOT_EMBEDDED 0x40 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Wed Jul 26 21:59:37 2017 (r321588) +++ head/sys/dev/sdhci/sdhci_acpi.c Wed Jul 26 22:04:23 2017 (r321589) @@ -58,7 +58,6 @@ static const struct sdhci_acpi_device { u_int quirks; } sdhci_acpi_devices[] = { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -76,7 +75,6 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80865ACC", 0, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Wed Jul 26 21:59:37 2017 (r321588) +++ head/sys/dev/sdhci/sdhci_pci.c Wed Jul 26 22:04:23 2017 (r321589) @@ -106,7 +106,6 @@ static const struct sdhci_device { { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | @@ -116,14 +115,12 @@ static const struct sdhci_device { SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | @@ -139,7 +136,6 @@ static const struct sdhci_device { SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */ - SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_MMC_DDR52 | From owner-svn-src-head@freebsd.org Thu Jul 27 02:38:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044F2DBEDB8; Thu, 27 Jul 2017 02:38:55 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC48E632B9; Thu, 27 Jul 2017 02:38:54 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R2crpd023017; Thu, 27 Jul 2017 02:38:53 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R2crwW023015; Thu, 27 Jul 2017 02:38:53 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201707270238.v6R2crwW023015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 27 Jul 2017 02:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321602 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/etherswitch/e6000sw X-SVN-Commit-Revision: 321602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 02:38:55 -0000 Author: loos Date: Thu Jul 27 02:38:53 2017 New Revision: 321602 URL: https://svnweb.freebsd.org/changeset/base/321602 Log: Fix the port vlan support in e6000 based switches. Reduce the use of local copies of switch register data. The switch now works with the upstream dsa node (i.e. the upstream DTS). Tested on: ClearFog Pro (88E6176), SG-3100 (88E6141) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/e6000sw/e6000swreg.h Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Thu Jul 27 00:30:13 2017 (r321601) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Thu Jul 27 02:38:53 2017 (r321602) @@ -72,6 +72,7 @@ typedef struct e6000sw_softc { struct proc *kproc; uint32_t swid; + uint32_t vlan_mode; uint32_t cpuports_mask; uint32_t fixed_mask; uint32_t fixed25_mask; @@ -80,15 +81,11 @@ typedef struct e6000sw_softc { int sw_addr; int num_ports; boolean_t multi_chip; - - int vid[E6000SW_NUM_VGROUPS]; - int members[E6000SW_NUM_VGROUPS]; - int vgroup[E6000SW_MAX_PORTS]; } e6000sw_softc_t; static etherswitch_info_t etherswitch_info = { .es_nports = 0, - .es_nvlangroups = E6000SW_NUM_VGROUPS, + .es_nvlangroups = 0, .es_vlan_caps = ETHERSWITCH_VLAN_PORT, .es_name = "Marvell 6000 series switch" }; @@ -263,15 +260,14 @@ e6000sw_probe(device_t dev) } static int -e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t child, int *pport, - int *pvlangroup) +e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t child, int *pport) { char *name, *portlabel; int speed; phandle_t fixed_link; - uint32_t port, vlangroup; + uint32_t port; - if (pport == NULL || pvlangroup == NULL) + if (pport == NULL) return (ENXIO); if (OF_getencprop(child, "reg", (void *)&port, sizeof(port)) < 0) @@ -280,15 +276,6 @@ e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t return (ENXIO); *pport = port; - if (OF_getencprop(child, "vlangroup", (void *)&vlangroup, - sizeof(vlangroup)) > 0) { - if (vlangroup >= E6000SW_NUM_VGROUPS) - return (ENXIO); - *pvlangroup = vlangroup; - } else { - *pvlangroup = -1; - } - if (OF_getprop_alloc(child, "label", 1, (void **)&portlabel) > 0) { if (strncmp(portlabel, "cpu", 3) == 0) { device_printf(sc->dev, "CPU port at %d\n", port); @@ -364,11 +351,9 @@ e6000sw_attach_miibus(e6000sw_softc_t *sc, int port) static int e6000sw_attach(device_t dev) { - etherswitch_vlangroup_t vg; e6000sw_softc_t *sc; phandle_t child; - int err, port, vlangroup; - int member_ports[E6000SW_NUM_VGROUPS]; + int err, port; uint32_t reg; err = 0; @@ -383,18 +368,14 @@ e6000sw_attach(device_t dev) E6000SW_LOCK(sc); e6000sw_setup(dev, sc); - bzero(member_ports, sizeof(member_ports)); for (child = OF_child(sc->node); child != 0; child = OF_peer(child)) { - err = e6000sw_parse_child_fdt(sc, child, &port, &vlangroup); + err = e6000sw_parse_child_fdt(sc, child, &port); if (err != 0) { device_printf(sc->dev, "failed to parse DTS\n"); goto out_fail; } - if (vlangroup != -1) - member_ports[vlangroup] |= (1 << port); - /* Port is in use. */ sc->ports_mask |= (1 << port); @@ -440,21 +421,9 @@ e6000sw_attach(device_t dev) } etherswitch_info.es_nports = sc->num_ports; - for (port = 0; port < sc->num_ports; port++) - sc->vgroup[port] = E6000SW_PORT_NO_VGROUP; - /* Set VLAN configuration */ + /* Default to port vlan. */ e6000sw_port_vlan_conf(sc); - - /* Set vlangroups */ - for (vlangroup = 0; vlangroup < E6000SW_NUM_VGROUPS; vlangroup++) - if (member_ports[vlangroup] != 0) { - vg.es_vlangroup = vg.es_vid = vlangroup; - vg.es_member_ports = vg.es_untagged_ports = - member_ports[vlangroup]; - e6000sw_setvgroup(dev, &vg); - } - E6000SW_UNLOCK(sc); bus_generic_probe(dev); @@ -597,12 +566,14 @@ e6000sw_getinfo(device_t dev) } static int -e6000sw_getconf(device_t dev __unused, etherswitch_conf_t *conf) +e6000sw_getconf(device_t dev, etherswitch_conf_t *conf) { + struct e6000sw_softc *sc; /* Return the VLAN mode. */ + sc = device_get_softc(dev); conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; - conf->vlan_mode = ETHERSWITCH_VLAN_PORT; + conf->vlan_mode = sc->vlan_mode; return (0); } @@ -808,67 +779,79 @@ e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vl } static __inline void -e6000sw_flush_port(e6000sw_softc_t *sc, int port) +e6000sw_port_vlan_assign(e6000sw_softc_t *sc, int port, uint32_t fid, + uint32_t members) { uint32_t reg; reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); reg &= ~PORT_VLAN_MAP_TABLE_MASK; reg &= ~PORT_VLAN_MAP_FID_MASK; + reg |= members & PORT_VLAN_MAP_TABLE_MASK & ~(1 << port); + reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); - if (sc->vgroup[port] != E6000SW_PORT_NO_VGROUP) { - /* - * If port belonged somewhere, owner-group - * should have its entry removed. - */ - sc->members[sc->vgroup[port]] &= ~(1 << port); - sc->vgroup[port] = E6000SW_PORT_NO_VGROUP; - } + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL_1); + reg &= ~PORT_CONTROL_1_FID_MASK; + reg |= (fid >> 4) & PORT_CONTROL_1_FID_MASK; + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL_1, reg); } -static __inline void -e6000sw_port_assign_vgroup(e6000sw_softc_t *sc, int port, int fid, int vgroup, - int members) +static int +e6000sw_set_port_vlan(e6000sw_softc_t *sc, etherswitch_vlangroup_t *vg) { - uint32_t reg; + uint32_t port; - reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); - reg &= ~PORT_VLAN_MAP_TABLE_MASK; - reg &= ~PORT_VLAN_MAP_FID_MASK; - reg |= members & ~(1 << port); - reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; - e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, reg); - sc->vgroup[port] = vgroup; + port = vg->es_vlangroup; + if (port > sc->num_ports) + return (EINVAL); + + if (vg->es_member_ports != vg->es_untagged_ports) { + device_printf(sc->dev, "Tagged ports not supported.\n"); + return (EINVAL); + } + + e6000sw_port_vlan_assign(sc, port, port + 1, vg->es_untagged_ports); + vg->es_vid = port | ETHERSWITCH_VID_VALID; + + return (0); } static int e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) { e6000sw_softc_t *sc; - int port, fid; sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - if (vg->es_vlangroup >= E6000SW_NUM_VGROUPS) + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) + return (e6000sw_set_port_vlan(sc, vg)); + + return (EINVAL); +} + +static int +e6000sw_get_port_vlan(e6000sw_softc_t *sc, etherswitch_vlangroup_t *vg) +{ + uint32_t port, reg; + + port = vg->es_vlangroup; + if (port > sc->num_ports) return (EINVAL); - if (vg->es_member_ports != vg->es_untagged_ports) { - device_printf(dev, "Tagged ports not supported.\n"); - return (EINVAL); - } - vg->es_untagged_ports &= PORT_VLAN_MAP_TABLE_MASK; - fid = vg->es_vlangroup + 1; - for (port = 0; port < sc->num_ports; port++) { - if ((sc->members[sc->vgroup[port]] & (1 << port))) - e6000sw_flush_port(sc, port); - if (vg->es_untagged_ports & (1 << port)) - e6000sw_port_assign_vgroup(sc, port, fid, - vg->es_vlangroup, vg->es_untagged_ports); + if (!e6000sw_is_portenabled(sc, port)) { + vg->es_vid = port; + return (0); } - sc->vid[vg->es_vlangroup] = vg->es_vid; - sc->members[vg->es_vlangroup] = vg->es_untagged_ports; + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_VLAN_MAP); + vg->es_untagged_ports = vg->es_member_ports = + reg & PORT_VLAN_MAP_TABLE_MASK; + vg->es_vid = port | ETHERSWITCH_VID_VALID; + vg->es_fid = (reg & PORT_VLAN_MAP_FID_MASK) >> PORT_VLAN_MAP_FID; + reg = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL_1); + vg->es_fid |= (reg & PORT_CONTROL_1_FID_MASK) << 4; + return (0); } @@ -880,14 +863,10 @@ e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_ sc = device_get_softc(dev); E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); - if (vg->es_vlangroup >= E6000SW_NUM_VGROUPS) - return (EINVAL); - vg->es_untagged_ports = vg->es_member_ports = - sc->members[vg->es_vlangroup]; - if (vg->es_untagged_ports != 0) - vg->es_vid = ETHERSWITCH_VID_VALID; + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) + return (e6000sw_get_port_vlan(sc, vg)); - return (0); + return (EINVAL); } static __inline struct mii_data* @@ -1172,10 +1151,9 @@ e6000sw_setup(device_t dev, e6000sw_softc_t *sc) static void e6000sw_port_vlan_conf(e6000sw_softc_t *sc) { - int port, ret; - device_t dev; + int i, port, ret; + uint32_t members; - dev = sc->dev; /* Disable all ports */ for (port = 0; port < sc->num_ports; port++) { ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); @@ -1207,8 +1185,23 @@ e6000sw_port_vlan_conf(e6000sw_softc_t *sc) if (!e6000sw_is_portenabled(sc, port)) continue; ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); - e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, (ret | - PORT_CONTROL_ENABLE)); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, + (ret | PORT_CONTROL_ENABLE)); + } + + /* Set VLAN mode. */ + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + etherswitch_info.es_nvlangroups = sc->num_ports; + for (port = 0; port < sc->num_ports; port++) { + members = 0; + if (e6000sw_is_portenabled(sc, port)) { + for (i = 0; i < sc->num_ports; i++) { + if (i == port || !e6000sw_is_portenabled(sc, i)) + continue; + members |= (1 << i); + } + } + e6000sw_port_vlan_assign(sc, port, port + 1, members); } } Modified: head/sys/dev/etherswitch/e6000sw/e6000swreg.h ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000swreg.h Thu Jul 27 00:30:13 2017 (r321601) +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h Thu Jul 27 02:38:53 2017 (r321602) @@ -87,6 +87,7 @@ struct atu_opt { #define SWITCH_ID 0x3 #define PORT_CONTROL 0x4 #define PORT_CONTROL_1 0x5 +#define PORT_CONTROL_1_FID_MASK 0xf #define PORT_VLAN_MAP 0x6 #define PORT_VID 0x7 #define PORT_ASSOCIATION_VECTOR 0xb @@ -104,6 +105,7 @@ struct atu_opt { #define PORT_VLAN_MAP_TABLE_MASK 0x7f #define PORT_VLAN_MAP_FID 12 #define PORT_VLAN_MAP_FID_MASK 0xf000 + /* * Switch Global Register 1 accessed via REG_GLOBAL_ADDR */ @@ -201,9 +203,7 @@ struct atu_opt { #define SCR_AND_MISC_DATA_CFG_MASK 0xf0 #define E6000SW_NUM_PHY_REGS 29 -#define E6000SW_NUM_VGROUPS 8 -#define E6000SW_MAX_PORTS 10 -#define E6000SW_PORT_NO_VGROUP -1 +#define E6000SW_MAX_PORTS 8 #define E6000SW_DEFAULT_AGETIME 20 #define E6000SW_RETRIES 100 #define E6000SW_SMI_TIMEOUT 16 From owner-svn-src-head@freebsd.org Thu Jul 27 02:53:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87949DBF43D; Thu, 27 Jul 2017 02:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5658363B3C; Thu, 27 Jul 2017 02:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R2rIEU031084; Thu, 27 Jul 2017 02:53:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R2rIrD031083; Thu, 27 Jul 2017 02:53:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707270253.v6R2rIrD031083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 27 Jul 2017 02:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321603 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 321603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 02:53:19 -0000 Author: emaste Date: Thu Jul 27 02:53:18 2017 New Revision: 321603 URL: https://svnweb.freebsd.org/changeset/base/321603 Log: uart: add AX99100 chipset support PR: 215837 Submitted by: joe@thrallingpenguin.com MFC after: 2 weeks Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Thu Jul 27 02:38:53 2017 (r321602) +++ head/sys/dev/uart/uart_bus_pci.c Thu Jul 27 02:53:18 2017 (r321603) @@ -88,6 +88,8 @@ static const struct pci_id pci_ns8250_ids[] = { { 0x103c, 0x3301, 0xffff, 0, "HP iLO serial port", 0x10 }, { 0x11c1, 0x0480, 0xffff, 0, "Agere Systems Venus Modem (V90, 56KFlex)", 0x14 }, { 0x115d, 0x0103, 0xffff, 0, "Xircom Cardbus Ethernet + 56k Modem", 0x10 }, +{ 0x125b, 0x9100, 0xa000, 0x1000, + "ASIX AX99100 PCIe 1/2/3/4-port RS-232/422/485", 0x10 }, { 0x1282, 0x6585, 0xffff, 0, "Davicom 56PDV PCI Modem", 0x10 }, { 0x12b9, 0x1008, 0xffff, 0, "3Com 56K FaxModem Model 5610", 0x10 }, { 0x131f, 0x1000, 0xffff, 0, "Siig CyberSerial (1-port) 16550", 0x18 }, From owner-svn-src-head@freebsd.org Thu Jul 27 05:31:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00C54DC21BC; Thu, 27 Jul 2017 05:31:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2843679D1; Thu, 27 Jul 2017 05:31:49 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R5Vmcv095835; Thu, 27 Jul 2017 05:31:48 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R5Vmg2095834; Thu, 27 Jul 2017 05:31:48 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707270531.v6R5Vmg2095834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 27 Jul 2017 05:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321604 - head/usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/mpsutil X-SVN-Commit-Revision: 321604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 05:31:50 -0000 Author: scottl Date: Thu Jul 27 05:31:48 2017 New Revision: 321604 URL: https://svnweb.freebsd.org/changeset/base/321604 Log: Fix some broken logic used in obtaining the certain config pages. I'm surprised that this even pretended to work. PR: 215793 Submitted by: longwitz@incore.de Modified: head/usr.sbin/mpsutil/mps_cmd.c Modified: head/usr.sbin/mpsutil/mps_cmd.c ============================================================================== --- head/usr.sbin/mpsutil/mps_cmd.c Thu Jul 27 02:53:18 2017 (r321603) +++ head/usr.sbin/mpsutil/mps_cmd.c Thu Jul 27 05:31:48 2017 (r321604) @@ -365,8 +365,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumbe req.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; req.PageAddress = PageAddress; req.Header = header; - req.Header.PageLength = reply.Header.PageLength; - if (reply.Header.PageLength == 0) + if (req.Header.PageLength == 0) req.Header.PageLength = 4; len = req.Header.PageLength * 4; From owner-svn-src-head@freebsd.org Thu Jul 27 06:26:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E846CDC31BE; Thu, 27 Jul 2017 06:26:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B77026932A; Thu, 27 Jul 2017 06:26:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R6QFcw016945; Thu, 27 Jul 2017 06:26:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R6QFpx016943; Thu, 27 Jul 2017 06:26:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201707270626.v6R6QFpx016943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Jul 2017 06:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321605 - head/contrib/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter X-SVN-Commit-Revision: 321605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 06:26:17 -0000 Author: cy Date: Thu Jul 27 06:26:15 2017 New Revision: 321605 URL: https://svnweb.freebsd.org/changeset/base/321605 Log: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. PR: 217920 Submitted by: codarren@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) MFC after: 1 week Differential Revision: D11747 Patterned after: r315225 Modified: head/contrib/ipfilter/arc4random.c Modified: head/contrib/ipfilter/arc4random.c ============================================================================== --- head/contrib/ipfilter/arc4random.c Thu Jul 27 05:31:48 2017 (r321604) +++ head/contrib/ipfilter/arc4random.c Thu Jul 27 06:26:15 2017 (r321605) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } From owner-svn-src-head@freebsd.org Thu Jul 27 07:28:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF45DC400F; Thu, 27 Jul 2017 07:28:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D7746AA74; Thu, 27 Jul 2017 07:28:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R7STj7040977; Thu, 27 Jul 2017 07:28:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R7STBK040976; Thu, 27 Jul 2017 07:28:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707270728.v6R7STBK040976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Jul 2017 07:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321606 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 321606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 07:28:30 -0000 Author: mav Date: Thu Jul 27 07:28:29 2017 New Revision: 321606 URL: https://svnweb.freebsd.org/changeset/base/321606 Log: adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE The attached patch lets adaasync() set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD. This fixes a regression introduced in r300207 which changed the flag names. PR: 220948 Submitted by: Fabian Keil Obtained from: ElectroBSD 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 Thu Jul 27 06:26:15 2017 (r321605) +++ head/sys/cam/ata/ata_da.c Thu Jul 27 07:28:29 2017 (r321606) @@ -1320,7 +1320,7 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) softc->state = ADA_STATE_RAHEAD; - else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) + else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_WCACHE) softc->state = ADA_STATE_WCACHE; else if ((softc->flags & ADA_FLAG_CAN_LOG) && (softc->zone_mode != ADA_ZONE_NONE)) From owner-svn-src-head@freebsd.org Thu Jul 27 08:33:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FA7DC50EA; Thu, 27 Jul 2017 08:33:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25236C622; Thu, 27 Jul 2017 08:33:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R8XVAb069509; Thu, 27 Jul 2017 08:33:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R8XVHc069508; Thu, 27 Jul 2017 08:33:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707270833.v6R8XVHc069508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Jul 2017 08:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321607 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 321607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 08:33:32 -0000 Author: kib Date: Thu Jul 27 08:33:31 2017 New Revision: 321607 URL: https://svnweb.freebsd.org/changeset/base/321607 Log: Allow to specify targets by absolute paths in libmap.conf. Submitted by: Tatu Kilappa PR: 221032 MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jul 27 07:28:29 2017 (r321606) +++ head/libexec/rtld-elf/rtld.c Thu Jul 27 08:33:31 2017 (r321607) @@ -1590,19 +1590,20 @@ find_library(const char *xname, const Obj_Entry *refob bool nodeflib, objgiven; objgiven = refobj != NULL; - if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ - if (xname[0] != '/' && !trust) { + + if (libmap_disable || !objgiven || + (name = lm_find(refobj->path, xname)) == NULL) + name = (char *)xname; + + if (strchr(name, '/') != NULL) { /* Hard coded pathname */ + if (name[0] != '/' && !trust) { _rtld_error("Absolute pathname required for shared object \"%s\"", - xname); - return NULL; + name); + return (NULL); } return (origin_subst(__DECONST(Obj_Entry *, refobj), - __DECONST(char *, xname))); + __DECONST(char *, name))); } - - if (libmap_disable || !objgiven || - (name = lm_find(refobj->path, xname)) == NULL) - name = (char *)xname; dbg(" Searching for \"%s\"", name); From owner-svn-src-head@freebsd.org Thu Jul 27 08:37:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31C9EDC51D2; Thu, 27 Jul 2017 08:37:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB616C817; Thu, 27 Jul 2017 08:37:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R8b8DZ069684; Thu, 27 Jul 2017 08:37:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R8b81e069683; Thu, 27 Jul 2017 08:37:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707270837.v6R8b81e069683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Jul 2017 08:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321608 - head/lib/libc/x86/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/x86/sys X-SVN-Commit-Revision: 321608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 08:37:09 -0000 Author: kib Date: Thu Jul 27 08:37:07 2017 New Revision: 321608 URL: https://svnweb.freebsd.org/changeset/base/321608 Log: Use MFENCE to serialize RDTSC on non-Intel CPUs. Kernel already used the stronger barrier instruction for AMDs, correct the userspace fast gettimeofday() implementation as well. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D11728 Modified: head/lib/libc/x86/sys/__vdso_gettc.c Modified: head/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/x86/sys/__vdso_gettc.c Thu Jul 27 08:33:31 2017 (r321607) +++ head/lib/libc/x86/sys/__vdso_gettc.c Thu Jul 27 08:37:07 2017 (r321608) @@ -52,57 +52,108 @@ __FBSDID("$FreeBSD$"); #endif #include "libc_private.h" +static enum LMB { + LMB_UNKNOWN, + LMB_NONE, + LMB_MFENCE, + LMB_LFENCE +} lfence_works = LMB_UNKNOWN; + static void -lfence_mb(void) +cpuidp(u_int leaf, u_int p[4]) { + + __asm __volatile( #if defined(__i386__) - static int lfence_works = -1; + " pushl %%ebx\n" +#endif + " cpuid\n" +#if defined(__i386__) + " movl %%ebx,%1\n" + " popl %%ebx" +#endif + : "=a" (p[0]), +#if defined(__i386__) + "=r" (p[1]), +#elif defined(__amd64__) + "=b" (p[1]), +#else +#error "Arch" +#endif + "=c" (p[2]), "=d" (p[3]) + : "0" (leaf)); +} + +static enum LMB +select_lmb(void) +{ + u_int p[4]; + static const char intel_id[] = "GenuntelineI"; + + cpuidp(0, p); + return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? + LMB_LFENCE : LMB_MFENCE); +} + +static void +init_fence(void) +{ +#if defined(__i386__) u_int cpuid_supported, p[4]; - if (lfence_works == -1) { - __asm __volatile( - " pushfl\n" - " popl %%eax\n" - " movl %%eax,%%ecx\n" - " xorl $0x200000,%%eax\n" - " pushl %%eax\n" - " popfl\n" - " pushfl\n" - " popl %%eax\n" - " xorl %%eax,%%ecx\n" - " je 1f\n" - " movl $1,%0\n" - " jmp 2f\n" - "1: movl $0,%0\n" - "2:\n" - : "=r" (cpuid_supported) : : "eax", "ecx", "cc"); - if (cpuid_supported) { - __asm __volatile( - " pushl %%ebx\n" - " cpuid\n" - " movl %%ebx,%1\n" - " popl %%ebx\n" - : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (0x1)); - lfence_works = (p[3] & CPUID_SSE2) != 0; - } else - lfence_works = 0; - } - if (lfence_works == 1) - lfence(); + __asm __volatile( + " pushfl\n" + " popl %%eax\n" + " movl %%eax,%%ecx\n" + " xorl $0x200000,%%eax\n" + " pushl %%eax\n" + " popfl\n" + " pushfl\n" + " popl %%eax\n" + " xorl %%eax,%%ecx\n" + " je 1f\n" + " movl $1,%0\n" + " jmp 2f\n" + "1: movl $0,%0\n" + "2:\n" + : "=r" (cpuid_supported) : : "eax", "ecx", "cc"); + if (cpuid_supported) { + cpuidp(0x1, p); + if ((p[3] & CPUID_SSE2) != 0) + lfence_works = select_lmb(); + } else + lfence_works = LMB_NONE; #elif defined(__amd64__) - lfence(); + lfence_works = select_lmb(); #else -#error "arch" +#error "Arch" #endif } +static void +rdtsc_mb(void) +{ + +again: + if (__predict_true(lfence_works == LMB_LFENCE)) { + lfence(); + return; + } else if (lfence_works == LMB_MFENCE) { + mfence(); + return; + } else if (lfence_works == LMB_NONE) { + return; + } + init_fence(); + goto again; +} + static u_int __vdso_gettc_rdtsc_low(const struct vdso_timehands *th) { u_int rv; - lfence_mb(); + rdtsc_mb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); return (rv); @@ -112,7 +163,7 @@ static u_int __vdso_rdtsc32(void) { - lfence_mb(); + rdtsc_mb(); return (rdtsc32()); } @@ -212,7 +263,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc *tsc_ref, u_int scale = tsc_ref->tsc_scale; ofs = tsc_ref->tsc_ofs; - lfence_mb(); + rdtsc_mb(); tsc = rdtsc(); /* ret = ((tsc * scale) >> 64) + ofs */ From owner-svn-src-head@freebsd.org Thu Jul 27 12:29:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BED2DC9F40; Thu, 27 Jul 2017 12:29:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473B67446A; Thu, 27 Jul 2017 12:29:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RCTV6E064816; Thu, 27 Jul 2017 12:29:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RCTVwh064815; Thu, 27 Jul 2017 12:29:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707271229.v6RCTVwh064815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 27 Jul 2017 12:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321616 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 12:29:32 -0000 Author: emaste Date: Thu Jul 27 12:29:31 2017 New Revision: 321616 URL: https://svnweb.freebsd.org/changeset/base/321616 Log: genericize target exclusion for missing external toolchain Previously we excluded riscv from make universe / tinderbox if the required xtoolchain package was not installed. Make that logic generic so that we can loop over multiple architectures, in preparation to test patches to have other architectures rely on external toolchain. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11652 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jul 27 10:52:36 2017 (r321615) +++ head/Makefile Thu Jul 27 12:29:31 2017 (r321616) @@ -441,14 +441,22 @@ TARGET_ARCHES_${target}?= ${target} MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc -# XXX Remove riscv from universe if the required toolchain package is missing. -.if !exists(/usr/local/share/toolchains/riscv64-gcc.mk) && ${TARGETS:Mriscv} -_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Nriscv} -universe: universe_riscv_skip .PHONY -universe_epilogue: universe_riscv_skip .PHONY -universe_riscv_skip: universe_prologue .PHONY - @echo ">> riscv skipped - install riscv64-xtoolchain-gcc port or package to build" +# XXX Remove architectures only supported by external toolchain from universe +# if required toolchain packages are missing. +TOOLCHAINS_riscv= riscv64 +.for target in riscv +.if ${_UNIVERSE_TARGETS:M${target}} +.for toolchain in ${TOOLCHAINS_${target}} +.if !exists(/usr/local/share/toolchains/${toolchain}-gcc.mk) +_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}} +universe: universe_${toolchain}_skip .PHONY +universe_epilogue: universe_${toolchain}_skip .PHONY +universe_${toolchain}_skip: universe_prologue .PHONY + @echo ">> ${target} skipped - install ${toolchain}-xtoolchain-gcc port or package to build" .endif +.endfor +.endif +.endfor .if defined(UNIVERSE_TARGET) MAKE_JUST_WORLDS= YES From owner-svn-src-head@freebsd.org Thu Jul 27 13:03:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 415F2DCAC11; Thu, 27 Jul 2017 13:03:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B53375882; Thu, 27 Jul 2017 13:03:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RD3b0v080945; Thu, 27 Jul 2017 13:03:37 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RD3amQ080937; Thu, 27 Jul 2017 13:03:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201707271303.v6RD3amQ080937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 27 Jul 2017 13:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321618 - in head: sys/conf sys/net sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: sys/conf sys/net sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Commit-Revision: 321618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 13:03:38 -0000 Author: bz Date: Thu Jul 27 13:03:36 2017 New Revision: 321618 URL: https://svnweb.freebsd.org/changeset/base/321618 Log: After inpcb route caching was put back in place there is no need for flowtable anymore (as flowtable was never considered to be useful in the forwarding path). Reviewed by: np Differential Revision: https://reviews.freebsd.org/D11448 Deleted: head/sys/net/flowtable.c head/sys/net/flowtable.h head/usr.bin/netstat/flowtable.c Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/net/route.c head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jul 27 12:37:18 2017 (r321617) +++ head/sys/conf/NOTES Thu Jul 27 13:03:36 2017 (r321618) @@ -646,9 +646,6 @@ options LIBMCHAIN # libalias library, performing NAT options LIBALIAS -# flowtable cache -options FLOWTABLE - # # SCTP is a NEW transport protocol defined by # RFC2960 updated by RFC3309 and RFC3758.. and Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jul 27 12:37:18 2017 (r321617) +++ head/sys/conf/options Thu Jul 27 13:03:36 2017 (r321618) @@ -454,8 +454,6 @@ TCP_RFC7413_MAX_KEYS opt_inet.h TCP_SIGNATURE opt_ipsec.h VLAN_ARRAY opt_vlan.h XBONEHACK -FLOWTABLE opt_route.h -FLOWTABLE_HASH_ALL opt_route.h # # SCTP Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jul 27 12:37:18 2017 (r321617) +++ head/sys/net/route.c Thu Jul 27 13:03:36 2017 (r321618) @@ -59,7 +59,6 @@ #include #include #include -#include #ifdef RADIX_MPATH #include @@ -1504,79 +1503,12 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif -#ifdef FLOWTABLE -static struct rtentry * -rt_flowtable_check_route(struct rib_head *rnh, struct rt_addrinfo *info) -{ -#if defined(INET6) || defined(INET) - struct radix_node *rn; -#endif - struct rtentry *rt0; - - rt0 = NULL; - /* "flow-table" only supports IPv6 and IPv4 at the moment. */ - switch (dst->sa_family) { -#ifdef INET6 - case AF_INET6: -#endif -#ifdef INET - case AF_INET: -#endif -#if defined(INET6) || defined(INET) - rn = rnh->rnh_matchaddr(dst, &rnh->head); - if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { - struct sockaddr *mask; - u_char *m, *n; - int len; - - /* - * compare mask to see if the new route is - * more specific than the existing one - */ - rt0 = RNTORT(rn); - RT_LOCK(rt0); - RT_ADDREF(rt0); - RT_UNLOCK(rt0); - /* - * A host route is already present, so - * leave the flow-table entries as is. - */ - if (rt0->rt_flags & RTF_HOST) { - RTFREE(rt0); - rt0 = NULL; - } else if (!(flags & RTF_HOST) && netmask) { - mask = rt_mask(rt0); - len = mask->sa_len; - m = (u_char *)mask; - n = (u_char *)netmask; - while (len-- > 0) { - if (*n != *m) - break; - n++; - m++; - } - if (len == 0 || (*n < *m)) { - RTFREE(rt0); - rt0 = NULL; - } - } - } -#endif/* INET6 || INET */ - } - - return (rt0); -} -#endif - int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) { int error = 0; struct rtentry *rt, *rt_old; -#ifdef FLOWTABLE - struct rtentry *rt0; -#endif struct radix_node *rn; struct rib_head *rnh; struct ifaddr *ifa; @@ -1710,10 +1642,6 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru } #endif -#ifdef FLOWTABLE - rt0 = rt_flowtable_check_route(rnh, info); -#endif /* FLOWTABLE */ - /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); @@ -1748,18 +1676,8 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru ifa_free(rt->rt_ifa); R_Free(rt_key(rt)); uma_zfree(V_rtzone, rt); -#ifdef FLOWTABLE - if (rt0 != NULL) - RTFREE(rt0); -#endif return (EEXIST); } -#ifdef FLOWTABLE - else if (rt0 != NULL) { - flowtable_route_flush(dst->sa_family, rt0); - RTFREE(rt0); - } -#endif if (rt_old != NULL) { rt_notifydelete(rt_old, info); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jul 27 12:37:18 2017 (r321617) +++ head/sys/netinet/ip_output.c Thu Jul 27 13:03:36 2017 (r321618) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef RADIX_MPATH #include #endif @@ -243,11 +242,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou ro = &iproute; bzero(ro, sizeof (*ro)); } - -#ifdef FLOWTABLE - if (ro->ro_rt == NULL) - (void )flowtable_lookup(AF_INET, m, ro); -#endif if (opt) { int len = 0; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jul 27 12:37:18 2017 (r321617) +++ head/sys/netinet6/ip6_output.c Thu Jul 27 13:03:36 2017 (r321618) @@ -117,10 +117,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FLOWTABLE -#include -#endif - extern int in6_mcast_loop; struct ip6_exthdrs { @@ -502,10 +498,6 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, if (opt && opt->ip6po_rthdr) ro = &opt->ip6po_route; dst = (struct sockaddr_in6 *)&ro->ro_dst; -#ifdef FLOWTABLE - if (ro->ro_rt == NULL) - (void )flowtable_lookup(AF_INET6, m, (struct route *)ro); -#endif fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); again: /* Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Thu Jul 27 12:37:18 2017 (r321617) +++ head/usr.bin/netstat/Makefile Thu Jul 27 13:03:36 2017 (r321618) @@ -6,7 +6,7 @@ PROG= netstat SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c nl_symbols.c route.c \ unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \ - flowtable.c nl_defs.h + nl_defs.h nl_symbols.c: nlist_symbols awk '\ Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Thu Jul 27 12:37:18 2017 (r321617) +++ head/usr.bin/netstat/main.c Thu Jul 27 13:03:36 2017 (r321618) @@ -480,7 +480,6 @@ main(int argc, char *argv[]) xo_open_container("statistics"); if (sflag) { rt_stats(); - flowtable_stats(); } else routepr(fib, af); xo_close_container("statistics"); Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Thu Jul 27 12:37:18 2017 (r321617) +++ head/usr.bin/netstat/netstat.h Thu Jul 27 13:03:36 2017 (r321618) @@ -140,7 +140,6 @@ void intpr(void (*)(char *), int); void pr_family(int); void rt_stats(void); -void flowtable_stats(void); char *routename(struct sockaddr *, int); const char *netname(struct sockaddr *, struct sockaddr *); From owner-svn-src-head@freebsd.org Thu Jul 27 13:37:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92597DCB5E5; Thu, 27 Jul 2017 13:37:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4F77689E; Thu, 27 Jul 2017 13:37:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RDbLjP092908; Thu, 27 Jul 2017 13:37:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RDbLtR092906; Thu, 27 Jul 2017 13:37:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707271337.v6RDbLtR092906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 27 Jul 2017 13:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321619 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 321619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 13:37:22 -0000 Author: gjb Date: Thu Jul 27 13:37:21 2017 New Revision: 321619 URL: https://svnweb.freebsd.org/changeset/base/321619 Log: Bump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as 1G is no longer large enough. Reported by: manu Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BANANAPI.conf head/release/arm/CUBIEBOARD2.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Thu Jul 27 13:03:36 2017 (r321618) +++ head/release/arm/BANANAPI.conf Thu Jul 27 13:37:21 2017 (r321619) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1G" +IMAGE_SIZE="1536M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Thu Jul 27 13:03:36 2017 (r321618) +++ head/release/arm/CUBIEBOARD2.conf Thu Jul 27 13:37:21 2017 (r321619) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1G" +IMAGE_SIZE="1536M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" From owner-svn-src-head@freebsd.org Thu Jul 27 14:34:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A37DCC6A7; Thu, 27 Jul 2017 14:34:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 042A27C7F3; Thu, 27 Jul 2017 14:34:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6REYw8e018265; Thu, 27 Jul 2017 14:34:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6REYwf2018264; Thu, 27 Jul 2017 14:34:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707271434.v6REYwf2018264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Jul 2017 14:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321620 - head/usr.bin/w X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.bin/w X-SVN-Commit-Revision: 321620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 14:34:59 -0000 Author: mav Date: Thu Jul 27 14:34:57 2017 New Revision: 321620 URL: https://svnweb.freebsd.org/changeset/base/321620 Log: Fix singular/plural "users" output. It was broken during libxo'fication. PR: 221039 Submitted by: timur@ MFC after: 1 week Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Thu Jul 27 13:37:21 2017 (r321619) +++ head/usr.bin/w/w.c Thu Jul 27 14:34:57 2017 (r321620) @@ -511,7 +511,7 @@ pr_header(time_t *nowp, int nusers) } /* Print number of users logged in to system */ - xo_emit(" {:users/%d} {N:user%s}", nusers, nusers == 1 ? "" : "s"); + xo_emit(" {:users/%d} {Np:user,users}", nusers); /* * Print 1, 5, and 15 minute load averages. From owner-svn-src-head@freebsd.org Thu Jul 27 15:06:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 797D7DCCFE1; Thu, 27 Jul 2017 15:06:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 472AE7D7C9; Thu, 27 Jul 2017 15:06:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RF6YXA030586; Thu, 27 Jul 2017 15:06:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RF6YxM030585; Thu, 27 Jul 2017 15:06:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707271506.v6RF6YxM030585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Jul 2017 15:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321621 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 321621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 15:06:35 -0000 Author: andrew Date: Thu Jul 27 15:06:34 2017 New Revision: 321621 URL: https://svnweb.freebsd.org/changeset/base/321621 Log: Always set the receive mask in loader.efi. Some UEFI implementations set this to be too restrictive. We need to have both broadcast and unicast enabled for loader to work. Set them in all cases to ensure this is true. This allows the Cavium ThunderX 2s in the netperf cluster to netboot using a USB NIC. PR: 221001 Reviewed by: emaste, tsoome Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11732 Modified: head/sys/boot/efi/libefi/efinet.c Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Thu Jul 27 14:34:57 2017 (r321620) +++ head/sys/boot/efi/libefi/efinet.c Thu Jul 27 15:06:34 2017 (r321621) @@ -187,6 +187,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint) EFI_SIMPLE_NETWORK *net; EFI_HANDLE h; EFI_STATUS status; + UINT32 mask; if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) { printf("Invalid network interface %d\n", nif->nif_unit); @@ -220,16 +221,14 @@ efinet_init(struct iodesc *desc, void *machdep_hint) } } - if (net->Mode->ReceiveFilterSetting == 0) { - UINT32 mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | - EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST; + mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | + EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST; - status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL); - if (status != EFI_SUCCESS) { - printf("net%d: cannot set rx. filters (status=%lu)\n", - nif->nif_unit, EFI_ERROR_CODE(status)); - return; - } + status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL); + if (status != EFI_SUCCESS) { + printf("net%d: cannot set rx. filters (status=%lu)\n", + nif->nif_unit, EFI_ERROR_CODE(status)); + return; } #ifdef EFINET_DEBUG From owner-svn-src-head@freebsd.org Thu Jul 27 15:33:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A10DCD8D8; Thu, 27 Jul 2017 15:33:58 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E79C7E982; Thu, 27 Jul 2017 15:33:58 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RFXvo9043560; Thu, 27 Jul 2017 15:33:57 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RFXvsf043559; Thu, 27 Jul 2017 15:33:57 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201707271533.v6RFXvsf043559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 27 Jul 2017 15:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321622 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 321622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 15:33:58 -0000 Author: ken Date: Thu Jul 27 15:33:57 2017 New Revision: 321622 URL: https://svnweb.freebsd.org/changeset/base/321622 Log: Fix probing FC targets with hard addressing turned on. This largely reverts FreeBSD SVN change 289937 from October 25th, 2015. The intent of that change was to keep loop IDs persistent across chip reinits. The problem is that the change turned on the PREVLOOP / PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the Qlogic chip to not participate in the loop if it can't get the requested loop address. It also turned off soft addressing on 2400 (4Gb) and newer controllers. The isp(4) driver defaults to loop address 0, and the tape drives I have tested default to loop address 0 if hard addressing is turned on. So when hard loop addressing is turned on on the drive, the isp(4) driver just refuses to participate in the loop. The solution is to largely revert that change. I left some elements in place that are related to virtual ports, since they were new. This does work with IBM tape drives with hard and soft addressing turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers. sys/dev/isp.c: Largely revert FreeBSD SVN change 289937. I left the ispmbox.h changes in place. Don't use the PREV_ADDRESS bit on initialization. It tells the chip to not participate if it can't get the requested loop ID. Do use soft addressing on 2400 and newer chips. Use hard addressing when the user has requested a specific initiator ID. (hint.isp.X.iid=N in /boot/loader.conf) Leave some of the virtual port options from that change in place, but don't turn on the PREV_ADDRESS bit. Reviewed by: mav MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Jul 27 15:06:34 2017 (r321621) +++ head/sys/dev/isp/isp.c Thu Jul 27 15:33:57 2017 (r321622) @@ -1631,6 +1631,7 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; + int ownloopid; /* * We only support one channel on non-24XX cards @@ -1709,15 +1710,22 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; - else - icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; + icbp->icb_hardaddr = fcp->isp_loopid; + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } /* + * Our life seems so much better with 2200s and later with + * the latest f/w if we set Hard Address. + */ + if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + } + + /* * Right now we just set extended options to prefer point-to-point * over loop based upon some soft config options. * @@ -1951,6 +1959,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; + int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2023,14 +2032,18 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - else - icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; + + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + icbp->icb_hardaddr = fcp->isp_loopid; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } + if (ownloopid) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + + icbp->icb_fwoptions2 = fcp->isp_xfwoptions; if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2093,6 +2106,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA; } + icbp->icb_fwoptions3 = fcp->isp_zfwoptions; if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } @@ -2132,6 +2146,9 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } } + if (ownloopid == 0) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; + } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2244,14 +2261,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + } + } - if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { - pi.vp_port_loopid = fcp2->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; - else - pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; - } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; @@ -2329,8 +2345,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) vp.vp_mod_ports[0].loopid = fcp->isp_loopid; if (isp->isp_confopts & ISP_CFG_OWNLOOPID) vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS; - else - vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS; } MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); From owner-svn-src-head@freebsd.org Thu Jul 27 15:51:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C343FDCDEB5; Thu, 27 Jul 2017 15:51:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904B17F8A0; Thu, 27 Jul 2017 15:51:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RFpur4050063; Thu, 27 Jul 2017 15:51:56 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RFpuLP050062; Thu, 27 Jul 2017 15:51:56 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201707271551.v6RFpuLP050062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 27 Jul 2017 15:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321623 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 321623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 15:51:57 -0000 Author: ken Date: Thu Jul 27 15:51:56 2017 New Revision: 321623 URL: https://svnweb.freebsd.org/changeset/base/321623 Log: Remove duplicate assignments from r321622. Submitted by: mav MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Jul 27 15:33:57 2017 (r321622) +++ head/sys/dev/isp/isp.c Thu Jul 27 15:51:56 2017 (r321623) @@ -2043,7 +2043,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) if (ownloopid) icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - icbp->icb_fwoptions2 = fcp->isp_xfwoptions; if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2106,7 +2105,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA; } - icbp->icb_fwoptions3 = fcp->isp_zfwoptions; if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } From owner-svn-src-head@freebsd.org Thu Jul 27 16:40:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192FFDAA54D; Thu, 27 Jul 2017 16:40:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D569081E9C; Thu, 27 Jul 2017 16:40:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RGeEPr069695; Thu, 27 Jul 2017 16:40:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RGeEgq069693; Thu, 27 Jul 2017 16:40:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707271640.v6RGeEgq069693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Jul 2017 16:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321625 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 321625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 16:40:16 -0000 Author: kib Date: Thu Jul 27 16:40:14 2017 New Revision: 321625 URL: https://svnweb.freebsd.org/changeset/base/321625 Log: Make the number of children for pctrie node available outside subr_pctrie.c. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D11435 Modified: head/sys/kern/subr_pctrie.c head/sys/sys/pctrie.h Modified: head/sys/kern/subr_pctrie.c ============================================================================== --- head/sys/kern/subr_pctrie.c Thu Jul 27 15:59:36 2017 (r321624) +++ head/sys/kern/subr_pctrie.c Thu Jul 27 16:40:14 2017 (r321625) @@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$"); #include #endif -/* - * These widths should allow the pointers to a node's children to fit within - * a single cache line. The extra levels from a narrow width should not be - * a problem thanks to path compression. - */ -#ifdef __LP64__ -#define PCTRIE_WIDTH 4 -#else -#define PCTRIE_WIDTH 3 -#endif - -#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) #define PCTRIE_MASK (PCTRIE_COUNT - 1) #define PCTRIE_LIMIT (howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1) Modified: head/sys/sys/pctrie.h ============================================================================== --- head/sys/sys/pctrie.h Thu Jul 27 15:59:36 2017 (r321624) +++ head/sys/sys/pctrie.h Thu Jul 27 16:40:14 2017 (r321625) @@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree) return (ptree->pt_root == 0); } +/* + * These widths should allow the pointers to a node's children to fit within + * a single cache line. The extra levels from a narrow width should not be + * a problem thanks to path compression. + */ +#ifdef __LP64__ +#define PCTRIE_WIDTH 4 +#else +#define PCTRIE_WIDTH 3 +#endif + +#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) + #endif /* _KERNEL */ #endif /* !_SYS_PCTRIE_H_ */ From owner-svn-src-head@freebsd.org Thu Jul 27 17:51:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6D1DAC1E4; Thu, 27 Jul 2017 17:51:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD008480B; Thu, 27 Jul 2017 17:51:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RHpp2e099010; Thu, 27 Jul 2017 17:51:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RHppVD099009; Thu, 27 Jul 2017 17:51:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707271751.v6RHppVD099009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 27 Jul 2017 17:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321626 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 321626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 17:51:52 -0000 Author: manu Date: Thu Jul 27 17:51:51 2017 New Revision: 321626 URL: https://svnweb.freebsd.org/changeset/base/321626 Log: Allwinner A64: fix typo 'pll_ddr0' is the dram parent, not 'pll_ddr' Modified: head/sys/arm/allwinner/clkng/ccu_a64.c Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Thu Jul 27 16:40:14 2017 (r321625) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Thu Jul 27 17:51:51 2017 (r321626) @@ -712,7 +712,7 @@ static struct clk_fixed_def *fixed_factor_clks[] = { static struct aw_clk_init init_clks[] = { {"ahb1", "pll_periph0", 0, false}, {"ahb2", "pll_periph0", 0, false}, - {"dram", "pll_ddr", 0, false}, + {"dram", "pll_ddr0", 0, false}, }; void From owner-svn-src-head@freebsd.org Thu Jul 27 20:45:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2C7DAF866; Thu, 27 Jul 2017 20:45:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87EE0640E8; Thu, 27 Jul 2017 20:45:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RKjfqK072431; Thu, 27 Jul 2017 20:45:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RKjfJJ072430; Thu, 27 Jul 2017 20:45:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707272045.v6RKjfJJ072430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Jul 2017 20:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321627 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 20:45:42 -0000 Author: kib Date: Thu Jul 27 20:45:41 2017 New Revision: 321627 URL: https://svnweb.freebsd.org/changeset/base/321627 Log: Make it possible to request nosys logging to console. New kern.lognosys values are 1 - log to ctty 2 - log to console 3 - log to both. Inspired by: eugen Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jul 27 17:51:51 2017 (r321626) +++ head/sys/kern/kern_sig.c Thu Jul 27 20:45:41 2017 (r321627) @@ -3579,9 +3579,14 @@ nosys(struct thread *td, struct nosys_args *args) PROC_LOCK(p); tdsignal(td, SIGSYS); PROC_UNLOCK(p); - if (kern_lognosys) + if (kern_lognosys == 1 || kern_lognosys == 3) { uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); + } + if (kern_lognosys == 2 || kern_lognosys == 3) { + printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, + td->td_sa.code); + } return (ENOSYS); } From owner-svn-src-head@freebsd.org Thu Jul 27 20:55:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F6CCDAFCC3; Thu, 27 Jul 2017 20:55:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF0A64684; Thu, 27 Jul 2017 20:55:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RKtWiO076432; Thu, 27 Jul 2017 20:55:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RKtVET076423; Thu, 27 Jul 2017 20:55:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707272055.v6RKtVET076423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 27 Jul 2017 20:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321628 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 321628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 20:55:33 -0000 Author: rmacklem Date: Thu Jul 27 20:55:31 2017 New Revision: 321628 URL: https://svnweb.freebsd.org/changeset/base/321628 Log: Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing. This patch defines a macro that checks for MNTK_UNMOUNTF and replaces explicit checks with this macro. It has no effect on semantics, but prepares the code for a future patch where there will also be a NFS specific flag for "forced dismount about to occur". Suggested by: kib MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfscl.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfs/nfs_commonkrpc.c Thu Jul 27 20:55:31 2017 (r321628) @@ -511,7 +511,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmo if (xidp != NULL) *xidp = 0; /* Reject requests while attempting a forced unmount. */ - if (nmp != NULL && (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)) { + if (nmp != NULL && NFSCL_FORCEDISM(nmp->nm_mountp)) { m_freem(nd->nd_mreq); return (ESTALE); } @@ -1231,7 +1231,7 @@ newnfs_sigintr(struct nfsmount *nmp, struct thread *td sigset_t tmpset; /* Terminate all requests while attempting a forced unmount. */ - if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) + if (NFSCL_FORCEDISM(nmp->nm_mountp)) return (EIO); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Jul 27 20:55:31 2017 (r321628) @@ -1839,7 +1839,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i lp->nfslock_lock |= NFSV4LOCK_LOCKWANTED; } while (lp->nfslock_lock & (NFSV4LOCK_LOCK | NFSV4LOCK_LOCKWANTED)) { - if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (mp != NULL && NFSCL_FORCEDISM(mp)) { lp->nfslock_lock &= ~NFSV4LOCK_LOCKWANTED; return (0); } @@ -1893,7 +1893,7 @@ nfsv4_relref(struct nfsv4lock *lp) * not wait for threads that want the exclusive lock. If priority needs * to be given to threads that need the exclusive lock, a call to nfsv4_lock() * with the 2nd argument == 0 should be done before calling nfsv4_getref(). - * If the mp argument is not NULL, check for MNTK_UNMOUNTF being set and + * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ APPLESTATIC void @@ -1908,7 +1908,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Wait for a lock held. */ while (lp->nfslock_lock & NFSV4LOCK_LOCK) { - if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) + if (mp != NULL && NFSCL_FORCEDISM(mp)) return; lp->nfslock_lock |= NFSV4LOCK_WANTED; if (isleptp) @@ -1916,7 +1916,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void (void) nfsmsleep(&lp->nfslock_lock, mutex, PZERO - 1, "nfsv4gr", NULL); } - if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) + if (mp != NULL && NFSCL_FORCEDISM(mp)) return; lp->nfslock_usecnt++; @@ -4197,9 +4197,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc * This RPC attempt will fail when it calls * newnfs_request(). */ - if (nmp != NULL && - (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) - != 0) { + if (nmp != NULL && NFSCL_FORCEDISM(nmp->nm_mountp)) { mtx_unlock(&sep->nfsess_mtx); return (ESTALE); } Modified: head/sys/fs/nfs/nfscl.h ============================================================================== --- head/sys/fs/nfs/nfscl.h Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfs/nfscl.h Thu Jul 27 20:55:31 2017 (r321628) @@ -59,6 +59,9 @@ struct nfsv4node { #define NFSCL_RENEW(l) (((l) < 2) ? 1 : ((l) / 2)) #define NFSCL_LEASE(r) ((r) * 2) +/* This macro checks to see if a forced dismount is about to occur. */ +#define NFSCL_FORCEDISM(m) (((m)->mnt_kern_flag & MNTK_UNMOUNTF) != 0) + /* * These flag bits are used for the argument to nfscl_fillsattr() to * indicate special handling of the attributes. Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Jul 27 20:55:31 2017 (r321628) @@ -1342,7 +1342,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre if ((nmp->nm_flag & NFSMNT_INT) == 0) intrflg = 0; - if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)) + if (NFSCL_FORCEDISM(nmp->nm_mountp)) intrflg = 1; if (intrflg) { slpflag = PCATCH; Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Jul 27 20:55:31 2017 (r321628) @@ -313,7 +313,7 @@ nfscl_ngetreopen(struct mount *mntp, u_int8_t *fhp, in *npp = NULL; /* For forced dismounts, just return error. */ - if ((mntp->mnt_kern_flag & MNTK_UNMOUNTF)) + if (NFSCL_FORCEDISM(mntp)) return (EINTR); MALLOC(nfhp, struct nfsfh *, sizeof (struct nfsfh) + fhsize, M_NFSFH, M_WAITOK); @@ -336,7 +336,7 @@ nfscl_ngetreopen(struct mount *mntp, u_int8_t *fhp, in * stopped and the MNTK_UNMOUNTF flag is set before doing * a vflush() with FORCECLOSE, we should be ok here. */ - if ((mntp->mnt_kern_flag & MNTK_UNMOUNTF)) + if (NFSCL_FORCEDISM(mntp)) error = EINTR; else { vfs_hash_ref(mntp, hash, td, &nvp, newnfs_vncmpf, nfhp); Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfsclient/nfs_clstate.c Thu Jul 27 20:55:31 2017 (r321628) @@ -803,7 +803,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP * allocate a new clientid and get out now. For the case where * clp != NULL, this is a harmless optimization. */ - if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (NFSCL_FORCEDISM(mp)) { NFSUNLOCKCLSTATE(); if (newclp != NULL) free(newclp, M_NFSCLCLIENT); @@ -843,7 +843,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP } NFSLOCKCLSTATE(); while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock && - (mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) + !NFSCL_FORCEDISM(mp)) igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR, mp); if (igotlock == 0) { @@ -858,10 +858,10 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP nfsv4_lock(&clp->nfsc_lock, 0, NULL, NFSCLSTATEMUTEXPTR, mp); nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, mp); } - if (igotlock == 0 && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (igotlock == 0 && NFSCL_FORCEDISM(mp)) { /* * Both nfsv4_lock() and nfsv4_getref() know to check - * for MNTK_UNMOUNTF and return without sleeping to + * for NFSCL_FORCEDISM() and return without sleeping to * wait for the exclusive lock to be released, since it * might be held by nfscl_umount() and we need to get out * now for that case and not wait until nfscl_umount() @@ -4844,7 +4844,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_ lyp->nfsly_timestamp = NFSD_MONOSEC + 120; } nfsv4_getref(&lyp->nfsly_lock, NULL, NFSCLSTATEMUTEXPTR, mp); - if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (NFSCL_FORCEDISM(mp)) { NFSUNLOCKCLSTATE(); if (tlyp != NULL) free(tlyp, M_NFSLAYOUT); @@ -4903,11 +4903,10 @@ nfscl_getlayout(struct nfsclclient *clp, uint8_t *fhp, do { igotlock = nfsv4_lock(&lyp->nfsly_lock, 1, NULL, NFSCLSTATEMUTEXPTR, mp); - } while (igotlock == 0 && - (mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0); + } while (igotlock == 0 && !NFSCL_FORCEDISM(mp)); *retflpp = NULL; } - if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (NFSCL_FORCEDISM(mp)) { lyp = NULL; *recalledp = 1; } @@ -5298,7 +5297,7 @@ nfscl_layoutcommit(vnode_t vp, NFSPROC_T *p) return (EPERM); } nfsv4_getref(&lyp->nfsly_lock, NULL, NFSCLSTATEMUTEXPTR, mp); - if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (NFSCL_FORCEDISM(mp)) { NFSUNLOCKCLSTATE(); return (EPERM); } Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Jul 27 20:55:31 2017 (r321628) @@ -1775,7 +1775,7 @@ nfs_sync(struct mount *mp, int waitfor) * the umount(2) syscall doesn't get stuck in VFS_SYNC() before * calling VFS_UNMOUNT(). */ - if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + if (NFSCL_FORCEDISM(mp)) { MNT_IUNLOCK(mp); return (EBADF); } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Jul 27 20:45:41 2017 (r321627) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Jul 27 20:55:31 2017 (r321628) @@ -663,7 +663,7 @@ nfs_close(struct vop_close_args *ap) int error = 0, ret, localcred = 0; int fmode = ap->a_fflag; - if ((vp->v_mount->mnt_kern_flag & MNTK_UNMOUNTF)) + if (NFSCL_FORCEDISM(vp->v_mount)) return (0); /* * During shutdown, a_cred isn't valid, so just use root. From owner-svn-src-head@freebsd.org Thu Jul 27 21:21:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A37FDB09EF; Thu, 27 Jul 2017 21:21:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57B096553A; Thu, 27 Jul 2017 21:21:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RLLh7q087722; Thu, 27 Jul 2017 21:21:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RLLhFv087720; Thu, 27 Jul 2017 21:21:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707272121.v6RLLhFv087720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 27 Jul 2017 21:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321629 - in head/sys: dev/bnxt net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys: dev/bnxt net X-SVN-Commit-Revision: 321629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 21:21:44 -0000 Author: sbruno Date: Thu Jul 27 21:21:43 2017 New Revision: 321629 URL: https://svnweb.freebsd.org/changeset/base/321629 Log: Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they were redundant and not being used to set anything up. Submitted by: Matt Macy Reported by: Jeb Cramer Sponsored by: Limelight Networks Modified: head/sys/dev/bnxt/if_bnxt.c head/sys/net/iflib.h Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 20:55:31 2017 (r321628) +++ head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 21:21:43 2017 (r321629) @@ -761,12 +761,12 @@ bnxt_attach_pre(if_ctx_t ctx) scctx->isc_nrxd[1]; scctx->isc_rxqsizes[2] = sizeof(struct rx_prod_pkt_bd) * scctx->isc_nrxd[2]; - scctx->isc_max_rxqsets = min(pci_msix_count(softc->dev)-1, + scctx->isc_nrxqsets_max = min(pci_msix_count(softc->dev)-1, softc->func.max_cp_rings - 1); - scctx->isc_max_rxqsets = min(scctx->isc_max_rxqsets, + scctx->isc_nrxqsets_max = min(scctx->isc_nrxqsets_max, softc->func.max_rx_rings); - scctx->isc_max_txqsets = min(softc->func.max_rx_rings, - softc->func.max_cp_rings - scctx->isc_max_rxqsets - 1); + scctx->isc_ntxqsets_max = min(softc->func.max_rx_rings, + softc->func.max_cp_rings - scctx->isc_nrxqsets_max - 1); scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE; scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Thu Jul 27 20:55:31 2017 (r321628) +++ head/sys/net/iflib.h Thu Jul 27 21:21:43 2017 (r321629) @@ -200,8 +200,6 @@ typedef struct if_softc_ctx { uint8_t isc_txd_size[8]; uint8_t isc_rxd_size[8]; - int isc_max_txqsets; - int isc_max_rxqsets; int isc_tx_tso_segments_max; int isc_tx_tso_size_max; int isc_tx_tso_segsize_max; From owner-svn-src-head@freebsd.org Thu Jul 27 22:53:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D072DB2B61; Thu, 27 Jul 2017 22:53:48 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1269C683DE; Thu, 27 Jul 2017 22:53:48 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RMrlpH025260; Thu, 27 Jul 2017 22:53:47 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RMrl90025259; Thu, 27 Jul 2017 22:53:47 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707272253.v6RMrl90025259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 27 Jul 2017 22:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321630 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 22:53:48 -0000 Author: sbruno Date: Thu Jul 27 22:53:47 2017 New Revision: 321630 URL: https://svnweb.freebsd.org/changeset/base/321630 Log: Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting when m_collapse() fails. Submitted by: krzystof.galazka@intel.com Reviewed by: Jeb Cramer Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D11476 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jul 27 21:21:43 2017 (r321629) +++ head/sys/net/iflib.c Thu Jul 27 22:53:47 2017 (r321630) @@ -2975,6 +2975,8 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag #endif ifsd_m[next] = m; while (buflen > 0) { + if (i >= max_segs) + goto err; max_sgsize = MIN(buflen, maxsegsz); curaddr = pmap_kextract(vaddr); sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); @@ -2984,8 +2986,6 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag vaddr += sgsize; buflen -= sgsize; i++; - if (i >= max_segs) - goto err; } count++; tmp = m; From owner-svn-src-head@freebsd.org Thu Jul 27 23:01:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF16DB2E28; Thu, 27 Jul 2017 23:01:09 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBF6A68669; Thu, 27 Jul 2017 23:01:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RN171R028569; Thu, 27 Jul 2017 23:01:07 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RN17oh028568; Thu, 27 Jul 2017 23:01:07 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707272301.v6RN17oh028568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 27 Jul 2017 23:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321631 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 321631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 23:01:09 -0000 Author: sbruno Date: Thu Jul 27 23:01:07 2017 New Revision: 321631 URL: https://svnweb.freebsd.org/changeset/base/321631 Log: Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX queue lock when the uppoer stack is called inside TCP_LRO Submitted by: Kevin Bowling Reviewed by: erj Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11724 Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 22:53:47 2017 (r321630) +++ head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 23:01:07 2017 (r321631) @@ -1400,9 +1400,7 @@ ixl_rx_input(struct rx_ring *rxr, struct ifnet *ifp, s return; } #endif - IXL_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); - IXL_RX_LOCK(rxr); } @@ -1730,7 +1728,9 @@ next_desc: /* Now send to the stack or do LRO */ if (sendmp != NULL) { rxr->next_check = i; + IXL_RX_UNLOCK(rxr); ixl_rx_input(rxr, ifp, sendmp, ptype); + IXL_RX_LOCK(rxr); i = rxr->next_check; } @@ -1747,6 +1747,8 @@ next_desc: rxr->next_check = i; + IXL_RX_UNLOCK(rxr); + #if defined(INET6) || defined(INET) /* * Flush any outstanding LRO work @@ -1762,7 +1764,6 @@ next_desc: #endif #endif /* defined(INET6) || defined(INET) */ - IXL_RX_UNLOCK(rxr); return (FALSE); } From owner-svn-src-head@freebsd.org Thu Jul 27 23:14:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7037DDB33B6; Thu, 27 Jul 2017 23:14:18 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D67168FCD; Thu, 27 Jul 2017 23:14:18 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6RNEHax033482; Thu, 27 Jul 2017 23:14:17 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6RNEHwQ033479; Thu, 27 Jul 2017 23:14:17 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201707272314.v6RNEHwQ033479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 27 Jul 2017 23:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321633 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: zbb X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 321633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 27 Jul 2017 23:14:18 -0000 Author: zbb Date: Thu Jul 27 23:14:17 2017 New Revision: 321633 URL: https://svnweb.freebsd.org/changeset/base/321633 Log: Fix TEX index acquisition using L2 attributes The TEX index is selected using (TEX0 C B) bits from the L2 descriptor. Use correct index by masking and shifting those bits accordingly. Differential Revision: https://reviews.freebsd.org/D11703 Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pte-v6.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu Jul 27 23:09:12 2017 (r321632) +++ head/sys/arm/arm/pmap-v6.c Thu Jul 27 23:14:17 2017 (r321633) @@ -525,8 +525,8 @@ pmap_remap_vm_attr(vm_memattr_t old_attr, vm_memattr_t int old_idx, new_idx; /* Map VM memattrs to indexes to tex_class table. */ - old_idx = pte2_attr_tab[(int)old_attr]; - new_idx = pte2_attr_tab[(int)new_attr]; + old_idx = PTE2_ATTR2IDX(pte2_attr_tab[(int)old_attr]); + new_idx = PTE2_ATTR2IDX(pte2_attr_tab[(int)new_attr]); /* Replace TEX attribute and apply it. */ tex_class[old_idx] = tex_class[new_idx]; Modified: head/sys/arm/include/pte-v6.h ============================================================================== --- head/sys/arm/include/pte-v6.h Thu Jul 27 23:09:12 2017 (r321632) +++ head/sys/arm/include/pte-v6.h Thu Jul 27 23:14:17 2017 (r321633) @@ -149,10 +149,12 @@ #define L2_NX 0x00000001 /* Not executable */ #define L2_B 0x00000004 /* Bufferable page */ #define L2_C 0x00000008 /* Cacheable page */ +#define L2_CB_SHIFT 2 /* C,B bit field shift */ #define L2_AP(x) ((x) << 4) #define L2_AP0 0x00000010 /* access permissions bit 0*/ #define L2_AP1 0x00000020 /* access permissions bit 1*/ -#define L2_TEX(x) ((x) << 6) /* type extension */ +#define L2_TEX_SHIFT 6 /* type extension field shift */ +#define L2_TEX(x) ((x) << L2_TEX_SHIFT) /* type extension */ #define L2_TEX0 0x00000040 /* type extension bit 0 */ #define L2_TEX1 0x00000080 /* type extension bit 1 */ #define L2_TEX2 0x00000100 /* type extension bit 2 */ @@ -271,6 +273,10 @@ #define PTE2_FRAME L2_S_FRAME #define PTE2_ATTR_MASK (L2_TEX0 | L2_C | L2_B) +/* PTE2 attributes to TEX class index: (TEX0 C B) */ +#define PTE2_ATTR2IDX(attr) \ + ((((attr) & (L2_C | L2_B)) >> L2_CB_SHIFT) | \ + (((attr) & L2_TEX0) >> (L2_TEX_SHIFT - L2_CB_SHIFT))) #define PTE2_AP_KR (PTE2_RO | PTE2_NM) #define PTE2_AP_KRW 0 From owner-svn-src-head@freebsd.org Fri Jul 28 01:17:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DF9FDB56BD; Fri, 28 Jul 2017 01:17:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F02626C27E; Fri, 28 Jul 2017 01:17:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S1Hd0e082891; Fri, 28 Jul 2017 01:17:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S1Hdwo082890; Fri, 28 Jul 2017 01:17:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707280117.v6S1Hdwo082890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 28 Jul 2017 01:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321635 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 321635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 01:17:40 -0000 Author: adrian Date: Fri Jul 28 01:17:38 2017 New Revision: 321635 URL: https://svnweb.freebsd.org/changeset/base/321635 Log: [ar71xx] get rid of ath_pci - it's built as a module now. Modified: head/sys/mips/conf/TL-WDR4300 Modified: head/sys/mips/conf/TL-WDR4300 ============================================================================== --- head/sys/mips/conf/TL-WDR4300 Thu Jul 27 23:15:24 2017 (r321634) +++ head/sys/mips/conf/TL-WDR4300 Fri Jul 28 01:17:38 2017 (r321635) @@ -45,8 +45,7 @@ options GEOM_UZIP # Used for the static uboot partition map device geom_map -# yes, this board has a PCI connected atheros device -device ath_pci +# Yes, this board has a PCI connected atheros device options AR71XX_ATH_EEPROM device firmware # Used by the above options ATH_EEPROM_FIRMWARE From owner-svn-src-head@freebsd.org Fri Jul 28 01:59:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20D4BDB63B5; Fri, 28 Jul 2017 01:59:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 458716D6E1; Fri, 28 Jul 2017 01:59:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S1xrua099663; Fri, 28 Jul 2017 01:59:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S1xr9P099662; Fri, 28 Jul 2017 01:59:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707280159.v6S1xr9P099662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Jul 2017 01:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321636 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 321636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 01:59:55 -0000 Author: imp Date: Fri Jul 28 01:59:53 2017 New Revision: 321636 URL: https://svnweb.freebsd.org/changeset/base/321636 Log: Properly expand shell glob characters in NANO_PACKAGE_LIST. The defualt NANO_PACKAGE_LIST is *, which fails to work properly. Expand glob characters and make sure that we install the special pkg package first. Sponsored by: Netflix Submitted by: wout at canodus dot be PR: 219405 MFC After: 3 days Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:17:38 2017 (r321635) +++ head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:59:53 2017 (r321636) @@ -780,7 +780,6 @@ cust_pkgng ( ) ( echo "FAILED: need a pkg/ package for bootstrapping" exit 2 fi - NANO_PACKAGE_LIST="${_NANO_PKG_PACKAGE} ${NANO_PACKAGE_LIST}" # Mount packages into chroot mkdir -p ${NANO_WORLDDIR}/_.p @@ -788,14 +787,25 @@ cust_pkgng ( ) ( trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT - # Install packages - todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')" - echo "=== TODO: $todo" - echo "${NANO_PACKAGE_LIST}" - echo "===" - for _PKG in ${NANO_PACKAGE_LIST}; do - CR "${PKGCMD} add /_.p/${_PKG}" - done + # Install pkg-* package + CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" + + ( + # Expand any glob characters in pacakge list + cd "${NANO_PACKAGE_DIR}" + _PKGS=`find ${NANO_PACKAGE_LIST} -not -name "${_NANO_PKG_PACKAGE}" -print | sort | uniq` + + # Show todo + todo=`echo "$_PKGS" | wc -l` + echo "=== TODO: $todo" + echo "$_PKGS" + echo "===" + + # Install packages + for _PKG in $_PKGS; do + CR "${PKGCMD} add /_.p/${_PKG}" + done + ) CR0 "${PKGCMD} info" From owner-svn-src-head@freebsd.org Fri Jul 28 01:59:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A96A0DB63D4; Fri, 28 Jul 2017 01:59:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788166D6F5; Fri, 28 Jul 2017 01:59:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S1xwQC099729; Fri, 28 Jul 2017 01:59:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S1xwNo099728; Fri, 28 Jul 2017 01:59:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707280159.v6S1xwNo099728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Jul 2017 01:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321637 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 321637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 01:59:59 -0000 Author: imp Date: Fri Jul 28 01:59:58 2017 New Revision: 321637 URL: https://svnweb.freebsd.org/changeset/base/321637 Log: Ensure that ordinary files that happen to start with .git, .hg and .cvs into the image. This makes .gitignore files in the working tree appear in the final tree... PR: 192178 Submitted by: Jason Unovitch Sponsored by: Netflix MFC After: 3 days Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:59:53 2017 (r321636) +++ head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:59:58 2017 (r321637) @@ -634,7 +634,7 @@ populate_slice ( ) ( if [ -n "${dir}" -a -d "${dir}" ]; then echo "Populating ${lbl} from ${dir}" cd "${dir}" - find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -dumpv ${mnt} fi df -i ${mnt} nano_umount ${mnt} @@ -742,7 +742,7 @@ cust_allow_ssh_root ( ) ( cust_install_files ( ) ( cd "${NANO_TOOLS}/Files" - find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -Ldumpv ${NANO_WORLDDIR} if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE} From owner-svn-src-head@freebsd.org Fri Jul 28 02:00:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6064DB63FB; Fri, 28 Jul 2017 02:00:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74D286D75E; Fri, 28 Jul 2017 02:00:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S203pP099844; Fri, 28 Jul 2017 02:00:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S203wm099842; Fri, 28 Jul 2017 02:00:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201707280200.v6S203wm099842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Jul 2017 02:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321638 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 321638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 02:00:04 -0000 Author: imp Date: Fri Jul 28 02:00:03 2017 New Revision: 321638 URL: https://svnweb.freebsd.org/changeset/base/321638 Log: Allow _.disk.image to be specified. Submitted by: ask at develooper dot com (reworked to new structure) PR: 199191 Sponsored by: Netflix MFC After: 3 days Modified: head/tools/tools/nanobsd/defaults.sh head/tools/tools/nanobsd/legacy.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jul 28 01:59:58 2017 (r321637) +++ head/tools/tools/nanobsd/defaults.sh Fri Jul 28 02:00:03 2017 (r321638) @@ -71,6 +71,7 @@ NANO_PMAKE="make -j 3" # The default name for any image we create. NANO_IMGNAME="_.disk.full" +NANO_IMG1NAME="_.disk.image" # Options to put in make.conf during buildworld only CONF_BUILD=' ' @@ -652,7 +653,7 @@ last_orders ( ) ( # Redefine this function with any last orders you may have # after the build completed, for instance to copy the finished # image to a more convenient place: - # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk + # cp ${NANO_DISKIMGDIR}/${NANO_IMG1NAME} /home/ftp/pub/nanobsd.disk true ) @@ -919,6 +920,7 @@ set_defaults_and_export ( ) { export_var NANO_HEADS export_var NANO_IMAGES export_var NANO_IMGNAME + export_var NANO_IMG1NAME export_var NANO_MAKE export_var NANO_MAKE_CONF_BUILD export_var NANO_MAKE_CONF_INSTALL Modified: head/tools/tools/nanobsd/legacy.sh ============================================================================== --- head/tools/tools/nanobsd/legacy.sh Fri Jul 28 01:59:58 2017 (r321637) +++ head/tools/tools/nanobsd/legacy.sh Fri Jul 28 02:00:03 2017 (r321638) @@ -191,8 +191,9 @@ create_diskimage ( ) ( fi if ${do_copyout_partition} ; then - echo "Writing out _.disk.image..." - dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + echo "Writing out ${NANO_IMG1NAME}..." + dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} \ + of=${NANO_DISKIMGDIR}/${NANO_IMG1NAME} bs=64k fi mdconfig -d -u $MD From owner-svn-src-head@freebsd.org Fri Jul 28 03:14:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF9DDBC1AC; Fri, 28 Jul 2017 03:14:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C5D370B36; Fri, 28 Jul 2017 03:14:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S3EVU2033834; Fri, 28 Jul 2017 03:14:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S3EVau033833; Fri, 28 Jul 2017 03:14:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707280314.v6S3EVau033833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Jul 2017 03:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321639 - head/sys/dev/ksyms X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ksyms X-SVN-Commit-Revision: 321639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 03:14:32 -0000 Author: markj Date: Fri Jul 28 03:14:31 2017 New Revision: 321639 URL: https://svnweb.freebsd.org/changeset/base/321639 Log: Restrict permissions on /dev/ksyms to 0400. The ksyms(4) device was added specifically for use by lockstat(1), which as a DTrace consumer must run as root. Discussed with: emaste MFC after: 3 days Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Fri Jul 28 02:00:03 2017 (r321638) +++ head/sys/dev/ksyms/ksyms.c Fri Jul 28 03:14:31 2017 (r321639) @@ -592,7 +592,7 @@ ksyms_modevent(module_t mod __unused, int type, void * case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0444, KSYMS_DNAME); + 0400, KSYMS_DNAME); break; case MOD_UNLOAD: From owner-svn-src-head@freebsd.org Fri Jul 28 03:18:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CE3DBC233; Fri, 28 Jul 2017 03:18:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8C5B70CA6; Fri, 28 Jul 2017 03:18:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S3IIHn034008; Fri, 28 Jul 2017 03:18:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S3IIxK034007; Fri, 28 Jul 2017 03:18:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707280318.v6S3IIxK034007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Jul 2017 03:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321640 - head/sys/dev/ksyms X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ksyms X-SVN-Commit-Revision: 321640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 03:18:20 -0000 Author: markj Date: Fri Jul 28 03:18:18 2017 New Revision: 321640 URL: https://svnweb.freebsd.org/changeset/base/321640 Log: Fix style bugs in ksyms.c. No functional change intended. MFC after: 3 days Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Fri Jul 28 03:14:31 2017 (r321639) +++ head/sys/dev/ksyms/ksyms.c Fri Jul 28 03:18:18 2017 (r321640) @@ -62,41 +62,40 @@ #define STR_SYMTAB ".symtab" #define STR_STRTAB ".strtab" -#define STR_SHSTRTAB ".shstrtab" +#define STR_SHSTRTAB ".shstrtab" #define KSYMS_DNAME "ksyms" -static d_open_t ksyms_open; -static d_read_t ksyms_read; -static d_close_t ksyms_close; -static d_ioctl_t ksyms_ioctl; -static d_mmap_t ksyms_mmap; +static d_open_t ksyms_open; +static d_read_t ksyms_read; +static d_close_t ksyms_close; +static d_ioctl_t ksyms_ioctl; +static d_mmap_t ksyms_mmap; static struct cdevsw ksyms_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = ksyms_open, - .d_close = ksyms_close, - .d_read = ksyms_read, - .d_ioctl = ksyms_ioctl, - .d_mmap = ksyms_mmap, - .d_name = KSYMS_DNAME + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, + .d_open = ksyms_open, + .d_close = ksyms_close, + .d_read = ksyms_read, + .d_ioctl = ksyms_ioctl, + .d_mmap = ksyms_mmap, + .d_name = KSYMS_DNAME }; struct ksyms_softc { LIST_ENTRY(ksyms_softc) sc_list; - vm_offset_t sc_uaddr; - size_t sc_usize; + vm_offset_t sc_uaddr; + size_t sc_usize; pmap_t sc_pmap; struct proc *sc_proc; }; -static struct mtx ksyms_mtx; -static struct cdev *ksyms_dev; -static LIST_HEAD(, ksyms_softc) ksyms_list = - LIST_HEAD_INITIALIZER(ksyms_list); +static struct mtx ksyms_mtx; +static struct cdev *ksyms_dev; +static LIST_HEAD(, ksyms_softc) ksyms_list = LIST_HEAD_INITIALIZER(ksyms_list); -static const char ksyms_shstrtab[] = +static const char ksyms_shstrtab[] = "\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0"; struct ksyms_hdr { @@ -106,7 +105,7 @@ struct ksyms_hdr { Elf_Shdr kh_shdr[SHDR_NUM]; char kh_shstrtab[sizeof(ksyms_shstrtab)]; }; - + struct tsizes { size_t ts_symsz; size_t ts_strsz; @@ -123,7 +122,7 @@ static MALLOC_DEFINE(M_KSYMS, "KSYMS", "Kernel Symbol /* * Get the symbol and string table sizes for a kernel module. Add it to the - * running total. + * running total. */ static int ksyms_size_permod(linker_file_t lf, void *arg) @@ -132,35 +131,36 @@ ksyms_size_permod(linker_file_t lf, void *arg) const Elf_Sym *symtab; caddr_t strtab; long syms; - + ts = arg; - + syms = LINKER_SYMTAB_GET(lf, &symtab); ts->ts_symsz += syms * sizeof(Elf_Sym); ts->ts_strsz += LINKER_STRTAB_GET(lf, &strtab); - + return (0); } /* * For kernel module get the symbol and string table sizes, returning the - * totals in *ts. + * totals in *ts. */ -static void +static void ksyms_size_calc(struct tsizes *ts) { + ts->ts_symsz = 0; ts->ts_strsz = 0; - - (void) linker_file_foreach(ksyms_size_permod, ts); + + (void)linker_file_foreach(ksyms_size_permod, ts); } -#define KSYMS_EMIT(src, des, sz) do { \ - copyout(src, (void *)des, sz); \ - des += sz; \ - } while (0) +#define KSYMS_EMIT(src, des, sz) do { \ + copyout(src, (void *)des, sz); \ + des += sz; \ +} while (0) -#define SYMBLKSZ 256 * sizeof (Elf_Sym) +#define SYMBLKSZ (256 * sizeof(Elf_Sym)) /* * For a kernel module, add the symbol and string tables into the @@ -169,6 +169,7 @@ ksyms_size_calc(struct tsizes *ts) static int ksyms_add(linker_file_t lf, void *arg) { + char *buf; struct toffsets *to; const Elf_Sym *symtab; Elf_Sym *symp; @@ -176,43 +177,42 @@ ksyms_add(linker_file_t lf, void *arg) long symsz; size_t strsz, numsyms; linker_symval_t symval; - char *buf; int i, nsyms, len; - + to = arg; - + MOD_SLOCK; numsyms = LINKER_SYMTAB_GET(lf, &symtab); strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); - + buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); - + while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); - /* - * Fix up symbol table for kernel modules: - * string offsets need adjusted + /* + * Fix up symbol table for kernel modules: + * string offsets need adjusted * symbol values made absolute */ symp = (Elf_Sym *) buf; - nsyms = len / sizeof (Elf_Sym); + nsyms = len / sizeof(Elf_Sym); for (i = 0; i < nsyms; i++) { symp[i].st_name += to->to_stridx; - if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, - (c_linker_sym_t) &symtab[i], &symval) == 0) { - symp[i].st_value = (uintptr_t) symval.value; + if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, + (c_linker_sym_t)&symtab[i], &symval) == 0) { + symp[i].st_value = (uintptr_t)symval.value; } } - if (len > to->to_resid) { + if (len > to->to_resid) { MOD_SUNLOCK; free(buf, M_KSYMS); return (ENXIO); - } else - to->to_resid -= len; + } + to->to_resid -= len; KSYMS_EMIT(buf, to->to_symoff, len); symtab += nsyms; @@ -220,14 +220,13 @@ ksyms_add(linker_file_t lf, void *arg) } free(buf, M_KSYMS); MOD_SUNLOCK; - + if (strsz > to->to_resid) return (ENXIO); - else - to->to_resid -= strsz; + to->to_resid -= strsz; KSYMS_EMIT(strtab, to->to_stroff, strsz); to->to_stridx += strsz; - + return (0); } @@ -239,16 +238,14 @@ ksyms_add(linker_file_t lf, void *arg) static int ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, size_t resid) { - struct ksyms_hdr *hdr; - struct toffsets to; + struct toffsets to; int error = 0; - /* Be kernel stack friendly */ - hdr = malloc(sizeof (*hdr), M_KSYMS, M_WAITOK|M_ZERO); + hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); - /* - * Create the ELF header. + /* + * Create the ELF header. */ hdr->kh_ehdr.e_ident[EI_PAD] = 0; hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -269,32 +266,32 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_ehdr.e_flags = 0; hdr->kh_ehdr.e_ehsize = sizeof(Elf_Ehdr); hdr->kh_ehdr.e_phentsize = sizeof(Elf_Phdr); - hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ + hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ hdr->kh_ehdr.e_shentsize = sizeof(Elf_Shdr); hdr->kh_ehdr.e_shnum = SHDR_NUM; hdr->kh_ehdr.e_shstrndx = SHDR_SHSTRTAB; - /* - * Add both the text and data Program headers. + /* + * Add both the text and data program headers. */ hdr->kh_txtphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .text addr/size here? */ - hdr->kh_txtphdr.p_vaddr = 0; - hdr->kh_txtphdr.p_memsz = 0; + hdr->kh_txtphdr.p_vaddr = 0; + hdr->kh_txtphdr.p_memsz = 0; hdr->kh_txtphdr.p_flags = PF_R | PF_X; - + hdr->kh_datphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .data addr/size here? */ - hdr->kh_datphdr.p_vaddr = 0; - hdr->kh_datphdr.p_memsz = 0; + hdr->kh_datphdr.p_vaddr = 0; + hdr->kh_datphdr.p_memsz = 0; hdr->kh_datphdr.p_flags = PF_R | PF_W | PF_X; - /* - * Add the Section headers: null, symtab, strtab, shstrtab, + /* + * Add the section headers: null, symtab, strtab, shstrtab. */ /* First section header - null */ - + /* Second section header - symtab */ hdr->kh_shdr[SHDR_SYMTAB].sh_name = 1; /* String offset (skip null) */ hdr->kh_shdr[SHDR_SYMTAB].sh_type = SHT_SYMTAB; @@ -302,31 +299,31 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SYMTAB].sh_addr = 0; hdr->kh_shdr[SHDR_SYMTAB].sh_offset = sizeof(*hdr); hdr->kh_shdr[SHDR_SYMTAB].sh_size = ts->ts_symsz; - hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; - hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); + hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; + hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); hdr->kh_shdr[SHDR_SYMTAB].sh_addralign = sizeof(long); hdr->kh_shdr[SHDR_SYMTAB].sh_entsize = sizeof(Elf_Sym); /* Third section header - strtab */ - hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); + hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); hdr->kh_shdr[SHDR_STRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_STRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_STRTAB].sh_offset = - hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; + hdr->kh_shdr[SHDR_STRTAB].sh_offset = + hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; hdr->kh_shdr[SHDR_STRTAB].sh_size = ts->ts_strsz; hdr->kh_shdr[SHDR_STRTAB].sh_link = 0; hdr->kh_shdr[SHDR_STRTAB].sh_info = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addralign = sizeof(char); hdr->kh_shdr[SHDR_STRTAB].sh_entsize = 0; - + /* Fourth section - shstrtab */ hdr->kh_shdr[SHDR_SHSTRTAB].sh_name = 1 + sizeof(STR_SYMTAB) + sizeof(STR_STRTAB); hdr->kh_shdr[SHDR_SHSTRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_SHSTRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_SHSTRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = + hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = offsetof(struct ksyms_hdr, kh_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_size = sizeof(ksyms_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_link = 0; @@ -334,9 +331,9 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SHSTRTAB].sh_addralign = 0 /* sizeof(char) */; hdr->kh_shdr[SHDR_SHSTRTAB].sh_entsize = 0; - /* Copy shstrtab into the header */ + /* Copy shstrtab into the header. */ bcopy(ksyms_shstrtab, hdr->kh_shstrtab, sizeof(ksyms_shstrtab)); - + to.to_symoff = uaddr + hdr->kh_shdr[SHDR_SYMTAB].sh_offset; to.to_stroff = uaddr + hdr->kh_shdr[SHDR_STRTAB].sh_offset; to.to_stridx = 0; @@ -346,13 +343,13 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s } to.to_resid = resid - sizeof(struct ksyms_hdr); - /* Emit Header */ + /* emit header */ copyout(hdr, (void *)uaddr, sizeof(struct ksyms_hdr)); - + free(hdr, M_KSYMS); - /* Add symbol and string tables for each kernelmodule */ - error = linker_file_foreach(ksyms_add, &to); + /* Add symbol and string tables for each kernel module. */ + error = linker_file_foreach(ksyms_add, &to); if (to.to_resid != 0) return (ENXIO); @@ -365,7 +362,7 @@ ksyms_cdevpriv_dtr(void *data) { struct ksyms_softc *sc; - sc = (struct ksyms_softc *)data; + sc = (struct ksyms_softc *)data; mtx_lock(&ksyms_mtx); LIST_REMOVE(sc, sc_list); @@ -373,19 +370,18 @@ ksyms_cdevpriv_dtr(void *data) free(sc, M_KSYMS); } -/* ARGSUSED */ static int ksyms_open(struct cdev *dev, int flags, int fmt __unused, struct thread *td) { struct tsizes ts; + struct ksyms_softc *sc; size_t total_elf_sz; int error, try; - struct ksyms_softc *sc; - - /* - * Limit one open() per process. The process must close() - * before open()'ing again. - */ + + /* + * Limit one open() per process. The process must close() + * before open()'ing again. + */ mtx_lock(&ksyms_mtx); LIST_FOREACH(sc, &ksyms_list, sc_list) { if (sc->sc_proc == td->td_proc) { @@ -394,9 +390,7 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus } } - sc = (struct ksyms_softc *) malloc(sizeof (*sc), M_KSYMS, - M_NOWAIT|M_ZERO); - + sc = malloc(sizeof(*sc), M_KSYMS, M_NOWAIT | M_ZERO); if (sc == NULL) { mtx_unlock(&ksyms_mtx); return (ENOMEM); @@ -407,41 +401,39 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus mtx_unlock(&ksyms_mtx); error = devfs_set_cdevpriv(sc, ksyms_cdevpriv_dtr); - if (error) + if (error != 0) goto failed; /* - * MOD_SLOCK doesn't work here (because of a lock reversal with - * KLD_SLOCK). Therefore, simply try upto 3 times to get a "clean" + * MOD_SLOCK doesn't work here (because of a lock reversal with + * KLD_SLOCK). Therefore, simply try up to 3 times to get a "clean" * snapshot of the kernel symbol table. This should work fine in the * rare case of a kernel module being loaded/unloaded at the same - * time. + * time. */ - for(try = 0; try < 3; try++) { + for (try = 0; try < 3; try++) { /* - * Map a buffer in the calling process memory space and - * create a snapshot of the kernel symbol table in it. - */ - + * Map a buffer in the calling process memory space and + * create a snapshot of the kernel symbol table in it. + */ + /* Compute the size of buffer needed. */ ksyms_size_calc(&ts); - total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + - ts.ts_strsz; + total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + + ts.ts_strsz; - error = copyout_map(td, &(sc->sc_uaddr), - (vm_size_t) total_elf_sz); - if (error) + error = copyout_map(td, &sc->sc_uaddr, (vm_size_t)total_elf_sz); + if (error != 0) break; - sc->sc_usize = total_elf_sz; + sc->sc_usize = total_elf_sz; - error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); - if (!error) { - /* Successful Snapshot */ - return (0); - } - - /* Snapshot failed, unmap the memory and try again */ - (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); + if (error == 0) + /* successful snapshot */ + return (0); + + /* Snapshot failed, unmap the memory and try again. */ + (void)copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -449,30 +441,28 @@ failed: return (error); } -/* ARGSUSED */ static int ksyms_read(struct cdev *dev, struct uio *uio, int flags __unused) { - int error; - size_t len, sz; struct ksyms_softc *sc; - off_t off; char *buf; + off_t off; + size_t len, sz; vm_size_t ubase; - + int error; + error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); - + off = uio->uio_offset; - len = uio->uio_resid; - + len = uio->uio_resid; + if (off < 0 || off > sc->sc_usize) return (EFAULT); - if (len > (sc->sc_usize - off)) + if (len > sc->sc_usize - off) len = sc->sc_usize - off; - if (len == 0) return (0); @@ -485,16 +475,14 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag ubase = sc->sc_uaddr + off; while (len) { - sz = min(PAGE_SIZE, len); - if (copyin((void *)ubase, buf, sz)) - error = EFAULT; + if (copyin((void *)ubase, buf, sz) != 0) + error = EFAULT; else error = uiomove(buf, sz, uio); - - if (error) + if (error != 0) break; - + len -= sz; ubase += sz; } @@ -503,27 +491,25 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag return (error); } -/* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, struct thread *td __unused) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); switch (cmd) { case KIOCGSIZE: - /* + /* * Return the size (in bytes) of the symbol table * snapshot. */ *(size_t *)data = sc->sc_usize; break; - case KIOCGADDR: /* * Return the address of the symbol table snapshot. @@ -531,7 +517,6 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data */ *(void **)data = (void *)sc->sc_uaddr; break; - default: error = ENOTTY; break; @@ -540,71 +525,64 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (error); } -/* ARGUSED */ static int ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot __unused, vm_memattr_t *memattr __unused) + int prot __unused, vm_memattr_t *memattr __unused) { - struct ksyms_softc *sc; + struct ksyms_softc *sc; int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* * XXX mmap() will actually map the symbol table into the process * address space again. */ - if (offset > round_page(sc->sc_usize) || - (*paddr = pmap_extract(sc->sc_pmap, - (vm_offset_t)sc->sc_uaddr + offset)) == 0) + if (offset > round_page(sc->sc_usize) || + (*paddr = pmap_extract(sc->sc_pmap, + (vm_offset_t)sc->sc_uaddr + offset)) == 0) return (-1); return (0); } -/* ARGUSED */ static int ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused, - struct thread *td) + struct thread *td) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* Unmap the buffer from the process address space. */ - error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); - - return (error); + return (copyout_unmap(td, sc->sc_uaddr, sc->sc_usize)); } -/* ARGSUSED */ static int ksyms_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; + int error; + error = 0; switch (type) { case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, KSYMS_DNAME); break; - case MOD_UNLOAD: if (!LIST_EMPTY(&ksyms_list)) return (EBUSY); destroy_dev(ksyms_dev); mtx_destroy(&ksyms_mtx); break; - case MOD_SHUTDOWN: break; - default: error = EOPNOTSUPP; break; From owner-svn-src-head@freebsd.org Fri Jul 28 04:41:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C62DBD9BB; Fri, 28 Jul 2017 04:41:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED7473578; Fri, 28 Jul 2017 04:41:58 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6S4fvan069724; Fri, 28 Jul 2017 04:41:57 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6S4fvod069723; Fri, 28 Jul 2017 04:41:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201707280441.v6S4fvod069723@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, 28 Jul 2017 04:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321649 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 321649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 04:41:58 -0000 Author: loos Date: Fri Jul 28 04:41:57 2017 New Revision: 321649 URL: https://svnweb.freebsd.org/changeset/base/321649 Log: Remove the unused mutex since r273220. MFC after: 1 week Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/net/if_stf.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Fri Jul 28 03:33:09 2017 (r321648) +++ head/sys/net/if_stf.c Fri Jul 28 04:41:57 2017 (r321649) @@ -139,7 +139,6 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CT struct stf_softc { struct ifnet *sc_ifp; - struct mtx sc_ro_mtx; u_int sc_fibnum; const struct encaptab *encap_cookie; }; @@ -147,10 +146,6 @@ struct stf_softc { static const char stfname[] = "stf"; -/* - * Note that mutable fields in the softc are not currently locked. - * We do lock sc_ro in stf_output though. - */ static MALLOC_DEFINE(M_STF, stfname, "6to4 Tunnel Interface"); static const int ip_stf_ttl = 40; @@ -253,7 +248,6 @@ stf_clone_create(struct if_clone *ifc, char *name, siz ifp->if_dname = stfname; ifp->if_dunit = IF_DUNIT_NONE; - mtx_init(&(sc)->sc_ro_mtx, "stf ro", NULL, MTX_DEF); sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, stf_encapcheck, &in_stf_protosw, sc); if (sc->encap_cookie == NULL) { @@ -280,7 +274,6 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet * err = encap_detach(sc->encap_cookie); KASSERT(err == 0, ("Unexpected error detaching encap_cookie")); - mtx_destroy(&(sc)->sc_ro_mtx); bpfdetach(ifp); if_detach(ifp); if_free(ifp); From owner-svn-src-head@freebsd.org Fri Jul 28 11:51:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E92DC440D; Fri, 28 Jul 2017 11:51:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9A6282759; Fri, 28 Jul 2017 11:51:56 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SBpukH042638; Fri, 28 Jul 2017 11:51:56 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SBpukb042637; Fri, 28 Jul 2017 11:51:56 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201707281151.v6SBpukb042637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 28 Jul 2017 11:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321651 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 321651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 11:51:57 -0000 Author: mw Date: Fri Jul 28 11:51:55 2017 New Revision: 321651 URL: https://svnweb.freebsd.org/changeset/base/321651 Log: Fix remapping VM attributes on Armada 38x pmap_remap_vm_attr() function requires indexes to pte2_attr_tab as the arguments (VM_MEMATTR_). Mistakenly, instead of them, actual values from the table were used (PTE2_ATTR_), when applying work-around for Marvell Armada 38x SoCs. Submitted by: Marcin Wojtas (mw@semihalf.com) Reported by: Rafal Kozik (rk@semihalf.com) Reviewed by: cognet (mentor) Approved by: cognet (mentor) Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D11704 Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Fri Jul 28 10:30:59 2017 (r321650) +++ head/sys/arm/mv/mv_machdep.c Fri Jul 28 11:51:55 2017 (r321651) @@ -301,7 +301,7 @@ platform_late_init(void) * To avoid that, map all registers including PCIe IO * as strongly ordered instead of device memory. */ - pmap_remap_vm_attr(PTE2_ATTR_DEVICE, PTE2_ATTR_SO); + pmap_remap_vm_attr(VM_MEMATTR_DEVICE, VM_MEMATTR_SO); /* Set IO Sync Barrier bit for all Mbus devices */ if (armada38x_win_set_iosync_barrier() != 0) From owner-svn-src-head@freebsd.org Fri Jul 28 12:22:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB863DC547F; Fri, 28 Jul 2017 12:22:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF0383A4B; Fri, 28 Jul 2017 12:22:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SCMWGM057244; Fri, 28 Jul 2017 12:22:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SCMWdE057243; Fri, 28 Jul 2017 12:22:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707281222.v6SCMWdE057243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Jul 2017 12:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321652 - head/lib/libc/x86/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/x86/sys X-SVN-Commit-Revision: 321652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 12:22:33 -0000 Author: kib Date: Fri Jul 28 12:22:32 2017 New Revision: 321652 URL: https://svnweb.freebsd.org/changeset/base/321652 Log: Simplify flow control. Also add explicit comment why libc cannot simply rely on open(2) failure in capability mode. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/x86/sys/__vdso_gettc.c Modified: head/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/x86/sys/__vdso_gettc.c Fri Jul 28 11:51:55 2017 (r321651) +++ head/lib/libc/x86/sys/__vdso_gettc.c Fri Jul 28 12:22:32 2017 (r321652) @@ -197,25 +197,24 @@ __vdso_init_hpet(uint32_t u) if (old_map != NULL) return; - if (cap_getmode(&mode) == 0 && mode != 0) - goto fail; + /* + * Explicitely check for the capability mode to avoid + * triggering trap_enocap on the device open by absolute path. + */ + if ((cap_getmode(&mode) == 0 && mode != 0) || + (fd = _open(devname, O_RDONLY)) == -1) { + /* Prevent the caller from re-entering. */ + atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], + (uintptr_t)old_map, (uintptr_t)MAP_FAILED); + return; + } - fd = _open(devname, O_RDONLY); - if (fd == -1) - goto fail; - new_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); _close(fd); if (atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], (uintptr_t)old_map, (uintptr_t)new_map) == 0 && new_map != MAP_FAILED) munmap((void *)new_map, PAGE_SIZE); - - return; -fail: - /* Prevent the caller from re-entering. */ - atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], - (uintptr_t)old_map, (uintptr_t)MAP_FAILED); } #ifdef WANT_HYPERV From owner-svn-src-head@freebsd.org Fri Jul 28 18:11:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41DF2DCB4AA; Fri, 28 Jul 2017 18:11:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F0426A96C; Fri, 28 Jul 2017 18:11:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SIBrBP000429; Fri, 28 Jul 2017 18:11:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SIBrH6000428; Fri, 28 Jul 2017 18:11:53 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707281811.v6SIBrH6000428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 28 Jul 2017 18:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321658 - head/usr.sbin/binmiscctl X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/usr.sbin/binmiscctl X-SVN-Commit-Revision: 321658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 18:11:55 -0000 Author: sbruno Date: Fri Jul 28 18:11:53 2017 New Revision: 321658 URL: https://svnweb.freebsd.org/changeset/base/321658 Log: binmiscctl should use modfind instead of kldfind kldfind() only matches kernel modules, so if you link imgact_binmisc directly into the kernel, binmiscctl can't find it, tries to load it, and errors out with: Can't load imgact_binmisc kernel module: File exists A quick search of other base commands shows that the correct procedure is to call modfind(), and then try kldload() if that fails. PR: 218593 Submitted by: Dan Nelson MFC after: 1 week Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Fri Jul 28 18:09:41 2017 (r321657) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri Jul 28 18:11:53 2017 (r321658) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include enum cmd { @@ -401,7 +402,7 @@ main(int argc, char **argv) size_t xbe_out_sz = 0, *xbe_out_szp = NULL; uint32_t i; - if (kldfind(KMOD_NAME) == -1) { + if (modfind(KMOD_NAME) == -1) { if (kldload(KMOD_NAME) == -1) fatal("Can't load %s kernel module: %s", KMOD_NAME, strerror(errno)); From owner-svn-src-head@freebsd.org Fri Jul 28 18:27:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F529DCBCEF; Fri, 28 Jul 2017 18:27:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BF1C6B60C; Fri, 28 Jul 2017 18:27:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SIRU0m005786; Fri, 28 Jul 2017 18:27:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SIRUmc005785; Fri, 28 Jul 2017 18:27:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707281827.v6SIRUmc005785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Jul 2017 18:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321659 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 321659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 18:27:31 -0000 Author: gjb Date: Fri Jul 28 18:27:30 2017 New Revision: 321659 URL: https://svnweb.freebsd.org/changeset/base/321659 Log: Turn off ChallengeResponseAuthentication for EC2 AMIs, one of EC2's requirements. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Fri Jul 28 18:11:53 2017 (r321658) +++ head/release/tools/ec2.conf Fri Jul 28 18:27:30 2017 (r321659) @@ -81,6 +81,12 @@ vm_extra_pre_umount() { # Load the kernel module for the Amazon "Elastic Network Adapter" echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf + # Disable ChallengeResponseAuthentication according to EC2 + # requirements. + sed -i '' -e \ + 's/^#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \ + ${DESTDIR}/etc/ssh/sshd_config + # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) From owner-svn-src-head@freebsd.org Fri Jul 28 18:46:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D641DCC1E9; Fri, 28 Jul 2017 18:46:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CD116C21C; Fri, 28 Jul 2017 18:46:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SIk3er014409; Fri, 28 Jul 2017 18:46:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SIk3xr014408; Fri, 28 Jul 2017 18:46:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707281846.v6SIk3xr014408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Jul 2017 18:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321661 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 321661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 18:46:04 -0000 Author: gjb Date: Fri Jul 28 18:46:02 2017 New Revision: 321661 URL: https://svnweb.freebsd.org/changeset/base/321661 Log: Revert r321659, re-enabling ChallengeResponseAuthentication, which was discussed a while back between cperciva@ and so@, and I forgot. Reported by: cperciva Sponsored by: The FreeBSD Foundation Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Fri Jul 28 18:35:29 2017 (r321660) +++ head/release/tools/ec2.conf Fri Jul 28 18:46:02 2017 (r321661) @@ -81,12 +81,6 @@ vm_extra_pre_umount() { # Load the kernel module for the Amazon "Elastic Network Adapter" echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf - # Disable ChallengeResponseAuthentication according to EC2 - # requirements. - sed -i '' -e \ - 's/^#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \ - ${DESTDIR}/etc/ssh/sshd_config - # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) From owner-svn-src-head@freebsd.org Fri Jul 28 20:13:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE060DCDCB9; Fri, 28 Jul 2017 20:13:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99F466F117; Fri, 28 Jul 2017 20:13:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SKDPx8051281; Fri, 28 Jul 2017 20:13:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SKDPpg051279; Fri, 28 Jul 2017 20:13:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707282013.v6SKDPpg051279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 28 Jul 2017 20:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321664 - in head/contrib/llvm/lib: CodeGen Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm/lib: CodeGen Target/X86 X-SVN-Commit-Revision: 321664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 20:13:26 -0000 Author: dim Date: Fri Jul 28 20:13:25 2017 New Revision: 321664 URL: https://svnweb.freebsd.org/changeset/base/321664 Log: Pull in r308891 from upstream llvm trunk (by Benjamin Kramer): [CodeGenPrepare] Cut off FindAllMemoryUses if there are too many uses. This avoids excessive compile time. The case I'm looking at is Function.cpp from an old version of LLVM that still had the giant memcmp string matcher in it. Before r308322 this compiled in about 2 minutes, after it, clang takes infinite* time to compile it. With this patch we're at 5 min, which is still bad but this is a pathological case. The cut off at 20 uses was chosen by looking at other cut-offs in LLVM for user scanning. It's probably too high, but does the job and is very unlikely to regress anything. Fixes PR33900. * I'm impatient and aborted after 15 minutes, on the bug report it was killed after 2h. Pull in r308986 from upstream llvm trunk (by Simon Pilgrim): [X86][CGP] Reduce memcmp() expansion to 2 load pairs (PR33914) D35067/rL308322 attempted to support up to 4 load pairs for memcmp inlining which resulted in regressions for some optimized libc memcmp implementations (PR33914). Until we can match these more optimal cases, this patch reduces the memcmp expansion to a maximum of 2 load pairs (which matches what we do for -Os). This patch should be considered for the 5.0.0 release branch as well Differential Revision: https://reviews.llvm.org/D35830 These fix a hang (or extremely long compile time) when building older LLVM ports. Reported by: antoine PR: 219139 Modified: head/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp Fri Jul 28 19:10:34 2017 (r321663) +++ head/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp Fri Jul 28 20:13:25 2017 (r321664) @@ -4016,14 +4016,18 @@ static bool IsOperandAMemoryOperand(CallInst *CI, Inli return true; } +// Max number of memory uses to look at before aborting the search to conserve +// compile time. +static constexpr int MaxMemoryUsesToScan = 20; + /// Recursively walk all the uses of I until we find a memory use. /// If we find an obviously non-foldable instruction, return true. /// Add the ultimately found memory instructions to MemoryUses. static bool FindAllMemoryUses( Instruction *I, SmallVectorImpl> &MemoryUses, - SmallPtrSetImpl &ConsideredInsts, - const TargetLowering &TLI, const TargetRegisterInfo &TRI) { + SmallPtrSetImpl &ConsideredInsts, const TargetLowering &TLI, + const TargetRegisterInfo &TRI, int SeenInsts = 0) { // If we already considered this instruction, we're done. if (!ConsideredInsts.insert(I).second) return false; @@ -4036,8 +4040,12 @@ static bool FindAllMemoryUses( // Loop over all the uses, recursively processing them. for (Use &U : I->uses()) { - Instruction *UserI = cast(U.getUser()); + // Conservatively return true if we're seeing a large number or a deep chain + // of users. This avoids excessive compilation times in pathological cases. + if (SeenInsts++ >= MaxMemoryUsesToScan) + return true; + Instruction *UserI = cast(U.getUser()); if (LoadInst *LI = dyn_cast(UserI)) { MemoryUses.push_back(std::make_pair(LI, U.getOperandNo())); continue; @@ -4082,7 +4090,8 @@ static bool FindAllMemoryUses( continue; } - if (FindAllMemoryUses(UserI, MemoryUses, ConsideredInsts, TLI, TRI)) + if (FindAllMemoryUses(UserI, MemoryUses, ConsideredInsts, TLI, TRI, + SeenInsts)) return true; } Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jul 28 19:10:34 2017 (r321663) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jul 28 20:13:25 2017 (r321664) @@ -1672,8 +1672,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMa // TODO: These control memcmp expansion in CGP and could be raised higher, but // that needs to benchmarked and balanced with the potential use of vector - // load/store types (PR33329). - MaxLoadsPerMemcmp = 4; + // load/store types (PR33329, PR33914). + MaxLoadsPerMemcmp = 2; MaxLoadsPerMemcmpOptSize = 2; // Set loop alignment to 2^ExperimentalPrefLoopAlignment bytes (default: 2^4). From owner-svn-src-head@freebsd.org Fri Jul 28 21:07:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2B0EDCF297; Fri, 28 Jul 2017 21:07:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B026271092; Fri, 28 Jul 2017 21:07:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SL7v5i071573; Fri, 28 Jul 2017 21:07:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SL7vtk071572; Fri, 28 Jul 2017 21:07:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707282107.v6SL7vtk071572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 28 Jul 2017 21:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321665 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 321665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 21:07:59 -0000 Author: rmacklem Date: Fri Jul 28 21:07:57 2017 New Revision: 321665 URL: https://svnweb.freebsd.org/changeset/base/321665 Log: Modify /etc/rc.d/nfsd so it doesn't force a startup of nfsuserd for NFSv4. Given that RFC7530 allows uid/gids to be placed in owner/owner_group strings directly, many NFSv4 environments don't need the nfsuserd. This small patch modified /etc/rc.d/nfsd so that it does not force startup of the nfsuserd daemon unless nfs_server_managegids is enabled. This implies that nfsuserd_enable="YES" must be added to /etc/rc.conf for NFSv4 server environments that use Kerberos mounts or clients that do not support the uid/gid in string capability. Since this could be considered a POLA violation, it will not be MFC'd. Discussed on: freebsd-current Modified: head/etc/rc.d/nfsd Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Fri Jul 28 20:13:25 2017 (r321664) +++ head/etc/rc.d/nfsd Fri Jul 28 21:07:57 2017 (r321665) @@ -33,8 +33,7 @@ nfsd_precmd() sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi - if checkyesno nfsv4_server_enable || \ - checkyesno nfs_server_managegids; then + if checkyesno nfs_server_managegids; then force_depend nfsuserd || err 1 "Cannot run nfsuserd" fi From owner-svn-src-head@freebsd.org Fri Jul 28 21:14:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273E5DCF5B6; Fri, 28 Jul 2017 21:14:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E319E715C2; Fri, 28 Jul 2017 21:14:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SLETfD075591; Fri, 28 Jul 2017 21:14:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SLETsb075590; Fri, 28 Jul 2017 21:14:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707282114.v6SLETsb075590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 28 Jul 2017 21:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321666 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 21:14:30 -0000 Author: rmacklem Date: Fri Jul 28 21:14:28 2017 New Revision: 321666 URL: https://svnweb.freebsd.org/changeset/base/321666 Log: Add an entry to UPDATING for r321665. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 28 21:07:57 2017 (r321665) +++ head/UPDATING Fri Jul 28 21:14:28 2017 (r321666) @@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20170728: + As of r321665, an NFSv4 server configuration that services + Kerberos mounts or clients that do not support the uid/gid in + owner/owner_group string capability, must explicitly enable + the nfsuserd daemon by adding nfsuserd_enable="YES" to the + machine's /etc/rc.conf file. + 20170722: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 5.0.0. Please see the 20141231 entry below for information about prerequisites From owner-svn-src-head@freebsd.org Fri Jul 28 21:43:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32895DD0549; Fri, 28 Jul 2017 21:43:01 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F12D172CDD; Fri, 28 Jul 2017 21:43:00 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SLgxqL088556; Fri, 28 Jul 2017 21:42:59 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SLgxAe088555; Fri, 28 Jul 2017 21:42:59 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707282142.v6SLgxAe088555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 28 Jul 2017 21:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321668 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 321668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 21:43:01 -0000 Author: rlibby Date: Fri Jul 28 21:42:59 2017 New Revision: 321668 URL: https://svnweb.freebsd.org/changeset/base/321668 Log: bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure Gcc complained that e82545_tx_thread has a return type declared but doesn't return anything. Annotate the procedure with _Noreturn. Reviewed by: grehan Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11774 Modified: head/usr.sbin/bhyve/pci_e82545.c Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Fri Jul 28 21:30:54 2017 (r321667) +++ head/usr.sbin/bhyve/pci_e82545.c Fri Jul 28 21:42:59 2017 (r321668) @@ -1405,7 +1405,7 @@ e82545_tx_run(struct e82545_softc *sc) sc->esc_TDH, sc->esc_TDHr, sc->esc_TDT); } -static void * +static _Noreturn void * e82545_tx_thread(void *param) { struct e82545_softc *sc = param; From owner-svn-src-head@freebsd.org Fri Jul 28 21:47:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6BF2DD07E2; Fri, 28 Jul 2017 21:47:11 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 949C47328D; Fri, 28 Jul 2017 21:47:11 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SLlAJ4089266; Fri, 28 Jul 2017 21:47:10 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SLlAub089265; Fri, 28 Jul 2017 21:47:10 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201707282147.v6SLlAub089265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 28 Jul 2017 21:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321669 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 321669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 21:47:11 -0000 Author: rlibby Date: Fri Jul 28 21:47:10 2017 New Revision: 321669 URL: https://svnweb.freebsd.org/changeset/base/321669 Log: bhyve/vga.c: fix atc_color_select_67 bit shift Gcc noticed that the result of the bit shift is always zero. Shift so that the ATC_CS_C67 bits end up in bits 6 & 7. Reviewed by: grehan, tychon Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11775 Modified: head/usr.sbin/bhyve/vga.c Modified: head/usr.sbin/bhyve/vga.c ============================================================================== --- head/usr.sbin/bhyve/vga.c Fri Jul 28 21:42:59 2017 (r321668) +++ head/usr.sbin/bhyve/vga.c Fri Jul 28 21:47:10 2017 (r321669) @@ -1069,7 +1069,7 @@ vga_port_out_handler(struct vmctx *ctx, int in, int po sc->vga_atc.atc_color_select_45 = (val & ATC_CS_C45) << 4; sc->vga_atc.atc_color_select_67 = - (val & ATC_CS_C67) << 6; + ((val & ATC_CS_C67) >> 2) << 6; break; default: //printf("XXX VGA ATC: outb 0x%04x, 0x%02x at index %d\n", port, val, sc->vga_atc.atc_index); From owner-svn-src-head@freebsd.org Fri Jul 28 22:23:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BE9DD1353; Fri, 28 Jul 2017 22:23:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 332A574773; Fri, 28 Jul 2017 22:23:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SMNWhx005723; Fri, 28 Jul 2017 22:23:32 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SMNUVu005702; Fri, 28 Jul 2017 22:23:30 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201707282223.v6SMNUVu005702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 28 Jul 2017 22:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321670 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/disassembler sys/con... X-SVN-Commit-Revision: 321670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 22:23:33 -0000 Author: jkim Date: Fri Jul 28 22:23:29 2017 New Revision: 321670 URL: https://svnweb.freebsd.org/changeset/base/321670 Log: Merge ACPICA 20170728. Added: head/sys/contrib/dev/acpica/compiler/aslparseop.c - copied, changed from r320476, vendor-sys/acpica/dist/source/compiler/aslparseop.c head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c - copied, changed from r321655, vendor-sys/acpica/dist/source/components/dispatcher/dspkginit.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcstyle.y head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslhelpers.y head/sys/contrib/dev/acpica/compiler/aslkeywords.y head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslpld.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprimaries.y head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvdisasm.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/dev/acpica/acpi.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/conf/files Fri Jul 28 22:23:29 2017 (r321670) @@ -355,6 +355,7 @@ contrib/dev/acpica/components/dispatcher/dsmethod.c op contrib/dev/acpica/components/dispatcher/dsmthdat.c optional acpi contrib/dev/acpica/components/dispatcher/dsobject.c optional acpi contrib/dev/acpica/components/dispatcher/dsopcode.c optional acpi +contrib/dev/acpica/components/dispatcher/dspkginit.c optional acpi contrib/dev/acpica/components/dispatcher/dsutils.c optional acpi contrib/dev/acpica/components/dispatcher/dswexec.c optional acpi contrib/dev/acpica/components/dispatcher/dswload.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Fri Jul 28 22:23:29 2017 (r321670) @@ -21,10 +21,9 @@ stripdirs="generate libraries parsers preprocessor tes stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ - acwin.h acwin64.h acwinex.h dspkginit.c new_table.txt \ - osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \ - osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \ - readme.txt utclib.c utprint.c" + acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ + osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ + oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c" # include files to canonify src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/changes.txt Fri Jul 28 22:23:29 2017 (r321670) @@ -1,4 +1,156 @@ ---------------------------------------- +28 July 2017. Summary of changes for version 20170728: + + +1) ACPICA kernel-resident subsystem: + +Fixed a regression seen with small resource descriptors that could cause +an inadvertent AE_AML_NO_RESOURCE_END_TAG exception. + +AML interpreter: Implemented a new feature that allows forward references +from individual named references within package objects that are +contained within blocks of "module-level code". This provides +compatibility with other ACPI implementations and supports existing +firmware that depends on this feature. Example: + + Name (ABCD, 1) + If (ABCD) /* An If() at module-level */ + { + Name (PKG1, Package() + { + INT1 /* Forward reference to object INT1 +*/ + }) + Name (INT1, 0x1234) + } + +AML Interpreter: Fixed a problem with the Alias() operator where aliases +to some ASL objects were not handled properly. Objects affected are: +Mutex, Event, and OperationRegion. + +AML Debugger: Enhanced to properly handle AML Alias objects. These +objects have one level of indirection which was not fully supported by +the debugger. + +Table Manager: Added support to detect and ignore duplicate SSDTs within +the XSDT/RSDT. This error in the XSDT has been seen in the field. + +EFI and EDK2 support: + Enabled /WX flag for MSVC builds + Added support for AcpiOsStall, AcpiOsSleep, and AcpiOsGetTimer + Added local support for 64-bit multiply and shift operations + Added support to compile acpidump.efi on Windows + Added OSL function stubs for interfaces not used under EFI + +Added additional support for the _DMA predefined name. _DMA returns a +buffer containing a resource template. This change add support within the +resource manager (AcpiWalkResourceBuffer) to walk and parse this list of +resource descriptors. Lorenzo Pieralisi + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem where the internal input line buffer(s) could +overflow if there are very long lines in the input ASL source code file. +Implemented buffer management that automatically increases the size of +the buffers as necessary. + +iASL: Added an option (-vx) to "expect" particular remarks, warnings and +errors. If the specified exception is not raised during compilation, the +compiler emits an error. This is intended to support the ASL test suite, +but may be useful in other contexts. + +iASL: Implemented a new predefined macro, __METHOD__, which returns a +string containing the name of the current control method that is being +compiled. + +iASL: Implemented debugger and table compiler support for the SDEI ACPI +table (Software Delegated Exception Interface). James Morse + + +Unix/Linux makefiles: Added an option to disable compile optimizations. +The disable occurs when the NOOPT flag is set to TRUE. +theracermaster@gmail.com + +Acpidump: Added support for multiple DSDT and FACS tables. This can occur +when there are different tables for 32-bit versus 64-bit. + +Enhanced error reporting for the ASL test suite (ASLTS) by removing +unnecessary/verbose text, and emit the actual line number where an error +has occurred. These changes are intended to improve the usefulness of the +test suite. + +---------------------------------------- +29 June 2017. Summary of changes for version 20170629: + + +1) ACPICA kernel-resident subsystem: + +Tables: Implemented a deferred ACPI table verification. This is useful +for operating systems where the tables cannot be verified in the early +initialization stage due to early memory mapping limitations on some +architectures. Lv Zheng. + +Tables: Removed the signature validation for dynamically loaded tables. +Provides compatibility with other ACPI implementations. Previously, only +SSDT tables were allowed, as per the ACPI specification. Now, any table +signature can be used via the Load() operator. Lv Zheng. + +Tables: Fixed several mutex issues that could cause errors during table +acquisition. Lv Zheng. + +Tables: Fixed a problem where an ACPI warning could be generated if a +null pointer was passed to the AcpiPutTable interface. Lv Zheng. + +Tables: Added a mechanism to handle imbalances for the AcpiGetTable and +AcpiPutTable interfaces. This applies to the "late stage" table loading +when the use of AcpiPutTable is no longer required (since the system +memory manager is fully running and available). Lv Zheng. + +Fixed/Reverted a regression during processing of resource descriptors +that contain only a single EndTag. Fixes an AE_AML_NO_RESOURCE_END_TAG +exception in this case. + +Headers: IORT/SMMU support: Updated the SMMU models for Revision C of the +I/O Remapping specification. Robin Murphy + +Interpreter: Fixed a possible fault if an Alias operator with an invalid +or duplicate target is encountered during Alias creation in +AcpiExCreateAlias. Alex James + +Added an option to use designated initializers for function pointers. +Kees Cook + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Allow compilation of External declarations with target pathnames +that refer to existing named objects within the table. Erik Schmauss. + +iASL: Fixed a regression when compiling FieldUnits. Fixes an error if a +FieldUnit name also is declared via External in the same table. Erik +Schmauss. + +iASL: Allow existing scope names within pathnames used in External +statements. For example: + External (ABCD.EFGH) // ABCD exists, but EFGH is truly external + Device (ABCD) + +iASL: IORT ACPI table: Implemented changes required to decode the new +Proximity Domain for the SMMUv3 IORT. Disassembler and Data Table +compiler. Ganapatrao Kulkarni + +Disassembler: Don't abort disassembly on errors from External() +statements. Erik Schmauss. + +Disassembler: fixed a possible fault when one of the Create*Field +operators references a Resource Template. ACPICA Bugzilla 1396. + +iASL: In the source code, resolved some naming inconsistences across the +parsing support. Fixes confusion between "Parse Op" and "Parse Node". +Adds a new file, aslparseop.c + +---------------------------------------- 31 May 2017. Summary of changes for version 20170531: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/acfileio.c Fri Jul 28 22:23:29 2017 (r321670) @@ -175,6 +175,36 @@ AcCheckTextModeCorruption ( /******************************************************************************* * + * FUNCTION: AcDeleteTableList + * + * PARAMETERS: ListHead - List to delete + * + * RETURN: Status + * + * DESCRIPTION: Delete a list of tables. This is useful for removing memory + * allocated by AcGetAllTablesFromFile + * + ******************************************************************************/ + +void +AcDeleteTableList ( + ACPI_NEW_TABLE_DESC *ListHead) +{ + ACPI_NEW_TABLE_DESC *Current = ListHead; + ACPI_NEW_TABLE_DESC *Previous = Current; + + + while (Current) + { + Current = Current->Next; + AcpiOsFree (Previous); + Previous = Current; + } +} + + +/******************************************************************************* + * * FUNCTION: AcGetAllTablesFromFile * * PARAMETERS: Filename - Table filename Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/adisasm.c Fri Jul 28 22:23:29 2017 (r321670) @@ -408,6 +408,8 @@ Cleanup: ACPI_FREE (Table); } + AcDeleteTableList (ListHead); + if (File) { fclose (File); @@ -748,6 +750,7 @@ AdDoExternalFileList ( continue; } + AcDeleteTableList (ExternalListHead); return (Status); } @@ -761,6 +764,7 @@ AdDoExternalFileList ( { AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", AcpiFormatException (Status)); + AcDeleteTableList (ExternalListHead); return (Status); } @@ -779,6 +783,8 @@ AdDoExternalFileList ( ExternalFileList = ExternalFileList->Next; } + + AcDeleteTableList (ExternalListHead); if (ACPI_FAILURE (GlobalStatus)) { Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/adwalk.c Fri Jul 28 22:23:29 2017 (r321670) @@ -536,11 +536,20 @@ AcpiDmDumpDescending ( case AML_NAME_OP: case AML_METHOD_OP: case AML_DEVICE_OP: + + AcpiOsPrintf ("%4.4s", + ACPI_CAST_PTR (char, &Op->Named.Name)); + break; + case AML_INT_NAMEDFIELD_OP: - AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); + AcpiOsPrintf ("%4.4s Length: (bits) %8.8X%8.8X (bytes) %8.8X%8.8X", + ACPI_CAST_PTR (char, &Op->Named.Name), + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer / 8)); break; + default: break; @@ -1070,10 +1079,10 @@ AcpiDmCommonDescendingOp ( { ACPI_STATUS Status; + /* Resource descriptor conversion */ Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); - if (ACPI_FAILURE (Status)) { return (Status); @@ -1082,7 +1091,6 @@ AcpiDmCommonDescendingOp ( /* Switch/Case conversion */ Status = AcpiDmProcessSwitch (Op); - return (AE_OK); } @@ -1113,6 +1121,7 @@ AcpiDmProcessResourceDescriptors ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; + WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1138,7 +1147,6 @@ AcpiDmProcessResourceDescriptors ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); - return (AE_OK); } Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Fri Jul 28 22:23:29 2017 (r321670) @@ -474,6 +474,15 @@ AcpiAhMatchPredefinedName ( const AH_PREDEFINED_NAME *Info; + /* Nameseg must start with an underscore */ + + if (*Nameseg != '_') + { + return (NULL); + } + + /* Search for a match in the predefined name table */ + for (Info = AslPredefinedInfo; Info->Name; Info++) { if (ACPI_COMPARE_NAME (Nameseg, Info->Name)) Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/ahtable.c Fri Jul 28 22:23:29 2017 (r321670) @@ -239,6 +239,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_RSDT, "Root System Description Table"}, {ACPI_SIG_S3PT, "S3 Performance Table"}, {ACPI_SIG_SBST, "Smart Battery Specification Table"}, + {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"}, {ACPI_SIG_SLIC, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, "System Locality Information Table"}, {ACPI_SIG_SPCR, "Serial Port Console Redirection table"}, Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/dmtable.c Fri Jul 28 22:23:29 2017 (r321670) @@ -493,6 +493,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt}, {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, + {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit}, {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr}, Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Jul 28 22:23:29 2017 (r321670) @@ -218,6 +218,7 @@ #define ACPI_RASF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RASF,f) #define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f) #define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f) +#define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f) #define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f) #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) @@ -1838,6 +1839,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC Override", 0}, {ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU Override", 0}, + {ACPI_DMT_FLAG3, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "Proximity Domain Valid", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS Address", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0}, @@ -1845,6 +1847,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0}, + {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, + {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -2763,6 +2768,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] = ACPI_DMT_TERMINATOR }; +/******************************************************************************* + * + * SDEI - Software Delegated Execption Interface Descriptor Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[] = +{ + ACPI_DMT_TERMINATOR +}; /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Jul 28 22:23:29 2017 (r321670) @@ -435,13 +435,13 @@ AnCheckMethodReturnValue ( /* Examine the parent op of this method */ OwningOp = Node->Op; - if (OwningOp->Asl.CompileFlags & NODE_METHOD_NO_RETVAL) + if (OwningOp->Asl.CompileFlags & OP_METHOD_NO_RETVAL) { /* Method NEVER returns a value */ AslError (ASL_ERROR, ASL_MSG_NO_RETVAL, Op, Op->Asl.ExternalName); } - else if (OwningOp->Asl.CompileFlags & NODE_METHOD_SOME_NO_RETVAL) + else if (OwningOp->Asl.CompileFlags & OP_METHOD_SOME_NO_RETVAL) { /* Method SOMETIMES returns a value, SOMETIMES not */ Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Jul 28 22:23:29 2017 (r321670) @@ -560,7 +560,7 @@ AnGetBtype ( return (ACPI_UINT32_MAX); } - if (ReferencedNode->Asl.CompileFlags & NODE_METHOD_TYPED) + if (ReferencedNode->Asl.CompileFlags & OP_METHOD_TYPED) { ThisNodeBtype = ReferencedNode->Asl.AcpiBtype; } Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Jul 28 22:23:29 2017 (r321670) @@ -291,6 +291,8 @@ CgAmlWriteWalk ( /* 19 */ Op->Asl.LogicalLineNumber, /* 20 */ Op->Asl.EndLogicalLine); + TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT); + DbgPrint (ASL_TREE_OUTPUT, "\n"); return (AE_OK); } @@ -438,7 +440,7 @@ CgWriteAmlOpcode ( /* Does this opcode have an associated "PackageLength" field? */ - if (Op->Asl.CompileFlags & NODE_AML_PACKAGE) + if (Op->Asl.CompileFlags & OP_AML_PACKAGE) { if (Op->Asl.AmlPkgLenBytes == 1) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Jul 28 22:23:29 2017 (r321670) @@ -815,6 +815,7 @@ CmCleanupAndExit ( BOOLEAN DeleteAmlFile = FALSE; + AslCheckExpectedExceptions (); AePrintErrorLog (ASL_FILE_STDERR); if (Gbl_DebugFlag) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Jul 28 22:23:29 2017 (r321670) @@ -413,12 +413,20 @@ AslError ( ACPI_PARSE_OBJECT *Op, char *ExtraMessage); +void +AslCheckExpectedExceptions ( + void); + ACPI_STATUS +AslExpectException ( + char *MessageIdString); + +ACPI_STATUS AslDisableException ( char *MessageIdString); BOOLEAN -AslIsExceptionDisabled ( +AslIsExceptionIgnored ( UINT8 Level, UINT16 MessageId); @@ -790,17 +798,6 @@ TrAmlTransformWalkEnd ( /* - * asltree - parse tree support - */ -ACPI_STATUS -TrWalkParseTree ( - ACPI_PARSE_OBJECT *Op, - UINT32 Visitation, - ASL_WALK_CALLBACK DescendingCallback, - ASL_WALK_CALLBACK AscendingCallback, - void *Context); - -/* * aslexternal - External opcode support */ ACPI_STATUS @@ -826,103 +823,111 @@ ExDoExternal ( #define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD) -void -TrSetParent ( - ACPI_PARSE_OBJECT *Op, - ACPI_PARSE_OBJECT *ParentOp); - +/* + * aslparseop.c - Parse op create/allocate/cache + */ ACPI_PARSE_OBJECT * -TrAllocateNode ( - UINT32 ParseOpcode); - -void -TrPrintNodeCompileFlags ( - UINT32 Flags); - -void -TrReleaseNode ( - ACPI_PARSE_OBJECT *Op); - -ACPI_PARSE_OBJECT * -TrUpdateNode ( +TrCreateOp ( UINT32 ParseOpcode, - ACPI_PARSE_OBJECT *Op); - -ACPI_PARSE_OBJECT * -TrCreateNode ( - UINT32 ParseOpcode, UINT32 NumChildren, ...); ACPI_PARSE_OBJECT * -TrCreateLeafNode ( +TrCreateLeafOp ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * -TrCreateNullTarget ( +TrCreateNullTargetOp ( void); ACPI_PARSE_OBJECT * -TrCreateAssignmentNode ( +TrCreateAssignmentOp ( ACPI_PARSE_OBJECT *Target, ACPI_PARSE_OBJECT *Source); ACPI_PARSE_OBJECT * -TrCreateTargetOperand ( +TrCreateTargetOp ( ACPI_PARSE_OBJECT *OriginalOp, ACPI_PARSE_OBJECT *ParentOp); ACPI_PARSE_OBJECT * -TrCreateValuedLeafNode ( +TrCreateValuedLeafOp ( UINT32 ParseOpcode, UINT64 Value); ACPI_PARSE_OBJECT * -TrCreateConstantLeafNode ( +TrCreateConstantLeafOp ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * -TrLinkChildren ( - ACPI_PARSE_OBJECT *Op, - UINT32 NumChildren, - ...); +TrAllocateOp ( + UINT32 ParseOpcode); void -TrSetEndLineNumber ( +TrPrintOpFlags ( + UINT32 Flags, + UINT32 OutputLevel); + + +/* + * asltree.c - Parse tree management + */ +void +TrSetOpParent ( + ACPI_PARSE_OBJECT *Op, + ACPI_PARSE_OBJECT *ParentOp); + +ACPI_PARSE_OBJECT * +TrSetOpIntegerValue ( + UINT32 ParseOpcode, ACPI_PARSE_OBJECT *Op); void -TrSetCurrentFilename ( +TrSetOpEndLineNumber ( ACPI_PARSE_OBJECT *Op); void -TrWalkTree ( - void); +TrSetOpCurrentFilename ( + ACPI_PARSE_OBJECT *Op); ACPI_PARSE_OBJECT * -TrLinkPeerNode ( +TrLinkOpChildren ( + ACPI_PARSE_OBJECT *Op, + UINT32 NumChildren, + ...); + +ACPI_PARSE_OBJECT * +TrLinkPeerOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2); ACPI_PARSE_OBJECT * -TrLinkChildNode ( +TrLinkChildOp ( ACPI_PARSE_OBJECT *Op1, ACPI_PARSE_OBJECT *Op2); ACPI_PARSE_OBJECT * -TrSetNodeFlags ( +TrSetOpFlags ( ACPI_PARSE_OBJECT *Op, UINT32 Flags); ACPI_PARSE_OBJECT * -TrSetNodeAmlLength ( +TrSetOpAmlLength ( ACPI_PARSE_OBJECT *Op, UINT32 Length); ACPI_PARSE_OBJECT * -TrLinkPeerNodes ( +TrLinkPeerOps ( UINT32 NumPeers, ...); + +ACPI_STATUS +TrWalkParseTree ( + ACPI_PARSE_OBJECT *Op, + UINT32 Visitation, + ASL_WALK_CALLBACK DescendingCallback, + ASL_WALK_CALLBACK AscendingCallback, + void *Context); /* Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Jul 28 22:23:29 2017 (r321670) @@ -809,7 +809,7 @@ NamePathTail [.]{NameSeg} "__FILE__" { count (0); return (PARSEOP___FILE__); } "__LINE__" { count (0); return (PARSEOP___LINE__); } "__PATH__" { count (0); return (PARSEOP___PATH__); } - +"__METHOD__" { count (0); return (PARSEOP___METHOD__); } {NameSeg} { char *s; count (0); Modified: head/sys/contrib/dev/acpica/compiler/aslcstyle.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcstyle.y Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslcstyle.y Fri Jul 28 22:23:29 2017 (r321670) @@ -201,59 +201,59 @@ Expression /* Unary operators */ - : PARSEOP_EXP_LOGICAL_NOT {$$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg {$$ = TrLinkChildren ($2,1,$3);} - | PARSEOP_EXP_NOT {$$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg {$$ = TrLinkChildren ($2,2,$3,TrCreateNullTarget ());} + : PARSEOP_EXP_LOGICAL_NOT {$$ = TrCreateLeafOp (PARSEOP_LNOT);} + TermArg {$$ = TrLinkOpChildren ($2,1,$3);} + | PARSEOP_EXP_NOT {$$ = TrCreateLeafOp (PARSEOP_NOT);} + TermArg {$$ = TrLinkOpChildren ($2,2,$3,TrCreateNullTargetOp ());} - | SuperName PARSEOP_EXP_INCREMENT {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - {$$ = TrLinkChildren ($3,1,$1);} - | SuperName PARSEOP_EXP_DECREMENT {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - {$$ = TrLinkChildren ($3,1,$1);} + | SuperName PARSEOP_EXP_INCREMENT {$$ = TrCreateLeafOp (PARSEOP_INCREMENT);} + {$$ = TrLinkOpChildren ($3,1,$1);} + | SuperName PARSEOP_EXP_DECREMENT {$$ = TrCreateLeafOp (PARSEOP_DECREMENT);} + {$$ = TrLinkOpChildren ($3,1,$1);} /* Binary operators: math and logical */ - | TermArg PARSEOP_EXP_ADD {$$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_DIVIDE {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), - TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MODULO {$$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_MULTIPLY {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_LEFT {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SHIFT_RIGHT {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_SUBTRACT {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_ADD {$$ = TrCreateLeafOp (PARSEOP_ADD);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_DIVIDE {$$ = TrCreateLeafOp (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkOpChildren ($3,4,$1,$4,TrCreateNullTargetOp (), + TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_MODULO {$$ = TrCreateLeafOp (PARSEOP_MOD);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_MULTIPLY {$$ = TrCreateLeafOp (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SHIFT_LEFT {$$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SHIFT_RIGHT {$$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_SUBTRACT {$$ = TrCreateLeafOp (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} - | TermArg PARSEOP_EXP_AND {$$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_OR {$$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} - | TermArg PARSEOP_EXP_XOR {$$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4,TrCreateNullTarget ());} + | TermArg PARSEOP_EXP_AND {$$ = TrCreateLeafOp (PARSEOP_AND);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_OR {$$ = TrCreateLeafOp (PARSEOP_OR);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} + | TermArg PARSEOP_EXP_XOR {$$ = TrCreateLeafOp (PARSEOP_XOR);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4,TrCreateNullTargetOp ());} - | TermArg PARSEOP_EXP_GREATER {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_GREATER_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS {$$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LESS_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER {$$ = TrCreateLeafOp (PARSEOP_LGREATER);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_GREATER_EQUAL {$$ = TrCreateLeafOp (PARSEOP_LGREATEREQUAL);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS {$$ = TrCreateLeafOp (PARSEOP_LLESS);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LESS_EQUAL {$$ = TrCreateLeafOp (PARSEOP_LLESSEQUAL);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_NOT_EQUAL {$$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_EQUAL {$$ = TrCreateLeafOp (PARSEOP_LEQUAL);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_NOT_EQUAL {$$ = TrCreateLeafOp (PARSEOP_LNOTEQUAL);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_AND {$$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} - | TermArg PARSEOP_EXP_LOGICAL_OR {$$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg {$$ = TrLinkChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_AND {$$ = TrCreateLeafOp (PARSEOP_LAND);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} + | TermArg PARSEOP_EXP_LOGICAL_OR {$$ = TrCreateLeafOp (PARSEOP_LOR);} + TermArg {$$ = TrLinkOpChildren ($3,2,$1,$4);} /* Parentheses */ @@ -280,8 +280,8 @@ IndexExpTerm : SuperName PARSEOP_EXP_INDEX_LEFT TermArg - PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); - TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} + PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafOp (PARSEOP_INDEX); + TrLinkOpChildren ($$,3,$1,$3,TrCreateNullTargetOp ());} ; @@ -304,7 +304,7 @@ EqualsTerm | SuperName PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + TermArg {$$ = TrCreateAssignmentOp ($1, $3);} /* Chained equals: (a=RefOf)=b, a=b=c=d etc. */ @@ -312,47 +312,47 @@ EqualsTerm EqualsTerm PARSEOP_CLOSE_PAREN PARSEOP_EXP_EQUALS - TermArg {$$ = TrCreateAssignmentNode ($2, $5);} + TermArg {$$ = TrCreateAssignmentOp ($2, $5);} /* Compound assignments -- Add (operand, operand, target) */ - | TermArg PARSEOP_EXP_ADD_EQ {$$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_ADD_EQ {$$ = TrCreateLeafOp (PARSEOP_ADD);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_DIV_EQ {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg {$$ = TrLinkChildren ($3,4,$1,$4,TrCreateNullTarget (), - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_DIV_EQ {$$ = TrCreateLeafOp (PARSEOP_DIVIDE);} + TermArg {$$ = TrLinkOpChildren ($3,4,$1,$4,TrCreateNullTargetOp (), + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_MOD_EQ {$$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_MOD_EQ {$$ = TrCreateLeafOp (PARSEOP_MOD);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_MUL_EQ {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_MUL_EQ {$$ = TrCreateLeafOp (PARSEOP_MULTIPLY);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SHL_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SHL_EQ {$$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SHR_EQ {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SHR_EQ {$$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_SUB_EQ {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_SUB_EQ {$$ = TrCreateLeafOp (PARSEOP_SUBTRACT);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_AND_EQ {$$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_AND_EQ {$$ = TrCreateLeafOp (PARSEOP_AND);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_OR_EQ {$$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_OR_EQ {$$ = TrCreateLeafOp (PARSEOP_OR);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} - | TermArg PARSEOP_EXP_XOR_EQ {$$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg {$$ = TrLinkChildren ($3,3,$1,$4, - TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} + | TermArg PARSEOP_EXP_XOR_EQ {$$ = TrCreateLeafOp (PARSEOP_XOR);} + TermArg {$$ = TrLinkOpChildren ($3,3,$1,$4, + TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));} ; Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Jul 28 22:23:29 2017 (r321670) @@ -290,7 +290,7 @@ #define ASL_PARSE_TREE_DEBUG2 \ " %08X %04X %04X %01X %04X %04X %05X %05X "\ - "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d\n" + "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d" /* * Macros for ASL/ASL+ converter Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Jul 28 21:47:10 2017 (r321669) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Jul 28 22:23:29 2017 (r321670) @@ -160,7 +160,17 @@ static void AeAddToErrorLog ( ASL_ERROR_MSG *Enode); +static BOOLEAN +AslIsExceptionExpected ( + UINT8 Level, + UINT16 MessageId); +static BOOLEAN +AslIsExceptionDisabled ( + UINT8 Level, + UINT16 MessageId); + + /******************************************************************************* * * FUNCTION: AslAbort @@ -806,9 +816,118 @@ AslCommonError ( return; } +/******************************************************************************* + * + * FUNCTION: AslIsExceptionIgnored + * + * PARAMETERS: Level - Seriousness (Warning/error, etc.) + * MessageId - Index into global message buffer + * + * RETURN: BOOLEAN + * + * DESCRIPTION: Check if a particular exception is ignored. In this case it + * means that the exception is (expected or disabled. + * + ******************************************************************************/ +BOOLEAN +AslIsExceptionIgnored ( + UINT8 Level, + UINT16 MessageId) +{ + BOOLEAN ExceptionIgnored; + + + /* Note: this allows exception to be disabled and expected */ + + ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId); + ExceptionIgnored |= AslIsExceptionExpected (Level, MessageId); + + return (Gbl_AllExceptionsDisabled || ExceptionIgnored); +} + + /******************************************************************************* * + * FUNCTION: AslCheckExpectException + * + * PARAMETERS: none + * + * RETURN: none + * + * DESCRIPTION: Check the global expected messages table and raise an error + * for each message that has not been received. + * + ******************************************************************************/ + +void +AslCheckExpectedExceptions ( + void) +{ + UINT8 i; + + for (i = 0; i < Gbl_ExpectedMessagesIndex; ++i) + { + if (!Gbl_ExpectedMessages[i].MessageReceived) + { + AslError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, NULL, + Gbl_ExpectedMessages[i].MessageIdStr); + } + } +} + + +/******************************************************************************* + * + * FUNCTION: AslExpectException + * + * PARAMETERS: MessageIdString - ID of excepted exception during compile + * + * RETURN: Status + * + * DESCRIPTION: Enter a message ID into the global expected messages table + * If these messages are not raised during the compilation, throw + * an error. + * + ******************************************************************************/ + +ACPI_STATUS +AslExpectException ( + char *MessageIdString) +{ + UINT32 MessageId; + + + /* Convert argument to an integer and validate it */ + + MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); + + if (MessageId > 6999) + { + printf ("\"%s\" is not a valid warning/remark/erro ID\n", + MessageIdString); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jul 28 22:28:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A091DD16A5; Fri, 28 Jul 2017 22:28:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 379BA74C9A; Fri, 28 Jul 2017 22:28:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SMSjXO005974; Fri, 28 Jul 2017 22:28:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SMSjdK005973; Fri, 28 Jul 2017 22:28:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201707282228.v6SMSjdK005973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 28 Jul 2017 22:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321671 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 321671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 22:28:46 -0000 Author: np Date: Fri Jul 28 22:28:45 2017 New Revision: 321671 URL: https://svnweb.freebsd.org/changeset/base/321671 Log: cxgbe/iw_cxgbe: Log the end point's history and flags to the trace buffer just before it's freed. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Jul 28 22:23:29 2017 (r321670) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Jul 28 22:28:45 2017 (r321671) @@ -1002,6 +1002,8 @@ void _c4iw_free_ep(struct kref *kref) __func__, epc)); if (test_bit(QP_REFERENCED, &ep->com.flags)) deref_qp(ep); + CTR4(KTR_IW_CXGBE, "%s: ep %p, history 0x%lx, flags 0x%lx", + __func__, ep, epc->history, epc->flags); kfree(ep); } From owner-svn-src-head@freebsd.org Fri Jul 28 23:56:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2106FDAB2A2; Fri, 28 Jul 2017 23:56:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E24DB775B9; Fri, 28 Jul 2017 23:56:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6SNu8rB042704; Fri, 28 Jul 2017 23:56:08 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6SNu89R042702; Fri, 28 Jul 2017 23:56:08 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707282356.v6SNu89R042702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 28 Jul 2017 23:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321674 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 321674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 28 Jul 2017 23:56:09 -0000 Author: mm Date: Fri Jul 28 23:56:07 2017 New Revision: 321674 URL: https://svnweb.freebsd.org/changeset/base/321674 Log: MFV r321673: Sync libarchive with vendor. Relevant vendor changes: PR #926: ensure ar strtab is null terminated MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_cryptor_private.h head/contrib/libarchive/libarchive/archive_write_set_format_ar.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Jul 28 23:51:08 2017 (r321673) +++ head/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Jul 28 23:56:07 2017 (r321674) @@ -64,7 +64,7 @@ typedef struct { } archive_crypto_ctx; #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) -#include +#include /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS Modified: head/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Jul 28 23:51:08 2017 (r321673) +++ head/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Jul 28 23:56:07 2017 (r321674) @@ -374,13 +374,14 @@ archive_write_ar_data(struct archive_write *a, const v return (ARCHIVE_WARN); } - ar->strtab = (char *)malloc(s); + ar->strtab = (char *)malloc(s + 1); if (ar->strtab == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate strtab buffer"); return (ARCHIVE_FATAL); } - strncpy(ar->strtab, buff, s); + memcpy(ar->strtab, buff, s); + ar->strtab[s] = '\0'; ar->has_strtab = 1; } From owner-svn-src-head@freebsd.org Sat Jul 29 02:25:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07DBFDB0D60; Sat, 29 Jul 2017 02:25:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E7D7FE3B; Sat, 29 Jul 2017 02:25:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6T2Pne6002862; Sat, 29 Jul 2017 02:25:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6T2Pnon002861; Sat, 29 Jul 2017 02:25:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707290225.v6T2Pnon002861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 29 Jul 2017 02:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321675 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 321675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 02:25:51 -0000 Author: rmacklem Date: Sat Jul 29 02:25:49 2017 New Revision: 321675 URL: https://svnweb.freebsd.org/changeset/base/321675 Log: Fix possible crash for the NFSv4.1 pNFS client. If the nfsrpc_createlayoutrpc() call in nfsrpc_getcreatelayout() fails, the code used nfhpp when it might be set NULL. This patch checks for the error cases (laystat != 0) and avoids using nfhpp for the failure case. This would only affect NFSv4.1 mounts with the "pnfs" option. Found while testing the "umount -N" patch not yet in head. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jul 28 23:56:07 2017 (r321674) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 29 02:25:49 2017 (r321675) @@ -6643,9 +6643,14 @@ nfsrpc_getcreatelayout(vnode_t dvp, char *name, int na NFSCL_DEBUG(4, "aft nfsrpc_createlayoutrpc laystat=%d err=%d\n", laystat, error); lyp = NULL; - nfhp = *nfhpp; - laystat = nfsrpc_layoutgetres(nmp, dvp, nfhp->nfh_fh, nfhp->nfh_len, - &stateid, retonclose, NULL, &lyp, &flh, laystat, NULL, cred, p); + if (laystat == 0) { + nfhp = *nfhpp; + laystat = nfsrpc_layoutgetres(nmp, dvp, nfhp->nfh_fh, + nfhp->nfh_len, &stateid, retonclose, NULL, &lyp, &flh, + laystat, NULL, cred, p); + } else + laystat = nfsrpc_layoutgetres(nmp, dvp, NULL, 0, &stateid, + retonclose, NULL, &lyp, &flh, laystat, NULL, cred, p); if (laystat == 0) nfscl_rellayout(lyp, 0); return (error); From owner-svn-src-head@freebsd.org Sat Jul 29 08:35:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74AAADBE135; Sat, 29 Jul 2017 08:35:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E50963E8B; Sat, 29 Jul 2017 08:35:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6T8Z7Ui053378; Sat, 29 Jul 2017 08:35:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6T8Z7s2053377; Sat, 29 Jul 2017 08:35:07 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201707290835.v6T8Z7s2053377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 29 Jul 2017 08:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321678 - head/usr.sbin/prometheus_sysctl_exporter X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/prometheus_sysctl_exporter X-SVN-Commit-Revision: 321678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 08:35:08 -0000 Author: ed Date: Sat Jul 29 08:35:07 2017 New Revision: 321678 URL: https://svnweb.freebsd.org/changeset/base/321678 Log: Be a bit more liberal about sysctl naming. On the systems on which I tested this exporter, I never ran into metrics that were named in such a way that they couldn't be exported to Prometheus metrics directly. Now it turns out that on systems with NUMA, the sysctl tree contains metrics named dev.${driver}.${index}.%domain. For these metrics, the % in the name is problematic, as Prometheus doesn't allow this symbol to be used. Remove the assertions that were originally put in place to prevent the exporter from generating malformed output and add code to deal with it accordingly. For metric names, convert any unsupported character to an underscore. For label values, perform string escaping. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221035 Reported by: lifanov@ Modified: head/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c Modified: head/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c ============================================================================== --- head/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c Sat Jul 29 08:24:51 2017 (r321677) +++ head/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c Sat Jul 29 08:35:07 2017 (r321678) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Nuxi, https://nuxi.nl/ + * Copyright (c) 2016-2017 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -384,11 +385,12 @@ oidname_print(const struct oidname *on, const struct o label = on->labels; for (i = 0; i < on->oid.len; ++i) { if (*label == '\0') { - assert(name[strspn(name, - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789_")] == '\0'); - fprintf(fp, "_%s", name); + fputc('_', fp); + while (*name != '\0') { + /* Map unsupported characters to underscores. */ + fputc(isalnum(*name) ? *name : '_', fp); + ++name; + } } name += strlen(name) + 1; label += strlen(label) + 1; @@ -404,15 +406,18 @@ oidname_print(const struct oidname *on, const struct o separator = '{'; for (i = 0; i < on->oid.len; ++i) { if (*label != '\0') { - assert(name[strspn(name, - "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789_-")] == '\0'); assert(label[strspn(label, "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789_")] == '\0'); - fprintf(fp, "%c%s=\"%s\"", separator, label, name); + fprintf(fp, "%c%s=\"", separator, label); + while (*name != '\0') { + /* Escape backslashes and double quotes. */ + if (*name == '\\' || *name == '"') + fputc('\\', fp); + fputc(*name++, fp); + } + fputc('"', fp); separator = ','; } name += strlen(name) + 1; From owner-svn-src-head@freebsd.org Sat Jul 29 09:22:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1505DBF443; Sat, 29 Jul 2017 09:22:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0A1D658A8; Sat, 29 Jul 2017 09:22:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6T9Mm0j073567; Sat, 29 Jul 2017 09:22:48 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6T9Mm2E073566; Sat, 29 Jul 2017 09:22:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201707290922.v6T9Mm2E073566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 29 Jul 2017 09:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321679 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 321679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 09:22:50 -0000 Author: kp Date: Sat Jul 29 09:22:48 2017 New Revision: 321679 URL: https://svnweb.freebsd.org/changeset/base/321679 Log: vtnet: Support jumbo frames without TSO/GSO Currently in Virtio driver without TSO/GSO features enabled, the max scatter gather segments for the TX path can be 4, which limits the support for 9K JUMBO frames. 9K JUMBO frames results in more than 4 scatter gather segments and virtio driver fails to send the frame down to host OS. With TSO/GSO feature enabled max scatter gather segments can be 64, then 9K JUMBO frames are fine, this is making virtio driver to support JUMBO frames only with TSO/GSO. Increasing the VTNET_MIN_TX_SEGS which is the case for non TSO/GSO to 32 to support upto 64K JUMBO frames to Host. Submitted by: Lohith Bellad Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8803 Modified: head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Sat Jul 29 08:35:07 2017 (r321678) +++ head/sys/dev/virtio/network/if_vtnetvar.h Sat Jul 29 09:22:48 2017 (r321679) @@ -314,7 +314,7 @@ CTASSERT(sizeof(struct vtnet_mac_filter) <= PAGE_SIZE) #define VTNET_MRG_RX_SEGS 1 #define VTNET_MIN_RX_SEGS 2 #define VTNET_MAX_RX_SEGS 34 -#define VTNET_MIN_TX_SEGS 4 +#define VTNET_MIN_TX_SEGS 32 #define VTNET_MAX_TX_SEGS 64 /* From owner-svn-src-head@freebsd.org Sat Jul 29 12:22:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDF3EDC31E5; Sat, 29 Jul 2017 12:22:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67FA6AADD; Sat, 29 Jul 2017 12:22:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TCMTPm046864; Sat, 29 Jul 2017 12:22:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TCMT0T046863; Sat, 29 Jul 2017 12:22:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707291222.v6TCMT0T046863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 29 Jul 2017 12:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321684 - head X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 12:22:31 -0000 Author: dim Date: Sat Jul 29 12:22:29 2017 New Revision: 321684 URL: https://svnweb.freebsd.org/changeset/base/321684 Log: Don't use libc++ when cross-building for gcc arches Since we imported clang 5.0.0, the version check in Makefile.inc1 which checks whether to use libc++ fires even when the compiler for the target architecture is gcc 4.2.1. This is because only X_COMPILER_VERSION is checked. Also check X_COMPILER_TYPE, so it will only use libc++ when an external gcc toolchain is used. Reviewed by: emaste, rpokala MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D11776 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jul 29 11:27:54 2017 (r321683) +++ head/Makefile.inc1 Sat Jul 29 12:22:29 2017 (r321684) @@ -624,8 +624,7 @@ XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTM # combined with --sysroot. XCFLAGS+= -B${WORLDTMP}/usr/lib # Force using libc++ for external GCC. -# XXX: This should be checking MK_GNUCXX == no -.if ${X_COMPILER_VERSION} >= 40800 +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif From owner-svn-src-head@freebsd.org Sat Jul 29 13:54:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A5DBDC495B; Sat, 29 Jul 2017 13:54:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 550A46CCDA; Sat, 29 Jul 2017 13:54:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TDsSba083277; Sat, 29 Jul 2017 13:54:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TDsSFp083276; Sat, 29 Jul 2017 13:54:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707291354.v6TDsSFp083276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Jul 2017 13:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321685 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 321685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 13:54:29 -0000 Author: mav Date: Sat Jul 29 13:54:28 2017 New Revision: 321685 URL: https://svnweb.freebsd.org/changeset/base/321685 Log: Fix IORDY bits definition. According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11. PR: 221049 Submitted by: aaron.styx@baesystems.com MFC after: 1 week Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Sat Jul 29 12:22:29 2017 (r321684) +++ head/sys/sys/ata.h Sat Jul 29 13:54:28 2017 (r321685) @@ -68,8 +68,8 @@ struct ata_params { /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 -#define ATA_SUPPORT_IORDY 0x0400 -#define ATA_SUPPORT_IORDYDIS 0x0800 +#define ATA_SUPPORT_IORDYDIS 0x0400 +#define ATA_SUPPORT_IORDY 0x0800 #define ATA_SUPPORT_OVERLAP 0x4000 /*050*/ u_int16_t capabilities2; From owner-svn-src-head@freebsd.org Sat Jul 29 15:20:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCE3DC59BA; Sat, 29 Jul 2017 15:20:08 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 698AB6EB56; Sat, 29 Jul 2017 15:20:08 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v6TFK4Gi055279; Sat, 29 Jul 2017 17:20:04 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 70F53BDE; Sat, 29 Jul 2017 17:20:04 +0200 (CEST) Message-ID: <597CA7A3.4050404@omnilan.de> Date: Sat, 29 Jul 2017 17:20:03 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Kristof Provost CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320802 - head/etc/rc.d References: <201707080928.v689SV93013507@repo.freebsd.org> In-Reply-To: <201707080928.v689SV93013507@repo.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Sat, 29 Jul 2017 17:20:04 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 15:20:08 -0000 Bezüglich Kristof Provost's Nachricht vom 08.07.2017 11:28 (localtime): > Author: kp > Date: Sat Jul 8 09:28:31 2017 > New Revision: 320802 > URL: https://svnweb.freebsd.org/changeset/base/320802 > > Log: > Allow more services to run in vnet jails > > After some tests, here are the services that run into a vnet jail: > - defaultroute > - dhclient > - ip6addrctl > - natd > - pf > - pfsync > - pflog (deamon runs, pflog0 interface usable, but /var/log/pflog not filled) > - rarpd > - route6d (do nothing anyway because obsolete) > - routed (do nothing anyway because obsolete) > - rtsold > - static_arp > - static_ndp > > PR: 220530 > Submitted by: olivier@freebsd.org Do you (or somebidy else) plan to MFC this, along with r320696? Valuable "extension" IMHO. Thanks, -harry From owner-svn-src-head@freebsd.org Sat Jul 29 15:22:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14013DC5BB2; Sat, 29 Jul 2017 15:22:58 +0000 (UTC) (envelope-from srs0=pmua=7a=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3C3F6EF28; Sat, 29 Jul 2017 15:22:57 +0000 (UTC) (envelope-from srs0=pmua=7a=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyewexqkewvy3sy.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:2106:f3e4:9b75:26c2]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id C959DBB01; Sat, 29 Jul 2017 17:22:55 +0200 (CEST) From: "Kristof Provost" To: "Harry Schmalzbauer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320802 - head/etc/rc.d Date: Sat, 29 Jul 2017 17:22:53 +0200 Message-ID: <4C595496-31A5-476A-9D3B-3CD85E9A198D@FreeBSD.org> In-Reply-To: <597CA7A3.4050404@omnilan.de> References: <201707080928.v689SV93013507@repo.freebsd.org> <597CA7A3.4050404@omnilan.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6089) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 15:22:58 -0000 On 29 Jul 2017, at 17:20, Harry Schmalzbauer wrote: > Bezüglich Kristof Provost's Nachricht vom 08.07.2017 11:28 > (localtime): >> Author: kp >> Date: Sat Jul 8 09:28:31 2017 >> New Revision: 320802 >> URL: https://svnweb.freebsd.org/changeset/base/320802 >> >> Log: >> Allow more services to run in vnet jails >> > Do you (or somebidy else) plan to MFC this, along with r320696? > Valuable "extension" IMHO. > I have no plans to, no. I’m not terribly confident that vnet is sufficiently robust in stable/11 to encourage people to use it. There are a number of vnet bugs that are fixed (or being worked on) in CURRENT that still affect stable/11. Regards, Kristof From owner-svn-src-head@freebsd.org Sat Jul 29 15:29:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B2BDC5CF8; Sat, 29 Jul 2017 15:29:13 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5E036F11B; Sat, 29 Jul 2017 15:29:12 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v6TFTAxK055394; Sat, 29 Jul 2017 17:29:10 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 8F237BE7; Sat, 29 Jul 2017 17:29:10 +0200 (CEST) Message-ID: <597CA9C6.20204@omnilan.de> Date: Sat, 29 Jul 2017 17:29:10 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Kristof Provost CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320802 - head/etc/rc.d References: <201707080928.v689SV93013507@repo.freebsd.org> <597CA7A3.4050404@omnilan.de> In-Reply-To: <597CA7A3.4050404@omnilan.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: ACL 129 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Sat, 29 Jul 2017 17:29:10 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 15:29:13 -0000 Bez=FCglich Harry Schmalzbauer's Nachricht vom 29.07.2017 17:20 (localti= me): > Bez=FCglich Kristof Provost's Nachricht vom 08.07.2017 11:28 (localtim= e): >> Author: kp >> Date: Sat Jul 8 09:28:31 2017 >> New Revision: 320802 >> URL: https://svnweb.freebsd.org/changeset/base/320802 >> >> Log: >> Allow more services to run in vnet jails >> =20 >> After some tests, here are the services that run into a vnet jail: >> - defaultroute >> - dhclient >> - ip6addrctl >> - natd >> - pf >> - pfsync >> - pflog (deamon runs, pflog0 interface usable, but /var/log/pflog = not filled) >> - rarpd >> - route6d (do nothing anyway because obsolete) >> - routed (do nothing anyway because obsolete) >> - rtsold >> - static_arp >> - static_ndp >> =20 >> PR: 220530 >> Submitted by: olivier@freebsd.org > Do you (or somebidy else) plan to MFC this, along with r320696? Forgot to mention r320618 also. > Valuable "extension" IMHO. > > Thanks, > > -harry > From owner-svn-src-head@freebsd.org Sat Jul 29 15:35:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25C89DC5EF6; Sat, 29 Jul 2017 15:35:37 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA84B6F4FC; Sat, 29 Jul 2017 15:35:36 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id v6TFZZl4055464; Sat, 29 Jul 2017 17:35:35 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id B98BCBEA; Sat, 29 Jul 2017 17:35:34 +0200 (CEST) Message-ID: <597CAB46.8010509@omnilan.de> Date: Sat, 29 Jul 2017 17:35:34 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Kristof Provost CC: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r320802 - head/etc/rc.d References: <201707080928.v689SV93013507@repo.freebsd.org> <597CA7A3.4050404@omnilan.de> <4C595496-31A5-476A-9D3B-3CD85E9A198D@FreeBSD.org> In-Reply-To: <4C595496-31A5-476A-9D3B-3CD85E9A198D@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Sat, 29 Jul 2017 17:35:35 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 15:35:37 -0000 Bezüglich Kristof Provost's Nachricht vom 29.07.2017 17:22 (localtime): > On 29 Jul 2017, at 17:20, Harry Schmalzbauer wrote: >> Bezüglich Kristof Provost's Nachricht vom 08.07.2017 11:28 (localtime): >>> Author: kp >>> Date: Sat Jul 8 09:28:31 2017 >>> New Revision: 320802 >>> URL: https://svnweb.freebsd.org/changeset/base/320802 >>> >>> Log: >>> Allow more services to run in vnet jails >>> >> Do you (or somebidy else) plan to MFC this, along with r320696? >> Valuable "extension" IMHO. >> > I have no plans to, no. > > I’m not terribly confident that vnet is sufficiently robust in stable/11 to > encourage people to use it. There are a number of vnet bugs that are > fixed (or > being worked on) in CURRENT that still affect stable/11. I see, thanks a lot for your quick response. Haven't used vnet (in production) before stable/11, but palnning to do so, so I'm prepared to find some of them in the near future. I'm merging locally and can at least provide testing. Thanks, -harry From owner-svn-src-head@freebsd.org Sat Jul 29 16:06:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E7D3DC6673 for ; Sat, 29 Jul 2017 16:06:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFAF0700AE for ; Sat, 29 Jul 2017 16:06:20 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d4ce0ec6-7477-11e7-b2f5-7fbc454a3a22 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id d4ce0ec6-7477-11e7-b2f5-7fbc454a3a22; Sat, 29 Jul 2017 16:06:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6TG652g001414; Sat, 29 Jul 2017 10:06:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1501344365.90400.99.camel@freebsd.org> Subject: Re: svn commit: r321633 - in head/sys/arm: arm include From: Ian Lepore To: Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 29 Jul 2017 10:06:05 -0600 In-Reply-To: <201707272314.v6RNEHwQ033479@repo.freebsd.org> References: <201707272314.v6RNEHwQ033479@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 16:06:21 -0000 On Thu, 2017-07-27 at 23:14 +0000, Zbigniew Bodek wrote: > Author: zbb > Date: Thu Jul 27 23:14:17 2017 > New Revision: 321633 > URL: https://svnweb.freebsd.org/changeset/base/321633 > > Log: >   Fix TEX index acquisition using L2 attributes >    >   The TEX index is selected using (TEX0 C B) bits >   from the L2 descriptor. Use correct index by masking >   and shifting those bits accordingly. >    >   Differential Revision: https://reviews.freebsd.org/D11703 How did you guys discover this bug, like what were the symptoms?  Should we consider merging this to 11-stable? -- Ian From owner-svn-src-head@freebsd.org Sat Jul 29 17:00:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD82DDC6FBA; Sat, 29 Jul 2017 17:00:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FECD71324; Sat, 29 Jul 2017 17:00:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TH0NZ7056638; Sat, 29 Jul 2017 17:00:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TH0Nx0056634; Sat, 29 Jul 2017 17:00:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707291700.v6TH0Nx0056634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 29 Jul 2017 17:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321686 - in head/sys: arm/arm compat/linuxkpi/common/src dev/ow sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/arm compat/linuxkpi/common/src dev/ow sys X-SVN-Commit-Revision: 321686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 17:00:24 -0000 Author: ian Date: Sat Jul 29 17:00:23 2017 New Revision: 321686 URL: https://svnweb.freebsd.org/changeset/base/321686 Log: Add inline functions to convert between sbintime_t and decimal time units. Use them in some existing code that is vulnerable to roundoff errors. The existing constant SBT_1NS is a honeypot, luring unsuspecting folks into writing code such as long_timeout_ns*SBT_1NS to generate the argument for a sleep call. The actual value of 1ns in sbt units is ~4.3, leading to a large roundoff error giving a shorter sleep than expected when multiplying by the trucated value of 4 in SBT_1NS. (The evil honeypot aspect becomes clear after you waste a whole day figuring out why your sleeps return early.) Modified: head/sys/arm/arm/mpcore_timer.c head/sys/compat/linuxkpi/common/src/linux_hrtimer.c head/sys/dev/ow/owc_gpiobus.c head/sys/sys/time.h Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sat Jul 29 13:54:28 2017 (r321685) +++ head/sys/arm/arm/mpcore_timer.c Sat Jul 29 17:00:23 2017 (r321686) @@ -351,7 +351,7 @@ attach_et(struct arm_tmr_softc *sc) sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; sc->et.et_quality = 1000; sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = 20 * SBT_1NS; + sc->et.et_min_period = nstosbt(20); sc->et.et_max_period = 2 * SBT_1S; sc->et.et_start = arm_tmr_start; sc->et.et_stop = arm_tmr_stop; Modified: head/sys/compat/linuxkpi/common/src/linux_hrtimer.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sat Jul 29 13:54:28 2017 (r321685) +++ head/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sat Jul 29 17:00:23 2017 (r321686) @@ -101,8 +101,8 @@ linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, { mtx_lock(&hrtimer->mtx); - callout_reset_sbt(&hrtimer->callout, time.tv64 * SBT_1NS, - nsec * SBT_1NS, hrtimer_call_handler, hrtimer, 0); + callout_reset_sbt(&hrtimer->callout, nstosbt(time.tv64), nstosbt(nsec), + hrtimer_call_handler, hrtimer, 0); hrtimer->flags |= HRTIMER_ACTIVE; mtx_unlock(&hrtimer->mtx); } Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Sat Jul 29 13:54:28 2017 (r321685) +++ head/sys/dev/ow/owc_gpiobus.c Sat Jul 29 17:00:23 2017 (r321686) @@ -295,10 +295,10 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * do { now = sbinuptime(); GETPIN(sc, &sample); - } while ((now - then) / SBT_1US < t->t_rdv + 2 && sample == 0); + } while (sbttous(now - then) < t->t_rdv + 2 && sample == 0); critical_exit(); - if ((now - then) / SBT_1NS < t->t_rdv * 1000) + if (sbttons(now - then) < t->t_rdv * 1000) *bit = 1; else *bit = 0; Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Jul 29 13:54:28 2017 (r321685) +++ head/sys/sys/time.h Sat Jul 29 17:00:23 2017 (r321686) @@ -128,7 +128,7 @@ bintime_shift(struct bintime *_bt, int _exp) #define SBT_1M (SBT_1S * 60) #define SBT_1MS (SBT_1S / 1000) #define SBT_1US (SBT_1S / 1000000) -#define SBT_1NS (SBT_1S / 1000000000) +#define SBT_1NS (SBT_1S / 1000000000) /* beware rounding, see nstosbt() */ #define SBT_MAX 0x7fffffffffffffffLL static __inline int @@ -155,6 +155,53 @@ sbttobt(sbintime_t _sbt) return (_bt); } +/* + * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS results in + * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and + * microsecond functions are also provided for completeness. + */ +static __inline int64_t +sbttons(sbintime_t _sbt) +{ + + return ((1000000000 * _sbt) >> 32); +} + +static __inline sbintime_t +nstosbt(int64_t _ns) +{ + + return ((_ns * (((uint64_t)1 << 63) / 500000000) >> 32)); +} + +static __inline int64_t +sbttous(sbintime_t _sbt) +{ + + return ((1000000 * _sbt) >> 32); +} + +static __inline sbintime_t +ustosbt(int64_t _us) +{ + + return ((_us * (((uint64_t)1 << 63) / 500000) >> 32)); +} + +static __inline int64_t +sbttoms(sbintime_t _sbt) +{ + + return ((1000 * _sbt) >> 32); +} + +static __inline sbintime_t +mstosbt(int64_t _ms) +{ + + return ((_ms * (((uint64_t)1 << 63) / 500) >> 32)); +} + /*- * Background information: * @@ -210,7 +257,7 @@ sbttots(sbintime_t _sbt) struct timespec _ts; _ts.tv_sec = _sbt >> 32; - _ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32; + _ts.tv_nsec = sbttons((uint32_t)_sbt); return (_ts); } @@ -218,8 +265,7 @@ static __inline sbintime_t tstosbt(struct timespec _ts) { - return (((sbintime_t)_ts.tv_sec << 32) + - (_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32)); + return (((sbintime_t)_ts.tv_sec << 32) + nstosbt(_ts.tv_nsec)); } static __inline struct timeval @@ -228,7 +274,7 @@ sbttotv(sbintime_t _sbt) struct timeval _tv; _tv.tv_sec = _sbt >> 32; - _tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32; + _tv.tv_usec = sbttous((uint32_t)_sbt); return (_tv); } @@ -236,8 +282,7 @@ static __inline sbintime_t tvtosbt(struct timeval _tv) { - return (((sbintime_t)_tv.tv_sec << 32) + - (_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32)); + return (((sbintime_t)_tv.tv_sec << 32) + ustosbt(_tv.tv_usec)); } #endif /* __BSD_VISIBLE */ From owner-svn-src-head@freebsd.org Sat Jul 29 19:52:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C7DBDC9F68; Sat, 29 Jul 2017 19:52:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4854576364; Sat, 29 Jul 2017 19:52:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TJqmMY031807; Sat, 29 Jul 2017 19:52:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TJqlcE031799; Sat, 29 Jul 2017 19:52:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707291952.v6TJqlcE031799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 29 Jul 2017 19:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321688 - in head/sys: fs/nfs fs/nfsclient nfs sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: fs/nfs fs/nfsclient nfs sys X-SVN-Commit-Revision: 321688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 19:52:49 -0000 Author: rmacklem Date: Sat Jul 29 19:52:47 2017 New Revision: 321688 URL: https://svnweb.freebsd.org/changeset/base/321688 Log: Add kernel support for the NFS client forced dismount "umount -N" option. When an NFS mount is hung against an unresponsive NFS server, the "umount -f" option can be used to dismount the mount. Unfortunately, "umount -f" gets hung as well if a "umount" without "-f" has already been done. Usually, this is because of a vnode lock being held by the "umount" for the mounted-on vnode. This patch adds kernel code so that a new "-N" option can be added to "umount", allowing it to avoid getting hung for this case. It adds two flags. One indicates that a forced dismount is about to happen and the other is used, along with setting mnt_data == NULL, to handshake with the nfs_unmount() VFS call. It includes a slight change to the interface used between the client and common NFS modules, so I bumped __FreeBSD_version to ensure both modules are rebuilt. Tested by: pho Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11735 Modified: head/sys/fs/nfs/nfscl.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfsmount.h head/sys/nfs/nfs_nfssvc.c head/sys/nfs/nfssvc.h head/sys/sys/param.h Modified: head/sys/fs/nfs/nfscl.h ============================================================================== --- head/sys/fs/nfs/nfscl.h Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/fs/nfs/nfscl.h Sat Jul 29 19:52:47 2017 (r321688) @@ -60,7 +60,8 @@ struct nfsv4node { #define NFSCL_LEASE(r) ((r) * 2) /* This macro checks to see if a forced dismount is about to occur. */ -#define NFSCL_FORCEDISM(m) (((m)->mnt_kern_flag & MNTK_UNMOUNTF) != 0) +#define NFSCL_FORCEDISM(m) (((m)->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || \ + (VFSTONFS(m)->nm_privflag & NFSMNTP_FORCEDISM) != 0) /* * These flag bits are used for the argument to nfscl_fillsattr() to Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/fs/nfsclient/nfs_clport.c Sat Jul 29 19:52:47 2017 (r321688) @@ -1311,6 +1311,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua cap_rights_t rights; char *buf; int error; + struct mount *mp; + struct nfsmount *nmp; if (uap->flag & NFSSVC_CBADDSOCK) { error = copyin(uap->argp, (caddr_t)&nfscbdarg, sizeof(nfscbdarg)); @@ -1365,6 +1367,56 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua dumpmntopts.ndmnt_blen); free(buf, M_TEMP); } + } else if (uap->flag & NFSSVC_FORCEDISM) { + buf = malloc(MNAMELEN + 1, M_TEMP, M_WAITOK); + error = copyinstr(uap->argp, buf, MNAMELEN + 1, NULL); + if (error == 0) { + nmp = NULL; + mtx_lock(&mountlist_mtx); + TAILQ_FOREACH(mp, &mountlist, mnt_list) { + if (strcmp(mp->mnt_stat.f_mntonname, buf) == + 0 && strcmp(mp->mnt_stat.f_fstypename, + "nfs") == 0 && mp->mnt_data != NULL) { + nmp = VFSTONFS(mp); + mtx_lock(&nmp->nm_mtx); + if ((nmp->nm_privflag & + NFSMNTP_FORCEDISM) == 0) { + nmp->nm_privflag |= + (NFSMNTP_FORCEDISM | + NFSMNTP_CANCELRPCS); + mtx_unlock(&nmp->nm_mtx); + } else { + nmp = NULL; + mtx_unlock(&nmp->nm_mtx); + } + break; + } + } + mtx_unlock(&mountlist_mtx); + + if (nmp != NULL) { + /* + * Call newnfs_nmcancelreqs() to cause + * any RPCs in progress on the mount point to + * fail. + * This will cause any process waiting for an + * RPC to complete while holding a vnode lock + * on the mounted-on vnode (such as "df" or + * a non-forced "umount") to fail. + * This will unlock the mounted-on vnode so + * a forced dismount can succeed. + * Then clear NFSMNTP_CANCELRPCS and wakeup(), + * so that nfs_unmount() can complete. + */ + newnfs_nmcancelreqs(nmp); + mtx_lock(&nmp->nm_mtx); + nmp->nm_privflag &= ~NFSMNTP_CANCELRPCS; + wakeup(nmp); + mtx_unlock(&nmp->nm_mtx); + } else + error = EINVAL; + } + free(buf, M_TEMP); } else { error = EINVAL; } Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sat Jul 29 19:52:47 2017 (r321688) @@ -1698,6 +1698,11 @@ nfs_unmount(struct mount *mp, int mntflags) */ if ((mntflags & MNT_FORCE) == 0) nfscl_umount(nmp, td); + else { + mtx_lock(&nmp->nm_mtx); + nmp->nm_privflag |= NFSMNTP_FORCEDISM; + mtx_unlock(&nmp->nm_mtx); + } /* Make sure no nfsiods are assigned to this mount. */ mtx_lock(&ncl_iod_mutex); for (i = 0; i < NFS_MAXASYNCDAEMON; i++) @@ -1706,6 +1711,19 @@ nfs_unmount(struct mount *mp, int mntflags) ncl_iodmount[i] = NULL; } mtx_unlock(&ncl_iod_mutex); + + /* + * We can now set mnt_data to NULL and wait for + * nfssvc(NFSSVC_FORCEDISM) to complete. + */ + mtx_lock(&mountlist_mtx); + mtx_lock(&nmp->nm_mtx); + mp->mnt_data = NULL; + mtx_unlock(&mountlist_mtx); + while ((nmp->nm_privflag & NFSMNTP_CANCELRPCS) != 0) + msleep(nmp, &nmp->nm_mtx, PVFS, "nfsfdism", 0); + mtx_unlock(&nmp->nm_mtx); + newnfs_disconnect(&nmp->nm_sockreq); crfree(nmp->nm_sockreq.nr_cred); FREE(nmp->nm_nam, M_SONAME); Modified: head/sys/fs/nfsclient/nfsmount.h ============================================================================== --- head/sys/fs/nfsclient/nfsmount.h Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/fs/nfsclient/nfsmount.h Sat Jul 29 19:52:47 2017 (r321688) @@ -44,6 +44,7 @@ */ struct nfsmount { struct nfsmount_common nm_com; /* Common fields for nlm */ + uint32_t nm_privflag; /* Private flags */ int nm_numgrps; /* Max. size of groupslist */ u_char nm_fh[NFSX_FHMAX]; /* File handle of root dir */ int nm_fhsize; /* Size of root file handle */ @@ -98,6 +99,10 @@ struct nfsmount { #define nm_hostname nm_com.nmcom_hostname #define nm_getinfo nm_com.nmcom_getinfo #define nm_vinvalbuf nm_com.nmcom_vinvalbuf + +/* Private flags. */ +#define NFSMNTP_FORCEDISM 0x00000001 +#define NFSMNTP_CANCELRPCS 0x00000002 #define NFSMNT_DIRPATH(m) (&((m)->nm_name[(m)->nm_krbnamelen + 1])) #define NFSMNT_SRVKRBNAME(m) \ Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/nfs/nfs_nfssvc.c Sat Jul 29 19:52:47 2017 (r321688) @@ -92,7 +92,7 @@ sys_nfssvc(struct thread *td, struct nfssvc_args *uap) nfsd_call_nfsserver != NULL) error = (*nfsd_call_nfsserver)(td, uap); else if ((uap->flag & (NFSSVC_CBADDSOCK | NFSSVC_NFSCBD | - NFSSVC_DUMPMNTOPTS)) && nfsd_call_nfscl != NULL) + NFSSVC_DUMPMNTOPTS | NFSSVC_FORCEDISM)) && nfsd_call_nfscl != NULL) error = (*nfsd_call_nfscl)(td, uap); else if ((uap->flag & (NFSSVC_IDNAME | NFSSVC_GETSTATS | NFSSVC_GSSDADDPORT | NFSSVC_GSSDADDFIRST | NFSSVC_GSSDDELETEALL | Modified: head/sys/nfs/nfssvc.h ============================================================================== --- head/sys/nfs/nfssvc.h Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/nfs/nfssvc.h Sat Jul 29 19:52:47 2017 (r321688) @@ -70,6 +70,7 @@ #define NFSSVC_RESUMENFSD 0x08000000 #define NFSSVC_DUMPMNTOPTS 0x10000000 #define NFSSVC_NEWSTRUCT 0x20000000 +#define NFSSVC_FORCEDISM 0x40000000 /* Argument structure for NFSSVC_DUMPMNTOPTS. */ struct nfscl_dumpmntopts { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jul 29 17:30:25 2017 (r321687) +++ head/sys/sys/param.h Sat Jul 29 19:52:47 2017 (r321688) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200039 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200040 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Jul 29 20:08:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EE1DCA204; Sat, 29 Jul 2017 20:08:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB23B768A4; Sat, 29 Jul 2017 20:08:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TK8Q2Z036023; Sat, 29 Jul 2017 20:08:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TK8Pa2036021; Sat, 29 Jul 2017 20:08:25 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707292008.v6TK8Pa2036021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 29 Jul 2017 20:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321689 - head/sbin/umount X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sbin/umount X-SVN-Commit-Revision: 321689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 20:08:27 -0000 Author: rmacklem Date: Sat Jul 29 20:08:25 2017 New Revision: 321689 URL: https://svnweb.freebsd.org/changeset/base/321689 Log: Add a new "-N" option to umount(8), that does a forced dismount of an NFS mount point. The new "-N" option does a forced dismount of an NFS mount point, but avoids doing any checking of the mounted-on path, so that it will not get hung when a vnode lock is held by another hung process on the mounted-on vnode. The most common case of this is a "umount" with the "-f" option. Other than avoiding checking the mounted-on path, it performs the same forced dismount as a successful "umount -f" would do. This commit includes a content change to the man page. Tested by: pho Reviewed by: kib MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11735 Modified: head/sbin/umount/umount.8 head/sbin/umount/umount.c Modified: head/sbin/umount/umount.8 ============================================================================== --- head/sbin/umount/umount.8 Sat Jul 29 19:52:47 2017 (r321688) +++ head/sbin/umount/umount.8 Sat Jul 29 20:08:25 2017 (r321689) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd July 25, 2017 .Dt UMOUNT 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd unmount file systems .Sh SYNOPSIS .Nm -.Op Fl fnv +.Op Fl fNnv .Ar special ... | node ... | fsid ... .Nm .Fl a | A @@ -81,6 +81,15 @@ The root file system cannot be forcibly unmounted. For NFS, a forced dismount can take up to 1 minute or more to complete against an unresponsive server and may throw away data not yet written to the server for this case. +If a process, such as +.Nm +without the +.Fl f +flag is hung on an +.Tn NFS +mount point, use the +.Fl N +flag instead. Also, doing a forced dismount of an NFSv3 mount when .Xr rpc.lockd 8 is running is unsafe and can result in a crash. @@ -94,6 +103,24 @@ option and, unless otherwise specified with the option, will only unmount .Tn NFS file systems. +.It Fl N +Do a forced dismount of an +.Tn NFS +mount point without checking the mount path. +This option can only be used with the path to the mount point +.Ar node +and the path must be specified exactly as it was at mount time. +This option is useful when a process is hung waiting for an unresponsive +.Tn NFS +server while holding a vnode lock on the mounted-on vnode, such that +.Nm +with the +.Fl f +flag can't complete. +Using this option can result in a loss of file updates that have not been +flushed to the +.Tn NFS +server. .It Fl n Unless the .Fl f Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Sat Jul 29 19:52:47 2017 (r321688) +++ head/sbin/umount/umount.c Sat Jul 29 20:08:25 2017 (r321689) @@ -86,13 +86,13 @@ int xdr_dir (XDR *, char *); int main(int argc, char *argv[]) { - int all, errs, ch, mntsize, error; + int all, errs, ch, mntsize, error, nfsforce, ret; char **typelist = NULL; struct statfs *mntbuf, *sfs; struct addrinfo hints; - all = errs = 0; - while ((ch = getopt(argc, argv, "AaF:fh:nt:v")) != -1) + nfsforce = all = errs = 0; + while ((ch = getopt(argc, argv, "AaF:fh:Nnt:v")) != -1) switch (ch) { case 'A': all = 2; @@ -110,6 +110,9 @@ main(int argc, char *argv[]) all = 2; nfshost = optarg; break; + case 'N': + nfsforce = 1; + break; case 'n': fflag |= MNT_NONBUSY; break; @@ -132,12 +135,15 @@ main(int argc, char *argv[]) err(1, "-f and -n are mutually exclusive"); /* Start disks transferring immediately. */ - if ((fflag & (MNT_FORCE | MNT_NONBUSY)) == 0) + if ((fflag & (MNT_FORCE | MNT_NONBUSY)) == 0 && nfsforce == 0) sync(); if ((argc == 0 && !all) || (argc != 0 && all)) usage(); + if (nfsforce != 0 && (argc == 0 || nfshost != NULL || typelist != NULL)) + usage(); + /* -h implies "-t nfs" if no -t flag. */ if ((nfshost != NULL) && (typelist == NULL)) typelist = makevfslist("nfs"); @@ -175,7 +181,20 @@ main(int argc, char *argv[]) break; case 0: for (errs = 0; *argv != NULL; ++argv) - if (checkname(*argv, typelist) != 0) + if (nfsforce != 0) { + /* + * First do the nfssvc() syscall to shut down + * the mount point and then do the forced + * dismount. + */ + ret = nfssvc(NFSSVC_FORCEDISM, *argv); + if (ret >= 0) + ret = unmount(*argv, MNT_FORCE); + if (ret < 0) { + warn("%s", *argv); + errs = 1; + } + } else if (checkname(*argv, typelist) != 0) errs = 1; break; } @@ -635,7 +654,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: umount [-fnv] special ... | node ... | fsid ...", + "usage: umount [-fNnv] special ... | node ... | fsid ...", " umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]"); exit(1); } From owner-svn-src-head@freebsd.org Sat Jul 29 20:11:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503C0DCA280; Sat, 29 Jul 2017 20:11:47 +0000 (UTC) (envelope-from zbodek@gmail.com) Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::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 17BCF76AA9; Sat, 29 Jul 2017 20:11:47 +0000 (UTC) (envelope-from zbodek@gmail.com) Received: by mail-pg0-x22a.google.com with SMTP id u185so17723106pgb.1; Sat, 29 Jul 2017 13:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cLha8ZBeMCZrMf02pYawsOmVk391mp+6z1JubeRmGwc=; b=okMMSjyhcJmKbH3uB6PMNPVCyWQfe9kQwTi57v02Co5InYhiVr0m0PQpUSGWfZJ/P1 mLa/hNLOdmTvlrgekgNeFxrTBsZTlGl2lE8NLrzosbA9V6LDjXT1tJzyjgSLk6REOqWW 3KqO/vcPTW8wLranSrpPPG5sGFxzcJQlFfgCY4+gfZXz+VfnwGr4HbsmlrWabblqEBCV bqKg2DYXF6iwUjvb5GvXmNxB2oEug3metgTjOu4z2kf/w2jikrYZl0QCcUNlwq607YzU w1Snr+Blb3lXJZryiIRQnKmh7h1VNqjxAWmPsf0lWyOqz+ymgCASbwG0LAjkV7y6k1kD SDdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=cLha8ZBeMCZrMf02pYawsOmVk391mp+6z1JubeRmGwc=; b=jmGxDcJWf41SHpKzMJt37r3/bpwlGDBzlX3JJ1PzLzb0QMgzGFNX8RdTm5mkhtqStZ JVD2rz5hsg8cjP+H8s+BS5639y0x8obbN/RSB1McuV8tCKUg54CAiC+5KaQbm4lWc642 yVbn3TJE/OeTtnbww+f+Xr+i35pJFejmv5yMHsTFoUW6ZjbzYCpKVJsFv3PFMvUwRrWc UWx4BAL2kRh6G5xwgaTBrnmlaMqsjUlN4q3f1VV7YYvbTKq6FBsXd9iBpjEzmALmFg/O fjbtsz86FdDxnWBUZuROblPaGAl2fLNujtfavhyqcd+p/Vkke/jogscYJt40uVDrp4VI db8A== X-Gm-Message-State: AIVw112Fy1d8AZlC18MQO0TKgPrm5y3tgyxCy9Yb7UX/vRzPENMeG6Sa 1RXeBa9mZGpmliOuh6ply4xxUcklAyTh7Kw= X-Received: by 10.84.191.165 with SMTP id a34mr11956914pld.243.1501359106532; Sat, 29 Jul 2017 13:11:46 -0700 (PDT) MIME-Version: 1.0 Sender: zbodek@gmail.com Received: by 10.100.157.166 with HTTP; Sat, 29 Jul 2017 13:11:26 -0700 (PDT) In-Reply-To: <1501344365.90400.99.camel@freebsd.org> References: <201707272314.v6RNEHwQ033479@repo.freebsd.org> <1501344365.90400.99.camel@freebsd.org> From: Zbigniew Bodek Date: Sat, 29 Jul 2017 22:11:26 +0200 X-Google-Sender-Auth: vdfSFZD8VJZZ3BbwBKfxaWL74mA Message-ID: Subject: Re: svn commit: r321633 - in head/sys/arm: arm include To: Ian Lepore 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.23 Precedence: list List-Id: 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, 29 Jul 2017 20:11:47 -0000 2017-07-29 18:06 GMT+02:00 Ian Lepore : > On Thu, 2017-07-27 at 23:14 +0000, Zbigniew Bodek wrote: >> Author: zbb >> Date: Thu Jul 27 23:14:17 2017 >> New Revision: 321633 >> URL: https://svnweb.freebsd.org/changeset/base/321633 >> >> Log: >> Fix TEX index acquisition using L2 attributes >> >> The TEX index is selected using (TEX0 C B) bits >> from the L2 descriptor. Use correct index by masking >> and shifting those bits accordingly. >> >> Differential Revision: https://reviews.freebsd.org/D11703 > > How did you guys discover this bug, like what were the symptoms? Hello Ian, We had bug in usage of pmap_remap_vm_attr() and fixing it didn't help for the issue so the second bug has been found here. > Should we consider merging this to 11-stable? As far as I know nobody besides Armada38x is using this function in HEAD and nobody uses it in 11. You may merge it to 11 though (just for the safety of this code in the future). > > -- Ian From owner-svn-src-head@freebsd.org Sat Jul 29 20:52:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11725DCAF6B for ; Sat, 29 Jul 2017 20:52:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9836B77CFA for ; Sat, 29 Jul 2017 20:52:57 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e2b3602b-749f-11e7-b2f5-7fbc454a3a22 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e2b3602b-749f-11e7-b2f5-7fbc454a3a22; Sat, 29 Jul 2017 20:52:52 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v6TKqmsH001795; Sat, 29 Jul 2017 14:52:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1501361568.90400.100.camel@freebsd.org> Subject: Re: svn commit: r321633 - in head/sys/arm: arm include From: Ian Lepore To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 29 Jul 2017 14:52:48 -0600 In-Reply-To: References: <201707272314.v6RNEHwQ033479@repo.freebsd.org> <1501344365.90400.99.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 20:52:58 -0000 On Sat, 2017-07-29 at 22:11 +0200, Zbigniew Bodek wrote: > 2017-07-29 18:06 GMT+02:00 Ian Lepore : > > > > On Thu, 2017-07-27 at 23:14 +0000, Zbigniew Bodek wrote: > > > > > > Author: zbb > > > Date: Thu Jul 27 23:14:17 2017 > > > New Revision: 321633 > > > URL: https://svnweb.freebsd.org/changeset/base/321633 > > > > > > Log: > > >   Fix TEX index acquisition using L2 attributes > > > > > >   The TEX index is selected using (TEX0 C B) bits > > >   from the L2 descriptor. Use correct index by masking > > >   and shifting those bits accordingly. > > > > > >   Differential Revision:      https://reviews.freebsd.org/D11703 > > How did you guys discover this bug, like what were the symptoms? > Hello Ian, > > We had bug in usage of  pmap_remap_vm_attr() and fixing it didn't > help > for the issue so the second bug has been found here. > > > > >  Should we consider merging this to 11-stable? > As far as I know nobody besides Armada38x is using this function in > HEAD and nobody uses it in 11. > You may merge it to 11 though (just for the safety of this code in > the future). Cool, thanks.  We just imported 11-stable for use at $work, so I want to start from the most bug-free base we can.  :) -- Ian From owner-svn-src-head@freebsd.org Sat Jul 29 22:01:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF70CDCC359; Sat, 29 Jul 2017 22:01:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9E437E42E; Sat, 29 Jul 2017 22:01:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TM1HlC081076; Sat, 29 Jul 2017 22:01:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TM1Hvb081075; Sat, 29 Jul 2017 22:01:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292201.v6TM1Hvb081075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321702 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 321702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 22:01:19 -0000 Author: ngie Date: Sat Jul 29 22:01:17 2017 New Revision: 321702 URL: https://svnweb.freebsd.org/changeset/base/321702 Log: Load geom_gate(4) if necessary before running tests; skip if it can't be loaded The test code prior to r311893 loaded geom_gate at test start if necessary and skipped the tests if it couldn't be loaded. The ATF-ifcation of this test done in r311893 unfortunately dropped this functionality. This change restores the geom_gate module load and skips the test(s) if unavailable in an ATF-like way. MFC after: 1 month PR: 220164 Reported by: gjb Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 21:31:54 2017 (r321701) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 22:01:17 2017 (r321702) @@ -16,6 +16,8 @@ ggated_head() ggated_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -57,6 +59,8 @@ ggatel_file_head() ggatel_file_body() { + load_ggate + us=$(alloc_ggate_dev) echo src work >> ${PLAINFILES} @@ -91,6 +95,8 @@ ggatel_md_head() ggatel_md_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -193,6 +199,19 @@ common_cleanup() rm md.devs fi true +} + +load_ggate() +{ + local class=gate + + # If the geom class isn't already loaded, try loading it. + if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + atf_skip "could not load module for geom class=${class}" + exit 0 + fi + fi } # Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` From owner-svn-src-head@freebsd.org Sat Jul 29 22:03:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E1ADCC4EE; Sat, 29 Jul 2017 22:03:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9697E732; Sat, 29 Jul 2017 22:03:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TM3Lnl085030; Sat, 29 Jul 2017 22:03:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TM3LcU085029; Sat, 29 Jul 2017 22:03:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292203.v6TM3LcU085029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321703 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 321703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 22:03:22 -0000 Author: ngie Date: Sat Jul 29 22:03:21 2017 New Revision: 321703 URL: https://svnweb.freebsd.org/changeset/base/321703 Log: Remove superfluous `exit 0` added in r321702 atf_skip triggers equivalent functionality, which means the `exit 0` is unreachable code. PR: 220164 MFC after: 1 month MFC with: r321702 Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 22:01:17 2017 (r321702) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sat Jul 29 22:03:21 2017 (r321703) @@ -209,7 +209,6 @@ load_ggate() if ! kldstat -q -m g_${class}; then if ! geom ${class} load; then atf_skip "could not load module for geom class=${class}" - exit 0 fi fi } From owner-svn-src-head@freebsd.org Sat Jul 29 22:16:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F0C9DCC6E0; Sat, 29 Jul 2017 22:16:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AB17EB17; Sat, 29 Jul 2017 22:16:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TMG5JK089245; Sat, 29 Jul 2017 22:16:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TMG5Qh089244; Sat, 29 Jul 2017 22:16:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292216.v6TMG5Qh089244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321704 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 321704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 22:16:06 -0000 Author: ngie Date: Sat Jul 29 22:16:05 2017 New Revision: 321704 URL: https://svnweb.freebsd.org/changeset/base/321704 Log: Add sys/socket.h to SYNOPSIS for libprocstat(3) sys/socket.h is required for procstat_get_socket_info(3), added in r221807. MFC after: 1 month PR: 217884 Submitted by: tobik Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:03:21 2017 (r321703) +++ head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:16:05 2017 (r321704) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2017 +.Dd July 29, 2017 .Dt LIBPROCSTAT 3 .Os .Sh NAME @@ -66,6 +66,7 @@ .Sh SYNOPSIS .In sys/param.h .In sys/queue.h +.In sys/socket.h .In libprocstat.h .Ft void .Fn procstat_close "struct procstat *procstat" From owner-svn-src-head@freebsd.org Sat Jul 29 22:19:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA604DCC770; Sat, 29 Jul 2017 22:19:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7FD7EC6B; Sat, 29 Jul 2017 22:19:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TMJ0o1089398; Sat, 29 Jul 2017 22:19:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TMJ0kZ089397; Sat, 29 Jul 2017 22:19:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292219.v6TMJ0kZ089397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321705 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 321705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 22:19:01 -0000 Author: ngie Date: Sat Jul 29 22:19:00 2017 New Revision: 321705 URL: https://svnweb.freebsd.org/changeset/base/321705 Log: libprocstat(3): fix reference (typo) to procstat_freeenvv in description for procstat_getargv(3) PR: 217884 MFC after: 1 month Submitted by: tobik Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:16:05 2017 (r321704) +++ head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:19:00 2017 (r321705) @@ -379,7 +379,7 @@ function is similar to .Fn procstat_getargv but returns the vector of environment strings. The caller may free the allocated memory with a subsequent -.Fn procstat_freeenv +.Fn procstat_freeenvv function call. .Pp The From owner-svn-src-head@freebsd.org Sat Jul 29 22:25:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1046BDCC9C2; Sat, 29 Jul 2017 22:25:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2D857F0BE; Sat, 29 Jul 2017 22:25:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TMPjKv093210; Sat, 29 Jul 2017 22:25:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TMPjkx093209; Sat, 29 Jul 2017 22:25:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707292225.v6TMPjkx093209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 29 Jul 2017 22:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321706 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 321706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 22:25:47 -0000 Author: ngie Date: Sat Jul 29 22:25:45 2017 New Revision: 321706 URL: https://svnweb.freebsd.org/changeset/base/321706 Log: libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3) Neither libcall takes a fourth argument (`char *errbuf`). PR: 217884 Submitted by: tobik MFC after: 1 month Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:19:00 2017 (r321705) +++ head/lib/libprocstat/libprocstat.3 Sat Jul 29 22:25:45 2017 (r321706) @@ -157,7 +157,6 @@ .Fa "struct procstat *procstat" .Fa "const struct kinfo_proc *kp" .Fa "size_t nchr" -.Fa "char *errbuf" .Fc .Ft "Elf_Auxinfo *" .Fo procstat_getauxv @@ -170,7 +169,6 @@ .Fa "struct procstat *procstat" .Fa "const struct kinfo_proc *kp" .Fa "size_t nchr" -.Fa "char *errbuf" .Fc .Ft "struct filestat_list *" .Fo procstat_getfiles From owner-svn-src-head@freebsd.org Sat Jul 29 23:31:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5630BDCD82A; Sat, 29 Jul 2017 23:31:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 243638070A; Sat, 29 Jul 2017 23:31:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TNVLv1017764; Sat, 29 Jul 2017 23:31:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TNVLLO017763; Sat, 29 Jul 2017 23:31:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201707292331.v6TNVLLO017763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 29 Jul 2017 23:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321707 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 23:31:22 -0000 Author: cem Date: Sat Jul 29 23:31:21 2017 New Revision: 321707 URL: https://svnweb.freebsd.org/changeset/base/321707 Log: kldstat: Use sizeof in place of named constants for sizing No functional change. This is handy for FreeBSD derivatives that want to modify the value of MAXPATHLEN, but not the kld_file_stat ABI. Submitted by: Siddhant Agarwal Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Jul 29 22:25:45 2017 (r321706) +++ head/sys/kern/kern_linker.c Sat Jul 29 23:31:21 2017 (r321707) @@ -1243,8 +1243,8 @@ kern_kldstat(struct thread *td, int fileid, struct kld /* Version 1 fields: */ namelen = strlen(lf->filename) + 1; - if (namelen > MAXPATHLEN) - namelen = MAXPATHLEN; + if (namelen > sizeof(stat->name)) + namelen = sizeof(stat->name); bcopy(lf->filename, &stat->name[0], namelen); stat->refs = lf->refs; stat->id = lf->id; @@ -1252,8 +1252,8 @@ kern_kldstat(struct thread *td, int fileid, struct kld stat->size = lf->size; /* Version 2 fields: */ namelen = strlen(lf->pathname) + 1; - if (namelen > MAXPATHLEN) - namelen = MAXPATHLEN; + if (namelen > sizeof(stat->pathname)) + namelen = sizeof(stat->pathname); bcopy(lf->pathname, &stat->pathname[0], namelen); sx_xunlock(&kld_sx); From owner-svn-src-head@freebsd.org Sat Jul 29 23:45:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D8FDCDAA6; Sat, 29 Jul 2017 23:45:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29D480C42; Sat, 29 Jul 2017 23:45:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6TNjwwH025617; Sat, 29 Jul 2017 23:45:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6TNjvSb025615; Sat, 29 Jul 2017 23:45:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707292345.v6TNjvSb025615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 29 Jul 2017 23:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321708 - in head/sys: conf dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: conf dev/iicbus X-SVN-Commit-Revision: 321708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 29 Jul 2017 23:45:59 -0000 Author: ian Date: Sat Jul 29 23:45:57 2017 New Revision: 321708 URL: https://svnweb.freebsd.org/changeset/base/321708 Log: Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles all the chips in the NXP PCA212x and PCA/PCF85xx series. In addition to supporting more chips, this driver uses the countdown timer on the chips as a fractional seconds counter, giving it a resolution of about 15 milliseconds. Added: head/sys/dev/iicbus/nxprtc.c (contents, props changed) Deleted: head/sys/dev/iicbus/pcf8563.c head/sys/dev/iicbus/pcf8563reg.h Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jul 29 23:31:21 2017 (r321707) +++ head/sys/conf/files Sat Jul 29 23:45:57 2017 (r321708) @@ -1737,8 +1737,8 @@ dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc dev/iicbus/lm75.c optional lm75 +dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus -dev/iicbus/pcf8563.c optional pcf8563 dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir Added: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/nxprtc.c Sat Jul 29 23:45:57 2017 (r321708) @@ -0,0 +1,787 @@ +/*- + * Copyright (c) 2017 Ian Lepore + * 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$"); + +/* + * Driver for NXP real-time clock/calendar chips: + * - PCF8563 = low power, countdown timer + * - PCA8565 = like PCF8563, automotive temperature range + * - PCF8523 = low power, countdown timer, oscillator freq tuning, 2 timers + * - PCF2127 = like PCF8523, industrial, tcxo, tamper/ts, i2c & spi, 512B ram + * - PCA2129 = like PCF8523, automotive, tcxo, tamper/ts, i2c & spi, no timer + * - PCF2129 = like PCF8523, industrial, tcxo, tamper/ts, i2c & spi, no timer + * + * Most chips have a countdown timer, ostensibly intended to generate periodic + * interrupt signals on an output pin. The timer is driven from the same + * divider chain that clocks the time of day registers, and they start counting + * in sync when the STOP bit is cleared after the time and timer registers are + * set. The timer register can also be read on the fly, so we use it to count + * fractional seconds and get a resolution of ~15ms. + */ + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef FDT +#include +#include +#include +#endif + +#include "clock_if.h" +#include "iicbus_if.h" + +/* + * I2C address 1010 001x : PCA2129 PCF2127 PCF2129 PCF8563 PCF8565 + * I2C address 1101 000x : PCF8523 + */ +#define PCF8563_ADDR 0xa2 +#define PCF8523_ADDR 0xd0 + +/* + * Registers, bits within them, and masks that are common to all chip types. + */ +#define PCF85xx_R_CS1 0x00 /* CS1 and CS2 control regs are in */ +#define PCF85xx_R_CS2 0x01 /* the same location on all chips. */ + +#define PCF85xx_B_CS1_STOP 0x20 /* Stop time incrementing bit */ +#define PCF85xx_B_SECOND_OS 0x80 /* Oscillator Stopped bit */ + +#define PCF85xx_M_SECOND 0x7f /* Masks for all BCD time regs... */ +#define PCF85xx_M_MINUTE 0x7f +#define PCF85xx_M_HOUR 0x3f +#define PCF85xx_M_DAY 0x3f +#define PCF85xx_M_MONTH 0x1f +#define PCF85xx_M_YEAR 0xff + +/* + * PCF2127-specific registers, bits, and masks. + */ +#define PCF2127_R_TMR_CTL 0x10 /* Timer/watchdog control */ + +#define PCF2127_M_TMR_CTRL 0xe3 /* Mask off undef bits */ + +#define PCF2127_B_TMR_CD 0x40 /* Run in countdown mode */ +#define PCF2127_B_TMR_64HZ 0x01 /* Timer frequency 64Hz */ + +/* + * PCA/PCF2129-specific registers, bits, and masks. + */ +#define PCF2129_B_CS1_12HR 0x04 /* Use 12-hour (AM/PM) mode bit */ +#define PCF2129_B_CLKOUT_OTPR 0x20 /* OTP refresh command */ +#define PCF2129_B_CLKOUT_HIGHZ 0x07 /* Clock Out Freq = disable */ + +/* + * PCF8523-specific registers, bits, and masks. + */ +#define PCF8523_R_CS3 0x02 /* Control and status reg 3 */ +#define PCF8523_R_SECOND 0x03 /* Seconds */ +#define PCF8523_R_TMR_CLKOUT 0x0F /* Timer and clockout control */ +#define PCF8523_R_TMR_A_FREQ 0x10 /* Timer A frequency control */ +#define PCF8523_R_TMR_A_COUNT 0x11 /* Timer A count */ + +#define PCF8523_M_TMR_A_FREQ 0x07 /* Mask off undef bits */ + +#define PCF8523_B_HOUR_PM 0x20 /* PM bit */ +#define PCF8523_B_CS1_SOFTRESET 0x58 /* Initiate Soft Reset bits */ +#define PCF8523_B_CS1_12HR 0x08 /* Use 12-hour (AM/PM) mode bit */ +#define PCF8523_B_CLKOUT_TACD 0x02 /* TimerA runs in CountDown mode */ +#define PCF8523_B_CLKOUT_HIGHZ 0x38 /* Clock Out Freq = disable */ +#define PCF8523_B_TMR_A_64HZ 0x01 /* Timer A freq 64Hz */ + +#define PCF8523_M_CS3_PM 0xE0 /* Power mode mask */ +#define PCF8523_B_CS3_PM_NOBAT 0xE0 /* PM bits: no battery usage */ +#define PCF8523_B_CS3_PM_STD 0x00 /* PM bits: standard */ +#define PCF8523_B_CS3_BLF 0x04 /* Battery Low Flag bit */ + +/* + * PCF8563-specific registers, bits, and masks. + */ +#define PCF8563_R_SECOND 0x02 /* Seconds */ +#define PCF8563_R_TMR_CTRL 0x0e /* Timer control */ +#define PCF8563_R_TMR_COUNT 0x0f /* Timer count */ + +#define PCF8563_M_TMR_CTRL 0x93 /* Mask off undef bits */ + +#define PCF8563_B_TMR_ENABLE 0x80 /* Enable countdown timer */ +#define PCF8563_B_TMR_64HZ 0x01 /* Timer frequency 64Hz */ + +#define PCF8563_B_MONTH_C 0x80 /* Century bit */ + +/* + * We use the countdown timer for fractional seconds. We program it for 64 Hz, + * the fastest available rate that doesn't roll over in less than a second. + */ +#define TMR_TICKS_SEC 64 +#define TMR_TICKS_HALFSEC 32 + +/* + * The chip types we support. + */ +enum { + TYPE_NONE, + TYPE_PCA2129, + TYPE_PCA8565, + TYPE_PCF2127, + TYPE_PCF2129, + TYPE_PCF8523, + TYPE_PCF8563, + + TYPE_COUNT +}; +static const char *desc_strings[] = { + "", + "NXP PCA2129 RTC", + "NXP PCA8565 RTC", + "NXP PCF2127 RTC", + "NXP PCF2129 RTC", + "NXP PCF8523 RTC", + "NXP PCF8563 RTC", +}; +CTASSERT(nitems(desc_strings) == TYPE_COUNT); + +/* + * The time registers in the order they are laid out in hardware. + */ +struct time_regs { + uint8_t sec, min, hour, day, wday, month, year; +}; + +struct nxprtc_softc { + device_t dev; + device_t busdev; + struct intr_config_hook + config_hook; + u_int flags; /* SC_F_* flags */ + u_int chiptype; /* Type of PCF85xx chip */ + uint8_t secaddr; /* Address of seconds register */ + uint8_t tmcaddr; /* Address of timer count register */ + uint8_t slave_addr; /* PCF85xx slave address */ + bool use_timer; /* Use timer for fractional sec */ +}; + +#define SC_F_CPOL (1 << 0) /* Century bit means 19xx */ +#define SC_F_AMPM (1 << 1) /* Use PM flag in hours reg */ + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"nxp,pca2129", TYPE_PCA2129}, + {"nxp,pca8565", TYPE_PCA8565}, + {"nxp,pcf2127", TYPE_PCF2127}, + {"nxp,pcf2129", TYPE_PCF2129}, + {"nxp,pcf8523", TYPE_PCF8523}, + {"nxp,pcf8563", TYPE_PCF8563}, + + /* Undocumented compat strings known to exist in the wild... */ + {"pcf8563", TYPE_PCF8563}, + {"phg,pcf8563", TYPE_PCF8563}, + {"philips,pcf8563", TYPE_PCF8563}, + + {NULL, TYPE_NONE}, +}; +#endif + +static int +read_reg(struct nxprtc_softc *sc, uint8_t reg, uint8_t *val) +{ + + return (iicdev_readfrom(sc->dev, reg, val, sizeof(*val), IIC_WAIT)); +} + +static int +write_reg(struct nxprtc_softc *sc, uint8_t reg, uint8_t val) +{ + + return (iicdev_writeto(sc->dev, reg, &val, sizeof(val), IIC_WAIT)); +} + +static int +read_timeregs(struct nxprtc_softc *sc, struct time_regs *tregs, uint8_t *tmr) +{ + int err; + uint8_t sec, tmr1, tmr2; + + /* + * The datasheet says loop to read the same timer value twice because it + * does not freeze while reading. To that we add our own logic that + * the seconds register must be the same before and after reading the + * timer, ensuring the fractional part is from the same second as tregs. + */ + do { + if (sc->use_timer) { + if ((err = read_reg(sc, sc->secaddr, &sec)) != 0) + break; + if ((err = read_reg(sc, sc->tmcaddr, &tmr1)) != 0) + break; + if ((err = read_reg(sc, sc->tmcaddr, &tmr2)) != 0) + break; + if (tmr1 != tmr2) + continue; + } + if ((err = iicdev_readfrom(sc->dev, sc->secaddr, tregs, + sizeof(*tregs), IIC_WAIT)) != 0) + break; + } while (sc->use_timer && tregs->sec != sec); + + /* + * If the timer value is greater than our hz rate (or is zero), + * something is wrong. Maybe some other OS used the timer differently? + * Just set it to zero. Likewise if we're not using the timer. After + * the offset calc below, the zero turns into 32, the mid-second point, + * which in effect performs 4/5 rounding, which is just the right thing + * to do if we don't have fine-grained time. + */ + if (!sc->use_timer || tmr1 > TMR_TICKS_SEC) + tmr1 = 0; + + /* + * Turn the downcounter into an upcounter. The timer starts counting at + * and rolls over at mid-second, so add half a second worth of ticks to + * get its zero point back in sync with the tregs.sec rollover. + */ + *tmr = (TMR_TICKS_SEC - tmr1 + TMR_TICKS_HALFSEC) % TMR_TICKS_SEC; + + return (err); +} + +static int +write_timeregs(struct nxprtc_softc *sc, struct time_regs *tregs) +{ + + return (iicdev_writeto(sc->dev, sc->secaddr, tregs, + sizeof(*tregs), IIC_WAIT)); +} + +static int +pcf8523_start(struct nxprtc_softc *sc) +{ + int err; + uint8_t cs1, cs3, clkout; + bool is2129; + + is2129 = (sc->chiptype == TYPE_PCA2129 || sc->chiptype == TYPE_PCF2129); + + /* Read and sanity-check the control registers. */ + if ((err = read_reg(sc, PCF85xx_R_CS1, &cs1)) != 0) { + device_printf(sc->dev, "cannot read RTC CS1 control\n"); + return (err); + } + if ((err = read_reg(sc, PCF8523_R_CS3, &cs3)) != 0) { + device_printf(sc->dev, "cannot read RTC CS3 control\n"); + return (err); + } + + /* + * Do a full init (soft-reset) if... + * - The chip is in battery-disable mode (fresh from the factory). + * - The clock-increment STOP flag is set (this is just insane). + * After reset, battery disable mode has to be overridden to "standard" + * mode. Also, turn off clock output to save battery power. + */ + if ((cs3 & PCF8523_M_CS3_PM) == PCF8523_B_CS3_PM_NOBAT || + (cs1 & PCF85xx_B_CS1_STOP)) { + cs1 = PCF8523_B_CS1_SOFTRESET; + if ((err = write_reg(sc, PCF85xx_R_CS1, cs1)) != 0) { + device_printf(sc->dev, "cannot write CS1 control\n"); + return (err); + } + cs3 = PCF8523_B_CS3_PM_STD; + if ((err = write_reg(sc, PCF8523_R_CS3, cs3)) != 0) { + device_printf(sc->dev, "cannot write CS3 control\n"); + return (err); + } + /* + * For 2129 series, trigger OTP refresh by forcing the OTPR bit + * to zero then back to 1, then wait 100ms for the refresh, and + * finally set the bit back to zero with the COF_HIGHZ write. + */ + if (is2129) { + clkout = PCF2129_B_CLKOUT_HIGHZ; + if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, + clkout)) != 0) { + device_printf(sc->dev, + "cannot write CLKOUT control\n"); + return (err); + } + if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, + clkout | PCF2129_B_CLKOUT_OTPR)) != 0) { + device_printf(sc->dev, + "cannot write CLKOUT control\n"); + return (err); + } + pause_sbt("nxpotp", mstosbt(100), mstosbt(10), 0); + } else + clkout = PCF8523_B_CLKOUT_HIGHZ; + if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, clkout)) != 0) { + device_printf(sc->dev, "cannot write CLKOUT control\n"); + return (err); + } + device_printf(sc->dev, + "first time startup, enabled RTC battery operation\n"); + + /* + * Sleep briefly so the battery monitor can make a measurement, + * then re-read CS3 so battery-low status can be reported below. + */ + pause_sbt("nxpbat", mstosbt(100), 0, 0); + if ((err = read_reg(sc, PCF8523_R_CS3, &cs3)) != 0) { + device_printf(sc->dev, "cannot read RTC CS3 control\n"); + return (err); + } + } + + /* Let someone know if the battery is weak. */ + if (cs3 & PCF8523_B_CS3_BLF) + device_printf(sc->dev, "WARNING: RTC battery is low\n"); + + /* Remember whether we're running in AM/PM mode. */ + if (is2129) { + if (cs1 & PCF2129_B_CS1_12HR) + sc->flags |= SC_F_AMPM; + } else { + if (cs1 & PCF8523_B_CS1_12HR) + sc->flags |= SC_F_AMPM; + } + + return (0); +} + +static int +pcf8523_start_timer(struct nxprtc_softc *sc) +{ + int err; + uint8_t clkout, stdclk, stdfreq, tmrfreq; + + /* + * Read the timer control and frequency regs. If they don't have the + * values we normally program into them then the timer count doesn't + * contain a valid fractional second, so zero it to prevent using a bad + * value. Then program the normal timer values so that on the first + * settime call we'll begin to use fractional time. + */ + if ((err = read_reg(sc, PCF8523_R_TMR_A_FREQ, &tmrfreq)) != 0) + return (err); + if ((err = read_reg(sc, PCF8523_R_TMR_CLKOUT, &clkout)) != 0) + return (err); + + stdfreq = PCF8523_B_TMR_A_64HZ; + stdclk = PCF8523_B_CLKOUT_TACD | PCF8523_B_CLKOUT_HIGHZ; + + if (clkout != stdclk || (tmrfreq & PCF8523_M_TMR_A_FREQ) != stdfreq) { + if ((err = write_reg(sc, sc->tmcaddr, 0)) != 0) + return (err); + if ((err = write_reg(sc, PCF8523_R_TMR_A_FREQ, stdfreq)) != 0) + return (err); + if ((err = write_reg(sc, PCF8523_R_TMR_CLKOUT, stdclk)) != 0) + return (err); + } + return (0); +} + +static int +pcf2127_start_timer(struct nxprtc_softc *sc) +{ + int err; + uint8_t stdctl, tmrctl; + + /* See comment in pcf8523_start_timer(). */ + if ((err = read_reg(sc, PCF2127_R_TMR_CTL, &tmrctl)) != 0) + return (err); + + stdctl = PCF2127_B_TMR_CD | PCF8523_B_TMR_A_64HZ; + + if ((tmrctl & PCF2127_M_TMR_CTRL) != stdctl) { + if ((err = write_reg(sc, sc->tmcaddr, 0)) != 0) + return (err); + if ((err = write_reg(sc, PCF2127_R_TMR_CTL, stdctl)) != 0) + return (err); + } + return (0); +} + +static int +pcf8563_start_timer(struct nxprtc_softc *sc) +{ + int err; + uint8_t stdctl, tmrctl; + + /* See comment in pcf8523_start_timer(). */ + if ((err = read_reg(sc, PCF8563_R_TMR_CTRL, &tmrctl)) != 0) + return (err); + + stdctl = PCF8563_B_TMR_ENABLE | PCF8563_B_TMR_64HZ; + + if ((tmrctl & PCF8563_M_TMR_CTRL) != stdctl) { + if ((err = write_reg(sc, sc->tmcaddr, 0)) != 0) + return (err); + if ((err = write_reg(sc, PCF8563_R_TMR_CTRL, stdctl)) != 0) + return (err); + } + return (0); +} + +static void +nxprtc_start(void *dev) +{ + struct nxprtc_softc *sc; + int clockflags, resolution; + uint8_t sec; + + sc = device_get_softc((device_t)dev); + config_intrhook_disestablish(&sc->config_hook); + + /* First do chip-specific inits. */ + switch (sc->chiptype) { + case TYPE_PCA2129: + case TYPE_PCF2129: + if (pcf8523_start(sc) != 0) + return; + /* No timer to start */ + break; + case TYPE_PCF2127: + if (pcf8523_start(sc) != 0) + return; + if (pcf2127_start_timer(sc) != 0) + return; + break; + case TYPE_PCF8523: + if (pcf8523_start(sc) != 0) + return; + if (pcf8523_start_timer(sc) != 0) + return; + break; + case TYPE_PCA8565: + case TYPE_PCF8563: + if (pcf8563_start_timer(sc) != 0) + return; + break; + default: + device_printf(sc->dev, "missing init code for this chiptype\n"); + return; + } + + /* + * Common init. Read the seconds register so we can check the + * oscillator-stopped status bit in it. + */ + if (read_reg(sc, sc->secaddr, &sec) != 0) { + device_printf(sc->dev, "cannot read RTC seconds\n"); + return; + } + if ((sec & PCF85xx_B_SECOND_OS) != 0) { + device_printf(sc->dev, + "WARNING: RTC battery failed; time is invalid\n"); + } + + /* + * Everything looks good if we make it to here; register as an RTC. If + * we're using the timer to count fractional seconds, our resolution is + * 1e6/64, about 15.6ms. Without the timer we still align the RTC clock + * when setting it so our error is an average .5s when reading it. + */ + resolution = sc->use_timer ? 1000000 / TMR_TICKS_SEC : 1000000 / 2; + clockflags = CLOCKF_GETTIME_NO_ADJ | CLOCKF_SETTIME_NO_TS; + clock_register_flags(sc->dev, resolution, clockflags); +} + +static int +nxprtc_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + struct time_regs tregs; + struct nxprtc_softc *sc; + int err; + uint8_t cs1, tmrcount; + + sc = device_get_softc(dev); + + /* + * Read the time, but before using it, validate that the oscillator- + * stopped/power-fail bit is not set, and that the time-increment STOP + * bit is not set in the control reg. The latter can happen if there + * was an error when setting the time. + */ + if ((err = read_timeregs(sc, &tregs, &tmrcount)) != 0) { + device_printf(dev, "cannot read RTC time\n"); + return (err); + } + if ((err = read_reg(sc, PCF85xx_R_CS1, &cs1)) != 0) { + device_printf(dev, "cannot read RTC time\n"); + return (err); + } + if ((tregs.sec & PCF85xx_B_SECOND_OS) || (cs1 & PCF85xx_B_CS1_STOP)) { + device_printf(dev, "RTC clock not running\n"); + return (EINVAL); /* hardware is good, time is not. */ + } + + ct.nsec = ((uint64_t)tmrcount * 1000000000) / TMR_TICKS_SEC; + ct.sec = FROMBCD(tregs.sec & PCF85xx_M_SECOND); + ct.min = FROMBCD(tregs.min & PCF85xx_M_MINUTE); + ct.hour = FROMBCD(tregs.hour & PCF85xx_M_HOUR); + ct.day = FROMBCD(tregs.day & PCF85xx_M_DAY); + ct.mon = FROMBCD(tregs.month & PCF85xx_M_MONTH); + ct.year = FROMBCD(tregs.year & PCF85xx_M_YEAR); + ct.year += 1900; + if (ct.year < POSIX_BASE_YEAR) + ct.year += 100; /* assume [1970, 2069] */ + + /* + * Old PCF8563 datasheets recommended that the C bit be 1 for 19xx and 0 + * for 20xx; newer datasheets don't recommend that. We don't care, + * but we may co-exist with other OSes sharing the hardware. Determine + * existing polarity on a read so that we can preserve it on a write. + */ + if (sc->chiptype == TYPE_PCF8563) { + if (tregs.month & PCF8563_B_MONTH_C) { + if (ct.year >= 2000) + sc->flags |= SC_F_CPOL; + } else if (ct.year < 2000) + sc->flags |= SC_F_CPOL; + } + + /* If this chip is running in 12-hour/AMPM mode, deal with it. */ + if ((sc->flags & SC_F_AMPM) && (tregs.hour & PCF8523_B_HOUR_PM)) + ct.hour += 12; + + err = clock_ct_to_ts(&ct, ts); + ts->tv_sec += utc_offset(); + + return (err); +} + +static int +nxprtc_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + struct time_regs tregs; + struct nxprtc_softc *sc; + long waitns; + int err; + uint8_t cflag, cs1, pmflag; + + sc = device_get_softc(dev); + + /* + * We stop the clock, set the time, then restart the clock. Half a + * second after restarting the clock it ticks over to the next second. + * So to align the RTC, sleep until system time is halfway through the + * current second (shoot for .495 to allow time for i2c operations). + */ + getnanotime(ts); + waitns = 495000000 - ts->tv_nsec; + if (waitns < 0) + waitns += 1000000000; + pause_sbt("nxpset", nstosbt(waitns), 0, C_PREL(31)); + + /* + * Reserve use of the i2c bus and stop the RTC clock. Note that if + * anything goes wrong from this point on, we leave the clock stopped, + * because we don't really know what state it's in. + */ + if ((err = iicbus_request_bus(sc->busdev, sc->dev, IIC_WAIT)) != 0) + return (err); + if ((err = read_reg(sc, PCF85xx_R_CS1, &cs1)) != 0) + goto errout; + cs1 |= PCF85xx_B_CS1_STOP; + if ((err = write_reg(sc, PCF85xx_R_CS1, cs1)) != 0) + goto errout; + + /* Grab a fresh post-sleep idea of what time it is. */ + getnanotime(ts); + ts->tv_sec -= utc_offset(); + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + + /* If the chip is in AMPM mode deal with the PM flag. */ + pmflag = 0; + if ((sc->flags & SC_F_AMPM) && ct.hour > 12) { + ct.hour -= 12; + pmflag = PCF8523_B_HOUR_PM; + } + + /* On 8563 set the century based on the polarity seen when reading. */ + cflag = 0; + if (sc->chiptype == TYPE_PCF8563) { + if ((sc->flags & SC_F_CPOL) != 0) { + if (ct.year >= 2000) + cflag = PCF8563_B_MONTH_C; + } else if (ct.year < 2000) + cflag = PCF8563_B_MONTH_C; + } + + tregs.sec = TOBCD(ct.sec); + tregs.min = TOBCD(ct.min); + tregs.hour = TOBCD(ct.hour) | pmflag; + tregs.day = TOBCD(ct.day); + tregs.month = TOBCD(ct.mon); + tregs.year = TOBCD(ct.year % 100) | cflag; + tregs.wday = ct.dow; + + /* + * Set the time, reset the timer count register, then start the clocks. + */ + if ((err = write_timeregs(sc, &tregs)) != 0) + goto errout; + + if ((err = write_reg(sc, sc->tmcaddr, TMR_TICKS_SEC)) != 0) + return (err); + + cs1 &= ~PCF85xx_B_CS1_STOP; + err = write_reg(sc, PCF85xx_R_CS1, cs1); + +errout: + + iicbus_release_bus(sc->busdev, sc->dev); + + if (err != 0) + device_printf(dev, "cannot write RTC time\n"); + + return (err); +} + +static int +nxprtc_probe(device_t dev) +{ + int chiptype; + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + chiptype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (chiptype == TYPE_NONE) + return (ENXIO); +#else + /* Historically the non-FDT driver supports only PCF8563. */ + chiptype = TYPE_PCF8563; +#endif + device_set_desc(dev, desc_strings[chiptype]); + + return (BUS_PROBE_DEFAULT); +} + +static int +nxprtc_attach(device_t dev) +{ + struct nxprtc_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->busdev = device_get_parent(dev); + sc->slave_addr = iicbus_get_addr(dev); + + /* + * We need to know what kind of chip we're driving. Historically the + * non-FDT driver supported only PCF8563. There is no machine-readable + * identifier in the chip so we would need a set of hints defined to use + * the other chips on non-FDT systems. + */ +#ifdef FDT + sc->chiptype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; +#else + sc->chiptype = TYPE_PCF8563; + if (sc->slave_addr == 0) + sc->slave_addr = PCF8563_ADDR; +#endif + + /* The features and some register addresses vary by chip type. */ + switch (sc->chiptype) { + case TYPE_PCA2129: + case TYPE_PCF2129: + sc->secaddr = PCF8523_R_SECOND; + sc->tmcaddr = 0; + sc->use_timer = false; + break; + case TYPE_PCF2127: + case TYPE_PCF8523: + sc->secaddr = PCF8523_R_SECOND; + sc->tmcaddr = PCF8523_R_TMR_A_COUNT; + sc->use_timer = true; + break; + case TYPE_PCA8565: + case TYPE_PCF8563: + sc->secaddr = PCF8563_R_SECOND; + sc->tmcaddr = PCF8563_R_TMR_COUNT; + sc->use_timer = true; + break; + default: + device_printf(dev, "impossible: cannot determine chip type\n"); + return (ENXIO); + } + + /* + * We have to wait until interrupts are enabled. Sometimes I2C read + * and write only works when the interrupts are available. + */ + sc->config_hook.ich_func = nxprtc_start; + sc->config_hook.ich_arg = dev; + if (config_intrhook_establish(&sc->config_hook) != 0) + return (ENOMEM); + + return (0); +} + +static int +nxprtc_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + +static device_method_t nxprtc_methods[] = { + DEVMETHOD(device_probe, nxprtc_probe), + DEVMETHOD(device_attach, nxprtc_attach), + DEVMETHOD(device_detach, nxprtc_detach), + + DEVMETHOD(clock_gettime, nxprtc_gettime), + DEVMETHOD(clock_settime, nxprtc_settime), + + DEVMETHOD_END +}; + +static driver_t nxprtc_driver = { + "nxprtc", + nxprtc_methods, + sizeof(struct nxprtc_softc), +}; + +static devclass_t nxprtc_devclass; + +DRIVER_MODULE(nxprtc, iicbus, nxprtc_driver, nxprtc_devclass, NULL, NULL); +MODULE_VERSION(nxprtc, 1); +MODULE_DEPEND(nxprtc, iicbus, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER);