From owner-svn-src-head@freebsd.org Sun Jun 9 00:26:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F68915B79B2; Sun, 9 Jun 2019 00:26:33 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D927B80A7B; Sun, 9 Jun 2019 00:26:32 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-oi1-f170.google.com with SMTP id u64so3950012oib.1; Sat, 08 Jun 2019 17:26:32 -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:references:in-reply-to:from:date :message-id:subject:to; bh=GWMZLgyTombFr65+Xkkb2PddY+cYEw0vSPJFGP7G6Cs=; b=tKIr7UUXHqpZydAa7of3wVbrhEvHH/NjvEX9ckG2sh5iVyiYOaCmMfrCmd4UUZetqj PL0nPvKvQJr9uUGbOocAvwNBztn6f4mXyNfjTn3vnaivf4622zH9pKrOe4giKFbS9YVa bA134718XMigEPjjiYmX1gOlvoLU31VpVNrHr7VP/BKcmccHE7zc5ouDcxT8S1t2bQFW PfEsJ4yDM/PklD92ypS97X1JNtA8xCAZMWnCXhNa/Mj867ALdXe4+FNW0pwwyFX8iD+u 8ZFSz/bX2XBqOUMxdRd9xvVQQFaCYvdAo59z13jOZz7bMlQjU3hc5p+mAVGeNomqirOb x51Q== X-Gm-Message-State: APjAAAXOSJi8I9yzbttZGMyLezLG+5Obl9L+NpXdI+CH0PMJNdQhdcoo /1sVG4QYXZxsAbWfiW3720QOQCmr X-Google-Smtp-Source: APXvYqzWfYmNZafTx4pc9ZAreWEC1W4fIGw2IXqMs7pX1q+rgDaMDlRrzFQl/WnaomODws0qonxHuQ== X-Received: by 2002:aca:38d4:: with SMTP id f203mr8353880oia.88.1560038128434; Sat, 08 Jun 2019 16:55:28 -0700 (PDT) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com. [209.85.210.50]) by smtp.gmail.com with ESMTPSA id x193sm2466836oix.15.2019.06.08.16.55.28 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2019 16:55:28 -0700 (PDT) Received: by mail-ot1-f50.google.com with SMTP id j19so5203723otq.2; Sat, 08 Jun 2019 16:55:28 -0700 (PDT) X-Received: by 2002:a9d:7a82:: with SMTP id l2mr3219679otn.120.1560038128050; Sat, 08 Jun 2019 16:55:28 -0700 (PDT) MIME-Version: 1.0 References: <201906081717.x58HHHST031098@repo.freebsd.org> In-Reply-To: <201906081717.x58HHHST031098@repo.freebsd.org> From: Chuck Tuffli Date: Sat, 8 Jun 2019 16:55:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348806 - head/usr.sbin/camdd To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D927B80A7B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 00:26:33 -0000 On Sat, Jun 8, 2019 at 10:17 AM Chuck Tuffli wrote: > > Author: chuck > Date: Sat Jun 8 17:17:17 2019 > New Revision: 348806 > URL: https://svnweb.freebsd.org/changeset/base/348806 > > Log: > Add NVMe support to camdd(8) > > Reviewed by: ken > Approved by: ken (mentor) > MFC after: 1 week > Differential Review: https://reviews.freebsd.org/D12141 > > Modified: > head/usr.sbin/camdd/camdd.c This is breaking several builds and I'm looking at it now. Sorry :( --chuck From owner-svn-src-head@freebsd.org Sun Jun 9 02:06:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3BD515B98A7; Sun, 9 Jun 2019 02:06:32 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92B31835B6; Sun, 9 Jun 2019 02:06:32 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81E092425B; Sun, 9 Jun 2019 02:06:32 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5926WK6008687; Sun, 9 Jun 2019 02:06:32 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5926W30008686; Sun, 9 Jun 2019 02:06:32 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201906090206.x5926W30008686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sun, 9 Jun 2019 02:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348824 - head/usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/camdd X-SVN-Commit-Revision: 348824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92B31835B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 02:06:33 -0000 Author: chuck Date: Sun Jun 9 02:06:31 2019 New Revision: 348824 URL: https://svnweb.freebsd.org/changeset/base/348824 Log: Fix uninitialized variable in camdd gcc builds were failing because of this uninitialized warning. Reported by: bz, imp Approved by: imp (mentor) Discussed with: ken Pointy hat: chuck Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Sun Jun 9 01:26:56 2019 (r348823) +++ head/usr.sbin/camdd/camdd.c Sun Jun 9 02:06:31 2019 (r348824) @@ -1475,7 +1475,7 @@ camdd_probe_pass(struct cam_device *cam_dev, struct ca struct kevent ke; struct ccb_getdev cgd; int retval; - int scsi_dev_type; + int scsi_dev_type = T_NODEVICE; if ((retval = camdd_get_cgd(cam_dev, &cgd)) != 0) { warnx("%s: error retrieving CGD", __func__); From owner-svn-src-head@freebsd.org Sun Jun 9 03:36:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2240415BB8DD; Sun, 9 Jun 2019 03:36:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF35A860DB; Sun, 9 Jun 2019 03:36:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B9682522B; Sun, 9 Jun 2019 03:36:11 +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 x593aBIN056735; Sun, 9 Jun 2019 03:36:11 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x593aBCf056732; Sun, 9 Jun 2019 03:36:11 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906090336.x593aBCf056732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 9 Jun 2019 03:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348828 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv X-SVN-Commit-Revision: 348828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF35A860DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 03:36:12 -0000 Author: alc Date: Sun Jun 9 03:36:10 2019 New Revision: 348828 URL: https://svnweb.freebsd.org/changeset/base/348828 Log: Implement an alternative solution to the amd64 and i386 pmap problem that we previously addressed in r348246. This pmap problem also exists on arm64 and riscv. However, the original solution developed for amd64 and i386 cannot be used on arm64 and riscv. In particular, arm64 and riscv do not define a PG_PROMOTED flag in their level 2 PTEs. (A PG_PROMOTED flag makes no sense on arm64, where unlike x86 or riscv we are required to break the old 4KB mappings before making the 2MB mapping; and on riscv there are no unused bits in the PTE to define a PG_PROMOTED flag.) This commit implements an alternative solution that can be used on all four architectures. Moreover, this solution has two other advantages. First, on older AMD processors that required the Erratum 383 workaround, it is less costly. Specifically, it avoids unnecessary calls to pmap_fill_ptp() on a superpage demotion. Second, it enables the elimination of some calls to pagezero() in pmap_kernel_remove_{l2,pde}(). In addition, remove a related stale comment from pmap_enter_{l2,pde}(). Reviewed by: kib, markj (an earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20538 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c head/sys/i386/i386/pmap.c head/sys/riscv/riscv/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jun 9 03:31:07 2019 (r348827) +++ head/sys/amd64/amd64/pmap.c Sun Jun 9 03:36:10 2019 (r348828) @@ -1053,7 +1053,7 @@ static int pmap_enter_pde(pmap_t pmap, vm_offset_t va, 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); -static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted); static void pmap_invalidate_cache_range_selfsnoop(vm_offset_t sva, vm_offset_t eva); static void pmap_invalidate_cache_range_all(vm_offset_t sva, @@ -1757,8 +1757,13 @@ pmap_init(void) mpte->pindex = pmap_pde_pindex(KERNBASE) + i; mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); mpte->wire_count = 1; + + /* + * Collect the page table pages that were replaced by a 2MB + * page in create_pagetables(). They are zero filled. + */ if (i << PDRSHIFT < KERNend && - pmap_insert_pt_page(kernel_pmap, mpte)) + pmap_insert_pt_page(kernel_pmap, mpte, false)) panic("pmap_init: pmap_insert_pt_page failed"); } PMAP_UNLOCK(kernel_pmap); @@ -3129,12 +3134,15 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist * of idle page table pages. Each of a pmap's page table pages is responsible * for mapping a distinct range of virtual addresses. The pmap's collection is * ordered by this virtual address range. + * + * If "promoted" is false, then the page table page "mpte" must be zero filled. */ static __inline int -pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) +pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); + mpte->valid = promoted ? VM_PAGE_BITS_ALL : 0; return (vm_radix_insert(&pmap->pm_root, mpte)); } @@ -4626,7 +4634,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v * If the page table page is not leftover from an earlier promotion, * initialize it. */ - if ((oldpde & PG_PROMOTED) == 0) + if (mpte->valid == 0) pmap_fill_ptp(firstpte, newpte); pmap_demote_pde_check(firstpte, newpte); @@ -4699,9 +4707,11 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, v newpde = mptepa | X86_PG_M | X86_PG_A | X86_PG_RW | X86_PG_V; /* - * Initialize the page table page. + * If this page table page was unmapped by a promotion, then it + * contains valid mappings. Zero it to invalidate those mappings. */ - pagezero((void *)PHYS_TO_DMAP(mptepa)); + if (mpte->valid != 0) + pagezero((void *)PHYS_TO_DMAP(mptepa)); /* * Demote the mapping. @@ -4766,6 +4776,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse } else { mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { + KASSERT(mpte->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pde: pte page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); @@ -5399,7 +5411,7 @@ setpte: ("pmap_promote_pde: page table page is out of range")); KASSERT(mpte->pindex == pmap_pde_pindex(va), ("pmap_promote_pde: page table page's pindex is wrong")); - if (pmap_insert_pt_page(pmap, mpte)) { + if (pmap_insert_pt_page(pmap, mpte, true)) { atomic_add_long(&pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx in pmap %p", va, @@ -5826,15 +5838,13 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { + /* + * Both pmap_remove_pde() and pmap_remove_ptes() will + * leave the kernel page table page zero filled. + */ 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. - */ + if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_pde: trie insert failed"); - } } else KASSERT(*pde == 0, ("pmap_enter_pde: non-zero pde %p", pde)); @@ -6824,6 +6834,8 @@ pmap_remove_pages(pmap_t pmap) } mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { + KASSERT(mpte->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pages: pte page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jun 9 03:31:07 2019 (r348827) +++ head/sys/arm64/arm64/pmap.c Sun Jun 9 03:36:10 2019 (r348828) @@ -2401,9 +2401,11 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_ newl2 = ml3pa | L2_TABLE; /* - * Initialize the page table page. + * If this page table page was unmapped by a promotion, then it + * contains valid mappings. Zero it to invalidate those mappings. */ - pagezero((void *)PHYS_TO_DMAP(ml3pa)); + if (ml3->valid != 0) + pagezero((void *)PHYS_TO_DMAP(ml3pa)); /* * Demote the mapping. The caller must have already invalidated the @@ -2456,6 +2458,8 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ } else { ml3 = pmap_remove_pt_page(pmap, sva); if (ml3 != NULL) { + KASSERT(ml3->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_l2: l3 page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_l2: l3 page wire count error")); @@ -2812,12 +2816,15 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t * of idle page table pages. Each of a pmap's page table pages is responsible * for mapping a distinct range of virtual addresses. The pmap's collection is * ordered by this virtual address range. + * + * If "promoted" is false, then the page table page "mpte" must be zero filled. */ static __inline int -pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) +pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); + mpte->valid = promoted ? VM_PAGE_BITS_ALL : 0; return (vm_radix_insert(&pmap->pm_root, mpte)); } @@ -2962,7 +2969,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset ("pmap_promote_l2: page table page is out of range")); KASSERT(mpte->pindex == pmap_l2_pindex(va), ("pmap_promote_l2: page table page's pindex is wrong")); - if (pmap_insert_pt_page(pmap, mpte)) { + if (pmap_insert_pt_page(pmap, mpte, true)) { atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx in pmap %p", va, @@ -3386,15 +3393,13 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { + /* + * Both pmap_remove_l2() and pmap_remove_l3() will + * leave the kernel page table page zero filled. + */ mt = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); - if (pmap_insert_pt_page(pmap, mt)) { - /* - * XXX Currently, this can't happen bacuse - * we do not perform pmap_enter(psind == 1) - * on the kernel pmap. - */ + if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_l2: trie insert failed"); - } } else KASSERT(pmap_load(l2) == 0, ("pmap_enter_l2: non-zero L2 entry %p", l2)); @@ -4081,6 +4086,8 @@ pmap_remove_pages(pmap_t pmap) ml3 = pmap_remove_pt_page(pmap, pv->pv_va); if (ml3 != NULL) { + KASSERT(ml3->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pages: l3 page not promoted")); pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); @@ -5035,8 +5042,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ " in pmap %p", va, pmap); goto fail; } - if (va < VM_MAXUSER_ADDRESS) + if (va < VM_MAXUSER_ADDRESS) { + ml3->wire_count = NL3PG; pmap_resident_count_inc(pmap, 1); + } } l3phys = VM_PAGE_TO_PHYS(ml3); @@ -5048,10 +5057,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ newl3 = (oldl2 & (ATTR_MASK & ~ATTR_DESCR_MASK)) | L3_PAGE; /* - * If the page table page is new, initialize it. + * If the page table page is not leftover from an earlier promotion, + * initialize it. */ - if (ml3->wire_count == 1) { - ml3->wire_count = NL3PG; + if (ml3->valid == 0) { for (i = 0; i < Ln_ENTRIES; i++) { l3[i] = newl3 | phys; phys += L3_SIZE; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Jun 9 03:31:07 2019 (r348827) +++ head/sys/i386/i386/pmap.c Sun Jun 9 03:36:10 2019 (r348828) @@ -318,7 +318,7 @@ static int pmap_enter_pde(pmap_t pmap, vm_offset_t va, u_int flags, vm_page_t m); 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); -static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted); static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); @@ -990,9 +990,14 @@ __CONCAT(PMTYPE, init)(void) mpte->pindex = i + KPTDI; mpte->phys_addr = KPTphys + ptoa(i); mpte->wire_count = 1; + + /* + * Collect the page table pages that were replaced by a 2/4MB + * page. They are filled with equivalent 4KB page mappings. + */ if (pseflag != 0 && KERNBASE <= i << PDRSHIFT && i << PDRSHIFT < KERNend && - pmap_insert_pt_page(kernel_pmap, mpte)) + pmap_insert_pt_page(kernel_pmap, mpte, true)) panic("pmap_init: pmap_insert_pt_page failed"); } PMAP_UNLOCK(kernel_pmap); @@ -1900,12 +1905,15 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist * of idle page table pages. Each of a pmap's page table pages is responsible * for mapping a distinct range of virtual addresses. The pmap's collection is * ordered by this virtual address range. + * + * If "promoted" is false, then the page table page "mpte" must be zero filled. */ static __inline int -pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) +pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); + mpte->valid = promoted ? VM_PAGE_BITS_ALL : 0; return (vm_radix_insert(&pmap->pm_root, mpte)); } @@ -2823,7 +2831,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse * If the page table page is not leftover from an earlier promotion, * initialize it. */ - if ((oldpde & PG_PROMOTED) == 0) + if (mpte->valid == 0) pmap_fill_ptp(firstpte, newpte); KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), @@ -2895,9 +2903,11 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, v newpde = mptepa | PG_M | PG_A | PG_RW | PG_V; /* - * Initialize the page table page. + * If this page table page was unmapped by a promotion, then it + * contains valid mappings. Zero it to invalidate those mappings. */ - pagezero((void *)&KPTmap[i386_btop(trunc_4mpage(va))]); + if (mpte->valid != 0) + pagezero((void *)&KPTmap[i386_btop(trunc_4mpage(va))]); /* * Remove the mapping. @@ -2960,6 +2970,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse } else { mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { + KASSERT(mpte->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pde: pte page not promoted")); pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); @@ -3533,7 +3545,7 @@ setpte: ("pmap_promote_pde: page table page is out of range")); KASSERT(mpte->pindex == va >> PDRSHIFT, ("pmap_promote_pde: page table page's pindex is wrong")); - if (pmap_insert_pt_page(pmap, mpte)) { + if (pmap_insert_pt_page(pmap, mpte, true)) { pmap_pde_p_failures++; CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#x in pmap %p", va, @@ -3911,15 +3923,13 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t } vm_page_free_pages_toq(&free, true); if (pmap == kernel_pmap) { + /* + * Both pmap_remove_pde() and pmap_remove_ptes() will + * leave the kernel page table page zero filled. + */ 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. - */ + if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_pde: trie insert failed"); - } } else KASSERT(*pde == 0, ("pmap_enter_pde: non-zero pde %p", pde)); @@ -4797,6 +4807,8 @@ __CONCAT(PMTYPE, remove_pages)(pmap_t pmap) } mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { + KASSERT(mpte->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pages: pte page not promoted")); pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sun Jun 9 03:31:07 2019 (r348827) +++ head/sys/riscv/riscv/pmap.c Sun Jun 9 03:36:10 2019 (r348828) @@ -1104,12 +1104,15 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist * of idle page table pages. Each of a pmap's page table pages is responsible * for mapping a distinct range of virtual addresses. The pmap's collection is * ordered by this virtual address range. + * + * If "promoted" is false, then the page table page "ml3" must be zero filled. */ static __inline int -pmap_insert_pt_page(pmap_t pmap, vm_page_t ml3) +pmap_insert_pt_page(pmap_t pmap, vm_page_t ml3, bool promoted) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); + ml3->valid = promoted ? VM_PAGE_BITS_ALL : 0; return (vm_radix_insert(&pmap->pm_root, ml3)); } @@ -2002,9 +2005,11 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_ newl2 = ml3pa | PTE_V; /* - * Initialize the page table page. + * If this page table page was unmapped by a promotion, then it + * contains valid mappings. Zero it to invalidate those mappings. */ - pagezero((void *)PHYS_TO_DMAP(ml3pa)); + if (ml3->valid != 0) + pagezero((void *)PHYS_TO_DMAP(ml3pa)); /* * Demote the mapping. @@ -2064,6 +2069,8 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ } else { ml3 = pmap_remove_pt_page(pmap, sva); if (ml3 != NULL) { + KASSERT(ml3->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_l2: l3 page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == Ln_ENTRIES, ("pmap_remove_l2: l3 page wire count error")); @@ -2482,8 +2489,10 @@ pmap_demote_l2_locked(pmap_t pmap, pd_entry_t *l2, vm_ "failure for va %#lx in pmap %p", va, pmap); return (false); } - if (va < VM_MAXUSER_ADDRESS) + if (va < VM_MAXUSER_ADDRESS) { + mpte->wire_count = Ln_ENTRIES; pmap_resident_count_inc(pmap, 1); + } } mptepa = VM_PAGE_TO_PHYS(mpte); firstl3 = (pt_entry_t *)PHYS_TO_DMAP(mptepa); @@ -2495,10 +2504,10 @@ pmap_demote_l2_locked(pmap_t pmap, pd_entry_t *l2, vm_ newl3 = oldl2; /* - * If the page table page is new, initialize it. + * If the page table page is not leftover from an earlier promotion, + * initialize it. */ - if (mpte->wire_count == 1) { - mpte->wire_count = Ln_ENTRIES; + if (mpte->valid == 0) { for (i = 0; i < Ln_ENTRIES; i++) pmap_store(firstl3 + i, newl3 + (i << PTE_PPN0_S)); } @@ -2589,7 +2598,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset ml3 = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); KASSERT(ml3->pindex == pmap_l2_pindex(va), ("pmap_promote_l2: page table page's pindex is wrong")); - if (pmap_insert_pt_page(pmap, ml3)) { + if (pmap_insert_pt_page(pmap, ml3, true)) { CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx pmap %p", va, pmap); atomic_add_long(&pmap_l2_p_failures, 1); @@ -2972,15 +2981,13 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { + /* + * Both pmap_remove_l2() and pmap_remove_l3() will + * leave the kernel page table page zero filled. + */ mt = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); - if (pmap_insert_pt_page(pmap, mt)) { - /* - * XXX Currently, this can't happen bacuse - * we do not perform pmap_enter(psind == 1) - * on the kernel pmap. - */ + if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_l2: trie insert failed"); - } } else KASSERT(pmap_load(l2) == 0, ("pmap_enter_l2: non-zero L2 entry %p", l2)); @@ -3557,6 +3564,8 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr } mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { + KASSERT(ml3->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pages: l3 page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == Ln_ENTRIES, ("pmap_remove_pages: pte page wire count error")); From owner-svn-src-head@freebsd.org Sun Jun 9 05:55:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A89F15BE49F; Sun, 9 Jun 2019 05:55:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 176BB8A3B8; Sun, 9 Jun 2019 05:55:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E113E269CB; Sun, 9 Jun 2019 05:55:58 +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 x595twOK031344; Sun, 9 Jun 2019 05:55:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x595twPt031343; Sun, 9 Jun 2019 05:55:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906090555.x595twPt031343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 9 Jun 2019 05:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348829 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 348829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 176BB8A3B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 05:55:59 -0000 Author: alc Date: Sun Jun 9 05:55:58 2019 New Revision: 348829 URL: https://svnweb.freebsd.org/changeset/base/348829 Log: Correct a new KASSERT() in r348828. X-MFC with: r348828 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sun Jun 9 03:36:10 2019 (r348828) +++ head/sys/riscv/riscv/pmap.c Sun Jun 9 05:55:58 2019 (r348829) @@ -3564,8 +3564,8 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr } mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { - KASSERT(ml3->valid == VM_PAGE_BITS_ALL, - ("pmap_remove_pages: l3 page not promoted")); + KASSERT(mpte->valid == VM_PAGE_BITS_ALL, + ("pmap_remove_pages: pte page not promoted")); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == Ln_ENTRIES, ("pmap_remove_pages: pte page wire count error")); From owner-svn-src-head@freebsd.org Sun Jun 9 11:21:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3DCB15C4E98; Sun, 9 Jun 2019 11:21:30 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4025F6CC99; Sun, 9 Jun 2019 11:21:30 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A16F219F; Sun, 9 Jun 2019 11:21:30 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59BLTqa002636; Sun, 9 Jun 2019 11:21:29 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59BLT1T002635; Sun, 9 Jun 2019 11:21:29 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906091121.x59BLT1T002635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 9 Jun 2019 11:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348833 - head/usr.bin/tail X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/tail X-SVN-Commit-Revision: 348833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4025F6CC99 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 11:21:30 -0000 Author: oshogbo Date: Sun Jun 9 11:21:29 2019 New Revision: 348833 URL: https://svnweb.freebsd.org/changeset/base/348833 Log: tail: style nits Modified: head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Sun Jun 9 08:22:38 2019 (r348832) +++ head/usr.bin/tail/tail.c Sun Jun 9 11:21:29 2019 (r348833) @@ -212,7 +212,8 @@ main(int argc, char *argv[]) file->file_name = strdup(fn); if (! file->file_name) errx(1, "Couldn't malloc space for file name."); - if ((file->fp = fileargs_fopen(fa, file->file_name, "r")) == NULL || + file->fp = fileargs_fopen(fa, file->file_name, "r"); + if (file->fp == NULL || fstat(fileno(file->fp), &file->st)) { if (file->fp != NULL) { fclose(file->fp); From owner-svn-src-head@freebsd.org Sun Jun 9 12:41:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 222B615C6B37; Sun, 9 Jun 2019 12:41:22 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6E4F6EDF4; Sun, 9 Jun 2019 12:41:21 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 922D72E07; Sun, 9 Jun 2019 12:41:21 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59CfLBU042203; Sun, 9 Jun 2019 12:41:21 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59CfLjQ042202; Sun, 9 Jun 2019 12:41:21 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906091241.x59CfLjQ042202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 9 Jun 2019 12:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348834 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6E4F6EDF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 12:41:22 -0000 Author: vmaffione Date: Sun Jun 9 12:41:21 2019 New Revision: 348834 URL: https://svnweb.freebsd.org/changeset/base/348834 Log: bhyve: vtnet: simplify thread synchronization On vtnet device reset it is necessary to wait for threads to stop TX and RX processing. However, the rx_in_progress variable (used for to wait for RX processing to stop) is actually useless, and can be removed. Acquiring and releasing the RX lock is enough to synchronize correctly. Moreover, it is possible to reset the device while holding both TX and RX locks, so that the "resetting" variable becomes unnecessary for the RX thread, and can be protected by the TX lock (instead of being volatile). Reviewed by: jhb, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20543 Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Jun 9 11:21:29 2019 (r348833) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Jun 9 12:41:21 2019 (r348834) @@ -150,14 +150,13 @@ struct pci_vtnet_softc { struct nm_desc *vsc_nmd; int vsc_rx_ready; - volatile int resetting; /* set and checked outside lock */ + int resetting; /* protected by tx_mtx */ uint64_t vsc_features; /* negotiated features */ struct virtio_net_config vsc_config; pthread_mutex_t rx_mtx; - int rx_in_progress; int rx_vhdrlen; int rx_merge; /* merged rx bufs in use */ @@ -189,62 +188,39 @@ static struct virtio_consts vtnet_vi_consts = { VTNET_S_HOSTCAPS, /* our capabilities */ }; -/* - * If the transmit thread is active then stall until it is done. - */ static void -pci_vtnet_txwait(struct pci_vtnet_softc *sc) +pci_vtnet_reset(void *vsc) { + struct pci_vtnet_softc *sc = vsc; + DPRINTF(("vtnet: device reset requested !\n")); + + /* Acquire the RX lock to block RX processing. */ + pthread_mutex_lock(&sc->rx_mtx); + + /* Set sc->resetting and give a chance to the TX thread to stop. */ pthread_mutex_lock(&sc->tx_mtx); + sc->resetting = 1; while (sc->tx_in_progress) { pthread_mutex_unlock(&sc->tx_mtx); usleep(10000); pthread_mutex_lock(&sc->tx_mtx); } - pthread_mutex_unlock(&sc->tx_mtx); -} -/* - * If the receive thread is active then stall until it is done. - */ -static void -pci_vtnet_rxwait(struct pci_vtnet_softc *sc) -{ - - pthread_mutex_lock(&sc->rx_mtx); - while (sc->rx_in_progress) { - pthread_mutex_unlock(&sc->rx_mtx); - usleep(10000); - pthread_mutex_lock(&sc->rx_mtx); - } - pthread_mutex_unlock(&sc->rx_mtx); -} - -static void -pci_vtnet_reset(void *vsc) -{ - struct pci_vtnet_softc *sc = vsc; - - DPRINTF(("vtnet: device reset requested !\n")); - - sc->resetting = 1; - - /* - * Wait for the transmit and receive threads to finish their - * processing. - */ - pci_vtnet_txwait(sc); - pci_vtnet_rxwait(sc); - sc->vsc_rx_ready = 0; sc->rx_merge = 1; sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); - /* now reset rings, MSI-X vectors, and negotiated capabilities */ + /* + * Now reset rings, MSI-X vectors, and negotiated capabilities. + * Do that with the TX lock held, since we need to reset + * sc->resetting. + */ vi_reset_dev(&sc->vsc_vs); sc->resetting = 0; + pthread_mutex_unlock(&sc->tx_mtx); + pthread_mutex_unlock(&sc->rx_mtx); } /* @@ -318,9 +294,9 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *sc) /* * But, will be called when the rx ring hasn't yet - * been set up or the guest is resetting the device. + * been set up. */ - if (!sc->vsc_rx_ready || sc->resetting) { + if (!sc->vsc_rx_ready) { /* * Drop the packet and try later. */ @@ -515,9 +491,9 @@ pci_vtnet_netmap_rx(struct pci_vtnet_softc *sc) /* * But, will be called when the rx ring hasn't yet - * been set up or the guest is resetting the device. + * been set up. */ - if (!sc->vsc_rx_ready || sc->resetting) { + if (!sc->vsc_rx_ready) { /* * Drop the packet and try later. */ @@ -594,9 +570,7 @@ pci_vtnet_rx_callback(int fd, enum ev_type type, void struct pci_vtnet_softc *sc = param; pthread_mutex_lock(&sc->rx_mtx); - sc->rx_in_progress = 1; sc->pci_vtnet_rx(sc); - sc->rx_in_progress = 0; pthread_mutex_unlock(&sc->rx_mtx); } @@ -921,7 +895,6 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * sc->rx_merge = 1; sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); - sc->rx_in_progress = 0; pthread_mutex_init(&sc->rx_mtx, NULL); /* From owner-svn-src-head@freebsd.org Sun Jun 9 15:36:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82DD415C9F55; Sun, 9 Jun 2019 15:36:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2572673A93; Sun, 9 Jun 2019 15:36:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF05E4F0C; Sun, 9 Jun 2019 15:36:51 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59FapWo036041; Sun, 9 Jun 2019 15:36:51 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59FapFQ036040; Sun, 9 Jun 2019 15:36:51 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091536.x59FapFQ036040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348835 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 348835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2572673A93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:36:52 -0000 Author: mhorne Date: Sun Jun 9 15:36:51 2019 New Revision: 348835 URL: https://svnweb.freebsd.org/changeset/base/348835 Log: Remove block of dead code Approved by: markj (mentor) Modified: head/sys/riscv/riscv/exception.S Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Sun Jun 9 12:41:21 2019 (r348834) +++ head/sys/riscv/riscv/exception.S Sun Jun 9 15:36:51 2019 (r348835) @@ -81,16 +81,6 @@ __FBSDID("$FreeBSD$"); sd a6, (TF_A + 6 * 8)(sp) sd a7, (TF_A + 7 * 8)(sp) -#if 0 - /* XXX: temporary test: spin if stack is not kernel one */ -.if \el == 1 /* kernel */ - mv t0, sp - srli t0, t0, 63 -1: - beqz t0, 1b -.endif -#endif - .if \el == 1 /* Store kernel sp */ li t1, TF_SIZE From owner-svn-src-head@freebsd.org Sun Jun 9 15:43:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A79CD15CA17D; Sun, 9 Jun 2019 15:43:41 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43DB174417; Sun, 9 Jun 2019 15:43:41 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B1E850C3; Sun, 9 Jun 2019 15:43:41 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59Fhep6041010; Sun, 9 Jun 2019 15:43:40 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59FhdLj041002; Sun, 9 Jun 2019 15:43:39 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091543.x59FhdLj041002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348836 - in head/sys: conf riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: conf riscv/include riscv/riscv X-SVN-Commit-Revision: 348836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43DB174417 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:43:41 -0000 Author: mhorne Date: Sun Jun 9 15:43:38 2019 New Revision: 348836 URL: https://svnweb.freebsd.org/changeset/base/348836 Log: Fix global pointer relaxations in the RISC-V kernel The gp register is intended to used by the linker as another means of performing relaxations, and should point to the small data section (.sdata). Currently gp is being used as the pcpu pointer within the kernel, but the more appropriate choice for this is the tp register, which is unused. Swap existing usage of gp with tp within the kernel, and set up gp properly at boot with the value of __global_pointer$ for all harts. Additionally, remove some cases of accessing tp from the PCB, as it is not part of the per-thread state. The user's tp and gp should be tracked only through the trapframe. Reviewed by: markj, jhb Approved by: markj (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19893 Modified: head/sys/conf/ldscript.riscv head/sys/riscv/include/asm.h head/sys/riscv/include/pcpu.h head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/swtch.S head/sys/riscv/riscv/vm_machdep.c Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/conf/ldscript.riscv Sun Jun 9 15:43:38 2019 (r348836) @@ -89,7 +89,11 @@ SECTIONS can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ . = ALIGN(8); - .sdata : { *(.sdata) } + .sdata : + { + __global_pointer$ = . + 0x800; + *(.sdata) + } _edata = .; PROVIDE (edata = .); /* Ensure __bss_start is associated with the next section in case orphan Modified: head/sys/riscv/include/asm.h ============================================================================== --- head/sys/riscv/include/asm.h Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/include/asm.h Sun Jun 9 15:43:38 2019 (r348836) @@ -59,7 +59,7 @@ .set alias,sym #define SET_FAULT_HANDLER(handler, tmp) \ - ld tmp, PC_CURTHREAD(gp); \ + ld tmp, PC_CURTHREAD(tp); \ ld tmp, TD_PCB(tmp); /* Load the pcb */ \ sd handler, PCB_ONFAULT(tmp) /* Set the handler */ Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/include/pcpu.h Sun Jun 9 15:43:38 2019 (r348836) @@ -60,7 +60,7 @@ get_pcpu(void) { struct pcpu *pcpu; - __asm __volatile("mv %0, gp" : "=&r"(pcpu)); + __asm __volatile("mv %0, tp" : "=&r"(pcpu)); return (pcpu); } @@ -70,7 +70,7 @@ get_curthread(void) { struct thread *td; - __asm __volatile("ld %0, 0(gp)" : "=&r"(td)); + __asm __volatile("ld %0, 0(tp)" : "=&r"(td)); return (td); } Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/exception.S Sun Jun 9 15:43:38 2019 (r348836) @@ -44,11 +44,18 @@ __FBSDID("$FreeBSD$"); addi sp, sp, -(TF_SIZE) sd ra, (TF_RA)(sp) - sd tp, (TF_TP)(sp) -.if \el == 0 /* We came from userspace. Load our pcpu */ +.if \el == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) - ld gp, (TF_SIZE)(sp) +.option push +.option norelax + /* Load the kernel's global pointer */ + la gp, __global_pointer$ +.option pop + + /* Load our pcpu */ + sd tp, (TF_TP)(sp) + ld tp, (TF_SIZE)(sp) .endif sd t0, (TF_T + 0 * 8)(sp) @@ -128,13 +135,15 @@ __FBSDID("$FreeBSD$"); ld t0, (TF_SP)(sp) csrw sscratch, t0 - /* And store our pcpu */ - sd gp, (TF_SIZE)(sp) + /* Store our pcpu */ + sd tp, (TF_SIZE)(sp) + ld tp, (TF_TP)(sp) + + /* And restore the user's global pointer */ ld gp, (TF_GP)(sp) .endif ld ra, (TF_RA)(sp) - ld tp, (TF_TP)(sp) ld t0, (TF_T + 0 * 8)(sp) ld t1, (TF_T + 1 * 8)(sp) @@ -175,7 +184,7 @@ __FBSDID("$FreeBSD$"); 1: csrci sstatus, (SSTATUS_SIE) - ld a1, PC_CURTHREAD(gp) + ld a1, PC_CURTHREAD(tp) lw a2, TD_FLAGS(a1) li a3, (TDF_ASTPENDING|TDF_NEEDRESCHED) Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/locore.S Sun Jun 9 15:43:38 2019 (r348836) @@ -171,12 +171,18 @@ va: li t0, 0 csrw sscratch, t0 + /* Set the global pointer */ +.option push +.option norelax + la gp, __global_pointer$ +.option pop + /* Initialize stack pointer */ la s3, initstack_end mv sp, s3 addi sp, sp, -PCB_SIZE - /* Clear BSS */ + /* Clear BSS */ la s0, _C_LABEL(__bss_start) la s1, _C_LABEL(_end) 1: @@ -251,12 +257,6 @@ virt_map: hart_lottery: .space 4 - /* Not in use, but required for linking. */ - .align 3 - .globl __global_pointer$ -__global_pointer$: - .space 8 - .globl init_pt_va init_pt_va: .quad pagetable_l2 /* XXX: Keep page tables VA */ @@ -323,6 +323,12 @@ mpva: /* Ensure sscratch is zero */ li t0, 0 csrw sscratch, t0 + + /* Set the global pointer */ +.option push +.option norelax + la gp, __global_pointer$ +.option pop call init_secondary END(mpentry) Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/machdep.c Sun Jun 9 15:43:38 2019 (r348836) @@ -822,7 +822,7 @@ initriscv(struct riscv_bootparams *rvbp) pcpup->pc_hart = boot_hart; /* Set the pcpu pointer */ - __asm __volatile("mv gp, %0" :: "r"(pcpup)); + __asm __volatile("mv tp, %0" :: "r"(pcpup)); PCPU_SET(curthread, &thread0); Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/mp_machdep.c Sun Jun 9 15:43:38 2019 (r348836) @@ -234,7 +234,7 @@ init_secondary(uint64_t hart) /* Setup the pcpu pointer */ pcpup = &__pcpu[cpuid]; - __asm __volatile("mv gp, %0" :: "r"(pcpup)); + __asm __volatile("mv tp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ csr_set(sie, SIE_SSIE); Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/swtch.S Sun Jun 9 15:43:38 2019 (r348836) @@ -217,15 +217,14 @@ ENTRY(cpu_throw) mv a0, s0 /* Store the new curthread */ - sd a0, PC_CURTHREAD(gp) + sd a0, PC_CURTHREAD(tp) /* And the new pcb */ ld x13, TD_PCB(a0) - sd x13, PC_CURPCB(gp) + sd x13, PC_CURPCB(tp) /* Load registers */ ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) - ld tp, (PCB_TP)(x13) /* s[0-11] */ ld s0, (PCB_S + 0 * 8)(x13) @@ -267,10 +266,10 @@ END(cpu_throw) */ ENTRY(cpu_switch) /* Store the new curthread */ - sd a1, PC_CURTHREAD(gp) + sd a1, PC_CURTHREAD(tp) /* And the new pcb */ ld x13, TD_PCB(a1) - sd x13, PC_CURPCB(gp) + sd x13, PC_CURPCB(tp) /* Save the old context. */ ld x13, TD_PCB(a0) @@ -278,7 +277,6 @@ ENTRY(cpu_switch) /* Store ra, sp and the callee-saved registers */ sd ra, (PCB_RA)(x13) sd sp, (PCB_SP)(x13) - sd tp, (PCB_TP)(x13) /* s[0-11] */ sd s0, (PCB_S + 0 * 8)(x13) @@ -340,7 +338,6 @@ ENTRY(cpu_switch) ld x13, TD_PCB(a1) /* Restore the registers */ - ld tp, (PCB_TP)(x13) ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) @@ -429,15 +426,16 @@ ENTRY(fork_trampoline) ld a6, (TF_A + 6 * 8)(sp) ld a7, (TF_A + 7 * 8)(sp) - /* Load user ra and sp */ + /* Load user ra and gp */ ld ra, (TF_RA)(sp) + ld gp, (TF_GP)(sp) /* * Store our pcpup on stack, we will load it back * on kernel mode trap. */ - sd gp, (TF_SIZE)(sp) - ld gp, (TF_GP)(sp) + sd tp, (TF_SIZE)(sp) + ld tp, (TF_TP)(sp) /* Save kernel stack so we can use it doing a user trap */ addi sp, sp, TF_SIZE @@ -454,6 +452,7 @@ ENTRY(savectx) sd ra, (PCB_RA)(a0) sd sp, (PCB_SP)(a0) sd tp, (PCB_TP)(a0) + sd gp, (PCB_GP)(a0) /* s[0-11] */ sd s0, (PCB_S + 0 * 8)(a0) Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Sun Jun 9 15:36:51 2019 (r348835) +++ head/sys/riscv/riscv/vm_machdep.c Sun Jun 9 15:43:38 2019 (r348836) @@ -69,23 +69,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t { struct pcb *pcb2; struct trapframe *tf; - register_t val; if ((flags & RFPROC) == 0) return; - if (td1 == curthread) { - /* - * Save the tp. These normally happen in cpu_switch, - * but if userland changes this then forks this may - * not have happened. - */ - __asm __volatile("mv %0, tp" : "=&r"(val)); - td1->td_pcb->pcb_tp = val; + /* RISCVTODO: save the FPU state here */ - /* RISCVTODO: save the FPU state here */ - } - pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; @@ -205,15 +194,15 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * int cpu_set_user_tls(struct thread *td, void *tls_base) { - struct pcb *pcb; if ((uintptr_t)tls_base >= VM_MAXUSER_ADDRESS) return (EINVAL); - pcb = td->td_pcb; - pcb->pcb_tp = (register_t)tls_base + TP_OFFSET; - if (td == curthread) - __asm __volatile("mv tp, %0" :: "r"(pcb->pcb_tp)); + /* + * The user TLS is set by modifying the trapframe's tp value, which + * will be restored when returning to userspace. + */ + td->td_frame->tf_tp = (register_t)tls_base + TP_OFFSET; return (0); } From owner-svn-src-head@freebsd.org Sun Jun 9 15:45:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01ABB15CA261; Sun, 9 Jun 2019 15:45:49 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 965FB746A6; Sun, 9 Jun 2019 15:45:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F09F50EF; Sun, 9 Jun 2019 15:45:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59FjmjH041271; Sun, 9 Jun 2019 15:45:48 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59FjmjX041269; Sun, 9 Jun 2019 15:45:48 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091545.x59FjmjX041269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348837 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 348837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 965FB746A6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:45:49 -0000 Author: mhorne Date: Sun Jun 9 15:45:48 2019 New Revision: 348837 URL: https://svnweb.freebsd.org/changeset/base/348837 Log: Add TSLOG events to initriscv() Add the enter and exit events, similar to what's found in hammer_time() on amd64. We must use TSRAW as the pcpu isn't yet initialized. Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20497 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun Jun 9 15:43:38 2019 (r348836) +++ head/sys/riscv/riscv/machdep.c Sun Jun 9 15:45:48 2019 (r348837) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -816,6 +817,8 @@ initriscv(struct riscv_bootparams *rvbp) caddr_t kmdp; int i; + TSRAW(&thread0, TS_ENTER, __func__, NULL); + /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); @@ -888,6 +891,8 @@ initriscv(struct riscv_bootparams *rvbp) kdb_init(); early_boot = 0; + + TSEXIT(); } #undef bzero From owner-svn-src-head@freebsd.org Sun Jun 9 15:48:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D128215CA31A; Sun, 9 Jun 2019 15:48:37 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70E2674812; Sun, 9 Jun 2019 15:48:37 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47B1450F4; Sun, 9 Jun 2019 15:48:37 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59FmbLC041417; Sun, 9 Jun 2019 15:48:37 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59Fmanq041416; Sun, 9 Jun 2019 15:48:36 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091548.x59Fmanq041416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348838 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 348838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70E2674812 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:48:38 -0000 Author: mhorne Date: Sun Jun 9 15:48:36 2019 New Revision: 348838 URL: https://svnweb.freebsd.org/changeset/base/348838 Log: RISC-V: Announce real and available memory at boot Most architectures print their total (real) and available memory during boot. Properly initialize the realmem global and print these messages. Also print the physical memory chunks (behind a bootverbose flag). Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20496 Modified: head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun Jun 9 15:45:48 2019 (r348837) +++ head/sys/riscv/riscv/machdep.c Sun Jun 9 15:48:36 2019 (r348838) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -140,7 +141,34 @@ cpu_startup(void *dummy) identify_cpu(); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem), + ptoa((uintmax_t)realmem) / (1024 * 1024)); + + /* + * Display any holes after the first chunk of extended memory. + */ + if (bootverbose) { + int indx; + + printf("Physical memory chunk(s):\n"); + for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { + vm_paddr_t size; + + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); + } + } + vm_ksubmap_init(&kmi); + + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / (1024 * 1024)); + bufinit(); vm_pager_bufferinit(); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sun Jun 9 15:45:48 2019 (r348837) +++ head/sys/riscv/riscv/pmap.c Sun Jun 9 15:48:36 2019 (r348838) @@ -640,6 +640,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, continue; dump_avail[map_slot] = start; dump_avail[map_slot + 1] = end; + realmem += atop((vm_offset_t)(end - start)); if (start >= kernstart && end <= pa) continue; From owner-svn-src-head@freebsd.org Sun Jun 9 15:50:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 280E615CA459; Sun, 9 Jun 2019 15:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3AD974A46; Sun, 9 Jun 2019 15:50:35 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF2BF50FE; Sun, 9 Jun 2019 15:50:35 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59FoZos041565; Sun, 9 Jun 2019 15:50:35 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59FoZdl041564; Sun, 9 Jun 2019 15:50:35 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091550.x59FoZdl041564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348839 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 348839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3AD974A46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:50:36 -0000 Author: mhorne Date: Sun Jun 9 15:50:35 2019 New Revision: 348839 URL: https://svnweb.freebsd.org/changeset/base/348839 Log: RISC-V: Clean up some GENERIC options Some of the config options that are disabled by default seem to be only for historical reasons. Enable those that appear to no longer be problematic. This includes WITH_CTF, STACK, GEOM_RAID, and re-enabling blacklisted kernel modules. Reviewed by: markj Approved by: markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20495 Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Sun Jun 9 15:48:36 2019 (r348838) +++ head/sys/riscv/conf/GENERIC Sun Jun 9 15:50:35 2019 (r348839) @@ -22,12 +22,8 @@ cpu RISCV ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -# makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support -# FIXME: linker error. "--relax and -r may not be used together" -makeoptions WITHOUT_MODULES="usb otusfw mwlfw ispfw mwlfw ralfw rtwnfw" -# makeoptions NO_MODULES - options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET @@ -52,11 +48,11 @@ options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. -# options GEOM_RAID # Soft RAID functionality. +options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support -# options STACK # stack(9) support +options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores From owner-svn-src-head@freebsd.org Sun Jun 9 15:52:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12F515CA931; Sun, 9 Jun 2019 15:52:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 812DA75029; Sun, 9 Jun 2019 15:52:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C8AE529A; Sun, 9 Jun 2019 15:52:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59FqRRI046750; Sun, 9 Jun 2019 15:52:27 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59FqRvQ046749; Sun, 9 Jun 2019 15:52:27 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906091552.x59FqRvQ046749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sun, 9 Jun 2019 15:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348840 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 348840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 812DA75029 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 15:52:28 -0000 Author: mhorne Date: Sun Jun 9 15:52:26 2019 New Revision: 348840 URL: https://svnweb.freebsd.org/changeset/base/348840 Log: Remove unused mcall_trap() function The mcall_trap() dummy function is unused, and should be removed as we are unlikely to support M-mode traps any time soon. Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20494 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun Jun 9 15:50:35 2019 (r348839) +++ head/sys/riscv/riscv/machdep.c Sun Jun 9 15:52:26 2019 (r348840) @@ -126,15 +126,6 @@ cpuset_t all_harts; extern int *end; extern int *initstack_end; -uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); - -uintptr_t -mcall_trap(uintptr_t mcause, uintptr_t* regs) -{ - - return (0); -} - static void cpu_startup(void *dummy) { From owner-svn-src-head@freebsd.org Sun Jun 9 22:45:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D393C15ADE3B; Sun, 9 Jun 2019 22:45:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77AF7898F1; Sun, 9 Jun 2019 22:45:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BEE29823; Sun, 9 Jun 2019 22:45:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59Mj8Te063233; Sun, 9 Jun 2019 22:45:08 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59Mj8S8063232; Sun, 9 Jun 2019 22:45:08 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906092245.x59Mj8S8063232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 9 Jun 2019 22:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348841 - head/cddl/usr.sbin/dtrace/tests/amd64 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/amd64 X-SVN-Commit-Revision: 348841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77AF7898F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 22:45:09 -0000 Author: oshogbo Date: Sun Jun 9 22:45:07 2019 New Revision: 348841 URL: https://svnweb.freebsd.org/changeset/base/348841 Log: DTrace: add a top level makefile to the new test suit Pointed out by: markj Added: head/cddl/usr.sbin/dtrace/tests/amd64/Makefile (contents, props changed) Added: head/cddl/usr.sbin/dtrace/tests/amd64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/amd64/Makefile Sun Jun 9 22:45:07 2019 (r348841) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/amd64 +TESTS_SUBDIRS+= arrays + +.PATH: ${.CURDIR:H:H:H:H:H}/tests +KYUAFILE= YES + +.include From owner-svn-src-head@freebsd.org Sun Jun 9 22:55:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26B0315AE18D; Sun, 9 Jun 2019 22:55:24 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0E9E89D82; Sun, 9 Jun 2019 22:55:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9682199CB; Sun, 9 Jun 2019 22:55:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x59MtNBQ068213; Sun, 9 Jun 2019 22:55:23 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x59MtMmW068206; Sun, 9 Jun 2019 22:55:22 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906092255.x59MtMmW068206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 9 Jun 2019 22:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348842 - head/usr.bin/tail X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/tail X-SVN-Commit-Revision: 348842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0E9E89D82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 09 Jun 2019 22:55:24 -0000 Author: oshogbo Date: Sun Jun 9 22:55:21 2019 New Revision: 348842 URL: https://svnweb.freebsd.org/changeset/base/348842 Log: tail: fix the checks if the file was rotated The freopen(3) was replaced with fileargs_open(3) and fclose(3). In the following function, we skip if the stream is standard in, so it is safe to do so. This also requires us to change the logic first to open the file and then check its status. The stat(2) is disallowed in capability mode. This commit unbrakes the -F option. The bug was introduced in the r348708. Reported by: pho Tested by: pho Modified: head/usr.bin/tail/extern.h head/usr.bin/tail/forward.c head/usr.bin/tail/misc.c head/usr.bin/tail/read.c head/usr.bin/tail/reverse.c head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/extern.h ============================================================================== --- head/usr.bin/tail/extern.h Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/extern.h Sun Jun 9 22:55:21 2019 (r348842) @@ -78,3 +78,4 @@ int maparound(struct mapinfo *, off_t); void printfn(const char *, int); extern int Fflag, fflag, qflag, rflag, rval, no_files; +extern fileargs_t *fa; Modified: head/usr.bin/tail/forward.c ============================================================================== --- head/usr.bin/tail/forward.c Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/forward.c Sun Jun 9 22:55:21 2019 (r348842) @@ -57,6 +57,9 @@ static const char sccsid[] = "@(#)forward.c 8.1 (Berke #include #include +#include +#include + #include "extern.h" static void rlines(FILE *, const char *fn, off_t, struct stat *); @@ -310,6 +313,7 @@ follow(file_info_t *files, enum STYLE style, off_t off int active, ev_change, i, n = -1; struct stat sb2; file_info_t *file; + FILE *ftmp; struct timespec ts; /* Position each of the files */ @@ -346,7 +350,9 @@ follow(file_info_t *files, enum STYLE style, off_t off if (Fflag) { for (i = 0, file = files; i < no_files; i++, file++) { if (!file->fp) { - file->fp = fopen(file->file_name, "r"); + file->fp = + fileargs_fopen(fa, file->file_name, + "r"); if (file->fp != NULL && fstat(fileno(file->fp), &file->st) == -1) { @@ -359,7 +365,9 @@ follow(file_info_t *files, enum STYLE style, off_t off } if (fileno(file->fp) == STDIN_FILENO) continue; - if (stat(file->file_name, &sb2) == -1) { + ftmp = fileargs_fopen(fa, file->file_name, "r"); + if (ftmp == NULL || + fstat(fileno(file->fp), &sb2) == -1) { if (errno != ENOENT) ierr(file->file_name); show(file); @@ -367,6 +375,9 @@ follow(file_info_t *files, enum STYLE style, off_t off fclose(file->fp); file->fp = NULL; } + if (ftmp != NULL) { + fclose(ftmp); + } ev_change++; continue; } @@ -375,14 +386,13 @@ follow(file_info_t *files, enum STYLE style, off_t off sb2.st_dev != file->st.st_dev || sb2.st_nlink == 0) { show(file); - file->fp = freopen(file->file_name, "r", - file->fp); - if (file->fp != NULL) - memcpy(&file->st, &sb2, - sizeof(struct stat)); - else if (errno != ENOENT) - ierr(file->file_name); + fclose(file->fp); + file->fp = ftmp; + memcpy(&file->st, &sb2, + sizeof(struct stat)); ev_change++; + } else { + fclose(ftmp); } } } Modified: head/usr.bin/tail/misc.c ============================================================================== --- head/usr.bin/tail/misc.c Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/misc.c Sun Jun 9 22:55:21 2019 (r348842) @@ -51,6 +51,9 @@ static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley #include #include +#include +#include + #include "extern.h" void Modified: head/usr.bin/tail/read.c ============================================================================== --- head/usr.bin/tail/read.c Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/read.c Sun Jun 9 22:55:21 2019 (r348842) @@ -51,6 +51,9 @@ static const char sccsid[] = "@(#)read.c 8.1 (Berkeley #include #include +#include +#include + #include "extern.h" /* Modified: head/usr.bin/tail/reverse.c ============================================================================== --- head/usr.bin/tail/reverse.c Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/reverse.c Sun Jun 9 22:55:21 2019 (r348842) @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "extern.h" static void r_buf(FILE *, const char *); Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Sun Jun 9 22:45:07 2019 (r348841) +++ head/usr.bin/tail/tail.c Sun Jun 9 22:55:21 2019 (r348842) @@ -65,6 +65,7 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley #include "extern.h" int Fflag, fflag, qflag, rflag, rval, no_files; +fileargs_t *fa; static file_info_t *files; @@ -90,10 +91,9 @@ main(int argc, char *argv[]) int i, ch, first; file_info_t *file; char *p; - fileargs_t *fa; cap_rights_t rights; - cap_rights_init(&rights, CAP_FSTAT, CAP_FCNTL, CAP_MMAP_RW); + cap_rights_init(&rights, CAP_FSTAT, CAP_FSTATFS, CAP_FCNTL, CAP_MMAP_RW); if (caph_rights_limit(STDIN_FILENO, &rights) < 0 || caph_limit_stderr() < 0 || caph_limit_stdout() < 0) err(1, "can't limit stdio rights"); From owner-svn-src-head@freebsd.org Mon Jun 10 03:07:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2EBB15B1FE3; Mon, 10 Jun 2019 03:07:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 692D58FB01; Mon, 10 Jun 2019 03:07:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52858C598; Mon, 10 Jun 2019 03:07:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5A37BD5099670; Mon, 10 Jun 2019 03:07:11 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A37BFt099669; Mon, 10 Jun 2019 03:07:11 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906100307.x5A37BFt099669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 10 Jun 2019 03:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348843 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 692D58FB01 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 03:07:11 -0000 Author: dougm Date: Mon Jun 10 03:07:10 2019 New Revision: 348843 URL: https://svnweb.freebsd.org/changeset/base/348843 Log: There are times when a len==0 parameter to mmap is okay. But on a 32-bit machine, a len parameter just a few bytes short of 4G, rounded up to a page boundary and hitting zero then, is not okay. Return failure in that case. Reported by: pho Reviewed by: alc, kib (mentor) Tested by: pho Differential Revision: https://reviews.freebsd.org/D20580 Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s /* Adjust size for rounding (on both ends). */ size += pageoff; /* low end... */ - size = (vm_size_t) round_page(size); /* hi end */ + /* Check for rounding up to zero. */ + if (round_page(size) < size) + return (EINVAL); + size = round_page(size); /* hi end */ /* Ensure alignment is at least a page and fits in a pointer. */ align = flags & MAP_ALIGNMENT_MASK; From owner-svn-src-head@freebsd.org Mon Jun 10 03:16:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A6215B228C; Mon, 10 Jun 2019 03:16:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00E928FF9D; Mon, 10 Jun 2019 03:16:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1B87C759; Mon, 10 Jun 2019 03:16:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5A3GtpN005248; Mon, 10 Jun 2019 03:16:55 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A3Gtj4005247; Mon, 10 Jun 2019 03:16:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906100316.x5A3Gtj4005247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 10 Jun 2019 03:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348844 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 348844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00E928FF9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 03:16:56 -0000 Author: jhibbits Date: Mon Jun 10 03:16:55 2019 New Revision: 348844 URL: https://svnweb.freebsd.org/changeset/base/348844 Log: powerpc/powernv: Reduce the scope of the sensor guarding mutex vmem_xalloc() cannot be called while holding a nonblocking mutex, warned by WITNESS. The lock may not be necessary in general, but it avoids superfluous concurrent OPAL calls for the same sensor. Reported by: pkubaj Modified: head/sys/powerpc/powernv/opal_sensor.c Modified: head/sys/powerpc/powernv/opal_sensor.c ============================================================================== --- head/sys/powerpc/powernv/opal_sensor.c Mon Jun 10 03:07:10 2019 (r348843) +++ head/sys/powerpc/powernv/opal_sensor.c Mon Jun 10 03:16:55 2019 (r348844) @@ -92,13 +92,14 @@ const char *opal_sensor_types[] = { * Retrieve the raw value from OPAL. This will be cooked by the sysctl handler. */ static int -opal_sensor_get_val(uint32_t key, uint64_t *val) +opal_sensor_get_val(struct opal_sensor_softc *sc, uint32_t key, uint64_t *val) { struct opal_msg msg; uint32_t val32; int rv, token; token = opal_alloc_async_token(); + SENSOR_LOCK(sc); rv = opal_call(OPAL_SENSOR_READ, key, token, vtophys(&val32)); if (rv == OPAL_ASYNC_COMPLETION) { @@ -110,6 +111,7 @@ opal_sensor_get_val(uint32_t key, uint64_t *val) if (rv == OPAL_SUCCESS) val32 = msg.params[0]; } + SENSOR_UNLOCK(sc); if (rv == OPAL_SUCCESS) *val = val32; @@ -131,9 +133,7 @@ opal_sensor_sysctl(SYSCTL_HANDLER_ARGS) sc = arg1; sensor = arg2; - SENSOR_LOCK(sc); - error = opal_sensor_get_val(sensor, &sensval); - SENSOR_UNLOCK(sc); + error = opal_sensor_get_val(sc, sensor, &sensval); if (error) return (error); From owner-svn-src-head@freebsd.org Mon Jun 10 03:24:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9996215B24B9; Mon, 10 Jun 2019 03:24:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFE19041F; Mon, 10 Jun 2019 03:24:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08E56C908; Mon, 10 Jun 2019 03:24:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5A3OcVR010493; Mon, 10 Jun 2019 03:24:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A3OcM4010492; Mon, 10 Jun 2019 03:24:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906100324.x5A3OcM4010492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 10 Jun 2019 03:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348845 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 348845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2AFE19041F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 03:24:40 -0000 Author: jhibbits Date: Mon Jun 10 03:24:38 2019 New Revision: 348845 URL: https://svnweb.freebsd.org/changeset/base/348845 Log: powernv: Port HMI handler to use the message framework When an HMI occurs a message event also gets created with the details of the exception. Hook into the messaging framework to retrieve the HMI message. Nothing is done with it yet, except to panic on unhandled exception. Modified: head/sys/powerpc/powernv/opal_hmi.c Modified: head/sys/powerpc/powernv/opal_hmi.c ============================================================================== --- head/sys/powerpc/powernv/opal_hmi.c Mon Jun 10 03:16:55 2019 (r348844) +++ head/sys/powerpc/powernv/opal_hmi.c Mon Jun 10 03:24:38 2019 (r348845) @@ -28,8 +28,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include @@ -38,6 +40,47 @@ __FBSDID("$FreeBSD$"); #include #include "opal.h" +struct opal_hmi_event { + uint8_t version; + uint8_t severity; + uint8_t type; + uint8_t disposition; + uint8_t rsvd_1[4]; + uint64_t hmer; + uint64_t tfmr; + union { + struct { + uint8_t xstop_type; + uint8_t rsvd_2[3]; + uint32_t xstop_reason; + union { + uint32_t pir; + uint32_t chip_id; + }; + }; + }; +}; + +#define HMI_DISP_RECOVERED 0 +#define HMI_DISP_NOT_RECOVERED 1 + +static void +opal_hmi_event_handler(void *unused, struct opal_msg *msg) +{ + struct opal_hmi_event evt; + + memcpy(&evt, &msg->params, sizeof(evt)); + printf("Hypervisor Maintenance Event received" + "(Severity %d, type %d, HMER: %016lx).\n", + evt.severity, evt.type, evt.hmer); + + if (evt.disposition == HMI_DISP_NOT_RECOVERED) + panic("Unrecoverable hypervisor maintenance exception on CPU %d", + evt.pir); + + return; +} + static int opal_hmi_handler(struct trapframe *frame) { @@ -69,8 +112,11 @@ opal_setup_hmi(void *data) return; } + EVENTHANDLER_REGISTER(OPAL_HMI_EVT, opal_hmi_event_handler, NULL, + EVENTHANDLER_PRI_ANY); + if (bootverbose) printf("Installed OPAL HMI handler.\n"); } -SYSINIT(opal_setup_hmi, SI_SUB_HYPERVISOR, SI_ORDER_ANY, opal_setup_hmi, NULL); +SYSINIT(opal_setup_hmi, SI_SUB_CPU, SI_ORDER_ANY, opal_setup_hmi, NULL); From owner-svn-src-head@freebsd.org Mon Jun 10 03:34:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15FA015B2A4C; Mon, 10 Jun 2019 03:34:40 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A75F90937; Mon, 10 Jun 2019 03:34:39 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from pps.filterd (m0102855.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5A3PhXt028357; Sun, 9 Jun 2019 22:34:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=/OLITK+Nt4eTZ9bAqLinkEsLZ0/7ZWzjHR5SJqu1qck=; b=MQSPyuGk22W4pDulkDfUQxAKCxgG7f/GNuXNCYBv9/uKD2llauTbmAMVcO6qt8IJWZ3K aeS1eTUYDMKzhza7lzoEV+X57R+c/OC07vfHDneDVQvCE+Pz0VaxlIjFH9ZZYGohRmTW kGvpMYBrLuuwbPz8FBX61oBkexm784m6h8uH9WqOoLKd1RRUvtHEtp3SB9REvXhiqqXU QtxFs5IocPeWX7u4vuWnlvXwdVYqK+IsXUlyYspL2XUDhU8JYIptBaEP4C0Il68E+1no zX2nK/9mZgYqKvw8PZNtnrwe6m6uekYbOQ5DuAU5MqKH+kPqNBLgu/grahml1iF5MthO MQ== Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx0b-0010f301.pphosted.com with ESMTP id 2t0ab7hd96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 09 Jun 2019 22:34:31 -0500 Received-X: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 0C18C5001F1; Sun, 9 Jun 2019 22:34:31 -0500 (CDT) Received-X: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 0A90B5001C8; Sun, 9 Jun 2019 22:34:31 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received-X: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 0IrRFQaRmuJI; Sun, 9 Jun 2019 22:34:30 -0500 (CDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net [108.254.203.202]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dougm) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 99AAF500191; Sun, 9 Jun 2019 22:34:29 -0500 (CDT) Subject: Re: svn commit: r348843 - head/sys/vm To: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=dougm@rice.edu; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0IERvdWdsYXMgVyBNb29yZSA8ZG91Z21AcmljZS5lZHU+iQFUBBMBCAA+FiEEeV41MZJW A65Cl96D6I8hU9O51W4FAly53VQCGwMFCQWjmoAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ6I8hU9O51W58mgf8D9xOhD9/nqtHKUBDJz/m5DLzLyQVci6RrRFK9hSyQ1QdkG4VvvRL G1MpjsM16f42N41lf9Zhln7ydwpeUVNeGwwZu2S4EiSPOEhGpNOYC1lRjsD5ai9aZwzHcrAz 2PnyWxNJNEawrVdPUOaVlE+uzYe1048FaaB5tmYtooWZm5RZx6YBKSbWyWI8OvEO9BRlcwjr ErOlVlW3TNLpBGyvXYMAseWEozzsdaVbsekw6+7atIUYh6z9oBZXmClVdcpLF5/rtYhjwIIE 7AlWyt9tEJjRhA+2ujfbm96IrL5J8Da557IhjfslB8KcWGT+ynA5QzIrwidqllHMGsed4MAo RLkBDQRcud1UAQgA2xw6CEAjLMhRWjY86mW63fJ7WjMKUOoQS+0Z2yyUh2vI3oWWMgHbVlm2 7bclX+uidxABeh8gVxMcPX68ri1PsmXwDSNA93Jpm+dYwhugbvDZ5EEzn9ze3MNbGEEhx9j0 JYVmHOeSW7v2ia8H1ZxHIS3WzfKdsuFl0S34St9ojmkMzDNsRzZNvLF5wFeQ0cUI712OyBu3 E+T369rgIV6jwwwmbDI/YIWd2kMr6+6u40tbs70j7IpjluB3/XyaolcRdpDER9YUDXtSOL+/ UmhbQ10UrmIrxD1enqYn1gE8GOuv1P4zueU6qg8hc/wYPtggqR8smRjPQPn/OlcSxBnO4QAR AQABiQE8BBgBCAAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly53VQCGwwFCQWjmoAACgkQ 6I8hU9O51W5IYgf9ElaumHGMK89Y9ZQVJOwwlD1QC6DUoluIjYmudu6VkHRxrbE1VQohHAeu amaNA0qzLAL7RgkUs1HmyEOqJg0g51pm73l8pK97ztPqXEarCT0CnAE0atl43AY2TCjg+ANl zktrd4QDPqGOBfYbUCGPYJ7yukXU7cmnyaJx6XnjZDAuyhMDxkuocxVNJa32cV0NYqY9EDjo GfGaJjF20leX/BsGElCzDzlZgfWpNGQjqGuOdYdKNx43J654MO6HxSRT25j09s26VzpvT6rI c0wNdJ4CBE5tseI+YlbwhxGziQh/FEMnTSqxhWt1Ac6o9TqMQIIKoQhcekvT7EX5uvvOnLkB DQRcusvzAQgAvlC3Q5iWVbOxhZ6QXSiZ0p1SG19XZBo7tY5L4Pu6QPNsl/tIWbyDodMdz8vG rG36sRZXlcLOfZhhAHuWKUcoPpJ9H3deHrYZSK7H9LBvNm+0C8n/acRrkAZYch74A4HXlBpc +pMm1SfXufXm7TWII7hAvxpX/2+eaZppEl8eRf+JfNhK+34aYjoONp+wi6Jz/gMS7EfC+gIw jg3ncionUqKXHR/HR+kUzfQpiGEj0KvL0YgEawyzb1UB+D0Jb97OAiqj+s0jd4THS5S7b4He lDHcrlisUZNMtFoRmuG2fKCjwqOQ6+qNdjkhL8flHtkAUOu51WOR+kqAqKKRx6JnkQARAQAB iQLSBBgBCgAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly6y/MCGwIFCQWjmoABoAkQ6I8h U9O51W7A1CAEGQEKAH0WIQR+kHbQAKIFA/vka1CjtHtWP6FLrAUCXLrL818UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0N0U5MDc2RDAw MEEyMDUwM0ZCRTQ2QjUwQTNCNDdCNTYzRkExNEJBQwAKCRCjtHtWP6FLrKfwB/9JJhuW8pYI egq4N9O416AkIGb7U4WgfSxpn+e8qVL5368LdZ9BMe3CnEJ70gPtdvNPStdkJkeQ+tQHVPBw WkHaCxY9Kw4t+K2sYAGOeePmIhro/V2oDxCjHm/orr6r4XrQur+yvHl6qWliKMyKRSQphJcR jEp4AI/1epzp5ulw0sn4Gjgpp4zkEanuPblPukeu4G+1AeCflyR4D1pWvdQU6rL9zS3MFyDa j/ooh7YDC5qx9Y9HjYcTpPfkSzX9GG2XBmR3+3lo3CW1nAdd3tIBepkdEXEMQpZvPRFb9qfg jyE6V0wC6yG9fxF/TuG8/Trs3WZORa1gFDR0rQROvjHCc/UH/R7Pmbw4s7r/DTl9mGXikXQa VkrCkS99g5D67qerzA1S9SyH7d0iVy3PqFr8vNnwJtB7hjFx6uO2XG75h1CX50q3YYx0gd+U dwcM2GeP5SDQ0fdFoCsPjSTRK5oiD96D85VTbS7EJgF14wHcrBbqulUltE3JSVSIgYy4Jyr4 dF82pM8XWeaVaYAh8yoIDvud5UYRJECIC00VNG1W/wUJKmvIhsFIQXRneEoMvbMpDvP9QvAK WK7E+dYhu/eemFhteDTgbh16AbHcpwkwFWMEke/u393pzSsxKVCrYACxv7aY186fILDrQUpQ qJr40I2R31nvfny8tsCffMIvKtJ98Rw= Message-ID: Date: Sun, 9 Jun 2019 22:34:28 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201906100307.x5A37BFt099669@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-10_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=922 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906100022 X-Rspamd-Queue-Id: 8A75F90937 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 03:34:40 -0000 I understand that I ought to have included this in the previous checkin. MFC after: 3 days and that my description of the appropriateness of len==0 passed to mmap was imprecise.  I regret the error. Doug Moore On 6/9/19 10:07 PM, Doug Moore wrote: > Author: dougm > Date: Mon Jun 10 03:07:10 2019 > New Revision: 348843 > URL: https://svnweb.freebsd.org/changeset/base/348843 > > Log: > There are times when a len==0 parameter to mmap is okay. But on a > 32-bit machine, a len parameter just a few bytes short of 4G, rounded > up to a page boundary and hitting zero then, is not okay. Return > failure in that case. > > Reported by: pho > Reviewed by: alc, kib (mentor) > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D20580 > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s > > /* Adjust size for rounding (on both ends). */ > size += pageoff; /* low end... */ > - size = (vm_size_t) round_page(size); /* hi end */ > + /* Check for rounding up to zero. */ > + if (round_page(size) < size) > + return (EINVAL); > + size = round_page(size); /* hi end */ > > /* Ensure alignment is at least a page and fits in a pointer. */ > align = flags & MAP_ALIGNMENT_MASK; > From owner-svn-src-head@freebsd.org Mon Jun 10 05:28:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EEE815B4A95; Mon, 10 Jun 2019 05:28:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBC2935C7; Mon, 10 Jun 2019 05:28:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E7E9DD23; Mon, 10 Jun 2019 05:28:04 +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 x5A5S4cf072562; Mon, 10 Jun 2019 05:28:04 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A5S4gm072561; Mon, 10 Jun 2019 05:28:04 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201906100528.x5A5S4gm072561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 10 Jun 2019 05:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348847 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BBC2935C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 05:28:05 -0000 Author: dchagin Date: Mon Jun 10 05:28:03 2019 New Revision: 348847 URL: https://svnweb.freebsd.org/changeset/base/348847 Log: Use C11 anonymous unions. PR: 215202 Reported by: glebius MFC after: 2 weeks Modified: head/sys/sys/ucred.h Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) @@ -89,12 +89,11 @@ struct xucred { gid_t cr_groups[XU_NGROUPS]; /* groups */ union { void *_cr_unused1; /* compatibility with old ucred */ - pid_t _pid; - } _cr; + pid_t cr_pid; + }; }; #define XUCRED_VERSION 0 -#define cr_pid _cr._pid /* This can be used for both ucred and xucred structures. */ #define cr_gid cr_groups[0] From owner-svn-src-head@freebsd.org Mon Jun 10 06:35:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2CC715B5BE3; Mon, 10 Jun 2019 06:35:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5048A94D97; Mon, 10 Jun 2019 06:35:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id p17so1913590ljg.1; Sun, 09 Jun 2019 23:35:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ZxR4eUmJrD1IsL20rHu7dnM3I07RDJ1rKNnv3Oya9fU=; b=pDfD6pntUaf66vZXu4ncJMdEriTDBO4QwQ+JaQrY9K30iKyhrDvxaOCJ5xMkURwgam YmDubvmBKiKOFAsedHXvtvk2XpVq7gab/uMpje+g3guJb6cEIsF91fcpd36TOwpGYjFz TeY0suBSZef4LaJlt/QDfITBuMEwhZ4EGNOkZ2rF9EW15qVOQPN2M1c4ySYMB4a+vtD8 itUfQpIlYRd8E+TgfWLVJK93M5LsshUjxfWe4/B9rRX2ui53QqWhOV30vsTs9keNobB/ AoXHWJhqs0Lbsi7OaPoV8zGRG0zN76J5F/YIUvRdyPMbXTvQZUO+lxFqghV4wBpjVKWc hQVQ== X-Gm-Message-State: APjAAAWdLeZohDfKOjZ/kbhJmQRuAIdc03x1rRPaYgH2tTbYLRXJqGuF SdD9DmCl8sZrBtf4Gtkn2rT4+otw X-Google-Smtp-Source: APXvYqwJPjTws5T9JP4dBwVNAEYcOB5raEtefccTh8Nl5yfZs+Fftr6H2rNF2uq5D1+8FvLKi3P8NQ== X-Received: by 2002:a2e:96c3:: with SMTP id d3mr23737823ljj.68.1560148519952; Sun, 09 Jun 2019 23:35:19 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id l29sm1831809lfp.83.2019.06.09.23.35.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 23:35:19 -0700 (PDT) Subject: Re: svn commit: r348843 - head/sys/vm To: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Mon, 10 Jun 2019 09:35:17 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201906100307.x5A37BFt099669@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5048A94D97 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 06:35:28 -0000 On 10/06/2019 06:07, Doug Moore wrote: > Author: dougm > Date: Mon Jun 10 03:07:10 2019 > New Revision: 348843 > URL: https://svnweb.freebsd.org/changeset/base/348843 > > Log: > There are times when a len==0 parameter to mmap is okay. But on a > 32-bit machine, a len parameter just a few bytes short of 4G, rounded > up to a page boundary and hitting zero then, is not okay. Return > failure in that case. > > Reported by: pho > Reviewed by: alc, kib (mentor) > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D20580 > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s > > /* Adjust size for rounding (on both ends). */ > size += pageoff; /* low end... */ > - size = (vm_size_t) round_page(size); /* hi end */ > + /* Check for rounding up to zero. */ > + if (round_page(size) < size) Is this guaranteed to work with all compilers? I think that some smart compilers may think that this condition is impossible. Are we finally using -fwrapv or something like it for kernel builds? > + return (EINVAL); > + size = round_page(size); /* hi end */ > > /* Ensure alignment is at least a page and fits in a pointer. */ > align = flags & MAP_ALIGNMENT_MASK; > -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 10 06:42:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05AB15B5E21; Mon, 10 Jun 2019 06:42:38 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 687139519F; Mon, 10 Jun 2019 06:42:38 +0000 (UTC) (envelope-from dougm@rice.edu) Received: from pps.filterd (m0102857.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5A6fDc6031947; Mon, 10 Jun 2019 01:42:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=8wLuuqNA5BJ/xYPT7HX3WLMTd7syVvoo7yv06H9cARY=; b=DYCEg+n5wEmKyJCWlHK3KQjvvDv7Y2Wr8qwD1kMRLXgF+kLgAzz30x4wTox4sZRP09Q6 ape8RYeIJhDN5DZSKvpozPGigmcG6T8riw//7FmuwUHyk1RQNSr8sbAYYXPDENpybDBh BtRQ9VF4XIRW6zR9dR4tAZJu48mvHTjNfQM6nHQ4AR4dZs7ZF1sXLBm181dRUtWWiYLT afAsK/+/uXsgpDr1Hf0NaKdlU4Zu5S5qDCD30JCS9kr/oBYL7OFHaUrifObtJJT2KlmA rkjSNYvkpMnn/zxw52LN1qmHYsJee48iSg3BSaIEZ9kMFTduw+xPPd6F0LT+4pCz0Doh jw== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2t07b2hjju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2019 01:42:35 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 34348460569; Mon, 10 Jun 2019 01:42:35 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 1D1934605E5; Mon, 10 Jun 2019 01:42:35 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iq_3jNXws1-P; Mon, 10 Jun 2019 01:42:35 -0500 (CDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net [108.254.203.202]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dougm) by mh1.mail.rice.edu (Postfix) with ESMTPSA id B8AB0460569; Mon, 10 Jun 2019 01:42:34 -0500 (CDT) Subject: Re: svn commit: r348843 - head/sys/vm To: Andriy Gapon , Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=dougm@rice.edu; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0IERvdWdsYXMgVyBNb29yZSA8ZG91Z21AcmljZS5lZHU+iQFUBBMBCAA+FiEEeV41MZJW A65Cl96D6I8hU9O51W4FAly53VQCGwMFCQWjmoAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ6I8hU9O51W58mgf8D9xOhD9/nqtHKUBDJz/m5DLzLyQVci6RrRFK9hSyQ1QdkG4VvvRL G1MpjsM16f42N41lf9Zhln7ydwpeUVNeGwwZu2S4EiSPOEhGpNOYC1lRjsD5ai9aZwzHcrAz 2PnyWxNJNEawrVdPUOaVlE+uzYe1048FaaB5tmYtooWZm5RZx6YBKSbWyWI8OvEO9BRlcwjr ErOlVlW3TNLpBGyvXYMAseWEozzsdaVbsekw6+7atIUYh6z9oBZXmClVdcpLF5/rtYhjwIIE 7AlWyt9tEJjRhA+2ujfbm96IrL5J8Da557IhjfslB8KcWGT+ynA5QzIrwidqllHMGsed4MAo RLkBDQRcud1UAQgA2xw6CEAjLMhRWjY86mW63fJ7WjMKUOoQS+0Z2yyUh2vI3oWWMgHbVlm2 7bclX+uidxABeh8gVxMcPX68ri1PsmXwDSNA93Jpm+dYwhugbvDZ5EEzn9ze3MNbGEEhx9j0 JYVmHOeSW7v2ia8H1ZxHIS3WzfKdsuFl0S34St9ojmkMzDNsRzZNvLF5wFeQ0cUI712OyBu3 E+T369rgIV6jwwwmbDI/YIWd2kMr6+6u40tbs70j7IpjluB3/XyaolcRdpDER9YUDXtSOL+/ UmhbQ10UrmIrxD1enqYn1gE8GOuv1P4zueU6qg8hc/wYPtggqR8smRjPQPn/OlcSxBnO4QAR AQABiQE8BBgBCAAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly53VQCGwwFCQWjmoAACgkQ 6I8hU9O51W5IYgf9ElaumHGMK89Y9ZQVJOwwlD1QC6DUoluIjYmudu6VkHRxrbE1VQohHAeu amaNA0qzLAL7RgkUs1HmyEOqJg0g51pm73l8pK97ztPqXEarCT0CnAE0atl43AY2TCjg+ANl zktrd4QDPqGOBfYbUCGPYJ7yukXU7cmnyaJx6XnjZDAuyhMDxkuocxVNJa32cV0NYqY9EDjo GfGaJjF20leX/BsGElCzDzlZgfWpNGQjqGuOdYdKNx43J654MO6HxSRT25j09s26VzpvT6rI c0wNdJ4CBE5tseI+YlbwhxGziQh/FEMnTSqxhWt1Ac6o9TqMQIIKoQhcekvT7EX5uvvOnLkB DQRcusvzAQgAvlC3Q5iWVbOxhZ6QXSiZ0p1SG19XZBo7tY5L4Pu6QPNsl/tIWbyDodMdz8vG rG36sRZXlcLOfZhhAHuWKUcoPpJ9H3deHrYZSK7H9LBvNm+0C8n/acRrkAZYch74A4HXlBpc +pMm1SfXufXm7TWII7hAvxpX/2+eaZppEl8eRf+JfNhK+34aYjoONp+wi6Jz/gMS7EfC+gIw jg3ncionUqKXHR/HR+kUzfQpiGEj0KvL0YgEawyzb1UB+D0Jb97OAiqj+s0jd4THS5S7b4He lDHcrlisUZNMtFoRmuG2fKCjwqOQ6+qNdjkhL8flHtkAUOu51WOR+kqAqKKRx6JnkQARAQAB iQLSBBgBCgAmFiEEeV41MZJWA65Cl96D6I8hU9O51W4FAly6y/MCGwIFCQWjmoABoAkQ6I8h U9O51W7A1CAEGQEKAH0WIQR+kHbQAKIFA/vka1CjtHtWP6FLrAUCXLrL818UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0N0U5MDc2RDAw MEEyMDUwM0ZCRTQ2QjUwQTNCNDdCNTYzRkExNEJBQwAKCRCjtHtWP6FLrKfwB/9JJhuW8pYI egq4N9O416AkIGb7U4WgfSxpn+e8qVL5368LdZ9BMe3CnEJ70gPtdvNPStdkJkeQ+tQHVPBw WkHaCxY9Kw4t+K2sYAGOeePmIhro/V2oDxCjHm/orr6r4XrQur+yvHl6qWliKMyKRSQphJcR jEp4AI/1epzp5ulw0sn4Gjgpp4zkEanuPblPukeu4G+1AeCflyR4D1pWvdQU6rL9zS3MFyDa j/ooh7YDC5qx9Y9HjYcTpPfkSzX9GG2XBmR3+3lo3CW1nAdd3tIBepkdEXEMQpZvPRFb9qfg jyE6V0wC6yG9fxF/TuG8/Trs3WZORa1gFDR0rQROvjHCc/UH/R7Pmbw4s7r/DTl9mGXikXQa VkrCkS99g5D67qerzA1S9SyH7d0iVy3PqFr8vNnwJtB7hjFx6uO2XG75h1CX50q3YYx0gd+U dwcM2GeP5SDQ0fdFoCsPjSTRK5oiD96D85VTbS7EJgF14wHcrBbqulUltE3JSVSIgYy4Jyr4 dF82pM8XWeaVaYAh8yoIDvud5UYRJECIC00VNG1W/wUJKmvIhsFIQXRneEoMvbMpDvP9QvAK WK7E+dYhu/eemFhteDTgbh16AbHcpwkwFWMEke/u393pzSsxKVCrYACxv7aY186fILDrQUpQ qJr40I2R31nvfny8tsCffMIvKtJ98Rw= Message-ID: <21baf615-3356-73a1-52b0-d2f33f4cf49d@rice.edu> Date: Mon, 10 Jun 2019 01:42:34 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-10_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906100047 X-Rspamd-Queue-Id: 687139519F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 06:42:39 -0000 -fwrapv concerns signed arithmetic.  This calculation is with unsigned arithmetic, and the possibility of wrapping around to 0 is part of the language. Doug Moore On 6/10/19 1:35 AM, Andriy Gapon wrote: > On 10/06/2019 06:07, Doug Moore wrote: >> Author: dougm >> Date: Mon Jun 10 03:07:10 2019 >> New Revision: 348843 >> URL: https://svnweb.freebsd.org/changeset/base/348843 >> >> Log: >> There are times when a len==0 parameter to mmap is okay. But on a >> 32-bit machine, a len parameter just a few bytes short of 4G, rounded >> up to a page boundary and hitting zero then, is not okay. Return >> failure in that case. >> >> Reported by: pho >> Reviewed by: alc, kib (mentor) >> Tested by: pho >> Differential Revision: https://reviews.freebsd.org/D20580 >> >> Modified: >> head/sys/vm/vm_mmap.c >> >> Modified: head/sys/vm/vm_mmap.c >> ============================================================================== >> --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) >> +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) >> @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s >> >> /* Adjust size for rounding (on both ends). */ >> size += pageoff; /* low end... */ >> - size = (vm_size_t) round_page(size); /* hi end */ >> + /* Check for rounding up to zero. */ >> + if (round_page(size) < size) > Is this guaranteed to work with all compilers? > I think that some smart compilers may think that this condition is impossible. > Are we finally using -fwrapv or something like it for kernel builds? > >> + return (EINVAL); >> + size = round_page(size); /* hi end */ >> >> /* Ensure alignment is at least a page and fits in a pointer. */ >> align = flags & MAP_ALIGNMENT_MASK; >> > From owner-svn-src-head@freebsd.org Mon Jun 10 06:54:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0289315B714D; Mon, 10 Jun 2019 06:54:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 68C46956E5; Mon, 10 Jun 2019 06:54:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 73D4743E1C7; Mon, 10 Jun 2019 16:54:11 +1000 (AEST) Date: Mon, 10 Jun 2019 16:54:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Moore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm In-Reply-To: <201906100307.x5A37BFt099669@repo.freebsd.org> Message-ID: <20190610160930.S2504@besplex.bde.org> References: <201906100307.x5A37BFt099669@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=E8nMTcrMv8adVMIzyT4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 68C46956E5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 06:54:21 -0000 On Mon, 10 Jun 2019, Doug Moore wrote: > Log: > There are times when a len==0 parameter to mmap is okay. But on a > 32-bit machine, a len parameter just a few bytes short of 4G, rounded > up to a page boundary and hitting zero then, is not okay. Return > failure in that case. Some overflows still occur. The problem is not limited to 32-bit machines. The first overflow is for len parameter just a few bytes short of SIZE_MAX added to a page offset of a few bytes. This overflows to a small value. Then rounding up to a page boundary doesn't overflow, but gives 0 or PAGE_SIZE, so the new overflow check doesn't work and overflow still occurs. The second overflow is for a len parameter just a few bytes short of SIZE_MAX with the first overflow not occurring (usually because the offset is 0). This is now detected. > Reported by: pho > Reviewed by: alc, kib (mentor) > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D20580 > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s > > /* Adjust size for rounding (on both ends). */ > size += pageoff; /* low end... */ The first overflow occurs here. Except in special cases, pageoff can be anything between 0 and PAGE_SIZE - 1, and size can be anything between 0 and SIZE_MAX. > - size = (vm_size_t) round_page(size); /* hi end */ > + /* Check for rounding up to zero. */ > + if (round_page(size) < size) > + return (EINVAL); > + size = round_page(size); /* hi end */ > > /* Ensure alignment is at least a page and fits in a pointer. */ > align = flags & MAP_ALIGNMENT_MASK; This bug was implemented in r239247 and affects all versions of FreeBSD newer than FreeBSD-7. Before then, FreeBSD used the bogus 4.4BSD check that (ssize_t)uap->len >= 0 (else return EINVAL). This behaviour was even documented. POSIX doesn't allow this -- it requires ENOMEM for invalid ranges, though it should require EOVERFLOW for ranges that are so invalid that they overflow something. Bruce From owner-svn-src-head@freebsd.org Mon Jun 10 07:17:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6BE15B7580; Mon, 10 Jun 2019 07:17:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F0C95EE6; Mon, 10 Jun 2019 07:17:49 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id 16so6890860ljv.10; Mon, 10 Jun 2019 00:17:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=YX9hmvLMTUIzf1922UJ/0AFd+ihbS+Y3oCvL+R2YBTQ=; b=J1+hmfy/ud4BVTlQ2oMJ3fypu0kTej8789qWH61rVJ2fv3jY3XxEEkWFO3JZo6ZXFc ax44e7vJ7dJLwsQSnMddLffAw1CoeNe9BjmH6Gk0as1EBwUcF+PN0KJCFlnCLHbOGv8T 1GhR1Ks9Aee/HZGCVDkcKp4gkV+TQp+6Tqn7YSsbu9QJexZlEAwv0/DnXCxgwYig+ljd 9JFnBKhCiTxNdkUZ0N+f83qOMg8qu136h7QWCmJlYZZu56h0ZsOuBwzzfVianm/oA7Rw QuUq2MappfXUNPTrLn9ZGNV5bjUmz/kPNxDAiilznqLdE0JIY3xN+rsUfSQ7eTM8CDqe Ql3w== X-Gm-Message-State: APjAAAUiwzSRROS+QSE4LJOqJsJq+ea6z1QY9c0s/wR4ciioyb8KNCjS UCOzSDBWQgyZh7ye4pDKNfL9tvv1 X-Google-Smtp-Source: APXvYqw4FqxS0H2DdCMCh7r1ZqJ2Y/D3MbgtrIvtmY/iT5qRa0pDhIUcoAR+2zn4H92utt16ny3krg== X-Received: by 2002:a2e:8696:: with SMTP id l22mr11995757lji.201.1560151067448; Mon, 10 Jun 2019 00:17:47 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id g15sm1780925ljk.83.2019.06.10.00.17.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 00:17:46 -0700 (PDT) Subject: Re: svn commit: r348843 - head/sys/vm To: Doug Moore , Doug Moore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> <21baf615-3356-73a1-52b0-d2f33f4cf49d@rice.edu> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Mon, 10 Jun 2019 10:17:44 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <21baf615-3356-73a1-52b0-d2f33f4cf49d@rice.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42F0C95EE6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 07:17:50 -0000 On 10/06/2019 09:42, Doug Moore wrote: > -fwrapv concerns signed arithmetic.  This calculation is with unsigned > arithmetic, and the possibility of wrapping around to 0 is part of the > language. Oh, sorry for the noise! > On 6/10/19 1:35 AM, Andriy Gapon wrote: >> On 10/06/2019 06:07, Doug Moore wrote: >>> Author: dougm >>> Date: Mon Jun 10 03:07:10 2019 >>> New Revision: 348843 >>> URL: https://svnweb.freebsd.org/changeset/base/348843 >>> >>> Log: >>> There are times when a len==0 parameter to mmap is okay. But on a >>> 32-bit machine, a len parameter just a few bytes short of 4G, rounded >>> up to a page boundary and hitting zero then, is not okay. Return >>> failure in that case. >>> >>> Reported by: pho >>> Reviewed by: alc, kib (mentor) >>> Tested by: pho >>> Differential Revision: https://reviews.freebsd.org/D20580 >>> >>> Modified: >>> head/sys/vm/vm_mmap.c >>> >>> Modified: head/sys/vm/vm_mmap.c >>> ============================================================================== >>> --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) >>> +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) >>> @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s >>> >>> /* Adjust size for rounding (on both ends). */ >>> size += pageoff; /* low end... */ >>> - size = (vm_size_t) round_page(size); /* hi end */ >>> + /* Check for rounding up to zero. */ >>> + if (round_page(size) < size) >> Is this guaranteed to work with all compilers? >> I think that some smart compilers may think that this condition is impossible. >> Are we finally using -fwrapv or something like it for kernel builds? >> >>> + return (EINVAL); >>> + size = round_page(size); /* hi end */ >>> >>> /* Ensure alignment is at least a page and fits in a pointer. */ >>> align = flags & MAP_ALIGNMENT_MASK; >>> >> -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 10 09:10:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE99915B9C76; Mon, 10 Jun 2019 09:10:43 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay102.isp.belgacom.be (mailrelay102.isp.belgacom.be [195.238.20.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D14FF6A666; Mon, 10 Jun 2019 09:10:42 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CPAQDuHf5c/1H1sVtlGQEBAQEBAQE?= =?us-ascii?q?BAQEBAQcBAQEBAQGBZQKCD1kRUiASFBSNEIl2AQGCDDUBigiQHQkBAQIBAQE?= =?us-ascii?q?BASsMAQGEQAKCcCQ4EwEDAQEFAQEBAQRtHAxCAQwBhHsBBTocIxALDgYECSU?= =?us-ascii?q?PSAYBEoMjgg4LqBGEMgELAYRbgQoGgTQBi3OBf4QjPoREhWIElAiVHwmCEYZ?= =?us-ascii?q?EjHInlxuECokJhxORNSGBWE0wCIMnghsXiGGFQT0DMIIUjk4BAQ?= X-IPAS-Result: =?us-ascii?q?A2CPAQDuHf5c/1H1sVtlGQEBAQEBAQEBAQEBAQcBAQEBA?= =?us-ascii?q?QGBZQKCD1kRUiASFBSNEIl2AQGCDDUBigiQHQkBAQIBAQEBASsMAQGEQAKCc?= =?us-ascii?q?CQ4EwEDAQEFAQEBAQRtHAxCAQwBhHsBBTocIxALDgYECSUPSAYBEoMjgg4Lq?= =?us-ascii?q?BGEMgELAYRbgQoGgTQBi3OBf4QjPoREhWIElAiVHwmCEYZEjHInlxuECokJh?= =?us-ascii?q?xORNSGBWE0wCIMnghsXiGGFQT0DMIIUjk4BAQ?= Received: from 81.245-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.245.81]) by relay.skynet.be with ESMTP; 10 Jun 2019 11:09:10 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id x5A9996m007510; Mon, 10 Jun 2019 11:09:09 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Mon, 10 Jun 2019 11:09:09 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dmitry Chagin , glebius@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> In-Reply-To: <201906100528.x5A5S4gm072561@repo.freebsd.org> References: <201906100528.x5A5S4gm072561@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D14FF6A666 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 09:10:43 -0000 On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin wrote: > Author: dchagin > Date: Mon Jun 10 05:28:03 2019 > New Revision: 348847 > URL: https://svnweb.freebsd.org/changeset/base/348847 > > Log: > Use C11 anonymous unions. > > PR: 215202 > Reported by: glebius > MFC after: 2 weeks > > Modified: > head/sys/sys/ucred.h > > Modified: head/sys/sys/ucred.h > ============================================================================== > --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) > +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) > @@ -89,12 +89,11 @@ struct xucred { > gid_t cr_groups[XU_NGROUPS]; /* groups */ > union { > void *_cr_unused1; /* compatibility with old ucred */ > - pid_t _pid; > - } _cr; > + pid_t cr_pid; > + }; > }; > #define XUCRED_VERSION 0 > > -#define cr_pid _cr._pid > /* This can be used for both ucred and xucred structures. */ > #define cr_gid cr_groups[0] Isn't this a userland header that should work with non-C11 compilers? From owner-svn-src-head@freebsd.org Mon Jun 10 13:00:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D9C515BE90E for ; Mon, 10 Jun 2019 13:00:37 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92BCB71CC8 for ; Mon, 10 Jun 2019 13:00:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x842.google.com with SMTP id x47so10373108qtk.11 for ; Mon, 10 Jun 2019 06:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lRN7kbVAT6Nw12yBGC72tDOdiVHa8pf2/I01Z4DuBFo=; b=S7zQ4f3Cb4ZN4IyK7RybvnoMh+Vba0Gcplsf8zn4tJtOlo+0T4inWFtp9omc9WayBx 0/cFp57YQYwe7f79hBb6im+2iJUQbLmBd2FnaVTOp/JH4nPbbLmMzJKlRMUmGtB25/E/ ++kbR3X0+hp1KYhRo6UqkjGQb7Kz6HDI8qmWFMd4XpCiHge9RX4JOmZlcV8uz4VInm+B 1zcJ0hZ6ZK4IPQbvY3NwfMeQoPyvWPn7g1gaPShZY9F8gK85Rv7TEnKANl4tiBwWGE0s x76Z8YD4kXHUCo8wBT7Ji7UR/WfUQSjP777VzDNErsU80KzC/tPi2ZZ9j4QHn3pdgpFA UzUw== 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=lRN7kbVAT6Nw12yBGC72tDOdiVHa8pf2/I01Z4DuBFo=; b=LxLm2kHMXpdxSJYRjSyONWvheXtUDWNlT/wymL2BbijmXxvAgo/4NpWKwCPL3EvBA5 0wv6LfDP+B1yTVZxkjljwexHxvw9skl5eeC4ppTUDP4U2QAdkN2MbYfI5bQSa228m2tR ctkseVlXsWzymoFOkM4H8Vxio9cDkd7PaXsmMULllo98weFm1rZiPPMqEkpUe7iXDeiK Imes/maSO56nh4RUlhhK9Gv3ix7qll0OUrylCbtchlRVUiEn9QeGiffdGgL98iVUMLl8 C22Nb/9d0i2OpOjpUj89sT8w3+WAQSlxLThBy3Y2/yDPLKFl2sSLpfqgyXs2+xag12AA 4g3g== X-Gm-Message-State: APjAAAVdxkF9MCoRwLiPEvZpkdZzM5iIEHaS/4Y0qj3eszr/3Kcs57VM hAJUbR9JqQGfdw5w6+XecPDeKA== X-Google-Smtp-Source: APXvYqz6X4sPYdU81EIihgdQ8NG/LrDb8hOEN/6lQsJdOCH2hdFhH7FjLT9NL0E/lV8aESiiLHt/kQ== X-Received: by 2002:a0c:984b:: with SMTP id e11mr57683591qvd.174.1560171635481; Mon, 10 Jun 2019 06:00:35 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id p40sm5987110qte.93.2019.06.10.06.00.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 06:00:34 -0700 (PDT) Date: Mon, 10 Jun 2019 09:00:34 -0400 From: Shawn Webb To: Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm Message-ID: <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> References: <201906100307.x5A37BFt099669@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z44yomx5hny7i4jy" Content-Disposition: inline In-Reply-To: <201906100307.x5A37BFt099669@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 92BCB71CC8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 13:00:37 -0000 --z44yomx5hny7i4jy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: > Author: dougm > Date: Mon Jun 10 03:07:10 2019 > New Revision: 348843 > URL: https://svnweb.freebsd.org/changeset/base/348843 >=20 > Log: > There are times when a len=3D=3D0 parameter to mmap is okay. But on a > 32-bit machine, a len parameter just a few bytes short of 4G, rounded > up to a page boundary and hitting zero then, is not okay. Return > failure in that case. > =20 > Reported by: pho > Reviewed by: alc, kib (mentor) > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D20580 >=20 > Modified: > head/sys/vm/vm_mmap.c >=20 > Modified: head/sys/vm/vm_mmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t= s > =20 > /* Adjust size for rounding (on both ends). */ > size +=3D pageoff; /* low end... */ > - size =3D (vm_size_t) round_page(size); /* hi end */ > + /* Check for rounding up to zero. */ > + if (round_page(size) < size) > + return (EINVAL); The mmap(2) manpage says that len=3D=3D0 results in EINVAL, so the manpage needs updating. I'm curious what "there are times" refers to. Can you or the original reporter elaborate those cases? Thanks a lot! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --z44yomx5hny7i4jy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz+VGwACgkQ/y5nonf4 4frvGA//eQq2TpOcbjRwgfD6CI3iSLMimv3LTcxYDdmWvBEOaQYLVU4jk4gHM02F PkiHEw95AhW+YLD+Wqy62xCuzc4A9FtEjMSbIcBK3rxZ7fJzBreWCUNoFen29+3T 0qJQTf7gOE/l5XQ2Ysghi/Z3+5lpaLEuQCwjQbmgkBO+3Yl15YdJFupH9rM+RqcH /YQXUUfdwmV77N07iOpM6IGRHBVoW33D8a0LNdf7E3xrqgvd2guZnv2cnxt6FAyZ 213Rj44nvs1zkBerYuT1n1aEHEcvaSGv+8Cok9iaF5vQHfIsj2kkko2pvawF/RsJ Oo79JaYueU6+nGq87Tb7V/Z0EGDN3nvrbPbWM1TZXf7spT7SZOwb/tE098GPtG2w o6YCZTdxtDEMlApGK4yT3lCPBfhrmL4NdQ8bla5KyxjwubtZImdjuDlcFHIrmIJF FNk8az1+kapJcJmpbSJ0DI79N1YjdS/uUhP+et99GxYfzU80VeYiLYgAmXs3Xfbc ffwpelv5gxlav+VaT2WHYru0xxOklADd2zHkhrmsGYg5sP5wg7gM5+AYvHF763nU F5xa8vMyCHh5lvrd7ZZjcaDhrbqtztMWStCuZAfZ6cAbbT686FFtblYmuCT1QulR AH/nfS2f/8/cftLvSpbGArAt2v6GVBCh02CwlIdF7lz7bcSbyTA= =kEQg -----END PGP SIGNATURE----- --z44yomx5hny7i4jy-- From owner-svn-src-head@freebsd.org Mon Jun 10 13:34:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 157E915BF6D4; Mon, 10 Jun 2019 13:34:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A623B731C7; Mon, 10 Jun 2019 13:34:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BE11AF18; Mon, 10 Jun 2019 13:34:19 +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 x5ADYI6a028641; Mon, 10 Jun 2019 13:34:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ADYIud028640; Mon, 10 Jun 2019 13:34:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906101334.x5ADYIud028640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 10 Jun 2019 13:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348854 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 348854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A623B731C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 13:34:20 -0000 Author: cem Date: Mon Jun 10 13:34:18 2019 New Revision: 348854 URL: https://svnweb.freebsd.org/changeset/base/348854 Log: /etc/rc.d/local: Fix typo in description PR: 238448 Submitted by: Marián ÄŒerný Modified: head/libexec/rc/rc.d/local Modified: head/libexec/rc/rc.d/local ============================================================================== --- head/libexec/rc/rc.d/local Mon Jun 10 13:17:39 2019 (r348853) +++ head/libexec/rc/rc.d/local Mon Jun 10 13:34:18 2019 (r348854) @@ -11,7 +11,7 @@ . /etc/rc.subr name="local" -desc="Run /etc/rc.local and /etc/shutdown.local" +desc="Run /etc/rc.local and /etc/rc.shutdown.local" start_cmd="local_start" stop_cmd="local_stop" From owner-svn-src-head@freebsd.org Mon Jun 10 13:43:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D33615BFD96; Mon, 10 Jun 2019 13:43:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f181.google.com (mail-it1-f181.google.com [209.85.166.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABE6C73C25; Mon, 10 Jun 2019 13:43:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f181.google.com with SMTP id j194so6343513ite.0; Mon, 10 Jun 2019 06:43:44 -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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=NRoExSwodYbCDn41KNgiXw4+PDVRYzZc/7pZwLqLsEk=; b=EeWQ+vmrcLBKIp67OG+nTSP2dkeaCM1wgnbO6ZRWeBgjJAf1G8yP3EurVWryvmGzLG 57SzVE+r4YGxd1ypDpEeV0gTId3sDX9wqmYYyY/Xp2PqZRl2aohKDwT9lcnxkNMYt7QY Z0FPkzQzrkLEG8DBsPR/KPm1qOzj/P7eXAf5Y/3PShzrI0qxPjW4raDiW4GxziRTTsdi 7PCVvIMJL5Trj63bsiXT2Ul9fOZBzjfUBxxlZJGMyNIioKN1C+Ru+5/1HIb6NkCdT4Kg hdTLmLD4AQjIY6TxCyIuImhMWwH/4lXchP1ocaWAha6VDvINiZEIMAR2STUB6X6T8vSu M0Zg== X-Gm-Message-State: APjAAAVTbT6kaw5aOreQsTGN9u1bA08t6KymrBUKaj5HRt/oo1czT3yC 0EvNl+MeX3u2ho6WqYgmNTyZXWnF X-Google-Smtp-Source: APXvYqyPfuhx3RKd3Cq+au5YKR7qQFxd8JtQ9dl1glZ6bHXoOq7XqL/mYbvTIbiCISkaj5SJFEDh+A== X-Received: by 2002:a05:660c:20a:: with SMTP id y10mr13667142itj.148.1560174217484; Mon, 10 Jun 2019 06:43:37 -0700 (PDT) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com. [209.85.166.54]) by smtp.gmail.com with ESMTPSA id l136sm5251757itc.23.2019.06.10.06.43.37 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 06:43:37 -0700 (PDT) Received: by mail-io1-f54.google.com with SMTP id m24so6908344ioo.2; Mon, 10 Jun 2019 06:43:37 -0700 (PDT) X-Received: by 2002:a5d:8253:: with SMTP id n19mr8887525ioo.80.1560174216837; Mon, 10 Jun 2019 06:43:36 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> In-Reply-To: <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 10 Jun 2019 06:43:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: ABE6C73C25 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 13:43:45 -0000 On Mon, Jun 10, 2019 at 2:10 AM T=C4=B3l Coosemans wrote= : > On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin > wrote: > > ... > > URL: https://svnweb.freebsd.org/changeset/base/348847 > > Log: > > Use C11 anonymous unions. > > > > Modified: head/sys/sys/ucred.h > ... > > Isn't this a userland header that should work with non-C11 compilers? Hi Tijl, Why would one expect userland headers to work with non-C11 (gnu89) compiler= s? Thanks, Conrad From owner-svn-src-head@freebsd.org Mon Jun 10 13:46:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBBA815BFF5E; Mon, 10 Jun 2019 13:46:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AD59743D5; Mon, 10 Jun 2019 13:46:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 633AC1B0BC; Mon, 10 Jun 2019 13:46:37 +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 x5ADkbKS034573; Mon, 10 Jun 2019 13:46:37 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ADkb7S034572; Mon, 10 Jun 2019 13:46:37 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906101346.x5ADkb7S034572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 10 Jun 2019 13:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348860 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 348860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AD59743D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 13:46:38 -0000 Author: bz Date: Mon Jun 10 13:46:36 2019 New Revision: 348860 URL: https://svnweb.freebsd.org/changeset/base/348860 Log: allwinner mmc: move variable assignment into block "blksz is only used in one of the two blocks, so assign it inside that block rather than outside. MFC after: 2 weeks Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Mon Jun 10 13:44:29 2019 (r348859) +++ head/sys/arm/allwinner/aw_mmc.c Mon Jun 10 13:46:36 2019 (r348860) @@ -1104,7 +1104,6 @@ aw_mmc_request(device_t bus, device_t child, struct mm } if (cmd->data->flags & MMC_DATA_WRITE) cmdreg |= AW_MMC_CMDR_DIR_WRITE; - blksz = min(cmd->data->len, MMC_SECTOR_SIZE); #ifdef MMCCAM if (cmd->data->flags & MMC_DATA_BLOCK_SIZE) { AW_MMC_WRITE_4(sc, AW_MMC_BKSR, cmd->data->block_size); @@ -1112,6 +1111,7 @@ aw_mmc_request(device_t bus, device_t child, struct mm } else #endif { + blksz = min(cmd->data->len, MMC_SECTOR_SIZE); AW_MMC_WRITE_4(sc, AW_MMC_BKSR, blksz); AW_MMC_WRITE_4(sc, AW_MMC_BYCR, cmd->data->len); } From owner-svn-src-head@freebsd.org Mon Jun 10 13:49:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400CD15C002A for ; Mon, 10 Jun 2019 13:49:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7ED57456A for ; Mon, 10 Jun 2019 13:49:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x834.google.com with SMTP id 33so2446798qtr.8 for ; Mon, 10 Jun 2019 06:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n3av1DtxzvrXw8Q/dVEMl9mzyJ4FLuqvxSrTYuXi/kw=; b=MXYhpvg8o/cZ131nb7nnD0BkSWAN1IjLpUX6c/J73LCyn7vqbnDxnGfLjrGj0wLJd/ PH3GVpJNuMZk00ukjTK0WTHb5kHH/62J6SdfYsJQQjqkNYdUymWoYoDibSSGWbSvuUR1 TEm8ONYEbHrZl7E+W4p319r9GHmTw7TfEcmeVnkAIJumjCm+ote/Zrum8WglqvfQYgPs CprVVzMAHI9TZlJEi/04KCZXP+E1KsFdd8JlwYqAcFCZIdN+obwR/GmLy9aXrdBd8UET NX7oOWBC6uPam/q1LPoPy/3SSpNqVOkDHR3aRdzm4k4L3vaVEnrt5dvlWsdLJPcZZHT8 Gy9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n3av1DtxzvrXw8Q/dVEMl9mzyJ4FLuqvxSrTYuXi/kw=; b=AipMOQFRR0ZuvvOQVb3O7sSBaIRQVJHhFq6WRmV/dxk9F7a+pkahEuV1qi59BBQgjD IsLTqXSPESi9f2c9pgdI1ieJww2NnI/ApEk8GuxuJ0SMes+JozhPBS4bv+tor6v1mpPM ce8aBGONdNWYuWnfMHUVAqTCLAIxdEnALo2tVJNi5ourHa0hRheDiVrkOrdUVkZMk67h l+7JAgtS9DpVJVGAQ/WdMzp4FHK6Qhe1XzPnNn+aQPWJK2pZnW3RedGtMZAnBQe+fcBc ZfKUCBqYw/lSKU7quvPLZUbtteipFAVAuxWdYUOY3jTt1IBlhVVOFEe0QFe8ATw7t5AD gpmw== X-Gm-Message-State: APjAAAUI8gl2tXsKOAN/4wT4XEeaWhKmC5UNYsFk0FlrONAwxyEe4+Re fAyH2p0c6DwlGHlwbWImCDFcnlD0opE493XNpGWhUA== X-Google-Smtp-Source: APXvYqzweGueoFODLowkOqbCd3G32HE6+yxX+htK2+5o3SP7gVmnX8FXKcxjv8ncjZ8geW5s08nwbn+LWHONStSPghY= X-Received: by 2002:ac8:431e:: with SMTP id z30mr59662435qtm.291.1560174555070; Mon, 10 Jun 2019 06:49:15 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> In-Reply-To: From: Warner Losh Date: Mon, 10 Jun 2019 07:49:02 -0600 Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: "Conrad E. Meyer" Cc: Tijl Coosemans , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: C7ED57456A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 13:49:16 -0000 On Mon, Jun 10, 2019, 7:44 AM Conrad Meyer wrote: > On Mon, Jun 10, 2019 at 2:10 AM T=C4=B3l Coosemans wro= te: > > On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin > > wrote: > > > ... > > > URL: https://svnweb.freebsd.org/changeset/base/348847 > > > Log: > > > Use C11 anonymous unions. > > > > > > Modified: head/sys/sys/ucred.h > > ... > > > > Isn't this a userland header that should work with non-C11 compilers? > > Hi Tijl, > > Why would one expect userland headers to work with non-C11 (gnu89) > compilers? > Because those compilers can choose non c11 variants of the language? Warner > From owner-svn-src-head@freebsd.org Mon Jun 10 14:19:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B0E15C0776; Mon, 10 Jun 2019 14:19:59 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D808A754E4; Mon, 10 Jun 2019 14:19:58 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-oi1-x242.google.com with SMTP id e189so6332250oib.11; Mon, 10 Jun 2019 07:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=7KCGBB0pnkjWRrWFLi5sXN/Z/zEoLBQ5v+E0bTvu05o=; b=bxj+FflYCcVus0PTNDuP658OGW4F1ww2vOYhsWzBrZBITlihypyD4hdWw1MvUakapU 6BLTGI3LtEXA4bJNoMi44q22NHz+gqWVW6sY+aMDzsCPk32GF430ZW4O3MoiDugmbijY 22/tateN6m0P2uLSWsYYWrfBkPtMNMCv/jSaH4d7ABsx4hKgpdoPUEvsPrwR3Ai9jJVx 1IzgcHJwaiyo2gyyTgzi+BHrgBe/fKqNn7R59k/30jgWJNLRrFEyBpBgNWMWHV/znFYc zQ3AV8h/RsUAhOqETXF5b9pMcJc14+kDsCmiGufz/ubrgbmiwUft7VnKL/6e6NXQujCX huGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=7KCGBB0pnkjWRrWFLi5sXN/Z/zEoLBQ5v+E0bTvu05o=; b=Fogg+EYM80OgsyB+3+VKzzEdZ6B0DqyLVYL51qGSxi5BKL3Pby89kpYDePBmtjhmLx eO/tcU7O+iq5cIyeWGlVLH+jqAnYZfUnyfq2WNdCHP581QKjyA9dUqNBtNy8pnaUGAwM BLGH4ASaKvejWVLg2Sqkrf8Xm5el3DW4eQMSLij0U9k3oUeeuSiI4KjjpnQM6lzU9/iZ TFfdwQO3h/DiJJEzIHNTbX83m0I6Av5yVKpHczIfG82wPkauS8hZuijcyj3rBKKhY5Cw 7pKGfnZsRu37lYBGg8o92RdtLXsoSOZaxJFSfJ1N1mN0qJXECn6cnsIIbC9CsUddIxg6 aZqw== X-Gm-Message-State: APjAAAUZAYdneOYlWhzLjp4ngUQbI2V4KoL51ToBPRdYhtiINpRkdwpC xmf7V5ym/RGb8gQrJ0S31j80n8bz4Ks= X-Google-Smtp-Source: APXvYqyHuZJvPPkevy2szU9Xo9vDDy3DDzSxzesCeNtCbXhnRSF2/OQhW88lc/9CnnXKmslSFe8gKw== X-Received: by 2002:aca:ab57:: with SMTP id u84mr12441025oie.61.1560176397654; Mon, 10 Jun 2019 07:19:57 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id w17sm1351453oia.24.2019.06.10.07.19.56 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 07:19:57 -0700 (PDT) From: Doug Moore X-Google-Original-From: Doug Moore Subject: Re: svn commit: r348843 - head/sys/vm To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> Message-ID: Date: Mon, 10 Jun 2019 09:19:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: D808A754E4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 14:19:59 -0000 This comment appears in vm_mmap.c:      * Mapping of length 0 is only allowed for old binaries. and my intent was to say, to whoever wrote that comment, that I was not disallowing the mapping of length zero with this change.  I was only intending to affect a case in which the length was transformed to zero, and which was the problem that Peter Holm reported. Doug Moore On 6/10/19 8:00 AM, Shawn Webb wrote: > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: >> Author: dougm >> Date: Mon Jun 10 03:07:10 2019 >> New Revision: 348843 >> URL: https://svnweb.freebsd.org/changeset/base/348843 >> >> Log: >> There are times when a len==0 parameter to mmap is okay. But on a >> 32-bit machine, a len parameter just a few bytes short of 4G, rounded >> up to a page boundary and hitting zero then, is not okay. Return >> failure in that case. >> >> Reported by: pho >> Reviewed by: alc, kib (mentor) >> Tested by: pho >> Differential Revision: https://reviews.freebsd.org/D20580 >> >> Modified: >> head/sys/vm/vm_mmap.c >> >> Modified: head/sys/vm/vm_mmap.c >> ============================================================================== >> --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) >> +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) >> @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s >> >> /* Adjust size for rounding (on both ends). */ >> size += pageoff; /* low end... */ >> - size = (vm_size_t) round_page(size); /* hi end */ >> + /* Check for rounding up to zero. */ >> + if (round_page(size) < size) >> + return (EINVAL); > The mmap(2) manpage says that len==0 results in EINVAL, so the manpage > needs updating. > > I'm curious what "there are times" refers to. Can you or the original > reporter elaborate those cases? > > Thanks a lot! > From owner-svn-src-head@freebsd.org Mon Jun 10 14:27:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68E2515C09D7 for ; Mon, 10 Jun 2019 14:27:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 079DC759AB for ; Mon, 10 Jun 2019 14:27:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x841.google.com with SMTP id x47so10753420qtk.11 for ; Mon, 10 Jun 2019 07:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kVRUUM0Nz5KP6DmeStNXbEz7R8CCtid8iDOCIJ+JkUQ=; b=KcKaeRUfgHYhkLbdUTRF4k0EcefX4P2mpjo0KfaWmFwt1z3CCbI9SKKh6eozN0EPzO lgVse1mJb2/ez9ulCm89jCb9cvtsrFTKEF2RAhMI20LOqxpotaBaego0f8T4aw9eAcBm ohgyGbxn/i3hcCmyCnG0cek/SSadqmiW5jptffn3WdTI8MOifr5/uMqQQhylnF/G8YKl e5bZbbS7iuarAw9Abo1ROYEAANKqUymC4eGRhPQKWKpiyjED/UR0uAf7hNqQasM0YWH8 kgKoesV2xtT1mv3ZyCO/2rwSwrR3+KZV5WU6StEP0LhSqyDl9lOdpSzfRTx0zPiCJ5+v 9H0g== 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=kVRUUM0Nz5KP6DmeStNXbEz7R8CCtid8iDOCIJ+JkUQ=; b=krRqt/hKGpjCnZ7LQNyKPsfMbxJRoaN/LQ3Cc2Cf7rN3RUCvDOYG8qNqXjWiR8TOEj qxhDnvWCROsyOzpcEKN74JnfhC2gDzDvTVGuvq6+37l3cDoKEt6cZXPIX6TXAqeJKqSn J4jbpsNOpSLDbECqG9YlnLKFunEZ9fMgeKaOMs3/RnN9y1mn8OfdaECoq+HJlmmHO/KB ixCp+fKvaPK7fLPrBHIX3n5qRgC1KyK++jlA+cknlxV/LzI8X1sT7kHHEbiNuzWSyP4q 58TFvKN6YCCuMur4sNUxMBSVV3+GzjUBivdCPkUzzE9LDpyWHdNRUkT5MNTcAki0C0Hc R27g== X-Gm-Message-State: APjAAAUm+gKFjZnRZrzIjaInYhtMdxmgFqU22kNr10Nj+rSqMFVrOrWa ZxUjFpcjGBaDSQSD6C+ewnV9bQ== X-Google-Smtp-Source: APXvYqzJlyZKUbfvbzXUn7gtsxLddpJt9AvvI4+KmT5+gZdQ6+U6Qg7X2DsOMtxHGOB6GzZ9WJLVEw== X-Received: by 2002:ac8:96e:: with SMTP id z43mr59126687qth.55.1560176836328; Mon, 10 Jun 2019 07:27:16 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id p37sm6449996qtc.35.2019.06.10.07.27.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 07:27:15 -0700 (PDT) Date: Mon, 10 Jun 2019 10:27:15 -0400 From: Shawn Webb To: Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm Message-ID: <20190610142715.be254wljfrnetuom@mutt-hbsd> References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qtmrtafjtenr6vop" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 079DC759AB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 14:27:17 -0000 --qtmrtafjtenr6vop Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sounds good! I think the manpage still might still need a change to match the current behavior, or perhaps matching something similar to that vm_mmap.c comment. But that comment brings another question: what's the definition of "old binaries"? a.out? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 On Mon, Jun 10, 2019 at 09:19:55AM -0500, Doug Moore wrote: > This comment appears in vm_mmap.c: >=20 > ???? * Mapping of length 0 is only allowed for old binaries. >=20 > and my intent was to say, to whoever wrote that comment, that I was not > disallowing the mapping of length zero with this change.? I was only > intending to affect a case in which the length was transformed to zero, > and which was the problem that Peter Holm reported. >=20 > Doug Moore >=20 > On 6/10/19 8:00 AM, Shawn Webb wrote: > > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: > >> Author: dougm > >> Date: Mon Jun 10 03:07:10 2019 > >> New Revision: 348843 > >> URL: https://svnweb.freebsd.org/changeset/base/348843 > >> > >> Log: > >> There are times when a len=3D=3D0 parameter to mmap is okay. But on a > >> 32-bit machine, a len parameter just a few bytes short of 4G, rounded > >> up to a page boundary and hitting zero then, is not okay. Return > >> failure in that case. > >> =20 > >> Reported by: pho > >> Reviewed by: alc, kib (mentor) > >> Tested by: pho > >> Differential Revision: https://reviews.freebsd.org/D20580 > >> > >> Modified: > >> head/sys/vm/vm_mmap.c > >> > >> Modified: head/sys/vm/vm_mmap.c > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > >> +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > >> @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, siz= e_t s > >> =20 > >> /* Adjust size for rounding (on both ends). */ > >> size +=3D pageoff; /* low end... */ > >> - size =3D (vm_size_t) round_page(size); /* hi end */ > >> + /* Check for rounding up to zero. */ > >> + if (round_page(size) < size) > >> + return (EINVAL); > > The mmap(2) manpage says that len=3D=3D0 results in EINVAL, so the manp= age > > needs updating. > > > > I'm curious what "there are times" refers to. Can you or the original > > reporter elaborate those cases? > > > > Thanks a lot! > > --qtmrtafjtenr6vop Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz+aL4ACgkQ/y5nonf4 4fp98A//SC8qaENnvUk/upV7gKz/oMYmqXIhvHXZMJgiXymtdRZKRW7RMVQrRYmb gbtl9uNLSbLKI88LILJ/0YjXxRieT2e+UaNHkwzitco+fkeUr9LhbqVOuGxPOpWs J9ckPPtZjvVpUXAjt43LC4s2OlM0zs1mpcq/e7Xw7bYHrUO0c6dPGhgCQGvxdWD1 EYnOsNF2n7Us+rpviVTeQVWyESXEkRGhNLKu9/OwVFiUUHGM6vvL5K7A8OEpaU62 8uabKumD3ZnrTJspAXWOBF31EzzzP41wR+yWekdlvdkS5gutBj0XNQ/XBhLQmIBe JCtjKRLHdXAWqfF3kGQs8xCYjlSiF677dDVSrC29lTO98oXcC0Q5HWPkuOxqPQCR ySjfst/6L+R/CnTwFlQpHfaMY5oPJ/qqlDhzvtKmAa/jnoe1Qszc6mRU8hRXmqdn rC4Bk9PnUjxpAu172zJNNP0T6pBi+3bZSbjU6GhPGnifxOy8RV7EEp8ktJ79WJZA cb+SCPGDTjnBElI/kYK54sJy0/t2radwsc/7DxOJiuE7fO/Pu9MkiwoKWFjs4OZw VVZgoFOxXEvb8nWkddEyBGWhYPjU4TgWMv9MBCKHlA+5fNQcXtBroYpg/AcxAUCA I0ZYpeMrqb9fC3XLPtkZMFFUqbQYT6tpT4PQX6KYWYHWTsDoS8g= =Tqvi -----END PGP SIGNATURE----- --qtmrtafjtenr6vop-- From owner-svn-src-head@freebsd.org Mon Jun 10 14:31:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B8D15C0C09; Mon, 10 Jun 2019 14:31:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B7975D1B; Mon, 10 Jun 2019 14:31:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5B61B7FA; Mon, 10 Jun 2019 14:31:19 +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 x5AEVIL9057401; Mon, 10 Jun 2019 14:31:18 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AEVIre057400; Mon, 10 Jun 2019 14:31:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906101431.x5AEVIre057400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 10 Jun 2019 14:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348861 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 348861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35B7975D1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 14:31:19 -0000 Author: bz Date: Mon Jun 10 14:31:18 2019 New Revision: 348861 URL: https://svnweb.freebsd.org/changeset/base/348861 Log: Enhance the comment ieee80211_add_channel() to avoid a misunderstanding that the function does not work additive when repeatedly called for diffferent bands. Reviewed by: avos (a few months ago) MFC after: 2 weeks Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Mon Jun 10 13:46:36 2019 (r348860) +++ head/sys/net80211/ieee80211.c Mon Jun 10 14:31:18 2019 (r348861) @@ -1386,6 +1386,8 @@ getflags(const uint8_t bands[], uint32_t flags[], int /* * Add one 20 MHz channel into specified channel list. + * You MUST NOT mix bands when calling this. It will not add 5ghz + * channels if you have any B/G/N band bit set. */ /* XXX VHT */ int From owner-svn-src-head@freebsd.org Mon Jun 10 14:42:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F0115C137C; Mon, 10 Jun 2019 14:42:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE44C76692; Mon, 10 Jun 2019 14:42:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f195.google.com with SMTP id m3so13659512itl.1; Mon, 10 Jun 2019 07:42:36 -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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=T14frFXjUO8K7L1Jz+ryXYmE3UUCTu8tT9R+uE2TO3I=; b=hdUP+SrvOl1Z0z48IU31+y10KJdl7MJ0VRruV5G68ye3JdEPgBoE3Ek3WoLC4Jq6ff FCNakwLMJLVUNwJwW5cmUhyGggb44PENq24x3P47LxSz4TK8ijnrl76Iss8Jtq1zsxwP 1++NN89aMndzz11eRt7+tmq2lMAlP8ZK7/hdRRwLppX+nYyPqDfnxf9khpKlekksVJUl fIbulHD9FUrny25Pz8VLjxb3uLYNOd2d9CR2Gj1mITHPPn7y/7JMhzeaaJ/ztQeT9FYh 7ryC25peGPMTUuMrwaOZNoPwBvFfHkXFEnaBS8DSYo5RFRQU5yCfmu7r2Yj1TJDEEEWw La1A== X-Gm-Message-State: APjAAAU904wZZo+sVO+G0PYAThFj8e5As0d4ChAEFNthFbF8aKl9P8xA oSqgOBqG05EHc60bmwgNJ1SHwnpG X-Google-Smtp-Source: APXvYqyTG4F6bvYHzjcJQiOtl3+VhivZ7FpEyNwML+DLL/XVlx+jrtJH/BaJQl66fZxZtRPgcTx5Qg== X-Received: by 2002:a24:dd8f:: with SMTP id t137mr14370555itf.35.1560177749943; Mon, 10 Jun 2019 07:42:29 -0700 (PDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com. [209.85.166.50]) by smtp.gmail.com with ESMTPSA id g124sm4824765itg.12.2019.06.10.07.42.29 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 07:42:29 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id k13so7064634iop.5; Mon, 10 Jun 2019 07:42:29 -0700 (PDT) X-Received: by 2002:a5d:85c3:: with SMTP id e3mr7914054ios.265.1560177749298; Mon, 10 Jun 2019 07:42:29 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 10 Jun 2019 07:42:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: AE44C76692 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 14:42:37 -0000 Hi Warner, That doesn't seem responsive to the question. On Mon, Jun 10, 2019 at 6:49 AM Warner Losh wrote: > > > > On Mon, Jun 10, 2019, 7:44 AM Conrad Meyer wrote: >> >> On Mon, Jun 10, 2019 at 2:10 AM T=C4=B3l Coosemans wr= ote: >> > On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin >> > wrote: >> > > ... >> > > URL: https://svnweb.freebsd.org/changeset/base/348847 >> > > Log: >> > > Use C11 anonymous unions. >> > > >> > > Modified: head/sys/sys/ucred.h >> > ... >> > >> > Isn't this a userland header that should work with non-C11 compilers? >> >> Hi Tijl, >> >> Why would one expect userland headers to work with non-C11 (gnu89) compi= lers? > > > Because those compilers can choose non c11 variants of the language? > > Warner From owner-svn-src-head@freebsd.org Mon Jun 10 14:57:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 646FB15C1757; Mon, 10 Jun 2019 14:57:59 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA0FE76D4D; Mon, 10 Jun 2019 14:57:58 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-ot1-x342.google.com with SMTP id r10so8576841otd.4; Mon, 10 Jun 2019 07:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=OV8FWWL8HIgUlN+Zo0fZow/rI+SxGtVYRxTa4qTFQ2Q=; b=Atml7IEPRY0d5EPcb2fdQ+FmT4DpkpiumLvCZgXX3zqqQIIvJyfn0/IelaoolpK2vr ZVKGSTVPGuODWlfbhvhSGfteVvdxjIeUV0ho7d2XQivvd6ZG8B1wlDy4xI+FIfWTjBhr qb4aFmc62E35edIYbOVdt+3iXOq9ODmaRXVYqxdAnaKSdK5wTdPJ26wY0ftObfoCCPG5 hnLLWnJgsEAKr3QFFZxK2SrP4veGp/oc11t6Oz1zOt8Jz39uSy2F8UodBr9uip+J7lN2 /TenLHRuvbi2KIJbNdUU2wou33sUmVNzId6fMu2niv/nX/roQ1dAyxk/UZrZt7iLbLQV jJLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=OV8FWWL8HIgUlN+Zo0fZow/rI+SxGtVYRxTa4qTFQ2Q=; b=CyLKg7o+YBLwjGhomxmUDF7mvyJ6mt9m2VnmEjhIdv3wawQxr0ZaMFeadWD2bTBfLO XKdE3XSPhgHAdmBndeSwSEw8xHVYLtqfexPXB1ynUMO89zbJJO2KN0dkDVJzDlLI6dk6 a4mQiz8ZDiWqDxDOm3XXi8N57cCGbYmQ7aSfYRgGAZhSK03f4H4P5Wsz0ghqC7WNmj6J woQ7WurpDBw7O5EuFDsSTUcJQomiHVPWT5JnrXcx753RGkEHaQbxjzwQ3zUqG+GDqIOV IJ9qaNoLDVc8DO/O1wiEddCmAwzY3b9k6+Y2mUpfiE+RzI+v40gDBZpsi3vQ2z8EP2cY 1K/Q== X-Gm-Message-State: APjAAAXYRXIWblSt14rG+8EcHKhGmIDdUGTQyCVUsjPLjhtwTbHqMhbN bKx9sGF6/ERpwyWYTb6g0aRNAU7nV+U= X-Google-Smtp-Source: APXvYqwtZAyVMim/gUZ2/zlRGJRA3CuobgjOYaNNlU8LbvLmxrZEqDChMAmSu26+rUrrAipr+iIQtw== X-Received: by 2002:a05:6830:148c:: with SMTP id s12mr1920281otq.274.1560178677827; Mon, 10 Jun 2019 07:57:57 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id s64sm4084029oie.40.2019.06.10.07.57.57 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 07:57:57 -0700 (PDT) Subject: Re: svn commit: r348843 - head/sys/vm To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> <20190610142715.be254wljfrnetuom@mutt-hbsd> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=unkadoug@gmail.com; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0MERvdWcgTW9vcmUgKHd3dy5mcmVlYnNkLm9yZykgPGRvdWdtQGZyZWVic2Qub3JnPokB UgQTAQoAPBYhBHleNTGSVgOuQpfeg+iPIVPTudVuBQJcyljBAhsDBQkFo5qAAwsJCAUVCgkI CwUWAwIBAAIeAQIXgAAKCRDojyFT07nVbs4lB/49oHwi3YR7SQr43+59tBudmf3WdQ1SRi3G vJDufsrtsB7E9bIFXwFGvVDOMn/cfhNlzors3aM6UQr1N3TPqMAK4TaS12qGL3EvFQ0eVAF1 J+vhQCIjZtgFaCIjoPeQVbi2tVsHaCttBRJeHRIPruWlxngSGZ7eMfjlOY9Oupi809QjFO/3 7FHv+/Bw9HvzlUciY3wH6vLe4zE3Bhqz4lrQAAKey4XPwKwUgs7QK0qhHrlxy+mD0r8LYvwE +Y7WVu5bbDPbyWYZeI8rnCCKnoJ7VFxQd2/g3Jxc1alDg5LoHCssP7z8g9OG8GBXk1T5dRrA Vxlc8Rs3gSxg6b3+lt+CuQENBFy53VQBCADbHDoIQCMsyFFaNjzqZbrd8ntaMwpQ6hBL7Rnb LJSHa8jehZYyAdtWWbbttyVf66J3EAF6HyBXExw9fryuLU+yZfANI0D3cmmb51jCG6Bu8Nnk QTOf3N7cw1sYQSHH2PQlhWYc55Jbu/aJrwfVnEchLdbN8p2y4WXRLfhK32iOaQzMM2xHNk28 sXnAV5DRxQjvXY7IG7cT5Pfr2uAhXqPDDCZsMj9ghZ3aQyvr7q7jS1uzvSPsimOW4Hf9fJqi VxF2kMRH1hQNe1I4v79SaFtDXRSuYivEPV6epifWATwY66/U/jO55TqqDyFz/Bg+2CCpHyyZ GM9A+f86VxLEGc7hABEBAAGJATwEGAEIACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLnd VAIbDAUJBaOagAAKCRDojyFT07nVbkhiB/0SVq6YcYwrz1j1lBUk7DCUPVALoNSiW4iNia52 7pWQdHGtsTVVCiEcB65qZo0DSrMsAvtGCRSzUebIQ6omDSDnWmbveXykr3vO0+pcRqsJPQKc ATRq2XjcBjZMKOD4A2XOS2t3hAM+oY4F9htQIY9gnvK6RdTtyafJonHpeeNkMC7KEwPGS6hz FU0lrfZxXQ1ipj0QOOgZ8ZomMXbSV5f8GwYSULMPOVmB9ak0ZCOoa451h0o3Hjcnrngw7ofF JFPbmPT2zbpXOm9PqshzTA10ngIETm2x4j5iVvCHEbOJCH8UQydNKrGFa3UBzqj1OoxAggqh CFx6S9PsRfm6+86cuQENBFy6y/MBCAC+ULdDmJZVs7GFnpBdKJnSnVIbX1dkGju1jkvg+7pA 82yX+0hZvIOh0x3Py8asbfqxFleVws59mGEAe5YpRyg+kn0fd14ethlIrsf0sG82b7QLyf9p xGuQBlhyHvgDgdeUGlz6kybVJ9e59ebtNYgjuEC/Glf/b55pmmkSXx5F/4l82Er7fhpiOg42 n7CLonP+AxLsR8L6AjCODedyKidSopcdH8dH6RTN9CmIYSPQq8vRiARrDLNvVQH4PQlv3s4C KqP6zSN3hMdLlLtvgd6UMdyuWKxRk0y0WhGa4bZ8oKPCo5Dr6o12OSEvx+Ue2QBQ67nVY5H6 SoCoopHHomeRABEBAAGJAtIEGAEKACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLrL8wIb AgUJBaOagAGgCRDojyFT07nVbsDUIAQZAQoAfRYhBH6QdtAAogUD++RrUKO0e1Y/oUusBQJc usvzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9wZW5wZ3AuZmlmdGhob3JzZW1h bi5uZXQ3RTkwNzZEMDAwQTIwNTAzRkJFNDZCNTBBM0I0N0I1NjNGQTE0QkFDAAoJEKO0e1Y/ oUusp/AH/0kmG5bylgh6Crg307jXoCQgZvtThaB9LGmf57ypUvnfrwt1n0Ex7cKcQnvSA+12 809K12QmR5D61AdU8HBaQdoLFj0rDi34raxgAY554+YiGuj9XagPEKMeb+iuvqvhetC6v7K8 eXqpaWIozIpFJCmElxGMSngAj/V6nOnm6XDSyfgaOCmnjOQRqe49uU+6R67gb7UB4J+XJHgP Wla91BTqsv3NLcwXINqP+iiHtgMLmrH1j0eNhxOk9+RLNf0YbZcGZHf7eWjcJbWcB13e0gF6 mR0RcQxClm89EVv2p+CPITpXTALrIb1/EX9O4bz9OuzdZk5FrWAUNHStBE6+McJz9Qf9Hs+Z vDizuv8NOX2YZeKRdBpWSsKRL32DkPrup6vMDVL1LIft3SJXLc+oWvy82fAm0HuGMXHq47Zc bvmHUJfnSrdhjHSB35R3BwzYZ4/lINDR90WgKw+NJNErmiIP3oPzlVNtLsQmAXXjAdysFuq6 VSW0TclJVIiBjLgnKvh0XzakzxdZ5pVpgCHzKggO+53lRhEkQIgLTRU0bVb/BQkqa8iGwUhB dGd4Sgy9sykO8/1C8ApYrsT51iG7956YWG14NOBuHXoBsdynCTAVYwSR7+7f3enNKzEpUKtg ALG/tpjXzp8gsOtBSlComvjQjZHfWe9+fLy2wJ98wi8q0n3xHA== Message-ID: <65cab520-731a-3256-8a71-bb8cfcc93011@gmail.com> Date: Mon, 10 Jun 2019 09:57:56 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190610142715.be254wljfrnetuom@mutt-hbsd> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Rspamd-Queue-Id: BA0FE76D4D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 14:57:59 -0000 The comment and the code that rejects size=3D=3D0, or doesn't, are copied= below.=A0 Konstantin Belousov is the last person to have touched most of it, and can better explain its meaning than I. Doug Moore =A0=A0=A0 /* =A0=A0=A0 =A0* Enforce the constraints. =A0=A0=A0 =A0* Mapping of length 0 is only allowed for old binaries. =A0=A0=A0 =A0* Anonymous mapping shall specify -1 as filedescriptor and =A0=A0=A0 =A0* zero position for new code. Be nice to ancient a.out =A0=A0=A0 =A0* binaries and correct pos for anonymous mapping, since old =A0=A0=A0 =A0* ld.so sometimes issues anonymous map requests with non-zer= o =A0=A0=A0 =A0* pos. =A0=A0=A0 =A0*/ =A0=A0=A0 if (!SV_CURPROC_FLAG(SV_AOUT)) { =A0=A0=A0 =A0=A0=A0 if ((size =3D=3D 0 && curproc->p_osrel >=3D P_OSREL_M= AP_ANON) || =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ((flags & MAP_ANON) !=3D 0 && (fd !=3D -1 |= | pos !=3D 0))) =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 return (EINVAL); =A0=A0=A0 } else { =A0=A0=A0 =A0=A0=A0 if ((flags & MAP_ANON) !=3D 0) =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 pos =3D 0; =A0=A0=A0 } On 6/10/19 9:27 AM, Shawn Webb wrote: > Sounds good! I think the manpage still might still need a change > to match the current behavior, or perhaps matching something similar > to that vm_mmap.c comment. But that comment brings another question: > what's the definition of "old binaries"? a.out? > > Thanks, > From owner-svn-src-head@freebsd.org Mon Jun 10 15:03:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA60C15C1969 for ; Mon, 10 Jun 2019 15:03:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 220817716C for ; Mon, 10 Jun 2019 15:03:04 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1560178978; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=TvyjMImqQr5aHkcIYsAazDeqKS+bkGZQaISPmpZEIXZdc0UfWxVu8Q6v7jqeKE2qvOEJZ2B+WiP9h 1ZB7gQu8lBA46b+RB9v3P14xhagX2qzV8XR/BO/cEV62W6ZenfhV821whAI48ooAkUvcqmHfUN7NIB qCzByfH3I60I2TjJ3QeEwduZjsj5tY7cCgcFxAcMTFiZhmLNfXJe2ZfLkGXe21ZCLDHPIL2SYx9GnM zJlo6ROT9gfzZN9P4iCp1uC8kwPjU9Q1mcJGPi+x9XqmwLHjys7imXKc6CMeQcSzF0lf7+9d4RkR2H 2NPAYKLKbWDx7YkHbaoLKgTBH05rxsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=R9i3lO7JrqtAhhGre0IpWylWEL5819Ni66n+Kw4olkE=; b=UTznR7oSspH4NqoEI0KYM2TTAAE2y7p5PR8DbSPdfo99NEhIu7wOdMwmo0cju7h6/ahSMLsSw/CO7 FfQBWUK67g0KL/6cm+64g8GuMbUcn3Vczbyoa0RPTrM6DAgJuEWVVaCiIMnypDk1nQoHvhTw+8oeGl NbnHNj2TB4VoUyK+pOLn3N9Hz64jeCKLd4As9uDgZvoHXLzrc9cnOOH0taIBvz52ygxnJ4557d2y8N 5K9iEIL3dya5kbytU2sad6Dg/XSOLAoHEiYnUekpnbvImO5c8LzfliKqjlSw7BMdpMzvVE0Ktm34F3 rHAqzheRhPS4uT220G4cMEZdKXWNtEw== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=R9i3lO7JrqtAhhGre0IpWylWEL5819Ni66n+Kw4olkE=; b=pHultbCdbCy2jV0InfACrhHOUlUC58oNqro/AqC8gK4kAcoavvOeaJEw31WObCtBl1+2OP1WYfmNR bEb3jas5G0l41sKySdGL0Z1vrZGqxcktaPgLQHSsvDM9ge1eHU+55zHzJbbEQrq5xs+8ULblNOgqx+ 82ttGRBjodTtyXBiA5cJO3hL9dBt3U5xSXFCVeuT6EZDJ9WCYb+vFOTyBIE7zQdKAkP4WkOlfTN2zn QG8FJwoVEpz6BeK1NWupsKdipApK6NFP5lvlrQZaMzv1WQ4gmyUYH0aAGoN/hDiRHoFVQ7vaL2YO6h fTpU0mhlUpUlArqezGoK1ZKveW8r3Sw== X-MHO-RoutePath: aGlwcGll X-MHO-User: d3b7eddc-8b90-11e9-b39a-9d2c53d3dedb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id d3b7eddc-8b90-11e9-b39a-9d2c53d3dedb; Mon, 10 Jun 2019 15:02:56 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x5AF2tSX084496; Mon, 10 Jun 2019 09:02:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys From: Ian Lepore To: Warner Losh , "Conrad E. Meyer" Cc: Tijl Coosemans , src-committers , svn-src-all , svn-src-head Date: Mon, 10 Jun 2019 09:02:55 -0600 In-Reply-To: References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 220817716C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 15:03:06 -0000 On Mon, 2019-06-10 at 07:49 -0600, Warner Losh wrote: > On Mon, Jun 10, 2019, 7:44 AM Conrad Meyer wrote: > > > On Mon, Jun 10, 2019 at 2:10 AM Tijl Coosemans > > wrote: > > > On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin > > > wrote: > > > > ... > > > > URL: https://svnweb.freebsd.org/changeset/base/348847 > > > > Log: > > > > Use C11 anonymous unions. > > > > > > > > Modified: head/sys/sys/ucred.h > > > > > > ... > > > > > > Isn't this a userland header that should work with non-C11 > > > compilers? > > > > Hi Tijl, > > > > Why would one expect userland headers to work with non-C11 (gnu89) > > compilers? > > > > Because those compilers can choose non c11 variants of the language? > > Warner > Do we promise that userland will compile with -std=c89? I hope not. Anonymous unions may be a c11 feature, but they're also available with -std=gnu99, which I think is how we compile userland. I think -std=gnu99 is how we should also compile the kernel, and I think Bruce has been trying to say that for several years (but I'm not sure, because the emails that seem to say so are always so full of semi-related extraneous material that it's hard to be sure what they're saying). -- Ian From owner-svn-src-head@freebsd.org Mon Jun 10 15:21:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A45F15C20E9; Mon, 10 Jun 2019 15:21:18 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay118.isp.belgacom.be (mailrelay118.isp.belgacom.be [195.238.20.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAAE77BC1; Mon, 10 Jun 2019 15:21:17 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BTAABTdP5c/1H1sVtmGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBUwMBAQEBCwEBgg9ZEVIgEhQUhBWIe4l3AQGCDDUBigiOIoF?= =?us-ascii?q?7CQEBAgEBAQEBKwwBAYFLgnUCgnMkNgcOAQMBAQUBAQEBBG0cDEIBDAGEewE?= =?us-ascii?q?FIzMjEAsOCgICBSECAg9IBhODI4IOC6dJgTGEMgELAYRdgQoGgQwoAYtzgX+?= =?us-ascii?q?EIz6ERIMKglgEqScJghGGRIxyJ5cbhAqQHJElAy6BWE0wCIMnixOFQT0DMII?= =?us-ascii?q?ajgkBAQ?= X-IPAS-Result: =?us-ascii?q?A2BTAABTdP5c/1H1sVtmGgEBAQEBAgEBAQEHAgEBAQGBU?= =?us-ascii?q?wMBAQEBCwEBgg9ZEVIgEhQUhBWIe4l3AQGCDDUBigiOIoF7CQEBAgEBAQEBK?= =?us-ascii?q?wwBAYFLgnUCgnMkNgcOAQMBAQUBAQEBBG0cDEIBDAGEewEFIzMjEAsOCgICB?= =?us-ascii?q?SECAg9IBhODI4IOC6dJgTGEMgELAYRdgQoGgQwoAYtzgX+EIz6ERIMKglgEq?= =?us-ascii?q?ScJghGGRIxyJ5cbhAqQHJElAy6BWE0wCIMnixOFQT0DMIIajgkBAQ?= Received: from 81.245-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.245.81]) by relay.skynet.be with ESMTP; 10 Jun 2019 17:20:07 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id x5AFK6ot010221; Mon, 10 Jun 2019 17:20:06 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Mon, 10 Jun 2019 17:20:05 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <20190610172005.18bb0de4@kalimero.tijl.coosemans.org> In-Reply-To: References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 3CAAE77BC1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 15:21:18 -0000 On Mon, 10 Jun 2019 06:43:26 -0700 Conrad Meyer wrote: > On Mon, Jun 10, 2019 at 2:10 AM T=C4=B3l Coosemans wro= te: >> On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin >> wrote: >>> ... >>> URL: https://svnweb.freebsd.org/changeset/base/348847 >>> Log: >>> Use C11 anonymous unions. >>> >>> Modified: head/sys/sys/ucred.h >> ... >> >> Isn't this a userland header that should work with non-C11 compilers? >=20 > Why would one expect userland headers to work with non-C11 (gnu89) > compilers? I'm thinking of third party software compiled with third party compilers. The system headers need to work with various C and C++ standards. struct xucred is part of a public API documented in unix(4). From owner-svn-src-head@freebsd.org Mon Jun 10 15:33:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F56415C23F8; Mon, 10 Jun 2019 15:33:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7A780266; Mon, 10 Jun 2019 15:33:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 630293DF311; Tue, 11 Jun 2019 01:33:25 +1000 (AEST) Date: Tue, 11 Jun 2019 01:33:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Shawn Webb cc: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm In-Reply-To: <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> Message-ID: <20190611010531.A3253@besplex.bde.org> References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=49PTKM6K3fi4FU_zURsA:9 a=XhPod9kay0wDu7nv:21 a=zmuFhErOIJZMobcm:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 0E7A780266 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 15:33:38 -0000 On Mon, 10 Jun 2019, Shawn Webb wrote: > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: >> ... >> Log: >> There are times when a len==0 parameter to mmap is okay. But on a >> 32-bit machine, a len parameter just a few bytes short of 4G, rounded >> up to a page boundary and hitting zero then, is not okay. Return >> failure in that case. >> ... >> /* Adjust size for rounding (on both ends). */ >> size += pageoff; /* low end... */ >> - size = (vm_size_t) round_page(size); /* hi end */ >> + /* Check for rounding up to zero. */ >> + if (round_page(size) < size) >> + return (EINVAL); > > The mmap(2) manpage says that len==0 results in EINVAL, so the manpage > needs updating. The man page doesn't say that only len == 0 results in EINVAL, so it is not incorrect. However, the errno here is incorrect. POSIX specifies that the errno is ENOMEM if MAP_FIXED was specified, and the range [addr,addr+len) exceeds that allowed for the address space of the process; or, if MAP_FIXED was not specified and there is insufficient room in the address space to effect the mapping. There are 2 other meanings for ENOMEM in POSIX.1-2001. The man page documents ENOMEM, but only has a small fraction of the above case, and no other cases. It says that the errno is ENOMEM if MAP_FIXED was specified and the addr argument was not available, or MAP_ANON was specified and insufficient memory was available. Who knows what it means for the addr argument to be no available? The other cases specified by POSIX but not the man page are: (1) under the ML extension, if the mapping could not be locked... (1a) MAP_FIXED or MAP_PRIVATE was specified and the implementation does not support this (but FreeBSD does support this, at least for most file types). (2) under the TYM extension, not enough resources in the typed memory object designated by filedes... > I'm curious what "there are times" refers to. Can you or the original > reporter elaborate those cases? When len == 0 is actually a parameter, and with other parameters specifying that len == 0 is meaningful. The code has various style bugs starting with renaming the len parameter to a size parameter for a layered function. So it is not actually the len parameter that is adjusted, but adjusting it is still a style bug since it reuses a function parameter so the original parameter is harder to describe and to debug. Bruce From owner-svn-src-head@freebsd.org Mon Jun 10 15:39:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54BB915C24B2 for ; Mon, 10 Jun 2019 15:39:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB07C80484 for ; Mon, 10 Jun 2019 15:39:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-vk1-xa2d.google.com with SMTP id v69so1756473vke.0 for ; Mon, 10 Jun 2019 08:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tIo1ypD94PR8SSbexTEUrh16u4xIKaycns7OJHmcnX0=; b=BDWVHY7MMKSEZ8s8n470+e9JZ1zGeWFeUrE8l5jM0JWds10Jo+EE/Xwc7F7ZaF5XZ7 Db9FdqZTGX9x3wkfQdD/PVHg+QhHrFu7/dHuWfCh+17tzYKE9SHRbtT+ztxpN/2bJWK9 XbXaYqlqEmHytCuOU+JQpYnBdzJ1jsaWSgo+ppIEDvxlhjkOpEn+MK/WpSzi5VfI+hx5 aeL8sUfzTmUM7YVIXk8kQuLIQxNHTKn218JwbvG5FemUwaklyTu+WNQ2fRuMk7wuvSqS arBC5ZiSbieSr5JYUziAkH5DuIPp0gnLQk9z78bjb+PDBRLN0fgPVSVXMK/W4fMIx6sc yxAw== 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=tIo1ypD94PR8SSbexTEUrh16u4xIKaycns7OJHmcnX0=; b=blTPQWKTX3vcH1FK6cyuLDKIK5o3fTEGkXg5BVTPGqI6FjBPI6qDP+9/nARGZdYTVR y95vR+kkw9U3VonfDcsSLu+WOq2sz7S2kcYXx2fdWhu8dupHNSSeG41vwr+BnUE2U9Zt QBqTNsqdLmv+Ki8b7l6TK9w5j3X1CNI1QqC0eSskuwIaGSZf2oRTh9REU2dq/Gr14No6 p9I3DDc8uZbITFeMbWO66bY3ftOTVFL/2I1RTt9cXCor0gYexzEycuwSRzefKoojJfy8 UhxAg2a2arjjBZVnfpPZUoR9pgnIzNC/wC8+ossz6Ey5/aLVBiozGjJLmlMfZ7NQaMro OC+w== X-Gm-Message-State: APjAAAVs4Kwj+uRtdx8zt1OQYbc79Sjb1FeGO6MR/5C9ZUiIpT6pwYcU XthpxlaCoXOcvH2x8bKxg8wgwQ== X-Google-Smtp-Source: APXvYqzV0e6T0rs2m+MRUpdDoDvQEgMELLCDAbEB1OLJYYp6qcptR/b/IAcWJlL79BFju+yMVVfNpw== X-Received: by 2002:a1f:2dcf:: with SMTP id t198mr9913263vkt.27.1560181155738; Mon, 10 Jun 2019 08:39:15 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id v185sm2858615vkf.51.2019.06.10.08.39.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 08:39:14 -0700 (PDT) Date: Mon, 10 Jun 2019 11:39:14 -0400 From: Shawn Webb To: Bruce Evans Cc: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm Message-ID: <20190610153914.o2n5yjgfu3ubzbbt@mutt-hbsd> References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> <20190611010531.A3253@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lbusykrf4wkrwufc" Content-Disposition: inline In-Reply-To: <20190611010531.A3253@besplex.bde.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: CB07C80484 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 15:39:17 -0000 --lbusykrf4wkrwufc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2019 at 01:33:23AM +1000, Bruce Evans wrote: > On Mon, 10 Jun 2019, Shawn Webb wrote: >=20 > > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: > > > ... > > > Log: > > > There are times when a len=3D=3D0 parameter to mmap is okay. But on= a > > > 32-bit machine, a len parameter just a few bytes short of 4G, round= ed > > > up to a page boundary and hitting zero then, is not okay. Return > > > failure in that case. > > > ... > > > /* Adjust size for rounding (on both ends). */ > > > size +=3D pageoff; /* low end... */ > > > - size =3D (vm_size_t) round_page(size); /* hi end */ > > > + /* Check for rounding up to zero. */ > > > + if (round_page(size) < size) > > > + return (EINVAL); > >=20 > > The mmap(2) manpage says that len=3D=3D0 results in EINVAL, so the manp= age > > needs updating. >=20 > The man page doesn't say that only len =3D=3D 0 results in EINVAL, so it = is > not incorrect. https://github.com/freebsd/freebsd/blob/master/lib/libc/sys/mmap.2#L451-L455 Tons of error conditions listed, one of which is len=3D=3D0. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --lbusykrf4wkrwufc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz+eZ0ACgkQ/y5nonf4 4foGeg//ZvKETORITTUsmr6yvKYO8iaX5VhaH+XVcfGBdNtOUzrTSV7SkkSQHhAc 5GwH9QEjjWC2+auZjzMuaDMhXGsvAmCcEleHjUmrEDJOeshobVAUkAv8knAyCsRR NtBF55dBnI+xceCXZ3X24OUdDPlyod29cDHdcE/oQhogYspegk/IGHJfqNARH7qj 8NlOa0ZvjkpaKxn7PAXecZDqt9Yi6A8bh1pOxdJ1IloVx3KeI7Bb9LaLueS8Vmmj YPh5FYiLyJ53BReYySZyvYdpSor7GwijVFILND3JT4t4tiD3VuAtxLh1WBgrf4mp rWOPNgNH8Phz1/HnGoGE9fv3SArGqmLW/FRQZXH4T4FhHhyztqjok6yT/5DDNLbf WPYtfAGVf/+01HrYn0Zjr+uqSkJHjpQnTJDqih/hRx91YI0rukmmvJ+ab9+51zJV 3fmdBS3mmKP+5IM98dZGsFRuF0T1SyDAkFDJ+qojd3VZscTVCNcIFdIvNyeg4f+0 e1I0CzZJNpGxyX4wVO7Wp76A8Ju7vmBpxYfWk9ZKb6dZbYtOal/im1mqM0ljn7Oe kfNjI07ZJLxbQ3brtB8Gew30j9GWSl54+ZVoM4xLeu6Sr9l8v51dr0XtzYHcYgO8 /pvfAOm31nY+yEGBeUiFchrMTWhFIXvLgMQxq5l1u90kHfCzWso= =yRer -----END PGP SIGNATURE----- --lbusykrf4wkrwufc-- From owner-svn-src-head@freebsd.org Mon Jun 10 16:17:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EE0115C3380; Mon, 10 Jun 2019 16:17:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 73B0581EE1; Mon, 10 Jun 2019 16:17:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5D1102ADE14; Tue, 11 Jun 2019 02:16:53 +1000 (AEST) Date: Tue, 11 Jun 2019 02:16:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Warner Losh , "Conrad E. Meyer" , Tijl Coosemans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348847 - head/sys/sys In-Reply-To: Message-ID: <20190611013853.E3415@besplex.bde.org> References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=8f2riifyOPmppVszzmMA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 73B0581EE1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 16:17:04 -0000 On Mon, 10 Jun 2019, Ian Lepore wrote: > On Mon, 2019-06-10 at 07:49 -0600, Warner Losh wrote: >> On Mon, Jun 10, 2019, 7:44 AM Conrad Meyer wrote: >> >>> On Mon, Jun 10, 2019 at 2:10 AM T=C4=B3l Coosemans >>> wrote: >>>> On Mon, 10 Jun 2019 05:28:04 +0000 (UTC) Dmitry Chagin >>>> wrote: >>>>> ... >>>>> URL: https://svnweb.freebsd.org/changeset/base/348847 >>>>> Log: >>>>> Use C11 anonymous unions. >>>>> >>>>> Modified: head/sys/sys/ucred.h >>>> >>>> ... >>>> >>>> Isn't this a userland header that should work with non-C11 >>>> compilers? >>> ... >>> Why would one expect userland headers to work with non-C11 (gnu89) >>> compilers? >> ... >> Because those compilers can choose non c11 variants of the language? > > Do we promise that userland will compile with -std=3Dc89? I hope not. Only headers and libraries should support -std=3Dc89. has lots of support for compilers and POSIX versions going back to K&R C, and only the K&R parts are completely broken. FreeBSD also has the c89 and c99 utilities. These require c89 and c99 headers to work under FreeBSD. c89 uses CFLAGS -std=3Diso9899:199409 -pedantic. I don't see how a 1994 standard can be correct for c89, but -pedantic here might avoid the bug that -std=3Dcxx doesn't actually gives standard cxx, especially for clang. c99 uses -std=3Diso9899:1999 -pedantic. So anonymous unions are correctly disallowed by both c89 and c99. At least the following headers still compile with c89: sys/types.h, stdio.h, stdlib.h, the old version of sys/ucred.h. > Anonymous unions may be a c11 feature, but they're also available with > -std=3Dgnu99, which I think is how we compile userland. That is only the default, only for for parts of userland controlled by us. Non-FreeBSD makefiles get at most the POSIX CFLAGS (something like -O) from sys.mk if they use FreeBSD make, and something similar using gmake. > I think -std=3Dgnu99 is how we should also compile the kernel, and I > think Bruce has been trying to say that for several years (but I'm not > sure, because the emails that seem to say so are always so full of > semi-related extraneous material that it's hard to be sure what they're > saying). -std can be forced for kernel builds and other pure FreeBSD builds, but then it should be the correct one. bsd.sys.mk only directly supports the user selecting the following standard= s: - c89 or c90 - c94 or c95 (the c89 utility gives -std=3Dc94, not -std=3Dc89) - c99 - gnu99 (default) Newer and more useful old standards like gnu89 are hard to select. The user must set the undocumented variable CSTD even to change the default to c89/90/94/95. Adding -std=3Dwhatever to CFLAGS only works if it happens to be added after -std=3D${CSTD}. Bruce From owner-svn-src-head@freebsd.org Mon Jun 10 16:51:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047E315C4189; Mon, 10 Jun 2019 16:51:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9175C83B94; Mon, 10 Jun 2019 16:51:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id m3so128092itl.1; Mon, 10 Jun 2019 09:51:13 -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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Eu04DSogOqzagCsYJLwY4WcWqS8Pq2SPDwU0n9qEVE0=; b=DIcuyqkeSGVgvbGWYOmwHMG3gGpIu1RfMP3WT7Nryl73ZK7QHOjkhhRNHPCfKCw1KC TIS1NNWvgWmrxZ/sAk7qoabZFD3Ykk4BU6aJFKcQ2sOV/a544dUVoggP5xK5cKJkEQ6p UQPw8fAkJeKKK1N3Asa/o9UJwaEco7rLdHyvXucsNKDwoSHNz2OzZt8uBTXveLzud4jE MLahl1+K9A1Syr2bEmjLnOLbfMJ4Mn2+UC+fLh6rwO2E0h6PjSbFbJHU3qls+/lkdTh7 SivKK9KQDdV5UlDobBqR9PXhrjukJUQtki5owFEzWcK4cVZZf6RAgwGaaNWH7laHUoBD QJzA== X-Gm-Message-State: APjAAAVlFG3Om7+Qyqu7NmHoAcOKNUqoYt2MoccH+XqqPyUEmZwnp7/+ DJGp4Im0wRLOes8iUpHv2rR9+YBg X-Google-Smtp-Source: APXvYqzbWqZ0k+LjgZuFZlidfxe5Ukt5OyteODYkal1Eawig9aR6eZhvC9QqvS2cuB5a+EobbZUiyg== X-Received: by 2002:a05:6638:199:: with SMTP id a25mr135500jaq.18.1560184115751; Mon, 10 Jun 2019 09:28:35 -0700 (PDT) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com. [209.85.166.171]) by smtp.gmail.com with ESMTPSA id z138sm2224328itc.36.2019.06.10.09.28.35 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 09:28:35 -0700 (PDT) Received: by mail-it1-f171.google.com with SMTP id i21so14237933ita.5; Mon, 10 Jun 2019 09:28:35 -0700 (PDT) X-Received: by 2002:a24:4411:: with SMTP id o17mr13966343ita.117.1560184115377; Mon, 10 Jun 2019 09:28:35 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190611013853.E3415@besplex.bde.org> In-Reply-To: <20190611013853.E3415@besplex.bde.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 10 Jun 2019 09:28:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9175C83B94 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 16:51:14 -0000 On Mon, Jun 10, 2019 at 9:17 AM Bruce Evans wrote: > Only headers and libraries should support -std=c89. has > lots of support for compilers and POSIX versions going back to K&R C, > and only the K&R parts are completely broken. Is this due to specific policy, or just inertia? (No one has bothered to remove the old bits?) The older parts being totally broken suggests sheer inertia. Best, Conrad From owner-svn-src-head@freebsd.org Mon Jun 10 17:30:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3477815C4C2C; Mon, 10 Jun 2019 17:30:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42226853B9; Mon, 10 Jun 2019 17:30:38 +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 x5AHURlr089095 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 10 Jun 2019 20:30:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5AHURlr089095 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5AHUR8D089094; Mon, 10 Jun 2019 20:30:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 10 Jun 2019 20:30:27 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: Bruce Evans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <20190610173027.GZ75280@kib.kiev.ua> References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190611013853.E3415@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 17:30:39 -0000 On Mon, Jun 10, 2019 at 09:28:24AM -0700, Conrad Meyer wrote: > On Mon, Jun 10, 2019 at 9:17 AM Bruce Evans wrote: > > Only headers and libraries should support -std=c89. has > > lots of support for compilers and POSIX versions going back to K&R C, > > and only the K&R parts are completely broken. > > Is this due to specific policy, or just inertia? (No one has bothered > to remove the old bits?) The older parts being totally broken > suggests sheer inertia. This is due to very important compiler, not used by FreeBSD, still only providing c99 features, for instance. So people who have to write portable C might force all compilation environment to the common standard. I personally think that c89 is not very important now, but still should not be broken without serious cause. While c99 must be fully supported. Of course, the statements are limited to user-mode visible portion of /usr/include/* and libs. From owner-svn-src-head@freebsd.org Mon Jun 10 18:19:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8348715C5B6A; Mon, 10 Jun 2019 18:19:50 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28DD687245; Mon, 10 Jun 2019 18:19:50 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE62B1DE11; Mon, 10 Jun 2019 18:19:49 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5AIJnJi078839; Mon, 10 Jun 2019 18:19:49 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AIJnAX078838; Mon, 10 Jun 2019 18:19:49 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201906101819.x5AIJnAX078838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 10 Jun 2019 18:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348873 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 348873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28DD687245 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 18:19:50 -0000 Author: zeising (doc,ports committer) Date: Mon Jun 10 18:19:49 2019 New Revision: 348873 URL: https://svnweb.freebsd.org/changeset/base/348873 Log: psm(4): Enable touchpads and trackpads by default Enable synaptics and elantech touchpads, as well as IBM/Lenovo TrackPoints by default, instead of having users find and toggle a loader tunable. This makes things like two finger scroll and other modern features work out of the box with X. By enabling these settings by default, we get a better desktop experience in X, since xserver and evdev can make use of the more advanced synaptics and elantech features. Reviewed by: imp, wulf, 0mp Approved by: imp Sponsored by: B3 Init (zeising) Differential Revision: https://reviews.freebsd.org/D20507 Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Jun 10 17:44:50 2019 (r348872) +++ head/sys/dev/atkbdc/psm.c Mon Jun 10 18:19:49 2019 (r348873) @@ -513,9 +513,9 @@ static devclass_t psm_devclass; /* Tunables */ static int tap_enabled = -1; static int verbose = PSM_DEBUG; -static int synaptics_support = 0; -static int trackpoint_support = 0; -static int elantech_support = 0; +static int synaptics_support = 1; +static int trackpoint_support = 1; +static int elantech_support = 1; /* for backward compatibility */ #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) From owner-svn-src-head@freebsd.org Mon Jun 10 19:01:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D8915C6885; Mon, 10 Jun 2019 19:01:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1FBB88A30; Mon, 10 Jun 2019 19:01:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE5AD1E6AA; Mon, 10 Jun 2019 19:01:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5AJ1su1002585; Mon, 10 Jun 2019 19:01:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AJ1ssW002584; Mon, 10 Jun 2019 19:01:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906101901.x5AJ1ssW002584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Jun 2019 19:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348874 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1FBB88A30 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:01:55 -0000 Author: jhb Date: Mon Jun 10 19:01:54 2019 New Revision: 348874 URL: https://svnweb.freebsd.org/changeset/base/348874 Log: Remove an overly-aggressive assertion. While it is true that the new vmspace passed to vmspace_switch_aio will always have a valid reference due to the AIO job or the extra reference on the original vmspace in the worker thread, it is not true that the old vmspace being switched away from will have more than one reference. Specifically, when a process with queued AIO jobs exits, the exit hook in aio_proc_rundown will only ensure that all of the AIO jobs have completed or been cancelled. However, the last AIO job might have completed and woken up the exiting process before the worker thread servicing that job has switched back to its original vmspace. In that case, the process might finish exiting dropping its reference to the vmspace before the worker thread resulting in the worker thread dropping the last reference. Reported by: np Reviewed by: alc, markj, np, imp MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20542 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jun 10 18:19:49 2019 (r348873) +++ head/sys/vm/vm_map.c Mon Jun 10 19:01:54 2019 (r348874) @@ -454,18 +454,17 @@ vmspace_acquire_ref(struct proc *p) /* * Switch between vmspaces in an AIO kernel process. * - * The AIO kernel processes switch to and from a user process's - * vmspace while performing an I/O operation on behalf of a user - * process. The new vmspace is either the vmspace of a user process - * obtained from an active AIO request or the initial vmspace of the - * AIO kernel process (when it is idling). Because user processes - * will block to drain any active AIO requests before proceeding in - * exit() or execve(), the vmspace reference count for these vmspaces - * can never be 0. This allows for a much simpler implementation than - * the loop in vmspace_acquire_ref() above. Similarly, AIO kernel - * processes hold an extra reference on their initial vmspace for the - * life of the process so that this guarantee is true for any vmspace - * passed as 'newvm'. + * The new vmspace is either the vmspace of a user process obtained + * from an active AIO request or the initial vmspace of the AIO kernel + * process (when it is idling). Because user processes will block to + * drain any active AIO requests before proceeding in exit() or + * execve(), the reference count for vmspaces from AIO requests can + * never be 0. Similarly, AIO kernel processes hold an extra + * reference on their initial vmspace for the life of the process. As + * a result, the 'newvm' vmspace always has a non-zero reference + * count. This permits an additional reference on 'newvm' to be + * acquired via a simple atomic increment rather than the loop in + * vmspace_acquire_ref() above. */ void vmspace_switch_aio(struct vmspace *newvm) @@ -490,9 +489,6 @@ vmspace_switch_aio(struct vmspace *newvm) /* Activate the new mapping. */ pmap_activate(curthread); - /* Remove the daemon's reference to the old address space. */ - KASSERT(oldvm->vm_refcnt > 1, - ("vmspace_switch_aio: oldvm dropping last reference")); vmspace_free(oldvm); } From owner-svn-src-head@freebsd.org Mon Jun 10 19:22:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E1B15C72A0; Mon, 10 Jun 2019 19:22:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F9289889; Mon, 10 Jun 2019 19:22:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 276FF1EA38; Mon, 10 Jun 2019 19:22:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5AJMbcD015447; Mon, 10 Jun 2019 19:22:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AJMa3P015444; Mon, 10 Jun 2019 19:22:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906101922.x5AJMa3P015444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Jun 2019 19:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348875 - head/sys/kgssapi/krb5 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kgssapi/krb5 X-SVN-Commit-Revision: 348875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65F9289889 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:22:38 -0000 Author: jhb Date: Mon Jun 10 19:22:36 2019 New Revision: 348875 URL: https://svnweb.freebsd.org/changeset/base/348875 Log: Add warnings for Kerberos GSS algorithms deprecated in RFCs 6649 and 8429. All of these algorithms are explicitly marked SHOULD NOT in one of these RFCs. Specifically, RFC 6649 deprecates all algorithms using DES as well as the "export-friendly" variant of RC4. RFC 8429 deprecates Triple DES and the remaining RC4 algorithms. Reviewed by: cem MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20343 Modified: head/sys/kgssapi/krb5/kcrypto_arcfour.c head/sys/kgssapi/krb5/kcrypto_des.c head/sys/kgssapi/krb5/kcrypto_des3.c Modified: head/sys/kgssapi/krb5/kcrypto_arcfour.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_arcfour.c Mon Jun 10 19:01:54 2019 (r348874) +++ head/sys/kgssapi/krb5/kcrypto_arcfour.c Mon Jun 10 19:22:36 2019 (r348875) @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); static void arcfour_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; ks->ks_priv = NULL; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "RC4 cipher for Kerberos GSS"); } static void Modified: head/sys/kgssapi/krb5/kcrypto_des.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des.c Mon Jun 10 19:01:54 2019 (r348874) +++ head/sys/kgssapi/krb5/kcrypto_des.c Mon Jun 10 19:22:36 2019 (r348875) @@ -53,11 +53,15 @@ struct des1_state { static void des1_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des1_state *ds; ds = malloc(sizeof(struct des1_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des lock", NULL, MTX_DEF); ks->ks_priv = ds; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "DES cipher for Kerberos GSS"); } static void Modified: head/sys/kgssapi/krb5/kcrypto_des3.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des3.c Mon Jun 10 19:01:54 2019 (r348874) +++ head/sys/kgssapi/krb5/kcrypto_des3.c Mon Jun 10 19:22:36 2019 (r348875) @@ -54,11 +54,15 @@ struct des3_state { static void des3_init(struct krb5_key_state *ks) { + static struct timeval lastwarn; + static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des3_state *ds; ds = malloc(sizeof(struct des3_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des3 lock", NULL, MTX_DEF); ks->ks_priv = ds; + if (ratecheck(&lastwarn, &warninterval)) + gone_in(13, "DES3 cipher for Kerberos GSS"); } static void From owner-svn-src-head@freebsd.org Mon Jun 10 19:26:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0162815C7444; Mon, 10 Jun 2019 19:26:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5248289AFB; Mon, 10 Jun 2019 19:26:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9844C1EA52; Mon, 10 Jun 2019 19:26:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5AJQvMk015693; Mon, 10 Jun 2019 19:26:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AJQvoT015692; Mon, 10 Jun 2019 19:26:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906101926.x5AJQvoT015692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Jun 2019 19:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348876 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 348876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5248289AFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:26:59 -0000 Author: jhb Date: Mon Jun 10 19:26:57 2019 New Revision: 348876 URL: https://svnweb.freebsd.org/changeset/base/348876 Log: Add warnings to /dev/crypto for deprecated algorithms. These algorithms are deprecated algorithms that will have no in-kernel consumers in FreeBSD 13. Specifically, deprecate the following algorithms: - ARC4 - Blowfish - CAST128 - DES - 3DES - MD5-HMAC - Skipjack MFC after: 1 month Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20554 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon Jun 10 19:22:36 2019 (r348875) +++ head/sys/opencrypto/cryptodev.c Mon Jun 10 19:26:57 2019 (r348876) @@ -386,6 +386,9 @@ cryptof_ioctl( struct crypt_op copc; struct crypt_kop kopc; #endif + static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; + static struct timeval skipwarn, tdeswarn; + static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; switch (cmd) { case CIOCGSESSION: @@ -406,18 +409,28 @@ cryptof_ioctl( case 0: break; case CRYPTO_DES_CBC: + if (ratecheck(&deswarn, &warninterval)) + gone_in(13, "DES cipher via /dev/crypto"); txform = &enc_xform_des; break; case CRYPTO_3DES_CBC: + if (ratecheck(&tdeswarn, &warninterval)) + gone_in(13, "3DES cipher via /dev/crypto"); txform = &enc_xform_3des; break; case CRYPTO_BLF_CBC: + if (ratecheck(&blfwarn, &warninterval)) + gone_in(13, "Blowfish cipher via /dev/crypto"); txform = &enc_xform_blf; break; case CRYPTO_CAST_CBC: + if (ratecheck(&castwarn, &warninterval)) + gone_in(13, "CAST128 cipher via /dev/crypto"); txform = &enc_xform_cast5; break; case CRYPTO_SKIPJACK_CBC: + if (ratecheck(&skipwarn, &warninterval)) + gone_in(13, "Skipjack cipher via /dev/crypto"); txform = &enc_xform_skipjack; break; case CRYPTO_AES_CBC: @@ -430,6 +443,8 @@ cryptof_ioctl( txform = &enc_xform_null; break; case CRYPTO_ARC4: + if (ratecheck(&arc4warn, &warninterval)) + gone_in(13, "ARC4 cipher via /dev/crypto"); txform = &enc_xform_arc4; break; case CRYPTO_CAMELLIA_CBC: @@ -458,6 +473,9 @@ cryptof_ioctl( case 0: break; case CRYPTO_MD5_HMAC: + if (ratecheck(&md5warn, &warninterval)) + gone_in(13, + "MD5-HMAC authenticator via /dev/crypto"); thash = &auth_hash_hmac_md5; break; case CRYPTO_POLY1305: From owner-svn-src-head@freebsd.org Mon Jun 10 19:28:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D241715C74CC; Mon, 10 Jun 2019 19:28:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7424489C67; Mon, 10 Jun 2019 19:28:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id CF36C19BF5; Mon, 10 Jun 2019 19:28:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348875 - head/sys/kgssapi/krb5 From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906101922.x5AJMa3P015444@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 10 Jun 2019 12:28:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906101922.x5AJMa3P015444@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7424489C67 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:28:51 -0000 On 6/10/19 12:22 PM, John Baldwin wrote: > Author: jhb > Date: Mon Jun 10 19:22:36 2019 > New Revision: 348875 > URL: https://svnweb.freebsd.org/changeset/base/348875 > > Log: > Add warnings for Kerberos GSS algorithms deprecated in RFCs 6649 and 8429. > > All of these algorithms are explicitly marked SHOULD NOT in one of these > RFCs. > > Specifically, RFC 6649 deprecates all algorithms using DES as well as > the "export-friendly" variant of RC4. RFC 8429 deprecates Triple DES > and the remaining RC4 algorithms. > > Reviewed by: cem > MFC after: 1 month > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D20343 Bah, missed Relnotes: yes The long MFC timer is because I haven't run-tested this yet as when I sat down to look at what it would take to setup GSSAPI with NFS and Kerberos it seemed a bit of a daunting task. As such, I don't think it makes sense to rush into 11.3. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jun 10 19:34:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D82815C77DB; Mon, 10 Jun 2019 19:34:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 023BF8A293; Mon, 10 Jun 2019 19:34:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 64FCA19D1B; Mon, 10 Jun 2019 19:34:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348876 - head/sys/opencrypto From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906101926.x5AJQvoT015692@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 10 Jun 2019 12:34:39 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906101926.x5AJQvoT015692@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 023BF8A293 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:34:41 -0000 On 6/10/19 12:26 PM, John Baldwin wrote: > Author: jhb > Date: Mon Jun 10 19:26:57 2019 > New Revision: 348876 > URL: https://svnweb.freebsd.org/changeset/base/348876 > > Log: > Add warnings to /dev/crypto for deprecated algorithms. > > These algorithms are deprecated algorithms that will have no in-kernel > consumers in FreeBSD 13. Specifically, deprecate the following > algorithms: > - ARC4 > - Blowfish > - CAST128 > - DES > - 3DES > - MD5-HMAC > - Skipjack > > MFC after: 1 month > Relnotes: yes > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D20554 cryptocheck doesn't test any of these. The cryptotest.py tests do test 3DES so cryptotest.py will emit a warning due to that. The /dev/crypto engine for OpenSSL does support several of these, but calling into the kernel just to do software crypto instead of doing the software crypto userland is rather pointless (just adds overhead). -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jun 10 19:35:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5174915C787A; Mon, 10 Jun 2019 19:35:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAE818A3EE; Mon, 10 Jun 2019 19:35:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 694E119D1C; Mon, 10 Jun 2019 19:35:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348876 - head/sys/opencrypto From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906101926.x5AJQvoT015692@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <8cafcb98-2cad-77d9-41a3-39a1799576c9@FreeBSD.org> Date: Mon, 10 Jun 2019 12:35:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906101926.x5AJQvoT015692@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EAE818A3EE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:35:37 -0000 On 6/10/19 12:26 PM, John Baldwin wrote: > Author: jhb > Date: Mon Jun 10 19:26:57 2019 > New Revision: 348876 > URL: https://svnweb.freebsd.org/changeset/base/348876 > > Log: > Add warnings to /dev/crypto for deprecated algorithms. > > These algorithms are deprecated algorithms that will have no in-kernel > consumers in FreeBSD 13. Specifically, deprecate the following > algorithms: > - ARC4 > - Blowfish > - CAST128 > - DES > - 3DES > - MD5-HMAC > - Skipjack > > MFC after: 1 month > Relnotes: yes > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D20554 Also, I missed 'Reviewed by: cem' for this one. :-/ -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jun 10 19:38:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601C015C79D6; Mon, 10 Jun 2019 19:38:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030E08A607; Mon, 10 Jun 2019 19:38:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D12FA1EC23; Mon, 10 Jun 2019 19:38:35 +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 x5AJcZNZ021219; Mon, 10 Jun 2019 19:38:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AJcZGk021218; Mon, 10 Jun 2019 19:38:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906101938.x5AJcZGk021218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 10 Jun 2019 19:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348877 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 348877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 030E08A607 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 19:38:36 -0000 Author: bdrewery Date: Mon Jun 10 19:38:35 2019 New Revision: 348877 URL: https://svnweb.freebsd.org/changeset/base/348877 Log: DPSRCS need to be built before recursing. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Mon Jun 10 19:26:57 2019 (r348876) +++ head/share/mk/bsd.progs.mk Mon Jun 10 19:38:35 2019 (r348877) @@ -95,7 +95,7 @@ $v = # Find common sources among the PROGS to depend on them before building # anything. This allows parallelization without them each fighting over # the same objects. -_PROGS_COMMON_SRCS= +_PROGS_COMMON_SRCS= ${DPSRCS} _PROGS_ALL_SRCS= .for p in ${PROGS} .for s in ${SRCS.${p}} From owner-svn-src-head@freebsd.org Mon Jun 10 20:04:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F1C15C81DE; Mon, 10 Jun 2019 20:04:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63B508B3CB; Mon, 10 Jun 2019 20:04:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5AK46r1079753; Mon, 10 Jun 2019 13:04:06 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5AK46EI079752; Mon, 10 Jun 2019 13:04:06 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906102004.x5AK46EI079752@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348873 - head/sys/dev/atkbdc In-Reply-To: <201906101819.x5AIJnAX078838@repo.freebsd.org> To: Niclas Zeising Date: Mon, 10 Jun 2019 13:04:06 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 63B508B3CB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 20:04:09 -0000 > Author: zeising (doc,ports committer) > Date: Mon Jun 10 18:19:49 2019 > New Revision: 348873 > URL: https://svnweb.freebsd.org/changeset/base/348873 > > Log: > psm(4): Enable touchpads and trackpads by default > > Enable synaptics and elantech touchpads, as well as IBM/Lenovo TrackPoints > by default, instead of having users find and toggle a loader tunable. > This makes things like two finger scroll and other modern features work out > of the box with X. By enabling these settings by default, we get a better > desktop experience in X, since xserver and evdev can make use of the more > advanced synaptics and elantech features. > > Reviewed by: imp, wulf, 0mp > Approved by: imp > Sponsored by: B3 Init (zeising) > Differential Revision: https://reviews.freebsd.org/D20507 This should of probably had a Relnotes: Yes as it changes default system behavior. > Modified: > head/sys/dev/atkbdc/psm.c > > Modified: head/sys/dev/atkbdc/psm.c > ============================================================================== > --- head/sys/dev/atkbdc/psm.c Mon Jun 10 17:44:50 2019 (r348872) > +++ head/sys/dev/atkbdc/psm.c Mon Jun 10 18:19:49 2019 (r348873) > @@ -513,9 +513,9 @@ static devclass_t psm_devclass; > /* Tunables */ > static int tap_enabled = -1; > static int verbose = PSM_DEBUG; > -static int synaptics_support = 0; > -static int trackpoint_support = 0; > -static int elantech_support = 0; > +static int synaptics_support = 1; > +static int trackpoint_support = 1; > +static int elantech_support = 1; > > /* for backward compatibility */ > #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 10 21:24:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477DA15C9A9F; Mon, 10 Jun 2019 21:24:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D80C78DA9E; Mon, 10 Jun 2019 21:24: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B10621FF4E; Mon, 10 Jun 2019 21:24: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 x5ALOcLh078410; Mon, 10 Jun 2019 21:24:38 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ALOcWW078409; Mon, 10 Jun 2019 21:24:38 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906102124.x5ALOcWW078409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 10 Jun 2019 21:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348878 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 348878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D80C78DA9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 21:24:39 -0000 Author: bz Date: Mon Jun 10 21:24:38 2019 New Revision: 348878 URL: https://svnweb.freebsd.org/changeset/base/348878 Log: Add a bus_add_child device method to bcm2835_sdhci. This allows SDIO (through CAM) to attach to an upstream, e.g., .. sdhci_bcm0 pnpinfo name=mmc@7e300000 compat=brcm,bcm2835-mmc sdiob0 .. Without this, upon trying to load sdio, we would panic with "bus_add_child is not implemented". MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Jun 10 19:38:35 2019 (r348877) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Jun 10 21:24:38 2019 (r348878) @@ -708,6 +708,7 @@ static device_method_t bcm_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_add_child, bus_generic_add_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), From owner-svn-src-head@freebsd.org Mon Jun 10 21:26:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31C6F15C9B58; Mon, 10 Jun 2019 21:26:15 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C525B8DC34; Mon, 10 Jun 2019 21:26:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD961FF4F; Mon, 10 Jun 2019 21:26:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5ALQExr078528; Mon, 10 Jun 2019 21:26:14 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ALQEvO078526; Mon, 10 Jun 2019 21:26:14 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906102126.x5ALQEvO078526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 10 Jun 2019 21:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348879 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 348879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C525B8DC34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 21:26:15 -0000 Author: dougm Date: Mon Jun 10 21:26:14 2019 New Revision: 348879 URL: https://svnweb.freebsd.org/changeset/base/348879 Log: Change the check for 'size' wrapping around to zero in kern_mmap to account for both the lower and upper bound modifications. Change the error returned to ENOMEM. Rename the parameter size to len and make size a local variable that stores the value of len after it has been modified. This addresses concerns expressed by Bruce Evans after r348843. Reported by: brde@optusnet.com.au Reviewed by: kib, markj (mentors) MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20592 Modified: head/sys/sys/syscallsubr.h head/sys/vm/vm_mmap.c Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Jun 10 21:24:38 2019 (r348878) +++ head/sys/sys/syscallsubr.h Mon Jun 10 21:26:14 2019 (r348879) @@ -173,7 +173,7 @@ int kern_mknodat(struct thread *td, int fd, const char enum uio_seg pathseg, int mode, dev_t dev); int kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr, size_t len); -int kern_mmap(struct thread *td, uintptr_t addr, size_t size, int prot, +int kern_mmap(struct thread *td, uintptr_t addr, size_t len, int prot, int flags, int fd, off_t pos); int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 10 21:24:38 2019 (r348878) +++ head/sys/vm/vm_mmap.c Mon Jun 10 21:26:14 2019 (r348879) @@ -179,13 +179,13 @@ sys_mmap(struct thread *td, struct mmap_args *uap) } int -kern_mmap(struct thread *td, uintptr_t addr0, size_t size, int prot, int flags, +kern_mmap(struct thread *td, uintptr_t addr0, size_t len, int prot, int flags, int fd, off_t pos) { struct vmspace *vms; struct file *fp; vm_offset_t addr; - vm_size_t pageoff; + vm_size_t pageoff, size; vm_prot_t cap_maxprot; int align, error; cap_rights_t rights; @@ -210,7 +210,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s * pos. */ if (!SV_CURPROC_FLAG(SV_AOUT)) { - if ((size == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + if ((len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) return (EINVAL); } else { @@ -255,12 +255,12 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s pageoff = (pos & PAGE_MASK); pos -= pageoff; - /* Adjust size for rounding (on both ends). */ - size += pageoff; /* low end... */ - /* Check for rounding up to zero. */ - if (round_page(size) < size) - return (EINVAL); + /* Compute size from len by rounding (on both ends). */ + size = len + pageoff; /* low end... */ size = round_page(size); /* hi end */ + /* Check for rounding up to zero. */ + if (len < size) + return (ENOMEM); /* Ensure alignment is at least a page and fits in a pointer. */ align = flags & MAP_ALIGNMENT_MASK; @@ -317,7 +317,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s addr = round_page((vm_offset_t)vms->vm_daddr + lim_max(td, RLIMIT_DATA)); } - if (size == 0) { + if (len == 0) { /* * Return success without mapping anything for old * binaries that request a page-aligned mapping of From owner-svn-src-head@freebsd.org Mon Jun 10 21:27:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E85C215C9BE1; Mon, 10 Jun 2019 21:27:22 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86A8F8DDAB; Mon, 10 Jun 2019 21:27:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F42E1FF55; Mon, 10 Jun 2019 21:27:22 +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 x5ALRMmE078625; Mon, 10 Jun 2019 21:27:22 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ALRLt4078623; Mon, 10 Jun 2019 21:27:21 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906102127.x5ALRLt4078623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 10 Jun 2019 21:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348880 - in head/sys: arm/mv arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: in head/sys: arm/mv arm64/conf conf X-SVN-Commit-Revision: 348880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86A8F8DDAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 21:27:23 -0000 Author: loos Date: Mon Jun 10 21:27:21 2019 New Revision: 348880 URL: https://svnweb.freebsd.org/changeset/base/348880 Log: Add the GPIO driver for the North/South bridge in Marvell Armada 37x0. The A3700 has a different GPIO controller and thus, do not use the old (and shared) code for Marvell. The pinctrl driver, also part of the controller, is not supported yet (but the implementation should be straightforward). Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/sys/arm/mv/a37x0_gpio.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Added: head/sys/arm/mv/a37x0_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/a37x0_gpio.c Mon Jun 10 21:27:21 2019 (r348880) @@ -0,0 +1,352 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019, Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "gpio_if.h" + +static struct resource_spec a37x0_gpio_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Pinctl / GPIO */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* Interrupts control */ + { -1, 0, 0 } +}; + +struct a37x0_gpio_softc { + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + device_t sc_busdev; + int sc_type; + uint32_t sc_max_pins; + uint32_t sc_npins; + struct resource *sc_mem_res[nitems(a37x0_gpio_res_spec) - 1]; +}; + +/* Memory regions. */ +#define A37X0_GPIO 0 +#define A37X0_INTR 1 + +/* North Bridge / South Bridge. */ +#define A37X0_NB_GPIO 1 +#define A37X0_SB_GPIO 2 + +#define A37X0_GPIO_WRITE(_sc, _off, _val) \ + bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off), (_val)) +#define A37X0_GPIO_READ(_sc, _off) \ + bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off)) + +#define A37X0_GPIO_BIT(_p) (1U << ((_p) % 32)) +#define A37X0_GPIO_OUT_EN(_p) (0x0 + ((_p) / 32) * 4) +#define A37X0_GPIO_LATCH(_p) (0x8 + ((_p) / 32) * 4) +#define A37X0_GPIO_INPUT(_p) (0x10 + ((_p) / 32) * 4) +#define A37X0_GPIO_OUTPUT(_p) (0x18 + ((_p) / 32) * 4) +#define A37X0_GPIO_SEL 0x30 + + +static struct ofw_compat_data compat_data[] = { + { "marvell,armada3710-nb-pinctrl", A37X0_NB_GPIO }, + { "marvell,armada3710-sb-pinctrl", A37X0_SB_GPIO }, + { NULL, 0 } +}; + +static phandle_t +a37x0_gpio_get_node(device_t bus, device_t dev) +{ + + return (ofw_bus_get_node(bus)); +} + +static device_t +a37x0_gpio_get_bus(device_t dev) +{ + struct a37x0_gpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->sc_busdev); +} + +static int +a37x0_gpio_pin_max(device_t dev, int *maxpin) +{ + struct a37x0_gpio_softc *sc; + + sc = device_get_softc(dev); + *maxpin = sc->sc_npins - 1; + + return (0); +} + +static int +a37x0_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct a37x0_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + snprintf(name, GPIOMAXNAME, "pin %d", pin); + + return (0); +} + +static int +a37x0_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct a37x0_gpio_softc *sc; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + + return (0); +} + +static int +a37x0_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct a37x0_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUT_EN(pin)); + if ((reg & A37X0_GPIO_BIT(pin)) != 0) + *flags = GPIO_PIN_OUTPUT; + else + *flags = GPIO_PIN_INPUT; + + return (0); +} + +static int +a37x0_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct a37x0_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUT_EN(pin)); + if (flags & GPIO_PIN_OUTPUT) + reg |= A37X0_GPIO_BIT(pin); + else + reg &= ~A37X0_GPIO_BIT(pin); + A37X0_GPIO_WRITE(sc, A37X0_GPIO_OUT_EN(pin), reg); + + return (0); +} + +static int +a37x0_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct a37x0_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUT_EN(pin)); + if ((reg & A37X0_GPIO_BIT(pin)) != 0) + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUTPUT(pin)); + else + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_INPUT(pin)); + *val = ((reg & A37X0_GPIO_BIT(pin)) != 0) ? 1 : 0; + + return (0); +} + +static int +a37x0_gpio_pin_set(device_t dev, uint32_t pin, unsigned int val) +{ + struct a37x0_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUTPUT(pin)); + if (val != 0) + reg |= A37X0_GPIO_BIT(pin); + else + reg &= ~A37X0_GPIO_BIT(pin); + A37X0_GPIO_WRITE(sc, A37X0_GPIO_OUTPUT(pin), reg); + + return (0); +} + +static int +a37x0_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct a37x0_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + if (pin >= sc->sc_npins) + return (EINVAL); + + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUT_EN(pin)); + if ((reg & A37X0_GPIO_BIT(pin)) == 0) + return (EINVAL); + reg = A37X0_GPIO_READ(sc, A37X0_GPIO_OUTPUT(pin)); + reg ^= A37X0_GPIO_BIT(pin); + A37X0_GPIO_WRITE(sc, A37X0_GPIO_OUTPUT(pin), reg); + + return (0); +} + +static int +a37x0_gpio_probe(device_t dev) +{ + const char *desc; + struct a37x0_gpio_softc *sc; + + if (!OF_hasprop(ofw_bus_get_node(dev), "gpio-controller")) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_type = ofw_bus_search_compatible( + device_get_parent(dev), compat_data)->ocd_data; + switch (sc->sc_type) { + case A37X0_NB_GPIO: + sc->sc_max_pins = 36; + desc = "Armada 37x0 North Bridge GPIO Controller"; + break; + case A37X0_SB_GPIO: + sc->sc_max_pins = 30; + desc = "Armada 37x0 South Bridge GPIO Controller"; + break; + default: + return (ENXIO); + } + device_set_desc(dev, desc); + + return (BUS_PROBE_DEFAULT); +} + +static int +a37x0_gpio_attach(device_t dev) +{ + int err, ncells; + pcell_t *ranges; + struct a37x0_gpio_softc *sc; + + sc = device_get_softc(dev); + + /* Read and verify the "gpio-ranges" property. */ + ncells = OF_getencprop_alloc(ofw_bus_get_node(dev), "gpio-ranges", + (void **)&ranges); + if (ncells == -1) + return (ENXIO); + if (ncells != sizeof(*ranges) * 4 || ranges[1] != 0 || ranges[2] != 0) { + OF_prop_free(ranges); + return (ENXIO); + } + sc->sc_npins = ranges[3]; + OF_prop_free(ranges); + + /* Check the number of pins in the DTS vs HW capabilities. */ + if (sc->sc_npins > sc->sc_max_pins) + return (ENXIO); + + err = bus_alloc_resources(dev, a37x0_gpio_res_spec, sc->sc_mem_res); + if (err != 0) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + sc->sc_bst = rman_get_bustag(sc->sc_mem_res[A37X0_GPIO]); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res[A37X0_GPIO]); + + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + return (ENXIO); + + return (0); +} + +static int +a37x0_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t a37x0_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a37x0_gpio_probe), + DEVMETHOD(device_attach, a37x0_gpio_attach), + DEVMETHOD(device_detach, a37x0_gpio_detach), + + /* GPIO interface */ + DEVMETHOD(gpio_get_bus, a37x0_gpio_get_bus), + DEVMETHOD(gpio_pin_max, a37x0_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, a37x0_gpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, a37x0_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, a37x0_gpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, a37x0_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, a37x0_gpio_pin_get), + DEVMETHOD(gpio_pin_set, a37x0_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, a37x0_gpio_pin_toggle), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, a37x0_gpio_get_node), + + DEVMETHOD_END +}; + +static devclass_t a37x0_gpio_devclass; +static driver_t a37x0_gpio_driver = { + "gpio", + a37x0_gpio_methods, + sizeof(struct a37x0_gpio_softc), +}; + +EARLY_DRIVER_MODULE(a37x0_gpio, simple_mfd, a37x0_gpio_driver, + a37x0_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Jun 10 21:26:14 2019 (r348879) +++ head/sys/arm64/conf/GENERIC Mon Jun 10 21:27:21 2019 (r348880) @@ -223,6 +223,7 @@ device a10_codec device a31_dmac # GPIO / PINCTRL +device a37x0_gpio # Marvell Armada 37x0 GPIO controller device aw_gpio # Allwinner GPIO controller device gpio device gpioled Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Jun 10 21:26:14 2019 (r348879) +++ head/sys/conf/files.arm64 Mon Jun 10 21:27:21 2019 (r348880) @@ -95,6 +95,7 @@ arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 +arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt arm/mv/gpio.c optional mv_gpio fdt arm/mv/mvebu_pinctrl.c optional mvebu_pinctrl fdt arm/mv/mv_cp110_icu.c optional mv_cp110_icu fdt From owner-svn-src-head@freebsd.org Mon Jun 10 21:34:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E5115C9E5A; Mon, 10 Jun 2019 21:34:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E62858E25D; Mon, 10 Jun 2019 21:34:07 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0128200F5; Mon, 10 Jun 2019 21:34:07 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5ALY7DY083836; Mon, 10 Jun 2019 21:34:07 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ALY71Y083835; Mon, 10 Jun 2019 21:34:07 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906102134.x5ALY71Y083835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 10 Jun 2019 21:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348881 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E62858E25D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 21:34:08 -0000 Author: dougm Date: Mon Jun 10 21:34:07 2019 New Revision: 348881 URL: https://svnweb.freebsd.org/changeset/base/348881 Log: The computations of vm_map_splay_split and vm_map_splay_merge touch both children of every entry on the search path as part of updating values of the max_free field. By comparing the max_free values of an entry and its child on the search path, the code can avoid accessing the child off the path in cases where the max_free value decreases along the path. Specifically, this patch changes splay_split so that the max_free field of every entry on the search path is replaced, temporarily, by the max_free field from its child not on the search path or, if the child in that direction is NULL, then a difference between start and end values of two pointers already available in the split code, without following any next or prev pointers. However, to find that max_free value does not require looking toward that other child if either the child on the search path has a lower max_free value, or the current max_free value is zero, because in either case we know that the value of max_free for the other child is the value we already have. So, the changes to vm_entry_splay_split make sure that we know all the off-search-path entries we will need to complete the splay, without looking at all of them. There is an exception at the bottom of the search path where we cannot rely on the max_free value in the direction of the NULL pointer that ends the search, because of the behavior of entry-clipping code. The corresponding change to vm_splay_entry_merge makes it simpler, since it's just reversing pointers and updating running maxima. In a test intended to exercise vigorously the vm_map implementation, the effect of this change was to reduce the data cache miss rate by 10-14% and the running time by 5-7%. Tested by: pho Reviewed by: alc Approved by: kib (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19826 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jun 10 21:27:21 2019 (r348880) +++ head/sys/vm/vm_map.c Mon Jun 10 21:34:07 2019 (r348881) @@ -962,55 +962,92 @@ vm_map_entry_set_behavior(vm_map_entry_t entry, u_char } /* - * vm_map_entry_set_max_free: + * vm_map_entry_max_free_{left,right}: * - * Set the max_free field in a vm_map_entry. + * Compute the size of the largest free gap between two entries, + * one the root of a tree and the other the ancestor of that root + * that is the least or greatest ancestor found on the search path. */ -static inline void -vm_map_entry_set_max_free(vm_map_entry_t entry) +static inline vm_size_t +vm_map_entry_max_free_left(vm_map_entry_t root, vm_map_entry_t left_ancestor) { - vm_map_entry_t child; - vm_size_t max_left, max_right; - child = entry->left; - max_left = (child != NULL) ? child->max_free : - entry->start - entry->prev->end; - child = entry->right; - max_right = (child != NULL) ? child->max_free : - entry->next->start - entry->end; - entry->max_free = MAX(max_left, max_right); + return (root->left != NULL ? + root->left->max_free : root->start - left_ancestor->end); } -#define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ - y = root->left; \ - if (y != NULL && (test)) { \ - /* Rotate right and make y root. */ \ - root->left = y->right; \ - y->right = root; \ - vm_map_entry_set_max_free(root); \ - root = y; \ - y = root->left; \ - } \ - /* Put root on rlist. */ \ - root->left = rlist; \ - rlist = root; \ - root = y; \ +static inline vm_size_t +vm_map_entry_max_free_right(vm_map_entry_t root, vm_map_entry_t right_ancestor) +{ + + return (root->right != NULL ? + root->right->max_free : right_ancestor->start - root->end); +} + +#define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ + vm_size_t max_free; \ + \ + /* \ + * Infer root->right->max_free == root->max_free when \ + * y->max_free < root->max_free || root->max_free == 0. \ + * Otherwise, look right to find it. \ + */ \ + y = root->left; \ + max_free = root->max_free; \ + KASSERT(max_free >= vm_map_entry_max_free_right(root, rlist), \ + ("%s: max_free invariant fails", __func__)); \ + if (y == NULL ? max_free > 0 : max_free - 1 < y->max_free) \ + max_free = vm_map_entry_max_free_right(root, rlist); \ + if (y != NULL && (test)) { \ + /* Rotate right and make y root. */ \ + root->left = y->right; \ + y->right = root; \ + if (max_free < y->max_free) \ + root->max_free = max_free = MAX(max_free, \ + vm_map_entry_max_free_left(root, y)); \ + root = y; \ + y = root->left; \ + } \ + /* Copy right->max_free. Put root on rlist. */ \ + root->max_free = max_free; \ + KASSERT(max_free == vm_map_entry_max_free_right(root, rlist), \ + ("%s: max_free not copied from right", __func__)); \ + root->left = rlist; \ + rlist = root; \ + root = y; \ } while (0) -#define SPLAY_RIGHT_STEP(root, y, llist, test) do { \ - y = root->right; \ - if (y != NULL && (test)) { \ - /* Rotate left and make y root. */ \ - root->right = y->left; \ - y->left = root; \ - vm_map_entry_set_max_free(root); \ - root = y; \ - y = root->right; \ - } \ - /* Put root on llist. */ \ - root->right = llist; \ - llist = root; \ - root = y; \ +#define SPLAY_RIGHT_STEP(root, y, llist, test) do { \ + vm_size_t max_free; \ + \ + /* \ + * Infer root->left->max_free == root->max_free when \ + * y->max_free < root->max_free || root->max_free == 0. \ + * Otherwise, look left to find it. \ + */ \ + y = root->right; \ + max_free = root->max_free; \ + KASSERT(max_free >= vm_map_entry_max_free_left(root, llist), \ + ("%s: max_free invariant fails", __func__)); \ + if (y == NULL ? max_free > 0 : max_free - 1 < y->max_free) \ + max_free = vm_map_entry_max_free_left(root, llist); \ + if (y != NULL && (test)) { \ + /* Rotate left and make y root. */ \ + root->right = y->left; \ + y->left = root; \ + if (max_free < y->max_free) \ + root->max_free = max_free = MAX(max_free, \ + vm_map_entry_max_free_right(root, y)); \ + root = y; \ + y = root->right; \ + } \ + /* Copy left->max_free. Put root on llist. */ \ + root->max_free = max_free; \ + KASSERT(max_free == vm_map_entry_max_free_left(root, llist), \ + ("%s: max_free not copied from left", __func__)); \ + root->right = llist; \ + llist = root; \ + root = y; \ } while (0) /* @@ -1019,18 +1056,21 @@ vm_map_entry_set_max_free(vm_map_entry_t entry) * addr. Treat pointers to nodes with max_free < length as NULL pointers. * llist and rlist are the two sides in reverse order (bottom-up), with llist * linked by the right pointer and rlist linked by the left pointer in the - * vm_map_entry. + * vm_map_entry, and both lists terminated by &map->header. This function, and + * the subsequent call to vm_map_splay_merge, rely on the start and end address + * values in &map->header. */ static vm_map_entry_t -vm_map_splay_split(vm_offset_t addr, vm_size_t length, - vm_map_entry_t root, vm_map_entry_t *out_llist, vm_map_entry_t *out_rlist) +vm_map_splay_split(vm_map_t map, vm_offset_t addr, vm_size_t length, + vm_map_entry_t *out_llist, vm_map_entry_t *out_rlist) { - vm_map_entry_t llist, rlist; - vm_map_entry_t y; + vm_map_entry_t llist, rlist, root, y; - llist = NULL; - rlist = NULL; + llist = rlist = &map->header; + root = map->root; while (root != NULL && root->max_free >= length) { + KASSERT(llist->end <= root->start && root->end <= rlist->start, + ("%s: root not within tree bounds", __func__)); if (addr < root->start) { SPLAY_LEFT_STEP(root, y, rlist, y->max_free >= length && addr < y->start); @@ -1069,44 +1109,65 @@ vm_map_splay_findprev(vm_map_entry_t root, vm_map_entr *iolist = llist; } +static inline void +vm_map_entry_swap(vm_map_entry_t *a, vm_map_entry_t *b) +{ + vm_map_entry_t tmp; + + tmp = *b; + *b = *a; + *a = tmp; +} + /* * Walk back up the two spines, flip the pointers and set max_free. The * subtrees of the root go at the bottom of llist and rlist. */ -static vm_map_entry_t -vm_map_splay_merge(vm_map_entry_t root, - vm_map_entry_t llist, vm_map_entry_t rlist, - vm_map_entry_t ltree, vm_map_entry_t rtree) +static void +vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, + vm_map_entry_t llist, vm_map_entry_t rlist) { - vm_map_entry_t y; + vm_map_entry_t prev; + vm_size_t max_free_left, max_free_right; - while (llist != NULL) { - y = llist->right; - llist->right = ltree; - vm_map_entry_set_max_free(llist); - ltree = llist; - llist = y; + max_free_left = vm_map_entry_max_free_left(root, llist); + if (llist != &map->header) { + prev = root->left; + do { + /* + * The max_free values of the children of llist are in + * llist->max_free and max_free_left. Update with the + * max value. + */ + llist->max_free = max_free_left = + MAX(llist->max_free, max_free_left); + vm_map_entry_swap(&llist->right, &prev); + vm_map_entry_swap(&prev, &llist); + } while (llist != &map->header); + root->left = prev; } - while (rlist != NULL) { - y = rlist->left; - rlist->left = rtree; - vm_map_entry_set_max_free(rlist); - rtree = rlist; - rlist = y; - } - - /* - * Final assembly: add ltree and rtree as subtrees of root. - */ - root->left = ltree; - root->right = rtree; - vm_map_entry_set_max_free(root); - - return (root); + max_free_right = vm_map_entry_max_free_right(root, rlist); + if (rlist != &map->header) { + prev = root->right; + do { + /* + * The max_free values of the children of rlist are in + * rlist->max_free and max_free_right. Update with the + * max value. + */ + rlist->max_free = max_free_right = + MAX(rlist->max_free, max_free_right); + vm_map_entry_swap(&rlist->left, &prev); + vm_map_entry_swap(&prev, &rlist); + } while (rlist != &map->header); + root->right = prev; + } + root->max_free = MAX(max_free_left, max_free_right); + map->root = root; } /* - * vm_map_entry_splay: + * vm_map_splay: * * The Sleator and Tarjan top-down splay algorithm with the * following variation. Max_free must be computed bottom-up, so @@ -1123,14 +1184,14 @@ vm_map_splay_merge(vm_map_entry_t root, * Returns: the new root. */ static vm_map_entry_t -vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t root) +vm_map_splay(vm_map_t map, vm_offset_t addr) { - vm_map_entry_t llist, rlist; + vm_map_entry_t llist, rlist, root; - root = vm_map_splay_split(addr, 0, root, &llist, &rlist); + root = vm_map_splay_split(map, addr, 0, &llist, &rlist); if (root != NULL) { /* do nothing */ - } else if (llist != NULL) { + } else if (llist != &map->header) { /* * Recover the greatest node in the left * subtree and make it the root. @@ -1138,7 +1199,7 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t ro root = llist; llist = root->right; root->right = NULL; - } else if (rlist != NULL) { + } else if (rlist != &map->header) { /* * Recover the least node in the right * subtree and make it the root. @@ -1150,8 +1211,9 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t ro /* There is no root. */ return (NULL); } - return (vm_map_splay_merge(root, llist, rlist, - root->left, root->right)); + vm_map_splay_merge(map, root, llist, rlist); + VM_MAP_ASSERT_CONSISTENT(map); + return (root); } /* @@ -1160,8 +1222,7 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t ro * Insert/remove entries from maps. */ static void -vm_map_entry_link(vm_map_t map, - vm_map_entry_t entry) +vm_map_entry_link(vm_map_t map, vm_map_entry_t entry) { vm_map_entry_t llist, rlist, root; @@ -1170,15 +1231,14 @@ vm_map_entry_link(vm_map_t map, map->nentries, entry); VM_MAP_ASSERT_LOCKED(map); map->nentries++; - root = map->root; - root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root == NULL, ("vm_map_entry_link: link object already mapped")); - entry->prev = (llist == NULL) ? &map->header : llist; - entry->next = (rlist == NULL) ? &map->header : rlist; - entry->prev->next = entry->next->prev = entry; - root = vm_map_splay_merge(entry, llist, rlist, NULL, NULL); - map->root = entry; + entry->prev = llist; + entry->next = rlist; + llist->next = rlist->prev = entry; + entry->left = entry->right = NULL; + vm_map_splay_merge(map, entry, llist, rlist); VM_MAP_ASSERT_CONSISTENT(map); } @@ -1189,19 +1249,13 @@ enum unlink_merge_type { }; static void -vm_map_entry_unlink(vm_map_t map, - vm_map_entry_t entry, - enum unlink_merge_type op) +vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry, + enum unlink_merge_type op) { vm_map_entry_t llist, rlist, root, y; VM_MAP_ASSERT_LOCKED(map); - llist = entry->prev; - rlist = entry->next; - llist->next = rlist; - rlist->prev = llist; - root = map->root; - root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root != NULL, ("vm_map_entry_unlink: unlink object not mapped")); @@ -1226,11 +1280,11 @@ vm_map_entry_unlink(vm_map_t map, case UNLINK_MERGE_NONE: vm_map_splay_findprev(root, &llist); vm_map_splay_findnext(root, &rlist); - if (llist != NULL) { + if (llist != &map->header) { root = llist; llist = root->right; root->right = NULL; - } else if (rlist != NULL) { + } else if (rlist != &map->header) { root = rlist; rlist = root->left; root->left = NULL; @@ -1238,10 +1292,13 @@ vm_map_entry_unlink(vm_map_t map, root = NULL; break; } + y = entry->next; + y->prev = entry->prev; + y->prev->next = y; if (root != NULL) - root = vm_map_splay_merge(root, llist, rlist, - root->left, root->right); - map->root = root; + vm_map_splay_merge(map, root, llist, rlist); + else + map->root = NULL; VM_MAP_ASSERT_CONSISTENT(map); map->nentries--; CTR3(KTR_VM, "vm_map_entry_unlink: map %p, nentries %d, entry %p", map, @@ -1262,15 +1319,13 @@ vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry vm_map_entry_t llist, rlist, root; VM_MAP_ASSERT_LOCKED(map); - root = map->root; - root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + root = vm_map_splay_split(map, entry->start, 0, &llist, &rlist); KASSERT(root != NULL, ("%s: resize object not mapped", __func__)); vm_map_splay_findnext(root, &rlist); root->right = NULL; entry->end += grow_amount; - map->root = vm_map_splay_merge(root, llist, rlist, - root->left, root->right); + vm_map_splay_merge(map, root, llist, rlist); VM_MAP_ASSERT_CONSISTENT(map); CTR4(KTR_VM, "%s: map %p, nentries %d, entry %p", __func__, map, map->nentries, entry); @@ -1316,8 +1371,7 @@ vm_map_lookup_entry( * change the map. Thus, the map's timestamp need not change * on a temporary upgrade. */ - map->root = cur = vm_map_entry_splay(address, cur); - VM_MAP_ASSERT_CONSISTENT(map); + cur = vm_map_splay(map, address); if (!locked) sx_downgrade(&map->lock); @@ -1604,11 +1658,10 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s * After splay, if start comes before root node, then there * must be a gap from start to the root. */ - root = vm_map_splay_split(start, length, map->root, - &llist, &rlist); + root = vm_map_splay_split(map, start, length, &llist, &rlist); if (root != NULL) start = root->end; - else if (rlist != NULL) { + else if (rlist != &map->header) { root = rlist; rlist = root->left; root->left = NULL; @@ -1617,8 +1670,7 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s llist = root->right; root->right = NULL; } - map->root = vm_map_splay_merge(root, llist, rlist, - root->left, root->right); + vm_map_splay_merge(map, root, llist, rlist); VM_MAP_ASSERT_CONSISTENT(map); if (start + length <= root->start) return (start); @@ -1639,40 +1691,32 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s /* * Splay for the least large-enough gap in the right subtree. */ - llist = NULL; - rlist = NULL; - for (left_length = 0; ; - left_length = root->left != NULL ? - root->left->max_free : root->start - llist->end) { + llist = rlist = &map->header; + for (left_length = 0;; + left_length = vm_map_entry_max_free_left(root, llist)) { if (length <= left_length) SPLAY_LEFT_STEP(root, y, rlist, - length <= (y->left != NULL ? - y->left->max_free : y->start - llist->end)); + length <= vm_map_entry_max_free_left(y, llist)); else SPLAY_RIGHT_STEP(root, y, llist, - length > (y->left != NULL ? - y->left->max_free : y->start - root->end)); + length > vm_map_entry_max_free_left(y, root)); if (root == NULL) break; } root = llist; llist = root->right; - if ((y = rlist) == NULL) - root->right = NULL; - else { + root->right = NULL; + if (rlist != &map->header) { + y = rlist; rlist = y->left; y->left = NULL; - root->right = y->right; - } - root = vm_map_splay_merge(root, llist, rlist, - root->left, root->right); - if (y != NULL) { - y->right = root->right; - vm_map_entry_set_max_free(y); + vm_map_splay_merge(map, y, &map->header, rlist); + y->max_free = MAX( + vm_map_entry_max_free_left(y, root), + vm_map_entry_max_free_right(y, &map->header)); root->right = y; - vm_map_entry_set_max_free(root); } - map->root = root; + vm_map_splay_merge(map, root, llist, &map->header); VM_MAP_ASSERT_CONSISTENT(map); return (root->end); } From owner-svn-src-head@freebsd.org Mon Jun 10 21:50:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C877F15CA2AD; Mon, 10 Jun 2019 21:50:08 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DD678E945; Mon, 10 Jun 2019 21:50:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313F8202A6; Mon, 10 Jun 2019 21:50:08 +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 x5ALo8tS089526; Mon, 10 Jun 2019 21:50:08 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ALo8wL089525; Mon, 10 Jun 2019 21:50:08 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906102150.x5ALo8wL089525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 10 Jun 2019 21:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348882 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 348882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DD678E945 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 21:50:09 -0000 Author: loos Date: Mon Jun 10 21:50:07 2019 New Revision: 348882 URL: https://svnweb.freebsd.org/changeset/base/348882 Log: Add support for the GPIO SD Card VCC regulator/switch and the GPIO SD Card detection pins to the Marvell Xenon SDHCI controller. These features are enable by 'vqmmc-supply' and 'cd-gpios' properties in the DTS. This fixes the SD Card detection on espressobin. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/sdhci/sdhci_xenon.c Modified: head/sys/dev/sdhci/sdhci_xenon.c ============================================================================== --- head/sys/dev/sdhci/sdhci_xenon.c Mon Jun 10 21:34:07 2019 (r348881) +++ head/sys/dev/sdhci/sdhci_xenon.c Mon Jun 10 21:50:07 2019 (r348882) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -56,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" @@ -84,10 +86,12 @@ struct sdhci_xenon_softc { uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ + struct sdhci_fdt_gpio *gpio; /* GPIO pins for CD detection. */ struct sdhci_slot *slot; /* SDHCI internal data */ struct resource *mem_res; /* Memory resource */ + regulator_t reg_vqmmc; /* vqmmc-supply regulator */ uint8_t znr; /* PHY ZNR */ uint8_t zpr; /* PHY ZPR */ bool no_18v; /* No 1.8V support */ @@ -188,6 +192,14 @@ sdhci_xenon_get_ro(device_t bus, device_t dev) return (sdhci_generic_get_ro(bus, dev) ^ sc->wp_inverted); } +static bool +sdhci_xenon_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); +} + static int sdhci_xenon_phy_init(device_t brdev, struct mmc_ios *ios) { @@ -337,6 +349,25 @@ sdhci_xenon_update_ios(device_t brdev, device_t reqdev slot = device_get_ivars(reqdev); ios = &slot->host.ios; + switch (ios->power_mode) { + case power_on: + break; + case power_off: + if (bootverbose) + device_printf(sc->dev, "Powering down sd/mmc\n"); + + if (sc->reg_vqmmc) + regulator_disable(sc->reg_vqmmc); + break; + case power_up: + if (bootverbose) + device_printf(sc->dev, "Powering up sd/mmc\n"); + + if (sc->reg_vqmmc) + regulator_enable(sc->reg_vqmmc); + break; + }; + /* Update the PHY settings. */ if (ios->clock != 0) sdhci_xenon_phy_set(brdev, ios); @@ -352,6 +383,42 @@ sdhci_xenon_update_ios(device_t brdev, device_t reqdev } static int +sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) +{ + struct sdhci_xenon_softc *sc; + struct sdhci_slot *slot; + int uvolt, err; + + sc = device_get_softc(brdev); + + if (sc->reg_vqmmc == NULL) + return EOPNOTSUPP; + + slot = device_get_ivars(reqdev); + switch (slot->host.ios.vccq) { + case vccq_180: + uvolt = 1800000; + break; + case vccq_330: + uvolt = 3300000; + break; + default: + return EINVAL; + } + + err = regulator_set_voltage(sc->reg_vqmmc, uvolt, uvolt); + if (err != 0) { + device_printf(sc->dev, + "Cannot set vqmmc to %d<->%d\n", + uvolt, + uvolt); + return (err); + } + + return (0); +} + +static int sdhci_xenon_probe(device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(dev); @@ -389,6 +456,11 @@ sdhci_xenon_probe(device_t dev) if ((OF_getencprop(sc->node, "marvell,xenon-phy-zpr", &cid, sizeof(cid))) > 0) sc->zpr = cid & XENON_ZPR_MASK; + if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply", + &sc->reg_vqmmc) == 0 && bootverbose) { + if (bootverbose) + device_printf(dev, "vqmmc-supply regulator found\n"); + } return (0); } @@ -437,6 +509,12 @@ sdhci_xenon_attach(device_t dev) slot->max_clk = sc->max_clk; sc->slot = slot; + /* + * Set up any gpio pin handling described in the FDT data. This cannot + * fail; see comments in sdhci_fdt_gpio.h for details. + */ + sc->gpio = sdhci_fdt_gpio_setup(dev, slot); + if (sdhci_init_slot(dev, sc->slot, 0)) goto fail; @@ -497,6 +575,9 @@ sdhci_xenon_detach(device_t dev) { struct sdhci_xenon_softc *sc = device_get_softc(dev); + if (sc->gpio != NULL) + sdhci_fdt_gpio_teardown(sc->gpio); + bus_generic_detach(dev); bus_teardown_intr(dev, sc->irq_res, sc->intrhand); bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), @@ -526,6 +607,7 @@ static device_method_t sdhci_xenon_methods[] = { DEVMETHOD(mmcbr_get_ro, sdhci_xenon_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + DEVMETHOD(mmcbr_switch_vccq, sdhci_xenon_switch_vccq), /* SDHCI registers accessors */ DEVMETHOD(sdhci_read_1, sdhci_xenon_read_1), @@ -536,6 +618,7 @@ static device_method_t sdhci_xenon_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_xenon_write_2), DEVMETHOD(sdhci_write_4, sdhci_xenon_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_xenon_write_multi_4), + DEVMETHOD(sdhci_get_card_present, sdhci_xenon_get_card_present), DEVMETHOD_END }; From owner-svn-src-head@freebsd.org Mon Jun 10 22:06:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AC2315CA71B; Mon, 10 Jun 2019 22:06:41 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB10A8F21D; Mon, 10 Jun 2019 22:06:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E9CF20617; Mon, 10 Jun 2019 22:06:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5AM6eWJ099775; Mon, 10 Jun 2019 22:06:40 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5AM6e2W099774; Mon, 10 Jun 2019 22:06:40 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906102206.x5AM6e2W099774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 10 Jun 2019 22:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348883 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB10A8F21D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 22:06:41 -0000 Author: dougm Date: Mon Jun 10 22:06:40 2019 New Revision: 348883 URL: https://svnweb.freebsd.org/changeset/base/348883 Log: r348879 introduced a wrong-way comparison that broke mmap. This change rights that comparison. Reported by: pho Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20595 Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 10 21:50:07 2019 (r348882) +++ head/sys/vm/vm_mmap.c Mon Jun 10 22:06:40 2019 (r348883) @@ -259,7 +259,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t l size = len + pageoff; /* low end... */ size = round_page(size); /* hi end */ /* Check for rounding up to zero. */ - if (len < size) + if (len > size) return (ENOMEM); /* Ensure alignment is at least a page and fits in a pointer. */ From owner-svn-src-head@freebsd.org Mon Jun 10 22:58:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C1B115CB3EC for ; Mon, 10 Jun 2019 22:58:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBBB69D9F for ; Mon, 10 Jun 2019 22:58:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x736.google.com with SMTP id r6so6493669qkc.0 for ; Mon, 10 Jun 2019 15:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W7bom9QnspzaFs71kYZyYiaQGAM9uVchszIKw6Uf4TI=; b=0UOy1V+RTh+O7zxB9moLA9AztxsmVGZnW2gX7jbD05W+sJCMVWKbMakJugJU/1Xaot qfqBmbnvULIVhDqonpKkbtEO2Oh4e/R3k7PnZEALn4Y6kUmPw7ctp0g4a/FH9ux0Spj0 mMx8Qyfd60qpAAQkyhmDwXXusT7jrOhECCYNcKVlCsTFHYsUW4yDb9Soif/nw05yA85D BTYSgMMAS3XoI0cIczs+JKZp1hc48/7TBJU/B/fUKkZRI31co/xQotj7y1Bu6Ry0fRjg oCECoWPDhWcZcRvQ0Z8bqoGNnVl5+6U1RpQpr06cGueQcZGRmZ22q9BCjywFckZDlMeN fSAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W7bom9QnspzaFs71kYZyYiaQGAM9uVchszIKw6Uf4TI=; b=WYNCOhs79AtBkGVQ76eKkhuJ+4X8t3FfU2Y5stdI4gtMhUBiokvjGnna6aTrWhKe7c TpU7ZELGJOogxp/tvL0jNPgt9jJUYZy2Y5woV1jHKhvqlbuXHJfdk6px5Om8JnXmoCtV MYL5Y2vOwQY6Lk3kVdwYdTfIDlsuQOW7fxCc+wr22A5aO46aEFAXIA1ufkl91l8eWSzv nzJs8Zrvqshv7NKkgWr5AGGb+w0WJd+7Y7cVLF19kBRnC9xYt5EpTfPPw345ftTltqXk lJVSdhU+9iQD5I6zzM6rQmvJAYAavUrph3rLnjEW8Yp6e59JJrsA9P/TkICBqXgZx1R3 i9Og== X-Gm-Message-State: APjAAAU6XsrnMbOkGXY78cUgq5S3/+yKR/0HzY30oJa1UxKzzeNG6cRM /KMhBgnvPIbprxpHeZzn6ru1tRGevcm65AK01H72mQ== X-Google-Smtp-Source: APXvYqwSgnu6JSMfZ5TkayKWi/RQhQVjRGCc+m7PZrQEUhSbLN+xT3CQuz97tXgwkx+fIgCyA5qzZUAFqWK661u/qIo= X-Received: by 2002:a37:5942:: with SMTP id n63mr44966908qkb.69.1560207518537; Mon, 10 Jun 2019 15:58:38 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190611013853.E3415@besplex.bde.org> In-Reply-To: From: Warner Losh Date: Mon, 10 Jun 2019 16:58:27 -0600 Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: "Conrad E. Meyer" Cc: Bruce Evans , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 5EBBB69D9F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 22:58:40 -0000 On Mon, Jun 10, 2019 at 10:51 AM Conrad Meyer wrote: > On Mon, Jun 10, 2019 at 9:17 AM Bruce Evans wrote: > > Only headers and libraries should support -std=c89. has > > lots of support for compilers and POSIX versions going back to K&R C, > > and only the K&R parts are completely broken. > > Is this due to specific policy, or just inertia? (No one has bothered > to remove the old bits?) The older parts being totally broken > suggests sheer inertia. > As far as I know, it's been policy because there are a number of ports that compile with -std=c89, or used to be. I accidentally broke that a long time ago and had to fix it to unbreak a few ports (but granted, this was a while ago). Warner From owner-svn-src-head@freebsd.org Mon Jun 10 23:25:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B6715CB883; Mon, 10 Jun 2019 23:25:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5247C6A935; Mon, 10 Jun 2019 23:25:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 268062139B; Mon, 10 Jun 2019 23:25:41 +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 x5ANPf4L041920; Mon, 10 Jun 2019 23:25:41 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ANPeBe041915; Mon, 10 Jun 2019 23:25:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906102325.x5ANPeBe041915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 10 Jun 2019 23:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348885 - in head/sys: arm/allwinner arm/broadcom/bcm2835 arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/broadcom/bcm2835 arm64/rockchip X-SVN-Commit-Revision: 348885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5247C6A935 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 10 Jun 2019 23:25:42 -0000 Author: bz Date: Mon Jun 10 23:25:40 2019 New Revision: 348885 URL: https://svnweb.freebsd.org/changeset/base/348885 Log: A bit of code hygiene (no functional changes). Hide unused code under #ifdef notyet (in one case the only caller is under that same ifdef), or if it is arm (not arm64) specific code under the __arm__ ifdef to not yield -Wunused-function warnings during the arm64 kernel compile. MFC after: 2 weeks Modified: head/sys/arm/allwinner/a10_timer.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c head/sys/arm64/rockchip/if_dwc_rk.c Modified: head/sys/arm/allwinner/a10_timer.c ============================================================================== --- head/sys/arm/allwinner/a10_timer.c Mon Jun 10 22:23:37 2019 (r348884) +++ head/sys/arm/allwinner/a10_timer.c Mon Jun 10 23:25:40 2019 (r348885) @@ -108,12 +108,16 @@ struct a10_timer_softc { bus_write_4(sc->res[A10_TIMER_MEMRES], reg, val) static u_int a10_timer_get_timecount(struct timecounter *); +#if defined(__arm__) static int a10_timer_timer_start(struct eventtimer *, sbintime_t first, sbintime_t period); static int a10_timer_timer_stop(struct eventtimer *); +#endif static uint64_t timer_read_counter64(struct a10_timer_softc *sc); +#if defined(__arm__) static void a10_timer_eventtimer_setup(struct a10_timer_softc *sc); +#endif static void a23_timer_timecounter_setup(struct a10_timer_softc *sc); static u_int a23_timer_get_timecount(struct timecounter *tc); @@ -279,6 +283,7 @@ a10_timer_irq(void *arg) * Event timer function for A10 and A13 */ +#if defined(__arm__) static void a10_timer_eventtimer_setup(struct a10_timer_softc *sc) { @@ -363,6 +368,7 @@ a10_timer_timer_stop(struct eventtimer *et) return (0); } +#endif /* * Timecounter functions for A23 and above Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Mon Jun 10 22:23:37 2019 (r348884) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Mon Jun 10 23:25:40 2019 (r348885) @@ -251,6 +251,7 @@ WR4(struct bcm_sdhost_softc *sc, bus_size_t off, uint3 bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); } +#ifdef notyet static inline uint16_t RD2(struct bcm_sdhost_softc *sc, bus_size_t off) { @@ -260,6 +261,7 @@ RD2(struct bcm_sdhost_softc *sc, bus_size_t off) return ((val >> (off & 3)*8) & 0xffff); } +#endif static inline uint8_t RD1(struct bcm_sdhost_softc *sc, bus_size_t off) Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Mon Jun 10 22:23:37 2019 (r348884) +++ head/sys/arm64/rockchip/if_dwc_rk.c Mon Jun 10 23:25:40 2019 (r348885) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #define RK3328_GRF_MACPHY_CON3 0x0B0C #define RK3328_GRF_MACPHY_STATUS 0x0B10 +#ifdef notyet static void rk3328_set_delays(struct syscon *grf, phandle_t node) { @@ -82,6 +83,7 @@ rk3328_set_delays(struct syscon *grf, phandle_t node) SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); } +#endif #define RK3399_GRF_SOC_CON6 0xc218 #define RK3399_GRF_SOC_CON6_TX_MASK 0x7F @@ -89,6 +91,7 @@ rk3328_set_delays(struct syscon *grf, phandle_t node) #define RK3399_GRF_SOC_CON6_RX_MASK 0x7F #define RK3399_GRF_SOC_CON6_RX_SHIFT 8 +#ifdef notyet static void rk3399_set_delays(struct syscon *grf, phandle_t node) { @@ -106,6 +109,7 @@ rk3399_set_delays(struct syscon *grf, phandle_t node) SYSCON_WRITE_4(grf, RK3399_GRF_SOC_CON6, tx | rx | 0xFFFF0000); } +#endif static int if_dwc_rk_probe(device_t dev) From owner-svn-src-head@freebsd.org Tue Jun 11 00:55:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3242415CCF56; Tue, 11 Jun 2019 00:55:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC49A6CEFD; Tue, 11 Jun 2019 00:55:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B933E222E8; Tue, 11 Jun 2019 00:55:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5B0ttxr089235; Tue, 11 Jun 2019 00:55:55 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5B0tsOM089231; Tue, 11 Jun 2019 00:55:54 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906110055.x5B0tsOM089231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 11 Jun 2019 00:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348886 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 348886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC49A6CEFD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 00:55:56 -0000 Author: mhorne Date: Tue Jun 11 00:55:54 2019 New Revision: 348886 URL: https://svnweb.freebsd.org/changeset/base/348886 Log: RISC-V: expose extension bits in AT_HWCAP AT_HWCAP is a field in the elf auxiliary vector meant to describe cpu-specific hardware features. For RISC-V we want to use this to indicate the presence of any standard extensions supported by the CPU. This allows userland applications to query the system for supported extensions using elf_aux_info(3). Support for an extension is indicated by the presence of its corresponding bit in AT_HWCAP -- e.g. systems supporting the 'c' extension (compressed instructions) will have the second bit set. Extensions advertised through AT_HWCAP are only those that are supported by all harts in the system. Reviewed by: jhb, markj Approved by: markj (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20493 Modified: head/sys/riscv/include/elf.h head/sys/riscv/include/md_var.h head/sys/riscv/riscv/elf_machdep.c head/sys/riscv/riscv/identcpu.c Modified: head/sys/riscv/include/elf.h ============================================================================== --- head/sys/riscv/include/elf.h Mon Jun 10 23:25:40 2019 (r348885) +++ head/sys/riscv/include/elf.h Tue Jun 11 00:55:54 2019 (r348886) @@ -74,4 +74,15 @@ __ElfType(Auxinfo); /* TODO: set correct value */ #define ET_DYN_LOAD_ADDR 0x100000 +/* Flags passed in AT_HWCAP */ +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'A')) +#define HWCAP_ISA_I HWCAP_ISA_BIT('I') +#define HWCAP_ISA_M HWCAP_ISA_BIT('M') +#define HWCAP_ISA_A HWCAP_ISA_BIT('A') +#define HWCAP_ISA_F HWCAP_ISA_BIT('F') +#define HWCAP_ISA_D HWCAP_ISA_BIT('D') +#define HWCAP_ISA_C HWCAP_ISA_BIT('C') +#define HWCAP_ISA_G \ + (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/riscv/include/md_var.h ============================================================================== --- head/sys/riscv/include/md_var.h Mon Jun 10 23:25:40 2019 (r348885) +++ head/sys/riscv/include/md_var.h Tue Jun 11 00:55:54 2019 (r348886) @@ -38,6 +38,7 @@ extern char sigcode[]; extern int szsigcode; extern uint64_t *vm_page_dump; extern int vm_page_dump_size; +extern u_long elf_hwcap; struct dumperinfo; Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Mon Jun 10 23:25:40 2019 (r348885) +++ head/sys/riscv/riscv/elf_machdep.c Tue Jun 11 00:55:54 2019 (r348886) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +u_long elf_hwcap; + struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, @@ -90,6 +92,7 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf_hwcap, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/riscv/riscv/identcpu.c ============================================================================== --- head/sys/riscv/riscv/identcpu.c Mon Jun 10 23:25:40 2019 (r348885) +++ head/sys/riscv/riscv/identcpu.c Tue Jun 11 00:55:54 2019 (r348886) @@ -32,18 +32,28 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); #include +#include +#include #include #include -#include #include #include +#include +#include #include +#ifdef FDT +#include +#include +#endif + char machine[] = "riscv"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, @@ -87,6 +97,84 @@ const struct cpu_implementers cpu_implementers[] = { { CPU_IMPL_UCB_ROCKET, "UC Berkeley Rocket" }, CPU_IMPLEMENTER_NONE, }; + +#ifdef FDT +/* + * The ISA string is made up of a small prefix (e.g. rv64) and up to 26 letters + * indicating the presence of the 26 possible standard extensions. Therefore 32 + * characters will be sufficient. + */ +#define ISA_NAME_MAXLEN 32 +#define ISA_PREFIX ("rv" __XSTRING(__riscv_xlen)) +#define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) + +static void +fill_elf_hwcap(void *dummy __unused) +{ + u_long caps[256] = {0}; + char isa[ISA_NAME_MAXLEN]; + u_long hwcap; + phandle_t node; + ssize_t len; + int i; + + caps['i'] = caps['I'] = HWCAP_ISA_I; + caps['m'] = caps['M'] = HWCAP_ISA_M; + caps['a'] = caps['A'] = HWCAP_ISA_A; +#ifdef FPE + caps['f'] = caps['F'] = HWCAP_ISA_F; + caps['d'] = caps['D'] = HWCAP_ISA_D; +#endif + caps['c'] = caps['C'] = HWCAP_ISA_C; + + node = OF_finddevice("/cpus"); + if (node == -1) { + if (bootverbose) + printf("fill_elf_hwcap: Can't find cpus node\n"); + return; + } + + /* + * Iterate through the CPUs and examine their ISA string. While we + * could assign elf_hwcap to be whatever the boot CPU supports, to + * handle the (unusual) case of running a system with hetergeneous + * ISAs, keep only the extension bits that are common to all harts. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if (!fdt_is_compatible_strict(node, "riscv")) { + if (bootverbose) + printf("fill_elf_hwcap: Can't find cpu\n"); + return; + } + + len = OF_getprop(node, "riscv,isa", isa, sizeof(isa)); + KASSERT(len <= ISA_NAME_MAXLEN, ("ISA string truncated")); + if (len == -1) { + if (bootverbose) + printf("fill_elf_hwcap: " + "Can't find riscv,isa property\n"); + return; + } else if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != 0) { + if (bootverbose) + printf("fill_elf_hwcap: " + "Unsupported ISA string: %s\n", isa); + return; + } + + hwcap = 0; + for (i = ISA_PREFIX_LEN; i < len; i++) + hwcap |= caps[(unsigned char)isa[i]]; + + if (elf_hwcap != 0) + elf_hwcap &= hwcap; + else + elf_hwcap = hwcap; + + } +} + +SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); +#endif void identify_cpu(void) From owner-svn-src-head@freebsd.org Tue Jun 11 00:59:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1522215CD01D; Tue, 11 Jun 2019 00:59:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5AB16D0A2; Tue, 11 Jun 2019 00:59:47 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BDA4222EE; Tue, 11 Jun 2019 00:59:47 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5B0xlDG089442; Tue, 11 Jun 2019 00:59:47 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5B0xlvA089441; Tue, 11 Jun 2019 00:59:47 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201906110059.x5B0xlvA089441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 11 Jun 2019 00:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348887 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 348887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5AB16D0A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 00:59:48 -0000 Author: mhorne Date: Tue Jun 11 00:59:46 2019 New Revision: 348887 URL: https://svnweb.freebsd.org/changeset/base/348887 Log: procstat: Recognize HWCAP and HWCAP2 with auxv command The two most recent additions to the elf auxiliary vector are HWCAP and HWCAP2 which describe platform specific cpu capabilities. Make procstat recognize these fields so that they aren't displayed as UNKNOWN. Reviewed by: trociny, markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20582 Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Tue Jun 11 00:55:54 2019 (r348886) +++ head/usr.bin/procstat/procstat_auxv.c Tue Jun 11 00:59:46 2019 (r348887) @@ -185,6 +185,18 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); break; #endif +#ifdef AT_HWCAP + case AT_HWCAP: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP/%#lx}\n", + prefix, "AT_HWCAP", (u_long)auxv[i].a_un.a_val); + break; +#endif +#ifdef AT_HWCAP2 + case AT_HWCAP2: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_HWCAP2/%#lx}\n", + prefix, "AT_HWCAP2", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-head@freebsd.org Tue Jun 11 01:12:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D8E15CD833 for ; Tue, 11 Jun 2019 01:12:38 +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 799996DC55 for ; Tue, 11 Jun 2019 01:12:37 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1560215548; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Ym1Tt5yH+EV9Pt1tbG7qPNFNPt7tzbDMchITprVXS5H5tapCXNELmEocyTjNiNLnMbs1HzdQgoJum Blt4+WN6dO0OHYGLcPB1awirfSbTZmaCtjoU9kOp98ksOYLLsJQdFBfvBr0vlSg81IE2U5deUCeGMQ nAStxNEW8JGjJ9Na8Y2XUu2xejAzpNwzlU9enhWwe3TyeDppsnOTPMZB4qIYHmf0RJ8W/IwOf9Xu1H 9TaaHyDwF1ZfNcG/iHHsYb1Rgwpqe+f2CwVmW4yOLFHzuzxK1tLFPzLs7tFGhX8Aypzt5a7ktjjugO 6CTR1xf6CjXGqbMqjD7nWhHVBYmoUyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=RsTgiujJ5CDWSP++YXep9SkfpdIK2wm7aIYbDjroQUU=; b=P7326O/1AMp0B/2/RInfEQNJKs29M8CIkV+vx3WDSbVYTJBTU9n51TZx7nJPR7dN5523i0ZExnlHB C2NcZmTQ4mZBPP2OdFNL4ovYbEQJdwWqVmIv6EaOmv5zU71NhAKBIGawUMeJNX/BQfuWDFQ+SDo0mJ MNM8QNwtlPtKAm1F/TCbcm/M2NifEJXxSVpxZ6/939m6yDFfnX0Ae04EmqDn16fRFqMrrgIptvmufn 9X+UBSP0GO6V+hGhptGOZcktcM4AepfZsrBj0up1ceI8i5NPo8ginPdTF3GYz8YndF59rN4/c53+ZF rHIPr0VhwpXXQXY5HdxSrNdfAjbp02g== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=RsTgiujJ5CDWSP++YXep9SkfpdIK2wm7aIYbDjroQUU=; b=Vx4r4fHCrXl7fXwpiVFdy12E8VLDQYovsZ4TZoX88JQ0xrJBOZjeJ1HE+I/S1p1z6SbQVlxzri67F Y/k7H3f6iX8h2OhUhxOIz/IMgj1AmqE/nf1yeeAFv2nTG4uznioELxDSVcGC1hgWhrvq1aOotoFVoT MOJMsSgP+NOEJtJfBGPSpo9qmqwACKWtQroWxOPUh24UBx63dQKCogbDazqM7WuMSH83jUlB15Fkpq A5YObFDCZ62wIv7l5pHM2WqVIxqphKIa5QacLoLg1sQmJDiIPjw4SiQtTxogNEl7gjBGtb6f43p3LT p6NsCSTpgf6Au5VDD9pQoeyV8XvONXw== X-MHO-RoutePath: aGlwcGll X-MHO-User: f8c2858d-8be5-11e9-85c6-c97e5c048ed3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id f8c2858d-8be5-11e9-85c6-c97e5c048ed3; Tue, 11 Jun 2019 01:12:26 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x5B1COPC086507; Mon, 10 Jun 2019 19:12:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r348886 - in head/sys/riscv: include riscv From: Ian Lepore To: Mitchell Horne , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 10 Jun 2019 19:12:24 -0600 In-Reply-To: <201906110055.x5B0tsOM089231@repo.freebsd.org> References: <201906110055.x5B0tsOM089231@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 799996DC55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 01:12:38 -0000 On Tue, 2019-06-11 at 00:55 +0000, Mitchell Horne wrote: > Author: mhorne > Date: Tue Jun 11 00:55:54 2019 > New Revision: 348886 > URL: https://svnweb.freebsd.org/changeset/base/348886 > > Log: > RISC-V: expose extension bits in AT_HWCAP > > AT_HWCAP is a field in the elf auxiliary vector meant to describe > cpu-specific hardware features. For RISC-V we want to use this to > indicate the presence of any standard extensions supported by the > CPU. > This allows userland applications to query the system for supported > extensions using elf_aux_info(3). > > Support for an extension is indicated by the presence of its > corresponding bit in AT_HWCAP -- e.g. systems supporting the 'c' > extension (compressed instructions) will have the second bit set. > > Extensions advertised through AT_HWCAP are only those that are > supported > by all harts in the system. > A word of advice from the arm world (a don't make the mistakes we did kind of thing): If linux has already defined AT_HWCAP values for riscv, life may be better in the long run if our values match theirs as much as possible. It will especially help with ports. -- Ian > Reviewed by: jhb, markj > Approved by: markj (mentor) > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20493 > > Modified: > head/sys/riscv/include/elf.h > head/sys/riscv/include/md_var.h > head/sys/riscv/riscv/elf_machdep.c > head/sys/riscv/riscv/identcpu.c > > Modified: head/sys/riscv/include/elf.h > ===================================================================== > ========= > --- head/sys/riscv/include/elf.h Mon Jun 10 23:25:40 2019 (r348 > 885) > +++ head/sys/riscv/include/elf.h Tue Jun 11 00:55:54 2019 (r348 > 886) > @@ -74,4 +74,15 @@ __ElfType(Auxinfo); > /* TODO: set correct value */ > #define ET_DYN_LOAD_ADDR 0x100000 > > +/* Flags passed in AT_HWCAP */ > +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'A')) > +#define HWCAP_ISA_I HWCAP_ISA_BIT('I') > +#define HWCAP_ISA_M HWCAP_ISA_BIT('M') > +#define HWCAP_ISA_A HWCAP_ISA_BIT('A') > +#define HWCAP_ISA_F HWCAP_ISA_BIT('F') > +#define HWCAP_ISA_D HWCAP_ISA_BIT('D') > +#define HWCAP_ISA_C HWCAP_ISA_BIT('C') > +#define HWCAP_ISA_G \ > + (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | > HWCAP_ISA_D) > + > #endif /* !_MACHINE_ELF_H_ */ > > Modified: head/sys/riscv/include/md_var.h > ===================================================================== > ========= > --- head/sys/riscv/include/md_var.h Mon Jun 10 23:25:40 2019 (r348 > 885) > +++ head/sys/riscv/include/md_var.h Tue Jun 11 00:55:54 2019 (r348 > 886) > @@ -38,6 +38,7 @@ extern char sigcode[]; > extern int szsigcode; > extern uint64_t *vm_page_dump; > extern int vm_page_dump_size; > +extern u_long elf_hwcap; > > struct dumperinfo; > > > Modified: head/sys/riscv/riscv/elf_machdep.c > ===================================================================== > ========= > --- head/sys/riscv/riscv/elf_machdep.c Mon Jun 10 23:25:40 > 2019 (r348885) > +++ head/sys/riscv/riscv/elf_machdep.c Tue Jun 11 00:55:54 > 2019 (r348886) > @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +u_long elf_hwcap; > + > struct sysentvec elf64_freebsd_sysvec = { > .sv_size = SYS_MAXSYSCALL, > .sv_table = sysent, > @@ -90,6 +92,7 @@ struct sysentvec elf64_freebsd_sysvec = { > .sv_schedtail = NULL, > .sv_thread_detach = NULL, > .sv_trap = NULL, > + .sv_hwcap = &elf_hwcap, > }; > INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); > > > Modified: head/sys/riscv/riscv/identcpu.c > ===================================================================== > ========= > --- head/sys/riscv/riscv/identcpu.c Mon Jun 10 23:25:40 2019 (r348 > 885) > +++ head/sys/riscv/riscv/identcpu.c Tue Jun 11 00:55:54 2019 (r348 > 886) > @@ -32,18 +32,28 @@ > * SUCH DAMAGE. > */ > > +#include "opt_platform.h" > + > #include > __FBSDID("$FreeBSD$"); > > #include > +#include > +#include > #include > #include > -#include > > #include > #include > +#include > +#include > #include > > +#ifdef FDT > +#include > +#include > +#endif > + > char machine[] = "riscv"; > > SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, > @@ -87,6 +97,84 @@ const struct cpu_implementers cpu_implementers[] = > { > { CPU_IMPL_UCB_ROCKET, "UC Berkeley Rocket" }, > CPU_IMPLEMENTER_NONE, > }; > + > +#ifdef FDT > +/* > + * The ISA string is made up of a small prefix (e.g. rv64) and up to > 26 letters > + * indicating the presence of the 26 possible standard extensions. > Therefore 32 > + * characters will be sufficient. > + */ > +#define ISA_NAME_MAXLEN 32 > +#define ISA_PREFIX ("rv" > __XSTRING(__riscv_xlen)) > +#define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) > + > +static void > +fill_elf_hwcap(void *dummy __unused) > +{ > + u_long caps[256] = {0}; > + char isa[ISA_NAME_MAXLEN]; > + u_long hwcap; > + phandle_t node; > + ssize_t len; > + int i; > + > + caps['i'] = caps['I'] = HWCAP_ISA_I; > + caps['m'] = caps['M'] = HWCAP_ISA_M; > + caps['a'] = caps['A'] = HWCAP_ISA_A; > +#ifdef FPE > + caps['f'] = caps['F'] = HWCAP_ISA_F; > + caps['d'] = caps['D'] = HWCAP_ISA_D; > +#endif > + caps['c'] = caps['C'] = HWCAP_ISA_C; > + > + node = OF_finddevice("/cpus"); > + if (node == -1) { > + if (bootverbose) > + printf("fill_elf_hwcap: Can't find cpus > node\n"); > + return; > + } > + > + /* > + * Iterate through the CPUs and examine their ISA string. While > we > + * could assign elf_hwcap to be whatever the boot CPU supports, > to > + * handle the (unusual) case of running a system with > hetergeneous > + * ISAs, keep only the extension bits that are common to all > harts. > + */ > + for (node = OF_child(node); node > 0; node = OF_peer(node)) { > + if (!fdt_is_compatible_strict(node, "riscv")) { > + if (bootverbose) > + printf("fill_elf_hwcap: Can't find > cpu\n"); > + return; > + } > + > + len = OF_getprop(node, "riscv,isa", isa, sizeof(isa)); > + KASSERT(len <= ISA_NAME_MAXLEN, ("ISA string > truncated")); > + if (len == -1) { > + if (bootverbose) > + printf("fill_elf_hwcap: " > + "Can't find riscv,isa property\n"); > + return; > + } else if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != > 0) { > + if (bootverbose) > + printf("fill_elf_hwcap: " > + "Unsupported ISA string: %s\n", > isa); > + return; > + } > + > + hwcap = 0; > + for (i = ISA_PREFIX_LEN; i < len; i++) > + hwcap |= caps[(unsigned char)isa[i]]; > + > + if (elf_hwcap != 0) > + elf_hwcap &= hwcap; > + else > + elf_hwcap = hwcap; > + > + } > +} > + > +SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); > +#endif > > void > identify_cpu(void) > From owner-svn-src-head@freebsd.org Tue Jun 11 04:03:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A323F15ABAFD; Tue, 11 Jun 2019 04:03:37 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4456B7243E; Tue, 11 Jun 2019 04:03:37 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id B648B1DF00; Tue, 11 Jun 2019 04:03:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-oi1-f176.google.com with SMTP id m202so7908694oig.6; Mon, 10 Jun 2019 21:03:36 -0700 (PDT) X-Gm-Message-State: APjAAAVeWdM99amfa58cvVsb/6SGtMyRNylSlAptHKlBFuJlxAMHbFlS 7+QfA1XMHb3mHou1PHC9CcKdxPp2FZcOUL48EkI= X-Google-Smtp-Source: APXvYqxJUGwagK4K3ZUsFmDjVdSp3UO6uaLvzLWyrllLmqON37jbKqEeFnIs1DJxyEHYJ2GetF+kXm+4VViA1/mG+10= X-Received: by 2002:aca:3485:: with SMTP id b127mr13866091oia.86.1560225815585; Mon, 10 Jun 2019 21:03:35 -0700 (PDT) MIME-Version: 1.0 References: <201906110055.x5B0tsOM089231@repo.freebsd.org> In-Reply-To: From: Mitchell Horne Date: Tue, 11 Jun 2019 00:03:24 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348886 - in head/sys/riscv: include riscv 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-Rspamd-Queue-Id: 4456B7243E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 04:03:37 -0000 On Mon, Jun 10, 2019 at 9:12 PM Ian Lepore wrote: > > On Tue, 2019-06-11 at 00:55 +0000, Mitchell Horne wrote: > > Author: mhorne > > Date: Tue Jun 11 00:55:54 2019 > > New Revision: 348886 > > URL: https://svnweb.freebsd.org/changeset/base/348886 > > > > Log: > > RISC-V: expose extension bits in AT_HWCAP > > > > AT_HWCAP is a field in the elf auxiliary vector meant to describe > > cpu-specific hardware features. For RISC-V we want to use this to > > indicate the presence of any standard extensions supported by the > > CPU. > > This allows userland applications to query the system for supported > > extensions using elf_aux_info(3). > > > > Support for an extension is indicated by the presence of its > > corresponding bit in AT_HWCAP -- e.g. systems supporting the 'c' > > extension (compressed instructions) will have the second bit set. > > > > Extensions advertised through AT_HWCAP are only those that are > > supported > > by all harts in the system. > > > > A word of advice from the arm world (a don't make the mistakes we did > kind of thing): If linux has already defined AT_HWCAP values for > riscv, life may be better in the long run if our values match theirs as > much as possible. It will especially help with ports. > > -- Ian That's good advice. Rest assured that in this case we are mimicking the behaviour that's been implemented in Linux. Mitchell > > > Reviewed by: jhb, markj > > Approved by: markj (mentor) > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D20493 > > > > Modified: > > head/sys/riscv/include/elf.h > > head/sys/riscv/include/md_var.h > > head/sys/riscv/riscv/elf_machdep.c > > head/sys/riscv/riscv/identcpu.c > > > > Modified: head/sys/riscv/include/elf.h > > ===================================================================== > > ========= > > --- head/sys/riscv/include/elf.h Mon Jun 10 23:25:40 2019 (r348 > > 885) > > +++ head/sys/riscv/include/elf.h Tue Jun 11 00:55:54 2019 (r348 > > 886) > > @@ -74,4 +74,15 @@ __ElfType(Auxinfo); > > /* TODO: set correct value */ > > #define ET_DYN_LOAD_ADDR 0x100000 > > > > +/* Flags passed in AT_HWCAP */ > > +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'A')) > > +#define HWCAP_ISA_I HWCAP_ISA_BIT('I') > > +#define HWCAP_ISA_M HWCAP_ISA_BIT('M') > > +#define HWCAP_ISA_A HWCAP_ISA_BIT('A') > > +#define HWCAP_ISA_F HWCAP_ISA_BIT('F') > > +#define HWCAP_ISA_D HWCAP_ISA_BIT('D') > > +#define HWCAP_ISA_C HWCAP_ISA_BIT('C') > > +#define HWCAP_ISA_G \ > > + (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | > > HWCAP_ISA_D) > > + > > #endif /* !_MACHINE_ELF_H_ */ > > > > Modified: head/sys/riscv/include/md_var.h > > ===================================================================== > > ========= > > --- head/sys/riscv/include/md_var.h Mon Jun 10 23:25:40 2019 (r348 > > 885) > > +++ head/sys/riscv/include/md_var.h Tue Jun 11 00:55:54 2019 (r348 > > 886) > > @@ -38,6 +38,7 @@ extern char sigcode[]; > > extern int szsigcode; > > extern uint64_t *vm_page_dump; > > extern int vm_page_dump_size; > > +extern u_long elf_hwcap; > > > > struct dumperinfo; > > > > > > Modified: head/sys/riscv/riscv/elf_machdep.c > > ===================================================================== > > ========= > > --- head/sys/riscv/riscv/elf_machdep.c Mon Jun 10 23:25:40 > > 2019 (r348885) > > +++ head/sys/riscv/riscv/elf_machdep.c Tue Jun 11 00:55:54 > > 2019 (r348886) > > @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +u_long elf_hwcap; > > + > > struct sysentvec elf64_freebsd_sysvec = { > > .sv_size = SYS_MAXSYSCALL, > > .sv_table = sysent, > > @@ -90,6 +92,7 @@ struct sysentvec elf64_freebsd_sysvec = { > > .sv_schedtail = NULL, > > .sv_thread_detach = NULL, > > .sv_trap = NULL, > > + .sv_hwcap = &elf_hwcap, > > }; > > INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); > > > > > > Modified: head/sys/riscv/riscv/identcpu.c > > ===================================================================== > > ========= > > --- head/sys/riscv/riscv/identcpu.c Mon Jun 10 23:25:40 2019 (r348 > > 885) > > +++ head/sys/riscv/riscv/identcpu.c Tue Jun 11 00:55:54 2019 (r348 > > 886) > > @@ -32,18 +32,28 @@ > > * SUCH DAMAGE. > > */ > > > > +#include "opt_platform.h" > > + > > #include > > __FBSDID("$FreeBSD$"); > > > > #include > > +#include > > +#include > > #include > > #include > > -#include > > > > #include > > #include > > +#include > > +#include > > #include > > > > +#ifdef FDT > > +#include > > +#include > > +#endif > > + > > char machine[] = "riscv"; > > > > SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, > > @@ -87,6 +97,84 @@ const struct cpu_implementers cpu_implementers[] = > > { > > { CPU_IMPL_UCB_ROCKET, "UC Berkeley Rocket" }, > > CPU_IMPLEMENTER_NONE, > > }; > > + > > +#ifdef FDT > > +/* > > + * The ISA string is made up of a small prefix (e.g. rv64) and up to > > 26 letters > > + * indicating the presence of the 26 possible standard extensions. > > Therefore 32 > > + * characters will be sufficient. > > + */ > > +#define ISA_NAME_MAXLEN 32 > > +#define ISA_PREFIX ("rv" > > __XSTRING(__riscv_xlen)) > > +#define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) > > + > > +static void > > +fill_elf_hwcap(void *dummy __unused) > > +{ > > + u_long caps[256] = {0}; > > + char isa[ISA_NAME_MAXLEN]; > > + u_long hwcap; > > + phandle_t node; > > + ssize_t len; > > + int i; > > + > > + caps['i'] = caps['I'] = HWCAP_ISA_I; > > + caps['m'] = caps['M'] = HWCAP_ISA_M; > > + caps['a'] = caps['A'] = HWCAP_ISA_A; > > +#ifdef FPE > > + caps['f'] = caps['F'] = HWCAP_ISA_F; > > + caps['d'] = caps['D'] = HWCAP_ISA_D; > > +#endif > > + caps['c'] = caps['C'] = HWCAP_ISA_C; > > + > > + node = OF_finddevice("/cpus"); > > + if (node == -1) { > > + if (bootverbose) > > + printf("fill_elf_hwcap: Can't find cpus > > node\n"); > > + return; > > + } > > + > > + /* > > + * Iterate through the CPUs and examine their ISA string. While > > we > > + * could assign elf_hwcap to be whatever the boot CPU supports, > > to > > + * handle the (unusual) case of running a system with > > hetergeneous > > + * ISAs, keep only the extension bits that are common to all > > harts. > > + */ > > + for (node = OF_child(node); node > 0; node = OF_peer(node)) { > > + if (!fdt_is_compatible_strict(node, "riscv")) { > > + if (bootverbose) > > + printf("fill_elf_hwcap: Can't find > > cpu\n"); > > + return; > > + } > > + > > + len = OF_getprop(node, "riscv,isa", isa, sizeof(isa)); > > + KASSERT(len <= ISA_NAME_MAXLEN, ("ISA string > > truncated")); > > + if (len == -1) { > > + if (bootverbose) > > + printf("fill_elf_hwcap: " > > + "Can't find riscv,isa property\n"); > > + return; > > + } else if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != > > 0) { > > + if (bootverbose) > > + printf("fill_elf_hwcap: " > > + "Unsupported ISA string: %s\n", > > isa); > > + return; > > + } > > + > > + hwcap = 0; > > + for (i = ISA_PREFIX_LEN; i < len; i++) > > + hwcap |= caps[(unsigned char)isa[i]]; > > + > > + if (elf_hwcap != 0) > > + elf_hwcap &= hwcap; > > + else > > + elf_hwcap = hwcap; > > + > > + } > > +} > > + > > +SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); > > +#endif > > > > void > > identify_cpu(void) > > > From owner-svn-src-head@freebsd.org Tue Jun 11 08:20:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4376F15B28F7; Tue, 11 Jun 2019 08:20:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8D8381845; Tue, 11 Jun 2019 08:20:18 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45NNGg3Gxyz3c7W; Tue, 11 Jun 2019 08:20:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id 83ZYRQggd1LF; Tue, 11 Jun 2019 08:20:10 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-235-172.mobileonline.telia.com [95.192.235.172]) by mail.daemonic.se (Postfix) with ESMTPSA id 45NNGf4Xwwz3c7V; Tue, 11 Jun 2019 08:20:10 +0000 (UTC) Subject: Re: svn commit: r348873 - head/sys/dev/atkbdc To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906102004.x5AK46EI079752@gndrsh.dnsmgr.net> From: Niclas Zeising Message-ID: <4407062a-002e-f84d-5b18-9b748c9e1f53@freebsd.org> Date: Tue, 11 Jun 2019 10:20:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906102004.x5AK46EI079752@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C8D8381845 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.961,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 08:20:19 -0000 On 2019-06-10 22:04, Rodney W. Grimes wrote: >> Author: zeising (doc,ports committer) >> Date: Mon Jun 10 18:19:49 2019 >> New Revision: 348873 >> URL: https://svnweb.freebsd.org/changeset/base/348873 >> >> Log: >> psm(4): Enable touchpads and trackpads by default >> >> Enable synaptics and elantech touchpads, as well as IBM/Lenovo TrackPoints >> by default, instead of having users find and toggle a loader tunable. >> This makes things like two finger scroll and other modern features work out >> of the box with X. By enabling these settings by default, we get a better >> desktop experience in X, since xserver and evdev can make use of the more >> advanced synaptics and elantech features. >> >> Reviewed by: imp, wulf, 0mp >> Approved by: imp >> Sponsored by: B3 Init (zeising) >> Differential Revision: https://reviews.freebsd.org/D20507 > > This should of probably had a > Relnotes: Yes > as it changes default system behavior. You are right, sorry for not thinking about that. Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Tue Jun 11 11:16:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9EF15B7660; Tue, 11 Jun 2019 11:16:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91A99874F0; Tue, 11 Jun 2019 11:16:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69918CA3; Tue, 11 Jun 2019 11:16:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BBGgFQ014835; Tue, 11 Jun 2019 11:16:42 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BBGgtE014834; Tue, 11 Jun 2019 11:16:42 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906111116.x5BBGgtE014834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 11 Jun 2019 11:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348899 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 348899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91A99874F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 11:16:43 -0000 Author: luporl Date: Tue Jun 11 11:16:41 2019 New Revision: 348899 URL: https://svnweb.freebsd.org/changeset/base/348899 Log: [PPC64] Fix ofw_initrd Before this change, OFW initrd (as md) handling code was simulating an ofwbus device. But as there isn't really a Device Tree (DT) node representing OFW initrd (it is specified in 2 properties under /chosen), its driver was in fact stealing other driver's DT node. This was noticed after MD_ROOT_MEM became default and QEMU's USB keyboard stopped working under VNC. This change consists in simplifying the process of detection and mapping of initrd memory, turning it into a simple startup step, instead of trying to simulate a device. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20553 Modified: head/sys/powerpc/ofw/ofw_initrd.c Modified: head/sys/powerpc/ofw/ofw_initrd.c ============================================================================== --- head/sys/powerpc/ofw/ofw_initrd.c Tue Jun 11 10:41:39 2019 (r348898) +++ head/sys/powerpc/ofw/ofw_initrd.c Tue Jun 11 11:16:41 2019 (r348899) @@ -43,71 +43,41 @@ __FBSDID("$FreeBSD$"); #include "opt_md.h" -#ifdef MD_ROOT_MEM extern u_char *mfs_root; -extern uint32_t mfs_root_size; -#else -#warning "MD_ROOT_MEM should be set to use ofw initrd as a md device" -#endif +extern int mfs_root_size; -/* bus entry points */ -static int ofw_initrd_probe(device_t dev); -static int ofw_initrd_attach(device_t dev); -static void ofw_initrd_identify(driver_t *driver, device_t parent); +static void ofw_initrd_probe_and_attach(void *junk); -struct ofw_initrd_softc { - device_t sc_dev; - vm_paddr_t start; - vm_paddr_t end; -}; +SYSINIT(ofw_initrd_probe_and_attach, SI_SUB_KMEM, SI_ORDER_ANY, + ofw_initrd_probe_and_attach, NULL); -static int -ofw_initrd_probe(device_t dev) +static void +ofw_initrd_probe_and_attach(void *junk) { phandle_t chosen; - - /* limit this device to one unit */ - if (device_get_unit(dev) != 0) - return (ENXIO); - - chosen = OF_finddevice("/chosen"); - if (chosen <= 0) { - return (ENXIO); - } - - if (!OF_hasprop(chosen, "linux,initrd-start") || - !OF_hasprop(chosen, "linux,initrd-end")) - return (ENXIO); - - device_set_desc(dev, "OFW initrd memregion loader"); - return (BUS_PROBE_DEFAULT); -} - -static int -ofw_initrd_attach(device_t dev) -{ - struct ofw_initrd_softc *sc; vm_paddr_t start, end; - phandle_t chosen; pcell_t cell[2]; ssize_t size; - sc = device_get_softc(dev); + if (!hw_direct_map) + return; chosen = OF_finddevice("/chosen"); - if (chosen <= 0) { - device_printf(dev, "/chosen not found\n"); - return (ENXIO); - } + if (chosen <= 0) + return; + if (!OF_hasprop(chosen, "linux,initrd-start") || + !OF_hasprop(chosen, "linux,initrd-end")) + return; + size = OF_getencprop(chosen, "linux,initrd-start", cell, sizeof(cell)); if (size == 4) start = cell[0]; else if (size == 8) start = (uint64_t)cell[0] << 32 | cell[1]; else { - device_printf(dev, "Wrong linux,initrd-start size\n"); - return (ENXIO); + printf("ofw_initrd: Wrong linux,initrd-start size\n"); + return; } size = OF_getencprop(chosen, "linux,initrd-end", cell, sizeof(cell)); @@ -116,44 +86,15 @@ ofw_initrd_attach(device_t dev) else if (size == 8) end = (uint64_t)cell[0] << 32 | cell[1]; else{ - device_printf(dev, "Wrong linux,initrd-end size\n"); - return (ENXIO); + printf("ofw_initrd: Wrong linux,initrd-end size\n"); + return; } if (end - start > 0) { mfs_root = (u_char *) PHYS_TO_DMAP(start); mfs_root_size = end - start; - - return (0); + printf("ofw_initrd: initrd loaded at 0x%08lx-0x%08lx\n", + start, end); } - - return (ENXIO); } -static void -ofw_initrd_identify(driver_t *driver, device_t parent) -{ - if (device_find_child(parent, "initrd", -1) != NULL) - return; - - if (BUS_ADD_CHILD(parent, 10, "initrd", -1) == NULL) - device_printf(parent, "add ofw_initrd child failed\n"); -} - -static device_method_t ofw_initrd_methods[] = { - DEVMETHOD(device_identify, ofw_initrd_identify), - DEVMETHOD(device_probe, ofw_initrd_probe), - DEVMETHOD(device_attach, ofw_initrd_attach), - DEVMETHOD_END -}; - -static driver_t ofw_initrd_driver = { - "ofw_initrd", - ofw_initrd_methods, - sizeof(struct ofw_initrd_softc) -}; - -static devclass_t ofw_initrd_devclass; - -DRIVER_MODULE(ofw_initrd, ofwbus, ofw_initrd_driver, ofw_initrd_devclass, - NULL, NULL); From owner-svn-src-head@freebsd.org Tue Jun 11 11:23:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E537B15B7978; Tue, 11 Jun 2019 11:23:16 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82B3187B6F; Tue, 11 Jun 2019 11:23:16 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C54AE76; Tue, 11 Jun 2019 11:23:16 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BBNGfB020385; Tue, 11 Jun 2019 11:23:16 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BBNGZv020384; Tue, 11 Jun 2019 11:23:16 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906111123.x5BBNGZv020384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 11 Jun 2019 11:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348900 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 348900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82B3187B6F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 11:23:17 -0000 Author: luporl Date: Tue Jun 11 11:23:15 2019 New Revision: 348900 URL: https://svnweb.freebsd.org/changeset/base/348900 Log: [PPC] Fix build error when POWERNV is disabled When building a kernel supporting PSERIES but not POWERNV, the compiler would complain about an error variable being possibly used before being initialized. In practice, however, this should never happen. In any case, it is now initialized to an error value. Modified: head/sys/powerpc/pseries/xics.c Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Tue Jun 11 11:16:41 2019 (r348899) +++ head/sys/powerpc/pseries/xics.c Tue Jun 11 11:23:15 2019 (r348900) @@ -324,7 +324,7 @@ xicp_bind(device_t dev, u_int irq, cpuset_t cpumask, v struct xicp_softc *sc = device_get_softc(dev); struct xicp_intvec *iv; cell_t status, cpu; - int ncpus, i, error; + int ncpus, i, error = -1; /* Ignore IPIs */ if (irq == MAX_XICP_IRQS) From owner-svn-src-head@freebsd.org Tue Jun 11 15:52:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2003215BF46B; Tue, 11 Jun 2019 15:52:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA5456B889; Tue, 11 Jun 2019 15:52:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9519B3E46; Tue, 11 Jun 2019 15:52:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BFqgMZ062536; Tue, 11 Jun 2019 15:52:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BFqf3l062530; Tue, 11 Jun 2019 15:52:41 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906111552.x5BFqf3l062530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 11 Jun 2019 15:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348929 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA5456B889 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 15:52:43 -0000 Author: vmaffione Date: Tue Jun 11 15:52:41 2019 New Revision: 348929 URL: https://svnweb.freebsd.org/changeset/base/348929 Log: bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable() The VirtIO standard supports two schemes for notification suppression: a notification enable bit and a more sophisticated one (event_idx) that also supports delayed notifications. Currently bhyve fully supports only the first scheme. This patch hides the notification suppression internals by means of two inline routines, vq_kick_enable() and vq_kick_disable(), and makes the code more readable. Moreover, further improve readability by replacing the call to mb() with a call to atomic_thread_fence_seq_cst(), which is already used in virtio.c Reviewed by: pmooney_pfmooney.com, bryanv MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20581 Modified: head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_scsi.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Tue Jun 11 15:36:36 2019 (r348928) +++ head/usr.sbin/bhyve/pci_virtio_console.c Tue Jun 11 15:52:41 2019 (r348929) @@ -607,7 +607,7 @@ pci_vtcon_notify_rx(void *vsc, struct vqueue_info *vq) if (!port->vsp_rx_ready) { port->vsp_rx_ready = 1; - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } } Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Jun 11 15:36:36 2019 (r348928) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Jun 11 15:52:41 2019 (r348929) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifndef NETMAP_WITH_LIBS #define NETMAP_WITH_LIBS @@ -585,7 +584,7 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) */ if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } } @@ -631,7 +630,7 @@ pci_vtnet_ping_txq(void *vsc, struct vqueue_info *vq) /* Signal the tx thread for processing */ pthread_mutex_lock(&sc->tx_mtx); - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); if (sc->tx_in_progress == 0) pthread_cond_signal(&sc->tx_cond); pthread_mutex_unlock(&sc->tx_mtx); @@ -660,8 +659,7 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ while (sc->resetting || !vq_has_descs(vq)) { - vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; - mb(); + vq_kick_enable(vq); if (!sc->resetting && vq_has_descs(vq)) break; @@ -669,7 +667,7 @@ pci_vtnet_tx_thread(void *param) error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); assert(error == 0); } - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_scsi.c Tue Jun 11 15:36:36 2019 (r348928) +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Tue Jun 11 15:52:41 2019 (r348929) @@ -581,7 +581,7 @@ static void pci_vtscsi_eventq_notify(void *vsc, struct vqueue_info *vq) { - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } static void Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Tue Jun 11 15:36:36 2019 (r348928) +++ head/usr.sbin/bhyve/virtio.c Tue Jun 11 15:52:41 2019 (r348929) @@ -428,7 +428,8 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint /* * Ensure the used descriptor is visible before updating the index. - * This is necessary on ISAs with memory ordering less strict than x86. + * This is necessary on ISAs with memory ordering less strict than x86 + * (and even on x86 to act as a compiler barrier). */ atomic_thread_fence_rel(); vuh->vu_idx = uidx; Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Tue Jun 11 15:36:36 2019 (r348928) +++ head/usr.sbin/bhyve/virtio.h Tue Jun 11 15:52:41 2019 (r348929) @@ -31,6 +31,8 @@ #ifndef _VIRTIO_H_ #define _VIRTIO_H_ +#include + /* * These are derived from several virtio specifications. * @@ -445,6 +447,26 @@ vq_interrupt(struct virtio_softc *vs, struct vqueue_in pci_lintr_assert(vs->vs_pi); VS_UNLOCK(vs); } +} + +static inline void +vq_kick_enable(struct vqueue_info *vq) +{ + + vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; + /* + * Full memory barrier to make sure the store to vu_flags + * happens before the load from va_idx, which results from + * a subsequent call to vq_has_descs(). + */ + atomic_thread_fence_seq_cst(); +} + +static inline void +vq_kick_disable(struct vqueue_info *vq) +{ + + vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; } struct iovec; From owner-svn-src-head@freebsd.org Tue Jun 11 20:48:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B7115C6DFD; Tue, 11 Jun 2019 20:48:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86F6577F08; Tue, 11 Jun 2019 20:48:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 540DF6FD9; Tue, 11 Jun 2019 20:48:20 +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 x5BKmKbg018749; Tue, 11 Jun 2019 20:48:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BKmKZq018748; Tue, 11 Jun 2019 20:48:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906112048.x5BKmKZq018748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Jun 2019 20:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348963 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 348963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86F6577F08 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 20:48:21 -0000 Author: imp Date: Tue Jun 11 20:48:19 2019 New Revision: 348963 URL: https://svnweb.freebsd.org/changeset/base/348963 Log: Minor white space changes. Remove trailing white space that's crept into this file. Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Jun 11 18:57:25 2019 (r348962) +++ head/sys/cam/scsi/scsi_xpt.c Tue Jun 11 20:48:19 2019 (r348963) @@ -1603,7 +1603,7 @@ probe_device_check: start = strspn(serial_buf->serial_num, " "); slen = serial_buf->length - start; if (slen <= 0) { - /* + /* * SPC5r05 says that an all-space serial * number means no product serial number * is available @@ -2116,7 +2116,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *re CAM_GET_LUN(target->luns, 0, first); if (first == 0 && scan_info->lunindex[target_id] == 0) { scan_info->lunindex[target_id]++; - } + } /* * Skip any LUNs that the HBA can't deal with. @@ -2601,7 +2601,7 @@ scsi_dev_advinfo(union ccb *start_ccb) * We fetch extended inquiry data during probe, if * available. We don't allow changing it. */ - if (cdai->flags & CDAI_FLAG_STORE) + if (cdai->flags & CDAI_FLAG_STORE) return; cdai->provsiz = device->ext_inq_len; if (device->ext_inq_len == 0) @@ -2993,7 +2993,7 @@ scsi_dev_async(u_int32_t async_code, struct cam_eb *bu */ if (async_code == AC_SENT_BDR || async_code == AC_BUS_RESET) { - cam_freeze_devq(&newpath); + cam_freeze_devq(&newpath); cam_release_devq(&newpath, RELSIM_RELEASE_AFTER_TIMEOUT, /*reduction*/0, @@ -3051,7 +3051,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* Report connection speed */ + /* Report connection speed */ *speed = cpi.base_transfer_speed; *freq = 0; From owner-svn-src-head@freebsd.org Tue Jun 11 22:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D37E15C8668; Tue, 11 Jun 2019 22:06:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F049B826AF; Tue, 11 Jun 2019 22:06:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAD187D86; Tue, 11 Jun 2019 22:06:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BM65xm060452; Tue, 11 Jun 2019 22:06:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BM656n060451; Tue, 11 Jun 2019 22:06:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112206.x5BM656n060451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 22:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348964 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F049B826AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:06:06 -0000 Author: jhb Date: Tue Jun 11 22:06:05 2019 New Revision: 348964 URL: https://svnweb.freebsd.org/changeset/base/348964 Log: Trim an extra space. Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Jun 11 20:48:19 2019 (r348963) +++ head/sys/kern/kern_sendfile.c Tue Jun 11 22:06:05 2019 (r348964) @@ -303,7 +303,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i for (int i = 0; i < sfio->npages; i++) m = m_free(m); } else - (void )(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, + (void)(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, sfio->npages); SOCK_LOCK(so); From owner-svn-src-head@freebsd.org Tue Jun 11 22:06:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 417DF15C86A0; Tue, 11 Jun 2019 22:06:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAC5A827E7; Tue, 11 Jun 2019 22:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0C6B7D87; Tue, 11 Jun 2019 22:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BM6VUm060511; Tue, 11 Jun 2019 22:06:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BM6VZ9060510; Tue, 11 Jun 2019 22:06:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112206.x5BM6VZ9060510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 22:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348965 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAC5A827E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:06:32 -0000 Author: jhb Date: Tue Jun 11 22:06:31 2019 New Revision: 348965 URL: https://svnweb.freebsd.org/changeset/base/348965 Log: Add M_NOFREE to M_FLAG_BITS. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Jun 11 22:06:05 2019 (r348964) +++ head/sys/sys/mbuf.h Tue Jun 11 22:06:31 2019 (r348965) @@ -348,7 +348,7 @@ struct mbuf { */ #define M_FLAG_BITS \ "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ - "\7M_PROMISC\10M_VLANTAG\13M_TSTMP\14M_TSTMP_HPREC" + "\7M_PROMISC\10M_VLANTAG\12M_NOFREE\13M_TSTMP\14M_TSTMP_HPREC" #define M_FLAG_PROTOBITS \ "\15M_PROTO1\16M_PROTO2\17M_PROTO3\20M_PROTO4\21M_PROTO5" \ "\22M_PROTO6\23M_PROTO7\24M_PROTO8\25M_PROTO9\26M_PROTO10" \ From owner-svn-src-head@freebsd.org Tue Jun 11 22:07:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0BA115C8748; Tue, 11 Jun 2019 22:07:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54A608295F; Tue, 11 Jun 2019 22:07:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E4787D88; Tue, 11 Jun 2019 22:07:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BM7erO060599; Tue, 11 Jun 2019 22:07:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BM7dXB060597; Tue, 11 Jun 2019 22:07:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112207.x5BM7dXB060597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 22:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348966 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 348966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54A608295F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:07:40 -0000 Author: jhb Date: Tue Jun 11 22:07:39 2019 New Revision: 348966 URL: https://svnweb.freebsd.org/changeset/base/348966 Log: Sort opt_foo.h #includes and add a missing blank line in ip_output(). Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Jun 11 22:06:31 2019 (r348965) +++ head/sys/netinet/ip_output.c Tue Jun 11 22:07:39 2019 (r348966) @@ -35,13 +35,13 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_ratelimit.h" #include "opt_ipsec.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" +#include "opt_ratelimit.h" #include "opt_route.h" -#include "opt_sctp.h" #include "opt_rss.h" +#include "opt_sctp.h" #include #include @@ -283,6 +283,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou #if defined(IPSEC) || defined(IPSEC_SUPPORT) int no_route_but_check_spd = 0; #endif + M_ASSERTPKTHDR(m); if (inp != NULL) { Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue Jun 11 22:06:31 2019 (r348965) +++ head/sys/netinet6/ip6_output.c Tue Jun 11 22:07:39 2019 (r348966) @@ -67,11 +67,11 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ratelimit.h" #include "opt_ipsec.h" -#include "opt_sctp.h" +#include "opt_ratelimit.h" #include "opt_route.h" #include "opt_rss.h" +#include "opt_sctp.h" #include #include From owner-svn-src-head@freebsd.org Tue Jun 11 22:21:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11D115C8C95; Tue, 11 Jun 2019 22:21:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50CF882F06; Tue, 11 Jun 2019 22:21:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BEE180AF; Tue, 11 Jun 2019 22:21:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BMLTV4068336; Tue, 11 Jun 2019 22:21:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BMLTTG068335; Tue, 11 Jun 2019 22:21:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906112221.x5BMLTTG068335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 11 Jun 2019 22:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348967 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 348967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50CF882F06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:21:30 -0000 Author: delphij Date: Tue Jun 11 22:21:29 2019 New Revision: 348967 URL: https://svnweb.freebsd.org/changeset/base/348967 Log: Avoid out of boundary access when checking invalid long filenames. Obtained from: OpenBSD (dir.c,v 1.25) MFC after: 3 days Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Tue Jun 11 22:07:39 2019 (r348966) +++ head/sbin/fsck_msdosfs/dir.c Tue Jun 11 22:21:29 2019 (r348967) @@ -629,6 +629,15 @@ readDosDirSection(int f, struct bootblock *boot, struc vallfn = NULL; } lidx = *p & LRNOMASK; + if (lidx == 0) { + pwarn("invalid long name\n"); + if (!invlfn) { + invlfn = vallfn; + invcl = valcl; + } + vallfn = NULL; + continue; + } t = longName + --lidx * 13; for (k = 1; k < 11 && t < longName + sizeof(longName); k += 2) { From owner-svn-src-head@freebsd.org Tue Jun 11 22:41:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D78915C916E; Tue, 11 Jun 2019 22:41:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CBE4838E5; Tue, 11 Jun 2019 22:41:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFA58418; Tue, 11 Jun 2019 22:41:39 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BMfd2w081248; Tue, 11 Jun 2019 22:41:39 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BMfdvp081247; Tue, 11 Jun 2019 22:41:39 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906112241.x5BMfdvp081247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 11 Jun 2019 22:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348968 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CBE4838E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:41:40 -0000 Author: dougm Date: Tue Jun 11 22:41:39 2019 New Revision: 348968 URL: https://svnweb.freebsd.org/changeset/base/348968 Log: To test to see if a free space is big enough compare the required length to the difference of the two offsets that define the gap, to avoid overflow, rather that adding the length to an offset and comparing that to another offset. This addresses an overflow issue reported by Peter Holm on i386. Reported by: pho Tested by: pho Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20594 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Jun 11 22:21:29 2019 (r348967) +++ head/sys/vm/vm_map.c Tue Jun 11 22:41:39 2019 (r348968) @@ -1641,13 +1641,14 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s { vm_map_entry_t llist, rlist, root, y; vm_size_t left_length; + vm_offset_t gap_end; /* * Request must fit within min/max VM address and must avoid * address wrap. */ start = MAX(start, vm_map_min(map)); - if (start + length > vm_map_max(map) || start + length < start) + if (start >= vm_map_max(map) || length > vm_map_max(map) - start) return (vm_map_max(map) - length + 1); /* Empty tree means wide open address space. */ @@ -1655,13 +1656,19 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s return (start); /* - * After splay, if start comes before root node, then there - * must be a gap from start to the root. + * After splay_split, if start is within an entry, push it to the start + * of the following gap. If rlist is at the end of the gap containing + * start, save the end of that gap in gap_end to see if the gap is big + * enough; otherwise set gap_end to start skip gap-checking and move + * directly to a search of the right subtree. */ root = vm_map_splay_split(map, start, length, &llist, &rlist); - if (root != NULL) + gap_end = rlist->start; + if (root != NULL) { start = root->end; - else if (rlist != &map->header) { + if (root->right != NULL) + gap_end = start; + } else if (rlist != &map->header) { root = rlist; rlist = root->left; root->left = NULL; @@ -1672,18 +1679,9 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s } vm_map_splay_merge(map, root, llist, rlist); VM_MAP_ASSERT_CONSISTENT(map); - if (start + length <= root->start) + if (length <= gap_end - start) return (start); - /* - * Root is the last node that might begin its gap before - * start, and this is the last comparison where address - * wrap might be a problem. - */ - if (root->right == NULL && - start + length <= vm_map_max(map)) - return (start); - /* With max_free, can immediately tell if no solution. */ if (root->right == NULL || length > root->right->max_free) return (vm_map_max(map) - length + 1); @@ -1800,8 +1798,8 @@ vm_map_alignspace(vm_map_t map, vm_object_t object, vm VM_MAP_ASSERT_LOCKED(map); free_addr = *addr; KASSERT(free_addr == vm_map_findspace(map, free_addr, length), - ("caller failed to provide space %d at address %p", - (int)length, (void*)free_addr)); + ("caller failed to provide space %#jx at address %p", + (uintmax_t)length, (void *)free_addr)); for (;;) { /* * At the start of every iteration, the free space at address From owner-svn-src-head@freebsd.org Tue Jun 11 22:57:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A68E15C95B5; Tue, 11 Jun 2019 22:57:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC36F84139; Tue, 11 Jun 2019 22:57:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86A7C8608; Tue, 11 Jun 2019 22:57:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BMvQvD086691; Tue, 11 Jun 2019 22:57:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BMvQ3f086689; Tue, 11 Jun 2019 22:57:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112257.x5BMvQ3f086689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 22:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348969 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC36F84139 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 22:57:27 -0000 Author: jhb Date: Tue Jun 11 22:57:25 2019 New Revision: 348969 URL: https://svnweb.freebsd.org/changeset/base/348969 Log: Document sysctl nodes that translate their values. This documents the behavior of sysctl_msec_to_ticks and SYSCTL_{ADD,}_SBINTIME_[UM]SEC. Reviewed by: cem MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20596 Modified: head/share/man/man9/Makefile head/share/man/man9/sysctl.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jun 11 22:41:39 2019 (r348968) +++ head/share/man/man9/Makefile Tue Jun 11 22:57:25 2019 (r348969) @@ -2011,6 +2011,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_INT.9 \ sysctl.9 SYSCTL_INT_WITH_LABEL.9 \ sysctl.9 SYSCTL_LONG.9 \ + sysctl.9 sysctl_msec_to_ticks.9 \ sysctl.9 SYSCTL_NODE.9 \ sysctl.9 SYSCTL_NODE_WITH_LABEL.9 \ sysctl.9 SYSCTL_OPAQUE.9 \ Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Tue Jun 11 22:41:39 2019 (r348968) +++ head/share/man/man9/sysctl.9 Tue Jun 11 22:57:25 2019 (r348969) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2019 +.Dd June 11, 2019 .Dt SYSCTL 9 .Os .Sh NAME @@ -70,6 +70,7 @@ .Nm SYSCTL_INT , .Nm SYSCTL_INT_WITH_LABEL , .Nm SYSCTL_LONG , +.Nm sysctl_msec_to_ticks , .Nm SYSCTL_NODE , .Nm SYSCTL_NODE_WITH_LABEL , .Nm SYSCTL_OPAQUE , @@ -442,6 +443,8 @@ .Fn SYSCTL_INT parent number name ctlflags ptr val descr .Fn SYSCTL_INT_WITH_LABEL parent number name ctlflags ptr val descr label .Fn SYSCTL_LONG parent number name ctlflags ptr val descr +.Ft int +.Fn sysctl_msec_to_ticks SYSCTL_HANDLER_ARGS .Fn SYSCTL_NODE parent number name ctlflags handler descr .Fn SYSCTL_NODE_WITH_LABEL parent number name ctlflags handler descr label .Fn SYSCTL_OPAQUE parent number name ctlflags ptr len format descr @@ -466,6 +469,7 @@ .Fn SYSCTL_UQUAD parent number name ctlflags ptr val descr .Fn SYSCTL_UMA_MAX parent number name ctlflags ptr descr .Fn SYSCTL_UMA_CUR parent number name ctlflags ptr descr + .Sh DESCRIPTION The .Nm SYSCTL @@ -596,6 +600,55 @@ Labels should only be applied to siblings that are str and encode the same type of value, as aggregation is of no use otherwise. .El +.Sh NODE VALUE TYPES +Most of the macros and functions used to create sysctl nodes export a +read-only constant or in-kernel variable whose type matches the type +of the node's value. +For example, +.Fn SYSCTL_INT +reports the raw value of an associated variable of type +.Vt int . +However, nodes may also export a value that is a translatation of an internal +representation. +.Pp +The +.Fn sysctl_msec_to_ticks +handler can be used with +.Fn SYSCTL_PROC +or +.Fn SYSCTL_ADD_PROC +to export a millisecond time interval. +When using this handler, +the +.Fa arg2 +parameter points to an in-kernel variable of type +.Vt int +which stores a tick count suitable for use with functions like +.Xr tsleep 9 . +The +.Fn sysctl_msec_to_ticks +function converts this value to milliseconds when reporting the node's value. +Similarly, +.Fn sysctl_msec_to_ticks +accepts new values in milliseconds and stores an equivalent value in ticks to +.Fa *arg2 . +Note that new code should use kernel variables of type +.Vt sbintime_t +instead of tick counts. +.Pp +The +.Fn SYSCTL_ADD_SBINTIME_MSEC +and +.Fn SYSCTL_ADD_SBINTIME_USEC +functions and +.Fn SYSCTL_SBINTIME_MSEC +and +.Fn SYSCTL_SBINTIME_USEC +macros all create nodes which export an in-kernel variable of type +.Vt sbintime_t . +These nodes do not export the raw value of the associated variable. +Instead, they export a 64-bit integer containing a count of either +milliseconds (the MSEC variants) or microseconds (the USEC variants). .Sh CREATING ROOT NODES Sysctl MIBs or OIDs are created in a hierarchical tree. The nodes at the bottom of the tree are called root nodes, and have no From owner-svn-src-head@freebsd.org Tue Jun 11 23:00:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D239215C9699; Tue, 11 Jun 2019 23:00:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84FD38433E; Tue, 11 Jun 2019 23:00:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6161E8640; Tue, 11 Jun 2019 23:00:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BN0wnv086931; Tue, 11 Jun 2019 23:00:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BN0tIp086917; Tue, 11 Jun 2019 23:00:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112300.x5BN0tIp086917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 23:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348970 - in head: share/man/man9 sys/kern sys/kgssapi/krb5 sys/netipsec sys/opencrypto sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/kgssapi/krb5 sys/netipsec sys/opencrypto sys/sys X-SVN-Commit-Revision: 348970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84FD38433E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 23:00:59 -0000 Author: jhb Date: Tue Jun 11 23:00:55 2019 New Revision: 348970 URL: https://svnweb.freebsd.org/changeset/base/348970 Log: Make the warning intervals for deprecated crypto algorithms tunable. New sysctl/tunables can now set the interval (in seconds) between rate-limited crypto warnings. The new sysctls are: - kern.cryptodev_warn_interval for /dev/crypto - net.inet.ipsec.crypto_warn_interval for IPsec - kern.kgssapi_warn_interval for KGSSAPI Reviewed by: cem MFC after: 1 month Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20555 Modified: head/share/man/man9/Makefile head/share/man/man9/sysctl.9 head/sys/kern/kern_sysctl.c head/sys/kgssapi/krb5/kcrypto.c head/sys/kgssapi/krb5/kcrypto.h head/sys/kgssapi/krb5/kcrypto_arcfour.c head/sys/kgssapi/krb5/kcrypto_des.c head/sys/kgssapi/krb5/kcrypto_des3.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/opencrypto/cryptodev.c head/sys/sys/sysctl.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jun 11 22:57:25 2019 (r348969) +++ head/share/man/man9/Makefile Tue Jun 11 23:00:55 2019 (r348970) @@ -1996,6 +1996,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ADD_S64.9 \ sysctl.9 SYSCTL_ADD_STRING.9 \ sysctl.9 SYSCTL_ADD_STRUCT.9 \ + sysctl.9 SYSCTL_ADD_TIMEVAL_SEC.9 \ sysctl.9 SYSCTL_ADD_U8.9 \ sysctl.9 SYSCTL_ADD_U16.9 \ sysctl.9 SYSCTL_ADD_U32.9 \ @@ -2024,6 +2025,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_S64.9 \ sysctl.9 SYSCTL_STRING.9 \ sysctl.9 SYSCTL_STRUCT.9 \ + sysctl.9 SYSCTL_TIMEVAL_SEC.9 \ sysctl.9 SYSCTL_U8.9 \ sysctl.9 SYSCTL_U16.9 \ sysctl.9 SYSCTL_U32.9 \ Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Tue Jun 11 22:57:25 2019 (r348969) +++ head/share/man/man9/sysctl.9 Tue Jun 11 23:00:55 2019 (r348970) @@ -50,6 +50,7 @@ .Nm SYSCTL_ADD_STRING , .Nm SYSCTL_ADD_CONST_STRING , .Nm SYSCTL_ADD_STRUCT , +.Nm SYSCTL_ADD_TIMEVAL_SEC , .Nm SYSCTL_ADD_U8 , .Nm SYSCTL_ADD_U16 , .Nm SYSCTL_ADD_U32 , @@ -86,6 +87,7 @@ .Nm SYSCTL_STRING , .Nm SYSCTL_CONST_STRING , .Nm SYSCTL_STRUCT , +.Nm SYSCTL_TIMEVAL_SEC , .Nm SYSCTL_U8 , .Nm SYSCTL_U16 , .Nm SYSCTL_U32 , @@ -315,6 +317,16 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_TIMEVAL_SEC +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "struct timeval *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_U8 .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -460,6 +472,7 @@ .Fn SYSCTL_STRING parent number name ctlflags arg len descr .Fn SYSCTL_CONST_STRING parent number name ctlflags arg descr .Fn SYSCTL_STRUCT parent number name ctlflags ptr struct_type descr +.Fn SYSCTL_TIMEVAL_SEC parent number name ctlflags ptr descr .Fn SYSCTL_U8 parent number name ctlflags ptr val descr .Fn SYSCTL_U16 parent number name ctlflags ptr val descr .Fn SYSCTL_U32 parent number name ctlflags ptr val descr @@ -649,6 +662,21 @@ macros all create nodes which export an in-kernel vari These nodes do not export the raw value of the associated variable. Instead, they export a 64-bit integer containing a count of either milliseconds (the MSEC variants) or microseconds (the USEC variants). +.Pp +The +.Fn SYSCTL_ADD_TIMEVAL_SEC +function and +.Fn SYSCTL_TIMEVAL_SEC +macro create nodes which export an in-kernel variable of type +.Vt struct timeval . +These nodes do not export full value of the associated structure. +Instead, they export a count in seconds as a simple integer which is +stored in the +.Fa tv_sec +field of the associated variable. +This function and macro are intended to be used with variables which +store a non-negative interval rather than an absolute time. +As a result, they reject attempts to store negative values. .Sh CREATING ROOT NODES Sysctl MIBs or OIDs are created in a hierarchical tree. The nodes at the bottom of the tree are called root nodes, and have no @@ -731,6 +759,7 @@ Static sysctls are declared using one of the .Fn SYSCTL_STRING , .Fn SYSCTL_CONST_STRING , .Fn SYSCTL_STRUCT , +.Fn SYSCTL_TIMEVAL_SEC , .Fn SYSCTL_U8 , .Fn SYSCTL_U16 , .Fn SYSCTL_U32 , @@ -764,6 +793,7 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_STRING , .Fn SYSCTL_ADD_CONST_STRING , .Fn SYSCTL_ADD_STRUCT , +.Fn SYSCTL_ADD_TIMEVAL_SEC , .Fn SYSCTL_ADD_U8 , .Fn SYSCTL_ADD_U16 , .Fn SYSCTL_ADD_U32 , Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kern/kern_sysctl.c Tue Jun 11 23:00:55 2019 (r348970) @@ -1732,6 +1732,29 @@ sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS) return (0); } +/* + * Convert seconds to a struct timeval. Intended for use with + * intervals and thus does not permit negative seconds. + */ +int +sysctl_sec_to_timeval(SYSCTL_HANDLER_ARGS) +{ + struct timeval *tv; + int error, secs; + + tv = arg1; + secs = tv->tv_sec; + + error = sysctl_handle_int(oidp, &secs, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (secs < 0) + return (EINVAL); + tv->tv_sec = secs; + + return (0); +} /* * Transfer functions to/from kernel space. Modified: head/sys/kgssapi/krb5/kcrypto.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kgssapi/krb5/kcrypto.c Tue Jun 11 23:00:55 2019 (r348970) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -49,6 +50,11 @@ static struct krb5_encryption_class *krb5_encryption_c &krb5_arcfour_56_encryption_class, NULL }; + +struct timeval krb5_warn_interval = { .tv_sec = 3600, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, kgssapi_warn_interval, CTLFLAG_RW, + &krb5_warn_interval, + "Delay in seconds between warnings of deprecated KGSSAPI crypto."); struct krb5_encryption_class * krb5_find_encryption_class(int etype) Modified: head/sys/kgssapi/krb5/kcrypto.h ============================================================================== --- head/sys/kgssapi/krb5/kcrypto.h Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kgssapi/krb5/kcrypto.h Tue Jun 11 23:00:55 2019 (r348970) @@ -101,6 +101,7 @@ extern struct krb5_encryption_class krb5_aes128_encryp extern struct krb5_encryption_class krb5_aes256_encryption_class; extern struct krb5_encryption_class krb5_arcfour_encryption_class; extern struct krb5_encryption_class krb5_arcfour_56_encryption_class; +extern struct timeval krb5_warn_interval; static __inline void krb5_set_key(struct krb5_key_state *ks, const void *keydata) Modified: head/sys/kgssapi/krb5/kcrypto_arcfour.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_arcfour.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kgssapi/krb5/kcrypto_arcfour.c Tue Jun 11 23:00:55 2019 (r348970) @@ -47,10 +47,9 @@ static void arcfour_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; ks->ks_priv = NULL; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "RC4 cipher for Kerberos GSS"); } Modified: head/sys/kgssapi/krb5/kcrypto_des.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kgssapi/krb5/kcrypto_des.c Tue Jun 11 23:00:55 2019 (r348970) @@ -54,13 +54,12 @@ static void des1_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des1_state *ds; ds = malloc(sizeof(struct des1_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des lock", NULL, MTX_DEF); ks->ks_priv = ds; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "DES cipher for Kerberos GSS"); } Modified: head/sys/kgssapi/krb5/kcrypto_des3.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des3.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/kgssapi/krb5/kcrypto_des3.c Tue Jun 11 23:00:55 2019 (r348970) @@ -55,13 +55,12 @@ static void des3_init(struct krb5_key_state *ks) { static struct timeval lastwarn; - static struct timeval warninterval = { .tv_sec = 3600, .tv_usec = 0 }; struct des3_state *ds; ds = malloc(sizeof(struct des3_state), M_GSSAPI, M_WAITOK|M_ZERO); mtx_init(&ds->ds_lock, "gss des3 lock", NULL, MTX_DEF); ks->ks_priv = ds; - if (ratecheck(&lastwarn, &warninterval)) + if (ratecheck(&lastwarn, &krb5_warn_interval)) gone_in(13, "DES3 cipher for Kerberos GSS"); } Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/netipsec/ipsec.c Tue Jun 11 23:00:55 2019 (r348970) @@ -216,6 +216,11 @@ SYSCTL_INT(_net_inet_ipsec, OID_AUTO, filtertunnel, SYSCTL_VNET_PCPUSTAT(_net_inet_ipsec, OID_AUTO, ipsecstats, struct ipsecstat, ipsec4stat, "IPsec IPv4 statistics."); +struct timeval ipsec_warn_interval = { .tv_sec = 1, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_net_inet_ipsec, OID_AUTO, crypto_warn_interval, CTLFLAG_RW, + &ipsec_warn_interval, + "Delay in seconds between warnings of deprecated IPsec crypto algorithms."); + #ifdef REGRESSION /* * When set to 1, IPsec will send packets with the same sequence number. Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/netipsec/ipsec.h Tue Jun 11 23:00:55 2019 (r348970) @@ -287,6 +287,8 @@ VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, async_crypto); VNET_DECLARE(int, natt_cksum_policy); +extern struct timeval ipsec_warn_interval; + #define IPSECSTAT_INC(name) \ VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1) #define V_ip4_esp_trans_deflev VNET(ip4_esp_trans_deflev) Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/netipsec/xform_ah.c Tue Jun 11 23:00:55 2019 (r348970) @@ -109,7 +109,6 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_ah, IPSECCTL_STATS, sta static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */ static struct timeval md5warn, ripewarn, kpdkmd5warn, kpdksha1warn; -static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; static int ah_input_cb(struct cryptop*); static int ah_output_cb(struct cryptop*); @@ -189,19 +188,19 @@ ah_init0(struct secasvar *sav, struct xformsw *xsp, st switch (sav->alg_auth) { case SADB_AALG_MD5HMAC: - if (ratecheck(&md5warn, &warninterval)) + if (ratecheck(&md5warn, &ipsec_warn_interval)) gone_in(13, "MD5-HMAC authenticator for IPsec"); break; case SADB_X_AALG_RIPEMD160HMAC: - if (ratecheck(&ripewarn, &warninterval)) + if (ratecheck(&ripewarn, &ipsec_warn_interval)) gone_in(13, "RIPEMD160-HMAC authenticator for IPsec"); break; case SADB_X_AALG_MD5: - if (ratecheck(&kpdkmd5warn, &warninterval)) + if (ratecheck(&kpdkmd5warn, &ipsec_warn_interval)) gone_in(13, "Keyed-MD5 authenticator for IPsec"); break; case SADB_X_AALG_SHA: - if (ratecheck(&kpdksha1warn, &warninterval)) + if (ratecheck(&kpdksha1warn, &ipsec_warn_interval)) gone_in(13, "Keyed-SHA1 authenticator for IPsec"); break; } Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/netipsec/xform_esp.c Tue Jun 11 23:00:55 2019 (r348970) @@ -95,7 +95,6 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_esp, IPSECCTL_STATS, st "ESP statistics (struct espstat, netipsec/esp_var.h"); static struct timeval deswarn, blfwarn, castwarn, camelliawarn; -static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); @@ -162,19 +161,19 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) switch (sav->alg_enc) { case SADB_EALG_DESCBC: - if (ratecheck(&deswarn, &warninterval)) + if (ratecheck(&deswarn, &ipsec_warn_interval)) gone_in(13, "DES cipher for IPsec"); break; case SADB_X_EALG_BLOWFISHCBC: - if (ratecheck(&blfwarn, &warninterval)) + if (ratecheck(&blfwarn, &ipsec_warn_interval)) gone_in(13, "Blowfish cipher for IPsec"); break; case SADB_X_EALG_CAST128CBC: - if (ratecheck(&castwarn, &warninterval)) + if (ratecheck(&castwarn, &ipsec_warn_interval)) gone_in(13, "CAST cipher for IPsec"); break; case SADB_X_EALG_CAMELLIACBC: - if (ratecheck(&camelliawarn, &warninterval)) + if (ratecheck(&camelliawarn, &ipsec_warn_interval)) gone_in(13, "Camellia cipher for IPsec"); break; } Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/opencrypto/cryptodev.c Tue Jun 11 23:00:55 2019 (r348970) @@ -146,6 +146,11 @@ struct cryptostats32 { #define CIOCGSESSION232 _IOWR('c', 106, struct session2_op32) #define CIOCKEY232 _IOWR('c', 107, struct crypt_kop32) +static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_interval, CTLFLAG_RW, + &warninterval, + "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); + static void session_op_from_32(const struct session_op32 *from, struct session_op *to) { @@ -388,7 +393,6 @@ cryptof_ioctl( #endif static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; static struct timeval skipwarn, tdeswarn; - static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; switch (cmd) { case CIOCGSESSION: Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Jun 11 22:57:25 2019 (r348969) +++ head/sys/sys/sysctl.h Tue Jun 11 23:00:55 2019 (r348970) @@ -218,6 +218,7 @@ int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); int sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS); int sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS); +int sysctl_sec_to_timeval(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); @@ -854,6 +855,24 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ __ptr, 0, sysctl_msec_to_sbintime, "Q", __DESCR(descr), \ + NULL); \ +}) + +/* OID expressing a struct timeval as seconds */ +#define SYSCTL_TIMEVAL_SEC(parent, nbr, name, access, ptr, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + (ptr), 0, sysctl_sec_to_timeval, "I", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) +#define SYSCTL_ADD_TIMEVAL_SEC(ctx, parent, nbr, name, access, ptr, descr) \ +({ \ + struct timeval *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + __ptr, 0, sysctl_sec_to_timeval, "I", __DESCR(descr), \ NULL); \ }) From owner-svn-src-head@freebsd.org Tue Jun 11 23:28:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA5515C9D10; Tue, 11 Jun 2019 23:28:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B3F85166; Tue, 11 Jun 2019 23:28:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07F318B27; Tue, 11 Jun 2019 23:28:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5BNS7xh002573; Tue, 11 Jun 2019 23:28:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BNS7NJ002572; Tue, 11 Jun 2019 23:28:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906112328.x5BNS7NJ002572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Jun 2019 23:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348974 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 348974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35B3F85166 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 23:28:08 -0000 Author: jhb Date: Tue Jun 11 23:28:07 2019 New Revision: 348974 URL: https://svnweb.freebsd.org/changeset/base/348974 Log: Move declaration of warninterval out from under COMPAT_FREEBSD32. This fixes builds of kernels without COMPAT_FREEBSD32. Reported by: tinderbox MFC after: 1 month Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Jun 11 23:23:01 2019 (r348973) +++ head/sys/opencrypto/cryptodev.c Tue Jun 11 23:28:07 2019 (r348974) @@ -146,11 +146,6 @@ struct cryptostats32 { #define CIOCGSESSION232 _IOWR('c', 106, struct session2_op32) #define CIOCKEY232 _IOWR('c', 107, struct crypt_kop32) -static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; -SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_interval, CTLFLAG_RW, - &warninterval, - "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); - static void session_op_from_32(const struct session_op32 *from, struct session_op *to) { @@ -298,6 +293,11 @@ struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; }; + +static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_interval, CTLFLAG_RW, + &warninterval, + "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); static int cryptof_ioctl(struct file *, u_long, void *, struct ucred *, struct thread *); From owner-svn-src-head@freebsd.org Tue Jun 11 23:35:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B056015CA02E; Tue, 11 Jun 2019 23:35:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C75585643; Tue, 11 Jun 2019 23:35:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 190158CD3; Tue, 11 Jun 2019 23:35:35 +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 x5BNZYfx007554; Tue, 11 Jun 2019 23:35:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BNZYfe007553; Tue, 11 Jun 2019 23:35:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906112335.x5BNZYfe007553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 11 Jun 2019 23:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348975 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 348975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C75585643 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 23:35:35 -0000 Author: bdrewery Date: Tue Jun 11 23:35:34 2019 New Revision: 348975 URL: https://svnweb.freebsd.org/changeset/base/348975 Log: Restore genassym.o to CLEANFILES. This was lost in r335910 for some reason. This also fixes a META_MODE rebuild issue in some modules [1]. MFC after: 2 weeks Reported by: npn [1] Sponsored by: DellEMC Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jun 11 23:28:07 2019 (r348974) +++ head/sys/conf/kmod.mk Tue Jun 11 23:35:34 2019 (r348975) @@ -500,7 +500,7 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS .endif .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc) -CLEANFILES+= assym.inc +CLEANFILES+= assym.inc genassym.o DEPENDOBJS+= genassym.o DPSRCS+= offset.inc .endif From owner-svn-src-head@freebsd.org Tue Jun 11 23:35:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251DD15CA05B; Tue, 11 Jun 2019 23:35:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7A4685734; Tue, 11 Jun 2019 23:35: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E7B08CD4; Tue, 11 Jun 2019 23:35: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 x5BNZn5J007605; Tue, 11 Jun 2019 23:35:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5BNZnBd007604; Tue, 11 Jun 2019 23:35:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906112335.x5BNZnBd007604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 11 Jun 2019 23:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348976 - head/sys/modules/efirt X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/modules/efirt X-SVN-Commit-Revision: 348976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7A4685734 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 11 Jun 2019 23:35:50 -0000 Author: bdrewery Date: Tue Jun 11 23:35:49 2019 New Revision: 348976 URL: https://svnweb.freebsd.org/changeset/base/348976 Log: Add missing DPSRCS entry for assym.inc. This brings in various CLEANFILES/DEPENDOBJS handling. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/sys/modules/efirt/Makefile Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Tue Jun 11 23:35:34 2019 (r348975) +++ head/sys/modules/efirt/Makefile Tue Jun 11 23:35:49 2019 (r348976) @@ -11,6 +11,7 @@ SRCS+= device_if.h bus_if.h clock_if.h .if ${MACHINE_CPUARCH} == "amd64" SRCS+= opt_hwpmc_hooks.h opt_kstack_pages.h SRCS+= efirt_support.S +DPSRCS+= assym.inc efirt_support.o: efirt_support.S assym.inc ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} From owner-svn-src-head@freebsd.org Wed Jun 12 00:03:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D948F15CA98B; Wed, 12 Jun 2019 00:03:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 793048648A; Wed, 12 Jun 2019 00:03:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F1C491D9; Wed, 12 Jun 2019 00:03:02 +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 x5C0321p023179; Wed, 12 Jun 2019 00:03:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5C030G9023172; Wed, 12 Jun 2019 00:03:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906120003.x5C030G9023172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 12 Jun 2019 00:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348979 - in head/sys/modules: iwmfw iwnfw mwlfw ralfw rtwnfw usb/rsufw usb/runfw X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/sys/modules: iwmfw iwnfw mwlfw ralfw rtwnfw usb/rsufw usb/runfw X-SVN-Commit-Revision: 348979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 793048648A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 00:03:03 -0000 Author: bdrewery Date: Wed Jun 12 00:03:00 2019 New Revision: 348979 URL: https://svnweb.freebsd.org/changeset/base/348979 Log: Stop using .OODATE for extracting firmware. This fixes META_MODE rebuilding since it assumes that it this is a non-consistent build command. These are always unencoded consistently though and do not need to use the .OODATE/$? mechanism. MFC after: 2 weeks Reported by: npn Sponsored by: DellEMC Modified: head/sys/modules/iwmfw/Makefile.inc head/sys/modules/iwnfw/Makefile.inc head/sys/modules/mwlfw/Makefile head/sys/modules/ralfw/Makefile.inc head/sys/modules/rtwnfw/Makefile.inc head/sys/modules/usb/rsufw/Makefile.inc head/sys/modules/usb/runfw/Makefile Modified: head/sys/modules/iwmfw/Makefile.inc ============================================================================== --- head/sys/modules/iwmfw/Makefile.inc Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/iwmfw/Makefile.inc Wed Jun 12 00:03:00 2019 (r348979) @@ -15,4 +15,4 @@ FIRMWS= ${_FIRM}:${KMOD} #FIRMWARE_LICENSE= ${_FIRM}: ${SRCTOP}/sys/contrib/dev/iwm/${_FIRM}.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} Modified: head/sys/modules/iwnfw/Makefile.inc ============================================================================== --- head/sys/modules/iwnfw/Makefile.inc Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/iwnfw/Makefile.inc Wed Jun 12 00:03:00 2019 (r348979) @@ -15,4 +15,4 @@ FIRMWS= ${_FIRM}:${KMOD} #FIRMWARE_LICENSE= ${_FIRM}: ${SRCTOP}/sys/contrib/dev/iwn/${_FIRM}.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} Modified: head/sys/modules/mwlfw/Makefile ============================================================================== --- head/sys/modules/mwlfw/Makefile Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/mwlfw/Makefile Wed Jun 12 00:03:00 2019 (r348979) @@ -6,9 +6,9 @@ FIRMWS= mw88W8363.fw:mw88W8363fw mwlboot.fw:mwlboot CLEANFILES+= mw88W8363.fw mwlboot.fw mw88W8363.fw: ${SRCTOP}/sys/contrib/dev/mwl/mw88W8363.fw.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} mwlboot.fw: ${SRCTOP}/sys/contrib/dev/mwl/mwlboot.fw.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} .include Modified: head/sys/modules/ralfw/Makefile.inc ============================================================================== --- head/sys/modules/ralfw/Makefile.inc Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/ralfw/Makefile.inc Wed Jun 12 00:03:00 2019 (r348979) @@ -12,4 +12,4 @@ CLEANFILES+= ${_FIRM} FIRMWS= ${_FIRM}:${KMOD} ${_FIRM}: ${SRCTOP}/sys/contrib/dev/ral/${_FIRM}.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} Modified: head/sys/modules/rtwnfw/Makefile.inc ============================================================================== --- head/sys/modules/rtwnfw/Makefile.inc Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/rtwnfw/Makefile.inc Wed Jun 12 00:03:00 2019 (r348979) @@ -12,4 +12,4 @@ FIRMWS= ${_FIRM}:${KMOD}:111 # FIRMWARE_LICENSE= realtek ${_FIRM}: ${SRCTOP}/sys/contrib/dev/rtwn/${_FIRM}.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} Modified: head/sys/modules/usb/rsufw/Makefile.inc ============================================================================== --- head/sys/modules/usb/rsufw/Makefile.inc Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/usb/rsufw/Makefile.inc Wed Jun 12 00:03:00 2019 (r348979) @@ -12,4 +12,4 @@ FIRMWS= ${_FIRM}:${KMOD}:120 # FIRMWARE_LICENSE= realtek ${_FIRM}: ${SRCTOP}/sys/contrib/dev/rsu/${_FIRM}.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} Modified: head/sys/modules/usb/runfw/Makefile ============================================================================== --- head/sys/modules/usb/runfw/Makefile Tue Jun 11 23:46:31 2019 (r348978) +++ head/sys/modules/usb/runfw/Makefile Wed Jun 12 00:03:00 2019 (r348979) @@ -6,6 +6,6 @@ FIRMWS= run.fw:runfw:1 CLEANFILES= run.fw run.fw: ${SRCTOP}/sys/contrib/dev/run/rt2870.fw.uu - uudecode -p $? > ${.TARGET} + uudecode -p ${.ALLSRC} > ${.TARGET} .include From owner-svn-src-head@freebsd.org Wed Jun 12 09:16:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044E015AEDCF; Wed, 12 Jun 2019 09:16:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83ACE6DA5C; Wed, 12 Jun 2019 09:16:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C6EBF01E; Wed, 12 Jun 2019 09:16:43 +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 x5C9GhbK009232; Wed, 12 Jun 2019 09:16:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5C9Gh7O009231; Wed, 12 Jun 2019 09:16:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201906120916.x5C9Gh7O009231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 12 Jun 2019 09:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348981 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 348981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83ACE6DA5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 09:16:44 -0000 Author: manu Date: Wed Jun 12 09:16:42 2019 New Revision: 348981 URL: https://svnweb.freebsd.org/changeset/base/348981 Log: pkgbase: Set a default package=runtime for var directories This way every directory is at least present in packages. While here tag some directory from being in sendmail or dma Reviewed by: bapt MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20605 Modified: head/etc/mtree/BSD.var.dist Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Wed Jun 12 01:53:14 2019 (r348980) +++ head/etc/mtree/BSD.var.dist Wed Jun 12 09:16:42 2019 (r348981) @@ -3,7 +3,7 @@ # Please see the file src/etc/mtree/README before making changes to this file. # -/set type=dir uname=root gname=wheel mode=0755 +/set type=dir uname=root gname=wheel mode=0755 tags=package=runtime . account .. @@ -32,7 +32,7 @@ .. crash .. - cron tags=package=runtime + cron tabs mode=0700 .. .. @@ -59,21 +59,21 @@ .. .. .. - empty mode=0555 flags=schg tags=package=runtime + empty mode=0555 flags=schg .. games gname=games mode=0775 .. heimdal mode=0700 .. - log tags=package=runtime + log .. - mail gname=mail mode=0775 tags=package=runtime + mail gname=mail mode=0775 .. msgs uname=daemon .. preserve .. - run tags=package=runtime + run dhclient .. ppp gname=network mode=0770 @@ -84,16 +84,18 @@ rwho gname=daemon mode=0775 .. spool - dma uname=root gname=mail mode=0770 + clientmqueue uname=smmsp gname=smmsp mode=0770 tags=package=sendmail .. - lock uname=uucp gname=dialer mode=0775 + dma uname=root gname=mail mode=0770 tags=package=dma .. + lock uname=uucp gname=dialer + .. /set gname=daemon lpd .. - mqueue + mqueue tags=package=sendmail .. - opielocks mode=0700 + opielocks .. output lpd @@ -101,7 +103,7 @@ .. /set gname=wheel .. - tmp mode=01777 tags=package=runtime + tmp mode=01777 vi.recover mode=01777 .. .. From owner-svn-src-head@freebsd.org Wed Jun 12 09:17:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B0115AEE44; Wed, 12 Jun 2019 09:17:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C416F6DBAE; Wed, 12 Jun 2019 09:17:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EB7F022; Wed, 12 Jun 2019 09:17:32 +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 x5C9HWEX009308; Wed, 12 Jun 2019 09:17:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5C9HWje009307; Wed, 12 Jun 2019 09:17:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201906120917.x5C9HWje009307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 12 Jun 2019 09:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348982 - head/etc/sendmail X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/sendmail X-SVN-Commit-Revision: 348982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C416F6DBAE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 09:17:33 -0000 Author: manu Date: Wed Jun 12 09:17:32 2019 New Revision: 348982 URL: https://svnweb.freebsd.org/changeset/base/348982 Log: pkgbase: Add the correct package for sendmail configuration files Reviewed by: bapt MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20606 Modified: head/etc/sendmail/Makefile Modified: head/etc/sendmail/Makefile ============================================================================== --- head/etc/sendmail/Makefile Wed Jun 12 09:16:42 2019 (r348981) +++ head/etc/sendmail/Makefile Wed Jun 12 09:17:32 2019 (r348982) @@ -64,29 +64,29 @@ ${mc:T:R}.cf: ${mc} all: ${ALL} distribution: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "package=sendmail" \ ${.CURDIR}/freebsd.mc freebsd.cf ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 -T "package=sendmail" \ ${.CURDIR}/freebsd.submit.mc freebsd.submit.cf ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 -T "package=sendmail" \ ${SMDIR}/helpfile ${DESTDIR}/etc/mail .if defined(INSTALL_CF) - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "package=sendmail" \ ${INSTALL_CF} ${DEST_CF} .else - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "package=sendmail" \ freebsd.cf ${DEST_CF} .endif .if defined(SENDMAIL_ADDITIONAL_CF) - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "package=sendmail" \ ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail .endif .if !defined(SENDMAIL_SET_USER_ID) .if defined(INSTALL_SUBMIT_CF) - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 -T "package=sendmail" \ ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF} .else - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 -T "package=sendmail" \ freebsd.submit.cf ${DEST_SUBMIT_CF} .endif .endif From owner-svn-src-head@freebsd.org Wed Jun 12 09:18:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 118D815AEEFF; Wed, 12 Jun 2019 09:18:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A57D96DD15; Wed, 12 Jun 2019 09:18:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8081EF026; Wed, 12 Jun 2019 09:18:23 +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 x5C9INSo009386; Wed, 12 Jun 2019 09:18:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5C9INL1009385; Wed, 12 Jun 2019 09:18:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201906120918.x5C9INL1009385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 12 Jun 2019 09:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348983 - head/etc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 348983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A57D96DD15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 09:18:24 -0000 Author: manu Date: Wed Jun 12 09:18:23 2019 New Revision: 348983 URL: https://svnweb.freebsd.org/changeset/base/348983 Log: pkgbase: Add some tags to files installed in distribution target Add the MK_MAIL dependant file to the runtime package as well as the MK_KERBEROS ones the empty locate database, the FreeBSD copyright file and the GENERIC.hints. Tag the unbound link from /etc to /var to belong in the unbound package. Reviewed by: bapt MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20607 Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jun 12 09:17:32 2019 (r348982) +++ head/etc/Makefile Wed Jun 12 09:18:23 2019 (r348983) @@ -59,7 +59,8 @@ distribution: ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ - ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ + ${INSTALL_SYMLINK} -T "package=unbound" \ + ../var/unbound ${DESTDIR}/etc/unbound; \ fi .endif .if ${MK_SENDMAIL} != "no" @@ -68,26 +69,29 @@ distribution: .if ${MK_KERBEROS} != "no" cd ${.CURDIR}/root; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + -T "package=runtime" \ dot.k5login ${DESTDIR}/root/.k5login; .endif .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${ETCMAIL} ${DESTDIR}/etc/mail + -T "package=runtime" ${ETCMAIL} ${DESTDIR}/etc/mail if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ ! -f ${DESTDIR}/etc/aliases ]; then \ - ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \ + ${INSTALL_SYMLINK} -T "package=runtime" \ + mail/aliases ${DESTDIR}/etc/aliases; \ fi .endif .if ${MK_LOCATE} != "no" - ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ - ${DESTDIR}/var/db/locate.database + ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\ + /dev/null ${DESTDIR}/var/db/locate.database .endif cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${FREEBSD} ${DESTDIR}/ + -T "package=runtime" ${FREEBSD} ${DESTDIR}/ .if ${MK_BOOT} != "no" .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ + -T "package=runtime" \ ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \ ${DESTDIR}/boot/device.hints .endif From owner-svn-src-head@freebsd.org Wed Jun 12 10:03:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5767F15B02F0; Wed, 12 Jun 2019 10:03:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25586F45B; Wed, 12 Jun 2019 10:03:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5CA3AR6087468; Wed, 12 Jun 2019 03:03:10 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5CA3AHc087467; Wed, 12 Jun 2019 03:03:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906121003.x5CA3AHc087467@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348981 - head/etc/mtree In-Reply-To: <201906120916.x5C9Gh7O009231@repo.freebsd.org> To: Emmanuel Vadot Date: Wed, 12 Jun 2019 03:03:10 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C25586F45B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.958,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 10:03:14 -0000 > Author: manu > Date: Wed Jun 12 09:16:42 2019 > New Revision: 348981 > URL: https://svnweb.freebsd.org/changeset/base/348981 > > Log: > pkgbase: Set a default package=runtime for var directories > > This way every directory is at least present in packages. > While here tag some directory from being in sendmail or dma > > Reviewed by: bapt > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D20605 > > Modified: > head/etc/mtree/BSD.var.dist > > Modified: head/etc/mtree/BSD.var.dist > ============================================================================== > --- head/etc/mtree/BSD.var.dist Wed Jun 12 01:53:14 2019 (r348980) > +++ head/etc/mtree/BSD.var.dist Wed Jun 12 09:16:42 2019 (r348981) > @@ -3,7 +3,7 @@ > # Please see the file src/etc/mtree/README before making changes to this file. > # > > -/set type=dir uname=root gname=wheel mode=0755 > +/set type=dir uname=root gname=wheel mode=0755 tags=package=runtime > . > account > .. > @@ -32,7 +32,7 @@ > .. > crash > .. > - cron tags=package=runtime > + cron > tabs mode=0700 > .. > .. > @@ -59,21 +59,21 @@ > .. > .. > .. > - empty mode=0555 flags=schg tags=package=runtime > + empty mode=0555 flags=schg > .. > games gname=games mode=0775 > .. > heimdal mode=0700 > .. > - log tags=package=runtime > + log > .. > - mail gname=mail mode=0775 tags=package=runtime > + mail gname=mail mode=0775 > .. > msgs uname=daemon > .. > preserve > .. > - run tags=package=runtime > + run > dhclient > .. > ppp gname=network mode=0770 > @@ -84,16 +84,18 @@ > rwho gname=daemon mode=0775 > .. > spool > - dma uname=root gname=mail mode=0770 > + clientmqueue uname=smmsp gname=smmsp mode=0770 tags=package=sendmail > .. > - lock uname=uucp gname=dialer mode=0775 > + dma uname=root gname=mail mode=0770 tags=package=dma > .. > + lock uname=uucp gname=dialer Is loss of mode=0775 intentional here?? I think that may break cu locks. > + .. > /set gname=daemon > lpd > .. > - mqueue > + mqueue tags=package=sendmail > .. > - opielocks mode=0700 > + opielocks Again, loss of mode??? > .. > output > lpd > @@ -101,7 +103,7 @@ > .. > /set gname=wheel > .. > - tmp mode=01777 tags=package=runtime > + tmp mode=01777 > vi.recover mode=01777 > .. > .. > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jun 12 11:06:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0855615B19E3; Wed, 12 Jun 2019 11:06:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7948370EA0; Wed, 12 Jun 2019 11:06:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F573182B5; Wed, 12 Jun 2019 11:06:52 +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 x5CB6qqa066044; Wed, 12 Jun 2019 11:06:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CB6qGg066043; Wed, 12 Jun 2019 11:06:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906121106.x5CB6qGg066043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 12 Jun 2019 11:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348985 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7948370EA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:06:53 -0000 Author: cy Date: Wed Jun 12 11:06:51 2019 New Revision: 348985 URL: https://svnweb.freebsd.org/changeset/base/348985 Log: Enclose a long multi-line single conditional statement in braces to improve legibility and aesthetics. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 12 10:50:17 2019 (r348984) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 12 11:06:51 2019 (r348985) @@ -211,7 +211,7 @@ vnet_ipf_init(void) else defpass = "no-match -> block"; - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { printf("%s initialized. Default = %s all, Logging = %s%s\n", ipfilter_version, defpass, #ifdef IPFILTER_LOG @@ -225,6 +225,7 @@ vnet_ipf_init(void) "" #endif ); + } } VNET_SYSINIT(vnet_ipf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, vnet_ipf_init, NULL); From owner-svn-src-head@freebsd.org Wed Jun 12 11:06:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFBC615B1A07; Wed, 12 Jun 2019 11:06:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74CDB70EA1; Wed, 12 Jun 2019 11:06:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E0F2182B6; Wed, 12 Jun 2019 11:06:55 +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 x5CB6ti7066091; Wed, 12 Jun 2019 11:06:55 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CB6t68066090; Wed, 12 Jun 2019 11:06:55 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906121106.x5CB6t68066090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 12 Jun 2019 11:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348986 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74CDB70EA1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:06:56 -0000 Author: cy Date: Wed Jun 12 11:06:54 2019 New Revision: 348986 URL: https://svnweb.freebsd.org/changeset/base/348986 Log: Register pfil hooks when VNET != vnet0. r302298, which virtualized ipf, assumed the pfil hook registration performed in ipf_modload() would take care of this. However ipf_modload() is only called when the ipl kld is loaded or when ipfilter is first called when it is statically linked into the kernel at build time. Prior to this, even though r302298 has been in the tree for a while, it has never been used. So, r302298 in reality begins now. PR: 212000 Reported by: ahsanb@ MFC after: 1 month Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 12 11:06:51 2019 (r348985) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 12 11:06:54 2019 (r348986) @@ -225,6 +225,9 @@ vnet_ipf_init(void) "" #endif ); + } else { + (void)ipf_pfil_hook(); + ipf_event_reg(); } } VNET_SYSINIT(vnet_ipf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, From owner-svn-src-head@freebsd.org Wed Jun 12 11:07:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E5F15B1A33; Wed, 12 Jun 2019 11:07:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A50B270F3E; Wed, 12 Jun 2019 11:07:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02917182B8; Wed, 12 Jun 2019 11:06:59 +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 x5CB6wXh066154; Wed, 12 Jun 2019 11:06:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CB6wlM066151; Wed, 12 Jun 2019 11:06:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906121106.x5CB6wlM066151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 12 Jun 2019 11:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348987 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A50B270F3E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:07:14 -0000 Author: cy Date: Wed Jun 12 11:06:58 2019 New Revision: 348987 URL: https://svnweb.freebsd.org/changeset/base/348987 Log: Resolve IPv6 checksum errors with stateful inspection. According to PR/203585 this appears to have been broken by r235959, which predates the ipfilter 5.1.2 import into FreeBSD. The IPv6 checksum calculation is incorrect. To resolve this we call in6_cksum() to do the the heavy lifting for us, through a new function ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe is added to aid with future debugging. PR: 203275, 203585 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20583 Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 12 11:06:54 2019 (r348986) +++ head/sys/contrib/ipfilter/netinet/fil.c Wed Jun 12 11:06:58 2019 (r348987) @@ -3422,35 +3422,21 @@ fr_cksum(fin, ip, l4proto, l4hdr) sum += *sp++; sum += *sp++; /* ip_dst */ sum += *sp++; + slen = fin->fin_plen - off; + sum += htons(slen); #ifdef USE_INET6 } else if (IP_V(ip) == 6) { + mb_t *m; + + m = fin->fin_m; ip6 = (ip6_t *)ip; - hlen = sizeof(*ip6); - off = ((char *)fin->fin_dp - (char *)fin->fin_ip); - sp = (u_short *)&ip6->ip6_src; - sum += *sp++; /* ip6_src */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - /* This needs to be routing header aware. */ - sum += *sp++; /* ip6_dst */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; + off = ((caddr_t)ip6 - m->m_data) + sizeof(struct ip6_hdr); + int len = ntohs(ip6->ip6_plen) - (off - sizeof(*ip6)); + return(ipf_pcksum6(fin, ip6, off, len)); } else { return 0xffff; } #endif - slen = fin->fin_plen - off; - sum += htons(slen); switch (l4proto) { @@ -6645,6 +6631,12 @@ ipf_checkl4sum(fin) if ((fin->fin_flx & (FI_FRAG|FI_SHORT|FI_BAD)) != 0) return 1; + DT2(l4sumo, int, fin->fin_out, int, (int)fin->fin_p); + if (fin->fin_out == 1) { + fin->fin_cksum = FI_CK_SUMOK; + return 0; + } + csump = NULL; hdrsum = 0; dosum = 0; @@ -6696,7 +6688,11 @@ ipf_checkl4sum(fin) } #endif DT2(l4sums, u_short, hdrsum, u_short, sum); +#ifdef USE_INET6 + if (hdrsum == sum || (sum == 0 && fin->fin_p == IPPROTO_ICMPV6)) { +#else if (hdrsum == sum) { +#endif fin->fin_cksum = FI_CK_SUMOK; return 0; } Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jun 12 11:06:54 2019 (r348986) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jun 12 11:06:58 2019 (r348987) @@ -1836,6 +1836,10 @@ extern int ipf_matchicmpqueryreply __P((int, icmpinfo struct icmp *, int)); extern u_32_t ipf_newisn __P((fr_info_t *)); extern u_int ipf_pcksum __P((fr_info_t *, int, u_int)); +#ifdef USE_INET6 +extern u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *, + u_int32_t, u_int32_t)); +#endif extern void ipf_rule_expire __P((ipf_main_softc_t *)); extern int ipf_scanlist __P((fr_info_t *, u_32_t)); extern frentry_t *ipf_srcgrpmap __P((fr_info_t *, u_32_t *)); Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:06:54 2019 (r348986) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:06:58 2019 (r348987) @@ -1446,3 +1446,56 @@ ipf_pcksum(fin, hlen, sum) sum2 = ~sum & 0xffff; return sum2; } + +#ifdef USE_INET6 +#ifdef _KERNEL +u_int +ipf_pcksum6(fin, ip6, off, len) + fr_info_t *fin; + ip6_t *ip6; + u_int32_t off; + u_int32_t len; +{ + struct mbuf *m; + int sum; + + m = fin->fin_m; + if (m->m_len < sizeof(struct ip6_hdr)) { + return 0xffff; + } + + sum = in6_cksum(m, ip6->ip6_nxt, off, len); + return(sum); +} +#else +u_int +ipf_pcksum6(fin, ip6, off, len) + fr_info_t *fin; + ip6_t *ip6; + u_int32_t off; + u_int32_t len; +{ + u_short *sp; + u_int sum; + + sp = (u_short *)&ip6->ip6_src; + sum = *sp++; /* ip6_src */ + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; /* ip6_dst */ + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + return(ipf_pcksum(fin, off, sum)); +} +#endif +#endif From owner-svn-src-head@freebsd.org Wed Jun 12 11:18:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D32815B2316; Wed, 12 Jun 2019 11:18:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E433F71938; Wed, 12 Jun 2019 11:18:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4ED218467; Wed, 12 Jun 2019 11:18:11 +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 x5CBIBSQ071475; Wed, 12 Jun 2019 11:18:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CBIBNj071474; Wed, 12 Jun 2019 11:18:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906121118.x5CBIBNj071474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 12 Jun 2019 11:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348989 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E433F71938 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:18:12 -0000 Author: cy Date: Wed Jun 12 11:18:11 2019 New Revision: 348989 URL: https://svnweb.freebsd.org/changeset/base/348989 Log: Whitespace adjustments replacing spaces with tabs. MFC after: 1 month X-MFC with: r348987 Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:09:33 2019 (r348988) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:18:11 2019 (r348989) @@ -1480,21 +1480,21 @@ ipf_pcksum6(fin, ip6, off, len) sp = (u_short *)&ip6->ip6_src; sum = *sp++; /* ip6_src */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; sum += *sp++; /* ip6_dst */ - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; - sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; + sum += *sp++; return(ipf_pcksum(fin, off, sum)); } #endif From owner-svn-src-head@freebsd.org Wed Jun 12 11:29:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7C515B26B7; Wed, 12 Jun 2019 11:29:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BF6C371E10; Wed, 12 Jun 2019 11:29:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id b1RNhRa2XsAGkb1RQh86XQ; Wed, 12 Jun 2019 05:29:21 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=K2_46mqKuNSSPGngKTgA:9 a=wZHe4CrpH0V6knVJ:21 a=qP5YB1bfD8RQB4mK:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2967D4F7; Wed, 12 Jun 2019 04:29:15 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5CBTEK5005689; Wed, 12 Jun 2019 04:29:14 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5CBTEpt005683; Wed, 12 Jun 2019 04:29:14 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906121129.x5CBTEpt005683@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348989 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Wed, 12 Jun 2019 11:18:11 -0000." <201906121118.x5CBIBNj071474@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 12 Jun 2019 04:29:14 -0700 X-CMAE-Envelope: MS4wfJvADA1BQRfF4YIECcRBek/1dPQR7FILlbNvc+jzLtFWKXAnwmKCFo8aUf+mUY144lvmnz7/EhVsgoiCcoqJVDapN45opzi5XGJiguXnbrt15BnrIt/K m7ETEWFCJ5OpT4w0gcX5TR+whifyjv4WMI2S+NSxnhLgKD78BHG/DmJQMsRpvLXQ7aBOsTaD6CFwsB5m7J2gEy3yaWnQl1MHb+9bwXhbjlCcGVk3uoNUqaYX o4q2CYSXWujKxDzxLCk/RPHB0M7k+EySKcLhPFeTDTogpe8Tvcpcn9HJW3Lp63oI X-Rspamd-Queue-Id: BF6C371E10 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.20 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.52)[ip: (-6.71), ipnet: 64.59.128.0/20(-3.26), asn: 6327(-2.52), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:29:31 -0000 In message <201906121118.x5CBIBNj071474@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Wed Jun 12 11:18:11 2019 > New Revision: 348989 > URL: https://svnweb.freebsd.org/changeset/base/348989 > > Log: > Whitespace adjustments replacing spaces with tabs. > > MFC after: 1 month > X-MFC with: r348987 > > Modified: > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:0 > 9:33 2019 (r348988) > +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 12 11:1 > 8:11 2019 (r348989) > @@ -1480,21 +1480,21 @@ ipf_pcksum6(fin, ip6, off, len) > > sp = (u_short *)&ip6->ip6_src; > sum = *sp++; /* ip6_src */ > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > sum += *sp++; /* ip6_dst */ > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > - sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > + sum += *sp++; > return(ipf_pcksum(fin, off, sum)); > } > #endif > The reason for this latecomer is this change was in my use-everyday svn tree I boot from while the version with the incorrect whitespace was in my git repo I commit from. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 12 11:34:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59ABC15B2938; Wed, 12 Jun 2019 11:34:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE5247223A; Wed, 12 Jun 2019 11:34:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1309187BF; Wed, 12 Jun 2019 11:34:16 +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 x5CBYGJE081800; Wed, 12 Jun 2019 11:34:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CBYG1Q081799; Wed, 12 Jun 2019 11:34:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201906121134.x5CBYG1Q081799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 12 Jun 2019 11:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348990 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 348990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE5247223A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:34:17 -0000 Author: manu Date: Wed Jun 12 11:34:16 2019 New Revision: 348990 URL: https://svnweb.freebsd.org/changeset/base/348990 Log: mtree: Restore mode for /var/spool/lock and opielocks mode was dropped unintentionally in r348981 for those two directories. Reviewed by: rgrimes MFC after: 1 month X-MFC-With: r348981 Modified: head/etc/mtree/BSD.var.dist Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Wed Jun 12 11:18:11 2019 (r348989) +++ head/etc/mtree/BSD.var.dist Wed Jun 12 11:34:16 2019 (r348990) @@ -88,14 +88,14 @@ .. dma uname=root gname=mail mode=0770 tags=package=dma .. - lock uname=uucp gname=dialer + lock uname=uucp gname=dialer mode=0775 .. /set gname=daemon lpd .. mqueue tags=package=sendmail .. - opielocks + opielocks mode=0700 .. output lpd From owner-svn-src-head@freebsd.org Wed Jun 12 11:35:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4398315B29BC; Wed, 12 Jun 2019 11:35:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78B8E7239C; Wed, 12 Jun 2019 11:35:13 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5fb8504d; Wed, 12 Jun 2019 13:35:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=MXFfYLUhdOgm0t3Ns4TAjCego9k=; b=Nv9aRKj6GsaRB1c/iCmJxyKkDxSw +EHZu67lhR/OOSLYjOQcEs9eTW6Dj10wL1ZfGHPsD7Dp9MFeHgR5kDd6HU7BFE9q I/ofgE8/nHah+dc+XLqdIHYSLO+f6LLgqVvAavOSrcwYYNSmr3u5z2DIER94qYPT NrkzQuLGBe3xiYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=FmPJCl1fw0giKXh3E3wbSkUWxOR7umbvyLdej+9hfF6COqzCcOKxJEUd 2icYQ8KabuJph3PdvU2nax9QysqIxF/zkXnlII0IOxb+kYX3R0c9hanlyC+t+tQf 9x8WQVB6pHdwTQEy9h19/vwWl2da5doTEsXt7vEd2zlKqLzppoA= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 7f39befb TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 12 Jun 2019 13:35:05 +0200 (CEST) Date: Wed, 12 Jun 2019 13:35:05 +0200 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348981 - head/etc/mtree Message-Id: <20190612133505.aba56f63147c372fecd2d849@bidouilliste.com> In-Reply-To: <201906121003.x5CA3AHc087467@gndrsh.dnsmgr.net> References: <201906120916.x5C9Gh7O009231@repo.freebsd.org> <201906121003.x5CA3AHc087467@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 78B8E7239C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 11:35:14 -0000 On Wed, 12 Jun 2019 03:03:10 -0700 (PDT) "Rodney W. Grimes" wrote: > > Author: manu > > Date: Wed Jun 12 09:16:42 2019 > > New Revision: 348981 > > URL: https://svnweb.freebsd.org/changeset/base/348981 > > > > Log: > > pkgbase: Set a default package=runtime for var directories > > > > This way every directory is at least present in packages. > > While here tag some directory from being in sendmail or dma > > > > Reviewed by: bapt > > MFC after: 1 month > > Differential Revision: https://reviews.freebsd.org/D20605 > > > > Modified: > > head/etc/mtree/BSD.var.dist > > > > Modified: head/etc/mtree/BSD.var.dist > > ============================================================================== > > --- head/etc/mtree/BSD.var.dist Wed Jun 12 01:53:14 2019 (r348980) > > +++ head/etc/mtree/BSD.var.dist Wed Jun 12 09:16:42 2019 (r348981) > > @@ -3,7 +3,7 @@ > > # Please see the file src/etc/mtree/README before making changes to this file. > > # > > > > -/set type=dir uname=root gname=wheel mode=0755 > > +/set type=dir uname=root gname=wheel mode=0755 tags=package=runtime > > . > > account > > .. > > @@ -32,7 +32,7 @@ > > .. > > crash > > .. > > - cron tags=package=runtime > > + cron > > tabs mode=0700 > > .. > > .. > > @@ -59,21 +59,21 @@ > > .. > > .. > > .. > > - empty mode=0555 flags=schg tags=package=runtime > > + empty mode=0555 flags=schg > > .. > > games gname=games mode=0775 > > .. > > heimdal mode=0700 > > .. > > - log tags=package=runtime > > + log > > .. > > - mail gname=mail mode=0775 tags=package=runtime > > + mail gname=mail mode=0775 > > .. > > msgs uname=daemon > > .. > > preserve > > .. > > - run tags=package=runtime > > + run > > dhclient > > .. > > ppp gname=network mode=0770 > > @@ -84,16 +84,18 @@ > > rwho gname=daemon mode=0775 > > .. > > spool > > - dma uname=root gname=mail mode=0770 > > + clientmqueue uname=smmsp gname=smmsp mode=0770 tags=package=sendmail > > .. > > - lock uname=uucp gname=dialer mode=0775 > > + dma uname=root gname=mail mode=0770 tags=package=dma > > .. > > + lock uname=uucp gname=dialer > > Is loss of mode=0775 intentional here?? I think that may break cu locks. I miss read the mode=0755 above. > > + .. > > /set gname=daemon > > lpd > > .. > > - mqueue > > + mqueue tags=package=sendmail > > .. > > - opielocks mode=0700 > > + opielocks > > Again, loss of mode??? Both mode are restored in 348990, thanks for noticing. > > > .. > > output > > lpd > > @@ -101,7 +103,7 @@ > > .. > > /set gname=wheel > > .. > > - tmp mode=01777 tags=package=runtime > > + tmp mode=01777 > > vi.recover mode=01777 > > .. > > .. > > > > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Jun 12 13:34:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C6DE15B720D; Wed, 12 Jun 2019 13:34:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 170FE76296; Wed, 12 Jun 2019 13:34:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2D7D19BD3; Wed, 12 Jun 2019 13:34:14 +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 x5CDYEMx043825; Wed, 12 Jun 2019 13:34:14 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CDYCdU043813; Wed, 12 Jun 2019 13:34:12 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906121334.x5CDYCdU043813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 12 Jun 2019 13:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348993 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive_fe contrib/libarchive/tar lib/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 348993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 170FE76296 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 13:34:15 -0000 Author: mm Date: Wed Jun 12 13:34:12 2019 New Revision: 348993 URL: https://svnweb.freebsd.org/changeset/base/348993 Log: MFV r348971,r348977: Sync libarchive with vendor. Relevant vendor changes: - check_symlinks_fsobj() without chdir() and fchdir() - bsdtar.1 manpage fixes - patches from OpenBSD to libarchive_fe/passphrase.c - version bumped to 3.4.0 MFC after: 2 weeks Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/README.md head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive_fe/line_reader.c head/contrib/libarchive/libarchive_fe/passphrase.c head/contrib/libarchive/tar/bsdtar.1 head/lib/libarchive/config_freebsd.h head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/NEWS Wed Jun 12 13:34:12 2019 (r348993) @@ -1,3 +1,7 @@ +Jun 11, 2019: libarchive 3.4.0 released + +May 18, 2019: Fixes for reading Android APK and JAR archives + Apr 16, 2019: Support for non-recursive list and extract Apr 14, 2019: New tar option: --exclude-vcs @@ -6,7 +10,7 @@ Mar 27, 2019: Support for file and directory symlinks Mar 12, 2019: Important fixes for storing file attributes and flags -Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 decompression in ZIP files Oct 06, 2018: RAR 5.0 reader Modified: head/contrib/libarchive/README.md ============================================================================== --- head/contrib/libarchive/README.md Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/README.md Wed Jun 12 13:34:12 2019 (r348993) @@ -81,6 +81,7 @@ Currently, the library automatically detects and reads * Binary cpio (big-endian or little-endian) * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive/archive.h Wed Jun 12 13:34:12 2019 (r348993) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive/archive_entry.h Wed Jun 12 13:34:12 2019 (r348993) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003003 +#define ARCHIVE_VERSION_NUMBER 3004000 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c Wed Jun 12 13:34:12 2019 (r348993) @@ -60,7 +60,7 @@ static int archive_filter_b64encode_write(struct archi const void *, size_t); static int archive_filter_b64encode_close(struct archive_write_filter *); static int archive_filter_b64encode_free(struct archive_write_filter *); -static void b64_encode(struct archive_string *, const unsigned char *, size_t); +static void la_b64_encode(struct archive_string *, const unsigned char *, size_t); static int64_t atol8(const char *, size_t); static const char base64[] = { @@ -180,7 +180,7 @@ archive_filter_b64encode_open(struct archive_write_fil } static void -b64_encode(struct archive_string *as, const unsigned char *p, size_t len) +la_b64_encode(struct archive_string *as, const unsigned char *p, size_t len) { int c; @@ -234,12 +234,12 @@ archive_filter_b64encode_write(struct archive_write_fi } if (state->hold_len < LBYTES) return (ret); - b64_encode(&state->encoded_buff, state->hold, LBYTES); + la_b64_encode(&state->encoded_buff, state->hold, LBYTES); state->hold_len = 0; } for (; length >= LBYTES; length -= LBYTES, p += LBYTES) - b64_encode(&state->encoded_buff, p, LBYTES); + la_b64_encode(&state->encoded_buff, p, LBYTES); /* Save remaining bytes. */ if (length > 0) { @@ -270,7 +270,7 @@ archive_filter_b64encode_close(struct archive_write_fi /* Flush remaining bytes. */ if (state->hold_len != 0) - b64_encode(&state->encoded_buff, state->hold, state->hold_len); + la_b64_encode(&state->encoded_buff, state->hold, state->hold_len); archive_string_sprintf(&state->encoded_buff, "====\n"); /* Write the last block */ archive_write_set_bytes_in_last_block(f->archive, 1); Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Jun 12 13:34:12 2019 (r348993) @@ -165,6 +165,10 @@ __FBSDID("$FreeBSD$"); #define O_NOFOLLOW 0 #endif +#ifndef AT_FDCWD +#define AT_FDCWD -100 +#endif + struct fixup_entry { struct fixup_entry *next; struct archive_acl acl; @@ -348,6 +352,8 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) + +static int la_opendirat(int, const char *); static void fsobj_error(int *, struct archive_string *, int, const char *, const char *); static int check_symlinks_fsobj(char *, int *, struct archive_string *, @@ -401,6 +407,37 @@ static ssize_t _archive_write_disk_data_block(struct a size_t, int64_t); static int +la_opendirat(int fd, const char *path) { + const int flags = O_CLOEXEC +#if defined(O_BINARY) + | O_BINARY +#endif +#if defined(O_DIRECTORY) + | O_DIRECTORY +#endif +#if defined(O_PATH) + | O_PATH +#elif defined(O_SEARCH) + | O_SEARCH +#elif defined(O_EXEC) + | O_EXEC +#else + | O_RDONLY +#endif + ; + +#if !defined(HAVE_OPENAT) + if (fd != AT_FDCWD) { + errno = ENOTSUP; + return (-1); + } else + return (open(fd, path, flags)); +#else + return (openat(fd, path, flags)); +#endif +} + +static int lazy_stat(struct archive_write_disk *a) { if (a->pst != NULL) { @@ -1909,7 +1946,7 @@ edit_deep_directories(struct archive_write_disk *a) return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + a->restore_pwd = la_opendirat(AT_FDCWD, "."); __archive_ensure_cloexec_flag(a->restore_pwd); if (a->restore_pwd < 0) return; @@ -2342,7 +2379,7 @@ _archive_write_disk_close(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; struct fixup_entry *next, *p; - int ret; + int fd, ret; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, @@ -2353,21 +2390,33 @@ _archive_write_disk_close(struct archive *_a) p = sort_dir_list(a->fixup_list); while (p != NULL) { + fd = -1; a->pst = NULL; /* Mark stat cache as out-of-date. */ + if (p->fixup & + (TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) { + fd = open(p->name, + O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC); + } if (p->fixup & TODO_TIMES) { - set_times(a, -1, p->mode, p->name, + set_times(a, fd, p->mode, p->name, p->atime, p->atime_nanos, p->birthtime, p->birthtime_nanos, p->mtime, p->mtime_nanos, p->ctime, p->ctime_nanos); } - if (p->fixup & TODO_MODE_BASE) + if (p->fixup & TODO_MODE_BASE) { +#ifdef HAVE_FCHMOD + if (fd >= 0) + fchmod(fd, p->mode); + else +#endif chmod(p->name, p->mode); + } if (p->fixup & TODO_ACLS) - archive_write_disk_set_acls(&a->archive, -1, p->name, - &p->acl, p->mode); + archive_write_disk_set_acls(&a->archive, fd, + p->name, &p->acl, p->mode); if (p->fixup & TODO_FFLAGS) - set_fflags_platform(a, -1, p->name, + set_fflags_platform(a, fd, p->name, p->mode, p->fflags_set, 0); if (p->fixup & TODO_MAC_METADATA) set_mac_metadata(a, p->name, p->mac_metadata, @@ -2376,6 +2425,8 @@ _archive_write_disk_close(struct archive *_a) archive_acl_clear(&p->acl); free(p->mac_metadata); free(p->name); + if (fd >= 0) + close(fd); free(p); p = next; } @@ -2540,8 +2591,6 @@ fsobj_error(int *a_eno, struct archive_string *a_estr, * scan the path and both can be optimized by comparing against other * recent paths. */ -/* TODO: Extend this to support symlinks on Windows Vista and later. */ - /* * Checks the given path to see if any elements along it are symlinks. Returns * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. @@ -2550,7 +2599,8 @@ static int check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags) { -#if !defined(HAVE_LSTAT) +#if !defined(HAVE_LSTAT) && \ + !(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT)) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)path; /* UNUSED */ (void)error_number; /* UNUSED */ @@ -2565,7 +2615,10 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar char c; int r; struct stat st; - int restore_pwd; + int chdir_fd; +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + int fd; +#endif /* Nothing to do here if name is empty */ if(path[0] == '\0') @@ -2586,9 +2639,9 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * c holds what used to be in *tail * last is 1 if this is the last tail */ - restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); - __archive_ensure_cloexec_flag(restore_pwd); - if (restore_pwd < 0) { + chdir_fd = la_opendirat(AT_FDCWD, "."); + __archive_ensure_cloexec_flag(chdir_fd); + if (chdir_fd < 0) { fsobj_error(a_eno, a_estr, errno, "Could not open ", path); return (ARCHIVE_FATAL); @@ -2621,7 +2674,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar c = tail[0]; tail[0] = '\0'; /* Check that we haven't hit a symlink. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, AT_SYMLINK_NOFOLLOW); +#else r = lstat(head, &st); +#endif if (r != 0) { tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ @@ -2647,7 +2704,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } } else if (S_ISDIR(st.st_mode)) { if (!last) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not chdir ", path); @@ -2664,7 +2733,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * so we can overwrite it with the * item being extracted. */ - if (unlink(head)) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, "Could not remove symlink ", @@ -2694,7 +2768,12 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = unlinkat(chdir_fd, head, 0); +#else + r = unlink(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, 0, "Cannot remove intervening " @@ -2712,7 +2791,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar * This is needed to extract hardlinks over * symlinks. */ +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + r = fstatat(chdir_fd, head, &st, 0); +#else r = la_stat(head, &st); +#endif if (r != 0) { tail[0] = c; if (errno == ENOENT) { @@ -2725,7 +2808,19 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar break; } } else if (S_ISDIR(st.st_mode)) { - if (chdir(head) != 0) { +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + fd = la_opendirat(chdir_fd, head); + if (fd < 0) + r = -1; + else { + r = 0; + close(chdir_fd); + chdir_fd = fd; + } +#else + r = chdir(head); +#endif + if (r != 0) { tail[0] = c; fsobj_error(a_eno, a_estr, errno, @@ -2761,16 +2856,21 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar } /* Catches loop exits via break */ tail[0] = c; -#ifdef HAVE_FCHDIR +#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT) + /* If we operate with openat(), fstatat() and unlinkat() there was + * no chdir(), so just close the fd */ + if (chdir_fd >= 0) + close(chdir_fd); +#elif HAVE_FCHDIR /* If we changed directory above, restore it here. */ - if (restore_pwd >= 0) { - r = fchdir(restore_pwd); + if (chdir_fd >= 0) { + r = fchdir(chdir_fd); if (r != 0) { fsobj_error(a_eno, a_estr, errno, "chdir() failure", ""); } - close(restore_pwd); - restore_pwd = -1; + close(chdir_fd); + chdir_fd = -1; if (r != 0) { res = (ARCHIVE_FATAL); } @@ -3387,6 +3487,7 @@ static int set_mode(struct archive_write_disk *a, int mode) { int r = ARCHIVE_OK; + int r2; mode &= 07777; /* Strip off file type bits. */ if (a->todo & TODO_SGID_CHECK) { @@ -3480,21 +3581,19 @@ set_mode(struct archive_write_disk *a, int mode) * post-extract fixup, which is handled elsewhere. */ #ifdef HAVE_FCHMOD - if (a->fd >= 0) { - if (fchmod(a->fd, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } - } else + if (a->fd >= 0) + r2 = fchmod(a->fd, mode); + else #endif - /* If this platform lacks fchmod(), then - * we'll just use chmod(). */ - if (chmod(a->name, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; - } + /* If this platform lacks fchmod(), then + * we'll just use chmod(). */ + r2 = chmod(a->name, mode); + + if (r2 != 0) { + archive_set_error(&a->archive, errno, + "Can't set permissions to 0%o", (int)mode); + r = ARCHIVE_WARN; + } } return (r); } Modified: head/contrib/libarchive/libarchive_fe/line_reader.c ============================================================================== --- head/contrib/libarchive/libarchive_fe/line_reader.c Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive_fe/line_reader.c Wed Jun 12 13:34:12 2019 (r348993) @@ -49,11 +49,10 @@ __FBSDID("$FreeBSD$"); */ struct lafe_line_reader { FILE *f; - char *buff, *buff_end, *line_start, *line_end, *p; + char *buff, *buff_end, *line_start, *line_end; char *pathname; size_t buff_length; int nullSeparator; /* Lines separated by null, not CR/CRLF/etc. */ - int ret; }; struct lafe_line_reader * Modified: head/contrib/libarchive/libarchive_fe/passphrase.c ============================================================================== --- head/contrib/libarchive/libarchive_fe/passphrase.c Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/libarchive_fe/passphrase.c Wed Jun 12 13:34:12 2019 (r348993) @@ -23,9 +23,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $OpenBSD: readpassphrase.c,v 1.22 2010/01/13 10:20:54 dtucker Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.27 2019/01/25 00:19:25 millert Exp $ */ + /* - * Copyright (c) 2000-2002, 2007 Todd C. Miller + * Copyright (c) 2000-2002, 2007, 2010 + * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -199,6 +201,27 @@ restart: } /* + * Turn off echo if possible. + * If we are using a tty but are not the foreground pgrp this will + * generate SIGTTOU, so do it *before* installing the signal handlers. + */ + if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + memcpy(&term, &oterm, sizeof(term)); + if (!(flags & RPP_ECHO_ON)) + term.c_lflag &= ~(ECHO | ECHONL); +#ifdef VSTATUS + if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) + term.c_cc[VSTATUS] = _POSIX_VDISABLE; +#endif + (void)tcsetattr(input, _T_FLUSH, &term); + } else { + memset(&term, 0, sizeof(term)); + term.c_lflag |= ECHO; + memset(&oterm, 0, sizeof(oterm)); + oterm.c_lflag |= ECHO; + } + + /* * Catch signals that would otherwise cause the user to end * up with echo turned off in the shell. Don't worry about * things like SIGXCPU and SIGVTALRM for now. @@ -217,57 +240,41 @@ restart: (void)sigaction(SIGTTIN, &sa, &savettin); (void)sigaction(SIGTTOU, &sa, &savettou); - /* Turn off echo if possible. */ - if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { - memcpy(&term, &oterm, sizeof(term)); - if (!(flags & RPP_ECHO_ON)) - term.c_lflag &= ~(ECHO | ECHONL); -#ifdef VSTATUS - if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) - term.c_cc[VSTATUS] = _POSIX_VDISABLE; -#endif - (void)tcsetattr(input, _T_FLUSH, &term); - } else { - memset(&term, 0, sizeof(term)); - term.c_lflag |= ECHO; - memset(&oterm, 0, sizeof(oterm)); - oterm.c_lflag |= ECHO; + if (!(flags & RPP_STDIN)) { + int r = write(output, prompt, strlen(prompt)); + (void)r; } - - /* No I/O if we are already backgrounded. */ - if (signo[SIGTTOU] != 1 && signo[SIGTTIN] != 1) { - if (!(flags & RPP_STDIN)) { - int r = write(output, prompt, strlen(prompt)); - (void)r; - } - end = buf + bufsiz - 1; - p = buf; - while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { - if (p < end) { - if ((flags & RPP_SEVENBIT)) - ch &= 0x7f; - if (isalpha((unsigned char)ch)) { - if ((flags & RPP_FORCELOWER)) - ch = (char)tolower((unsigned char)ch); - if ((flags & RPP_FORCEUPPER)) - ch = (char)toupper((unsigned char)ch); - } - *p++ = ch; + end = buf + bufsiz - 1; + p = buf; + while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { + if (p < end) { + if ((flags & RPP_SEVENBIT)) + ch &= 0x7f; + if (isalpha((unsigned char)ch)) { + if ((flags & RPP_FORCELOWER)) + ch = (char)tolower((unsigned char)ch); + if ((flags & RPP_FORCEUPPER)) + ch = (char)toupper((unsigned char)ch); } + *p++ = ch; } - *p = '\0'; - save_errno = errno; - if (!(term.c_lflag & ECHO)) { - int r = write(output, "\n", 1); - (void)r; - } } + *p = '\0'; + save_errno = errno; + if (!(term.c_lflag & ECHO)) { + int r = write(output, "\n", 1); + (void)r; + } /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) { + const int sigttou = signo[SIGTTOU]; + + /* Ignore SIGTTOU generated when we are not the fg pgrp. */ while (tcsetattr(input, _T_FLUSH, &oterm) == -1 && - errno == EINTR) + errno == EINTR && !signo[SIGTTOU]) continue; + signo[SIGTTOU] = sigttou; } (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); Modified: head/contrib/libarchive/tar/bsdtar.1 ============================================================================== --- head/contrib/libarchive/tar/bsdtar.1 Wed Jun 12 12:19:34 2019 (r348992) +++ head/contrib/libarchive/tar/bsdtar.1 Wed Jun 12 13:34:12 2019 (r348993) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2017 +.Dd June 3, 2019 .Dt TAR 1 .Os .Sh NAME @@ -198,7 +198,7 @@ options and before extracting any files. .It Fl Fl clear-nochange-fflags (x mode only) Before removing file system objects to replace them, clear platform-specific -file flags that might prevent removal. +file attributes or file flags that might prevent removal. .It Fl Fl exclude Ar pattern Do not process files or directories that match the specified pattern. @@ -218,7 +218,8 @@ and .Sq Darcs . .It Fl Fl fflags (c, r, u, x modes only) -Archive or extract file flags. This is the reverse of +Archive or extract platform-specific file attributes or file flags. +This is the reverse of .Fl Fl no-fflags and the default behavior in c, r, and u modes or if .Nm @@ -389,8 +390,8 @@ Do not extract modification time. By default, the modification time is set to the time stored in the archive. .It Fl Fl mac-metadata (c, r, u and x mode only) -Mac OS X specific. Archive or extract extended ACLs and extended attributes -using +Mac OS X specific. Archive or extract extended ACLs and extended file +attributes using .Xr copyfile 3 in AppleDouble format. This is the reverse of .Fl Fl no-mac-metadata . @@ -445,21 +446,21 @@ and the default behavior if is run as non-root in x mode (on Mac OS X as any user in c, r, u and x modes). .It Fl Fl no-fflags (c, r, u, x modes only) -Do not archive or extract file flags. This is the reverse of +Do not archive or extract file attributes or file flags. This is the reverse of .Fl Fl fflags and the default behavior if .Nm is run as non-root in x mode. .It Fl Fl no-mac-metadata (x mode only) -Mac OS X specific. Do not archive or extract ACLs and extended attributes using +Mac OS X specific. Do not archive or extract ACLs and extended file attributes +using .Xr copyfile 3 in AppleDouble format. This is the reverse of .Fl Fl mac-metadata . and the default behavior if .Nm is run as non-root in x mode. -.It Fl n , Fl Fl norecurse , Fl Fl no-recursion .It Fl Fl no-same-owner (x mode only) Do not extract owner and group IDs. @@ -470,8 +471,8 @@ and the default behavior if is run as non-root. .It Fl Fl no-same-permissions (x mode only) -Do not extract full permissions (SGID, SUID, sticky bit, ACLs, -extended attributes or extended file flags). +Do not extract full permissions (SGID, SUID, sticky bit, +file attributes or file flags, extended file attributes and ACLs). This is the reverse of .Fl p and the default behavior if @@ -479,7 +480,7 @@ and the default behavior if is run as non-root. .It Fl Fl no-xattrs (c, r, u, x modes only) -Do not archive or extract extended attributes. This is the reverse of +Do not archive or extract extended file attributes. This is the reverse of .Fl Fl xattrs and the default behavior if .Nm @@ -667,13 +668,13 @@ This option suppresses these behaviors. .It Fl p , Fl Fl insecure , Fl Fl preserve-permissions (x mode only) Preserve file permissions. -Attempt to restore the full permissions, including owner, file modes, ACLs, -extended attributes and extended file flags, if available, for each item -extracted from the archive. This is te reverse of +Attempt to restore the full permissions, including file modes, file attributes +or file flags, extended file attributes and ACLs, if available, for each item +extracted from the archive. This is the reverse of .Fl Fl no-same-permissions and the default if .Nm -is being run by root and can be partially overridden by also specifying +is being run as root. It can be partially overridden by also specifying .Fl Fl no-acls , .Fl Fl no-fflags , .Fl Fl no-mac-metadata @@ -844,7 +845,7 @@ See for more information about the handling of exclusions. .It Fl Fl xattrs (c, r, u, x modes only) -Archive or extract extended attributes. This is the reverse of +Archive or extract extended file attributes. This is the reverse of .Fl Fl no-xattrs and the default behavior in c, r, and u modes or if .Nm Modified: head/lib/libarchive/config_freebsd.h ============================================================================== --- head/lib/libarchive/config_freebsd.h Wed Jun 12 12:19:34 2019 (r348992) +++ head/lib/libarchive/config_freebsd.h Wed Jun 12 13:34:12 2019 (r348993) @@ -209,6 +209,7 @@ #define HAVE_TZSET 1 #define HAVE_UINTMAX_T 1 #define HAVE_UNISTD_H 1 +#define HAVE_UNLINKAT 1 #define HAVE_UNSETENV 1 #define HAVE_UNSIGNED_LONG_LONG 1 #define HAVE_UNSIGNED_LONG_LONG_INT 1 Modified: head/usr.bin/bsdcat/Makefile ============================================================================== --- head/usr.bin/bsdcat/Makefile Wed Jun 12 12:19:34 2019 (r348992) +++ head/usr.bin/bsdcat/Makefile Wed Jun 12 13:34:12 2019 (r348993) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.3.3 +BSDCAT_VERSION_STRING= 3.4.0 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Wed Jun 12 12:19:34 2019 (r348992) +++ head/usr.bin/cpio/Makefile Wed Jun 12 13:34:12 2019 (r348993) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.3.3 +BSDCPIO_VERSION_STRING= 3.4.0 .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Wed Jun 12 12:19:34 2019 (r348992) +++ head/usr.bin/tar/Makefile Wed Jun 12 13:34:12 2019 (r348993) @@ -4,7 +4,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.3.3 +BSDTAR_VERSION_STRING= 3.4.0 .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-svn-src-head@freebsd.org Wed Jun 12 15:58:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B66C15BACC4; Wed, 12 Jun 2019 15:58:12 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4003831F9; Wed, 12 Jun 2019 15:58:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2B571B319; Wed, 12 Jun 2019 15:58:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CFwBHw017293; Wed, 12 Jun 2019 15:58:11 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CFwB5V017292; Wed, 12 Jun 2019 15:58:11 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201906121558.x5CFwB5V017292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Wed, 12 Jun 2019 15:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348994 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 348994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4003831F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 15:58:12 -0000 Author: bdragon Date: Wed Jun 12 15:58:11 2019 New Revision: 348994 URL: https://svnweb.freebsd.org/changeset/base/348994 Log: Fix PPC970 boot after r348783 r348783 changed the behavior of the kernel mappings and broke booting on G5. - Split the kernel mapping logic out so that the case where we are running from the wrong memory space is handled using identity mappings, and the case where we are not using a DMAP is handled by forcibly mapping the kernel into the dmap range as intended by r348783. Reported by: Mikael Urankar Reviewed by: luporl Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D20608 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Jun 12 13:34:12 2019 (r348993) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Jun 12 15:58:11 2019 (r348994) @@ -684,8 +684,16 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel * without a direct map or on which the kernel is not already executing * out of the direct-mapped region. */ - - if (!hw_direct_map || kernelstart < DMAP_BASE_ADDRESS) { + if (kernelstart < DMAP_BASE_ADDRESS) { + /* + * For pre-dmap execution, we need to use identity mapping + * because we will be operating with the mmu on but in the + * wrong address configuration until we __restartkernel(). + */ + for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; + pa += PAGE_SIZE) + moea64_kenter(mmup, pa, pa); + } else if (!hw_direct_map) { pkernelstart = kernelstart & ~DMAP_BASE_ADDRESS; pkernelend = kernelend & ~DMAP_BASE_ADDRESS; for (pa = pkernelstart & ~PAGE_MASK; pa < pkernelend; From owner-svn-src-head@freebsd.org Wed Jun 12 16:05:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C13515BAF44; Wed, 12 Jun 2019 16:05:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3D8A836D5; Wed, 12 Jun 2019 16:05:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A1D41B4D6; Wed, 12 Jun 2019 16:05:21 +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 x5CG5LMu022495; Wed, 12 Jun 2019 16:05:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CG5LvN022494; Wed, 12 Jun 2019 16:05:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906121605.x5CG5LvN022494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 12 Jun 2019 16:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348995 - head/sys/modules/hwpmc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/hwpmc X-SVN-Commit-Revision: 348995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3D8A836D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 16:05:22 -0000 Author: ian Date: Wed Jun 12 16:05:20 2019 New Revision: 348995 URL: https://svnweb.freebsd.org/changeset/base/348995 Log: Don't attempt to include hwpmc support for armv6, we're missing some of the necessary support functions in cpu-v6.h, and it may be that the only armv6 platform we support (RPi, the bcm2835 SOC) is incapable of supporting hwpmc. Reported by: dim@ Modified: head/sys/modules/hwpmc/Makefile Modified: head/sys/modules/hwpmc/Makefile ============================================================================== --- head/sys/modules/hwpmc/Makefile Wed Jun 12 15:58:11 2019 (r348994) +++ head/sys/modules/hwpmc/Makefile Wed Jun 12 16:05:20 2019 (r348995) @@ -22,7 +22,7 @@ SRCS+= hwpmc_x86.c hwpmc_uncore.c SRCS+= hwpmc_arm.c .endif -.if ${MACHINE_ARCH:Marmv[67]*} != "" +.if ${MACHINE_ARCH} == "armv7" SRCS+= hwpmc_armv7.c .endif From owner-svn-src-head@freebsd.org Wed Jun 12 16:06:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F0715BAFE8; Wed, 12 Jun 2019 16:06:32 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6EA83833; Wed, 12 Jun 2019 16:06:32 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD3241B4D8; Wed, 12 Jun 2019 16:06:31 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CG6VOd022583; Wed, 12 Jun 2019 16:06:31 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CG6VjG022582; Wed, 12 Jun 2019 16:06:31 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201906121606.x5CG6VjG022582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 12 Jun 2019 16:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348996 - head/sys/dev/ipmi X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/dev/ipmi X-SVN-Commit-Revision: 348996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E6EA83833 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 16:06:32 -0000 Author: jtl Date: Wed Jun 12 16:06:31 2019 New Revision: 348996 URL: https://svnweb.freebsd.org/changeset/base/348996 Log: The current IPMI KCS code is waiting 100us for all transitions (roughly between each byte either sent or received). However, most transitions actually complete in 2-3 microseconds. By polling the status register with a delay of 4us with exponential backoff, the performance of most IPMI operations is significantly improved: - A BMC update on a Supermicro x9 or x11 motherboard goes from ~1 hour to ~6-8 minutes. - An ipmitool sensor list time improves by a factor of 4. Testing showed no significant improvements on a modern server by using a lower delay. The changes should also generally reduce the total amount of CPU or I/O bandwidth used for a given IPMI operation. Submitted by: Loic Prylli Reviewed by: jhb MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20527 Modified: head/sys/dev/ipmi/ipmi_kcs.c Modified: head/sys/dev/ipmi/ipmi_kcs.c ============================================================================== --- head/sys/dev/ipmi/ipmi_kcs.c Wed Jun 12 16:05:20 2019 (r348995) +++ head/sys/dev/ipmi/ipmi_kcs.c Wed Jun 12 16:06:31 2019 (r348996) @@ -48,55 +48,46 @@ __FBSDID("$FreeBSD$"); #include #endif +#define POLLING_DELAY_MIN 4 /* Waits are 2-3 usecs on typical systems */ +#define POLLING_DELAY_MAX 256 + static void kcs_clear_obf(struct ipmi_softc *, int); static void kcs_error(struct ipmi_softc *); -static int kcs_wait_for_ibf(struct ipmi_softc *, int); -static int kcs_wait_for_obf(struct ipmi_softc *, int); +static int kcs_wait_for_ibf(struct ipmi_softc *, bool); +static int kcs_wait_for_obf(struct ipmi_softc *, bool); static int -kcs_wait_for_ibf(struct ipmi_softc *sc, int state) +kcs_wait(struct ipmi_softc *sc, int value, int mask) { int status, start = ticks; + int delay_usec = POLLING_DELAY_MIN; status = INB(sc, KCS_CTL_STS); - if (state == 0) { - /* WAIT FOR IBF = 0 */ - while (ticks - start < MAX_TIMEOUT && status & KCS_STATUS_IBF) { - DELAY(100); - status = INB(sc, KCS_CTL_STS); - } - } else { - /* WAIT FOR IBF = 1 */ - while (ticks - start < MAX_TIMEOUT && - !(status & KCS_STATUS_IBF)) { - DELAY(100); - status = INB(sc, KCS_CTL_STS); - } + while (ticks - start < MAX_TIMEOUT && (status & mask) != value) { + /* + * The wait delay is increased exponentially to avoid putting + * significant load on I/O bus. + */ + DELAY(delay_usec); + status = INB(sc, KCS_CTL_STS); + if (delay_usec < POLLING_DELAY_MAX) + delay_usec *= 2; } return (status); } static int -kcs_wait_for_obf(struct ipmi_softc *sc, int state) +kcs_wait_for_ibf(struct ipmi_softc *sc, bool level) { - int status, start = ticks; - status = INB(sc, KCS_CTL_STS); - if (state == 0) { - /* WAIT FOR OBF = 0 */ - while (ticks - start < MAX_TIMEOUT && status & KCS_STATUS_OBF) { - DELAY(100); - status = INB(sc, KCS_CTL_STS); - } - } else { - /* WAIT FOR OBF = 1 */ - while (ticks - start < MAX_TIMEOUT && - !(status & KCS_STATUS_OBF)) { - DELAY(100); - status = INB(sc, KCS_CTL_STS); - } - } - return (status); + return (kcs_wait(sc, level ? KCS_STATUS_IBF : 0, KCS_STATUS_IBF)); +} + +static int +kcs_wait_for_obf(struct ipmi_softc *sc, bool level) +{ + + return (kcs_wait(sc, level ? KCS_STATUS_OBF : 0, KCS_STATUS_OBF)); } static void From owner-svn-src-head@freebsd.org Wed Jun 12 16:49:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12A5415BC213; Wed, 12 Jun 2019 16:49:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9BE285271; Wed, 12 Jun 2019 16:49:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80FAF1BB8B; Wed, 12 Jun 2019 16:49:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CGn1mh044235; Wed, 12 Jun 2019 16:49:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CGn1Zb044234; Wed, 12 Jun 2019 16:49:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906121649.x5CGn1Zb044234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 12 Jun 2019 16:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348998 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9BE285271 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 16:49:02 -0000 Author: jhb Date: Wed Jun 12 16:49:01 2019 New Revision: 348998 URL: https://svnweb.freebsd.org/changeset/base/348998 Log: Remove a spurious break when setting up a 64-bit memory BAR. This was causing 'enbit' to not be initialized in this case. CID: 1401924 Reported by: Coverity MFC after: 1 week Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Wed Jun 12 16:34:02 2019 (r348997) +++ head/usr.sbin/bhyve/pci_emul.c Wed Jun 12 16:49:01 2019 (r348998) @@ -634,7 +634,6 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; - break; } else { baseptr = &pci_emul_membase32; limit = PCI_EMUL_MEMLIMIT32; From owner-svn-src-head@freebsd.org Wed Jun 12 18:07:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D3615BDE89; Wed, 12 Jun 2019 18:07:07 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9EF87D77; Wed, 12 Jun 2019 18:07:07 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDB301C97F; Wed, 12 Jun 2019 18:07:06 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CI76lZ085941; Wed, 12 Jun 2019 18:07:06 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CI75jY085932; Wed, 12 Jun 2019 18:07:05 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201906121807.x5CI75jY085932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 12 Jun 2019 18:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348999 - in head: bin/stty share/man/man4 sys/dev/uart sys/dev/usb/serial sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head: bin/stty share/man/man4 sys/dev/uart sys/dev/usb/serial sys/kern sys/sys X-SVN-Commit-Revision: 348999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D9EF87D77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 18:07:07 -0000 Author: shurd Date: Wed Jun 12 18:07:04 2019 New Revision: 348999 URL: https://svnweb.freebsd.org/changeset/base/348999 Log: Some devices take undesired actions when RTS and DTR are asserted. Some development boards for example will reset on DTR, and some radio interfaces will transmit on RTS. This patch allows "stty -f /dev/ttyu9.init -rtsdtr" to prevent RTS and DTR from being asserted on open(), allowing these devices to be used without problems. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20031 Modified: head/bin/stty/modes.c head/bin/stty/print.c head/bin/stty/stty.1 head/share/man/man4/termios.4 head/sys/dev/uart/uart_tty.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/usb_serial.c head/sys/kern/tty.c head/sys/sys/_termios.h Modified: head/bin/stty/modes.c ============================================================================== --- head/bin/stty/modes.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/bin/stty/modes.c Wed Jun 12 18:07:04 2019 (r348999) @@ -91,6 +91,8 @@ static const struct modes cmodes[] = { { "-rtsflow", 0, CRTS_IFLOW }, { "mdmbuf", MDMBUF, 0 }, { "-mdmbuf", 0, MDMBUF }, + { "rtsdtr", 0, CNO_RTSDTR }, + { "-rtsdtr", CNO_RTSDTR, 0 }, { NULL, 0, 0 }, }; Modified: head/bin/stty/print.c ============================================================================== --- head/bin/stty/print.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/bin/stty/print.c Wed Jun 12 18:07:04 2019 (r348999) @@ -184,6 +184,12 @@ print(struct termios *tp, struct winsize *wp, int ldis put("-dsrflow", CDSR_OFLOW, 0); put("-dtrflow", CDTR_IFLOW, 0); put("-mdmbuf", MDMBUF, 0); /* XXX mdmbuf == dtrflow */ + if (on(CNO_RTSDTR)) + bput("-rtsdtr"); + else { + if (fmt >= BSD) + bput("rtsdtr"); + } /* special control characters */ cc = tp->c_cc; Modified: head/bin/stty/stty.1 ============================================================================== --- head/bin/stty/stty.1 Wed Jun 12 16:49:01 2019 (r348998) +++ head/bin/stty/stty.1 Wed Jun 12 18:07:04 2019 (r348999) @@ -145,6 +145,8 @@ Assume a line without (with) modem control. .It Cm crtscts Pq Fl crtscts Enable (disable) RTS/CTS flow control. +.It Cm rtsdtr Pq Fl -rtsdtr +Enable (disable) asserting RTS/DTR on open. .El .Ss Input Modes: This corresponds to the c_iflag in the termios structure. Modified: head/share/man/man4/termios.4 ============================================================================== --- head/share/man/man4/termios.4 Wed Jun 12 16:49:01 2019 (r348998) +++ head/share/man/man4/termios.4 Wed Jun 12 18:07:04 2019 (r348999) @@ -1185,6 +1185,8 @@ flow control of output */ /* RTS flow control of input */ .It Dv MDMBUF /* flow control output via Carrier */ +.It Dv CNO_RTSDTR +/* Do not assert RTS or DTR automatically */ .El .Pp The @@ -1266,6 +1268,12 @@ If .Dv MDMBUF is set then output flow control is controlled by the state of Carrier Detect. +.Pp +If +.Dv CNO_RTSDTR +is set then the RTS and DTR lines will not be asserted when the device +is opened. +As a result, this flag is only useful on initial-state devices. .Pp If the object for which the control modes are set is not an asynchronous serial connection, some of the modes may be ignored; for example, if an Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/sys/dev/uart/uart_tty.c Wed Jun 12 18:07:04 2019 (r348999) @@ -285,13 +285,16 @@ uart_tty_param(struct tty *tp, struct termios *t) parity = UART_PARITY_NONE; if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) return (EINVAL); - UART_SETSIG(sc, SER_DDTR | SER_DTR); + if ((t->c_cflag & CNO_RTSDTR) == 0) + UART_SETSIG(sc, SER_DDTR | SER_DTR); /* Set input flow control state. */ if (!sc->sc_hwiflow) { if ((t->c_cflag & CRTS_IFLOW) && sc->sc_isquelch) UART_SETSIG(sc, SER_DRTS); - else - UART_SETSIG(sc, SER_DRTS | SER_RTS); + else { + if ((t->c_cflag & CNO_RTSDTR) == 0) + UART_SETSIG(sc, SER_DRTS | SER_RTS); + } } else UART_IOCTL(sc, UART_IOCTL_IFLOW, (t->c_cflag & CRTS_IFLOW)); /* Set output flow control state. */ Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/sys/dev/usb/serial/umcs.c Wed Jun 12 18:07:04 2019 (r348999) @@ -499,7 +499,9 @@ umcs7840_cfg_open(struct ucom_softc *ucom) * Enable DTR/RTS on modem control, enable modem interrupts -- * documented */ - sc->sc_ports[pn].sc_mcr = MCS7840_UART_MCR_DTR | MCS7840_UART_MCR_RTS | MCS7840_UART_MCR_IE; + sc->sc_ports[pn].sc_mcr = MCS7840_UART_MCR_IE; + if (ucom->sc_tty == NULL || (ucom->sc_tty->t_termios.c_cflag & CNO_RTSDTR) == 0) + sc->sc_ports[pn].sc_mcr |= MCS7840_UART_MCR_DTR | MCS7840_UART_MCR_RTS; if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, sc->sc_ports[pn].sc_mcr)) return; Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/sys/dev/usb/serial/usb_serial.c Wed Jun 12 18:07:04 2019 (r348999) @@ -796,7 +796,8 @@ ucom_open(struct tty *tp) &sc->sc_start_task[0].hdr, &sc->sc_start_task[1].hdr); - ucom_modem(tp, SER_DTR | SER_RTS, 0); + if (sc->sc_tty == NULL || (sc->sc_tty->t_termios.c_cflag & CNO_RTSDTR) == 0) + ucom_modem(tp, SER_DTR | SER_RTS, 0); ucom_ring(sc, 0); Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Jun 12 16:49:01 2019 (r348998) +++ head/sys/kern/tty.c Wed Jun 12 18:07:04 2019 (r348999) @@ -93,7 +93,7 @@ static const char *dev_console_filename; FLUSHO|NOKERNINFO|NOFLSH) #define TTYSUP_CFLAG (CIGNORE|CSIZE|CSTOPB|CREAD|PARENB|PARODD|\ HUPCL|CLOCAL|CCTS_OFLOW|CRTS_IFLOW|CDTR_IFLOW|\ - CDSR_OFLOW|CCAR_OFLOW) + CDSR_OFLOW|CCAR_OFLOW|CNO_RTSDTR) #define TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT) @@ -332,7 +332,8 @@ ttydev_open(struct cdev *dev, int oflags, int devtype if (TTY_CALLOUT(tp, dev) || dev == dev_console) tp->t_termios.c_cflag |= CLOCAL; - ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); + if ((tp->t_termios.c_cflag & CNO_RTSDTR) == 0) + ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); error = ttydevsw_open(tp); if (error != 0) Modified: head/sys/sys/_termios.h ============================================================================== --- head/sys/sys/_termios.h Wed Jun 12 16:49:01 2019 (r348998) +++ head/sys/sys/_termios.h Wed Jun 12 18:07:04 2019 (r348999) @@ -143,6 +143,7 @@ #define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ #define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ #define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ +#define CNO_RTSDTR 0x00200000 /* Do not assert RTS or DTR automatically */ #endif From owner-svn-src-head@freebsd.org Wed Jun 12 19:29:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D31D15BFFC2; Wed, 12 Jun 2019 19:29:14 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF3C88A748; Wed, 12 Jun 2019 19:29:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DA131D713; Wed, 12 Jun 2019 19:29:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CJTDb2027583; Wed, 12 Jun 2019 19:29:13 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CJTCKQ027579; Wed, 12 Jun 2019 19:29:12 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906121929.x5CJTCKQ027579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 12 Jun 2019 19:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349000 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 349000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF3C88A748 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 19:29:14 -0000 Author: oshogbo Date: Wed Jun 12 19:29:12 2019 New Revision: 349000 URL: https://svnweb.freebsd.org/changeset/base/349000 Log: geli: partially revert r348709 Let's change the unsigned arguments to the signed one, but let's don't change pointers to the array notation. Requested by: pjd Modified: head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_hmac.c head/sys/geom/eli/pkcs5v2.c head/sys/geom/eli/pkcs5v2.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Wed Jun 12 18:07:04 2019 (r348999) +++ head/sys/geom/eli/g_eli.h Wed Jun 12 19:29:12 2019 (r349000) @@ -721,12 +721,12 @@ struct hmac_ctx { SHA512_CTX outerctx; }; -void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char hkey[], +void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char *hkey, size_t hkeylen); void g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const uint8_t *data, size_t datasize); void g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize); -void g_eli_crypto_hmac(const char hkey[], size_t hkeysize, +void g_eli_crypto_hmac(const char *hkey, size_t hkeysize, const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize); void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, Modified: head/sys/geom/eli/g_eli_hmac.c ============================================================================== --- head/sys/geom/eli/g_eli_hmac.c Wed Jun 12 18:07:04 2019 (r348999) +++ head/sys/geom/eli/g_eli_hmac.c Wed Jun 12 19:29:12 2019 (r349000) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include void -g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char hkey[], +g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char *hkey, size_t hkeylen) { u_char k_ipad[128], k_opad[128], key[128]; @@ -110,7 +110,7 @@ g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t } void -g_eli_crypto_hmac(const char hkey[], size_t hkeysize, const uint8_t *data, +g_eli_crypto_hmac(const char *hkey, size_t hkeysize, const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize) { struct hmac_ctx ctx; Modified: head/sys/geom/eli/pkcs5v2.c ============================================================================== --- head/sys/geom/eli/pkcs5v2.c Wed Jun 12 18:07:04 2019 (r348999) +++ head/sys/geom/eli/pkcs5v2.c Wed Jun 12 19:29:12 2019 (r349000) @@ -52,7 +52,7 @@ xor(uint8_t *dst, const uint8_t *src, size_t size) void pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt, - size_t saltsize, const char passphrase[], u_int iterations) + size_t saltsize, const char *passphrase, u_int iterations) { uint8_t md[SHA512_MDLEN], saltcount[saltsize + sizeof(uint32_t)]; uint8_t *counter, *keyp; Modified: head/sys/geom/eli/pkcs5v2.h ============================================================================== --- head/sys/geom/eli/pkcs5v2.h Wed Jun 12 18:07:04 2019 (r348999) +++ head/sys/geom/eli/pkcs5v2.h Wed Jun 12 19:29:12 2019 (r349000) @@ -31,7 +31,7 @@ #ifndef _PKCS5V2_H_ #define _PKCS5V2_H_ void pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt, - size_t saltsize, const char passphrase[], u_int iterations); + size_t saltsize, const char *passphrase, u_int iterations); #ifndef _KERNEL int pkcs5v2_calculate(int usecs); #endif From owner-svn-src-head@freebsd.org Wed Jun 12 19:29:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF2715C0002; Wed, 12 Jun 2019 19:29:49 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 041138A862; Wed, 12 Jun 2019 19:29:49 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D101B1D714; Wed, 12 Jun 2019 19:29:48 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CJTmXt027648; Wed, 12 Jun 2019 19:29:48 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CJTmwt027647; Wed, 12 Jun 2019 19:29:48 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906121929.x5CJTmwt027647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 12 Jun 2019 19:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349001 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 349001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 041138A862 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 19:29:49 -0000 Author: oshogbo Date: Wed Jun 12 19:29:48 2019 New Revision: 349001 URL: https://svnweb.freebsd.org/changeset/base/349001 Log: geli: style nits Modified: head/sys/geom/eli/g_eli_hmac.c Modified: head/sys/geom/eli/g_eli_hmac.c ============================================================================== --- head/sys/geom/eli/g_eli_hmac.c Wed Jun 12 19:29:12 2019 (r349000) +++ head/sys/geom/eli/g_eli_hmac.c Wed Jun 12 19:29:48 2019 (r349001) @@ -96,11 +96,11 @@ g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t /* Complete inner hash */ SHA512_Final(digest, &ctx->innerctx); - + /* Complete outer hash */ SHA512_Update(&ctx->outerctx, digest, sizeof(digest)); SHA512_Final(digest, &ctx->outerctx); - + explicit_bzero(ctx, sizeof(*ctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) From owner-svn-src-head@freebsd.org Wed Jun 12 19:31:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B8BF15C00BC; Wed, 12 Jun 2019 19:31:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2F768AABD; Wed, 12 Jun 2019 19:31:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C7A71D865; Wed, 12 Jun 2019 19:31:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CJVRDf031781; Wed, 12 Jun 2019 19:31:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CJVRha031779; Wed, 12 Jun 2019 19:31:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906121931.x5CJVRha031779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 12 Jun 2019 19:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349002 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 349002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2F768AABD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 19:31:28 -0000 Author: oshogbo Date: Wed Jun 12 19:31:26 2019 New Revision: 349002 URL: https://svnweb.freebsd.org/changeset/base/349002 Log: fileargs: add wrapping/unwrapping functions Those function may be useful to pass fileargs connections around. Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Jun 12 19:29:48 2019 (r349001) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Jun 12 19:31:26 2019 (r349002) @@ -424,6 +424,39 @@ fileargs_free(fileargs_t *fa) free(fa); } +cap_channel_t * +fileargs_unwrap(fileargs_t *fa, int *flags) +{ + cap_channel_t *chan; + + if (fa == NULL) + return (NULL); + + assert(fa->fa_magic == FILEARGS_MAGIC); + + chan = fa->fa_chann; + if (flags != NULL) { + *flags = fa->fa_fdflags; + } + + nvlist_destroy(fa->fa_cache); + explicit_bzero(&fa->fa_magic, sizeof(fa->fa_magic)); + free(fa); + + return (chan); +} + +fileargs_t * +fileargs_wrap(cap_channel_t *chan, int fdflags) +{ + + if (chan == NULL) { + return (NULL); + } + + return (fileargs_create(chan, fdflags)); +} + /* * Service functions. */ Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Jun 12 19:29:48 2019 (r349001) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Jun 12 19:31:26 2019 (r349002) @@ -54,6 +54,9 @@ int fileargs_lstat(fileargs_t *fa, const char *name, s int fileargs_open(fileargs_t *fa, const char *name); void fileargs_free(fileargs_t *fa); FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); + +fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags); +cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags); #else typedef struct fileargs { int fa_flags; @@ -114,7 +117,27 @@ FILE *fileargs_fopen(fileargs_t *fa, const char *name, (void) fa; return (fopen(name, mode)); } -#define fileargs_free(fa) (free(fa)) +#define fileargs_free(fa) (free(fa)) + +static inline fileargs_t * +fileargs_wrap(cap_channel_t *chan, int fdflags) +{ + + cap_close(chan); + return (fileargs_init(0, NULL, fdflags, 0, NULL, 0)); +} + +static inline cap_channel_t * +fileargs_unwrap(fileargs_t *fa, int *fdflags) +{ + + if (fdflags != NULL) { + *fdflags = fa->fa_flags; + } + fileargs_free(fa); + return (cap_init()); +} + #endif #endif /* !_FILEARGS_H_ */ From owner-svn-src-head@freebsd.org Wed Jun 12 20:38:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE0A15C1714; Wed, 12 Jun 2019 20:38:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2F258CD80; Wed, 12 Jun 2019 20:38:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A69561E303; Wed, 12 Jun 2019 20:38:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5CKcnFu065003; Wed, 12 Jun 2019 20:38:49 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CKcnix065002; Wed, 12 Jun 2019 20:38:49 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906122038.x5CKcnix065002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 12 Jun 2019 20:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349003 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2F258CD80 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 20:38:50 -0000 Author: alc Date: Wed Jun 12 20:38:49 2019 New Revision: 349003 URL: https://svnweb.freebsd.org/changeset/base/349003 Log: Change pmap_demote_l2_locked() so that it removes the superpage mapping on a demotion failure. Otherwise, some callers to pmap_demote_l2_locked(), such as pmap_protect(), may leave an incorrect mapping in place on a demotion failure. Change pmap_demote_l2_locked() so that it handles addresses that are not superpage aligned. Some callers to pmap_demote_l2_locked(), such as pmap_protect(), may not pass a superpage aligned address. Change pmap_enter_l2() so that it correctly calls vm_page_free_pages_toq(). The arm64 pmap is updating the count of wired pages when freeing page table pages, so pmap_enter_l2() should pass false to vm_page_free_pages_toq(). Optimize TLB invalidation in pmap_remove_l2(). Reviewed by: kib, markj (an earlier version) Discussed with: andrew MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D20585 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 12 19:31:26 2019 (r349002) +++ head/sys/arm64/arm64/pmap.c Wed Jun 12 20:38:49 2019 (r349003) @@ -2267,6 +2267,8 @@ pmap_pv_demote_l2(pmap_t pmap, vm_offset_t va, vm_padd int bit, field; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((va & L2_OFFSET) == 0, + ("pmap_pv_demote_l2: va is not 2mpage aligned")); KASSERT((pa & L2_OFFSET) == 0, ("pmap_pv_demote_l2: pa is not 2mpage aligned")); CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); @@ -2277,7 +2279,6 @@ pmap_pv_demote_l2(pmap_t pmap, vm_offset_t va, vm_padd * must not be released until the last pv entry is reinstantiated. */ pvh = pa_to_pvh(pa); - va = va & ~L2_OFFSET; pv = pmap_pvh_remove(pvh, pmap, va); KASSERT(pv != NULL, ("pmap_pv_demote_l2: pv not found")); m = PHYS_TO_VM_PAGE(pa); @@ -2433,7 +2434,13 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ old_l2 = pmap_load_clear(l2); KASSERT((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK, ("pmap_remove_l2: L2e %lx is not a block mapping", old_l2)); - pmap_invalidate_range(pmap, sva, sva + L2_SIZE); + + /* + * Since a promotion must break the 4KB page mappings before making + * the 2MB page mapping, a pmap_invalidate_page() suffices. + */ + pmap_invalidate_page(pmap, sva); + if (old_l2 & ATTR_SW_WIRED) pmap->pm_stats.wired_count -= L2_SIZE / PAGE_SIZE; pmap_resident_count_dec(pmap, L2_SIZE / PAGE_SIZE); @@ -2571,8 +2578,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_remove_l2(pmap, l2, sva, pmap_load(l1), &free, &lock); continue; - } else if (pmap_demote_l2_locked(pmap, l2, - sva &~L2_OFFSET, &lock) == NULL) + } else if (pmap_demote_l2_locked(pmap, l2, sva, + &lock) == NULL) continue; l3_paddr = pmap_load(l2); } @@ -3052,8 +3059,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if (pde != NULL && lvl == 1) { l2 = pmap_l1_to_l2(pde, va); if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && - (l3 = pmap_demote_l2_locked(pmap, l2, va & ~L2_OFFSET, - &lock)) != NULL) { + (l3 = pmap_demote_l2_locked(pmap, l2, va, &lock)) != NULL) { l3 = &l3[pmap_l3_index(va)]; if (va < VM_MAXUSER_ADDRESS) { mpte = PHYS_TO_VM_PAGE( @@ -3391,7 +3397,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t lockp) != 0) break; } - vm_page_free_pages_toq(&free, true); + vm_page_free_pages_toq(&free, false); if (va >= VM_MAXUSER_ADDRESS) { /* * Both pmap_remove_l2() and pmap_remove_l3() will @@ -3419,7 +3425,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t * Invalidate those entries. */ pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); + vm_page_free_pages_toq(&free, false); } CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p", @@ -4331,8 +4337,7 @@ retry_pv_loop: va = pv->pv_va; pte = pmap_pte(pmap, pv->pv_va, &lvl); if ((pmap_load(pte) & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) - pmap_demote_l2_locked(pmap, pte, va & ~L2_OFFSET, - &lock); + (void)pmap_demote_l2_locked(pmap, pte, va, &lock); KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), ("inconsistent pv lock %p %p for page %p", lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); @@ -4906,7 +4911,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size pte = pmap_l1_to_l2(pte, tmpva); case 2: newpte = pmap_demote_l2(kernel_pmap, pte, - tmpva & ~L2_OFFSET); + tmpva); if (newpte == NULL) return (EINVAL); pte = pmap_l2_to_l3(pte, tmpva); @@ -5005,6 +5010,18 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_ return (l2); } +static void +pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_entry_t *l2, + struct rwlock **lockp) +{ + struct spglist free; + + SLIST_INIT(&free); + (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, + lockp); + vm_page_free_pages_toq(&free, false); +} + /* * Create an L3 table to map all addresses within an L2 mapping. */ @@ -5023,8 +5040,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ oldl2 = pmap_load(l2); KASSERT((oldl2 & ATTR_DESCR_MASK) == L2_BLOCK, ("pmap_demote_l2: Demoting a non-block entry")); - KASSERT((va & L2_OFFSET) == 0, - ("pmap_demote_l2: Invalid virtual address %#lx", va)); + va &= ~L2_OFFSET; tmpl2 = 0; if (va <= (vm_offset_t)l2 && va + L2_SIZE > (vm_offset_t)l2) { @@ -5033,15 +5049,57 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ return (NULL); } + /* + * Invalidate the 2MB page mapping and return "failure" if the + * mapping was never accessed. + */ + if ((oldl2 & ATTR_AF) == 0) { + KASSERT((oldl2 & ATTR_SW_WIRED) == 0, + ("pmap_demote_l2: a wired mapping is missing ATTR_AF")); + pmap_demote_l2_abort(pmap, va, l2, lockp); + CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx in pmap %p", + va, pmap); + goto fail; + } + if ((ml3 = pmap_remove_pt_page(pmap, va)) == NULL) { + KASSERT((oldl2 & ATTR_SW_WIRED) == 0, + ("pmap_demote_l2: page table page for a wired mapping" + " is missing")); + + /* + * If the page table page is missing and the mapping + * is for a kernel address, the mapping must belong to + * the direct map. Page table pages are preallocated + * for every other part of the kernel address space, + * so the direct map region is the only part of the + * kernel address space that must be handled here. + */ + KASSERT(va < VM_MAXUSER_ADDRESS || VIRT_IN_DMAP(va), + ("pmap_demote_l2: No saved mpte for va %#lx", va)); + + /* + * If the 2MB page mapping belongs to the direct map + * region of the kernel's address space, then the page + * allocation request specifies the highest possible + * priority (VM_ALLOC_INTERRUPT). Otherwise, the + * priority is normal. + */ ml3 = vm_page_alloc(NULL, pmap_l2_pindex(va), (VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + + /* + * If the allocation of the new page table page fails, + * invalidate the 2MB page mapping and return "failure". + */ if (ml3 == NULL) { + pmap_demote_l2_abort(pmap, va, l2, lockp); CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx" " in pmap %p", va, pmap); goto fail; } + if (va < VM_MAXUSER_ADDRESS) { ml3->wire_count = NL3PG; pmap_resident_count_inc(pmap, 1); @@ -5090,6 +5148,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ if ((oldl2 & ATTR_SW_MANAGED) != 0) reserve_pv_entries(pmap, Ln_ENTRIES - 1, lockp); + /* + * Pass PAGE_SIZE so that a single TLB invalidation is performed on + * the 2MB page mapping. + */ pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); /* From owner-svn-src-head@freebsd.org Wed Jun 12 21:09:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC4ED15C1DCF; Wed, 12 Jun 2019 21:09:33 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65E468D8CC; Wed, 12 Jun 2019 21:09:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C646C3C0182; Wed, 12 Jun 2019 21:09:30 +0000 (UTC) Date: Wed, 12 Jun 2019 21:09:30 +0000 From: Brooks Davis To: Shawn Webb Cc: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org Subject: Re: svn commit: r348843 - head/sys/vm Message-ID: <20190612210930.GK64641@spindle.one-eyed-alien.net> References: <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mhOzvPhkurUs4vA9" Content-Disposition: inline In-Reply-To: <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 65E468D8CC X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.33 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spindle.one-eyed-alien.net]; NEURAL_HAM_SHORT(-0.84)[-0.844,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.58)[ip: (-9.31), ipnet: 199.48.128.0/22(-4.63), asn: 36236(-3.88), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 21:09:34 -0000 --mhOzvPhkurUs4vA9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2019 at 09:00:34AM -0400, Shawn Webb wrote: > On Mon, Jun 10, 2019 at 03:07:11AM +0000, Doug Moore wrote: > > Author: dougm > > Date: Mon Jun 10 03:07:10 2019 > > New Revision: 348843 > > URL: https://svnweb.freebsd.org/changeset/base/348843 > >=20 > > Log: > > There are times when a len=3D=3D0 parameter to mmap is okay. But on a > > 32-bit machine, a len parameter just a few bytes short of 4G, rounded > > up to a page boundary and hitting zero then, is not okay. Return > > failure in that case. > > =20 > > Reported by: pho > > Reviewed by: alc, kib (mentor) > > Tested by: pho > > Differential Revision: https://reviews.freebsd.org/D20580 > >=20 > > Modified: > > head/sys/vm/vm_mmap.c > >=20 > > Modified: head/sys/vm/vm_mmap.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/vm/vm_mmap.c Sun Jun 9 22:55:21 2019 (r348842) > > +++ head/sys/vm/vm_mmap.c Mon Jun 10 03:07:10 2019 (r348843) > > @@ -257,7 +257,10 @@ kern_mmap(struct thread *td, uintptr_t addr0, size= _t s > > =20 > > /* Adjust size for rounding (on both ends). */ > > size +=3D pageoff; /* low end... */ > > - size =3D (vm_size_t) round_page(size); /* hi end */ > > + /* Check for rounding up to zero. */ > > + if (round_page(size) < size) > > + return (EINVAL); >=20 > The mmap(2) manpage says that len=3D=3D0 results in EINVAL, so the manpage > needs updating. The manpage is correct for ABIs people are actually writing code for (ELF). I suppose it could document the exception for a.out (see the conditional containing SV_CURPROC_FLAG(SV_AOUT) in kern_mmap()), but it should be in BUGS, HISTORY, or some such. -- Brooks --mhOzvPhkurUs4vA9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdAWoKAAoJEKzQXbSebgfAd5wIAJ8q1Nv3uNJSB2JZkCfk8rSr 7D8CpRyHqrzP1+ew7QrW8r53gqExbnwki01IloB9v27TuCmTALmDMpQFQalAHXsi yrFlO/YuyhMW+Zfnrv6ym6PoYV6KzyoHN7W2r30ObKkJG4mqfjU6PWrKp8A1eIoh VJYzlcbcXWooDTG5l1MIAeEVaxziUN61+WtXBsj5mBQd3ionbpJP9kMZxoMCbbqb 0iI+YJUETCLIF/BS6EcnIOJpVTChobJ5hk1LIOqRfU/I4uo+d1ThRbX+pYJy/TkS 03X5pcxKd5f6MPxvPZp2N2RB5rWizWj/HHzgLMoEyg1J34TR0/d5GmQk7h9DLaU= =kkOR -----END PGP SIGNATURE----- --mhOzvPhkurUs4vA9-- From owner-svn-src-head@freebsd.org Wed Jun 12 21:10:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E5515C1E56; Wed, 12 Jun 2019 21:10:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FAB08DA53; Wed, 12 Jun 2019 21:10:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67B571E827; Wed, 12 Jun 2019 21:10:40 +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 x5CLAewe080597; Wed, 12 Jun 2019 21:10:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CLAbm3080581; Wed, 12 Jun 2019 21:10:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201906122110.x5CLAbm3080581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 12 Jun 2019 21:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349004 - in head: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Target/... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/... X-SVN-Commit-Revision: 349004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8FAB08DA53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 21:10:41 -0000 Author: dim Date: Wed Jun 12 21:10:37 2019 New Revision: 349004 URL: https://svnweb.freebsd.org/changeset/base/349004 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp to the upstream release_80 branch r363030 (effectively, 8.0.1 rc2). The 8.0.1 release should follow this within a week or so. MFC after: 2 weeks Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc head/contrib/libunwind/src/UnwindRegistersRestore.S head/contrib/libunwind/src/UnwindRegistersSave.S head/contrib/libunwind/src/assembly.h head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/WasmObjectWriter.cpp head/contrib/llvm/lib/Object/COFFImportFile.cpp head/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td head/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp head/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td head/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp head/contrib/llvm/lib/Target/AVR/AVRISelLowering.h head/contrib/llvm/lib/Target/AVR/AVRSubtarget.cpp head/contrib/llvm/lib/Target/AVR/AVRSubtarget.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp head/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsFastISel.cpp head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Linux.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp head/contrib/llvm/tools/lld/COFF/Writer.cpp head/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp head/contrib/llvm/tools/lld/ELF/InputSection.cpp head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp head/contrib/llvm/tools/lld/ELF/Writer.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/freebsd_cc_version.h head/lib/clang/headers/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/libclang_rt/Makefile.inc head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/libunwind/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/openmp/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jun 12 20:38:49 2019 (r349003) +++ head/ObsoleteFiles.inc Wed Jun 12 21:10:37 2019 (r349004) @@ -38,6 +38,157 @@ # xargs -n1 | sort | uniq -d; # done +# 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/8.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/8.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/8.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/8.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/8.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/8.0.0/include +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/8.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/8.0.0/lib +OLD_DIRS+=usr/lib/clang/8.0.0 + # 20190523: Remove obsolete kgzip and support files OLD_FILES+=usr/sbin/kgzip OLD_FILES+=usr/lib/kgzldr.o Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jun 12 20:38:49 2019 (r349003) +++ head/UPDATING Wed Jun 12 21:10:37 2019 (r349004) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190612: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 8.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20190608: A fix was applied to i386 kernel modules to avoid panics with dpcpu or vnet. Users need to recompile i386 kernel modules Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Wed Jun 12 21:10:37 2019 (r349004) @@ -124,7 +124,9 @@ #include #include #include +#if 0 #include +#endif #include #include #include Modified: head/contrib/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- head/contrib/libunwind/src/UnwindRegistersRestore.S Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/libunwind/src/UnwindRegistersRestore.S Wed Jun 12 21:10:37 2019 (r349004) @@ -396,119 +396,119 @@ Lnovec: #elif defined(__ppc__) DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv) -; -; void libunwind::Registers_ppc::jumpto() -; -; On entry: -; thread_state pointer is in r3 -; +// +// void libunwind::Registers_ppc::jumpto() +// +// On entry: +// thread_state pointer is in r3 +// - ; restore integral registerrs - ; skip r0 for now - ; skip r1 for now - lwz r2, 16(r3) - ; skip r3 for now - ; skip r4 for now - ; skip r5 for now - lwz r6, 32(r3) - lwz r7, 36(r3) - lwz r8, 40(r3) - lwz r9, 44(r3) - lwz r10, 48(r3) - lwz r11, 52(r3) - lwz r12, 56(r3) - lwz r13, 60(r3) - lwz r14, 64(r3) - lwz r15, 68(r3) - lwz r16, 72(r3) - lwz r17, 76(r3) - lwz r18, 80(r3) - lwz r19, 84(r3) - lwz r20, 88(r3) - lwz r21, 92(r3) - lwz r22, 96(r3) - lwz r23,100(r3) - lwz r24,104(r3) - lwz r25,108(r3) - lwz r26,112(r3) - lwz r27,116(r3) - lwz r28,120(r3) - lwz r29,124(r3) - lwz r30,128(r3) - lwz r31,132(r3) + // restore integral registerrs + // skip r0 for now + // skip r1 for now + lwz %r2, 16(%r3) + // skip r3 for now + // skip r4 for now + // skip r5 for now + lwz %r6, 32(%r3) + lwz %r7, 36(%r3) + lwz %r8, 40(%r3) + lwz %r9, 44(%r3) + lwz %r10, 48(%r3) + lwz %r11, 52(%r3) + lwz %r12, 56(%r3) + lwz %r13, 60(%r3) + lwz %r14, 64(%r3) + lwz %r15, 68(%r3) + lwz %r16, 72(%r3) + lwz %r17, 76(%r3) + lwz %r18, 80(%r3) + lwz %r19, 84(%r3) + lwz %r20, 88(%r3) + lwz %r21, 92(%r3) + lwz %r22, 96(%r3) + lwz %r23,100(%r3) + lwz %r24,104(%r3) + lwz %r25,108(%r3) + lwz %r26,112(%r3) + lwz %r27,116(%r3) + lwz %r28,120(%r3) + lwz %r29,124(%r3) + lwz %r30,128(%r3) + lwz %r31,132(%r3) - ; restore float registers - lfd f0, 160(r3) - lfd f1, 168(r3) - lfd f2, 176(r3) - lfd f3, 184(r3) - lfd f4, 192(r3) - lfd f5, 200(r3) - lfd f6, 208(r3) - lfd f7, 216(r3) - lfd f8, 224(r3) - lfd f9, 232(r3) - lfd f10,240(r3) - lfd f11,248(r3) - lfd f12,256(r3) - lfd f13,264(r3) - lfd f14,272(r3) - lfd f15,280(r3) - lfd f16,288(r3) - lfd f17,296(r3) - lfd f18,304(r3) - lfd f19,312(r3) - lfd f20,320(r3) - lfd f21,328(r3) - lfd f22,336(r3) - lfd f23,344(r3) - lfd f24,352(r3) - lfd f25,360(r3) - lfd f26,368(r3) - lfd f27,376(r3) - lfd f28,384(r3) - lfd f29,392(r3) - lfd f30,400(r3) - lfd f31,408(r3) + // restore float registers + lfd %f0, 160(%r3) + lfd %f1, 168(%r3) + lfd %f2, 176(%r3) + lfd %f3, 184(%r3) + lfd %f4, 192(%r3) + lfd %f5, 200(%r3) + lfd %f6, 208(%r3) + lfd %f7, 216(%r3) + lfd %f8, 224(%r3) + lfd %f9, 232(%r3) + lfd %f10,240(%r3) + lfd %f11,248(%r3) + lfd %f12,256(%r3) + lfd %f13,264(%r3) + lfd %f14,272(%r3) + lfd %f15,280(%r3) + lfd %f16,288(%r3) + lfd %f17,296(%r3) + lfd %f18,304(%r3) + lfd %f19,312(%r3) + lfd %f20,320(%r3) + lfd %f21,328(%r3) + lfd %f22,336(%r3) + lfd %f23,344(%r3) + lfd %f24,352(%r3) + lfd %f25,360(%r3) + lfd %f26,368(%r3) + lfd %f27,376(%r3) + lfd %f28,384(%r3) + lfd %f29,392(%r3) + lfd %f30,400(%r3) + lfd %f31,408(%r3) - ; restore vector registers if any are in use - lwz r5,156(r3) ; test VRsave - cmpwi r5,0 - beq Lnovec + // restore vector registers if any are in use + lwz %r5, 156(%r3) // test VRsave + cmpwi %r5, 0 + beq Lnovec - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone - ; the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone + // the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + - #define LOAD_VECTOR_UNALIGNEDl(_index) \ - andis. r0,r5,(1<<(15-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ -Ldone ## _index: + andis. %r0, %r5, (1<<(15-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: #define LOAD_VECTOR_UNALIGNEDh(_index) \ - andi. r0,r5,(1<<(31-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ - Ldone ## _index: + andi. %r0, %r5, (1<<(31-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: LOAD_VECTOR_UNALIGNEDl(0) @@ -545,17 +545,17 @@ Ldone ## _index: LOAD_VECTOR_UNALIGNEDh(31) Lnovec: - lwz r0, 136(r3) ; __cr - mtocrf 255,r0 - lwz r0, 148(r3) ; __ctr - mtctr r0 - lwz r0, 0(r3) ; __ssr0 - mtctr r0 - lwz r0, 8(r3) ; do r0 now - lwz r5,28(r3) ; do r5 now - lwz r4,24(r3) ; do r4 now - lwz r1,12(r3) ; do sp now - lwz r3,20(r3) ; do r3 last + lwz %r0, 136(%r3) // __cr + mtcr %r0 + lwz %r0, 148(%r3) // __ctr + mtctr %r0 + lwz %r0, 0(%r3) // __ssr0 + mtctr %r0 + lwz %r0, 8(%r3) // do r0 now + lwz %r5, 28(%r3) // do r5 now + lwz %r4, 24(%r3) // do r4 now + lwz %r1, 12(%r3) // do sp now + lwz %r3, 20(%r3) // do r3 last bctr #elif defined(__arm64__) || defined(__aarch64__) Modified: head/contrib/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/libunwind/src/UnwindRegistersSave.S Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/libunwind/src/UnwindRegistersSave.S Wed Jun 12 21:10:37 2019 (r349004) @@ -557,144 +557,144 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #elif defined(__ppc__) -; -; extern int unw_getcontext(unw_context_t* thread_state) -; -; On entry: -; thread_state pointer is in r3 -; +// +// extern int unw_getcontext(unw_context_t* thread_state) +// +// On entry: +// thread_state pointer is in r3 +// DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) - stw r0, 8(r3) - mflr r0 - stw r0, 0(r3) ; store lr as ssr0 - stw r1, 12(r3) - stw r2, 16(r3) - stw r3, 20(r3) - stw r4, 24(r3) - stw r5, 28(r3) - stw r6, 32(r3) - stw r7, 36(r3) - stw r8, 40(r3) - stw r9, 44(r3) - stw r10, 48(r3) - stw r11, 52(r3) - stw r12, 56(r3) - stw r13, 60(r3) - stw r14, 64(r3) - stw r15, 68(r3) - stw r16, 72(r3) - stw r17, 76(r3) - stw r18, 80(r3) - stw r19, 84(r3) - stw r20, 88(r3) - stw r21, 92(r3) - stw r22, 96(r3) - stw r23,100(r3) - stw r24,104(r3) - stw r25,108(r3) - stw r26,112(r3) - stw r27,116(r3) - stw r28,120(r3) - stw r29,124(r3) - stw r30,128(r3) - stw r31,132(r3) + stw %r0, 8(%r3) + mflr %r0 + stw %r0, 0(%r3) // store lr as ssr0 + stw %r1, 12(%r3) + stw %r2, 16(%r3) + stw %r3, 20(%r3) + stw %r4, 24(%r3) + stw %r5, 28(%r3) + stw %r6, 32(%r3) + stw %r7, 36(%r3) + stw %r8, 40(%r3) + stw %r9, 44(%r3) + stw %r10, 48(%r3) + stw %r11, 52(%r3) + stw %r12, 56(%r3) + stw %r13, 60(%r3) + stw %r14, 64(%r3) + stw %r15, 68(%r3) + stw %r16, 72(%r3) + stw %r17, 76(%r3) + stw %r18, 80(%r3) + stw %r19, 84(%r3) + stw %r20, 88(%r3) + stw %r21, 92(%r3) + stw %r22, 96(%r3) + stw %r23,100(%r3) + stw %r24,104(%r3) + stw %r25,108(%r3) + stw %r26,112(%r3) + stw %r27,116(%r3) + stw %r28,120(%r3) + stw %r29,124(%r3) + stw %r30,128(%r3) + stw %r31,132(%r3) - ; save VRSave register - mfspr r0,256 - stw r0,156(r3) - ; save CR registers - mfcr r0 - stw r0,136(r3) - ; save CTR register - mfctr r0 - stw r0,148(r3) + // save VRSave register + mfspr %r0, 256 + stw %r0, 156(%r3) + // save CR registers + mfcr %r0 + stw %r0, 136(%r3) + // save CTR register + mfctr %r0 + stw %r0, 148(%r3) - ; save float registers - stfd f0, 160(r3) - stfd f1, 168(r3) - stfd f2, 176(r3) - stfd f3, 184(r3) - stfd f4, 192(r3) - stfd f5, 200(r3) - stfd f6, 208(r3) - stfd f7, 216(r3) - stfd f8, 224(r3) - stfd f9, 232(r3) - stfd f10,240(r3) - stfd f11,248(r3) - stfd f12,256(r3) - stfd f13,264(r3) - stfd f14,272(r3) - stfd f15,280(r3) - stfd f16,288(r3) - stfd f17,296(r3) - stfd f18,304(r3) - stfd f19,312(r3) - stfd f20,320(r3) - stfd f21,328(r3) - stfd f22,336(r3) - stfd f23,344(r3) - stfd f24,352(r3) - stfd f25,360(r3) - stfd f26,368(r3) - stfd f27,376(r3) - stfd f28,384(r3) - stfd f29,392(r3) - stfd f30,400(r3) - stfd f31,408(r3) + // save float registers + stfd %f0, 160(%r3) + stfd %f1, 168(%r3) + stfd %f2, 176(%r3) + stfd %f3, 184(%r3) + stfd %f4, 192(%r3) + stfd %f5, 200(%r3) + stfd %f6, 208(%r3) + stfd %f7, 216(%r3) + stfd %f8, 224(%r3) + stfd %f9, 232(%r3) + stfd %f10,240(%r3) + stfd %f11,248(%r3) + stfd %f12,256(%r3) + stfd %f13,264(%r3) + stfd %f14,272(%r3) + stfd %f15,280(%r3) + stfd %f16,288(%r3) + stfd %f17,296(%r3) + stfd %f18,304(%r3) + stfd %f19,312(%r3) + stfd %f20,320(%r3) + stfd %f21,328(%r3) + stfd %f22,336(%r3) + stfd %f23,344(%r3) + stfd %f24,352(%r3) + stfd %f25,360(%r3) + stfd %f26,368(%r3) + stfd %f27,376(%r3) + stfd %f28,384(%r3) + stfd %f29,392(%r3) + stfd %f30,400(%r3) + stfd %f31,408(%r3) - ; save vector registers + // save vector registers - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone #define SAVE_VECTOR_UNALIGNED(_vec, _offset) \ - stvx _vec,0,r4 @\ - lwz r5, 0(r4) @\ - stw r5, _offset(r3) @\ - lwz r5, 4(r4) @\ - stw r5, _offset+4(r3) @\ - lwz r5, 8(r4) @\ - stw r5, _offset+8(r3) @\ - lwz r5, 12(r4) @\ - stw r5, _offset+12(r3) + stvx _vec, 0, %r4 SEPARATOR \ + lwz %r5, 0(%r4) SEPARATOR \ + stw %r5, _offset(%r3) SEPARATOR \ + lwz %r5, 4(%r4) SEPARATOR \ + stw %r5, _offset+4(%r3) SEPARATOR \ + lwz %r5, 8(%r4) SEPARATOR \ + stw %r5, _offset+8(%r3) SEPARATOR \ + lwz %r5, 12(%r4) SEPARATOR \ + stw %r5, _offset+12(%r3) - SAVE_VECTOR_UNALIGNED( v0, 424+0x000) - SAVE_VECTOR_UNALIGNED( v1, 424+0x010) - SAVE_VECTOR_UNALIGNED( v2, 424+0x020) - SAVE_VECTOR_UNALIGNED( v3, 424+0x030) - SAVE_VECTOR_UNALIGNED( v4, 424+0x040) - SAVE_VECTOR_UNALIGNED( v5, 424+0x050) - SAVE_VECTOR_UNALIGNED( v6, 424+0x060) - SAVE_VECTOR_UNALIGNED( v7, 424+0x070) - SAVE_VECTOR_UNALIGNED( v8, 424+0x080) - SAVE_VECTOR_UNALIGNED( v9, 424+0x090) - SAVE_VECTOR_UNALIGNED(v10, 424+0x0A0) - SAVE_VECTOR_UNALIGNED(v11, 424+0x0B0) - SAVE_VECTOR_UNALIGNED(v12, 424+0x0C0) - SAVE_VECTOR_UNALIGNED(v13, 424+0x0D0) - SAVE_VECTOR_UNALIGNED(v14, 424+0x0E0) - SAVE_VECTOR_UNALIGNED(v15, 424+0x0F0) - SAVE_VECTOR_UNALIGNED(v16, 424+0x100) - SAVE_VECTOR_UNALIGNED(v17, 424+0x110) - SAVE_VECTOR_UNALIGNED(v18, 424+0x120) - SAVE_VECTOR_UNALIGNED(v19, 424+0x130) - SAVE_VECTOR_UNALIGNED(v20, 424+0x140) - SAVE_VECTOR_UNALIGNED(v21, 424+0x150) - SAVE_VECTOR_UNALIGNED(v22, 424+0x160) - SAVE_VECTOR_UNALIGNED(v23, 424+0x170) - SAVE_VECTOR_UNALIGNED(v24, 424+0x180) - SAVE_VECTOR_UNALIGNED(v25, 424+0x190) - SAVE_VECTOR_UNALIGNED(v26, 424+0x1A0) - SAVE_VECTOR_UNALIGNED(v27, 424+0x1B0) - SAVE_VECTOR_UNALIGNED(v28, 424+0x1C0) - SAVE_VECTOR_UNALIGNED(v29, 424+0x1D0) - SAVE_VECTOR_UNALIGNED(v30, 424+0x1E0) - SAVE_VECTOR_UNALIGNED(v31, 424+0x1F0) + SAVE_VECTOR_UNALIGNED( %v0, 424+0x000) + SAVE_VECTOR_UNALIGNED( %v1, 424+0x010) + SAVE_VECTOR_UNALIGNED( %v2, 424+0x020) + SAVE_VECTOR_UNALIGNED( %v3, 424+0x030) + SAVE_VECTOR_UNALIGNED( %v4, 424+0x040) + SAVE_VECTOR_UNALIGNED( %v5, 424+0x050) + SAVE_VECTOR_UNALIGNED( %v6, 424+0x060) + SAVE_VECTOR_UNALIGNED( %v7, 424+0x070) + SAVE_VECTOR_UNALIGNED( %v8, 424+0x080) + SAVE_VECTOR_UNALIGNED( %v9, 424+0x090) + SAVE_VECTOR_UNALIGNED(%v10, 424+0x0A0) + SAVE_VECTOR_UNALIGNED(%v11, 424+0x0B0) + SAVE_VECTOR_UNALIGNED(%v12, 424+0x0C0) + SAVE_VECTOR_UNALIGNED(%v13, 424+0x0D0) + SAVE_VECTOR_UNALIGNED(%v14, 424+0x0E0) + SAVE_VECTOR_UNALIGNED(%v15, 424+0x0F0) + SAVE_VECTOR_UNALIGNED(%v16, 424+0x100) + SAVE_VECTOR_UNALIGNED(%v17, 424+0x110) + SAVE_VECTOR_UNALIGNED(%v18, 424+0x120) + SAVE_VECTOR_UNALIGNED(%v19, 424+0x130) + SAVE_VECTOR_UNALIGNED(%v20, 424+0x140) + SAVE_VECTOR_UNALIGNED(%v21, 424+0x150) + SAVE_VECTOR_UNALIGNED(%v22, 424+0x160) + SAVE_VECTOR_UNALIGNED(%v23, 424+0x170) + SAVE_VECTOR_UNALIGNED(%v24, 424+0x180) + SAVE_VECTOR_UNALIGNED(%v25, 424+0x190) + SAVE_VECTOR_UNALIGNED(%v26, 424+0x1A0) + SAVE_VECTOR_UNALIGNED(%v27, 424+0x1B0) + SAVE_VECTOR_UNALIGNED(%v28, 424+0x1C0) + SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0) + SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0) + SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0) - li r3, 0 ; return UNW_ESUCCESS + li %r3, 0 // return UNW_ESUCCESS blr Modified: head/contrib/libunwind/src/assembly.h ============================================================================== --- head/contrib/libunwind/src/assembly.h Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/libunwind/src/assembly.h Wed Jun 12 21:10:37 2019 (r349004) @@ -29,8 +29,6 @@ #ifdef _ARCH_PWR8 #define PPC64_HAS_VMX #endif -#elif defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) -#define SEPARATOR @ #elif defined(__arm64__) #define SEPARATOR %% #else Modified: head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp ============================================================================== --- head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -301,7 +301,7 @@ void CIE::dump(raw_ostream &OS, const MCRegisterInfo * OS << format(" Data alignment factor: %d\n", (int32_t)DataAlignmentFactor); OS << format(" Return address column: %d\n", (int32_t)ReturnAddressRegister); if (Personality) - OS << format(" Personality Address: %08x\n", *Personality); + OS << format(" Personality Address: %016" PRIx64 "\n", *Personality); if (!AugmentationData.empty()) { OS << " Augmentation data: "; for (uint8_t Byte : AugmentationData) @@ -320,7 +320,7 @@ void FDE::dump(raw_ostream &OS, const MCRegisterInfo * (uint32_t)InitialLocation, (uint32_t)InitialLocation + (uint32_t)AddressRange); if (LSDAAddress) - OS << format(" LSDA Address: %08x\n", *LSDAAddress); + OS << format(" LSDA Address: %016" PRIx64 "\n", *LSDAAddress); CFIs.dump(OS, MRI, IsEH); OS << "\n"; } Modified: head/contrib/llvm/lib/MC/ELFObjectWriter.cpp ============================================================================== --- head/contrib/llvm/lib/MC/ELFObjectWriter.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/MC/ELFObjectWriter.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -1271,6 +1271,7 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssem // This is the first place we are able to copy this information. Alias->setExternal(Symbol.isExternal()); Alias->setBinding(Symbol.getBinding()); + Alias->setOther(Symbol.getOther()); if (!Symbol.isUndefined() && !Rest.startswith("@@@")) continue; Modified: head/contrib/llvm/lib/MC/MCWin64EH.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCWin64EH.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/MC/MCWin64EH.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -522,7 +522,7 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, if (MatchingEpilog) { assert(EpilogInfo.find(MatchingEpilog) != EpilogInfo.end() && "Duplicate epilog not found"); - EpilogInfo[EpilogStart] = EpilogInfo[MatchingEpilog]; + EpilogInfo[EpilogStart] = EpilogInfo.lookup(MatchingEpilog); // Clear the unwind codes in the EpilogMap, so that they don't get output // in the logic below. EpilogInstrs.clear(); Modified: head/contrib/llvm/lib/MC/WasmObjectWriter.cpp ============================================================================== --- head/contrib/llvm/lib/MC/WasmObjectWriter.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/MC/WasmObjectWriter.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -368,7 +368,13 @@ void WasmObjectWriter::startCustomSection(SectionBookk // Now that the section is complete and we know how big it is, patch up the // section size field at the start of the section. void WasmObjectWriter::endSection(SectionBookkeeping &Section) { - uint64_t Size = W.OS.tell() - Section.PayloadOffset; + uint64_t Size = W.OS.tell(); + // /dev/null doesn't support seek/tell and can report offset of 0. + // Simply skip this patching in that case. + if (!Size) + return; + + Size -= Section.PayloadOffset; if (uint32_t(Size) != Size) report_fatal_error("section size does not fit in a uint32_t"); Modified: head/contrib/llvm/lib/Object/COFFImportFile.cpp ============================================================================== --- head/contrib/llvm/lib/Object/COFFImportFile.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/Object/COFFImportFile.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -496,7 +496,7 @@ NewArchiveMember ObjectFactory::createWeakExternal(Str // COFF Header coff_file_header Header{ - u16(0), + u16(Machine), u16(NumberOfSections), u32(0), u32(sizeof(Header) + (NumberOfSections * sizeof(coff_section))), Modified: head/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Wed Jun 12 21:10:37 2019 (r349004) @@ -239,7 +239,6 @@ def M4WriteNEONK : SchedWriteRes<[M4UnitNSHF, M4UnitS0]> { let Latency = 5; let NumMicroOps = 2; } def M4WriteNEONL : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } -def M4WriteNEONM : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } def M4WriteNEONN : SchedWriteRes<[M4UnitNMSC, M4UnitNMSC]> { let Latency = 5; let NumMicroOps = 2; } @@ -480,8 +479,6 @@ def M4WriteCOPY : SchedWriteVariant<[SchedVar]>; def M4WriteMOVI : SchedWriteVariant<[SchedVar, SchedVar]>; -def M4WriteMULL : SchedWriteVariant<[SchedVar, - SchedVar]>; // Fast forwarding. def M4ReadAESM1 : SchedReadAdvance<+1, [M4WriteNCRY1]>; @@ -489,8 +486,9 @@ def M4ReadFMACM1 : SchedReadAdvance<+1, [M4WriteFMAC M4WriteFMAC4H, M4WriteFMAC5]>; def M4ReadNMULM1 : SchedReadAdvance<+1, [M4WriteNMUL3]>; -def M4ReadMULLP2 : SchedReadAdvance<-2, [M4WriteNEONM]>; +def M4ReadNMULP2 : SchedReadAdvance<-2, [M4WriteNMUL3]>; + //===----------------------------------------------------------------------===// // Coarse scheduling model. @@ -662,10 +660,8 @@ def : InstRW<[M4WriteNEONK], (instregex "^FMOVDXHighr def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev1f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev1i(32|64)")>; def : InstRW<[M4WriteNMSC1], (instregex "^FRECPXv1")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)S16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)S(32|64)")>; // FP load instructions. def : InstRW<[WriteVLD], (instregex "^LDR[SDQ]l")>; @@ -736,14 +732,20 @@ def : InstRW<[M4WriteNALU1], (instregex "^(AND|BIC|EO def : InstRW<[M4WriteNMSC1], (instregex "^[SU](MIN|MAX)v")>; def : InstRW<[M4WriteNMSC2], (instregex "^[SU](MIN|MAX)Pv")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU](MIN|MAX)Vv")>; -def : InstRW<[M4WriteNMUL3], (instregex "^(SQR?D)?MULH?v")>; def : InstRW<[M4WriteNMUL3, M4ReadNMULM1], (instregex "^ML[AS]v")>; -def : InstRW<[M4WriteNMUL3], (instregex "^SQRDML[AS]H")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)ML[AS]Lv")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)MULLv")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(SQR?D)?MULH?v")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^SQRDML[AS]H")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)ML[AS]L(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)ML[AS]L(v4i32|v8i16|v16i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)MULL(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)MULL(v4i32|v8i16|v16i8)")>; def : InstRW<[M4WriteNMUL3], (instregex "^[SU]DOT(lane)?v")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU]ADALPv")>; def : InstRW<[M4WriteNSHT4A], (instregex "^[SU]R?SRA[dv]")>; @@ -808,10 +810,8 @@ def : InstRW<[M4WriteNALU1], (instregex "^FMOVv.f(32| def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev[248]f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev[248]f(32|64)")>; def : InstRW<[M4WriteFCVT3], (instregex "^U(RECP|RSQRT)Ev[24]i32")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)Sv.f16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; def : InstRW<[M4WriteNSHF1], (instregex "^REV(16|32|64)v")>; def : InstRW<[M4WriteNSHFA], (instregex "^TB[LX]v(8|16)i8One")>; def : InstRW<[M4WriteNSHFB], (instregex "^TB[LX]v(8|16)i8Two")>; Modified: head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Wed Jun 12 21:10:37 2019 (r349004) @@ -103,17 +103,6 @@ def ExynosScaledIdxPred : MCSchedPredicate>; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def ExynosLongVectorUpperFn : TIIPredicate< - "isExynosLongVectorUpper", - MCOpcodeSwitchStatement< - [MCOpcodeSwitchCase< - IsLongVectorUpperOp.ValidOpcodes, - MCReturnStatement>], - MCReturnStatement>>; -def ExynosLongVectorUpperPred : MCSchedPredicate; - // Identify 128-bit NEON instructions. def ExynosQFormPred : MCSchedPredicate; Modified: head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Wed Jun 12 21:10:37 2019 (r349004) @@ -268,59 +268,6 @@ def IsStoreRegOffsetOp : CheckOpcode<[STRBBroW, ST def IsLoadStoreRegOffsetOp : CheckOpcode; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def IsLongVectorUpperOp : CheckOpcode<[FCVTLv8i16, FCVTLv4i32, - FCVTNv8i16, FCVTNv4i32, - FCVTXNv4f32, - PMULLv16i8, PMULLv2i64, - RADDHNv8i16_v16i8, RADDHNv4i32_v8i16, RADDHNv2i64_v4i32, - RSHRNv16i8_shift, RSHRNv8i16_shift, RSHRNv4i32_shift, - RSUBHNv8i16_v16i8, RSUBHNv4i32_v8i16, RSUBHNv2i64_v4i32, - SABALv16i8_v8i16, SABALv8i16_v4i32, SABALv4i32_v2i64, - SABDLv16i8_v8i16, SABDLv8i16_v4i32, SABDLv4i32_v2i64, - SADDLv16i8_v8i16, SADDLv8i16_v4i32, SADDLv4i32_v2i64, - SADDWv16i8_v8i16, SADDWv8i16_v4i32, SADDWv4i32_v2i64, - SHLLv16i8, SHLLv8i16, SHLLv4i32, - SHRNv16i8_shift, SHRNv8i16_shift, SHRNv4i32_shift, - SMLALv16i8_v8i16, SMLALv8i16_v4i32, SMLALv4i32_v2i64, - SMLALv8i16_indexed, SMLALv4i32_indexed, - SMLSLv16i8_v8i16, SMLSLv8i16_v4i32, SMLSLv4i32_v2i64, - SMLSLv8i16_indexed, SMLSLv4i32_indexed, - SMULLv16i8_v8i16, SMULLv8i16_v4i32, SMULLv4i32_v2i64, - SMULLv8i16_indexed, SMULLv4i32_indexed, - SQDMLALv8i16_v4i32, SQDMLALv4i32_v2i64, - SQDMLALv8i16_indexed, SQDMLALv4i32_indexed, - SQDMLSLv8i16_v4i32, SQDMLSLv4i32_v2i64, - SQDMLSLv8i16_indexed, SQDMLSLv4i32_indexed, - SQDMULLv8i16_v4i32, SQDMULLv4i32_v2i64, - SQDMULLv8i16_indexed, SQDMULLv4i32_indexed, - SQRSHRNv16i8_shift, SQRSHRNv8i16_shift, SQRSHRNv4i32_shift, - SQRSHRUNv16i8_shift, SQRSHRUNv8i16_shift, SQRSHRUNv4i32_shift, - SQSHRNv16i8_shift, SQSHRNv8i16_shift, SQSHRNv4i32_shift, - SQSHRUNv16i8_shift, SQSHRUNv8i16_shift, SQSHRUNv4i32_shift, - SQXTNv16i8, SQXTNv8i16, SQXTNv4i32, - SQXTUNv16i8, SQXTUNv8i16, SQXTUNv4i32, - SSHLLv16i8_shift, SSHLLv8i16_shift, SSHLLv4i32_shift, - SSUBLv16i8_v8i16, SSUBLv8i16_v4i32, SSUBLv4i32_v2i64, - SSUBWv16i8_v8i16, SSUBWv8i16_v4i32, SSUBWv4i32_v2i64, - UABALv16i8_v8i16, UABALv8i16_v4i32, UABALv4i32_v2i64, - UABDLv16i8_v8i16, UABDLv8i16_v4i32, UABDLv4i32_v2i64, - UADDLv16i8_v8i16, UADDLv8i16_v4i32, UADDLv4i32_v2i64, - UADDWv16i8_v8i16, UADDWv8i16_v4i32, UADDWv4i32_v2i64, - UMLALv16i8_v8i16, UMLALv8i16_v4i32, UMLALv4i32_v2i64, - UMLALv8i16_indexed, UMLALv4i32_indexed, - UMLSLv16i8_v8i16, UMLSLv8i16_v4i32, UMLSLv4i32_v2i64, - UMLSLv8i16_indexed, UMLSLv4i32_indexed, - UMULLv16i8_v8i16, UMULLv8i16_v4i32, UMULLv4i32_v2i64, - UMULLv8i16_indexed, UMULLv4i32_indexed, - UQSHRNv16i8_shift, UQSHRNv8i16_shift, UQSHRNv4i32_shift, - UQXTNv16i8, UQXTNv8i16, UQXTNv4i32, - USHLLv16i8_shift, USHLLv8i16_shift, USHLLv4i32_shift, - USUBLv16i8_v8i16, USUBLv8i16_v4i32, USUBLv4i32_v2i64, - USUBWv16i8_v8i16, USUBWv8i16_v4i32, USUBWv4i32_v2i64, - XTNv16i8, XTNv8i16, XTNv4i32]>; - // Target predicates. // Identify an instruction that effectively transfers a register to another. Modified: head/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp Wed Jun 12 20:38:49 2019 (r349003) +++ head/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp Wed Jun 12 21:10:37 2019 (r349004) @@ -201,49 +201,55 @@ static bool updateOperand(FoldCandidate &Fold, Mod.setImm(Mod.getImm() & ~SISrcMods::OP_SEL_1); } } + } - if (Fold.needsShrink()) { - MachineBasicBlock *MBB = MI->getParent(); - auto Liveness = MBB->computeRegisterLiveness(&TRI, AMDGPU::VCC, MI); - if (Liveness != MachineBasicBlock::LQR_Dead) - return false; + if ((Fold.isImm() || Fold.isFI()) && Fold.needsShrink()) { + MachineBasicBlock *MBB = MI->getParent(); + auto Liveness = MBB->computeRegisterLiveness(&TRI, AMDGPU::VCC, MI); + if (Liveness != MachineBasicBlock::LQR_Dead) + return false; - MachineRegisterInfo &MRI = MBB->getParent()->getRegInfo(); - int Op32 = Fold.getShrinkOpcode(); - MachineOperand &Dst0 = MI->getOperand(0); - MachineOperand &Dst1 = MI->getOperand(1); - assert(Dst0.isDef() && Dst1.isDef()); + MachineRegisterInfo &MRI = MBB->getParent()->getRegInfo(); + int Op32 = Fold.getShrinkOpcode(); + MachineOperand &Dst0 = MI->getOperand(0); + MachineOperand &Dst1 = MI->getOperand(1); + assert(Dst0.isDef() && Dst1.isDef()); - bool HaveNonDbgCarryUse = !MRI.use_nodbg_empty(Dst1.getReg()); + bool HaveNonDbgCarryUse = !MRI.use_nodbg_empty(Dst1.getReg()); - const TargetRegisterClass *Dst0RC = MRI.getRegClass(Dst0.getReg()); - unsigned NewReg0 = MRI.createVirtualRegister(Dst0RC); - const TargetRegisterClass *Dst1RC = MRI.getRegClass(Dst1.getReg()); - unsigned NewReg1 = MRI.createVirtualRegister(Dst1RC); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jun 12 22:49:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B0DD15C3E71; Wed, 12 Jun 2019 22:49:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 36D7190447; Wed, 12 Jun 2019 22:49:09 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x5CMgt5O009440 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 12 Jun 2019 15:42:55 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x5CMgtrB009439; Wed, 12 Jun 2019 15:42:55 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 12 Jun 2019 15:42:55 -0700 From: Gleb Smirnoff To: =?utf-8?Q?T=C4=B3l?= Coosemans Cc: Dmitry Chagin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <20190612224255.GA67242@FreeBSD.org> References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 36D7190447 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.92)[-0.924,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 22:49:11 -0000 On Mon, Jun 10, 2019 at 11:09:09AM +0200, Tijl Coosemans wrote: T> > Date: Mon Jun 10 05:28:03 2019 T> > New Revision: 348847 T> > URL: https://svnweb.freebsd.org/changeset/base/348847 T> > T> > Log: T> > Use C11 anonymous unions. T> > T> > PR: 215202 T> > Reported by: glebius T> > MFC after: 2 weeks T> > T> > Modified: T> > head/sys/sys/ucred.h T> > T> > Modified: head/sys/sys/ucred.h T> > ============================================================================== T> > --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) T> > +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) T> > @@ -89,12 +89,11 @@ struct xucred { T> > gid_t cr_groups[XU_NGROUPS]; /* groups */ T> > union { T> > void *_cr_unused1; /* compatibility with old ucred */ T> > - pid_t _pid; T> > - } _cr; T> > + pid_t cr_pid; T> > + }; T> > }; T> > #define XUCRED_VERSION 0 T> > T> > -#define cr_pid _cr._pid T> > /* This can be used for both ucred and xucred structures. */ T> > #define cr_gid cr_groups[0] T> T> Isn't this a userland header that should work with non-C11 compilers? It could make sense to keep such low bar for standard headers, but ucred.h is BSD-specific header and struct xucred is FreeBSD specific. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jun 12 22:51:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7951D15C40A9 for ; Wed, 12 Jun 2019 22:51:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11630906DB for ; Wed, 12 Jun 2019 22:51:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id s15so20362229qtk.9 for ; Wed, 12 Jun 2019 15:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ns7coK6JkAwcU5C7oi+MY95bnPZICmtLkTU9ajcbyoo=; b=RxYzrPztegrv2mRWzIV02LENptVHdOcfGYxDbm26r/GlbcoQjllqAEOomujpU/IjV7 QYjn9zcAmV3yuUcLSZvpRgp11Somep1T0X2EC8kEOzywFRjnMtxuxrVtfy+7Bw6Oy3K4 53q8oFVLEukkfqmJoW1iJcwB15dsMUu5VK+VBXRbt22dQGmzxJyIqEQROQMMQ5zNFbBS hm3HVFTezE+8wQaNqs8hMbEVUctf62BdctNZNDWOswvZqeV9rcIXb3FJThyVagenncs1 75YypzKUtBqrvBfg7Eb3Ptl9E4ScghvjfpzX+3LEUiKi9fhhqRbOHTRPx22qOnnjIJOb 7osw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ns7coK6JkAwcU5C7oi+MY95bnPZICmtLkTU9ajcbyoo=; b=j7Dsd/OuIzVug9+Aj6X285R5bm/SUBYQhBtUbpWE+0dr4Typ3gRHFJoMIRaIypToHG iIY489cthsE5cTR7/gHeznKeePnY3rjbdIJiNjMCHxtquD5AdBAHuPpKRExiMVd3fk2p oo9jih2yVNWWxeVoaWxRsEkJlT+w+B4mcow8VS5eXzMjtSq/BYHPIm3Y9/XNJVhEglM9 6oG9dl8n060rTf2S1PRggTkvwNn5MReS3vQLqlOeGeCBEMM1dX/sg197PM96RFfxMl4Y csWwf+heBDpLRODcgnPIv4PpajzA+F3g7VONQX/4/x/blSyvrTQ2n3ki6kI34OTU91OR T3zg== X-Gm-Message-State: APjAAAVBtbhIup43lx6Zm9PUYySpuwGAO8272CPKhhnoxh6400/a4sce ThRO7lV270eMcDYxFbbaPziK8+r03CVSfxm9WfAT7w== X-Google-Smtp-Source: APXvYqyInDhnGD7plV2w2zZKzq9aY3As+r+ZzN7trQI4xsUwReyRSQHcnh1EGDYYEfqKAS+8a5xejh7YTQOajidCiW8= X-Received: by 2002:a0c:9230:: with SMTP id a45mr795455qva.188.1560379874921; Wed, 12 Jun 2019 15:51:14 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190612224255.GA67242@FreeBSD.org> In-Reply-To: <20190612224255.GA67242@FreeBSD.org> From: Warner Losh Date: Wed, 12 Jun 2019 16:51:03 -0600 Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: Gleb Smirnoff Cc: =?UTF-8?Q?T=C4=B3l_Coosemans?= , Dmitry Chagin , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 11630906DB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 22:51:16 -0000 On Wed, Jun 12, 2019 at 4:49 PM Gleb Smirnoff wrote: > On Mon, Jun 10, 2019 at 11:09:09AM +0200, T=C4=B3l Coosemans wrote: > T> > Date: Mon Jun 10 05:28:03 2019 > T> > New Revision: 348847 > T> > URL: https://svnweb.freebsd.org/changeset/base/348847 > T> > > T> > Log: > T> > Use C11 anonymous unions. > T> > > T> > PR: 215202 > T> > Reported by: glebius > T> > MFC after: 2 weeks > T> > > T> > Modified: > T> > head/sys/sys/ucred.h > T> > > T> > Modified: head/sys/sys/ucred.h > T> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > T> > --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) > T> > +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) > T> > @@ -89,12 +89,11 @@ struct xucred { > T> > gid_t cr_groups[XU_NGROUPS]; /* groups */ > T> > union { > T> > void *_cr_unused1; /* compatibility with old ucred *= / > T> > - pid_t _pid; > T> > - } _cr; > T> > + pid_t cr_pid; > T> > + }; > T> > }; > T> > #define XUCRED_VERSION 0 > T> > > T> > -#define cr_pid _cr._pid > T> > /* This can be used for both ucred and xucred structures. */ > T> > #define cr_gid cr_groups[0] > T> > T> Isn't this a userland header that should work with non-C11 compilers? > > It could make sense to keep such low bar for standard headers, but ucred.= h > is BSD-specific header and struct xucred is FreeBSD specific. > This is solvable with proper visibility, I'd think.. Warner From owner-svn-src-head@freebsd.org Wed Jun 12 23:09:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C613515C464D; Wed, 12 Jun 2019 23:09:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5223D90E48; Wed, 12 Jun 2019 23:09:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B351FC3D; Wed, 12 Jun 2019 23:09:11 +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 x5CN9Bgs043060; Wed, 12 Jun 2019 23:09:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5CN9BIq043059; Wed, 12 Jun 2019 23:09:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906122309.x5CN9BIq043059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 12 Jun 2019 23:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349005 - head/sys/modules/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/modules/ocs_fc X-SVN-Commit-Revision: 349005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5223D90E48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 12 Jun 2019 23:09:12 -0000 Author: bdrewery Date: Wed Jun 12 23:09:10 2019 New Revision: 349005 URL: https://svnweb.freebsd.org/changeset/base/349005 Log: Don't delete .depend files outside of cleandepend. Sponsored by: DellEMC Modified: head/sys/modules/ocs_fc/Makefile Modified: head/sys/modules/ocs_fc/Makefile ============================================================================== --- head/sys/modules/ocs_fc/Makefile Wed Jun 12 21:10:37 2019 (r349004) +++ head/sys/modules/ocs_fc/Makefile Wed Jun 12 23:09:10 2019 (r349005) @@ -41,6 +41,6 @@ SRCS += ocs_cam.c CINCS = -I. -CLEANFILES += ${PROG}.debug ${PROG}.symbols cscope.* .depend.* +CLEANFILES += ${PROG}.debug ${PROG}.symbols cscope.* .include From owner-svn-src-head@freebsd.org Thu Jun 13 01:21:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B574E15C7091; Thu, 13 Jun 2019 01:21:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57F18943EE; Thu, 13 Jun 2019 01:21:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29BE321373; Thu, 13 Jun 2019 01:21:33 +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 x5D1LXRo011501; Thu, 13 Jun 2019 01:21:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D1LXLB011500; Thu, 13 Jun 2019 01:21:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906130121.x5D1LXLB011500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 13 Jun 2019 01:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349006 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 349006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57F18943EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 01:21:34 -0000 Author: mav Date: Thu Jun 13 01:21:32 2019 New Revision: 349006 URL: https://svnweb.freebsd.org/changeset/base/349006 Log: Move write aggregation memory copy out of vq_lock. Memory copy is too heavy operation to do under the congested lock. Moving it out reduces congestion by many times to almost invisible. Since the original zio removed from the queue, and the child zio is not executed yet, I don't see why would the copy need protection. My guess it just remained like this from the time when lock was not dropped here, which was added later to fix lock ordering issue. Multi-threaded sequential write tests with both HDD and SSD pools with ZVOL block sizes of 4KB, 16KB, 64KB and 128KB all show major reduction of lock congestion, saving from 15% to 35% of CPU time and increasing throughput from 10% to 40%. Reviewed by: ahrens, behlendorf, ryao MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Jun 12 23:09:10 2019 (r349005) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Thu Jun 13 01:21:32 2019 (r349006) @@ -815,6 +815,18 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio) do { dio = nio; nio = AVL_NEXT(t, dio); + zio_add_child(dio, aio); + vdev_queue_io_remove(vq, dio); + } while (dio != last); + + /* + * We need to drop the vdev queue's lock during zio_execute() to + * avoid a deadlock that we could encounter due to lock order + * reversal between vq_lock and io_lock in zio_change_priority(). + * Use the dropped lock to do memory copy without congestion. + */ + mutex_exit(&vq->vq_lock); + while ((dio = zio_walk_parents(aio, &zl)) != NULL) { ASSERT3U(dio->io_type, ==, aio->io_type); if (dio->io_flags & ZIO_FLAG_NODATA) { @@ -826,16 +838,6 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio) dio->io_offset - aio->io_offset, 0, dio->io_size); } - zio_add_child(dio, aio); - vdev_queue_io_remove(vq, dio); - } while (dio != last); - - /* - * We need to drop the vdev queue's lock to avoid a deadlock that we - * could encounter since this I/O will complete immediately. - */ - mutex_exit(&vq->vq_lock); - while ((dio = zio_walk_parents(aio, &zl)) != NULL) { zio_vdev_io_bypass(dio); zio_execute(dio); } From owner-svn-src-head@freebsd.org Thu Jun 13 03:48:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E6D15CA517; Thu, 13 Jun 2019 03:48:37 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A07AF68375; Thu, 13 Jun 2019 03:48:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A0AF22C01; Thu, 13 Jun 2019 03:48:36 +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 x5D3maPR089163; Thu, 13 Jun 2019 03:48:36 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D3malC089162; Thu, 13 Jun 2019 03:48:36 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906130348.x5D3malC089162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 13 Jun 2019 03:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349008 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 349008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A07AF68375 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 03:48:37 -0000 Author: lwhsu Date: Thu Jun 13 03:48:36 2019 New Revision: 349008 URL: https://svnweb.freebsd.org/changeset/base/349008 Log: Fix gcc build by removing redeclaration Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20622 Modified: head/stand/efi/boot1/boot_module.h Modified: head/stand/efi/boot1/boot_module.h ============================================================================== --- head/stand/efi/boot1/boot_module.h Thu Jun 13 01:23:03 2019 (r349007) +++ head/stand/efi/boot1/boot_module.h Thu Jun 13 03:48:36 2019 (r349008) @@ -109,5 +109,4 @@ extern const boot_module_t zfs_module; /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); -extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); #endif From owner-svn-src-head@freebsd.org Thu Jun 13 05:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F95415CBCB2; Thu, 13 Jun 2019 05:05:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35E466BCB7; Thu, 13 Jun 2019 05:05:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F64F23989; Thu, 13 Jun 2019 05:05:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5D55wLm030532; Thu, 13 Jun 2019 05:05:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D55w6W030531; Thu, 13 Jun 2019 05:05:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906130505.x5D55w6W030531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 13 Jun 2019 05:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349009 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 349009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35E466BCB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 05:05:59 -0000 Author: asomers Date: Thu Jun 13 05:05:58 2019 New Revision: 349009 URL: https://svnweb.freebsd.org/changeset/base/349009 Log: Add test cases for epair Implements the missing test cases for epair in a similar fashion to the existing tests. Fixes shared abstractions to work with epair tests. Submitted by: Ryan Moeller Reviewed by: asomers MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20498 Modified: head/tests/sys/net/if_clone_test.sh Modified: head/tests/sys/net/if_clone_test.sh ============================================================================== --- head/tests/sys/net/if_clone_test.sh Thu Jun 13 03:48:36 2019 (r349008) +++ head/tests/sys/net/if_clone_test.sh Thu Jun 13 05:05:58 2019 (r349009) @@ -39,6 +39,52 @@ TESTLEN=10 # seconds +atf_test_case epair_stress cleanup +epair_stress_head() +{ + atf_set "descr" "Simultaneously create and destroy an epair(4)" + atf_set "require.user" "root" +} +epair_stress_body() +{ + do_stress "epair" +} +epair_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_up_stress cleanup +epair_up_stress_head() +{ + atf_set "descr" "Simultaneously up and detroy an epair(4)" + atf_set "require.user" "root" +} +epair_up_stress_body() +{ + do_up_stress "epair" "" "" +} +epair_up_stress_cleanup() +{ + cleanup_ifaces +} + +atf_test_case epair_ipv6_up_stress cleanup +epair_ipv6_up_stress_head() +{ + atf_set "descr" "Simultaneously up and destroy an epair(4) with IPv6" + atf_set "require.user" "root" +} +epair_ipv6_up_stress_body() +{ + atf_skip "Quickly panics: page fault in in6_unlink_ifa (PR 225438)" + do_up_stress "epair" "6" "" +} +epair_ipv6_up_stress_cleanup() +{ + cleanup_ifaces +} + atf_test_case faith_stress cleanup faith_stress_head() { @@ -369,7 +415,9 @@ vmnet_ipv6_up_stress_cleanup() atf_init_test_cases() { - # TODO: add epair(4) tests, which need a different syntax + atf_add_test_case epair_ipv6_up_stress + atf_add_test_case epair_stress + atf_add_test_case epair_up_stress atf_add_test_case faith_ipv6_up_stress atf_add_test_case faith_stress atf_add_test_case faith_up_stress @@ -396,13 +444,13 @@ atf_init_test_cases() do_stress() { - local IFACE + local IFACE CREATOR_PID DESTROYER_PID IFACE=`get_iface $1` # First thread: create the interface while true; do - ifconfig $IFACE create 2>/dev/null && \ + ifconfig ${IFACE%a} create 2>/dev/null && \ echo -n . >> creator_count.txt done & CREATOR_PID=$! @@ -417,7 +465,7 @@ do_stress() sleep ${TESTLEN} kill $CREATOR_PID kill $DESTROYER_PID - echo "Created $IFACE `stat -f %z creator_count.txt` times." + echo "Created ${IFACE%a} `stat -f %z creator_count.txt` times." echo "Destroyed it `stat -f %z destroyer_count.txt` times." } @@ -428,7 +476,8 @@ do_stress() # $3 p2p for point to point interfaces, anything else for normal interfaces do_up_stress() { - local IFACE IPv6 MAC P2P SRCDIR + local ADDR DSTADDR MASK MEAN_SLEEP_SECONDS MAX_SLEEP_USECS \ + IFACE IPV6 P2P SRCDIR LOOP_PID ipv6_cmd up_cmd # Configure the interface to use an RFC5737 nonrouteable addresses ADDR="192.0.2.2" @@ -464,7 +513,7 @@ do_up_stress() ifconfig $IFACE destroy && echo -n . >> destroy_count.txt ; } & wait - ifconfig $IFACE create + ifconfig ${IFACE%a} create done & LOOP_PID=$! @@ -489,7 +538,11 @@ get_iface() N=$(($N + 1)) fi done - local DEV=${CLASS}${N} + if [ ${CLASS} = "epair" ]; then + DEV=${CLASS}${N}a + else + DEV=${CLASS}${N} + fi # Record the device so we can clean it up later echo ${DEV} >> "devices_to_cleanup" echo ${DEV} @@ -501,11 +554,7 @@ cleanup_ifaces() local DEV for DEV in `cat "devices_to_cleanup"`; do - if [ ${DEV%%[0-9]*a} = "epair" ]; then - ifconfig ${DEV}a destroy - else - ifconfig ${DEV} destroy - fi + ifconfig ${DEV} destroy done true } From owner-svn-src-head@freebsd.org Thu Jun 13 05:19:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DFB15CC086; Thu, 13 Jun 2019 05:19:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7990C6C20D; Thu, 13 Jun 2019 05:19:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F35123B5C; Thu, 13 Jun 2019 05:19:37 +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 x5D5JbDd036192; Thu, 13 Jun 2019 05:19:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D5JbLa036191; Thu, 13 Jun 2019 05:19:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906130519.x5D5JbLa036191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 13 Jun 2019 05:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349010 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 349010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7990C6C20D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 05:19:38 -0000 Author: imp Date: Thu Jun 13 05:19:36 2019 New Revision: 349010 URL: https://svnweb.freebsd.org/changeset/base/349010 Log: Increase the timeout for READ NATIVE MAX READ NATIVE MAX can take longer than a second if the queued NCQ I/Os take longer than a second to drain. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jun 13 05:05:58 2019 (r349009) +++ head/sbin/camcontrol/camcontrol.c Thu Jun 13 05:19:36 2019 (r349010) @@ -2059,7 +2059,7 @@ ata_read_native_max(struct cam_device *device, int ret /*sector_count*/0, /*data_ptr*/NULL, /*dxfer_len*/0, - timeout ? timeout : 1000, + timeout ? timeout : 5000, is48bit); if (error) From owner-svn-src-head@freebsd.org Thu Jun 13 05:19:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F23015CC0C6; Thu, 13 Jun 2019 05:19:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D317C6C2A3; Thu, 13 Jun 2019 05:19:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4333823B5D; Thu, 13 Jun 2019 05:19: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 x5D5JhuU036246; Thu, 13 Jun 2019 05:19:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5D5Jhwv036245; Thu, 13 Jun 2019 05:19:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906130519.x5D5Jhwv036245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 13 Jun 2019 05:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349011 - head/sys/dev/ciss X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ciss X-SVN-Commit-Revision: 349011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D317C6C2A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 05:19:50 -0000 Author: imp Date: Thu Jun 13 05:19:42 2019 New Revision: 349011 URL: https://svnweb.freebsd.org/changeset/base/349011 Log: Don't print the request we may be aborting in ciss_notify_abort as part of ciss_detach. It's a left-over debug that isn't needed and also discloses a kernel address. Only root could provoke as part of a devctl or kldunload. Submitted by: Fuqian Huang MFC After: 1 week Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Jun 13 05:19:36 2019 (r349010) +++ head/sys/dev/ciss/ciss.c Thu Jun 13 05:19:42 2019 (r349011) @@ -107,6 +107,10 @@ #include #include +#ifdef CISS_DEBUG +#include "opt_ddb.h" +#endif + static MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", "ciss internal data buffers"); @@ -197,7 +201,9 @@ static void ciss_notify_logical(struct ciss_softc *sc, static void ciss_notify_physical(struct ciss_softc *sc, struct ciss_notify *cn); /* debugging output */ +#ifdef DDB static void ciss_print_request(struct ciss_request *cr); +#endif static void ciss_print_ldrive(struct ciss_softc *sc, struct ciss_ldrive *ld); static const char *ciss_name_ldrive_status(int status); static int ciss_decode_ldrive_status(int status); @@ -3811,8 +3817,9 @@ ciss_notify_abort(struct ciss_softc *sc) cnc->opcode = CISS_OPCODE_WRITE; cnc->command = CISS_COMMAND_ABORT_NOTIFY; cnc->length = htonl(CISS_NOTIFY_DATA_SIZE); - +#if 0 ciss_print_request(cr); +#endif /* * Submit the request and wait for it to complete. @@ -4237,6 +4244,7 @@ ciss_kill_notify_thread(struct ciss_softc *sc) /************************************************************************ * Print a request. */ +#ifdef DDB static void ciss_print_request(struct ciss_request *cr) { @@ -4290,6 +4298,7 @@ ciss_print_request(struct ciss_request *cr) } } } +#endif /************************************************************************ * Print information about the status of a logical drive. @@ -4353,8 +4362,6 @@ ciss_print_ldrive(struct ciss_softc *sc, struct ciss_l } } -#ifdef CISS_DEBUG -#include "opt_ddb.h" #ifdef DDB #include /************************************************************************ @@ -4408,7 +4415,6 @@ DB_COMMAND(ciss_prt, db_ciss_prt) ciss_print_adapter(sc); } } -#endif #endif /************************************************************************ From owner-svn-src-head@freebsd.org Thu Jun 13 05:42:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFEA015CC8D9 for ; Thu, 13 Jun 2019 05:42:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84B476CE62 for ; Thu, 13 Jun 2019 05:42:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x841.google.com with SMTP id d23so21213710qto.2 for ; Wed, 12 Jun 2019 22:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=emq+F9t67KCdzWzxxSI0OWN7+ojfpr9ZBDTB15TYib0=; b=AWfLqRnDKvWIQlHvMiqtdxDVO9NfvZGE/0IXlpymDW3B0v6PpWnYoIYpx7CpsWdTFC D814TkmSrJTb3x/r4YkYSmjaMJf/p0/owy6uqk9fFSDsCehNd9MIK81aTcGbXzQ4o6sz nezk0zuonvivJASMCbE125iBuatKpqYVLXwkCfwQpaegv1esRBOn7EhBXWPNuqg6yKhF 4FjlESz3WAEau4PrAVRQWsFjlVaP50e2b2JgvjSU7cSTr1w/RhpcyfQlKxG37MP19qUC k6EwEl2rbVdxw6on6K35XXfENhOxkboHvBy7771+QhUF3ES51AI20ynPzOxjdqIXJltE O9iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=emq+F9t67KCdzWzxxSI0OWN7+ojfpr9ZBDTB15TYib0=; b=KsZ4pc/ySk/jvyhZppjOEOTcBqBLl3CmQ+GmQdYqhekUxYcy3ItqR5Qphiry3A89OW swUd5W6WJxL7Kxduyg2/wXTbE8Rb9hwqs7q8fsfHb1nBtMiqHvwo5KTol96L8nepRXhE y04v1Caoeowk8lKEARjOCDwmq+BvLgncMxfxZAXzIzbSp4/yzjDmG5fAx5AMg8g5EekF cmXFxvVvin89SC9+30TphbKYEK1H5xMYLqSGeOpFbP0r9UWrtT8s8u+FpIE+P+s3kB6B ywlWcxEeKWCD3imTTgJg6eR7/of6m0zgndVOFJ+F8vUCl6STgMe+d3uv0jXYi/ZWZ7ot XZJQ== X-Gm-Message-State: APjAAAWx9S9Sq9Xw8tJdnODJn0pzjTIzVharXcqfWvc951PLr7lf5yjX 3mYDMebfoBOf+RWqLl2xbdua8pVW1qjq/kAMLJ/zbSb4X1Q= X-Google-Smtp-Source: APXvYqzuauJTTjbWwJJ9YgeNHMM64TAJL6HcdDV0PKzu8L3YnLBAVGGDuqcBP57nb9BpINvoPbPFOAa7xFr1Fl4H+eg= X-Received: by 2002:ac8:488f:: with SMTP id i15mr50335830qtq.32.1560404530919; Wed, 12 Jun 2019 22:42:10 -0700 (PDT) MIME-Version: 1.0 References: <201906130519.x5D5JbLa036191@repo.freebsd.org> In-Reply-To: <201906130519.x5D5JbLa036191@repo.freebsd.org> From: Warner Losh Date: Wed, 12 Jun 2019 23:41:59 -0600 Message-ID: Subject: Re: svn commit: r349010 - head/sbin/camcontrol To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 84B476CE62 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 05:42:12 -0000 On Wed, Jun 12, 2019, 11:19 PM Warner Losh wrote: > Author: imp > Date: Thu Jun 13 05:19:36 2019 > New Revision: 349010 > URL: https://svnweb.freebsd.org/changeset/base/349010 > > Log: > Increase the timeout for READ NATIVE MAX > > READ NATIVE MAX can take longer than a second if the queued NCQ I/Os > take longer than a second to drain. > I didn't mean to commit this with such a short commit message and was planning on getting it reviewed first. So this may change again. Warner Modified: > head/sbin/camcontrol/camcontrol.c > > Modified: head/sbin/camcontrol/camcontrol.c > > ============================================================================== > --- head/sbin/camcontrol/camcontrol.c Thu Jun 13 05:05:58 2019 > (r349009) > +++ head/sbin/camcontrol/camcontrol.c Thu Jun 13 05:19:36 2019 > (r349010) > @@ -2059,7 +2059,7 @@ ata_read_native_max(struct cam_device *device, int > ret > /*sector_count*/0, > /*data_ptr*/NULL, > /*dxfer_len*/0, > - timeout ? timeout : 1000, > + timeout ? timeout : 5000, > is48bit); > > if (error) > > From owner-svn-src-head@freebsd.org Thu Jun 13 08:43:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C28F15D06D6; Thu, 13 Jun 2019 08:43:20 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay118.isp.belgacom.be (mailrelay118.isp.belgacom.be [195.238.20.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB1417224A; Thu, 13 Jun 2019 08:43:19 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AzAACoCwJd/1H1sVtmGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBUQYBAQELAQGCD0cSEVIgEiiEFogcX4l4AQGCDDUBigiOI4F7CQE?= =?us-ascii?q?BAgEBAQEBKwwBAYRAAoJFJDQJDgEDAQEFAQEBAQRtHAxCAQwBhHsBBSMzIxA?= =?us-ascii?q?LDgYEAgIFIQICD0gGE4Mjgg4LqguBMYQyAQsBhGOBCgaBDCgBi3OBf4QjPoR?= =?us-ascii?q?EgwqCWASOA5tGCYIShkeMeCeXKYQLkCiRLTiBWE0wCIMnghsXiGGFQT0DMIQ?= =?us-ascii?q?PjDkBAQ?= X-IPAS-Result: =?us-ascii?q?A2AzAACoCwJd/1H1sVtmGwEBAQEDAQEBBwMBAQGBUQYBA?= =?us-ascii?q?QELAQGCD0cSEVIgEiiEFogcX4l4AQGCDDUBigiOI4F7CQEBAgEBAQEBKwwBA?= =?us-ascii?q?YRAAoJFJDQJDgEDAQEFAQEBAQRtHAxCAQwBhHsBBSMzIxALDgYEAgIFIQICD?= =?us-ascii?q?0gGE4Mjgg4LqguBMYQyAQsBhGOBCgaBDCgBi3OBf4QjPoREgwqCWASOA5tGC?= =?us-ascii?q?YIShkeMeCeXKYQLkCiRLTiBWE0wCIMnghsXiGGFQT0DMIQPjDkBAQ?= Received: from 81.245-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.245.81]) by relay.skynet.be with ESMTP; 13 Jun 2019 10:43:12 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id x5D8hBxm024159; Thu, 13 Jun 2019 10:43:11 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 13 Jun 2019 10:43:10 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Warner Losh Cc: Gleb Smirnoff , Dmitry Chagin , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <20190613104310.1b0f8f70@kalimero.tijl.coosemans.org> In-Reply-To: References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190612224255.GA67242@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: AB1417224A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 08:43:20 -0000 On Wed, 12 Jun 2019 16:51:03 -0600 Warner Losh wrote: > On Wed, Jun 12, 2019 at 4:49 PM Gleb Smirnoff wrote: >> On Mon, Jun 10, 2019 at 11:09:09AM +0200, T=C4=B3l Coosemans wrote: =20 >>>> Date: Mon Jun 10 05:28:03 2019 >>>> New Revision: 348847 >>>> URL: https://svnweb.freebsd.org/changeset/base/348847 >>>> >>>> Log: >>>> Use C11 anonymous unions. >>>> >>>> PR: 215202 >>>> Reported by: glebius >>>> MFC after: 2 weeks >>>> >>>> Modified: >>>> head/sys/sys/ucred.h >>>> >>>> Modified: head/sys/sys/ucred.h >>>> =20 >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =20 >>>> --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) >>>> +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) >>>> @@ -89,12 +89,11 @@ struct xucred { >>>> gid_t cr_groups[XU_NGROUPS]; /* groups */ >>>> union { >>>> void *_cr_unused1; /* compatibility with old ucred */ >>>> - pid_t _pid; >>>> - } _cr; >>>> + pid_t cr_pid; >>>> + }; >>>> }; >>>> #define XUCRED_VERSION 0 >>>> >>>> -#define cr_pid _cr._pid >>>> /* This can be used for both ucred and xucred structures. */ >>>> #define cr_gid cr_groups[0] =20 >>> >>> Isn't this a userland header that should work with non-C11 compilers? = =20 >> >> It could make sense to keep such low bar for standard headers, but ucred= .h >> is BSD-specific header and struct xucred is FreeBSD specific. >=20 > This is solvable with proper visibility, I'd think.. I think "union {" should be replaced with "__extension__ union {". That seems to kill this warning: /usr/include/sys/ucred.h:90:2: warning: anonymous unions are a C11 extension [-Wc11-extensions] union { ^ 1 warning generated. From owner-svn-src-head@freebsd.org Thu Jun 13 17:39:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76FD615B896B; Thu, 13 Jun 2019 17:39:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 069508EADC; Thu, 13 Jun 2019 17:39:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E1593B73; Thu, 13 Jun 2019 17:39:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5DHdYxn034133; Thu, 13 Jun 2019 17:39:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5DHdX93034129; Thu, 13 Jun 2019 17:39:33 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906131739.x5DHdX93034129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 13 Jun 2019 17:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349019 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 069508EADC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 17:39:35 -0000 Author: vmaffione Date: Thu Jun 13 17:39:32 2019 New Revision: 349019 URL: https://svnweb.freebsd.org/changeset/base/349019 Log: bhyve: move common code to net_utils.c Both virtio_net and e82545 network frontends have code to validate and generate MAC addresses. These functionalities are replicated in the two files, so we move them in a separate compilation unit. Reviewed by: rgrimes, bryanv, imp, kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20626 Added: head/usr.sbin/bhyve/net_utils.c (contents, props changed) head/usr.sbin/bhyve/net_utils.h (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Thu Jun 13 16:34:55 2019 (r349018) +++ head/usr.sbin/bhyve/Makefile Thu Jun 13 17:39:32 2019 (r349019) @@ -32,6 +32,7 @@ SRCS= \ mem.c \ mevent.c \ mptbl.c \ + net_utils.c \ pci_ahci.c \ pci_e82545.c \ pci_emul.c \ Added: head/usr.sbin/bhyve/net_utils.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/net_utils.c Thu Jun 13 17:39:32 2019 (r349019) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "net_utils.h" +#include "bhyverun.h" +#include +#include +#include +#include +#include + +int +net_parsemac(char *mac_str, uint8_t *mac_addr) +{ + struct ether_addr *ea; + char *tmpstr; + char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; + + tmpstr = strsep(&mac_str,"="); + + if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { + ea = ether_aton(mac_str); + + if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || + memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { + fprintf(stderr, "Invalid MAC %s\n", mac_str); + return (EINVAL); + } else + memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); + } + + return (0); +} + +void +net_genmac(struct pci_devinst *pi, uint8_t *macaddr) +{ + /* + * The default MAC address is the standard NetApp OUI of 00-a0-98, + * followed by an MD5 of the PCI slot/func number and dev name + */ + MD5_CTX mdctx; + unsigned char digest[16]; + char nstr[80]; + + snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, + pi->pi_func, vmname); + + MD5Init(&mdctx); + MD5Update(&mdctx, nstr, (unsigned int)strlen(nstr)); + MD5Final(digest, &mdctx); + + macaddr[0] = 0x00; + macaddr[1] = 0xa0; + macaddr[2] = 0x98; + macaddr[3] = digest[0]; + macaddr[4] = digest[1]; + macaddr[5] = digest[2]; +} Added: head/usr.sbin/bhyve/net_utils.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/net_utils.h Thu Jun 13 17:39:32 2019 (r349019) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2019 Vincenzo Maffione + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NET_UTILS_H_ +#define _NET_UTILS_H_ + +#include +#include "pci_emul.h" + +void net_genmac(struct pci_devinst *pi, uint8_t *macaddr); +int net_parsemac(char *mac_str, uint8_t *mac_addr); + +#endif /* _NET_UTILS_H_ */ Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Thu Jun 13 16:34:55 2019 (r349018) +++ head/usr.sbin/bhyve/pci_e82545.c Thu Jun 13 17:39:32 2019 (r349019) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "pci_emul.h" #include "mevent.h" +#include "net_utils.h" /* Hardware/register definitions XXX: move some to common code. */ #define E82545_VENDOR_ID_INTEL 0x8086 @@ -2259,38 +2260,16 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) } static int -e82545_parsemac(char *mac_str, uint8_t *mac_addr) -{ - struct ether_addr *ea; - char *tmpstr; - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; - - tmpstr = strsep(&mac_str,"="); - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { - ea = ether_aton(mac_str); - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { - fprintf(stderr, "Invalid MAC %s\n", mac_str); - return (1); - } else - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); - } - return (0); -} - -static int e82545_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { - DPRINTF("Loading with options: %s\r\n", opts); - - MD5_CTX mdctx; - unsigned char digest[16]; char nstr[80]; struct e82545_softc *sc; char *devname; char *vtopts; int mac_provided; + DPRINTF("Loading with options: %s\r\n", opts); + /* Setup our softc */ sc = calloc(1, sizeof(*sc)); @@ -2340,7 +2319,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, (void) strsep(&vtopts, ","); if (vtopts != NULL) { - err = e82545_parsemac(vtopts, sc->esc_mac.octet); + err = net_parsemac(vtopts, sc->esc_mac.octet); if (err != 0) { free(devname); return (err); @@ -2355,24 +2334,8 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, free(devname); } - /* - * The default MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the PCI slot/func number and dev name - */ if (!mac_provided) { - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); - - MD5Init(&mdctx); - MD5Update(&mdctx, nstr, strlen(nstr)); - MD5Final(digest, &mdctx); - - sc->esc_mac.octet[0] = 0x00; - sc->esc_mac.octet[1] = 0xa0; - sc->esc_mac.octet[2] = 0x98; - sc->esc_mac.octet[3] = digest[0]; - sc->esc_mac.octet[4] = digest[1]; - sc->esc_mac.octet[5] = digest[2]; + net_genmac(pi, sc->esc_mac.octet); } /* H/w initiated reset */ Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 13 16:34:55 2019 (r349018) +++ head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 13 17:39:32 2019 (r349019) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "mevent.h" #include "virtio.h" +#include "net_utils.h" #define VTNET_RINGSZ 1024 @@ -698,29 +699,6 @@ pci_vtnet_ping_ctlq(void *vsc, struct vqueue_info *vq) } #endif -static int -pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr) -{ - struct ether_addr *ea; - char *tmpstr; - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; - - tmpstr = strsep(&mac_str,"="); - - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { - ea = ether_aton(mac_str); - - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { - fprintf(stderr, "Invalid MAC %s\n", mac_str); - return (EINVAL); - } else - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); - } - - return (0); -} - static void pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) { @@ -795,9 +773,6 @@ pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, cha static int pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { - MD5_CTX mdctx; - unsigned char digest[16]; - char nstr[80]; char tname[MAXCOMLEN + 1]; struct pci_vtnet_softc *sc; char *devname; @@ -834,7 +809,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * (void) strsep(&vtopts, ","); if (vtopts != NULL) { - err = pci_vtnet_parsemac(vtopts, sc->vsc_config.mac); + err = net_parsemac(vtopts, sc->vsc_config.mac); if (err != 0) { free(devname); return (err); @@ -851,24 +826,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * free(devname); } - /* - * The default MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the PCI slot/func number and dev name - */ if (!mac_provided) { - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); - - MD5Init(&mdctx); - MD5Update(&mdctx, nstr, strlen(nstr)); - MD5Final(digest, &mdctx); - - sc->vsc_config.mac[0] = 0x00; - sc->vsc_config.mac[1] = 0xa0; - sc->vsc_config.mac[2] = 0x98; - sc->vsc_config.mac[3] = digest[0]; - sc->vsc_config.mac[4] = digest[1]; - sc->vsc_config.mac[5] = digest[2]; + net_genmac(pi, sc->vsc_config.mac); } /* initialize config space */ From owner-svn-src-head@freebsd.org Thu Jun 13 17:46:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8000315B8C40; Thu, 13 Jun 2019 17:46:39 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF6EE8EFF0; Thu, 13 Jun 2019 17:46:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x5DHkUsY093160; Thu, 13 Jun 2019 10:46:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5DHkUgr093159; Thu, 13 Jun 2019 10:46:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906131746.x5DHkUgr093159@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349019 - head/usr.sbin/bhyve In-Reply-To: <201906131739.x5DHdX93034129@repo.freebsd.org> To: Vincenzo Maffione Date: Thu, 13 Jun 2019 10:46:30 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CF6EE8EFF0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 17:46:39 -0000 > Author: vmaffione > Date: Thu Jun 13 17:39:32 2019 > New Revision: 349019 > URL: https://svnweb.freebsd.org/changeset/base/349019 > > Log: > bhyve: move common code to net_utils.c > > Both virtio_net and e82545 network frontends have code to validate and > generate MAC addresses. These functionalities are replicated in the two > files, so we move them in a separate compilation unit. > > Reviewed by: rgrimes, bryanv, imp, kevans > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20626 You should of waited for a bit longer for additional comments based on the fact you made changes based on other comments. > Added: > head/usr.sbin/bhyve/net_utils.c (contents, props changed) > head/usr.sbin/bhyve/net_utils.h (contents, props changed) > Modified: > head/usr.sbin/bhyve/Makefile > head/usr.sbin/bhyve/pci_e82545.c > head/usr.sbin/bhyve/pci_virtio_net.c > > Modified: head/usr.sbin/bhyve/Makefile > ============================================================================== > --- head/usr.sbin/bhyve/Makefile Thu Jun 13 16:34:55 2019 (r349018) > +++ head/usr.sbin/bhyve/Makefile Thu Jun 13 17:39:32 2019 (r349019) > @@ -32,6 +32,7 @@ SRCS= \ > mem.c \ > mevent.c \ > mptbl.c \ > + net_utils.c \ > pci_ahci.c \ > pci_e82545.c \ > pci_emul.c \ > > Added: head/usr.sbin/bhyve/net_utils.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/bhyve/net_utils.c Thu Jun 13 17:39:32 2019 (r349019) > @@ -0,0 +1,83 @@ > +/*- > + * Copyright (c) 2011 NetApp, Inc. The all rights reserved clause must be restored here, please see the review for the reason. Thanks, Rod > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT > + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE > + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, > + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include "net_utils.h" > +#include "bhyverun.h" > +#include > +#include > +#include > +#include > +#include > + > +int > +net_parsemac(char *mac_str, uint8_t *mac_addr) > +{ > + struct ether_addr *ea; > + char *tmpstr; > + char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; > + > + tmpstr = strsep(&mac_str,"="); > + > + if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { > + ea = ether_aton(mac_str); > + > + if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || > + memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { > + fprintf(stderr, "Invalid MAC %s\n", mac_str); > + return (EINVAL); > + } else > + memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); > + } > + > + return (0); > +} > + > +void > +net_genmac(struct pci_devinst *pi, uint8_t *macaddr) > +{ > + /* > + * The default MAC address is the standard NetApp OUI of 00-a0-98, > + * followed by an MD5 of the PCI slot/func number and dev name > + */ > + MD5_CTX mdctx; > + unsigned char digest[16]; > + char nstr[80]; > + > + snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, > + pi->pi_func, vmname); > + > + MD5Init(&mdctx); > + MD5Update(&mdctx, nstr, (unsigned int)strlen(nstr)); > + MD5Final(digest, &mdctx); > + > + macaddr[0] = 0x00; > + macaddr[1] = 0xa0; > + macaddr[2] = 0x98; > + macaddr[3] = digest[0]; > + macaddr[4] = digest[1]; > + macaddr[5] = digest[2]; > +} > > Added: head/usr.sbin/bhyve/net_utils.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/bhyve/net_utils.h Thu Jun 13 17:39:32 2019 (r349019) > @@ -0,0 +1,37 @@ > +/*- > + * Copyright (c) 2019 Vincenzo Maffione This one is fine, thank you for fixing this. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT > + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE > + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, > + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _NET_UTILS_H_ > +#define _NET_UTILS_H_ > + > +#include > +#include "pci_emul.h" > + > +void net_genmac(struct pci_devinst *pi, uint8_t *macaddr); > +int net_parsemac(char *mac_str, uint8_t *mac_addr); > + > +#endif /* _NET_UTILS_H_ */ > > Modified: head/usr.sbin/bhyve/pci_e82545.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_e82545.c Thu Jun 13 16:34:55 2019 (r349018) > +++ head/usr.sbin/bhyve/pci_e82545.c Thu Jun 13 17:39:32 2019 (r349019) > @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); > #include "bhyverun.h" > #include "pci_emul.h" > #include "mevent.h" > +#include "net_utils.h" > > /* Hardware/register definitions XXX: move some to common code. */ > #define E82545_VENDOR_ID_INTEL 0x8086 > @@ -2259,38 +2260,16 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) > } > > static int > -e82545_parsemac(char *mac_str, uint8_t *mac_addr) > -{ > - struct ether_addr *ea; > - char *tmpstr; > - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; > - > - tmpstr = strsep(&mac_str,"="); > - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { > - ea = ether_aton(mac_str); > - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || > - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { > - fprintf(stderr, "Invalid MAC %s\n", mac_str); > - return (1); > - } else > - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); > - } > - return (0); > -} > - > -static int > e82545_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) > { > - DPRINTF("Loading with options: %s\r\n", opts); > - > - MD5_CTX mdctx; > - unsigned char digest[16]; > char nstr[80]; > struct e82545_softc *sc; > char *devname; > char *vtopts; > int mac_provided; > > + DPRINTF("Loading with options: %s\r\n", opts); > + > /* Setup our softc */ > sc = calloc(1, sizeof(*sc)); > > @@ -2340,7 +2319,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, > (void) strsep(&vtopts, ","); > > if (vtopts != NULL) { > - err = e82545_parsemac(vtopts, sc->esc_mac.octet); > + err = net_parsemac(vtopts, sc->esc_mac.octet); > if (err != 0) { > free(devname); > return (err); > @@ -2355,24 +2334,8 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, > free(devname); > } > > - /* > - * The default MAC address is the standard NetApp OUI of 00-a0-98, > - * followed by an MD5 of the PCI slot/func number and dev name > - */ > if (!mac_provided) { > - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, > - pi->pi_func, vmname); > - > - MD5Init(&mdctx); > - MD5Update(&mdctx, nstr, strlen(nstr)); > - MD5Final(digest, &mdctx); > - > - sc->esc_mac.octet[0] = 0x00; > - sc->esc_mac.octet[1] = 0xa0; > - sc->esc_mac.octet[2] = 0x98; > - sc->esc_mac.octet[3] = digest[0]; > - sc->esc_mac.octet[4] = digest[1]; > - sc->esc_mac.octet[5] = digest[2]; > + net_genmac(pi, sc->esc_mac.octet); > } > > /* H/w initiated reset */ > > Modified: head/usr.sbin/bhyve/pci_virtio_net.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 13 16:34:55 2019 (r349018) > +++ head/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 13 17:39:32 2019 (r349019) > @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); > #include "pci_emul.h" > #include "mevent.h" > #include "virtio.h" > +#include "net_utils.h" > > #define VTNET_RINGSZ 1024 > > @@ -698,29 +699,6 @@ pci_vtnet_ping_ctlq(void *vsc, struct vqueue_info *vq) > } > #endif > > -static int > -pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr) > -{ > - struct ether_addr *ea; > - char *tmpstr; > - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; > - > - tmpstr = strsep(&mac_str,"="); > - > - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { > - ea = ether_aton(mac_str); > - > - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || > - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { > - fprintf(stderr, "Invalid MAC %s\n", mac_str); > - return (EINVAL); > - } else > - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); > - } > - > - return (0); > -} > - > static void > pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) > { > @@ -795,9 +773,6 @@ pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, cha > static int > pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) > { > - MD5_CTX mdctx; > - unsigned char digest[16]; > - char nstr[80]; > char tname[MAXCOMLEN + 1]; > struct pci_vtnet_softc *sc; > char *devname; > @@ -834,7 +809,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * > (void) strsep(&vtopts, ","); > > if (vtopts != NULL) { > - err = pci_vtnet_parsemac(vtopts, sc->vsc_config.mac); > + err = net_parsemac(vtopts, sc->vsc_config.mac); > if (err != 0) { > free(devname); > return (err); > @@ -851,24 +826,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * > free(devname); > } > > - /* > - * The default MAC address is the standard NetApp OUI of 00-a0-98, > - * followed by an MD5 of the PCI slot/func number and dev name > - */ > if (!mac_provided) { > - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, > - pi->pi_func, vmname); > - > - MD5Init(&mdctx); > - MD5Update(&mdctx, nstr, strlen(nstr)); > - MD5Final(digest, &mdctx); > - > - sc->vsc_config.mac[0] = 0x00; > - sc->vsc_config.mac[1] = 0xa0; > - sc->vsc_config.mac[2] = 0x98; > - sc->vsc_config.mac[3] = digest[0]; > - sc->vsc_config.mac[4] = digest[1]; > - sc->vsc_config.mac[5] = digest[2]; > + net_genmac(pi, sc->vsc_config.mac); > } > > /* initialize config space */ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 13 20:09:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E769B15BBB8A; Thu, 13 Jun 2019 20:09:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 856EC6CAC0; Thu, 13 Jun 2019 20:09:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 732975557; Thu, 13 Jun 2019 20:09:08 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5DK98OB012684; Thu, 13 Jun 2019 20:09:08 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5DK98T1012683; Thu, 13 Jun 2019 20:09:08 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906132009.x5DK98T1012683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 13 Jun 2019 20:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349023 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 856EC6CAC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 20:09:09 -0000 Author: dougm Date: Thu Jun 13 20:09:07 2019 New Revision: 349023 URL: https://svnweb.freebsd.org/changeset/base/349023 Log: Create a function for creating objects to back map entries, and one for giving cred to a map entry backed by an object, and use them instead of the code duplicated inline now. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20370 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Jun 13 19:51:48 2019 (r349022) +++ head/sys/vm/vm_map.c Thu Jun 13 20:09:07 2019 (r349023) @@ -2109,6 +2109,60 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent } /* + * vm_map_entry_back: + * + * Allocate an object to back a map entry. + */ +static inline void +vm_map_entry_back(vm_map_entry_t entry) +{ + vm_object_t object; + + KASSERT(entry->object.vm_object == NULL, + ("map entry %p has backing object", entry)); + KASSERT((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0, + ("map entry %p is a submap", entry)); + object = vm_object_allocate(OBJT_DEFAULT, + atop(entry->end - entry->start)); + entry->object.vm_object = object; + entry->offset = 0; + if (entry->cred != NULL) { + object->cred = entry->cred; + object->charge = entry->end - entry->start; + entry->cred = NULL; + } +} + +/* + * vm_map_entry_charge_object + * + * If there is no object backing this entry, create one. Otherwise, if + * the entry has cred, give it to the backing object. + */ +static inline void +vm_map_entry_charge_object(vm_map_t map, vm_map_entry_t entry) +{ + + VM_MAP_ASSERT_LOCKED(map); + KASSERT((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0, + ("map entry %p is a submap", entry)); + if (entry->object.vm_object == NULL && !map->system_map && + (entry->eflags & MAP_ENTRY_GUARD) == 0) + vm_map_entry_back(entry); + else if (entry->object.vm_object != NULL && + ((entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) && + entry->cred != NULL) { + VM_OBJECT_WLOCK(entry->object.vm_object); + KASSERT(entry->object.vm_object->cred == NULL, + ("OVERCOMMIT: %s: both cred e %p", __func__, entry)); + entry->object.vm_object->cred = entry->cred; + entry->object.vm_object->charge = entry->end - entry->start; + VM_OBJECT_WUNLOCK(entry->object.vm_object); + entry->cred = NULL; + } +} + +/* * vm_map_clip_start: [ internal use only ] * * Asserts that the given entry begins at or after @@ -2140,38 +2194,7 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, * starting address. */ vm_map_simplify_entry(map, entry); - - /* - * If there is no object backing this entry, we might as well create - * one now. If we defer it, an object can get created after the map - * is clipped, and individual objects will be created for the split-up - * map. This is a bit of a hack, but is also about the best place to - * put this improvement. - */ - if (entry->object.vm_object == NULL && !map->system_map && - (entry->eflags & MAP_ENTRY_GUARD) == 0) { - vm_object_t object; - object = vm_object_allocate(OBJT_DEFAULT, - atop(entry->end - entry->start)); - entry->object.vm_object = object; - entry->offset = 0; - if (entry->cred != NULL) { - object->cred = entry->cred; - object->charge = entry->end - entry->start; - entry->cred = NULL; - } - } else if (entry->object.vm_object != NULL && - ((entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) && - entry->cred != NULL) { - VM_OBJECT_WLOCK(entry->object.vm_object); - KASSERT(entry->object.vm_object->cred == NULL, - ("OVERCOMMIT: vm_entry_clip_start: both cred e %p", entry)); - entry->object.vm_object->cred = entry->cred; - entry->object.vm_object->charge = entry->end - entry->start; - VM_OBJECT_WUNLOCK(entry->object.vm_object); - entry->cred = NULL; - } - + vm_map_entry_charge_object(map, entry); new_entry = vm_map_entry_create(map); *new_entry = *entry; @@ -2222,40 +2245,11 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v KASSERT(entry->start < end && entry->end > end, ("_vm_map_clip_end: invalid clip of entry %p", entry)); - /* - * If there is no object backing this entry, we might as well create - * one now. If we defer it, an object can get created after the map - * is clipped, and individual objects will be created for the split-up - * map. This is a bit of a hack, but is also about the best place to - * put this improvement. - */ - if (entry->object.vm_object == NULL && !map->system_map && - (entry->eflags & MAP_ENTRY_GUARD) == 0) { - vm_object_t object; - object = vm_object_allocate(OBJT_DEFAULT, - atop(entry->end - entry->start)); - entry->object.vm_object = object; - entry->offset = 0; - if (entry->cred != NULL) { - object->cred = entry->cred; - object->charge = entry->end - entry->start; - entry->cred = NULL; - } - } else if (entry->object.vm_object != NULL && - ((entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) && - entry->cred != NULL) { - VM_OBJECT_WLOCK(entry->object.vm_object); - KASSERT(entry->object.vm_object->cred == NULL, - ("OVERCOMMIT: vm_entry_clip_end: both cred e %p", entry)); - entry->object.vm_object->cred = entry->cred; - entry->object.vm_object->charge = entry->end - entry->start; - VM_OBJECT_WUNLOCK(entry->object.vm_object); - entry->cred = NULL; - } /* * Create a new entry and insert it AFTER the specified entry */ + vm_map_entry_charge_object(map, entry); new_entry = vm_map_entry_create(map); *new_entry = *entry; @@ -3935,16 +3929,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c */ object = old_entry->object.vm_object; if (object == NULL) { - object = vm_object_allocate(OBJT_DEFAULT, - atop(old_entry->end - old_entry->start)); - old_entry->object.vm_object = object; - old_entry->offset = 0; - if (old_entry->cred != NULL) { - object->cred = old_entry->cred; - object->charge = old_entry->end - - old_entry->start; - old_entry->cred = NULL; - } + vm_map_entry_back(old_entry); + object = old_entry->object.vm_object; } /* From owner-svn-src-head@freebsd.org Thu Jun 13 22:03:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDC4915BE7CD; Thu, 13 Jun 2019 22:03:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79BAD7042F; Thu, 13 Jun 2019 22:03:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0B569FF; Thu, 13 Jun 2019 22:03: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 x5DM3smx075057; Thu, 13 Jun 2019 22:03:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5DM3sjp075056; Thu, 13 Jun 2019 22:03:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906132203.x5DM3sjp075056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 13 Jun 2019 22:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349025 - head/sys/modules/sdio X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/sdio X-SVN-Commit-Revision: 349025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79BAD7042F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 Jun 2019 22:03:55 -0000 Author: imp Date: Thu Jun 13 22:03:53 2019 New Revision: 349025 URL: https://svnweb.freebsd.org/changeset/base/349025 Log: Add opt_cam.h so we can build this outside of a kernel build. Modified: head/sys/modules/sdio/Makefile Modified: head/sys/modules/sdio/Makefile ============================================================================== --- head/sys/modules/sdio/Makefile Thu Jun 13 20:16:26 2019 (r349024) +++ head/sys/modules/sdio/Makefile Thu Jun 13 22:03:53 2019 (r349025) @@ -5,6 +5,6 @@ KMOD= sdio SRCS= sdiob.c sdio_subr.c SRCS+= sdio_if.c -SRCS+= device_if.h bus_if.h sdio_if.h +SRCS+= device_if.h bus_if.h sdio_if.h opt_cam.h .include From owner-svn-src-head@freebsd.org Fri Jun 14 01:09:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EBA815C2269; Fri, 14 Jun 2019 01:09:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BD275BD0; Fri, 14 Jun 2019 01:09:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFF7A8857; Fri, 14 Jun 2019 01:09:10 +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 x5E19APV087900; Fri, 14 Jun 2019 01:09:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5E19Aj9087899; Fri, 14 Jun 2019 01:09:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906140109.x5E19Aj9087899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Jun 2019 01:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349029 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16BD275BD0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 01:09:11 -0000 Author: mav Date: Fri Jun 14 01:09:10 2019 New Revision: 349029 URL: https://svnweb.freebsd.org/changeset/base/349029 Log: Update td_runtime of running thread on each statclock(). Normally td_runtime is updated on context switch, but there are some kernel threads that due to high absolute priority may run for many seconds without context switches (yes, that is bad, but that is true), which means their td_runtime was not updated all that time, that made them invisible for top other then as some general CPU usage. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Fri Jun 14 00:30:52 2019 (r349028) +++ head/sys/kern/kern_clock.c Fri Jun 14 01:09:10 2019 (r349029) @@ -644,6 +644,7 @@ statclock(int cnt, int usermode) struct proc *p; long rss; long *cp_time; + uint64_t runtime, new_switchtime; td = curthread; p = td->td_proc; @@ -699,6 +700,17 @@ statclock(int cnt, int usermode) "prio:%d", td->td_priority, "stathz:%d", (stathz)?stathz:hz); SDT_PROBE2(sched, , , tick, td, td->td_proc); thread_lock_flags(td, MTX_QUIET); + + /* + * Compute the amount of time during which the current + * thread was running, and add that to its total so far. + */ + new_switchtime = cpu_ticks(); + runtime = new_switchtime - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; + PCPU_SET(switchtime, new_switchtime); + for ( ; cnt > 0; cnt--) sched_clock(td); thread_unlock(td); From owner-svn-src-head@freebsd.org Fri Jun 14 01:26:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD8715C277D; Fri, 14 Jun 2019 01:26:24 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26F2E76387; Fri, 14 Jun 2019 01:26:24 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f46.google.com with SMTP id e3so2111507ioc.12; Thu, 13 Jun 2019 18:26:24 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/iElz/kjuib3F+c36X9dLvxLJ8zEu0veIQfqzL/Ko0Q=; b=bYxx1tQnpq8Z7Kwub21CgwOhMmgZ1WqtPospEvMKi8pphnrN+0XnS24BHg7dtfbfR7 aXVxOuf8wcUQFk6PiCeFYOsDFV75/gOZIz7lkkK3xExElM3d9jwzVPkZtScrJYHbnQZE TbC9zCSLdeg80ImwvL1MITGGXhe1hokBaX8g7CztFkFjuY7n09Az+VVaDG53XFLK8uGQ 1w4ttxf4TLuG1LbA6hUtkK0osito9hSkaTqTphVYafqwpxUGiMi5NUa0pa2E5BxyAE5x G9VDSeuu3ezMouVV/7Fb3o5Fac5Bb7G2OORULu9PiNq6vWqwgOdz3Ijrq9DfTO8Jndwt ZVDA== X-Gm-Message-State: APjAAAX88zTM36p2ko4xFEhUTsQpY4XetsXvVGXBYhSbCX4pjozJ+/Ck 7QfnWhlpzU+nDlxQZ7GPu1QwIEbe6q9vxLkMlXzAVe+W X-Google-Smtp-Source: APXvYqzqGZdR3edRu/oLl0B62bbYaOu0sL8IXVxPeoihOTt0GyaIq2hZzZ41sq2m3a/GEtqfr6UZ1h7HTlGsNKLvOwQ= X-Received: by 2002:a5e:a712:: with SMTP id b18mr2701992iod.220.1560446174837; Thu, 13 Jun 2019 10:16:14 -0700 (PDT) MIME-Version: 1.0 References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190612224255.GA67242@FreeBSD.org> <20190613104310.1b0f8f70@kalimero.tijl.coosemans.org> In-Reply-To: <20190613104310.1b0f8f70@kalimero.tijl.coosemans.org> From: Dmitry Chagin Date: Thu, 13 Jun 2019 20:16:04 +0300 Message-ID: Subject: Re: svn commit: r348847 - head/sys/sys To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: Dmitry Chagin , Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 26F2E76387 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 01:26:24 -0000 Hi, All! thanks for reply, I will be back in a week and fix it, I am rafting in Eastern Siberia)) =D1=87=D1=82, 13 =D0=B8=D1=8E=D0=BD=D1=8F 2019 =D0=B3. =D0=B2 11:43, T=C4= =B3l Coosemans : > On Wed, 12 Jun 2019 16:51:03 -0600 Warner Losh wrote: > > On Wed, Jun 12, 2019 at 4:49 PM Gleb Smirnoff > wrote: > >> On Mon, Jun 10, 2019 at 11:09:09AM +0200, T=C4=B3l Coosemans wrote: > >>>> Date: Mon Jun 10 05:28:03 2019 > >>>> New Revision: 348847 > >>>> URL: https://svnweb.freebsd.org/changeset/base/348847 > >>>> > >>>> Log: > >>>> Use C11 anonymous unions. > >>>> > >>>> PR: 215202 > >>>> Reported by: glebius > >>>> MFC after: 2 weeks > >>>> > >>>> Modified: > >>>> head/sys/sys/ucred.h > >>>> > >>>> Modified: head/sys/sys/ucred.h > >>>> > >>>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > >>>> --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) > >>>> +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) > >>>> @@ -89,12 +89,11 @@ struct xucred { > >>>> gid_t cr_groups[XU_NGROUPS]; /* groups */ > >>>> union { > >>>> void *_cr_unused1; /* compatibility with old ucred *= / > >>>> - pid_t _pid; > >>>> - } _cr; > >>>> + pid_t cr_pid; > >>>> + }; > >>>> }; > >>>> #define XUCRED_VERSION 0 > >>>> > >>>> -#define cr_pid _cr._pid > >>>> /* This can be used for both ucred and xucred structures. */ > >>>> #define cr_gid cr_groups[0] > >>> > >>> Isn't this a userland header that should work with non-C11 compilers? > >> > >> It could make sense to keep such low bar for standard headers, but > ucred.h > >> is BSD-specific header and struct xucred is FreeBSD specific. > > > > This is solvable with proper visibility, I'd think.. > > I think "union {" should be replaced with "__extension__ union {". That > seems to kill this warning: > > /usr/include/sys/ucred.h:90:2: warning: anonymous unions are a C11 > extension > [-Wc11-extensions] > union { > ^ > 1 warning generated. > From owner-svn-src-head@freebsd.org Fri Jun 14 03:15:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5299215C4282; Fri, 14 Jun 2019 03:15:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E75C680BC3; Fri, 14 Jun 2019 03:15:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B95E59E6A; Fri, 14 Jun 2019 03:15:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5E3Fs8L055751; Fri, 14 Jun 2019 03:15:54 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5E3FsGg055750; Fri, 14 Jun 2019 03:15:54 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906140315.x5E3FsGg055750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 14 Jun 2019 03:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349030 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E75C680BC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 03:15:55 -0000 Author: dougm Date: Fri Jun 14 03:15:54 2019 New Revision: 349030 URL: https://svnweb.freebsd.org/changeset/base/349030 Log: Avoid using the prev field of vm_map_entry_t in two functions that iterate over consecutive vm_map entries, and that can easily just 'remember' the prev value instead of looking it up. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20628 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jun 14 01:09:10 2019 (r349029) +++ head/sys/vm/vm_map.c Fri Jun 14 03:15:54 2019 (r349030) @@ -734,18 +734,17 @@ SYSCTL_INT(_debug, OID_AUTO, vmmap_check, CTLFLAG_RWTU static void _vm_map_assert_consistent(vm_map_t map) { - vm_map_entry_t entry; - vm_map_entry_t child; + vm_map_entry_t child, entry, prev; vm_size_t max_left, max_right; if (!enable_vmmap_check) return; - for (entry = map->header.next; entry != &map->header; - entry = entry->next) { - KASSERT(entry->prev->end <= entry->start, + for (prev = &map->header; (entry = prev->next) != &map->header; + prev = entry) { + KASSERT(prev->end <= entry->start, ("map %p prev->end = %jx, start = %jx", map, - (uintmax_t)entry->prev->end, (uintmax_t)entry->start)); + (uintmax_t)prev->end, (uintmax_t)entry->start)); KASSERT(entry->start < entry->end, ("map %p start = %jx, end = %jx", map, (uintmax_t)entry->start, (uintmax_t)entry->end)); @@ -762,7 +761,7 @@ _vm_map_assert_consistent(vm_map_t map) (uintmax_t)entry->start, (uintmax_t)entry->right->start)); child = entry->left; max_left = (child != NULL) ? child->max_free : - entry->start - entry->prev->end; + entry->start - prev->end; child = entry->right; max_right = (child != NULL) ? child->max_free : entry->next->start - entry->end; @@ -4811,15 +4810,15 @@ vm_map_pmap_KBI(vm_map_t map) static void vm_map_print(vm_map_t map) { - vm_map_entry_t entry; + vm_map_entry_t entry, prev; db_iprintf("Task map %p: pmap=%p, nentries=%d, version=%u\n", (void *)map, (void *)map->pmap, map->nentries, map->timestamp); db_indent += 2; - for (entry = map->header.next; entry != &map->header; - entry = entry->next) { + for (prev = &map->header; (entry = prev->next) != &map->header; + prev = entry) { db_iprintf("map entry %p: start=%p, end=%p, eflags=%#x, \n", (void *)entry, (void *)entry->start, (void *)entry->end, entry->eflags); @@ -4830,7 +4829,8 @@ vm_map_print(vm_map_t map) db_iprintf(" prot=%x/%x/%s", entry->protection, entry->max_protection, - inheritance_name[(int)(unsigned char)entry->inheritance]); + inheritance_name[(int)(unsigned char) + entry->inheritance]); if (entry->wired_count != 0) db_printf(", wired"); } @@ -4838,9 +4838,9 @@ vm_map_print(vm_map_t map) db_printf(", share=%p, offset=0x%jx\n", (void *)entry->object.sub_map, (uintmax_t)entry->offset); - if ((entry->prev == &map->header) || - (entry->prev->object.sub_map != - entry->object.sub_map)) { + if (prev == &map->header || + prev->object.sub_map != + entry->object.sub_map) { db_indent += 2; vm_map_print((vm_map_t)entry->object.sub_map); db_indent -= 2; @@ -4860,9 +4860,9 @@ vm_map_print(vm_map_t map) (entry->eflags & MAP_ENTRY_NEEDS_COPY) ? "needed" : "done"); db_printf("\n"); - if ((entry->prev == &map->header) || - (entry->prev->object.vm_object != - entry->object.vm_object)) { + if (prev == &map->header || + prev->object.vm_object != + entry->object.vm_object) { db_indent += 2; vm_object_print((db_expr_t)(intptr_t) entry->object.vm_object, From owner-svn-src-head@freebsd.org Fri Jun 14 04:01:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 914E315C4DD2; Fri, 14 Jun 2019 04:01:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3563081E02; Fri, 14 Jun 2019 04:01:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F8B6A57E; Fri, 14 Jun 2019 04:01:09 +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 x5E41884079470; Fri, 14 Jun 2019 04:01:08 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5E418w6079469; Fri, 14 Jun 2019 04:01:08 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906140401.x5E418w6079469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 14 Jun 2019 04:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349031 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3563081E02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 04:01:09 -0000 Author: alc Date: Fri Jun 14 04:01:08 2019 New Revision: 349031 URL: https://svnweb.freebsd.org/changeset/base/349031 Log: Change the arm64 pmap so that updates to the global count of wired pages are not performed directly by the pmap. Instead, they are performed by vm_page_free_pages_toq(). (This is the same approach that we use on x86.) Reviewed by: kib, markj MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D20627 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Jun 14 03:15:54 2019 (r349030) +++ head/sys/arm64/arm64/pmap.c Fri Jun 14 04:01:08 2019 (r349031) @@ -1410,8 +1410,6 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - vm_wire_sub(1); - /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done @@ -2030,9 +2028,8 @@ next_chunk: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - vm_wire_add(1); } - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); return (m_pc); } @@ -2470,8 +2467,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); + ml3->wire_count = 0; pmap_add_delayed_free_list(ml3, free, FALSE); } } @@ -2624,7 +2620,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } /* @@ -2729,7 +2725,7 @@ retry: } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(lock); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } /* @@ -3397,7 +3393,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t lockp) != 0) break; } - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { /* * Both pmap_remove_l2() and pmap_remove_l3() will @@ -3425,7 +3421,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t * Invalidate those entries. */ pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p", @@ -3614,7 +3610,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v SLIST_INIT(&free); if (pmap_unwire_l3(pmap, va, mpte, &free)) { pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } mpte = NULL; } @@ -4097,8 +4093,7 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); + ml3->wire_count = 0; pmap_add_delayed_free_list(ml3, &free, FALSE); } @@ -4136,7 +4131,7 @@ pmap_remove_pages(pmap_t pmap) if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } /* @@ -4596,7 +4591,7 @@ small_mappings: not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); return (cleared + not_cleared); } @@ -5019,7 +5014,7 @@ pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_e SLIST_INIT(&free); (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, lockp); - vm_page_free_pages_toq(&free, false); + vm_page_free_pages_toq(&free, true); } /* From owner-svn-src-head@freebsd.org Fri Jun 14 06:10:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F2A515C72F0; Fri, 14 Jun 2019 06:10:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EED1684E5E; Fri, 14 Jun 2019 06:10:15 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4249BCA8; Fri, 14 Jun 2019 06:10:15 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5E6AFku044494; Fri, 14 Jun 2019 06:10:15 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5E6AF51044493; Fri, 14 Jun 2019 06:10:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201906140610.x5E6AF51044493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 14 Jun 2019 06:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349032 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 349032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EED1684E5E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 06:10:16 -0000 Author: mckusick Date: Fri Jun 14 06:10:15 2019 New Revision: 349032 URL: https://svnweb.freebsd.org/changeset/base/349032 Log: Clarify that the -r and -R options can be used only to create level 0 dumps. Suggested by: phk MFC after: 3 days Modified: head/sbin/dump/dump.8 Modified: head/sbin/dump/dump.8 ============================================================================== --- head/sbin/dump/dump.8 Fri Jun 14 04:01:08 2019 (r349031) +++ head/sbin/dump/dump.8 Fri Jun 14 06:10:15 2019 (r349032) @@ -29,7 +29,7 @@ .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd June 11, 2018 +.Dd June 13, 2019 .Dt DUMP 8 .Os .Sh NAME @@ -266,6 +266,12 @@ used to update a remote copy of a level 0 dump, since the date changes for each dump. This option sets both dates to the epoch, permitting rsync to be much more efficient when transferring a dump file. +The +.Fl r +option can be used only to create level 0 dumps. +A dump using the +.Fl r +option cannot be used as the basis for a later incremental dump. .It Fl R Be even more rsync-friendly. This option disables the storage of the actual inode access time @@ -277,6 +283,12 @@ The .Fl R option also sets .Fl r . +The +.Fl R +option can be used only to create level 0 dumps. +A dump using the +.Fl R +option cannot be used as the basis for a later incremental dump. .It Fl S Display an estimate of the backup size and the number of tapes required, and exit without actually performing the dump. From owner-svn-src-head@freebsd.org Fri Jun 14 08:24:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB9D15CA38F; Fri, 14 Jun 2019 08:24:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 37AFA894F7; Fri, 14 Jun 2019 08:24:49 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D87308D4A154; Fri, 14 Jun 2019 08:24:46 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id A1CCFE707B0; Fri, 14 Jun 2019 08:24:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id iEBeZ712i_Mr; Fri, 14 Jun 2019 08:24:44 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 47343E707AE; Fri, 14 Jun 2019 08:24:43 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Luiz Otavio O Souza" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348882 - head/sys/dev/sdhci Date: Fri, 14 Jun 2019 08:24:43 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: In-Reply-To: <201906102150.x5ALo8wL089525@repo.freebsd.org> References: <201906102150.x5ALo8wL089525@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Rspamd-Queue-Id: 37AFA894F7 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2a01:4f8:13b:39f::9f:25 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-5.72 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.43)[ip: (-8.32), ipnet: 2a01:4f8::/29(-2.06), asn: 24940(-1.76), country: DE(-0.01)]; MX_GOOD(-0.01)[cross.sbone.de]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 08:24:50 -0000 On 10 Jun 2019, at 21:50, Luiz Otavio O Souza wrote: > Author: loos > Date: Mon Jun 10 21:50:07 2019 > New Revision: 348882 > URL: https://svnweb.freebsd.org/changeset/base/348882 > > Log: > Add support for the GPIO SD Card VCC regulator/switch and the GPIO > SD Card > detection pins to the Marvell Xenon SDHCI controller. > > These features are enable by 'vqmmc-supply' and 'cd-gpios' > properties in the > DTS. > > This fixes the SD Card detection on espressobin. Do you have a copy or a reference to such a (working) dts file? Thanks, Bjoern From owner-svn-src-head@freebsd.org Fri Jun 14 12:58:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5547815CF6F6; Fri, 14 Jun 2019 12:58:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5906A7B2; Fri, 14 Jun 2019 12:58:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C1DB93DC6B6; Fri, 14 Jun 2019 22:58:35 +1000 (AEST) Date: Fri, 14 Jun 2019 22:58:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349029 - head/sys/kern In-Reply-To: <201906140109.x5E19Aj9087899@repo.freebsd.org> Message-ID: <20190614214154.I1201@besplex.bde.org> References: <201906140109.x5E19Aj9087899@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=xxwpQsxGIUx3GmqBR10A:9 a=Jt7mtkJ1TXbLOZa2:21 a=2KJrtirBv4LqabpG:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 4A5906A7B2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 12:58:46 -0000 On Fri, 14 Jun 2019, Alexander Motin wrote: > Log: > Update td_runtime of running thread on each statclock(). > > Normally td_runtime is updated on context switch, but there are some kernel > threads that due to high absolute priority may run for many seconds without > context switches (yes, that is bad, but that is true), which means their > td_runtime was not updated all that time, that made them invisible for top > other then as some general CPU usage. > > MFC after: 1 week > Sponsored by: iXsystems, Inc. This and more is supposed to be done in calcru(). It is also necessary to adjust for the current timeslice. I thought that calcru() was fixed, but the fix seems to be only in my version of FreeBSD-5.2. The bug seems to be in fill_kinfo_proc_only(). calcru() should update td_runtime for all threads in the proc (and sum into rux_rutime), but fill_kinfo_proc_only() uses rux_runtime to initialize ki_runtime before calling calcru(), so sees a stale value. This was broken in r132855 (the initialization of ki_runtime was moved too early as part of a fix for zombies). Using calcru() for its side effect is a bit magic. get_thread_cputime() does this less hackishly for curthread (by adding the timeslice without updating td_runtime), but is broken for other threads (by using the stale td_runtime). td_runtime is unavailable in userland. top and ps can only see ki_runtime which is per-process. Actually, calcru() seems to have the same bug as get_thread_cputime(). This is fixed in my version of FreeBSD-5-2, but is clearly broken in plain FreeBSD-FreeBSD-5.2, and -current seems to be even more broken than plain 5.2 -- it is missing the large comment about this bug that I added in r130858. -current first updates td_runtime for curthread. Then it loops over all threads in the process, but does nothing unless td_incruntime != 0, and when td_incruntime != 0 it updates rux_runtime using the value in td_incruntime, and this value is stale except for curthread. td_runtime is updated in one other place: in rufetchtd(), but this function has the same bug eas everywhere else -- it only updates the runtimes for curthread. Here is my fix for this in FreeBSD-5.2: XX Index: kern_resource.c XX =================================================================== XX RCS file: /home/ncvs/src/sys/kern/kern_resource.c,v XX retrieving revision 1.140 XX diff -u -2 -r1.140 kern_resource.c XX --- kern_resource.c 21 Jun 2004 17:46:27 -0000 1.140 XX @@ -702,18 +720,80 @@ XX struct timeval *ip; XX { XX - struct bintime bt, rt; XX - struct timeval tv; XX + struct bintime bt; XX + struct rusage_ext rux; -current already has most of the infrastructure for this -- I invented rusage_ext partly to fix this problem, and -current has a more sophisticated version of rusage_ext. -current also uses cputicks instead of bintimes. XX struct thread *td; XX - /* {user, system, interrupt, total} {ticks, usec}; previous tu: */ XX - u_int64_t ut, uu, st, su, it, iu, tt, tu, ptu; XX - int problemcase; XX + int bt_valid, proc_locked, sched_locked; XX XX - mtx_assert(&sched_lock, MA_OWNED); XX - /* XXX: why spl-protect ? worst case is an off-by-one report */ XX + proc_locked = mtx_owned(&p->p_mtx); XX + sched_locked = mtx_owned(&sched_lock); XX + if (!proc_locked && !sched_locked) XX + PROC_LOCK(p); XX + if (!sched_locked) XX + mtx_lock_spin(&sched_lock); This also has some restructuring that -current already has in a more sophisticated way. XX + rux = p->p_rux; XX + bt_valid = 0; XX + FOREACH_THREAD_IN_PROC(p, td) { XX + if (TD_IS_RUNNING(td)) { XX + /* XX + * Adjust for the current time slice. This is XX + * important since the adjustment is on the order XX + * of a time quantum, which is much greater than XX + * the precision of binuptime(). XX + */ XX + KASSERT(td->td_oncpu != NOCPU, XX + ("calcru: running thread has no CPU")); XX + if (!bt_valid) { XX + binuptime(&bt); XX + bt_valid = 1; XX + } XX + bintime_sub(&bt, XX + &pcpu_find(td->td_oncpu)->pc_switchtime); XX + if (bt.sec < 0) { XX + printf( XX + "calcru: negative delta-runtime of %jd sec + %jd wsec for pid %d (%s)\n", XX + (intmax_t)bt.sec, bt.frac, XX + p->p_pid, p->p_comm); XX + bt.sec = 0; XX + bt.frac = 0; XX + } XX + bintime_add(&rux.rux_runtime, &bt); XX + } XX + } XX + if (!sched_locked) XX + mtx_unlock_spin(&sched_lock); That is the main part of the fix. It is necessary to loop over all threads in the process. XX + calcru1(p, &rux, up, sp, ip); XX + p->p_rux.rux_uu = rux.rux_uu; XX + p->p_rux.rux_su = rux.rux_su; XX + p->p_rux.rux_iu = rux.rux_iu; XX + if (!proc_locked && !sched_locked) XX + PROC_UNLOCK(p); XX +} XX + XX +void XX +calccru(p, up, sp) XX + struct proc *p; XX + struct timeval *up; XX + struct timeval *sp; XX +{ XX XX - ut = p->p_uticks; XX - st = p->p_sticks; XX - it = p->p_iticks; XX + PROC_LOCK_ASSERT(p, MA_OWNED); XX + calcru1(p, &p->p_crux, up, sp, NULL); XX +} XX XX +static void XX +calcru1(p, ruxp, up, sp, ip) XX + struct proc *p; XX + struct rusage_ext *ruxp; XX + struct timeval *up; XX + struct timeval *sp; XX + struct timeval *ip; XX +{ XX + struct timeval tv; XX + /* {user, system, interrupt, total} {ticks, usec}; previous tu: */ XX + u_int64_t ut, uu, st, su, it, iu, tt, tu, ptu; XX + XX + ut = ruxp->rux_uticks; XX + st = ruxp->rux_sticks; XX + it = ruxp->rux_iticks; XX tt = ut + st + it; XX if (tt == 0) { XX @@ -721,42 +801,20 @@ XX tt = 1; XX } XX - rt = p->p_runtime; XX - problemcase = 0; XX - FOREACH_THREAD_IN_PROC(p, td) { XX - /* XX - * Adjust for the current time slice. This is actually fairly XX - * important since the error here is on the order of a time XX - * quantum, which is much greater than the sampling error. XX - */ XX - if (td == curthread) { XX - binuptime(&bt); XX - bintime_sub(&bt, PCPU_PTR(switchtime)); XX - bintime_add(&rt, &bt); XX - } else if (TD_IS_RUNNING(td)) { XX - /* XX - * XXX: this case should add the difference between XX - * the current time and the switch time as above, XX - * but the switch time is inaccessible, so we can't XX - * do the adjustment and will end up with a wrong XX - * runtime. A previous call with a different XX - * curthread may have obtained a (right or wrong) XX - * runtime that is in advance of ours. Just set a XX - * flag to avoid warning about this known problem. XX - */ XX - problemcase = 1; This is the large comment about the bug. It was broken by removing it in r136152. r136152 was mostly by me to introduce rusage_ext, but it seems to have been incomplete -- it even removed the adjustment of td_runtime for curthread. The latter wasn't restored until 7 years later in r244188. XX - } XX - } XX - bintime2timeval(&rt, &tv); XX + bintime2timeval(&ruxp->rux_runtime, &tv); XX tu = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; XX - ptu = p->p_uu + p->p_su + p->p_iu; XX + ptu = ruxp->rux_uu + ruxp->rux_su + ruxp->rux_iu; XX if (tu < ptu) { XX - if (!problemcase) XX - printf( XX -"calcru: runtime went backwards from %ju usec to %ju usec for pid %d (%s)\n", XX - (uintmax_t)ptu, (uintmax_t)tu, p->p_pid, p->p_comm); XX + printf( XX +"calcru1: runtime went backwards from %ju usec (uu = %ju, su = %ju, iu = %ju) to %ju usec for pid %d (%s)\n", XX + (uintmax_t)ptu, XX + (uintmax_t)ruxp->rux_uu, (uintmax_t)ruxp->rux_su, XX + (uintmax_t)ruxp->rux_iu, XX + (uintmax_t)tu, p->p_pid, p->p_comm); XX tu = ptu; XX } XX if ((int64_t)tu < 0) { XX - printf("calcru: negative runtime of %jd usec for pid %d (%s)\n", XX + /* XXX p is only needed to print these diagnostics. */ XX + printf( XX + "calcru1: negative runtime of %jd usec for pid %d (%s)\n", XX (intmax_t)tu, p->p_pid, p->p_comm); XX tu = ptu; -current still has many bugs that let the times go backwards. I don't remember if 'problemcase' gave negative times, but it still occurs and gives garbage times. Userland could do a related negative times check: assert(ki_runtime >= sum of user, sys and interrupt times) often fails because ki_runtime uses a stale rux_runtime time while the sum equals the non-stale rux_runtime (after scaling). Bruce From owner-svn-src-head@freebsd.org Fri Jun 14 13:46:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48DAF15D043C; Fri, 14 Jun 2019 13:46:28 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc32.google.com (mail-yw1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCB486BFBE; Fri, 14 Jun 2019 13:46:27 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc32.google.com with SMTP id k128so1128932ywf.2; Fri, 14 Jun 2019 06:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Cz9AULQQIkEWfSLw7ckiL50Vng161AsoGU5KIkEZ2pE=; b=e/Om5VgARnfq5EnYQbYtJykZ104gIOmHogEJC/F5e9hmxXZ+3W1ZS0x+x51CbI1O9M h89NbAyBbg2mgaEEM00Jt8pFWy/crriMJQHXfuABGBfXmwgsBuFZ/QkrCUW6yET7HfU2 BFakGzJfcHiKu82gv+G0RapnZDT06rU1V8iYm38iMEzrX9liQPPJdxv6n4iz1qMWfVv9 S0VIZ1WVYTiMH+9FQ2IPwt0J8Lhz8tbRQ/FPxpMeTN1x/ewGNBRf5zx29aikTcTabqWh Mehyzvtzou+BDAsoigxmuuWGov1G4hqrEUd+kDZ5TZGyEu4jnwWYEpDBfE87Lh5VK4Om b9eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Cz9AULQQIkEWfSLw7ckiL50Vng161AsoGU5KIkEZ2pE=; b=Cqlq+XrLEk29fFCbTB/jBChG5BrK4K/tHDdlTd4vpAnHd+aCGR1E/wYqqze8+oeTIm H2X/ICMvyoMiTnw4tmdYnhr6/sSrgw3WWhq8rIjbNYAG+1q++QdYWMOpUFNGx2O7WlI1 y2e/+N199c87zp+qLONbIPkQJtyuLDgRmKOoWuZaPCK7TWqkvVzfwpK9DHQXyKXlVlDY MljfYAldqL3OSE2/Q8dUiX7BYqjnFaO5mRWZI+6UEFDBsEkELxgMtrE+GQcJ8BsQ5vrZ m5vkcPJjNdUprn7eRfxBaMTRLH7nLBtauRz+Uti63xVqouCmuyrHelpD+i16rasLW9kJ lrpA== X-Gm-Message-State: APjAAAWUKzwl7WZphezmzkMQBfva0hUgYvMwF0N9zmPd4wDvnvs3+zbb H/ldl9OcBA75/tYhQcQyAeBLntPFvZs= X-Google-Smtp-Source: APXvYqzURJykRZjWZcubkiAHE8rjg3RtRkEJrPWQmZiqM2d9gquHfTgDQYZrtgrJGlkCho6RNHWLUQ== X-Received: by 2002:a81:2fca:: with SMTP id v193mr49508918ywv.296.1560519986798; Fri, 14 Jun 2019 06:46:26 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id r63sm777464ywr.53.2019.06.14.06.46.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jun 2019 06:46:26 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r349029 - head/sys/kern To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906140109.x5E19Aj9087899@repo.freebsd.org> <20190614214154.I1201@besplex.bde.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <399ec4d3-6548-1145-4dea-f0b7850f8381@FreeBSD.org> Date: Fri, 14 Jun 2019 09:46:25 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190614214154.I1201@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCB486BFBE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 13:46:28 -0000 Hi Bruce, On 14.06.2019 08:58, Bruce Evans wrote: > On Fri, 14 Jun 2019, Alexander Motin wrote: > >> Log: >>  Update td_runtime of running thread on each statclock(). >> >>  Normally td_runtime is updated on context switch, but there are some >> kernel >>  threads that due to high absolute priority may run for many seconds >> without >>  context switches (yes, that is bad, but that is true), which means their >>  td_runtime was not updated all that time, that made them invisible >> for top >>  other then as some general CPU usage. >> >>  MFC after:    1 week >>  Sponsored by:    iXsystems, Inc. > > This and more is supposed to be done in calcru().  It is also necessary to > adjust for the current timeslice. > > I thought that calcru() was fixed, but the fix seems to be only in my > version of FreeBSD-5.2. > > The bug seems to be in fill_kinfo_proc_only().  calcru() should update > td_runtime for all threads in the proc (and sum into rux_rutime), ... > td_runtime is updated in one other place: in rufetchtd(), but this function > has the same bug eas everywhere else -- it only updates the runtimes for > curthread. I think it has very simple reason -- now each CPU measures CPU time in its own time units, since cpu_ticks() are not synchronized and can not be compared between different CPUs, so to update td_runtime of another running thread you would need to switch to that CPU, or somehow else get the value (cache it periodically?). I see in your code you are using binuptime() calls instead of cpu_ticks(). I suppose it fixes many problems, since it is globally synchronous, but there was a reason why cpu_ticks() exists -- it is cheaper on system non-synchronized TSC. May be we could reconsider that, giving up on old platforms, expecting all new one to not have this problem, but for right now I think my patch is good enough to make top sane again, that annoyed me for years. -- Alexander Motin From owner-svn-src-head@freebsd.org Fri Jun 14 14:25:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3475215D0D88; Fri, 14 Jun 2019 14:25:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7996D4AE; Fri, 14 Jun 2019 14:25:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 301333DBD9D; Sat, 15 Jun 2019 00:25:05 +1000 (AEST) Date: Sat, 15 Jun 2019 00:25:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349029 - head/sys/kern In-Reply-To: <399ec4d3-6548-1145-4dea-f0b7850f8381@FreeBSD.org> Message-ID: <20190614235433.H1624@besplex.bde.org> References: <201906140109.x5E19Aj9087899@repo.freebsd.org> <20190614214154.I1201@besplex.bde.org> <399ec4d3-6548-1145-4dea-f0b7850f8381@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=-xne-0-MPzg3U2qvO0wA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: 3A7996D4AE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 14:25:10 -0000 On Fri, 14 Jun 2019, Alexander Motin wrote: > On 14.06.2019 08:58, Bruce Evans wrote: >> On Fri, 14 Jun 2019, Alexander Motin wrote: >> >>> Log: >>> =C2=A0Update td_runtime of running thread on each statclock(). >>> >>> =C2=A0Normally td_runtime is updated on context switch, but there are s= ome >>> kernel >>> =C2=A0threads that due to high absolute priority may run for many secon= ds >>> without >>> =C2=A0context switches (yes, that is bad, but that is true), which mean= s their >>> =C2=A0td_runtime was not updated all that time, that made them invisibl= e >>> for top >>> =C2=A0other then as some general CPU usage. >>> >>> =C2=A0MFC after:=C2=A0=C2=A0=C2=A0 1 week >>> =C2=A0Sponsored by:=C2=A0=C2=A0=C2=A0 iXsystems, Inc. >> >> This and more is supposed to be done in calcru().=C2=A0 It is also neces= sary to >> adjust for the current timeslice. >> >> I thought that calcru() was fixed, but the fix seems to be only in my >> version of FreeBSD-5.2. >> >> The bug seems to be in fill_kinfo_proc_only().=C2=A0 calcru() should upd= ate >> td_runtime for all threads in the proc (and sum into rux_rutime), > > ... > >> td_runtime is updated in one other place: in rufetchtd(), but this funct= ion >> has the same bug eas everywhere else -- it only updates the runtimes for >> curthread. > > I think it has very simple reason -- now each CPU measures CPU time in > its own time units, since cpu_ticks() are not synchronized and can not > be compared between different CPUs, so to update td_runtime of another > running thread you would need to switch to that CPU, or somehow else get > the value (cache it periodically?). I forgot about that bugfeature in the cpu ticker. > I see in your code you are using binuptime() calls instead of > cpu_ticks(). I suppose it fixes many problems, since it is globally > synchronous, but there was a reason why cpu_ticks() exists -- it is > cheaper on system non-synchronized TSC. May be we could reconsider > that, giving up on old platforms, expecting all new one to not have this > problem, but for right now I think my patch is good enough to make top > sane again, that annoyed me for years. It was written before the cpu ticker existed. cpu_ticks() exists because bintime() is too slow if the timecounter hardwar= e is too slow. i8254 timecounter hardware takes about 5 usec, ACPI timer about 1 usec, and HPET many hundreds of nsec. And of course, non-synchronized TSCs make the TSC unusable as a timecounter, so require use of a slow timecounter. Some systems don't have a TSC, so they use a timecounter for the cpu ticker anyway. There are many other bugs in the cpu ticker which only became not too bad when P-state invariant TSCs became common. The largest one is that all ticks are scaled at the current cpu ticker frequency. If synchronized P-state invariant TSCs are available, then the cpu ticker reduces to a micro-optimization. My code is used mainly on UP systems with TSC timecounters. I don't have any systems without a TSC, and UP avoids the problems of synchronization, and not throttling the CPU avoids the problem of the frequency changing, and I never noticed the micro-pessimization of using bintime() for the cpu ticker. I never noticed the problem in -current either, though I use my version of SCHED_4BSD with lots of tuning to reduce context switches. The tuning ofte= n results in threads running for a full quantum (100 msec) before switching, but I never noticed threads not switching for several seconds. Bruce From owner-svn-src-head@freebsd.org Fri Jun 14 17:09:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F29DC15ABE0F; Fri, 14 Jun 2019 17:09:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9539471DBC; Fri, 14 Jun 2019 17:09:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6783B1AB96; Fri, 14 Jun 2019 17:09:40 +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 x5EH9eWa079445; Fri, 14 Jun 2019 17:09:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EH9eka079444; Fri, 14 Jun 2019 17:09:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906141709.x5EH9eka079444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Jun 2019 17:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349035 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 349035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9539471DBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 17:09:41 -0000 Author: mav Date: Fri Jun 14 17:09:39 2019 New Revision: 349035 URL: https://svnweb.freebsd.org/changeset/base/349035 Log: Properly align struct multilist_sublist to cache line. Manual Illumos alignment does not fit us due to different kmutex_t size. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Fri Jun 14 15:09:08 2019 (r349034) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Fri Jun 14 17:09:39 2019 (r349035) @@ -44,11 +44,10 @@ struct multilist_sublist { */ list_t mls_list; /* - * Pad to cache line (64 bytes), in an effort to try and prevent - * cache line contention. + * Pad to cache line, in an effort to try and prevent cache line + * contention. */ - uint8_t mls_pad[24]; -}; +} __aligned(CACHE_LINE_SIZE); struct multilist { /* From owner-svn-src-head@freebsd.org Fri Jun 14 19:57:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 200CC15B001E; Fri, 14 Jun 2019 19:57:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3AEC76CA8; Fri, 14 Jun 2019 19:57:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BB3F1C7EF; Fri, 14 Jun 2019 19:57:33 +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 x5EJvXVe065278; Fri, 14 Jun 2019 19:57:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EJvXC7065277; Fri, 14 Jun 2019 19:57:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906141957.x5EJvXC7065277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Jun 2019 19:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349039 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 349039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3AEC76CA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 19:57:34 -0000 Author: mav Date: Fri Jun 14 19:57:32 2019 New Revision: 349039 URL: https://svnweb.freebsd.org/changeset/base/349039 Log: Alike to ZoL disable metaslab allocation tracing code. It is too generous to collect in production debug traces that can only be read with kernel debugger. Illumos includes special code in their mdb debugger to read it, we don't. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Jun 14 19:47:48 2019 (r349038) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Jun 14 19:57:32 2019 (r349039) @@ -259,7 +259,9 @@ int zfs_metaslab_switch_threshold = 2; * Internal switch to enable/disable the metaslab allocation tracing * facility. */ +#ifdef _METASLAB_TRACING boolean_t metaslab_trace_enabled = B_TRUE; +#endif /* * Maximum entries that the metaslab allocation tracing facility will keep @@ -269,7 +271,9 @@ boolean_t metaslab_trace_enabled = B_TRUE; * to every exceed this value. In debug mode, the system will panic if this * limit is ever reached allowing for further investigation. */ +#ifdef _METASLAB_TRACING uint64_t metaslab_trace_max_entries = 5000; +#endif static uint64_t metaslab_weight(metaslab_t *); static void metaslab_set_fragmentation(metaslab_t *); @@ -277,8 +281,9 @@ static void metaslab_free_impl(vdev_t *, uint64_t, uin static void metaslab_check_free_impl(vdev_t *, uint64_t, uint64_t); static void metaslab_passivate(metaslab_t *msp, uint64_t weight); static uint64_t metaslab_weight_from_range_tree(metaslab_t *msp); - +#ifdef _METASLAB_TRACING kmem_cache_t *metaslab_alloc_trace_cache; +#endif /* * ========================================================================== @@ -2797,6 +2802,7 @@ metaslab_distance(metaslab_t *msp, dva_t *dva) * Metaslab allocation tracing facility * ========================================================================== */ +#ifdef _METASLAB_TRACING kstat_t *metaslab_trace_ksp; kstat_named_t metaslab_trace_over_limit; @@ -2900,6 +2906,32 @@ metaslab_trace_fini(zio_alloc_list_t *zal) list_destroy(&zal->zal_list); zal->zal_size = 0; } + +#else + +#define metaslab_trace_add(zal, mg, msp, psize, id, off, alloc) + +void +metaslab_alloc_trace_init(void) +{ +} + +void +metaslab_alloc_trace_fini(void) +{ +} + +void +metaslab_trace_init(zio_alloc_list_t *zal) +{ +} + +void +metaslab_trace_fini(zio_alloc_list_t *zal) +{ +} + +#endif /* _METASLAB_TRACING */ /* * ========================================================================== From owner-svn-src-head@freebsd.org Fri Jun 14 20:04:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E16215B0264; Fri, 14 Jun 2019 20:04:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04AE4770E5; Fri, 14 Jun 2019 20:04: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D04231C99D; Fri, 14 Jun 2019 20:04:28 +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 x5EK4S3F070486; Fri, 14 Jun 2019 20:04:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EK4SeW070485; Fri, 14 Jun 2019 20:04:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906142004.x5EK4SeW070485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Jun 2019 20:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349040 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 349040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 04AE4770E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 20:04:29 -0000 Author: mav Date: Fri Jun 14 20:04:28 2019 New Revision: 349040 URL: https://svnweb.freebsd.org/changeset/base/349040 Log: Minimize aggsum_compare(&arc_size, arc_c) calls. For busy ARC situation when arc_size close to arc_c is desired. But then it is quite likely that aggsum_compare(&arc_size, arc_c) will need to flush per-CPU buckets to find exact comparison result. Doing that often in a hot path penalizes whole idea of aggsum usage there, since it replaces few simple atomic additions with dozens of lock acquisitions. Replacing aggsum_compare() with aggsum_upper_bound() in code increasing arc_p when ARC is growing (arc_size < arc_c) according to PMC profiles allows to save ~5% of CPU time in aggsum code during sequential write to 12 ZVOLs with 16KB block size on large dual-socket system. I suppose there some minor arc_p behavior change due to lower precision of the new code, but I don't think it is a big deal, since it should affect only very small window in time (aggsum buckets are flushed every second) and in ARC size (buckets are limited to 10 average ARC blocks per CPU). MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 14 19:57:32 2019 (r349039) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 14 20:04:28 2019 (r349040) @@ -5269,7 +5269,7 @@ arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, v * If we are growing the cache, and we are adding anonymous * data, and we have outgrown arc_p, update arc_p */ - if (aggsum_compare(&arc_size, arc_c) < 0 && + if (aggsum_upper_bound(&arc_size) < arc_c && hdr->b_l1hdr.b_state == arc_anon && (refcount_count(&arc_anon->arcs_size) + refcount_count(&arc_mru->arcs_size) > arc_p)) From owner-svn-src-head@freebsd.org Fri Jun 14 20:35:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFB9815B0D8C; Fri, 14 Jun 2019 20:35:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9265F80543; Fri, 14 Jun 2019 20:35:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B8C31CEAB; Fri, 14 Jun 2019 20:35:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5EKZcVA086343; Fri, 14 Jun 2019 20:35:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EKZcwY086342; Fri, 14 Jun 2019 20:35:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906142035.x5EKZcwY086342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 14 Jun 2019 20:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349041 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 349041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9265F80543 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 20:35:39 -0000 Author: asomers Date: Fri Jun 14 20:35:37 2019 New Revision: 349041 URL: https://svnweb.freebsd.org/changeset/base/349041 Log: open(2): fix the description of O_FSYNC The man page claims that with O_FSYNC (aka O_SYNC) the kernel will not cache written data. However, that's not true. Nor does POSIX require it. Perhaps it was true when that section of the man page was written in r69336 (I haven't checked). But it's not true now. Now the effect is simply that writes are sent to disk immediately and synchronously, but they're still cached. See also: https://pubs.opengroup.org/onlinepubs/9699919799/ See also: ffs_write in sys/ufs/ffs/ffs_vnops.c Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20641 Modified: head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Fri Jun 14 20:04:28 2019 (r349040) +++ head/lib/libc/sys/open.2 Fri Jun 14 20:35:37 2019 (r349041) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd November 11, 2018 +.Dd June 14, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -224,10 +224,7 @@ The descriptor remains in non-blocking mode for subseq If .Dv O_FSYNC is used in the mask, all writes will -immediately be written to disk, -the kernel will not cache written data -and all writes on the descriptor will not return until -the data to be written completes. +immediately and synchronously be written to disk. .Pp .Dv O_SYNC is a synonym for From owner-svn-src-head@freebsd.org Fri Jun 14 22:06:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD7F415B2A7E; Fri, 14 Jun 2019 22:06:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 616C182E3E; Fri, 14 Jun 2019 22:06:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3492C1DDE6; Fri, 14 Jun 2019 22:06:44 +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 x5EM6i2i031199; Fri, 14 Jun 2019 22:06:44 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5EM6i9W031198; Fri, 14 Jun 2019 22:06:44 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906142206.x5EM6i9W031198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 14 Jun 2019 22:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349042 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 616C182E3E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 22:06:44 -0000 Author: alc Date: Fri Jun 14 22:06:43 2019 New Revision: 349042 URL: https://svnweb.freebsd.org/changeset/base/349042 Log: Batch the TLB invalidations that are performed by pmap_protect() rather than performing them one at a time. MFC after: 10 days Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Jun 14 20:35:37 2019 (r349041) +++ head/sys/arm64/arm64/pmap.c Fri Jun 14 22:06:43 2019 (r349042) @@ -2791,8 +2791,15 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { l3 = pmap_load(l3p); - if (!pmap_l3_valid(l3)) + if (!pmap_l3_valid(l3)) { + if (va != va_next) { + pmap_invalidate_range(pmap, va, sva); + va = va_next; + } continue; + } + if (va == va_next) + va = sva; nbits = 0; if ((prot & VM_PROT_WRITE) == 0) { @@ -2807,9 +2814,9 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t nbits |= ATTR_XN; pmap_set(l3p, nbits); - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, sva); } + if (va != va_next) + pmap_invalidate_range(pmap, va, sva); } PMAP_UNLOCK(pmap); } From owner-svn-src-head@freebsd.org Fri Jun 14 23:53:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E32615B47C3; Fri, 14 Jun 2019 23:53:20 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBC6E85783; Fri, 14 Jun 2019 23:53:19 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0BA91F03C; Fri, 14 Jun 2019 23:53:19 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5ENrJYp088580; Fri, 14 Jun 2019 23:53:19 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5ENrJhF088579; Fri, 14 Jun 2019 23:53:19 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201906142353.x5ENrJhF088579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Fri, 14 Jun 2019 23:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349043 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 349043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBC6E85783 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 14 Jun 2019 23:53:20 -0000 Author: grog Date: Fri Jun 14 23:53:19 2019 New Revision: 349043 URL: https://svnweb.freebsd.org/changeset/base/349043 Log: Edvard Hagerup Grieg parses as given name, mother's maiden name, surname Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Fri Jun 14 22:06:43 2019 (r349042) +++ head/usr.bin/calendar/calendars/calendar.birthday Fri Jun 14 23:53:19 2019 (r349043) @@ -161,7 +161,7 @@ 06/07 Alan Mathison Turing died, 1954 06/08 Frank Lloyd Wright born in Richland Center, Wisconsin, 1867 06/13 Alexander the Great dies (323BC) -06/15 Edward (Edvard Hagerup) Grieg born in Bergen, Norway, 1843 +06/15 Edvard Hagerup Grieg born in Bergen, Norway, 1843 06/16 Hammurabi the Great dies, Babylon, 1686 BC 06/18 M.C. Escher born, 1898 06/19 FreeBSD project born, 1993 From owner-svn-src-head@freebsd.org Sat Jun 15 00:47:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3F015B5972; Sat, 15 Jun 2019 00:47:40 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A20A386B85; Sat, 15 Jun 2019 00:47:39 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778341F8A3; Sat, 15 Jun 2019 00:47:39 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5F0ldnP014740; Sat, 15 Jun 2019 00:47:39 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F0ld3V014739; Sat, 15 Jun 2019 00:47:39 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201906150047.x5F0ld3V014739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Sat, 15 Jun 2019 00:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349044 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: julian X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 349044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A20A386B85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 00:47:40 -0000 Author: julian Date: Sat Jun 15 00:47:39 2019 New Revision: 349044 URL: https://svnweb.freebsd.org/changeset/base/349044 Log: Lightly hide the 'var' inside the macros to read the arm special registers. I just happenned to have 3rd party code using 'var' as the output variable which drew my attention to this. variables defined inside macros should be prefixed to avoid getting shadowed varable wanrings from clang. Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Fri Jun 14 23:53:19 2019 (r349043) +++ head/sys/arm64/include/armreg.h Sat Jun 15 00:47:39 2019 (r349044) @@ -36,12 +36,12 @@ #define INSN_SIZE 4 #define READ_SPECIALREG(reg) \ -({ uint64_t val; \ - __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (val)); \ - val; \ +({ uint64_t _val; \ + __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (_val)); \ + _val; \ }) -#define WRITE_SPECIALREG(reg, val) \ - __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)val)) +#define WRITE_SPECIALREG(reg, _val) \ + __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)_val)) /* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ #define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ From owner-svn-src-head@freebsd.org Sat Jun 15 04:30:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 188B615BB488; Sat, 15 Jun 2019 04:30:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A561E8D057; Sat, 15 Jun 2019 04:30:13 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B34521F04; Sat, 15 Jun 2019 04:30:13 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5F4UDOD031216; Sat, 15 Jun 2019 04:30:13 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F4UDVX031215; Sat, 15 Jun 2019 04:30:13 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906150430.x5F4UDVX031215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 15 Jun 2019 04:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349046 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A561E8D057 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 04:30:14 -0000 Author: dougm Date: Sat Jun 15 04:30:13 2019 New Revision: 349046 URL: https://svnweb.freebsd.org/changeset/base/349046 Log: Critical comments were lost in r349203. This patch seeks to restore the lost information in new comments. Reported by: alc Reviewed by: alc Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20632 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jun 15 01:27:49 2019 (r349045) +++ head/sys/vm/vm_map.c Sat Jun 15 04:30:13 2019 (r349046) @@ -2186,17 +2186,22 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->end > start && entry->start < start, ("_vm_map_clip_start: invalid clip of entry %p", entry)); + vm_map_simplify_entry(map, entry); /* - * Split off the front portion -- note that we must insert the new - * entry BEFORE this one, so that this entry has the specified - * starting address. + * Create a backing object now, if none exists, so that more individual + * objects won't be created after the map entry is split. */ - vm_map_simplify_entry(map, entry); vm_map_entry_charge_object(map, entry); + + /* Clone the entry. */ new_entry = vm_map_entry_create(map); *new_entry = *entry; + /* + * Split off the front portion. Insert the new entry BEFORE this one, + * so that this entry has the specified starting address. + */ new_entry->end = start; entry->offset += (start - entry->start); entry->start = start; @@ -2244,14 +2249,20 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v KASSERT(entry->start < end && entry->end > end, ("_vm_map_clip_end: invalid clip of entry %p", entry)); - /* - * Create a new entry and insert it AFTER the specified entry + * Create a backing object now, if none exists, so that more individual + * objects won't be created after the map entry is split. */ vm_map_entry_charge_object(map, entry); + + /* Clone the entry. */ new_entry = vm_map_entry_create(map); *new_entry = *entry; + /* + * Split off the back portion. Insert the new entry AFTER this one, + * so that this entry has the specified ending address. + */ new_entry->start = entry->end = end; new_entry->offset += (end - entry->start); if (new_entry->cred != NULL) From owner-svn-src-head@freebsd.org Sat Jun 15 05:30:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD76015BC789 for ; Sat, 15 Jun 2019 05:30:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc30.google.com (mail-yw1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 448008EA98 for ; Sat, 15 Jun 2019 05:30:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc30.google.com with SMTP id m16so2054019ywh.12 for ; Fri, 14 Jun 2019 22:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RZOG7jW1CErgGwaGRMSLroVshSPVet3qOk+9l7YUpf0=; b=TI+4R/WWptlrRVkmvGM2WQcF4yBwPtMosuWXK4SH1ItLh+WArmiCWAoC3E5tfvF8rd T4sM4c/+D8w1zu1ExPfs8j1J1Mzc5XAtSDQC+ymizChgJmCoXp28yS9+FEN3C+jyaWuj TnkJpii6cjBiujxMgkGUOXfOhNKhlokxh3b/Np2T9/50Ct58AS1p6tbcG0n0soT5q5kY FwIqaBFn0ourMGDno6hfZsqUxV0cOo/3dgHunqaH4EChwLrrh5wQkiWCZcgJxC9u4HP4 con805YEb1ueKtgGey2FodiODGEBKrp3KKeDZ9KA4OuEuxvrS+ItaHDuFeULbh88KYVc mCjg== 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=RZOG7jW1CErgGwaGRMSLroVshSPVet3qOk+9l7YUpf0=; b=gdAIuUfFB5g625caaNdJp35rZQ9Yt2W8ZgmEp7o2tfHl2XXU0ko0O/f0RpJSmxiBNl Ig3OQ3UA1O5UY3ofPpNI4orA+ALCsTyW8GYhZnOp8LdVkhBcSu/8n4I5xJQltK+wzq+r eyX+4s962Xo1m+FwN03lirRk2gpcdub/aNWlECmdMS1qc8H2a46HvlVbBcVuC6Etpklr DgQXAdxrQF/0JV6WYK86n9OCwyXNhY79G5yVwLEltgmGrxoTdBICPK7t7WIsQGDKztms 93zoafgiBfCdGuwwFhBo8koyvtGbo0Ydq9k2qRwNl5pfTMVxvmbRiRXGm670IyRGwNYJ b3Ig== X-Gm-Message-State: APjAAAWZUm22irOAc5Ev/U1VH8XgXwRNCwrknwuQyEynNRZlHKTM5RBX AyRivkiRYl5V8Sk3Kf/xBLGbwjKJuG2CxAfDJVwm3w== X-Google-Smtp-Source: APXvYqzzJtQnCybgWGZCKITg6hALyGeUhS4Si5eXXiRneK1KoX/7W0be9mNO3HB3S49N2BjjkwQ9iPj7sf2+IS9WxRs= X-Received: by 2002:a81:7d07:: with SMTP id y7mr6938813ywc.377.1560576658426; Fri, 14 Jun 2019 22:30:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:4a86:0:0:0:0:0 with HTTP; Fri, 14 Jun 2019 22:30:57 -0700 (PDT) In-Reply-To: <201906150430.x5F4UDVX031215@repo.freebsd.org> References: <201906150430.x5F4UDVX031215@repo.freebsd.org> From: Oliver Pinter Date: Sat, 15 Jun 2019 07:30:57 +0200 Message-ID: Subject: Re: svn commit: r349046 - head/sys/vm To: Doug Moore Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 448008EA98 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 05:31:00 -0000 On Saturday, June 15, 2019, Doug Moore wrote: > Author: dougm > Date: Sat Jun 15 04:30:13 2019 > New Revision: 349046 > URL: https://svnweb.freebsd.org/changeset/base/349046 > > Log: > Critical comments were lost in r349203. This patch seeks to restore > the lost information in new comments. > > Reported by: alc > Reviewed by: alc > Approved by: kib (mentor) > Differential Revision: https://reviews.freebsd.org/D20632 > > Modified: > head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================ > ================== > --- head/sys/vm/vm_map.c Sat Jun 15 01:27:49 2019 (r349045) > +++ head/sys/vm/vm_map.c Sat Jun 15 04:30:13 2019 (r349046) > @@ -2186,17 +2186,22 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t > entry, > VM_MAP_ASSERT_LOCKED(map); > KASSERT(entry->end > start && entry->start < start, > ("_vm_map_clip_start: invalid clip of entry %p", entry)); > + vm_map_simplify_entry(map, entry); Hi! This isn't just comment. > > /* > - * Split off the front portion -- note that we must insert the new > - * entry BEFORE this one, so that this entry has the specified > - * starting address. > + * Create a backing object now, if none exists, so that more > individual > + * objects won't be created after the map entry is split. > */ > - vm_map_simplify_entry(map, entry); > vm_map_entry_charge_object(map, entry); > + > + /* Clone the entry. */ > new_entry = vm_map_entry_create(map); > *new_entry = *entry; > > + /* > + * Split off the front portion. Insert the new entry BEFORE this > one, > + * so that this entry has the specified starting address. > + */ > new_entry->end = start; > entry->offset += (start - entry->start); > entry->start = start; > @@ -2244,14 +2249,20 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t > entry, v > KASSERT(entry->start < end && entry->end > end, > ("_vm_map_clip_end: invalid clip of entry %p", entry)); > > - > /* > - * Create a new entry and insert it AFTER the specified entry > + * Create a backing object now, if none exists, so that more > individual > + * objects won't be created after the map entry is split. > */ > vm_map_entry_charge_object(map, entry); > + > + /* Clone the entry. */ > new_entry = vm_map_entry_create(map); > *new_entry = *entry; > > + /* > + * Split off the back portion. Insert the new entry AFTER this > one, > + * so that this entry has the specified ending address. > + */ > new_entry->start = entry->end = end; > new_entry->offset += (end - entry->start); > if (new_entry->cred != NULL) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Jun 15 05:44:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0821115BCC5B; Sat, 15 Jun 2019 05:44:54 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFCB8F17F; Sat, 15 Jun 2019 05:44:53 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-oi1-x236.google.com with SMTP id g7so3517598oia.8; Fri, 14 Jun 2019 22:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=X+Wojb+5EQe9Hu8Aykaa6blD1gyJPIkWCeCPNX6DwCE=; b=ozD1KyKlKrW3hW26fAkwaR/fEKUfDwTRNn6LzIWyenKYDUft1QNExSIgo0MsgU0Bsu dat1jUI/kyUO6jL6Qpt+vjYg65elsBEKmienZhQJZyqYheQER5YsXQBAD3YLfTZrA4WD P4A+dQ2H3KMqv6uYWSugVnsivl+HcXvK6JYHBAC4kiRp8gC+oXstYSVwFfDBZlLalvql TDWLJhCkSlR7jKvF5FnvlNY0xZBGlbzzCXrdH0c4xd82PA4t72Lk2E3B5MNPfNsetHbd 0OK50APgiGvPgX78jz8GXqomiqPDzk+mayEaKXxQRKi4lobjJosoA0L+22k7Y2bcBgkA 3aJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=X+Wojb+5EQe9Hu8Aykaa6blD1gyJPIkWCeCPNX6DwCE=; b=ruzBSSRMDReh8KAZ9ZsM7a6bUthhjC4kk6d/ouWPzDnxJeR+ml5QcskUT/KqBM0vl7 TF8b0ICJA9J4RO5oL+aNTqUuQ4Ja7KOs20e48eYRLi25nrTHIgdiG8XgjsfEPqSY3Q7c pQVAfRL9fGckP3bqvZ6CK2uYpaUyNd4uTLIGVtZDKqJvnvRE5dlPS4NW9AI9p4k07Cv6 LSEZNgsNSPVmi2kGwNwt+fcdY2Uc+O4nmnUuIEXCBUQYuvWg6q5TuLoDhbvDVJ93FaB2 v8zf22Tc8txtiq7+niR6OHBeqpJMnizkKfd//iWUgjbK4Vd4ok15eE3Ssacpox4oEHCW SdHA== X-Gm-Message-State: APjAAAXGlwt3nzgxwRJ/gH9N0Blv5fa6HzITB75/Z2lslnHVlughh9kC 8mqbyH1ydDHVDaUytjZfqRQdpIxV X-Google-Smtp-Source: APXvYqyWQGAYC6HEzbFJjKtXz9/R1lM+JxR6+nMsM8rW3losYXeFSQRpQH9VpGkmMIDOi4nf5vO3Gw== X-Received: by 2002:aca:b40b:: with SMTP id d11mr4164684oif.56.1560577492407; Fri, 14 Jun 2019 22:44:52 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id m72sm97791oig.14.2019.06.14.22.44.51 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jun 2019 22:44:51 -0700 (PDT) From: Doug Moore X-Google-Original-From: Doug Moore Subject: Re: svn commit: r349046 - head/sys/vm To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201906150430.x5F4UDVX031215@repo.freebsd.org> Message-ID: Date: Sat, 15 Jun 2019 00:44:50 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 8DFCB8F17F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 05:44:54 -0000 The patch makes it appear that a call to vm_map_simplify_entry has been removed, and that another has been added.  They are the same call, just moved from after a comment to before it. Doug Moore On 6/15/19 12:30 AM, Oliver Pinter wrote: > > > On Saturday, June 15, 2019, Doug Moore > wrote: > > Author: dougm > Date: Sat Jun 15 04:30:13 2019 > New Revision: 349046 > URL: https://svnweb.freebsd.org/changeset/base/349046 > > > Log: >   Critical comments were lost in r349203. This patch seeks to restore >   the lost information in new comments. > >   Reported by: alc >   Reviewed by: alc >   Approved by: kib (mentor) >   Differential Revision: https://reviews.freebsd.org/D20632 > > > Modified: >   head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c        Sat Jun 15 01:27:49 2019        > (r349045) > +++ head/sys/vm/vm_map.c        Sat Jun 15 04:30:13 2019        > (r349046) > @@ -2186,17 +2186,22 @@ _vm_map_clip_start(vm_map_t map, > vm_map_entry_t entry, >         VM_MAP_ASSERT_LOCKED(map); >         KASSERT(entry->end > start && entry->start < start, >             ("_vm_map_clip_start: invalid clip of entry %p", entry)); > +       vm_map_simplify_entry(map, entry); > > > Hi!  > > This isn't just comment.  >   > > >         /* > -        * Split off the front portion -- note that we must insert > the new > -        * entry BEFORE this one, so that this entry has the specified > -        * starting address. > +        * Create a backing object now, if none exists, so that > more individual > +        * objects won't be created after the map entry is split. >          */ > -       vm_map_simplify_entry(map, entry); >         vm_map_entry_charge_object(map, entry); > + > +       /* Clone the entry. */ >         new_entry = vm_map_entry_create(map); >         *new_entry = *entry; > > +       /* > +        * Split off the front portion.  Insert the new entry > BEFORE this one, > +        * so that this entry has the specified starting address. > +        */ >         new_entry->end = start; >         entry->offset += (start - entry->start); >         entry->start = start; > @@ -2244,14 +2249,20 @@ _vm_map_clip_end(vm_map_t map, > vm_map_entry_t entry, v >         KASSERT(entry->start < end && entry->end > end, >             ("_vm_map_clip_end: invalid clip of entry %p", entry)); > > - >         /* > -        * Create a new entry and insert it AFTER the specified entry > +        * Create a backing object now, if none exists, so that > more individual > +        * objects won't be created after the map entry is split. >          */ >         vm_map_entry_charge_object(map, entry); > + > +       /* Clone the entry. */ >         new_entry = vm_map_entry_create(map); >         *new_entry = *entry; > > +       /* > +        * Split off the back portion.  Insert the new entry AFTER > this one, > +        * so that this entry has the specified ending address. > +        */ >         new_entry->start = entry->end = end; >         new_entry->offset += (end - entry->start); >         if (new_entry->cred != NULL) > _______________________________________________ > svn-src-head@freebsd.org  mailing > list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-head@freebsd.org Sat Jun 15 06:51:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518B515BE3BA; Sat, 15 Jun 2019 06:51:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E823B6A0E0; Sat, 15 Jun 2019 06:51:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1B4F236FC; Sat, 15 Jun 2019 06:51:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5F6pkdR005862; Sat, 15 Jun 2019 06:51:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F6pklf005861; Sat, 15 Jun 2019 06:51:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906150651.x5F6pklf005861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 15 Jun 2019 06:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349047 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 349047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E823B6A0E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 06:51:47 -0000 Author: delphij Date: Sat Jun 15 06:51:46 2019 New Revision: 349047 URL: https://svnweb.freebsd.org/changeset/base/349047 Log: Blankspace. No actual code change. MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sat Jun 15 04:30:13 2019 (r349046) +++ head/sbin/fsck_msdosfs/boot.c Sat Jun 15 06:51:46 2019 (r349047) @@ -49,7 +49,7 @@ readboot(int dosfs, struct bootblock *boot) u_char backup[DOSBOOTBLOCKSIZE]; int ret = FSOK; int i; - + if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { perr("could not read boot block"); return FSFATAL; @@ -219,7 +219,7 @@ readboot(int dosfs, struct bootblock *boot) boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / boot->bpbSecPerClust; - if (boot->flags&FAT32) + if (boot->flags & FAT32) boot->ClustMask = CLUST32_MASK; else if (boot->NumClusters < (CLUST_RSRVD&CLUST12_MASK)) boot->ClustMask = CLUST12_MASK; From owner-svn-src-head@freebsd.org Sat Jun 15 07:23:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1444715BECA8; Sat, 15 Jun 2019 07:23:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF5256AD26; Sat, 15 Jun 2019 07:23:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8774D23D45; Sat, 15 Jun 2019 07:23:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5F7N6eW024309; Sat, 15 Jun 2019 07:23:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F7N6ZY024308; Sat, 15 Jun 2019 07:23:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906150723.x5F7N6ZY024308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 15 Jun 2019 07:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349048 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 349048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF5256AD26 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 07:23:07 -0000 Author: delphij Date: Sat Jun 15 07:23:06 2019 New Revision: 349048 URL: https://svnweb.freebsd.org/changeset/base/349048 Log: In ask(): override default option if any of alwaysyes/alwaysno/rdonly is set. MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/main.c Modified: head/sbin/fsck_msdosfs/main.c ============================================================================== --- head/sbin/fsck_msdosfs/main.c Sat Jun 15 06:51:46 2019 (r349047) +++ head/sbin/fsck_msdosfs/main.c Sat Jun 15 07:23:06 2019 (r349048) @@ -129,9 +129,10 @@ ask(int def, const char *fmt, ...) char prompt[256]; int c; + if (alwaysyes || alwaysno || rdonly) + def = (alwaysyes && !rdonly && !alwaysno); + if (preen) { - if (rdonly) - def = 0; if (def) printf("FIXED\n"); return def; @@ -140,9 +141,9 @@ ask(int def, const char *fmt, ...) va_start(ap, fmt); vsnprintf(prompt, sizeof(prompt), fmt, ap); va_end(ap); - if (alwaysyes || rdonly) { - printf("%s? %s\n", prompt, rdonly ? "no" : "yes"); - return !rdonly; + if (alwaysyes || alwaysno || rdonly) { + printf("%s? %s\n", prompt, def ? "yes" : "no"); + return def; } do { printf("%s? [yn] ", prompt); From owner-svn-src-head@freebsd.org Sat Jun 15 09:15:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 611C115C195C; Sat, 15 Jun 2019 09:15:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 058A36E246; Sat, 15 Jun 2019 09:15:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4E2124FC9; Sat, 15 Jun 2019 09:15:58 +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 x5F9FwIh082541; Sat, 15 Jun 2019 09:15:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F9FwN6082540; Sat, 15 Jun 2019 09:15:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906150915.x5F9FwN6082540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 15 Jun 2019 09:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349049 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 058A36E246 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 09:15:59 -0000 Author: emaste Date: Sat Jun 15 09:15:58 2019 New Revision: 349049 URL: https://svnweb.freebsd.org/changeset/base/349049 Log: vtfontcvt: add comments in add_glyph During review for PR 205707. Event: Berlin Devsummit 2019 Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 15 07:23:06 2019 (r349048) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 15 09:15:58 2019 (r349049) @@ -176,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, glyph_total++; glyph_count[map_idx]++; + /* Return existing glyph if we have an identical one. */ hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH; SLIST_FOREACH(gl, &glyph_hash[hash], g_hash) { if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { @@ -184,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, } } + /* Allocate new glyph. */ gl = xmalloc(sizeof *gl); gl->g_data = xmalloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); From owner-svn-src-head@freebsd.org Sat Jun 15 09:45:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CBF15C267E; Sat, 15 Jun 2019 09:45:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84BD6F49A; Sat, 15 Jun 2019 09:45:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAF53254CE; Sat, 15 Jun 2019 09:45:00 +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 x5F9j0Bg098446; Sat, 15 Jun 2019 09:45:00 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5F9j0TT098445; Sat, 15 Jun 2019 09:45:00 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906150945.x5F9j0TT098445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 15 Jun 2019 09:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349054 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 349054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E84BD6F49A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 09:45:01 -0000 Author: marius Date: Sat Jun 15 09:45:00 2019 New Revision: 349054 URL: https://svnweb.freebsd.org/changeset/base/349054 Log: Add required for libnv to SYSINCS, too, apparently missed in r336335. Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Sat Jun 15 09:30:11 2019 (r349053) +++ head/tools/build/Makefile Sat Jun 15 09:45:00 2019 (r349054) @@ -70,7 +70,8 @@ SUBDIR= cross-build .endif # Needed to build config (since it uses libnv) -SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h +SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \ + ${SRCTOP}/sys/sys/dnv.h # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't # accidentally run tools that are incompatible but happen to be in $PATH. From owner-svn-src-head@freebsd.org Sat Jun 15 11:07:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9D315C4296; Sat, 15 Jun 2019 11:07:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2083671743; Sat, 15 Jun 2019 11:07:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E999E26225; Sat, 15 Jun 2019 11:07:41 +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 x5FB7f64039971; Sat, 15 Jun 2019 11:07:41 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FB7f6N039968; Sat, 15 Jun 2019 11:07:41 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906151107.x5FB7f6N039968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 15 Jun 2019 11:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349055 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2083671743 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 11:07:42 -0000 Author: marius Date: Sat Jun 15 11:07:41 2019 New Revision: 349055 URL: https://svnweb.freebsd.org/changeset/base/349055 Log: - Replace unused and only ever written to members of public iflib(9) structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES etc. are also only ever used for these write-only members if at all, so both these macros and members can just go). Using these spares may render it possible to merge certain iflib(9) fixes to stable/12. Otherwise, changes extending struct if_irq or struct if_shared_ctx in any way would break KBI as instances of these are allocated by the driver front-ends (by contrast, struct if_pkt_info as well as struct if_softc_ctx instances are provided by iflib(9) and, thus, may grow at least at the end without breaking KBI). - Make the pvi_name in struct pci_vendor_info const char * as device identifiers in hardware lookup tables aren't to be expected to ever change at runtime. - Similarly, make the pci_vendor_info_t of struct if_shared_ctx which is used to point to the struct pci_vendor_info arrays provided by the driver front-ends const. - Remove the ETH_ADDR_LEN macro from iflib.h; this was duplicating ETHER_ADDR_LEN of with iflib(9) actually only consuming the latter macro. - Make the name argument of iflib_io_tqg_attach(9) const, matching the taskqgroup_attach_cpu(9) this function wraps as well as e. g. iflib_config_gtask_init(9). - Remove the orphaned iflib_qset_lock_get() prototype. - Remove some extraneous empty lines. Modified: head/sys/net/iflib.c head/sys/net/iflib.h head/sys/net/iflib_private.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Jun 15 09:45:00 2019 (r349054) +++ head/sys/net/iflib.c Sat Jun 15 11:07:41 2019 (r349055) @@ -376,7 +376,6 @@ struct iflib_fl { uint64_t ifl_cl_dequeued; #endif /* implicit pad */ - bitstr_t *ifl_rx_bitmap; qidx_t ifl_fragidx; /* constant */ @@ -1250,7 +1249,6 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t tx #define netmap_rx_irq(ifp, qid, budget) (0) #define netmap_tx_irq(ifp, qid) do {} while (0) #define iflib_netmap_timer_adjust(ctx, txq, reset_on) - #endif #if defined(__i386__) || defined(__amd64__) @@ -1537,17 +1535,17 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, driver_filter_t filter, driver_intr_t handler, void *arg, const char *name) { - int rc, flags; struct resource *res; void *tag = NULL; device_t dev = ctx->ifc_dev; + int flags, i, rc; flags = RF_ACTIVE; if (ctx->ifc_flags & IFC_LEGACY) flags |= RF_SHAREABLE; MPASS(rid < 512); - irq->ii_rid = rid; - res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq->ii_rid, flags); + i = rid; + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, flags); if (res == NULL) { device_printf(dev, "failed to allocate IRQ for rid %d, name %s.\n", rid, name); @@ -1569,7 +1567,6 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, return (0); } - /********************************************************************* * * Allocate DMA resources for TX buffers as well as memory for the TX @@ -4332,12 +4329,10 @@ iflib_led_func(void *arg, int onoff) int iflib_device_probe(device_t dev) { - pci_vendor_info_t *ent; - - uint16_t pci_vendor_id, pci_device_id; - uint16_t pci_subvendor_id, pci_subdevice_id; - uint16_t pci_rev_id; + const pci_vendor_info_t *ent; if_shared_ctx_t sctx; + uint16_t pci_device_id, pci_rev_id, pci_subdevice_id, pci_subvendor_id; + uint16_t pci_vendor_id; if ((sctx = DEVICE_REGISTER(dev)) == NULL || sctx->isc_magic != IFLIB_MAGIC) return (ENOTSUP); @@ -4397,8 +4392,6 @@ iflib_reset_qvalues(if_ctx_t ctx) device_t dev = ctx->ifc_dev; int i; - scctx->isc_txrx_budget_bytes_max = IFLIB_MAX_TX_BYTES; - scctx->isc_tx_qdepth = IFLIB_DEFAULT_TX_QDEPTH; if (ctx->ifc_sysctl_ntxqs != 0) scctx->isc_ntxqsets = ctx->ifc_sysctl_ntxqs; if (ctx->ifc_sysctl_nrxqs != 0) @@ -6037,15 +6030,14 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte struct resource *res; struct taskqgroup *tqg; gtask_fn_t *fn; - int tqrid; void *q; - int err; + int err, tqrid; q = &ctx->ifc_rxqs[0]; info = &rxq[0].ifr_filter_info; gtask = &rxq[0].ifr_task; tqg = qgroup_if_io_tqg; - tqrid = irq->ii_rid = *rid; + tqrid = *rid; fn = _task_fn_rx; ctx->ifc_flags |= IFC_LEGACY; @@ -6112,7 +6104,7 @@ iflib_iov_intr_deferred(if_ctx_t ctx) } void -iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, char *name) +iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, const char *name) { taskqgroup_attach_cpu(qgroup_if_io_tqg, gt, uniq, cpu, NULL, NULL, Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Sat Jun 15 09:45:00 2019 (r349054) +++ head/sys/net/iflib.h Sat Jun 15 11:07:41 2019 (r349055) @@ -132,12 +132,12 @@ typedef struct if_pkt_info { uint8_t ipi_mflags; /* packet mbuf flags */ uint32_t ipi_tcp_seq; /* tcp seqno */ - uint32_t ipi_tcp_sum; /* tcp csum */ + uint32_t __spare0__; } *if_pkt_info_t; typedef struct if_irq { struct resource *ii_res; - int ii_rid; + int __spare0__; void *ii_tag; } *if_irq_t; @@ -166,7 +166,7 @@ typedef struct pci_vendor_info { uint32_t pvi_subdevice_id; uint32_t pvi_rev_id; uint32_t pvi_class_mask; - caddr_t pvi_name; + const char *pvi_name; } pci_vendor_info_t; #define PVID(vendor, devid, name) {vendor, devid, 0, 0, 0, 0, name} @@ -194,9 +194,8 @@ typedef struct if_softc_ctx { int isc_vectors; int isc_nrxqsets; int isc_ntxqsets; - uint8_t isc_min_tx_latency; /* disable doorbell update batching */ - uint8_t isc_rx_mvec_enable; /* generate mvecs on rx */ - uint32_t isc_txrx_budget_bytes_max; + uint16_t __spare0__; + uint32_t __spare1__; int isc_msix_bar; /* can be model specific - initialize in attach_pre */ int isc_tx_nsegments; /* can be model specific - initialize in attach_pre */ int isc_ntxd[8]; @@ -218,20 +217,25 @@ typedef struct if_softc_ctx { int isc_rss_table_mask; int isc_nrxqsets_max; int isc_ntxqsets_max; - uint32_t isc_tx_qdepth; + uint32_t __spare2__; iflib_intr_mode_t isc_intr; uint16_t isc_max_frame_size; /* set at init time by driver */ uint16_t isc_min_frame_size; /* set at init time by driver, only used if IFLIB_NEED_ETHER_PAD is set. */ uint32_t isc_pause_frames; /* set by driver for iflib_timer to detect */ - pci_vendor_info_t isc_vendor_info; /* set by iflib prior to attach_pre */ + uint32_t __spare3__; + uint32_t __spare4__; + uint32_t __spare5__; + uint32_t __spare6__; + uint32_t __spare7__; + uint32_t __spare8__; + caddr_t __spare9__; int isc_disable_msix; if_txrx_t isc_txrx; struct ifmedia *isc_media; } *if_softc_ctx_t; - /* * Initialization values for device */ @@ -249,7 +253,7 @@ struct if_shared_ctx { int isc_admin_intrcnt; /* # of admin/link interrupts */ /* fields necessary for probe */ - pci_vendor_info_t *isc_vendor_info; + const pci_vendor_info_t *isc_vendor_info; const char *isc_driver_version; /* optional function to transform the read values to match the table*/ void (*isc_parse_devinfo) (uint16_t *device_id, uint16_t *subvendor_id, @@ -265,7 +269,7 @@ struct if_shared_ctx { int isc_nfl __aligned(CACHE_LINE_SIZE); int isc_ntxqs; /* # of tx queues per tx qset - usually 1 */ int isc_nrxqs; /* # of rx queues per rx qset - intel 1, chelsio 2, broadcom 3 */ - int isc_rx_process_limit; + int __spare0__; int isc_tx_reclaim_thresh; int isc_flags; const char *isc_name; @@ -289,11 +293,6 @@ typedef enum { IFLIB_INTR_IOV, } iflib_intr_type_t; -#ifndef ETH_ADDR_LEN -#define ETH_ADDR_LEN 6 -#endif - - /* * Interface has a separate command queue for RX */ @@ -368,7 +367,6 @@ typedef enum { */ #define IFLIB_DRIVER_MEDIA 0x20000 - /* * field accessors */ @@ -406,7 +404,6 @@ int iflib_device_shutdown(device_t); */ int iflib_device_probe_vendor(device_t); - int iflib_device_iov_init(device_t, uint16_t, const nvlist_t *); void iflib_device_iov_uninit(device_t); int iflib_device_iov_add_vf(device_t, uint16_t, const nvlist_t *); @@ -418,8 +415,6 @@ int iflib_device_iov_add_vf(device_t, uint16_t, const int iflib_device_register(device_t dev, void *softc, if_shared_ctx_t sctx, if_ctx_t *ctxp); int iflib_device_deregister(if_ctx_t); - - int iflib_irq_alloc(if_ctx_t, if_irq_t, int, driver_filter_t, void *filter_arg, driver_intr_t, void *arg, const char *name); int iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, iflib_intr_type_t type, driver_filter_t *filter, @@ -428,34 +423,28 @@ void iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_ void iflib_irq_free(if_ctx_t ctx, if_irq_t irq); -void iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, char *name); +void iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, + const char *name); void iflib_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, const char *name); - void iflib_config_gtask_deinit(struct grouptask *gtask); - - void iflib_tx_intr_deferred(if_ctx_t ctx, int txqid); void iflib_rx_intr_deferred(if_ctx_t ctx, int rxqid); void iflib_admin_intr_deferred(if_ctx_t ctx); void iflib_iov_intr_deferred(if_ctx_t ctx); - void iflib_link_state_change(if_ctx_t ctx, int linkstate, uint64_t baudrate); int iflib_dma_alloc(if_ctx_t ctx, int size, iflib_dma_info_t dma, int mapflags); int iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, int mapflags); void iflib_dma_free(iflib_dma_info_t dma); - int iflib_dma_alloc_multi(if_ctx_t ctx, int *sizes, iflib_dma_info_t *dmalist, int mapflags, int count); void iflib_dma_free_multi(iflib_dma_info_t *dmalist, int count); - struct sx *iflib_ctx_lock_get(if_ctx_t); -struct mtx *iflib_qset_lock_get(if_ctx_t, uint16_t); void iflib_led_create(if_ctx_t ctx); @@ -467,4 +456,5 @@ void iflib_add_int_delay_sysctl(if_ctx_t, const char * */ if_pseudo_t iflib_clone_register(if_shared_ctx_t); void iflib_clone_deregister(if_pseudo_t); + #endif /* __IFLIB_H_ */ Modified: head/sys/net/iflib_private.h ============================================================================== --- head/sys/net/iflib_private.h Sat Jun 15 09:45:00 2019 (r349054) +++ head/sys/net/iflib_private.h Sat Jun 15 11:07:41 2019 (r349055) @@ -28,9 +28,8 @@ */ #ifndef __NET_IFLIB_PRIVATE_H_ -#define __NET_IFLIB_PRIVATE_H_ +#define __NET_IFLIB_PRIVATE_H_ - #define IFC_LEGACY 0x001 #define IFC_QFLUSH 0x002 #define IFC_MULTISEG 0x004 @@ -40,18 +39,13 @@ #define IFC_PREFETCH 0x040 #define IFC_DO_RESET 0x080 #define IFC_DO_WATCHDOG 0x100 -#define IFC_CHECK_HUNG 0x200 +#define IFC_SPARE0 0x200 #define IFC_PSEUDO 0x400 #define IFC_IN_DETACH 0x800 -#define IFC_NETMAP_TX_IRQ 0x80000000 +#define IFC_NETMAP_TX_IRQ 0x80000000 MALLOC_DECLARE(M_IFLIB); - -#define IFLIB_MAX_TX_BYTES (2*1024*1024) -#define IFLIB_MIN_TX_BYTES (8*1024) -#define IFLIB_DEFAULT_TX_QDEPTH 2048 - struct iflib_cloneattach_ctx { struct if_clone *cc_ifc; From owner-svn-src-head@freebsd.org Sat Jun 15 12:09:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DA415C5BA3; Sat, 15 Jun 2019 12:09:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC34B72F77; Sat, 15 Jun 2019 12:09:22 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A23C926C15; Sat, 15 Jun 2019 12:09:22 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5FC9MBk072708; Sat, 15 Jun 2019 12:09:22 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FC9MCL072707; Sat, 15 Jun 2019 12:09:22 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201906151209.x5FC9MCL072707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sat, 15 Jun 2019 12:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349056 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC34B72F77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 12:09:23 -0000 Author: 0mp (ports committer) Date: Sat Jun 15 12:09:22 2019 New Revision: 349056 URL: https://svnweb.freebsd.org/changeset/base/349056 Log: netmap.4: Fix a typo as FreeBSD Linux is not a thing Approved by: src (emaste) Event: Berlin Devsummit 2019 Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Sat Jun 15 11:07:41 2019 (r349055) +++ head/share/man/man4/netmap.4 Sat Jun 15 12:09:22 2019 (r349056) @@ -40,7 +40,7 @@ is a framework for extremely fast and efficient packet I/O for userspace and kernel clients, and for Virtual Machines. It runs on -.Fx +.Fx , Linux and some versions of Windows, and supports a variety of .Nm netmap ports , including From owner-svn-src-head@freebsd.org Sat Jun 15 13:08:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73D8F15C6F18; Sat, 15 Jun 2019 13:08:13 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.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 0916F74C91; Sat, 15 Jun 2019 13:08:13 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id A4B782700090; Sat, 15 Jun 2019 09:08:05 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu A4B782700090 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1560604085; bh=0k02xZwPZx8AWXXHCETebKWjpPjwH2rUUp2kJeqW4+c=; h=Subject:To:From:Date:From; b=kG6nOArCpoJi6XZ6hCoNHsXU85X8mM5/SlQeV2semWGTVgAKtweUPeMYiuVNtPd25 9qBwZztVRdWKLFfBp0YvkIMXUuNOBffVloKjpUJQNo/uSRdlDVd7a9PamUC3I7NVMC mWqGiZBYitpwHhyy4rKds+ZqjMTDknTqGBdp/qS0OnB2VqOEFBsSdOj0HOXr8WToyC m9QQ+avnEiuiW+fmFXXoUVbSJDfpnj9TPolnhEwpxGFfUAxVWRiieIHo3bEZPWyAdn 16Z1qkTYOSCkbqbz+k8r5FYA3okGQv1F1hbTuYdPgHg6F4veMQ+V7XIN3RlMseq+Wr mGeTffR05vFiQ== Subject: Re: svn commit: r349055 - head/sys/net To: Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906151107.x5FB7f6N039968@repo.freebsd.org> From: Andrew Gallatin Message-ID: <154077cb-14b1-1dbc-cb65-3233045963c0@cs.duke.edu> Date: Sat, 15 Jun 2019 09:08:05 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906151107.x5FB7f6N039968@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0916F74C91 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 13:08:13 -0000 On 2019-06-15 07:07, Marius Strobl wrote: > Author: marius > Date: Sat Jun 15 11:07:41 2019 > New Revision: 349055 > Log: > - Replace unused and only ever written to members of public iflib(9) > structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES > etc. are also only ever used for these write-only members if at all, > so both these macros and members can just go). Using these spares > may render it possible to merge certain iflib(9) fixes to stable/12. > Otherwise, changes extending struct if_irq or struct if_shared_ctx > in any way would break KBI as instances of these are allocated by > the driver front-ends (by contrast, struct if_pkt_info as well as > struct if_softc_ctx instances are provided by iflib(9) and, thus, > may grow at least at the end without breaking KBI). Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare? Given that if_pkt_info can grow, I would also expect it to be able to shrink. So I don't quite see why the spare is needed here. I also worry about carrying the other spares around forever. Drew From owner-svn-src-head@freebsd.org Sat Jun 15 15:59:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D1915CA5EE; Sat, 15 Jun 2019 15:59:46 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B62AE8181F; Sat, 15 Jun 2019 15:59:45 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id x5FFxexk032360 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 15 Jun 2019 17:59:40 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id x5FFxedV032359; Sat, 15 Jun 2019 17:59:40 +0200 (CEST) (envelope-from marius) Date: Sat, 15 Jun 2019 17:59:40 +0200 From: Marius Strobl To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349055 - head/sys/net Message-ID: <20190615155940.GM6782@alchemy.franken.de> References: <201906151107.x5FB7f6N039968@repo.freebsd.org> <154077cb-14b1-1dbc-cb65-3233045963c0@cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <154077cb-14b1-1dbc-cb65-3233045963c0@cs.duke.edu> User-Agent: Mutt/1.9.2 (2017-12-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (alchemy.franken.de [0.0.0.0]); Sat, 15 Jun 2019 17:59:40 +0200 (CEST) X-Rspamd-Queue-Id: B62AE8181F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.964,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 15:59:46 -0000 On Sat, Jun 15, 2019 at 09:08:05AM -0400, Andrew Gallatin wrote: > On 2019-06-15 07:07, Marius Strobl wrote: > > Author: marius > > Date: Sat Jun 15 11:07:41 2019 > > New Revision: 349055 > > > Log: > > - Replace unused and only ever written to members of public iflib(9) > > structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES > > etc. are also only ever used for these write-only members if at all, > > so both these macros and members can just go). Using these spares > > may render it possible to merge certain iflib(9) fixes to stable/12. > > Otherwise, changes extending struct if_irq or struct if_shared_ctx > > in any way would break KBI as instances of these are allocated by > > the driver front-ends (by contrast, struct if_pkt_info as well as > > struct if_softc_ctx instances are provided by iflib(9) and, thus, > > may grow at least at the end without breaking KBI). > > Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare? > Given that if_pkt_info can grow, I would also expect it to be able to > shrink. So I don't quite see why the spare is needed here. > > I also worry about carrying the other spares around forever. Yes, KBI-wise it should be also safe for instances of structures allocated by iflib(9) to shrink at the end (though shrinking structures usually isn't a concern when MFCing as such parts may just be omitted); changes altering the offsets of members would be a problem regarding KBI. Still, I don't like changing the size of publicly visible structures in stable branches without a real good reason even if such a change doesn't strictly break the KBI. So the plan is to MFC the spares but then to get rid of the ones whose removal doesn't break KBI in head. Marius From owner-svn-src-head@freebsd.org Sat Jun 15 16:16:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9CAB15CAA13; Sat, 15 Jun 2019 16:16:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8079F82219; Sat, 15 Jun 2019 16:16:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59CD21829; Sat, 15 Jun 2019 16:16:30 +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 x5FGGUNd004240; Sat, 15 Jun 2019 16:16:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FGGUAl004239; Sat, 15 Jun 2019 16:16:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151616.x5FGGUAl004239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 16:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349057 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 349057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8079F82219 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 16:16:31 -0000 Author: ian Date: Sat Jun 15 16:16:29 2019 New Revision: 349057 URL: https://svnweb.freebsd.org/changeset/base/349057 Log: Allow pwm(9) components to be selected individually, while 'device pwm' still includes it all. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 15 12:09:22 2019 (r349056) +++ head/sys/conf/files Sat Jun 15 16:16:29 2019 (r349057) @@ -2700,11 +2700,11 @@ dev/puc/puc.c optional puc dev/puc/puc_cfg.c optional puc dev/puc/puc_pccard.c optional puc pccard dev/puc/puc_pci.c optional puc pci -dev/pwm/pwmc.c optional pwm -dev/pwm/pwmbus.c optional pwm -dev/pwm/pwm_if.m optional pwm -dev/pwm/pwmbus_if.m optional pwm -dev/pwm/ofw_pwm.c optional pwm fdt +dev/pwm/pwmc.c optional pwm | pwmc +dev/pwm/pwmbus.c optional pwm | pwmbus +dev/pwm/pwm_if.m optional pwm | pwmbus +dev/pwm/pwmbus_if.m optional pwm | pwmbus +dev/pwm/ofw_pwm.c optional pwm fdt | pwmbus fdt dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral From owner-svn-src-head@freebsd.org Sat Jun 15 16:36:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A8CC15CAE23; Sat, 15 Jun 2019 16:36:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96A5482A14; Sat, 15 Jun 2019 16:36:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B4601B84; Sat, 15 Jun 2019 16:36:29 +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 x5FGaTA0014760; Sat, 15 Jun 2019 16:36:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FGaTNY014759; Sat, 15 Jun 2019 16:36:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151636.x5FGaTNY014759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 16:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349058 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 349058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96A5482A14 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 16:36:30 -0000 Author: ian Date: Sat Jun 15 16:36:29 2019 New Revision: 349058 URL: https://svnweb.freebsd.org/changeset/base/349058 Log: In detach(), check for failure of bus_generic_detach(), only release resources if they got allocated (because detach() gets called from attach() to handle various failures), and delete the pwmbus child if it got created. Modified: head/sys/arm/allwinner/aw_pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:16:29 2019 (r349057) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:36:29 2019 (r349058) @@ -192,12 +192,20 @@ static int aw_pwm_detach(device_t dev) { struct aw_pwm_softc *sc; + int error; sc = device_get_softc(dev); - bus_generic_detach(sc->dev); + if (((error = bus_generic_detach(sc->dev)) != 0) { + device_printf(sc->dev, "cannot detach child devices\n"); + return (error); + } - bus_release_resources(dev, aw_pwm_spec, &sc->res); + if (sc->busdev != NULL) + device_delete_child(dev, sc->busdev); + + if (sc->res != NULL) + bus_release_resources(dev, aw_pwm_spec, &sc->res); return (0); } From owner-svn-src-head@freebsd.org Sat Jun 15 16:56:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6736B15CB1F7; Sat, 15 Jun 2019 16:56:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6D1831D4; Sat, 15 Jun 2019 16:56:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2DFA1ECA; Sat, 15 Jun 2019 16:56:00 +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 x5FGu083024984; Sat, 15 Jun 2019 16:56:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FGu0TZ024983; Sat, 15 Jun 2019 16:56:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151656.x5FGu0TZ024983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 16:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349059 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 349059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B6D1831D4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 16:56:01 -0000 Author: ian Date: Sat Jun 15 16:56:00 2019 New Revision: 349059 URL: https://svnweb.freebsd.org/changeset/base/349059 Log: Don't call pwmbus_attach_bus(), because it may not be present if this driver is compiled into the kernel but pwmbus will be loaded as a module when needed (and because of that, pwmbus_attach_bus() is going away in the near future). Instead, just directly do what that function did: register the fdt xfef handle, and attach the pwmbus. Modified: head/sys/arm/allwinner/aw_pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:36:29 2019 (r349058) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:56:00 2019 (r349059) @@ -138,6 +138,7 @@ aw_pwm_attach(device_t dev) struct aw_pwm_softc *sc; uint64_t clk_freq; uint32_t reg; + phandle_t node; int error; sc = device_get_softc(dev); @@ -158,9 +159,6 @@ aw_pwm_attach(device_t dev) goto fail; } - if ((sc->busdev = pwmbus_attach_bus(dev)) == NULL) - device_printf(dev, "Cannot attach pwm bus\n"); - /* Read the configuration left by U-Boot */ reg = AW_PWM_READ(sc, AW_PWM_CTRL); if (reg & (AW_PWM_CTRL_GATE | AW_PWM_CTRL_EN)) @@ -170,7 +168,7 @@ aw_pwm_attach(device_t dev) reg &= AW_PWM_CTRL_PRESCALE_MASK; if (reg > nitems(aw_pwm_clk_prescaler)) { device_printf(dev, "Bad prescaler %x, cannot guess current settings\n", reg); - goto out; + goto skipcfg; } clk_freq = sc->clk_freq / aw_pwm_clk_prescaler[reg]; @@ -180,9 +178,18 @@ aw_pwm_attach(device_t dev) sc->duty = NS_PER_SEC / (clk_freq / ((reg >> AW_PWM_PERIOD_ACTIVE_SHIFT) & AW_PWM_PERIOD_ACTIVE_MASK)); -out: - return (0); +skipcfg: + /* + * Note that we don't check for failure to attach pwmbus -- even without + * it we can still service clients who connect via fdt xref data. + */ + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + sc->busdev = device_add_child(dev, "pwmbus", -1); + + return (bus_generic_attach(dev)); + fail: aw_pwm_detach(dev); return (error); @@ -196,7 +203,7 @@ aw_pwm_detach(device_t dev) sc = device_get_softc(dev); - if (((error = bus_generic_detach(sc->dev)) != 0) { + if ((error = bus_generic_detach(sc->dev)) != 0) { device_printf(sc->dev, "cannot detach child devices\n"); return (error); } From owner-svn-src-head@freebsd.org Sat Jun 15 16:59:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55CF115CB2C0; Sat, 15 Jun 2019 16:59:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED88983347; Sat, 15 Jun 2019 16:59:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4D671ECC; Sat, 15 Jun 2019 16:59:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5FGx3lg025142; Sat, 15 Jun 2019 16:59:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FGx3IB025141; Sat, 15 Jun 2019 16:59:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151659.x5FGx3IB025141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 16:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349060 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 349060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED88983347 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 16:59:04 -0000 Author: ian Date: Sat Jun 15 16:59:03 2019 New Revision: 349060 URL: https://svnweb.freebsd.org/changeset/base/349060 Log: Handle failure to enable the clock or obtain its frequency. Modified: head/sys/arm/allwinner/aw_pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:56:00 2019 (r349059) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 16:59:03 2019 (r349060) @@ -150,8 +150,16 @@ aw_pwm_attach(device_t dev) goto fail; } error = clk_enable(sc->clk); + if (error != 0) { + device_printf(dev, "cannot enable clock\n"); + goto fail; + } error = clk_get_freq(sc->clk, &sc->clk_freq); + if (error != 0) { + device_printf(dev, "cannot get clock frequency\n"); + goto fail; + } if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A76FF15CB782; Sat, 15 Jun 2019 17:08:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB52838AE; Sat, 15 Jun 2019 17:08:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12AA22083; Sat, 15 Jun 2019 17:08:03 +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 x5FH82cf030570; Sat, 15 Jun 2019 17:08:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH82J6030569; Sat, 15 Jun 2019 17:08:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH82J6030569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349061 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AB52838AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:03 -0000 Author: bdrewery Date: Sat Jun 15 17:08:02 2019 New Revision: 349061 URL: https://svnweb.freebsd.org/changeset/base/349061 Log: Don't force OBJS_DEPEND_GUESS headers onto all objects. This is in the case of not having any .depend.foo.o yet. Don't force add *.h as a dependency for those. They are built in beforebuild already when in SRCS/DPSRCS. This change allows custom rules, like in bin/sh/Makefile for mksyntax, to not have cyclic dependency problems when connected to the .depend.* handling. This is purposely not copied to sys/conf/kern.post.mk as it handles generating headers slightly differently. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Jun 15 16:59:03 2019 (r349060) +++ head/share/mk/bsd.dep.mk Sat Jun 15 17:08:02 2019 (r349061) @@ -251,18 +251,17 @@ _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) -# For meta mode we still need to know which file to depend on to avoid -# ambiguous suffix transformation rules from .PATH. Meta mode does not -# use .depend files. We really only need source files, not headers since -# they are typically in SRCS/beforebuild already. For target-specific -# guesses do include headers though since they may not be in SRCS. +.if !exists(${_depfile}) || defined(_meta_filemon) +# - Headers are normally built in beforebuild when included in DPSRCS or SRCS. +# So we don't need it as a guessed dependency (it may lead to cyclic problems +# if custom rules are defined). The only time this causes a problem is when +# 'make foo.o' is ran. +# - For meta mode we still need to know which file to depend on to avoid +# ambiguous suffix transformation rules from .PATH. Meta mode does not +# use .depend files when filemon is in use. ${__obj}: ${OBJS_DEPEND_GUESS:N*.h} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} -.endif # !exists(${_depfile}) +.endif # !exists(${_depfile}) || defined(_meta_filemon) .endfor # Always run 'make depend' to generate dependencies early and to avoid the From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE76715CB7B0; Sat, 15 Jun 2019 17:08:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05734839B1; Sat, 15 Jun 2019 17:08:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA39B2084; Sat, 15 Jun 2019 17:08:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5FH8FFY030627; Sat, 15 Jun 2019 17:08:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8EVx030620; Sat, 15 Jun 2019 17:08:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8EVx030620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349062 - in head: bin/csh bin/sh lib/libmagic lib/ncurses/ncurses share/syscons/scrnmaps usr.bin/awk usr.bin/vi/catalog X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: bin/csh bin/sh lib/libmagic lib/ncurses/ncurses share/syscons/scrnmaps usr.bin/awk usr.bin/vi/catalog X-SVN-Commit-Revision: 349062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05734839B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:17 -0000 Author: bdrewery Date: Sat Jun 15 17:08:13 2019 New Revision: 349062 URL: https://svnweb.freebsd.org/changeset/base/349062 Log: Fix .depend files to work for build tools. This is somewhat of a follow-up to r335746. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/bin/csh/Makefile head/bin/sh/Makefile head/lib/libmagic/Makefile head/lib/ncurses/ncurses/Makefile head/share/syscons/scrnmaps/Makefile head/usr.bin/awk/Makefile head/usr.bin/vi/catalog/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/bin/csh/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -117,6 +117,7 @@ csh.1: tcsh.man build-tools: gethost +DEPENDOBJS+= gethost gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} ${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/bin/sh/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -48,6 +48,7 @@ builtins.h: .NOMETA builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} +DEPENDOBJS+= mknodes mksyntax mknodes mksyntax: ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/lib/libmagic/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -41,10 +41,11 @@ magic.mgc: mkmagic magic ${BTOOLSPATH:U.}/mkmagic magic CLEANFILES+= mkmagic +DEPENDOBJS+= mkmagic build-tools: mkmagic mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC:N*.h} \ - ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \ + ${.ALLSRC:N*.h:O:u} ${LDADD} FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ ${.CURDIR}/config.h Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/lib/ncurses/ncurses/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -389,6 +389,7 @@ keys.list: MKkeys_list.sh Caps ${NCURSES_DIR}/include/Caps | LC_ALL=C sort > keys.list # Build tools +DEPENDOBJS+= make_hash make_keys build-tools: make_hash make_keys make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} Modified: head/share/syscons/scrnmaps/Makefile ============================================================================== --- head/share/syscons/scrnmaps/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/share/syscons/scrnmaps/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -12,6 +12,7 @@ CLEANFILES+= ${SCRMAPS_MK} ${SCRMAPS} FILES= ${SCRMAPS} FILESDIR= ${SHAREDIR}/syscons/scrnmaps +DEPENDOBJS+= ${SCRMAPS_MK} build-tools: ${SCRMAPS_MK} ${SCRMAPS}: ${.TARGET:R}.mk Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/usr.bin/awk/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -27,6 +27,7 @@ ytab.h: awkgram.c awkgram.h .NOMETA proctab.c: maketab ${BTOOLSPATH:U.}/maketab awkgram.h > proctab.c +DEPENDOBJS+= maketab build-tools: maketab maketab: ytab.h maketab.c ${BUILD_TOOLS_META} Modified: head/usr.bin/vi/catalog/Makefile ============================================================================== --- head/usr.bin/vi/catalog/Makefile Sat Jun 15 17:08:02 2019 (r349061) +++ head/usr.bin/vi/catalog/Makefile Sat Jun 15 17:08:13 2019 (r349062) @@ -105,8 +105,8 @@ english.base: dump ${SCAN} #Makefile sort -nu > $@ -dump: dump.c ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} -o ${.TARGET} ${.ALLSRC} +DEPENDOBJS+= dump +dump: ${BUILD_TOOLS_META} CLEANFILES+= dump ${CAT} english.base *.check __ck1 __ck2 From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD58315CB7D5; Sat, 15 Jun 2019 17:08:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 617A9839D5; Sat, 15 Jun 2019 17:08:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F33562085; Sat, 15 Jun 2019 17:08:18 +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 x5FH8Itm030675; Sat, 15 Jun 2019 17:08:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8Ifq030674; Sat, 15 Jun 2019 17:08:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8Ifq030674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349063 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 617A9839D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:19 -0000 Author: bdrewery Date: Sat Jun 15 17:08:18 2019 New Revision: 349063 URL: https://svnweb.freebsd.org/changeset/base/349063 Log: Similar to r335710 avoid ccache when linking a .cc file directly. Sponsored by: DellEMC Modified: head/share/mk/bsd.suffixes.mk Modified: head/share/mk/bsd.suffixes.mk ============================================================================== --- head/share/mk/bsd.suffixes.mk Sat Jun 15 17:08:13 2019 (r349062) +++ head/share/mk/bsd.suffixes.mk Sat Jun 15 17:08:18 2019 (r349063) @@ -19,7 +19,7 @@ ${CC} -emit-llvm ${IR_CFLAGS} -S ${.IMPSRC} -o ${.TARGET} .cc .cpp .cxx .C: - ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + ${CXX:N${CCACHE_BIN}} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} .cc.o .cpp.o .cxx.o .C.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E5615CB7F7; Sat, 15 Jun 2019 17:08:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD0083A4D; Sat, 15 Jun 2019 17:08:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28CC12086; Sat, 15 Jun 2019 17:08:22 +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 x5FH8MnU030720; Sat, 15 Jun 2019 17:08:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8Me0030719; Sat, 15 Jun 2019 17:08:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8Me0030719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349064 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FD0083A4D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:25 -0000 Author: bdrewery Date: Sat Jun 15 17:08:21 2019 New Revision: 349064 URL: https://svnweb.freebsd.org/changeset/base/349064 Log: Avoid generating DEPENDFILES='.depend.' when there's no DEPENDOBJS. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Jun 15 17:08:18 2019 (r349063) +++ head/share/mk/bsd.dep.mk Sat Jun 15 17:08:21 2019 (r349064) @@ -186,7 +186,9 @@ DEPENDSRCS+= ${DPSRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS: .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,} .endif +.if !empty(DEPENDOBJS) DEPENDFILES+= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} +.endif .if defined(_SKIP_DEPEND) # Don't bother statting any .meta files for .depend* ${DEPENDOBJS}: .NOMETA From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7663A15CB818; Sat, 15 Jun 2019 17:08:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C8483AC0; Sat, 15 Jun 2019 17:08:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EC3B2087; Sat, 15 Jun 2019 17:08: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 x5FH8PEA030767; Sat, 15 Jun 2019 17:08:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8Pen030766; Sat, 15 Jun 2019 17:08:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8Pen030766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349065 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18C8483AC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:29 -0000 Author: bdrewery Date: Sat Jun 15 17:08:24 2019 New Revision: 349065 URL: https://svnweb.freebsd.org/changeset/base/349065 Log: Add various CFLAGS/LDADD overrides for the output target file. Sponsored by: DellEMC Modified: head/share/mk/bsd.README head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sat Jun 15 17:08:21 2019 (r349064) +++ head/share/mk/bsd.README Sat Jun 15 17:08:24 2019 (r349065) @@ -125,10 +125,16 @@ The following variables are common: AFLAGS.${SRC} Flags dependent on source file name. +AFLAGS.${TARGET} + Flags dependent on output file name. ACFLAGS.${SRC} Flags dependent on source file name. +ACFLAGS.${TARGET} + Flags dependent on output file name. CFLAGS.${SRC} Flags dependent on source file name. +CFLAGS.${TARGET} + Flags dependent on output file name. CFLAGS.${COMPILER_TYPE} Flags dependent on compiler added to CFLAGS. CFLAGS.${MACHINE_ARCH} @@ -142,6 +148,8 @@ CXXFLAGS.${MACHINE_ARCH} Architectural flags added to CXXFLAGS. CXXFLAGS.${SRC} Flags dependent on source file name. +CXXFLAGS.${TARGET} + Flags dependent on output file name. COMPILER_FEATURES A list of features that the compiler supports. Zero or more of: @@ -336,13 +344,22 @@ LDADD Additional loader objects. Usually used for li LDADD=-lutil -lcompat +LDADD.${TAREGT} + Loader objects dependent on output file name. + LDFLAGS Additional loader flags. Passed to the loader via CC, since that's used to link programs as well, so loader specific flags need to be prefixed with -Wl, to work. +LDFLAGS.${TARGET} + Flags dependent on output file name. + LIBADD Additional libraries. This is for base system libraries and is only valid inside of the /usr/src tree. Use LIBADD=name instead of LDADD=-lname. + +LIBADD.${TARGET} + Libraries dependent on output file name. LINKS The list of binary links; should be full pathnames, the linked-to file coming first, followed by the linked Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat Jun 15 17:08:21 2019 (r349064) +++ head/share/mk/bsd.sys.mk Sat Jun 15 17:08:24 2019 (r349065) @@ -234,17 +234,25 @@ DEBUG_FILES_CFLAGS?= -g .if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}} CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CWARNFLAGS.${.TARGET:T}} .endif CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} AFLAGS+= ${AFLAGS.${.IMPSRC:T}} +AFLAGS+= ${AFLAGS.${.TARGET:T}} ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} +ACFLAGS+= ${ACFLAGS.${.TARGET:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CFLAGS.${.TARGET:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +CXXFLAGS+= ${CXXFLAGS.${.TARGET:T}} LDFLAGS+= ${LDFLAGS.${LINKER_TYPE}} +LDFLAGS+= ${LDFLAGS.${.TARGET:T}} +LDADD+= ${LDADD.${.TARGET:T}} +LIBADD+= ${LIBADD.${.TARGET:T}} .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 406F315CB837; Sat, 15 Jun 2019 17:08:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D173983B0C; Sat, 15 Jun 2019 17:08:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA88E2088; Sat, 15 Jun 2019 17:08:28 +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 x5FH8SvY030814; Sat, 15 Jun 2019 17:08:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8Smq030813; Sat, 15 Jun 2019 17:08:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8Smq030813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349066 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D173983B0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:32 -0000 Author: bdrewery Date: Sat Jun 15 17:08:28 2019 New Revision: 349066 URL: https://svnweb.freebsd.org/changeset/base/349066 Log: META_MODE: Delete build targets that fail. If a meta mode change is triggered but then the build fails then the next build will not retrigger meta mode. This only prevented by removing the target on rebuild or on the failure to rebuild. Sponsored by: DellEMC Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Sat Jun 15 17:08:24 2019 (r349065) +++ head/share/mk/local.sys.mk Sat Jun 15 17:08:28 2019 (r349066) @@ -33,6 +33,11 @@ MAKE_PRINT_VAR_ON_ERROR+= \ OBJTOP \ ${MAKE_PRINT_VAR_ON_ERROR_XTRAS} +# Meta mode may rebuild targets that then fail. The next build won't detect +# the meta mode change. Not all targets have a 'rm ${.TARGET}' in them +# so force it. +.DELETE_ON_ERROR: + .if ${.MAKE.LEVEL} > 0 MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH .endif From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E41C15CB86F; Sat, 15 Jun 2019 17:08:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAAD583BB6; Sat, 15 Jun 2019 17:08: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 279CB2089; Sat, 15 Jun 2019 17:08:33 +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 x5FH8XqG030863; Sat, 15 Jun 2019 17:08:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8WQQ030858; Sat, 15 Jun 2019 17:08:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8WQQ030858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349067 - in head: gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov lib/csu X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov lib/csu X-SVN-Commit-Revision: 349067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAAD583BB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:39 -0000 Author: bdrewery Date: Sat Jun 15 17:08:32 2019 New Revision: 349067 URL: https://svnweb.freebsd.org/changeset/base/349067 Log: Support reading in .depend files. This is for an upcoming change that fixes .depend handling in here. It will cause some duplicate sources which need to be trimmed out. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/lib/csu/Makefile.inc Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Sat Jun 15 17:08:28 2019 (r349066) +++ head/gnu/lib/csu/Makefile Sat Jun 15 17:08:32 2019 (r349067) @@ -49,23 +49,23 @@ CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS} crtbegin.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \ - -c -o ${.TARGET} ${.ALLSRC:N*.h} + -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} crtbeginT.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \ - -c -o ${.TARGET} ${.ALLSRC:N*.h} + -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} crtbeginS.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \ - -c -o ${.TARGET} ${.ALLSRC:N*.h} + -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} crtend.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END \ - -c -o ${.TARGET} ${.ALLSRC:N*.h} + -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} crtendS.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ - -c -o ${.TARGET} ${.ALLSRC:N*.h} + -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} COMMONHDRS+= tm.h tconfig.h options.h CLEANFILES+= ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Jun 15 17:08:28 2019 (r349066) +++ head/gnu/lib/libgcc/Makefile Sat Jun 15 17:08:32 2019 (r349067) @@ -224,11 +224,11 @@ ${T}_OBJS_S = ${${T}_FUNCS:S/$/.pico/} SOBJS += ${${T}_FUNCS:S/$/.pico/} ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS} - ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} ${${T}_OBJS_P}: ${${T}_CFILE} ${COMMONHDRS} - ${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS} - ${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} .endfor #----------------------------------------------------------------------- @@ -249,9 +249,9 @@ STAT_OBJS_P = ${SYMS_ST:S/$/.po/} STATICOBJS = ${SYMS_ST:S/$/.o/} ${STAT_OBJS_T}: ${STD_CFILE} ${COMMONHDRS} - ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} ${STAT_OBJS_P}: ${STD_CFILE} ${COMMONHDRS} - ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} #----------------------------------------------------------------------- # Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Sat Jun 15 17:08:28 2019 (r349066) +++ head/gnu/lib/libgcov/Makefile Sat Jun 15 17:08:32 2019 (r349067) @@ -51,16 +51,16 @@ CLEANFILES+= ${COMMONHDRS} cs-tm.h cs-tconfig.h option ${OBJS} beforedepend: ${COMMONHDRS} ${OBJS_T}: libgcov.c - ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} .if !defined(NO_PIC) ${OBJS_S}: libgcov.c - ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} .endif .if ${MK_PROFILE} != "no" ${OBJS_P}: libgcov.c - ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} + ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c:[1]} .endif .include Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Sat Jun 15 17:08:28 2019 (r349066) +++ head/lib/csu/Makefile.inc Sat Jun 15 17:08:32 2019 (r349067) @@ -22,10 +22,11 @@ crtend.o: crtend.c crtendS.o: crtend.c crtbegin.o crtend.o crtbeginT.o: - ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC} + ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} crtbeginS.o crtendS.o: - ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} ${.ALLSRC} + ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \ + ${.ALLSRC:N*.h:[1]} .endif From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0697B15CB8AE; Sat, 15 Jun 2019 17:08:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F20A83C1A; Sat, 15 Jun 2019 17:08:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6430D208A; Sat, 15 Jun 2019 17:08:36 +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 x5FH8apa030910; Sat, 15 Jun 2019 17:08:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8aSg030909; Sat, 15 Jun 2019 17:08:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8aSg030909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349068 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F20A83C1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:43 -0000 Author: bdrewery Date: Sat Jun 15 17:08:35 2019 New Revision: 349068 URL: https://svnweb.freebsd.org/changeset/base/349068 Log: Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS. Default to tracking .depend.* for OBJS rather than SRCS. This helps cover some special case builds like gnu/lib/csu which do more of a PROGS-like thing with bsd.prog.mk. It is possible this causes out-of-tree Makefiles to have problems if they use this pattern: foo.o: foo.c ${CC} -o ${.TARGET} ${.ALLSRC} This may cause multiple source files to be compiled due to finding the 'foo.o: foo.c' dependency both in the Makefile at the .depend file. Or it may try compiling headers. This can be worked around by either of these: foo.o: foo.c ${CC} -o ${.TARGET} ${.ALLSRC:N*.h:[1]} Or foo.o: foo.c ${CC} -o ${.TARGET} ${.CURDIR}/foo.c In the latter case the ${.CURDIR} may need to be a different path. The first case covers automatically using .PATH. Sponsored by: DellEMC Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Jun 15 17:08:32 2019 (r349067) +++ head/share/mk/bsd.dep.mk Sat Jun 15 17:08:35 2019 (r349068) @@ -173,19 +173,23 @@ ${_D}.nossppico: ${_DSRC} ${SOBJS:S/^${_D}.nossppico$/ .endif .endfor .endfor +.endif # defined(SRCS) - .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP .endif # Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to # avoid collisions. DEPEND_FILTER= C,/,_,g +.if !empty(OBJS) +DEPENDOBJS+= ${OBJS} +.else DEPENDSRCS+= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} DEPENDSRCS+= ${DPSRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,} .endif +.endif # !empty(OBJS) .if !empty(DEPENDOBJS) DEPENDFILES+= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .endif @@ -215,7 +219,6 @@ CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS .endif .endfor .endif # !defined(_meta_filemon) -.endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.DEPENDFILE} != "/dev/null" # Prevent meta.autodep.mk from tracking "local dependencies". From owner-svn-src-head@freebsd.org Sat Jun 15 17:08:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E92B415CB8ED; Sat, 15 Jun 2019 17:08:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAD383CA3; Sat, 15 Jun 2019 17:08:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B916D208B; Sat, 15 Jun 2019 17:08:39 +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 x5FH8dUO030955; Sat, 15 Jun 2019 17:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FH8d25030954; Sat, 15 Jun 2019 17:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906151708.x5FH8d25030954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 15 Jun 2019 17:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349069 - head/gnu/lib/csu X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/gnu/lib/csu X-SVN-Commit-Revision: 349069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AAD383CA3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:08:48 -0000 Author: bdrewery Date: Sat Jun 15 17:08:39 2019 New Revision: 349069 URL: https://svnweb.freebsd.org/changeset/base/349069 Log: csu: Add proper .depend tracking for each object. This doesn't appear to have ever worked. After a .depend is generated there will be duplicate .c dependencies so only use the first one. MFC after: 2 weeks Sponsored by: DellEMC Modified: head/gnu/lib/csu/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Sat Jun 15 17:08:35 2019 (r349068) +++ head/gnu/lib/csu/Makefile Sat Jun 15 17:08:39 2019 (r349069) @@ -14,6 +14,7 @@ CCDIR= ${SRCTOP}/gnu/usr.bin/cc SRCS= crtstuff.c ${COMMONHDRS} OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o +DEPENDOBJS+= ${OBJS} ${SOBJS} CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder From owner-svn-src-head@freebsd.org Sat Jun 15 17:18:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C7CE15CBDA3; Sat, 15 Jun 2019 17:18:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACE8D8475B; Sat, 15 Jun 2019 17:17:59 +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 7CF5ABA13; Sat, 15 Jun 2019 17:17:59 +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 454F47FE0; Sat, 15 Jun 2019 17:17:58 +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 l2atEkUDhntY; Sat, 15 Jun 2019 17:17:55 +0000 (UTC) Subject: Re: svn commit: r349069 - head/gnu/lib/csu DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 559057FD2 From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906151708.x5FH8d25030954@repo.freebsd.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=https://zx.xk42.net/bryan.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBPAQYAQoAJgIbDBYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hL4BQkN PvONAAoJEDXXcbtuRpfPCjcH/ivBsOpdpebpgLizSNU5/X4yWN5Aixsc9VBnQhGKAKnMINJQ VMpA55sD2JSPwloXYM/B3qyPJRS/9cwIuX5LDNKKOZU3Qp+TzleynM15/xea14orWYRGRict YHBM3Cnqp7OD8K6Q1uhs0fTxyJP7PZ/G0+7Corlf1DlHhDt6C2HldRPFvAvAgl6sR9Wzgcb7 rzub2HVtbJgl6YHbgyAG7x9NpXFqzx1JLAMdpt2DIYwoi+oMdRQlBIwNuKjQjCGzuXHandd3 kGvBAsyJpQ+coEep9UzwANaV28cXrFr2R4FSOcR50rBA2Nh/vqUYfpsvBvJlwuKAoV1djVHa ihNeL5E= Organization: FreeBSD Message-ID: <365d54ca-2091-7a9a-1f0c-f55452d30449@FreeBSD.org> Date: Sat, 15 Jun 2019 10:17:55 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <201906151708.x5FH8d25030954@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: ACE8D8475B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:18:00 -0000 On 6/15/2019 10:08 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Sat Jun 15 17:08:39 2019 > New Revision: 349069 > URL: https://svnweb.freebsd.org/changeset/base/349069 > > Log: > csu: Add proper .depend tracking for each object. > > This doesn't appear to have ever worked. After a .depend is generated > there will be duplicate .c dependencies so only use the first one. > Oops. This 2nd paragraph was really from r349067 before some rebasing. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Sat Jun 15 17:26:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D20A715CBFD6; Sat, 15 Jun 2019 17:26:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7480884B5F; Sat, 15 Jun 2019 17:26:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2D023CC; Sat, 15 Jun 2019 17:26:43 +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 x5FHQhI3041021; Sat, 15 Jun 2019 17:26:43 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FHQhjF041020; Sat, 15 Jun 2019 17:26:43 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906151726.x5FHQhjF041020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 15 Jun 2019 17:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349070 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7480884B5F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 17:26:44 -0000 Author: alc Date: Sat Jun 15 17:26:42 2019 New Revision: 349070 URL: https://svnweb.freebsd.org/changeset/base/349070 Log: Previously, when pmap_remove_pages() destroyed a dirty superpage mapping, it only called vm_page_dirty() on the first of the superpage's constituent 4KB pages. This revision corrects that error, calling vm_page_dirty() on all of superpage's constituent 4KB pages. MFC after: 3 days Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Jun 15 17:08:39 2019 (r349069) +++ head/sys/arm64/arm64/pmap.c Sat Jun 15 17:26:42 2019 (r349070) @@ -4067,7 +4067,7 @@ pmap_remove_pages(pmap_t pmap) switch (lvl) { case 1: for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) - vm_page_dirty(m); + vm_page_dirty(mt); break; case 2: vm_page_dirty(m); From owner-svn-src-head@freebsd.org Sat Jun 15 18:48:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2088815CD3B6; Sat, 15 Jun 2019 18:48:33 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.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 AACA586E5F; Sat, 15 Jun 2019 18:48:32 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 14A5627001FF; Sat, 15 Jun 2019 14:48:31 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 14A5627001FF DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1560624511; bh=iFmvzU9PDa2Z9sIzoffU+qbsdYrSyPaOyOBigNENRN4=; h=Subject:To:From:Date:From; b=sisc4FBGcTiPo3tzX1ZuRan223PAXl8g5ev8KoDF8Gw6N7WvY6/Bw1CIqHS/ztxI+ ouj5mHWWy0yx6cy3UcOzNS5e8nph75iz1WaX3XlsyHp49cbC0eNQbO0rxL+ZIi86Bv mXB/U03wuZFEt20yy9pYqs7HSc2oSwwPfUQOhEDmcKroXeRBvlmkjagNkDWWUrVa+i TUlQwizzNoLI/Pk3ObNcGxy+cqzAy+gdYlqxicPUvYd0PkM81WlYmpTwZMdVN9VfRm 5ptX665cwgNFIVe8hlVabGX/wrrPZ6OQVS1B4L4d4AtmikQGF2qHv4wGx2reFwyTZh liYOzAvgONY/w== Subject: Re: svn commit: r349055 - head/sys/net To: Marius Strobl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906151107.x5FB7f6N039968@repo.freebsd.org> <154077cb-14b1-1dbc-cb65-3233045963c0@cs.duke.edu> <20190615155940.GM6782@alchemy.franken.de> From: Andrew Gallatin Message-ID: <178554f8-27f4-d09c-0d6f-0f53febbf601@cs.duke.edu> Date: Sat, 15 Jun 2019 14:48:30 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190615155940.GM6782@alchemy.franken.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AACA586E5F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 18:48:33 -0000 On 2019-06-15 11:59, Marius Strobl wrote: > On Sat, Jun 15, 2019 at 09:08:05AM -0400, Andrew Gallatin wrote: >> On 2019-06-15 07:07, Marius Strobl wrote: >>> Author: marius >>> Date: Sat Jun 15 11:07:41 2019 >>> New Revision: 349055 >> >>> Log: >>> - Replace unused and only ever written to members of public iflib(9) >>> structs with placeholders (in the latter case, IFLIB_MAX_TX_BYTES >>> etc. are also only ever used for these write-only members if at all, >>> so both these macros and members can just go). Using these spares >>> may render it possible to merge certain iflib(9) fixes to stable/12. >>> Otherwise, changes extending struct if_irq or struct if_shared_ctx >>> in any way would break KBI as instances of these are allocated by >>> the driver front-ends (by contrast, struct if_pkt_info as well as >>> struct if_softc_ctx instances are provided by iflib(9) and, thus, >>> may grow at least at the end without breaking KBI). >> >> Given the above, why replace ipi_tcp_sum in if_pkt_info with a spare? >> Given that if_pkt_info can grow, I would also expect it to be able to >> shrink. So I don't quite see why the spare is needed here. >> >> I also worry about carrying the other spares around forever. > > Yes, KBI-wise it should be also safe for instances of structures allocated > by iflib(9) to shrink at the end (though shrinking structures usually isn't > a concern when MFCing as such parts may just be omitted); changes altering > the offsets of members would be a problem regarding KBI. > Still, I don't like changing the size of publicly visible structures in > stable branches without a real good reason even if such a change doesn't > strictly break the KBI. So the plan is to MFC the spares but then to get > rid of the ones whose removal doesn't break KBI in head. > > Marius > Thanks, that makes sense Drew From owner-svn-src-head@freebsd.org Sat Jun 15 19:16:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A13215CDAF6; Sat, 15 Jun 2019 19:16:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A014187F67; Sat, 15 Jun 2019 19:16: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87BC937B0; Sat, 15 Jun 2019 19:16:02 +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 x5FJG2vY098626; Sat, 15 Jun 2019 19:16:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FJG2YQ098625; Sat, 15 Jun 2019 19:16:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151916.x5FJG2YQ098625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 19:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349072 - head X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 349072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A014187F67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 19:16:03 -0000 Author: ian Date: Sat Jun 15 19:16:02 2019 New Revision: 349072 URL: https://svnweb.freebsd.org/changeset/base/349072 Log: Remove pcf8563reg.h, the driver it was associated with was replaced in 2017 with the nxprtc multi-chip driver. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jun 15 19:07:03 2019 (r349071) +++ head/ObsoleteFiles.inc Sat Jun 15 19:16:02 2019 (r349072) @@ -1560,6 +1560,8 @@ OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat1 OLD_DIRS+=usr/share/openssl/man/en.ISO8859-1/cat3 # 20170802: ksyms(4) ioctl interface was removed OLD_FILES+=usr/include/sys/ksyms.h +# 20170729: the iicbus/pcf8563 driver is replaced with iicbus/nxprtc +OLD_FILES+=usr/include/dev/iicbus/pcf8563reg.h # 20170722: new clang import which bumps version from 4.0.0 to 5.0.0. OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/asan_interface.h From owner-svn-src-head@freebsd.org Sat Jun 15 19:43:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B0815CE6B6; Sat, 15 Jun 2019 19:43:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D006B8997C; Sat, 15 Jun 2019 19:43:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB6563D70; Sat, 15 Jun 2019 19:43:34 +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 x5FJhY80015992; Sat, 15 Jun 2019 19:43:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FJhYCS015990; Sat, 15 Jun 2019 19:43:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151943.x5FJhYCS015990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 19:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349073 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D006B8997C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 19:43:35 -0000 Author: ian Date: Sat Jun 15 19:43:33 2019 New Revision: 349073 URL: https://svnweb.freebsd.org/changeset/base/349073 Log: Do not include pwm.h here, it is purely a userland interface file containing ioctl defintions for the pwmc driver. It is not part of the pwmbus interface. Modified: head/sys/dev/pwm/pwmbus.h head/sys/dev/pwm/pwmbus_if.m Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sat Jun 15 19:16:02 2019 (r349072) +++ head/sys/dev/pwm/pwmbus.h Sat Jun 15 19:43:33 2019 (r349073) @@ -31,7 +31,6 @@ #ifndef _PWMBUS_H_ #include -#include struct pwm_channel { device_t dev; Modified: head/sys/dev/pwm/pwmbus_if.m ============================================================================== --- head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 19:16:02 2019 (r349072) +++ head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 19:43:33 2019 (r349073) @@ -48,10 +48,6 @@ CODE { } }; -HEADER { - #include -}; - # # Config the period (Total number of cycle in ns) and # the duty (active number of cycle in ns) From owner-svn-src-head@freebsd.org Sat Jun 15 19:47:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B4E15CE7E5; Sat, 15 Jun 2019 19:47:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A07789BDB; Sat, 15 Jun 2019 19:47:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8BA03D72; Sat, 15 Jun 2019 19:47:00 +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 x5FJl0vE016198; Sat, 15 Jun 2019 19:47:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FJkxeI016189; Sat, 15 Jun 2019 19:46:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906151946.x5FJkxeI016189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 19:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349074 - in head: . etc/mtree include sys/dev/pwm sys/sys usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: . etc/mtree include sys/dev/pwm sys/sys usr.sbin/pwm X-SVN-Commit-Revision: 349074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A07789BDB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 19:47:01 -0000 Author: ian Date: Sat Jun 15 19:46:59 2019 New Revision: 349074 URL: https://svnweb.freebsd.org/changeset/base/349074 Log: Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file contains ioctl definitions and related datatypes that allow userland control of pwm hardware via the pwmc device. The new name and location better reflects its assocation with a single device driver. Added: head/sys/dev/pwm/pwmc.h - copied unchanged from r349073, head/sys/sys/pwm.h Deleted: head/sys/sys/pwm.h Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/dev/pwm/pwmc.c head/usr.sbin/pwm/pwm.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jun 15 19:43:33 2019 (r349073) +++ head/ObsoleteFiles.inc Sat Jun 15 19:46:59 2019 (r349074) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190615: sys/pwm.h renamed to dev/pwmc.h +OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Jun 15 19:43:33 2019 (r349073) +++ head/etc/mtree/BSD.include.dist Sat Jun 15 19:46:59 2019 (r349074) @@ -152,6 +152,8 @@ .. ppbus .. + pwm + .. smbus .. speaker Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Jun 15 19:43:33 2019 (r349073) +++ head/include/Makefile Sat Jun 15 19:46:59 2019 (r349074) @@ -46,8 +46,8 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ - dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ - dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ + dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ + dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 19:43:33 2019 (r349073) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 19:46:59 2019 (r349074) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "pwmbus_if.h" #include "pwm_if.h" Copied: head/sys/dev/pwm/pwmc.h (from r349073, head/sys/sys/pwm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pwm/pwmc.h Sat Jun 15 19:46:59 2019 (r349074, copy of r349073, head/sys/sys/pwm.h) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PWM_H_ +#define _PWM_H_ + +#define PWM_POLARITY_INVERTED (1 << 0) + +struct pwm_state { + int channel; + unsigned int period; + unsigned int duty; + uint32_t flags; + bool enable; +}; + +/* + * ioctls + */ + +#define PWMMAXCHANNEL _IOWR('G', 0, int) +#define PWMGETSTATE _IOWR('G', 1, struct pwm_state) +#define PWMSETSTATE _IOWR('G', 2, struct pwm_state) + + +#endif /* _PWM_H_ */ Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Sat Jun 15 19:43:33 2019 (r349073) +++ head/usr.sbin/pwm/pwm.c Sat Jun 15 19:46:59 2019 (r349074) @@ -31,8 +31,8 @@ #include #include #include -#include #include +#include #include #include From owner-svn-src-head@freebsd.org Sat Jun 15 20:13:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCDA15CEDEF; Sat, 15 Jun 2019 20:13:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 217C68A887; Sat, 15 Jun 2019 20:13:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF44D42C1; Sat, 15 Jun 2019 20:13:42 +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 x5FKDgHs031627; Sat, 15 Jun 2019 20:13:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FKDgq1031625; Sat, 15 Jun 2019 20:13:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152013.x5FKDgq1031625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 20:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349075 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 217C68A887 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 20:13:43 -0000 Author: ian Date: Sat Jun 15 20:13:42 2019 New Revision: 349075 URL: https://svnweb.freebsd.org/changeset/base/349075 Log: Remove pwmbus_attach_bus(), it no longer has any callers. Also remove a couple prototypes for functions that never existed (and never will). Modified: head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmbus.h Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 19:46:59 2019 (r349074) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:13:42 2019 (r349075) @@ -61,35 +61,6 @@ struct pwmbus_softc { int nchannels; }; -device_t -pwmbus_attach_bus(device_t dev) -{ - device_t busdev; -#ifdef FDT - phandle_t node; -#endif - - busdev = device_add_child(dev, "pwmbus", -1); - if (busdev == NULL) { - device_printf(dev, "Cannot add child pwmbus\n"); - return (NULL); - } - if (device_add_child(dev, "pwmc", -1) == NULL) { - device_printf(dev, "Cannot add pwmc\n"); - device_delete_child(dev, busdev); - return (NULL); - } - -#ifdef FDT - node = ofw_bus_get_node(dev); - OF_device_register_xref(OF_xref_from_node(node), dev); -#endif - - bus_generic_attach(dev); - - return (busdev); -} - static int pwmbus_probe(device_t dev) { Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sat Jun 15 19:46:59 2019 (r349074) +++ head/sys/dev/pwm/pwmbus.h Sat Jun 15 20:13:42 2019 (r349075) @@ -43,10 +43,6 @@ struct pwm_channel { }; typedef struct pwm_channel *pwm_channel_t; -device_t pwmbus_attach_bus(device_t dev); -int pwmbus_acquire_channel(device_t bus, int channel); -int pwmbus_release_channel(device_t bus, int channel); - int pwm_get_by_ofw_propidx(device_t consumer, phandle_t node, const char *prop_name, int idx, pwm_channel_t *channel); From owner-svn-src-head@freebsd.org Sat Jun 15 20:17:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6933F15CEE82; Sat, 15 Jun 2019 20:17:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8558A9E9; Sat, 15 Jun 2019 20:17:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2BA342C2; Sat, 15 Jun 2019 20:17:00 +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 x5FKH0Ch031818; Sat, 15 Jun 2019 20:17:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FKH0Oc031817; Sat, 15 Jun 2019 20:17:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152017.x5FKH0Oc031817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 20:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349076 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B8558A9E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 20:17:01 -0000 Author: ian Date: Sat Jun 15 20:17:00 2019 New Revision: 349076 URL: https://svnweb.freebsd.org/changeset/base/349076 Log: Use device_delete_children() instead of a locally-rolled copy of it that leaks the device-list memory. Modified: head/sys/dev/pwm/pwmbus.c Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:13:42 2019 (r349075) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:17:00 2019 (r349076) @@ -92,20 +92,12 @@ pwmbus_attach(device_t dev) static int pwmbus_detach(device_t dev) { - device_t *devlist; - int i, rv, ndevs; + int rv; - rv = bus_generic_detach(dev); - if (rv != 0) - return (rv); + if ((rv = bus_generic_detach(dev)) == 0) + rv = device_delete_children(dev); - rv = device_get_children(dev, &devlist, &ndevs); - if (rv != 0) - return (rv); - for (i = 0; i < ndevs; i++) - device_delete_child(dev, devlist[i]); - - return (0); + return (rv); } static int From owner-svn-src-head@freebsd.org Sat Jun 15 20:20:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE44115CEF45; Sat, 15 Jun 2019 20:20:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1128AB82; Sat, 15 Jun 2019 20:20:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F3742CE; Sat, 15 Jun 2019 20:20:37 +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 x5FKKbkJ032017; Sat, 15 Jun 2019 20:20:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FKKb2E032016; Sat, 15 Jun 2019 20:20:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152020.x5FKKb2E032016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 20:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349077 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 349077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E1128AB82 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 20:20:38 -0000 Author: ian Date: Sat Jun 15 20:20:36 2019 New Revision: 349077 URL: https://svnweb.freebsd.org/changeset/base/349077 Log: Add a missing #include. I suspect this used to get included via some header pollution that was cleaned up recently, and this file got missed in the cleanup because it's not attached to the build unless you specifically request this device in a custom kernel config. Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtpps.c Sat Jun 15 20:17:00 2019 (r349076) +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Sat Jun 15 20:20:36 2019 (r349077) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Sat Jun 15 20:53:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 969D715CFCC8; Sat, 15 Jun 2019 20:53:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 391C38BEB2; Sat, 15 Jun 2019 20:53:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 274B44960; Sat, 15 Jun 2019 20:53: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 x5FKrR40052668; Sat, 15 Jun 2019 20:53:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FKrRhp052667; Sat, 15 Jun 2019 20:53:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152053.x5FKrRhp052667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 20:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349080 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 391C38BEB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 20:53:27 -0000 Author: ian Date: Sat Jun 15 20:53:26 2019 New Revision: 349080 URL: https://svnweb.freebsd.org/changeset/base/349080 Log: Make pwmbus driver and devclass vars static; they're not mentioned in any header file, so they can't be used outside this file anyway. Modified: head/sys/dev/pwm/pwmbus.c Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:25:36 2019 (r349079) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:53:26 2019 (r349080) @@ -195,12 +195,12 @@ static device_method_t pwmbus_methods[] = { DEVMETHOD_END }; -driver_t pwmbus_driver = { +static driver_t pwmbus_driver = { "pwmbus", pwmbus_methods, sizeof(struct pwmbus_softc), }; -devclass_t pwmbus_devclass; +static devclass_t pwmbus_devclass; EARLY_DRIVER_MODULE(pwmbus, pwm, pwmbus_driver, pwmbus_devclass, 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Sat Jun 15 20:54:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DBC15CFD2D; Sat, 15 Jun 2019 20:54:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 492AF8BFF6; Sat, 15 Jun 2019 20:54:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ED724961; Sat, 15 Jun 2019 20:54:34 +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 x5FKsYlM052757; Sat, 15 Jun 2019 20:54:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FKsYUS052756; Sat, 15 Jun 2019 20:54:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152054.x5FKsYUS052756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 20:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349081 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 492AF8BFF6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 20:54:34 -0000 Author: ian Date: Sat Jun 15 20:54:33 2019 New Revision: 349081 URL: https://svnweb.freebsd.org/changeset/base/349081 Log: Unwrap prototype lines so that return type and function name are on the same line. No functional changes. Modified: head/sys/dev/pwm/pwmbus.h Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sat Jun 15 20:53:26 2019 (r349080) +++ head/sys/dev/pwm/pwmbus.h Sat Jun 15 20:54:33 2019 (r349081) @@ -43,17 +43,13 @@ struct pwm_channel { }; typedef struct pwm_channel *pwm_channel_t; -int -pwm_get_by_ofw_propidx(device_t consumer, phandle_t node, +int pwm_get_by_ofw_propidx(device_t consumer, phandle_t node, const char *prop_name, int idx, pwm_channel_t *channel); -int -pwm_get_by_ofw_idx(device_t consumer, phandle_t node, int idx, +int pwm_get_by_ofw_idx(device_t consumer, phandle_t node, int idx, pwm_channel_t *out_channel); -int -pwm_get_by_ofw_property(device_t consumer, phandle_t node, +int pwm_get_by_ofw_property(device_t consumer, phandle_t node, const char *prop_name, pwm_channel_t *out_channel); -int -pwm_get_by_ofw_name(device_t consumer, phandle_t node, const char *name, +int pwm_get_by_ofw_name(device_t consumer, phandle_t node, const char *name, pwm_channel_t *out_channel); #endif /* _PWMBUS_H_ */ From owner-svn-src-head@freebsd.org Sat Jun 15 21:19:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAFF815D01B1; Sat, 15 Jun 2019 21:19:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31C4A8C7E6; Sat, 15 Jun 2019 21:19: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E72344CC5; Sat, 15 Jun 2019 21:19:23 +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 x5FLJNSo063364; Sat, 15 Jun 2019 21:19:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FLJNG0063363; Sat, 15 Jun 2019 21:19:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152119.x5FLJNG0063363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 21:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349082 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31C4A8C7E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 21:19:25 -0000 Author: ian Date: Sat Jun 15 21:19:23 2019 New Revision: 349082 URL: https://svnweb.freebsd.org/changeset/base/349082 Log: Spell unsigned int as u_int and channel as chan; eliminates the need to wrap some long lines. Modified: head/sys/dev/pwm/pwmbus.c Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 20:54:33 2019 (r349081) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 21:19:23 2019 (r349082) @@ -101,81 +101,81 @@ pwmbus_detach(device_t dev) } static int -pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned int duty) +pwmbus_channel_config(device_t bus, int chan, u_int period, u_int duty) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_CONFIG(sc->dev, channel, period, duty)); + return (PWM_CHANNEL_CONFIG(sc->dev, chan, period, duty)); } static int -pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, unsigned int *duty) +pwmbus_channel_get_config(device_t bus, int chan, u_int *period, u_int *duty) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_GET_CONFIG(sc->dev, channel, period, duty)); + return (PWM_CHANNEL_GET_CONFIG(sc->dev, chan, period, duty)); } static int -pwmbus_channel_set_flags(device_t bus, int channel, uint32_t flags) +pwmbus_channel_set_flags(device_t bus, int chan, uint32_t flags) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_SET_FLAGS(sc->dev, channel, flags)); + return (PWM_CHANNEL_SET_FLAGS(sc->dev, chan, flags)); } static int -pwmbus_channel_get_flags(device_t bus, int channel, uint32_t *flags) +pwmbus_channel_get_flags(device_t bus, int chan, uint32_t *flags) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_GET_FLAGS(sc->dev, channel, flags)); + return (PWM_CHANNEL_GET_FLAGS(sc->dev, chan, flags)); } static int -pwmbus_channel_enable(device_t bus, int channel, bool enable) +pwmbus_channel_enable(device_t bus, int chan, bool enable) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_ENABLE(sc->dev, channel, enable)); + return (PWM_CHANNEL_ENABLE(sc->dev, chan, enable)); } static int -pwmbus_channel_is_enabled(device_t bus, int channel, bool *enable) +pwmbus_channel_is_enabled(device_t bus, int chan, bool *enable) { struct pwmbus_softc *sc; sc = device_get_softc(bus); - if (channel > sc->nchannels) + if (chan > sc->nchannels) return (EINVAL); - return (PWM_CHANNEL_IS_ENABLED(sc->dev, channel, enable)); + return (PWM_CHANNEL_IS_ENABLED(sc->dev, chan, enable)); } static device_method_t pwmbus_methods[] = { From owner-svn-src-head@freebsd.org Sat Jun 15 21:31:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EDBF15D040B; Sat, 15 Jun 2019 21:31:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F1A8CDD6; Sat, 15 Jun 2019 21:31:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5187F4EA8; Sat, 15 Jun 2019 21:31:05 +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 x5FLV52R068651; Sat, 15 Jun 2019 21:31:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FLV524068650; Sat, 15 Jun 2019 21:31:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152131.x5FLV524068650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 21:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349083 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 349083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1F1A8CDD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 21:31:06 -0000 Author: ian Date: Sat Jun 15 21:31:04 2019 New Revision: 349083 URL: https://svnweb.freebsd.org/changeset/base/349083 Log: Give the aw_pwm driver a module version. Modified: head/sys/arm/allwinner/aw_pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:19:23 2019 (r349082) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:31:04 2019 (r349083) @@ -381,4 +381,5 @@ static driver_t aw_pwm_driver = { static devclass_t aw_pwm_devclass; DRIVER_MODULE(aw_pwm, simplebus, aw_pwm_driver, aw_pwm_devclass, 0, 0); +MODULE_VERSION(aw_pwm, 1); SIMPLEBUS_PNP_INFO(compat_data); From owner-svn-src-head@freebsd.org Sat Jun 15 21:36:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB8515D0622; Sat, 15 Jun 2019 21:36:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 216148D091; Sat, 15 Jun 2019 21:36:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1D2C5022; Sat, 15 Jun 2019 21:36:15 +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 x5FLaFWi073798; Sat, 15 Jun 2019 21:36:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FLaFCV073795; Sat, 15 Jun 2019 21:36:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152136.x5FLaFCV073795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 21:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349084 - in head/sys: arm/allwinner dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner dev/pwm X-SVN-Commit-Revision: 349084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 216148D091 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 21:36:16 -0000 Author: ian Date: Sat Jun 15 21:36:14 2019 New Revision: 349084 URL: https://svnweb.freebsd.org/changeset/base/349084 Log: Rename the channel_max method to channel_count, because that's what it's returning. (If the channel count is 2, then the max channel number is 1.) Modified: head/sys/arm/allwinner/aw_pwm.c head/sys/dev/pwm/pwm_if.m head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmc.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:31:04 2019 (r349083) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:36:14 2019 (r349084) @@ -226,7 +226,7 @@ aw_pwm_detach(device_t dev) } static int -aw_pwm_channel_max(device_t dev, int *nchannel) +aw_pwm_channel_count(device_t dev, int *nchannel) { *nchannel = 1; @@ -363,7 +363,7 @@ static device_method_t aw_pwm_methods[] = { /* pwm interface */ DEVMETHOD(pwm_get_bus, aw_pwm_get_bus), - DEVMETHOD(pwm_channel_max, aw_pwm_channel_max), + DEVMETHOD(pwm_channel_count, aw_pwm_channel_count), DEVMETHOD(pwm_channel_config, aw_pwm_channel_config), DEVMETHOD(pwm_channel_get_config, aw_pwm_channel_get_config), DEVMETHOD(pwm_channel_enable, aw_pwm_channel_enable), Modified: head/sys/dev/pwm/pwm_if.m ============================================================================== --- head/sys/dev/pwm/pwm_if.m Sat Jun 15 21:31:04 2019 (r349083) +++ head/sys/dev/pwm/pwm_if.m Sat Jun 15 21:36:14 2019 (r349084) @@ -100,7 +100,7 @@ METHOD int channel_is_enabled { # # Get the number of channels # -METHOD int channel_max { +METHOD int channel_count { device_t dev; int *nchannel; }; Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 21:31:04 2019 (r349083) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 21:36:14 2019 (r349084) @@ -78,7 +78,7 @@ pwmbus_attach(device_t dev) sc->busdev = dev; sc->dev = device_get_parent(dev); - if (PWM_CHANNEL_MAX(sc->dev, &sc->nchannels) != 0 || + if (PWM_CHANNEL_COUNT(sc->dev, &sc->nchannels) != 0 || sc->nchannels == 0) return (ENXIO); Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 21:31:04 2019 (r349083) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 21:36:14 2019 (r349084) @@ -67,7 +67,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PWMMAXCHANNEL: nchannel = -1; - rv = PWM_CHANNEL_MAX(sc->pdev, &nchannel); + rv = PWM_CHANNEL_COUNT(sc->pdev, &nchannel); bcopy(&nchannel, data, sizeof(nchannel)); break; case PWMSETSTATE: From owner-svn-src-head@freebsd.org Sat Jun 15 21:51:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251A715D0CE4; Sat, 15 Jun 2019 21:51:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB6D8D8DB; Sat, 15 Jun 2019 21:51:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AA875356; Sat, 15 Jun 2019 21:51:55 +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 x5FLptW6083760; Sat, 15 Jun 2019 21:51:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FLpt71083759; Sat, 15 Jun 2019 21:51:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152151.x5FLpt71083759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 21:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349085 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEB6D8D8DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 21:51:56 -0000 Author: ian Date: Sat Jun 15 21:51:55 2019 New Revision: 349085 URL: https://svnweb.freebsd.org/changeset/base/349085 Log: Destroy the cdev on device detach. Also, make the driver and devclass static, because nothing outside this file needs them. Modified: head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 21:36:14 2019 (r349084) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 21:51:55 2019 (r349085) @@ -137,6 +137,10 @@ pwmc_attach(device_t dev) static int pwmc_detach(device_t dev) { + struct pwmc_softc *sc; + + sc = device_get_softc(dev); + destroy_dev(sc->pwm_dev); return (0); } @@ -150,12 +154,12 @@ static device_method_t pwmc_methods[] = { DEVMETHOD_END }; -driver_t pwmc_driver = { +static driver_t pwmc_driver = { "pwmc", pwmc_methods, sizeof(struct pwmc_softc), }; -devclass_t pwmc_devclass; +static devclass_t pwmc_devclass; DRIVER_MODULE(pwmc, pwm, pwmc_driver, pwmc_devclass, 0, 0); MODULE_VERSION(pwmc, 1); From owner-svn-src-head@freebsd.org Sat Jun 15 22:25:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5656F15D1431; Sat, 15 Jun 2019 22:25:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9DFD8E664; Sat, 15 Jun 2019 22:25:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C07065880; Sat, 15 Jun 2019 22:25:40 +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 x5FMPe24099891; Sat, 15 Jun 2019 22:25:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FMPd3v099885; Sat, 15 Jun 2019 22:25:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152225.x5FMPd3v099885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 22:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349086 - in head/sys: arm/allwinner conf dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner conf dev/pwm X-SVN-Commit-Revision: 349086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9DFD8E664 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 22:25:41 -0000 Author: ian Date: Sat Jun 15 22:25:39 2019 New Revision: 349086 URL: https://svnweb.freebsd.org/changeset/base/349086 Log: Restructure the pwm device hirearchy and interfaces. The pwm and pwmbus interfaces were nearly identical, this merges them into a single pwmbus interface. The pwmbus driver now implements the pwmbus interface by simply passing all calls through to its parent (the hardware driver). The channel_count method moves from pwm to pwmbus, and the get_bus method is deleted (just no longer needed). The net effect is that the interface for doing pwm stuff is now the same regardless of whether you're a child of pwmbus, or some random driver elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking directly to the hardware driver via cross-hierarchy connections established using fdt data. The pwmc driver is now a child of pwmbus, instead of being its sibling (that's why the get_bus method is no longer needed; pwmc now gets the device_t of the bus using device_get_parent()). Deleted: head/sys/dev/pwm/pwm_if.m Modified: head/sys/arm/allwinner/aw_pwm.c head/sys/conf/files head/sys/dev/pwm/ofw_pwm.c head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmbus.h head/sys/dev/pwm/pwmbus_if.m head/sys/dev/pwm/pwmc.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 22:25:39 2019 (r349086) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include -#include "pwm_if.h" +#include "pwmbus_if.h" #define AW_PWM_CTRL 0x00 #define AW_PWM_CTRL_PRESCALE_MASK 0xF @@ -346,28 +346,18 @@ aw_pwm_channel_is_enabled(device_t dev, int channel, b return (0); } -static device_t -aw_pwm_get_bus(device_t dev) -{ - struct aw_pwm_softc *sc; - - sc = device_get_softc(dev); - - return (sc->busdev); -} static device_method_t aw_pwm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, aw_pwm_probe), DEVMETHOD(device_attach, aw_pwm_attach), DEVMETHOD(device_detach, aw_pwm_detach), - /* pwm interface */ - DEVMETHOD(pwm_get_bus, aw_pwm_get_bus), - DEVMETHOD(pwm_channel_count, aw_pwm_channel_count), - DEVMETHOD(pwm_channel_config, aw_pwm_channel_config), - DEVMETHOD(pwm_channel_get_config, aw_pwm_channel_get_config), - DEVMETHOD(pwm_channel_enable, aw_pwm_channel_enable), - DEVMETHOD(pwm_channel_is_enabled, aw_pwm_channel_is_enabled), + /* pwmbus interface */ + DEVMETHOD(pwmbus_channel_count, aw_pwm_channel_count), + DEVMETHOD(pwmbus_channel_config, aw_pwm_channel_config), + DEVMETHOD(pwmbus_channel_get_config, aw_pwm_channel_get_config), + DEVMETHOD(pwmbus_channel_enable, aw_pwm_channel_enable), + DEVMETHOD(pwmbus_channel_is_enabled, aw_pwm_channel_is_enabled), DEVMETHOD_END }; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/conf/files Sat Jun 15 22:25:39 2019 (r349086) @@ -2702,7 +2702,6 @@ dev/puc/puc_pccard.c optional puc pccard dev/puc/puc_pci.c optional puc pci dev/pwm/pwmc.c optional pwm | pwmc dev/pwm/pwmbus.c optional pwm | pwmbus -dev/pwm/pwm_if.m optional pwm | pwmbus dev/pwm/pwmbus_if.m optional pwm | pwmbus dev/pwm/ofw_pwm.c optional pwm fdt | pwmbus fdt dev/quicc/quicc_core.c optional quicc Modified: head/sys/dev/pwm/ofw_pwm.c ============================================================================== --- head/sys/dev/pwm/ofw_pwm.c Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/dev/pwm/ofw_pwm.c Sat Jun 15 22:25:39 2019 (r349086) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include -#include "pwm_if.h" +#include "pwmbus_if.h" int pwm_get_by_ofw_propidx(device_t consumer, phandle_t node, @@ -58,12 +58,6 @@ pwm_get_by_ofw_propidx(device_t consumer, phandle_t no channel.dev = OF_device_from_xref(xref); if (channel.dev == NULL) { - OF_prop_free(cells); - return (ENODEV); - } - - channel.busdev = PWM_GET_BUS(channel.dev); - if (channel.busdev == NULL) { OF_prop_free(cells); return (ENODEV); } Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 22:25:39 2019 (r349086) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include "pwmbus_if.h" -#include "pwm_if.h" struct pwmbus_channel_data { int reserved; @@ -55,8 +54,8 @@ struct pwmbus_channel_data { }; struct pwmbus_softc { - device_t busdev; device_t dev; + device_t parent; int nchannels; }; @@ -75,15 +74,18 @@ pwmbus_attach(device_t dev) struct pwmbus_softc *sc; sc = device_get_softc(dev); - sc->busdev = dev; - sc->dev = device_get_parent(dev); + sc->dev = dev; + sc->parent = device_get_parent(dev); - if (PWM_CHANNEL_COUNT(sc->dev, &sc->nchannels) != 0 || - sc->nchannels == 0) + if (PWMBUS_CHANNEL_COUNT(sc->parent, &sc->nchannels) != 0 || + sc->nchannels == 0) { + device_printf(sc->dev, "No channels on parent %s\n", + device_get_nameunit(sc->parent)); return (ENXIO); + } - if (bootverbose) - device_printf(dev, "Registering %d channel(s)\n", sc->nchannels); + device_add_child(sc->dev, "pwmc", -1); + bus_generic_probe(dev); return (bus_generic_attach(dev)); @@ -101,96 +103,61 @@ pwmbus_detach(device_t dev) } static int -pwmbus_channel_config(device_t bus, int chan, u_int period, u_int duty) +pwmbus_channel_config(device_t dev, int chan, u_int period, u_int duty) { - struct pwmbus_softc *sc; - - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_CONFIG(sc->dev, chan, period, duty)); + return (PWMBUS_CHANNEL_CONFIG(device_get_parent(dev), chan, period, duty)); } static int -pwmbus_channel_get_config(device_t bus, int chan, u_int *period, u_int *duty) +pwmbus_channel_get_config(device_t dev, int chan, u_int *period, u_int *duty) { - struct pwmbus_softc *sc; - - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_GET_CONFIG(sc->dev, chan, period, duty)); + return (PWMBUS_CHANNEL_GET_CONFIG(device_get_parent(dev), chan, period, duty)); } static int -pwmbus_channel_set_flags(device_t bus, int chan, uint32_t flags) +pwmbus_channel_get_flags(device_t dev, int chan, uint32_t *flags) { - struct pwmbus_softc *sc; - - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_SET_FLAGS(sc->dev, chan, flags)); + return (PWMBUS_CHANNEL_GET_FLAGS(device_get_parent(dev), chan, flags)); } static int -pwmbus_channel_get_flags(device_t bus, int chan, uint32_t *flags) +pwmbus_channel_enable(device_t dev, int chan, bool enable) { - struct pwmbus_softc *sc; - - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_GET_FLAGS(sc->dev, chan, flags)); + return (PWMBUS_CHANNEL_ENABLE(device_get_parent(dev), chan, enable)); } static int -pwmbus_channel_enable(device_t bus, int chan, bool enable) +pwmbus_channel_set_flags(device_t dev, int chan, uint32_t flags) { - struct pwmbus_softc *sc; - - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_ENABLE(sc->dev, chan, enable)); + return (PWMBUS_CHANNEL_SET_FLAGS(device_get_parent(dev), chan, flags)); } static int -pwmbus_channel_is_enabled(device_t bus, int chan, bool *enable) +pwmbus_channel_is_enabled(device_t dev, int chan, bool *enable) { - struct pwmbus_softc *sc; + return (PWMBUS_CHANNEL_IS_ENABLED(device_get_parent(dev), chan, enable)); +} - sc = device_get_softc(bus); - - if (chan > sc->nchannels) - return (EINVAL); - - return (PWM_CHANNEL_IS_ENABLED(sc->dev, chan, enable)); +static int +pwmbus_channel_count(device_t dev, int *nchannel) +{ + return (PWMBUS_CHANNEL_COUNT(device_get_parent(dev), nchannel)); } static device_method_t pwmbus_methods[] = { /* device_if */ - DEVMETHOD(device_probe, pwmbus_probe), + DEVMETHOD(device_probe, pwmbus_probe), DEVMETHOD(device_attach, pwmbus_attach), DEVMETHOD(device_detach, pwmbus_detach), - /* pwm interface */ - DEVMETHOD(pwmbus_channel_config, pwmbus_channel_config), - DEVMETHOD(pwmbus_channel_get_config, pwmbus_channel_get_config), - DEVMETHOD(pwmbus_channel_set_flags, pwmbus_channel_set_flags), - DEVMETHOD(pwmbus_channel_get_flags, pwmbus_channel_get_flags), - DEVMETHOD(pwmbus_channel_enable, pwmbus_channel_enable), - DEVMETHOD(pwmbus_channel_is_enabled, pwmbus_channel_is_enabled), + /* pwmbus_if */ + DEVMETHOD(pwmbus_channel_count, pwmbus_channel_count), + DEVMETHOD(pwmbus_channel_config, pwmbus_channel_config), + DEVMETHOD(pwmbus_channel_get_config, pwmbus_channel_get_config), + DEVMETHOD(pwmbus_channel_set_flags, pwmbus_channel_set_flags), + DEVMETHOD(pwmbus_channel_get_flags, pwmbus_channel_get_flags), + DEVMETHOD(pwmbus_channel_enable, pwmbus_channel_enable), + DEVMETHOD(pwmbus_channel_is_enabled, pwmbus_channel_is_enabled), DEVMETHOD_END }; Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/dev/pwm/pwmbus.h Sat Jun 15 22:25:39 2019 (r349086) @@ -34,7 +34,6 @@ struct pwm_channel { device_t dev; - device_t busdev; int channel; uint64_t period; uint64_t duty; Modified: head/sys/dev/pwm/pwmbus_if.m ============================================================================== --- head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 22:25:39 2019 (r349086) @@ -105,3 +105,11 @@ METHOD int channel_is_enabled { int channel; bool *enabled; }; + +# +# Get the number of channels +# +METHOD int channel_count { + device_t bus; + int *nchannel; +}; Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 21:51:55 2019 (r349085) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 22:25:39 2019 (r349086) @@ -40,11 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include "pwmbus_if.h" -#include "pwm_if.h" struct pwmc_softc { device_t dev; - device_t pdev; struct cdev *pwm_dev; char name[32]; }; @@ -60,14 +58,12 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int rv = 0; sc = dev->si_drv1; - bus = PWM_GET_BUS(sc->pdev); - if (bus == NULL) - return (EINVAL); + bus = device_get_parent(sc->dev); switch (cmd) { case PWMMAXCHANNEL: nchannel = -1; - rv = PWM_CHANNEL_COUNT(sc->pdev, &nchannel); + rv = PWMBUS_CHANNEL_COUNT(bus, &nchannel); bcopy(&nchannel, data, sizeof(nchannel)); break; case PWMSETSTATE: @@ -106,7 +102,7 @@ pwmc_probe(device_t dev) { device_set_desc(dev, "PWM Controller"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int @@ -117,7 +113,6 @@ pwmc_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->pdev = device_get_parent(dev); snprintf(sc->name, sizeof(sc->name), "pwmc%d", device_get_unit(dev)); make_dev_args_init(&args); @@ -161,5 +156,6 @@ static driver_t pwmc_driver = { }; static devclass_t pwmc_devclass; -DRIVER_MODULE(pwmc, pwm, pwmc_driver, pwmc_devclass, 0, 0); +DRIVER_MODULE(pwmc, pwmbus, pwmc_driver, pwmc_devclass, 0, 0); +MODULE_DEPEND(pwmc, pwmbus, 1, 1, 1); MODULE_VERSION(pwmc, 1); From owner-svn-src-head@freebsd.org Sat Jun 15 23:02:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9543915D1F0A; Sat, 15 Jun 2019 23:02:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38B248F6E4; Sat, 15 Jun 2019 23:02:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13DF55F02; Sat, 15 Jun 2019 23:02:11 +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 x5FN2AWq019243; Sat, 15 Jun 2019 23:02:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5FN297n019226; Sat, 15 Jun 2019 23:02:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906152302.x5FN297n019226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Jun 2019 23:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349088 - in head: sys/arm/allwinner sys/dev/pwm usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: sys/arm/allwinner sys/dev/pwm usr.sbin/pwm X-SVN-Commit-Revision: 349088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38B248F6E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 Jun 2019 23:02:11 -0000 Author: ian Date: Sat Jun 15 23:02:09 2019 New Revision: 349088 URL: https://svnweb.freebsd.org/changeset/base/349088 Log: Make pwm channel numbers unsigned. Modified: head/sys/arm/allwinner/aw_pwm.c head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmbus.h head/sys/dev/pwm/pwmbus_if.m head/sys/dev/pwm/pwmc.c head/usr.sbin/pwm/pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 23:00:23 2019 (r349087) +++ head/sys/arm/allwinner/aw_pwm.c Sat Jun 15 23:02:09 2019 (r349088) @@ -226,7 +226,7 @@ aw_pwm_detach(device_t dev) } static int -aw_pwm_channel_count(device_t dev, int *nchannel) +aw_pwm_channel_count(device_t dev, u_int *nchannel) { *nchannel = 1; @@ -235,7 +235,7 @@ aw_pwm_channel_count(device_t dev, int *nchannel) } static int -aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned int duty) +aw_pwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty) { struct aw_pwm_softc *sc; uint64_t period_freq, duty_freq; @@ -298,7 +298,7 @@ aw_pwm_channel_config(device_t dev, int channel, unsig } static int -aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, unsigned int *duty) +aw_pwm_channel_get_config(device_t dev, u_int channel, u_int *period, u_int *duty) { struct aw_pwm_softc *sc; @@ -311,7 +311,7 @@ aw_pwm_channel_get_config(device_t dev, int channel, u } static int -aw_pwm_channel_enable(device_t dev, int channel, bool enable) +aw_pwm_channel_enable(device_t dev, u_int channel, bool enable) { struct aw_pwm_softc *sc; uint32_t reg; @@ -335,7 +335,7 @@ aw_pwm_channel_enable(device_t dev, int channel, bool } static int -aw_pwm_channel_is_enabled(device_t dev, int channel, bool *enabled) +aw_pwm_channel_is_enabled(device_t dev, u_int channel, bool *enabled) { struct aw_pwm_softc *sc; Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sat Jun 15 23:00:23 2019 (r349087) +++ head/sys/dev/pwm/pwmbus.c Sat Jun 15 23:02:09 2019 (r349088) @@ -57,7 +57,7 @@ struct pwmbus_softc { device_t dev; device_t parent; - int nchannels; + u_int nchannels; }; static int @@ -103,43 +103,43 @@ pwmbus_detach(device_t dev) } static int -pwmbus_channel_config(device_t dev, int chan, u_int period, u_int duty) +pwmbus_channel_config(device_t dev, u_int chan, u_int period, u_int duty) { return (PWMBUS_CHANNEL_CONFIG(device_get_parent(dev), chan, period, duty)); } static int -pwmbus_channel_get_config(device_t dev, int chan, u_int *period, u_int *duty) +pwmbus_channel_get_config(device_t dev, u_int chan, u_int *period, u_int *duty) { return (PWMBUS_CHANNEL_GET_CONFIG(device_get_parent(dev), chan, period, duty)); } static int -pwmbus_channel_get_flags(device_t dev, int chan, uint32_t *flags) +pwmbus_channel_get_flags(device_t dev, u_int chan, uint32_t *flags) { return (PWMBUS_CHANNEL_GET_FLAGS(device_get_parent(dev), chan, flags)); } static int -pwmbus_channel_enable(device_t dev, int chan, bool enable) +pwmbus_channel_enable(device_t dev, u_int chan, bool enable) { return (PWMBUS_CHANNEL_ENABLE(device_get_parent(dev), chan, enable)); } static int -pwmbus_channel_set_flags(device_t dev, int chan, uint32_t flags) +pwmbus_channel_set_flags(device_t dev, u_int chan, uint32_t flags) { return (PWMBUS_CHANNEL_SET_FLAGS(device_get_parent(dev), chan, flags)); } static int -pwmbus_channel_is_enabled(device_t dev, int chan, bool *enable) +pwmbus_channel_is_enabled(device_t dev, u_int chan, bool *enable) { return (PWMBUS_CHANNEL_IS_ENABLED(device_get_parent(dev), chan, enable)); } static int -pwmbus_channel_count(device_t dev, int *nchannel) +pwmbus_channel_count(device_t dev, u_int *nchannel) { return (PWMBUS_CHANNEL_COUNT(device_get_parent(dev), nchannel)); } Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sat Jun 15 23:00:23 2019 (r349087) +++ head/sys/dev/pwm/pwmbus.h Sat Jun 15 23:02:09 2019 (r349088) @@ -34,7 +34,7 @@ struct pwm_channel { device_t dev; - int channel; + u_int channel; uint64_t period; uint64_t duty; uint32_t flags; Modified: head/sys/dev/pwm/pwmbus_if.m ============================================================================== --- head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 23:00:23 2019 (r349087) +++ head/sys/dev/pwm/pwmbus_if.m Sat Jun 15 23:02:09 2019 (r349088) @@ -33,14 +33,14 @@ INTERFACE pwmbus; CODE { static int - pwm_default_set_flags(device_t dev, int channel, uint32_t flags) + pwm_default_set_flags(device_t dev, u_int channel, uint32_t flags) { return (EOPNOTSUPP); } static int - pwm_default_get_flags(device_t dev, int channel, uint32_t *flags) + pwm_default_get_flags(device_t dev, u_int channel, uint32_t *flags) { *flags = 0; @@ -54,7 +54,7 @@ CODE { # METHOD int channel_config { device_t bus; - int channel; + u_int channel; unsigned int period; unsigned int duty; }; @@ -65,7 +65,7 @@ METHOD int channel_config { # METHOD int channel_get_config { device_t bus; - int channel; + u_int channel; unsigned int *period; unsigned int *duty; }; @@ -75,7 +75,7 @@ METHOD int channel_get_config { # METHOD int channel_set_flags { device_t bus; - int channel; + u_int channel; uint32_t flags; } DEFAULT pwm_default_set_flags; @@ -84,7 +84,7 @@ METHOD int channel_set_flags { # METHOD int channel_get_flags { device_t dev; - int channel; + u_int channel; uint32_t *flags; } DEFAULT pwm_default_get_flags; @@ -93,7 +93,7 @@ METHOD int channel_get_flags { # METHOD int channel_enable { device_t bus; - int channel; + u_int channel; bool enable; }; @@ -102,7 +102,7 @@ METHOD int channel_enable { # METHOD int channel_is_enabled { device_t bus; - int channel; + u_int channel; bool *enabled; }; @@ -111,5 +111,5 @@ METHOD int channel_is_enabled { # METHOD int channel_count { device_t bus; - int *nchannel; + u_int *nchannel; }; Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 23:00:23 2019 (r349087) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 23:02:09 2019 (r349088) @@ -54,7 +54,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, struct pwmc_softc *sc; struct pwm_state state; device_t bus; - int nchannel; + u_int nchannel; int rv = 0; sc = dev->si_drv1; @@ -62,7 +62,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PWMMAXCHANNEL: - nchannel = -1; + nchannel = 0; rv = PWMBUS_CHANNEL_COUNT(bus, &nchannel); bcopy(&nchannel, data, sizeof(nchannel)); break; Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Sat Jun 15 23:00:23 2019 (r349087) +++ head/usr.sbin/pwm/pwm.c Sat Jun 15 23:02:09 2019 (r349088) @@ -66,7 +66,7 @@ main(int argc, char *argv[]) { struct pwm_state state; int fd; - int channel, nchannels; + u_int channel, nchannels; int period, duty; int action, ch; cap_rights_t right_ioctl; @@ -75,7 +75,7 @@ main(int argc, char *argv[]) action = 0; fd = -1; - channel = -1; + channel = -1u; period = duty = -1; while ((ch = getopt(argc, argv, "f:c:EDCp:d:")) != -1) { @@ -110,9 +110,9 @@ main(int argc, char *argv[]) usage(); break; case 'c': - if (channel != -1) + if (channel != -1u) usage(); - channel = strtol(optarg, NULL, 10); + channel = strtoul(optarg, NULL, 10); break; case 'f': if ((fd = open(optarg, O_RDWR)) < 0) {