From owner-svn-src-head@freebsd.org Sun Jun 2 00: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 C3A9215C8C5C; Sun, 2 Jun 2019 00:08:25 +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 5D43683E21; Sun, 2 Jun 2019 00:08:25 +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 419FD1F227; Sun, 2 Jun 2019 00:08:25 +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 x5208PfT027575; Sun, 2 Jun 2019 00:08:25 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5208OpX027573; Sun, 2 Jun 2019 00:08:24 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201906020008.x5208OpX027573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 2 Jun 2019 00:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348501 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 348501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D43683E21 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: Sun, 02 Jun 2019 00:08:26 -0000 Author: bdragon Date: Sun Jun 2 00:08:24 2019 New Revision: 348501 URL: https://svnweb.freebsd.org/changeset/base/348501 Log: Add myself to committers-src.dot and calendar.freebsd Approved by: jhibbits (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat Jun 1 20:08:10 2019 (r348500) +++ head/share/misc/committers-src.dot Sun Jun 2 00:08:24 2019 (r348501) @@ -124,6 +124,7 @@ badger [label="Eric Badger\nbadger@FreeBSD.org\n2016/0 bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] bcran [label="Rebecca Cran\nbcran@FreeBSD.org\n2010/01/29"] bde [label="Bruce Evans\nbde@FreeBSD.org\n1994/08/20"] +bdragon [label="Brandon Bergren\nbdragon@FreeBSD.org\n2019/05/31"] bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] @@ -607,6 +608,7 @@ jhb -> rnoland jhb -> rpokala jhb -> arichardson +jhibbits -> bdragon jhibbits -> leitao jhibbits -> luporl Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Jun 1 20:08:10 2019 (r348500) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Jun 2 00:08:24 2019 (r348501) @@ -91,6 +91,7 @@ 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 02/24 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 +02/24 Brandon Bergren born in Edmond, Oklahoma, United States, 1984 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 From owner-svn-src-head@freebsd.org Sun Jun 2 01:00: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 3057C15A4CC6; Sun, 2 Jun 2019 01:00:20 +0000 (UTC) (envelope-from markj@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 C5CAB85076; Sun, 2 Jun 2019 01:00:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB94A1FA64; Sun, 2 Jun 2019 01:00:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5210JdC053785; Sun, 2 Jun 2019 01:00:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5210Iwr053778; Sun, 2 Jun 2019 01:00:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906020100.x5210Iwr053778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Jun 2019 01:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348502 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5CAB85076 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.961,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, 02 Jun 2019 01:00:20 -0000 Author: markj Date: Sun Jun 2 01:00:17 2019 New Revision: 348502 URL: https://svnweb.freebsd.org/changeset/base/348502 Log: Add a vm_page_wired() predicate. Use it instead of accessing the wire_count field directly. No functional change intended. Reviewed by: alc, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20485 Modified: head/sys/vm/memguard.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/memguard.c Sun Jun 2 01:00:17 2019 (r348502) @@ -262,7 +262,7 @@ v2sizep(vm_offset_t va) if (pa == 0) panic("MemGuard detected double-free of %p", (void *)va); p = PHYS_TO_VM_PAGE(pa); - KASSERT(p->wire_count != 0 && p->queue == PQ_NONE, + KASSERT(vm_page_wired(p) && p->queue == PQ_NONE, ("MEMGUARD: Expected wired page %p in vtomgfifo!", p)); return (&p->plinks.memguard.p); } @@ -277,7 +277,7 @@ v2sizev(vm_offset_t va) if (pa == 0) panic("MemGuard detected double-free of %p", (void *)va); p = PHYS_TO_VM_PAGE(pa); - KASSERT(p->wire_count != 0 && p->queue == PQ_NONE, + KASSERT(vm_page_wired(p) && p->queue == PQ_NONE, ("MEMGUARD: Expected wired page %p in vtomgfifo!", p)); return (&p->plinks.memguard.v); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/swap_pager.c Sun Jun 2 01:00:17 2019 (r348502) @@ -1679,7 +1679,7 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t vm_page_dirty(m); #ifdef INVARIANTS vm_page_lock(m); - if (m->wire_count == 0 && m->queue == PQ_NONE) + if (!vm_page_wired(m) && m->queue == PQ_NONE) panic("page %p is neither wired nor queued", m); vm_page_unlock(m); #endif Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/vm_fault.c Sun Jun 2 01:00:17 2019 (r348502) @@ -1004,7 +1004,7 @@ readrest: */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { vm_page_lock(fs.m); - if (fs.m->wire_count == 0) + if (!vm_page_wired(fs.m)) vm_page_free(fs.m); else vm_page_xunbusy_maybelocked(fs.m); @@ -1027,7 +1027,7 @@ readrest: */ if (fs.object != fs.first_object) { vm_page_lock(fs.m); - if (fs.m->wire_count == 0) + if (!vm_page_wired(fs.m)) vm_page_free(fs.m); else vm_page_xunbusy_maybelocked(fs.m); @@ -1805,7 +1805,7 @@ again: vm_page_wire(dst_m); vm_page_unlock(dst_m); } else { - KASSERT(dst_m->wire_count > 0, + KASSERT(vm_page_wired(dst_m), ("dst_m %p is not wired", dst_m)); } } else { Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/vm_object.c Sun Jun 2 01:00:17 2019 (r348502) @@ -720,7 +720,7 @@ vm_object_terminate_pages(vm_object_t object) */ vm_page_change_lock(p, &mtx); p->object = NULL; - if (p->wire_count != 0) + if (vm_page_wired(p)) continue; VM_CNT_INC(v_pfree); vm_page_free(p); @@ -1595,7 +1595,7 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (p->wire_count == 0) + if (!vm_page_wired(p)) vm_page_free(p); else vm_page_remove(p); @@ -1639,7 +1639,7 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (p->wire_count == 0) + if (!vm_page_wired(p)) vm_page_free(p); else vm_page_remove(p); @@ -1944,7 +1944,7 @@ again: VM_OBJECT_WLOCK(object); goto again; } - if (p->wire_count != 0) { + if (vm_page_wired(p)) { if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0) pmap_remove_all(p); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/vm_page.c Sun Jun 2 01:00:17 2019 (r348502) @@ -2608,7 +2608,7 @@ retry: error = ENOMEM; goto unlock; } - KASSERT(m_new->wire_count == 0, + KASSERT(!vm_page_wired(m_new), ("page %p is wired", m_new)); /* @@ -3434,7 +3434,7 @@ vm_page_activate(vm_page_t m) vm_page_assert_locked(m); - if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) return; if (vm_page_queue(m) == PQ_ACTIVE) { if (m->act_count < ACT_INIT) @@ -3509,7 +3509,7 @@ vm_page_free_prep(vm_page_t m) m->valid = 0; vm_page_undirty(m); - if (m->wire_count != 0) + if (vm_page_wired(m) != 0) panic("vm_page_free_prep: freeing wired page %p", m); if (m->hold_count != 0) { m->flags &= ~PG_ZERO; @@ -3610,7 +3610,7 @@ vm_page_wire(vm_page_t m) m)); return; } - if (m->wire_count == 0) { + if (!vm_page_wired(m)) { KASSERT((m->oflags & VPO_UNMANAGED) == 0 || m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); @@ -3688,7 +3688,7 @@ vm_page_unwire_noq(vm_page_t m) ("vm_page_unwire: fictitious page %p's wire count isn't one", m)); return (false); } - if (m->wire_count == 0) + if (!vm_page_wired(m)) panic("vm_page_unwire: page %p's wire count is zero", m); m->wire_count--; if (m->wire_count == 0) { @@ -3710,7 +3710,7 @@ vm_page_deactivate(vm_page_t m) vm_page_assert_locked(m); - if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) return; if (!vm_page_inactive(m)) { @@ -3734,7 +3734,7 @@ vm_page_deactivate_noreuse(vm_page_t m) vm_page_assert_locked(m); - if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) return; if (!vm_page_inactive(m)) { @@ -3756,7 +3756,7 @@ vm_page_launder(vm_page_t m) { vm_page_assert_locked(m); - if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) return; if (vm_page_in_laundry(m)) @@ -3777,7 +3777,7 @@ vm_page_unswappable(vm_page_t m) { vm_page_assert_locked(m); - KASSERT(m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0, + KASSERT(!vm_page_wired(m) && (m->oflags & VPO_UNMANAGED) == 0, ("page %p already unswappable", m)); vm_page_dequeue(m); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/vm_page.h Sun Jun 2 01:00:17 2019 (r348502) @@ -822,5 +822,12 @@ vm_page_held(vm_page_t m) return (m->hold_count > 0 || m->wire_count > 0); } +static inline bool +vm_page_wired(vm_page_t m) +{ + + return (m->wire_count > 0); +} + #endif /* _KERNEL */ #endif /* !_VM_PAGE_ */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Jun 2 00:08:24 2019 (r348501) +++ head/sys/vm/vm_pageout.c Sun Jun 2 01:00:17 2019 (r348502) @@ -754,7 +754,7 @@ recheck: */ if (m->hold_count != 0) continue; - if (m->wire_count != 0) { + if (vm_page_wired(m)) { vm_page_dequeue_deferred(m); continue; } @@ -1203,7 +1203,7 @@ act_scan: /* * Wired pages are dequeued lazily. */ - if (m->wire_count != 0) { + if (vm_page_wired(m)) { vm_page_dequeue_deferred(m); continue; } @@ -1430,7 +1430,7 @@ recheck: addl_page_shortage++; goto reinsert; } - if (m->wire_count != 0) { + if (vm_page_wired(m)) { vm_page_dequeue_deferred(m); continue; } From owner-svn-src-head@freebsd.org Sun Jun 2 02:38: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 4288615A7D8F; Sun, 2 Jun 2019 02:38:45 +0000 (UTC) (envelope-from kevans@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 D5D5F8744D; Sun, 2 Jun 2019 02:38:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B12E020B42; Sun, 2 Jun 2019 02:38:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x522ci2e005705; Sun, 2 Jun 2019 02:38:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x522ciVN005704; Sun, 2 Jun 2019 02:38:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906020238.x522ciVN005704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Jun 2019 02:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348503 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 348503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5D5F8744D 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.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: Sun, 02 Jun 2019 02:38:45 -0000 Author: kevans Date: Sun Jun 2 02:38:44 2019 New Revision: 348503 URL: https://svnweb.freebsd.org/changeset/base/348503 Log: grep: Move lone 'r'grep case into the adjacent switch This 'r' case should have belonged to the switch in the first place, but I had somehow missed the switch when initially adding the rgrep link. The zgrep script later came along and faithfully left this case standing alone, so we will now go ahead and join it. Nearby comment also adjusted a tad bit for wording and style. Reported by: Daniel Ebdrup MFC after: 3 days Modified: head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sun Jun 2 01:00:17 2019 (r348502) +++ head/usr.bin/grep/grep.c Sun Jun 2 02:38:44 2019 (r348503) @@ -343,20 +343,22 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - /* Check what is the program name of the binary. In this - way we can have all the funcionalities in one binary - without the need of scripting and using ugly hacks. */ + /* + * Check how we've bene invoked to determine the behavior we should + * exhibit. In this way we can have all the functionalities in one + * binary without the need of scripting and using ugly hacks. + */ pn = getprogname(); - if (pn[0] == 'r') { - dirbehave = DIR_RECURSE; - Hflag = true; - } switch (pn[0]) { case 'e': grepbehave = GREP_EXTENDED; break; case 'f': grepbehave = GREP_FIXED; + break; + case 'r': + dirbehave = DIR_RECURSE; + Hflag = true; break; } From owner-svn-src-head@freebsd.org Sun Jun 2 04:04: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 27AA615AA076; Sun, 2 Jun 2019 04:04:23 +0000 (UTC) (envelope-from kevans@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 B16BB89D69; Sun, 2 Jun 2019 04:04:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8483C21AF4; Sun, 2 Jun 2019 04:04:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5244Mmg052967; Sun, 2 Jun 2019 04:04:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5244MoT052965; Sun, 2 Jun 2019 04:04:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906020404.x5244MoT052965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Jun 2019 04:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348504 - in head: lib/clang/libllvm tools/build/mk usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/clang/libllvm tools/build/mk usr.bin/clang X-SVN-Commit-Revision: 348504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B16BB89D69 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.957,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, 02 Jun 2019 04:04:23 -0000 Author: kevans Date: Sun Jun 2 04:04:21 2019 New Revision: 348504 URL: https://svnweb.freebsd.org/changeset/base/348504 Log: llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the build is not much more time-consuming. The added benefit is that the resulting reports will actually include symbol information; without, thread trace information includes a bunch of addresses that immediately resolve to an inline function in ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a little more effort to examine. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20484 Modified: head/lib/clang/libllvm/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Sun Jun 2 02:38:44 2019 (r348503) +++ head/lib/clang/libllvm/Makefile Sun Jun 2 04:04:21 2019 (r348504) @@ -523,7 +523,7 @@ SRCS_EXT+= DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp SRCS_EXT+= DebugInfo/PDB/PDBSymbolUnknown.cpp SRCS_EXT+= DebugInfo/PDB/PDBSymbolUsingNamespace.cpp SRCS_EXT+= DebugInfo/PDB/UDTLayout.cpp -SRCS_EXT+= DebugInfo/Symbolize/DIPrinter.cpp +SRCS_MIW+= DebugInfo/Symbolize/DIPrinter.cpp SRCS_MIW+= DebugInfo/Symbolize/SymbolizableObjectFile.cpp SRCS_MIW+= DebugInfo/Symbolize/Symbolize.cpp SRCS_MIN+= Demangle/ItaniumDemangle.cpp @@ -779,7 +779,7 @@ SRCS_MIN+= Support/BinaryStreamWriter.cpp SRCS_MIN+= Support/BlockFrequency.cpp SRCS_MIN+= Support/BranchProbability.cpp SRCS_MIN+= Support/BuryPointer.cpp -SRCS_EXT+= Support/COM.cpp +SRCS_MIW+= Support/COM.cpp SRCS_MIN+= Support/CachePruning.cpp SRCS_MIN+= Support/Chrono.cpp SRCS_MIN+= Support/CodeGenCoverage.cpp Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jun 2 02:38:44 2019 (r348503) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jun 2 04:04:21 2019 (r348504) @@ -1372,6 +1372,7 @@ OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/bin/clang-tblgen OLD_FILES+=usr/bin/llvm-objdump +OLD_FILES+=usr/bin/llvm-symbolizer OLD_FILES+=usr/bin/llvm-tblgen 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 @@ -1561,7 +1562,6 @@ OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-pdbutil OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/bin/llvm-rtdyld -OLD_FILES+=usr/bin/llvm-symbolizer OLD_FILES+=usr/bin/llvm-xray OLD_FILES+=usr/bin/opt OLD_FILES+=usr/share/man/man1/bugpoint.1.gz Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sun Jun 2 02:38:44 2019 (r348503) +++ head/usr.bin/clang/Makefile Sun Jun 2 04:04:21 2019 (r348504) @@ -8,6 +8,7 @@ SUBDIR+= llvm-tblgen .if !defined(TOOLS_PREFIX) SUBDIR+= llvm-objdump +SUBDIR+= llvm-symbolizer .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+= bugpoint @@ -33,7 +34,6 @@ SUBDIR+= llvm-nm SUBDIR+= llvm-objcopy SUBDIR+= llvm-pdbutil SUBDIR+= llvm-rtdyld -SUBDIR+= llvm-symbolizer SUBDIR+= llvm-xray SUBDIR+= opt .endif From owner-svn-src-head@freebsd.org Sun Jun 2 11:56: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 45E8F15B34B6 for ; Sun, 2 Jun 2019 11:56: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 CBD08956FD for ; Sun, 2 Jun 2019 11:56:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x842.google.com with SMTP id j19so2719927qtr.12 for ; Sun, 02 Jun 2019 04:56: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=zQX21DCRcXwR7JtI+NGbY5gulXa1keWZjqsRVj4BOgs=; b=Ony1ShE0eZwZgObaqwskOF0Rek0MbjNhYWzuiTpJqx7sIrgXevD8eAs6jl/UdPC4/x YzumxxlN7YJ0Sc7QxG6ceif9/o6/s2k7kX4nYusV2poVoN27TpMfnEDjDQSIE0TLEu2s ceFiVlRpHtjH0bf6p38VAJc4A6SuQoHBrAnxv4+LhusNmfkiz9MlZ4emuTp5FBivbhsZ AurQahCuCqyGyYxH6Op1Ohr/B7UaCx6Hcmc0t+kalMI42kMpdK7REqwEKdZpvtbjhemu JUUAlq/b1mfpJ5sHRPjrG8D78vqctiScl7K7cEfShOJZEeM3014jEIRYnPYjh2K0nfPM QCsw== 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=zQX21DCRcXwR7JtI+NGbY5gulXa1keWZjqsRVj4BOgs=; b=rO8q24N0joGkq9/5UuysFMlnS9jh+2yzJ3AE5JXmvpTKjoh2MJiDsMaBBLI3/dN3Iq ConMgQgpT6P/zQ7ud/mYAjAvpP+g7jNDXd0ywAcHurmf/hs+0tCxJFYoMiLnJMCSDtxZ JR233A039eUnJRRK8SR8xnYmVjfG+Gc5MUg4bWDqaTE9XzV9vVr2nMOtiECpc2t0ScBP WU5G89/GUwoGSJp8JaV6gcHRt5VKLHkuMTUAfmhQ5Vft3iONHDzgk52/VGowFF7Za1e3 QLUVyy3fjZ3H7SV+xcdD0SLkPv090rswa4MXzM61CwAPXa4VThATLaCJtxxOv7MSmXfw UQ2Q== X-Gm-Message-State: APjAAAUduP+USR2fg1e9ByFM1Ba5b1Cn9cJJyz9UnnWV+vKm8hNEOja2 HAt70oTQfZ3T1l9A7OoyENCJkFdl23o= X-Google-Smtp-Source: APXvYqxlUsgs5o1x5eyiv7QVjovZkE0q1KGUs1J7kCEnqS4MHy78GQPsWzpz7BdT28J6WYQyHBYB/w== X-Received: by 2002:ac8:2d69:: with SMTP id o38mr4702718qta.169.1559476596144; Sun, 02 Jun 2019 04:56:36 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id o6sm7628629qtc.47.2019.06.02.04.56.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Jun 2019 04:56:35 -0700 (PDT) Date: Sun, 2 Jun 2019 07:56:34 -0400 From: Shawn Webb To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348504 - in head: lib/clang/libllvm tools/build/mk usr.bin/clang Message-ID: <20190602115634.j2cj2fr37p5c5sc2@mutt-hbsd> References: <201906020404.x5244MoT052965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mem34hxa6kbfuqsu" Content-Disposition: inline In-Reply-To: <201906020404.x5244MoT052965@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: CBD08956FD 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.994,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, 02 Jun 2019 11:56:37 -0000 --mem34hxa6kbfuqsu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 02, 2019 at 04:04:21AM +0000, Kyle Evans wrote: > Author: kevans > Date: Sun Jun 2 04:04:21 2019 > New Revision: 348504 > URL: https://svnweb.freebsd.org/changeset/base/348504 >=20 > Log: > llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG > =20 > ASAN reports become a lot more useful with llvm-symbolizer in $PATH, an= d the > build is not much more time-consuming. The added benefit is that the > resulting reports will actually include symbol information; without, th= read > trace information includes a bunch of addresses that immediately resolv= e to > an inline function in > ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a > little more effort to examine. > =20 > Reviewed by: emaste > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D20484 >=20 > Modified: > head/lib/clang/libllvm/Makefile > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.bin/clang/Makefile >=20 > Modified: head/lib/clang/libllvm/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/clang/libllvm/Makefile Sun Jun 2 02:38:44 2019 (r348503) > +++ head/lib/clang/libllvm/Makefile Sun Jun 2 04:04:21 2019 (r348504) > @@ -523,7 +523,7 @@ SRCS_EXT+=3D DebugInfo/PDB/PDBSymbolTypeVTableShape.c= pp > SRCS_EXT+=3D DebugInfo/PDB/PDBSymbolUnknown.cpp > SRCS_EXT+=3D DebugInfo/PDB/PDBSymbolUsingNamespace.cpp > SRCS_EXT+=3D DebugInfo/PDB/UDTLayout.cpp > -SRCS_EXT+=3D DebugInfo/Symbolize/DIPrinter.cpp > +SRCS_MIW+=3D DebugInfo/Symbolize/DIPrinter.cpp > SRCS_MIW+=3D DebugInfo/Symbolize/SymbolizableObjectFile.cpp > SRCS_MIW+=3D DebugInfo/Symbolize/Symbolize.cpp Is SRCS_MIW the right spelling? 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 --mem34hxa6kbfuqsu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlzzuW0ACgkQ/y5nonf4 4fo0mRAAoreDm+E+eJe+pUpeGCCQAUT6X5OrW9QHwJeNh0mqc6zjXaRu1YEvaM3l WOs7vw8l9s6Ys7KXLSTkNS9T9iUx7X6cUp76bF8CkDThpUM9WTiNnpg2XCNQ7IV5 8NDzhcXJvLeGHheHFH8tZVwj5uoImyDQycVPZDLaz9erWgaPdgWRjOk+XtG3g2EF hz7kUeFE4RB6auJNfcGzawZk4vCeGSBjG+738hJTzo3rpAOWiiNrkdH/B172d3HP hkaDIdcY/rXCsb53FoCFqpKS2qEYAHiBju81b3RayW+aKexbqKtFtJi9a3xv+488 KtwNH9oPThyCckbHGwyS41n/aGoUFZmagxzjTnjQKI7AnFSMWzExljhYSRhhnKLs V4m15jSU5UuzvqAFKJX2m1XVEBxaYb+pmYOv23V5AvejUEC8/0ExwU0/gDc/B5PM quPDLDoHTq6w6oPplca5cVO5RSJiUK2LX2Ubsi9mU+XwUxyFNu5Bwsux8EKzWa5J z2DPrS4NpxvTEZzRFiztWPqow3GIVoOzHlKpMp0iaY4GevnnWTaXYcP/0bySYTIL sp7UIt/cMtzCxtZnNcPVd+mwrTpOa9wyEBZ7/LfmIVrfhuvuyYcJGkxdWmXjr0nS D4OJpQVU86N//7fjuPHbFNu6tgC44mQL1ABksFBwoPqN8JpevdA= =IUmy -----END PGP SIGNATURE----- --mem34hxa6kbfuqsu-- From owner-svn-src-head@freebsd.org Sun Jun 2 14:03:58 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 157D115B685E; Sun, 2 Jun 2019 14:03:58 +0000 (UTC) (envelope-from kevans@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 7ACFD6A84B; Sun, 2 Jun 2019 14:03:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E93E27F63; Sun, 2 Jun 2019 14:03:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52E3vwY067699; Sun, 2 Jun 2019 14:03:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52E3v0x067698; Sun, 2 Jun 2019 14:03:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906021403.x52E3v0x067698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Jun 2019 14:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348509 - head/lib/libjail X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libjail X-SVN-Commit-Revision: 348509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7ACFD6A84B 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.948,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, 02 Jun 2019 14:03:58 -0000 Author: kevans Date: Sun Jun 2 14:03:56 2019 New Revision: 348509 URL: https://svnweb.freebsd.org/changeset/base/348509 Log: jail_getid(3): add special-case immediate return for jid 0 As depicted in the comment: jid 0 always exists, but the lookup will fail as it does not appear in the kernel's alljails list being a special jail. Some callers will expect/rely on this, and we have no reason to lie because it does always exist. Reported by: Stefan Hegnauer MFC after: soon (regression, breaks inspecting jail host bits, partial revert) Modified: head/lib/libjail/jail_getid.c Modified: head/lib/libjail/jail_getid.c ============================================================================== --- head/lib/libjail/jail_getid.c Sun Jun 2 09:28:50 2019 (r348508) +++ head/lib/libjail/jail_getid.c Sun Jun 2 14:03:56 2019 (r348509) @@ -54,6 +54,15 @@ jail_getid(const char *name) jid = strtoul(name, &ep, 10); if (*name && !*ep) { + /* + * jid == 0 is a special case; it will not appear in the + * kernel's jail list, but naturally processes will be assigned + * to it because it is prison 0. Trivially return this one + * without a trip to the kernel, because it always exists but + * the lookup won't succeed. + */ + if (jid == 0) + return jid; jiov[0].iov_base = __DECONST(char *, "jid"); jiov[0].iov_len = sizeof("jid"); jiov[1].iov_base = &jid; From owner-svn-src-head@freebsd.org Sun Jun 2 14:05: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 704DF15B695E; Sun, 2 Jun 2019 14:05:52 +0000 (UTC) (envelope-from kevans@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 C66846AA34; Sun, 2 Jun 2019 14:05:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E9AA27F65; Sun, 2 Jun 2019 14:05:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52E5p4G067823; Sun, 2 Jun 2019 14:05:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52E5plg067822; Sun, 2 Jun 2019 14:05:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906021405.x52E5plg067822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 2 Jun 2019 14:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348510 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 348510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C66846AA34 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.948,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, 02 Jun 2019 14:05:52 -0000 Author: kevans Date: Sun Jun 2 14:05:51 2019 New Revision: 348510 URL: https://svnweb.freebsd.org/changeset/base/348510 Log: bectl(8): Don't accept jid=0 from jail_getid This will trivially exist, but we don't want it - none of our jailed BEs will have jid=0. MFC after: 3 days Modified: head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Sun Jun 2 14:03:56 2019 (r348509) +++ head/sbin/bectl/bectl_jail.c Sun Jun 2 14:05:51 2019 (r348510) @@ -411,7 +411,12 @@ bectl_locate_jail(const char *ident) /* Try the easy-match first */ jid = jail_getid(ident); - if (jid != -1) + /* + * jail_getid(0) will always return 0, because this prison does exist. + * bectl(8) knows that this is not what it wants, so we should fall + * back to mount point search. + */ + if (jid > 0) return (jid); /* Attempt to try it as a BE name, first */ From owner-svn-src-head@freebsd.org Sun Jun 2 14:10: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 D025715B6BDE; Sun, 2 Jun 2019 14:10:21 +0000 (UTC) (envelope-from kevans@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 70CEF6ACDC; Sun, 2 Jun 2019 14:10:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 054E594A0; Sun, 2 Jun 2019 14:10:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f170.google.com with SMTP id r76so13769094lja.12; Sun, 02 Jun 2019 07:10:20 -0700 (PDT) X-Gm-Message-State: APjAAAVyxyHVw4Is1xY0brKsxA+b+USqBdE+ud+lLbdTMWSUNe6Nhwec poV6S3aGR+dwumJyF8hgPDWBIWHiPzSGRdFvBcA= X-Google-Smtp-Source: APXvYqyO6WODcjrdxR+Z4pY7zmfr9jElB7XAayrQG1qdbmEn4+oj6B4cW1URDLIvzFdI0244S7zXQX1LnDqwS6u7tgI= X-Received: by 2002:a2e:2f12:: with SMTP id v18mr11109081ljv.196.1559484619555; Sun, 02 Jun 2019 07:10:19 -0700 (PDT) MIME-Version: 1.0 References: <201906020404.x5244MoT052965@repo.freebsd.org> <20190602115634.j2cj2fr37p5c5sc2@mutt-hbsd> In-Reply-To: <20190602115634.j2cj2fr37p5c5sc2@mutt-hbsd> From: Kyle Evans Date: Sun, 2 Jun 2019 09:10:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348504 - in head: lib/clang/libllvm tools/build/mk usr.bin/clang To: Shawn Webb Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 70CEF6ACDC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 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.92)[-0.919,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, 02 Jun 2019 14:10:22 -0000 On Sun, Jun 2, 2019 at 6:56 AM Shawn Webb wrote: > > On Sun, Jun 02, 2019 at 04:04:21AM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Sun Jun 2 04:04:21 2019 > > New Revision: 348504 > > URL: https://svnweb.freebsd.org/changeset/base/348504 > > > > Log: > > llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG > > > > ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the > > build is not much more time-consuming. The added benefit is that the > > resulting reports will actually include symbol information; without, thread > > trace information includes a bunch of addresses that immediately resolve to > > an inline function in > > ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a > > little more effort to examine. > > > > Reviewed by: emaste > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D20484 > > > > Modified: > > head/lib/clang/libllvm/Makefile > > head/tools/build/mk/OptionalObsoleteFiles.inc > > head/usr.bin/clang/Makefile > > > > Modified: head/lib/clang/libllvm/Makefile > > ============================================================================== > > --- head/lib/clang/libllvm/Makefile Sun Jun 2 02:38:44 2019 (r348503) > > +++ head/lib/clang/libllvm/Makefile Sun Jun 2 04:04:21 2019 (r348504) > > @@ -523,7 +523,7 @@ SRCS_EXT+= DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp > > SRCS_EXT+= DebugInfo/PDB/PDBSymbolUnknown.cpp > > SRCS_EXT+= DebugInfo/PDB/PDBSymbolUsingNamespace.cpp > > SRCS_EXT+= DebugInfo/PDB/UDTLayout.cpp > > -SRCS_EXT+= DebugInfo/Symbolize/DIPrinter.cpp > > +SRCS_MIW+= DebugInfo/Symbolize/DIPrinter.cpp > > SRCS_MIW+= DebugInfo/Symbolize/SymbolizableObjectFile.cpp > > SRCS_MIW+= DebugInfo/Symbolize/Symbolize.cpp > > Is SRCS_MIW the right spelling? > Yup. Here's my understanding from looking at usage: SRCS_MIN = Absolute minimum set of src to build libllvm for bootstrap tools (MIN = MINimum) SRCS_MIW = Anything else needed to build libllvm for world tools (MIW = MIn World) Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Sun Jun 2 16: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 6FBA115B98EA; Sun, 2 Jun 2019 16:25:10 +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 0E9F96E434; Sun, 2 Jun 2019 16:25:10 +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 DB3032969B; Sun, 2 Jun 2019 16:25:09 +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 x52GP90w040847; Sun, 2 Jun 2019 16:25:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52GP8JM040837; Sun, 2 Jun 2019 16:25:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906021625.x52GP8JM040837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 16:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348511 - in head/contrib/one-true-awk: . bugs-fixed X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/contrib/one-true-awk: . bugs-fixed X-SVN-Commit-Revision: 348511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E9F96E434 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)[-1.000,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: Sun, 02 Jun 2019 16:25:10 -0000 Author: imp Date: Sun Jun 2 16:25:07 2019 New Revision: 348511 URL: https://svnweb.freebsd.org/changeset/base/348511 Log: Merge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.git Note: this backs out a number of changes we've made to awk because they aren't upstream, but are on the vendor branch. Those will be reapplied. svn makes it needlessly difficult to know which ones, but at least r315426, r301289, and maybe r301691, though there may be others too. None of these are critical, so bisecting through this point is safe for all but awk regression tests :). Added: head/contrib/one-true-awk/ChangeLog - copied unchanged from r348505, vendor/one-true-awk/dist/ChangeLog head/contrib/one-true-awk/LICENSE - copied unchanged from r348505, vendor/one-true-awk/dist/LICENSE head/contrib/one-true-awk/REGRESS - copied unchanged from r348505, vendor/one-true-awk/dist/REGRESS head/contrib/one-true-awk/bugs-fixed/ - copied from r348505, vendor/one-true-awk/dist/bugs-fixed/ head/contrib/one-true-awk/proctab.c - copied unchanged from r348505, vendor/one-true-awk/dist/proctab.c Modified: head/contrib/one-true-awk/FIXES head/contrib/one-true-awk/awk.1 head/contrib/one-true-awk/awk.h head/contrib/one-true-awk/awkgram.y head/contrib/one-true-awk/b.c head/contrib/one-true-awk/lex.c head/contrib/one-true-awk/lib.c head/contrib/one-true-awk/main.c head/contrib/one-true-awk/makefile head/contrib/one-true-awk/maketab.c head/contrib/one-true-awk/parse.c head/contrib/one-true-awk/proto.h head/contrib/one-true-awk/run.c head/contrib/one-true-awk/tran.c Directory Properties: head/contrib/one-true-awk/ (props changed) Copied: head/contrib/one-true-awk/ChangeLog (from r348505, vendor/one-true-awk/dist/ChangeLog) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/one-true-awk/ChangeLog Sun Jun 2 16:25:07 2019 (r348511, copy of r348505, vendor/one-true-awk/dist/ChangeLog) @@ -0,0 +1,245 @@ +2019-05-29 Arnold D. Robbins + + * lib.c (isclvar): Remove check for additional '=' after + first one. No longer needed. + +2019-01-26 Arnold D. Robbins + + * main.c (version): Updated. + +2019-01-25 Arnold D. Robbins + + * run.c (awkgetline): Check for numeric value in all getline + variants. See the numeric-getline.* files in bugs-fixed directory. + +2018-08-29 Arnold D. Robbins + + * REGRESS: Check for existence of a.out. If not there, run + make. Enable core dumps for T.arnold system status test + to work on MacOS X. + +2018-08-22 Arnold D. Robbins + + * awktest.tar (testdir/T.expr): Fix test for unary plus. + +2018-08-22 Arnold D. Robbins + + * REGRESS: Extract tests if necessary, set PATH to include '.'. + * regdir/beebe.tar (Makefile): Fix longwrds test to prefix + sort with LC_ALL=C. + * awktest.tar: Updated from fixed test suite, directory + it extracts is now called 'testdir' to match what's in top-level + REGRESS script. + * regdir: Removed, as Brian wants to keep the test suite in + the tar file. + +2018-08-22 Arnold D. Robbins + + * FIXES, lib.c, run.c, makefile, main.c: Merge from Brian's tree. + * REGRESS: New file, from Brian. + * awktest.tar: Restored from Brian's tree. + +2018-08-22 Arnold D. Robbins + + * awkgram.y (UPLUS): New token. In the grammar, call op1() + with it. + * maketab.c (proc): Add entry for UPLUS. + * run.c (arith): Handle UPLUS. + * main.c (version): Updated. + * bugs-fixed/unary-plus.awk, bugs-fixed/unary-plus.bad, + bugs-fixed/unary-plus.ok: New files. + +2018-08-10 Arnold D. Robbins + + * TODO: Updated. + * awk.1: Improve use of macros, add some additional explanation + in a few places, alphabetize list of variables. + +2018-08-08 Arnold D. Robbins + + * awk.h (Cell): Add new field `fmt' to track xFMT value used + for a string conversion. + [CONVC, CONVO]: New flag macros. + * bugs-fixed/README: Updated. + * bugs-fixed/string-conv.awk, bugs-fixed/string-conv.bad, + bugs-fixed/string-conv.ok: New files. + * main.c (version): Updated. + * proto.h (flags2str): Add declaration. + * tran.c (setfval): Clear CONVC and CONVO flags and set vp->fmt + to NULL. + (setsval): Ditto. Add large comment and new code to manage + correct conversion of number to string based on various flags + and the value of vp->fmt. The idea is to not convert again + if xFMT is the same as before and we're doing the same conversion. + Otherwise, clear the old flags, set the new, and reconvert. + (flags2str): New function. For debug prints and for use from a debugger. + +2018-08-05 Arnold D. Robbins + + Fix filename conflicts in regdir where the only difference was + in letter case. This caused problems on Windows systems. + + * regdir/Compare.T1: Renamed from regdir/Compare.T. + * regdir/t.delete0: Renamed from regdir/t.delete. + * regdir/t.getline1: Renamed from regdir/t.getline. + * regdir/t.redir1: Renamed from regdir/t.redir. + * regdir/t.split1: Renamed from regdir/t.split. + * regdir/t.sub0: Renamed from regdir/t.sub. + * regdir/REGRESS: Adjusted. + +2018-08-04 Arnold D. Robbins + + With scalpel, tweasers, magnifying glass and bated breath, + borrow code from the NetBSD version of nawk to fix the years-old + bug whereby decrementing the value of NF did not change the + record. + + * lib.c (fldbld): Set donerec to 1 when done. + (setlastfld): New function. + * proto.h (setlastfld): Add declaration. + * run.c (copycell): Make code smarter about flags (from NetBSD code). + * tran.c (setfree): New function. + * tran.c (setfval): Normalize negative zero to positive zero. + If setting NF, clear donerec and call setlastfld(). + (setsval): Remove call to save_old_OFS(). If setting OFS, call + recbld(). If setting NF, clear donerec and call setlastfld(). + + As part of the process, revert OFS-related changes of 2018-05-22: + + * awk.h (saveOFS, saveOFSlen, save_old_OFS): Remove declarations. + * lib.c (recbld): Use *OFS instead of saveOFS. + * run.c (saveOFS, saveOFSlen, save_old_OFS): Remove. + * tran.c (syminit): Remove initialization of saveOFS and saveOFSlen. + + General stuff that goes along with all this: + + * bugs-fixed/README: Updated. + * bugs-fixed/decr-NF.awk, bugs-fixed/decr-NF.bad, + bugs-fixed/decr-NF.ok: New files. + * main.c (version): Updated. + * regdir/README.TESTS: Fix awk book title. + * regdir/T.misc: Revise test to match fixed code. + * run.c (format): Increase size of buffer used for %a test. (Unrelated + to NF or OFS, but fixes a compiler complaint.) + +2018-06-07 Arnold D. Robbins + + * regdir/beebe.tar: Fix longwrds.ok so that the test will pass. + The file was incorrectly sorted. + +2018-06-06 Arnold D. Robbins + + * regdir/T.lilly: Fix the bug again in the second instance + of the code. Thanks to BWK for pointing this out. + +2018-05-31 Arnold D. Robbins + + * regdir/T.lilly: Fix a syntax error and ordering bug + in creating the 'foo' file. + +2018-05-23 Arnold D. Robbins + + * awk.1: Remove standalone 'awk' at the top of file, it messed up + the formatting. Arrange built-in variable list in alphabetical + order. + +2018-05-23 Arnold D. Robbins + + * main.c (version): Add my email address and a date so that + users can tell this isn't straight BWK awk. + * README.md: Minor updates. + * TODO: Updated. + +2018-05-22 Arnold D. Robbins + + Add POSIX-required formats %a and %A. + + * run.c (format): Check for %a support in C library. If there, + allow %a and %A as valid formats. + * TODO: Updated. + * bugs-fixed/README: Updated. + * bugs-fixed/a-format.awk, bugs-fixed/a-format.bad, + bugs-fixed/a-format.ok: New files. + +2018-05-22 Arnold D. Robbins + + * FIXES: Restored a line from a much earlier version that + apparently got lost when the dates were reordered. + * TODO: Updated. + +2018-05-22 Arnold D. Robbins + + * README.md: New file. + +2018-05-22 Arnold D. Robbins + + * regdir/echo.c, regdir/time.c: Minor fixes to compile without + warning on current GCC / Linux. + +2018-05-22 Arnold D. Robbins + + * TODO: New file. + +2018-05-22 Arnold D. Robbins + + * makefile (gitadd, gitpush): Remove these targets. They + should not be automated and were incorrect for things that + would be done regularly. + +2018-05-22 Arnold D. Robbins + + Fix nawk so that [[:blank:]] only matches space and tab instead + of any whitespace character, originally made May 10, 2018. + See bugs-fixed/space.awk. + + This appears to have been a thinko on Brian's part. + + * b.c (charclasses): Use xisblank() function for [[:blank:]]. + * bugs-fixed/README: Updated. + * bugs-fixed/space.awk, bugs-fixed/space.bad, + bugs-fixed/space.ok: New files. + +2018-05-22 Arnold D. Robbins + + * .gitignore: New file. + +2018-05-22 Arnold D. Robbins + + Fix nawk to provide reasonable exit status for system(), + a la gawk, originally made March 12, 2016. See + bugs-fixed/system-status.awk. + + * run.c (bltin): For FSYSTEM, use the macros defined for wait(2) + to produce a reasonable exit value, instead of doing a floating-point + division by 256. + * awk.1: Document the return status values. + * bugs-fixed/README: Updated. + * bugs-fixed/system-status.awk, bugs-fixed/system-status.bad, + bugs-fixed/system-status.ok: New files. + +2018-05-22 Arnold D. Robbins + + Bug fix with respect to rebuilding a record, originally + made August 19, 2014. See bugs-fixed/ofs-rebuild.awk. + + * awk.h (saveOFS, saveOFSlen): Declare new variables. + * lib.c (recbld): Use them when rebuilding the record. + * run.c (saveOFS, saveOFSlen): Define new variables. + (save_old_OFS): New function to save OFS aside. + * tran.c (syminit): Initialize saveOFS and saveOFSlen. + (setsval): If setting a field, call save_old_OFS(). + * bugs-fixed/README, bugs-fixed/ofs-rebuild.awk, + bugs-fixed/ofs-rebuild.bad, bugs-fixed/ofs-rebuild.ok: New files. + +2018-05-22 Arnold D. Robbins + + * makefile (YACC): Use bison. + +2018-05-22 Arnold D. Robbins + + * ChangeLog: Created. + * regdir: Created. Based on contents of awktest.a. + * .gitattributes: Created, to preserve CR LF in regdir/t.crlf. + * awktest.a: Removed. + * regdir/T.gawk, regdir/T.latin1: Updated from awktest.tar. + * awktest.tar: Removed. Modified: head/contrib/one-true-awk/FIXES ============================================================================== --- head/contrib/one-true-awk/FIXES Sun Jun 2 14:05:51 2019 (r348510) +++ head/contrib/one-true-awk/FIXES Sun Jun 2 16:25:07 2019 (r348511) @@ -25,6 +25,113 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +May 29,2019: + Fix check for command line arguments to no longer require that + first character after '=' not be another '='. Reverts change of + August 11, 1989. Thanks to GitHub user Jamie Landeg Jones for + pointing out the issue; from Issue #38. + +Apr 7, 2019: + Update awktest.tar(p.50) to use modern options to sort. Needed + for Android development. Thanks to GitHub user mohd-akram (Mohamed + Akram). From Comment #33. + +Mar 12, 2019: + Added very simplistic support for cross-compiling in the + makefile. We are NOT going to go in the direction of the + autotools, though. Thanks to GitHub user nee-san for + the basic change. (Merged from PR #34.) + +Mar 5, 2019: + Added support for POSIX-standard interval expressions (a.k.a. + bounds, a.k.a. repetition expressions) in regular expressions, + backported (via NetBSD) from Apple awk-24 (20070501). + Thanks to Martijn Dekker for the port. + (Merged from PR #30.) + +Mar 3, 2019: + Merge PRs as follows: + #12: Avoid undefined behaviour when using ctype(3) functions in + relex(). Thanks to GitHub user iamleot. + #31: Make getline handle numeric strings, and update FIXES. Thanks + to GitHub user arnoldrobbins + #32: maketab: support build systems with read-only source. Thanks + to GitHub user enh. + +Jan 25, 2019: + Make getline handle numeric strings properly in all cases. + (Thanks, Arnold.) + +Jan 21, 2019: + Merged a number of small fixes from GitHub pull requests. + Thanks to GitHub users Arnold Robbins (arnoldrobbins), + Cody Mello (melloc) and Christoph Junghans (junghans). + PR numbers: 13-21, 23, 24, 27. + +Oct 25, 2018: + Added test in maketab.c to prevent generating a proctab entry + for YYSTYPE_IS_DEFINED. It was harmless but some gcc settings + generated a warning message. Thanks to Nan Xiao for report. + +Aug 27, 2018: + Disallow '$' in printf formats; arguments evaluated in order + and printed in order. + + Added some casts to silence warnings on debugging printfs. + (Thanks, Arnold.) + +Aug 23, 2018: + A long list of fixes courtesy of Arnold Robbins, + to whom profound thanks. + + 1. ofs-rebuild: OFS value used to rebuild the record was incorrect. + Fixed August 19, 2014. Revised fix August 2018. + + 2. system-status: Instead of a floating-point division by 256, use + the wait(2) macros to create a reasonable exit status. + Fixed March 12, 2016. + + 3. space: Use provided xisblank() function instead of ispace() for + matching [[:blank:]]. + + 4. a-format: Add POSIX standard %a and %A to supported formats. Check + at runtime that this format is available. + + 5. decr-NF: Decrementing NF did not change $0. This is a decades-old + bug. There are interactions with the old and new value of OFS as well. + Most of the fix came from the NetBSD awk. + + 6. string-conv: String conversions of scalars were sticky. Once a + conversion to string happened, even with OFMT, that value was used until + a new numeric value was assigned, even if OFMT differed from CONVFMT, + and also if CONVFMT changed. + + 7. unary-plus: Unary plus on a string constant returned the string. + Instead, it should convert the value to numeric and give that value. + + Also added Arnold's tests for these to awktest.tar as T.arnold. + +Aug 15, 2018: + fixed mangled awktest.tar (thanks, Arnold), posted all + current (very minor) fixes to github / onetrueawk + +Jun 7, 2018: + (yes, a long layoff) + Updated some broken tests (beebe.tar, T.lilly) + [thanks to Arnold Robbins] + +Mar 26, 2015: + buffer overflow in error reporting; thanks to tobias ulmer + and john-mark gurney for spotting it and the fix. + +Feb 4, 2013: + cleaned up a handful of tests that didn't seem to actually + test for correct behavior: T.latin1, T.gawk. + +Jan 5, 2013: + added ,NULL initializer to static Cells in run.c; not really + needed but cleaner. Thanks to Michael Bombardieri. + Dec 20, 2012: fiddled makefile to get correct yacc and bison flags. pick yacc (linux) or bison (mac) as necessary. @@ -492,6 +599,8 @@ May 12, 1998: Mar 12, 1998: added -V to print version number and die. + +[notify dave kerns, dkerns@dacsoup.ih.lucent.com] Feb 11, 1998: subtle silent bug in lex.c: if the program ended with a number Copied: head/contrib/one-true-awk/LICENSE (from r348505, vendor/one-true-awk/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/one-true-awk/LICENSE Sun Jun 2 16:25:07 2019 (r348511, copy of r348505, vendor/one-true-awk/dist/LICENSE) @@ -0,0 +1,23 @@ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ Copied: head/contrib/one-true-awk/REGRESS (from r348505, vendor/one-true-awk/dist/REGRESS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/one-true-awk/REGRESS Sun Jun 2 16:25:07 2019 (r348511, copy of r348505, vendor/one-true-awk/dist/REGRESS) @@ -0,0 +1,35 @@ +#! /bin/sh + +case `uname` in +CYGWIN) EXE=a.exe ;; +*) EXE=a.out ;; +esac + +if [ ! -f $EXE ] +then + make || exit 1 +fi + +if [ -d testdir ] +then + true # do nothing +elif [ -f awktest.tar ] +then + echo extracting testdir + tar -xpf awktest.tar +else + echo $0: No testdir directory and no awktest.tar to extract it from! >&2 + exit 1 +fi + +cd testdir +pwd +PATH=.:$PATH +export PATH +if (ulimit -c unlimited > /dev/null 2>&1) +then + # Workaround broken default on MacOS X + ulimit -c unlimited +fi + +REGRESS Modified: head/contrib/one-true-awk/awk.1 ============================================================================== --- head/contrib/one-true-awk/awk.1 Sun Jun 2 14:05:51 2019 (r348510) +++ head/contrib/one-true-awk/awk.1 Sun Jun 2 16:25:07 2019 (r348511) @@ -7,7 +7,6 @@ .fi .ft 1 .. -awk .TH AWK 1 .CT 1 files prog_other .SH NAME @@ -36,7 +35,7 @@ awk \- pattern-directed scanning and processing langua scans each input .I file for lines that match any of a set of patterns specified literally in -.IR prog +.I prog or in one or more files specified as .B \-f @@ -53,7 +52,7 @@ The file name .B \- means the standard input. Any -.IR file +.I file of the form .I var=value is treated as an assignment, not a filename, @@ -70,12 +69,12 @@ any number of options may be present. The .B \-F -.IR fs +.I fs option defines the input field separator to be the regular expression -.IR fs. +.IR fs . .PP An input line is normally made up of fields separated by white space, -or by regular expression +or by the regular expression .BR FS . The fields are denoted .BR $1 , @@ -87,7 +86,7 @@ If .BR FS is null, the input line is split into one field per character. .PP -A pattern-action statement has the form +A pattern-action statement has the form: .IP .IB pattern " { " action " } .PP @@ -101,7 +100,7 @@ An action is a sequence of statements. A statement can be one of the following: .PP .EX -.ta \w'\f(CWdelete array[expression]'u +.ta \w'\f(CWdelete array[expression]\fR'u .RS .nf .ft CW @@ -145,7 +144,7 @@ The operators are also available in expressions. Variables may be scalars, array elements (denoted -.IB x [ i ] ) +.IB x [ i ] \fR) or fields. Variables are initialized to the null string. Array subscripts may be any string, @@ -161,11 +160,11 @@ The .B print statement prints its arguments on the standard output (or on a file if -.BI > file +.BI > " file or -.BI >> file +.BI >> " file is present or on a pipe if -.BI | cmd +.BI | " cmd is present), separated by the current output field separator, and terminated by the output record separator. .I file @@ -176,9 +175,10 @@ identical string values in different statements denote the same open file. The .B printf -statement formats its expression list according to the format +statement formats its expression list according to the +.I format (see -.IR printf (3)) . +.IR printf (3)). The built-in function .BI close( expr ) closes the file or pipe @@ -189,13 +189,13 @@ flushes any buffered output for the file or pipe .IR expr . .PP The mathematical functions +.BR atan2 , +.BR cos , .BR exp , .BR log , -.BR sqrt , .BR sin , -.BR cos , and -.BR atan2 +.B sqrt are built in. Other built-in functions: .TF length @@ -203,7 +203,8 @@ Other built-in functions: .B length the length of its argument taken as a string, -or of +number of elements in an array for an array argument, +or length of .B $0 if no argument. .TP @@ -218,14 +219,18 @@ and returns the previous seed. .B int truncates to an integer value .TP -.BI substr( s , " m" , " n\fB) +\fBsubstr(\fIs\fB, \fIm\fR [\fB, \fIn\^\fR]\fB)\fR the .IR n -character substring of .I s that begins at position -.IR m +.I m counted from 1. +If no +.IR m , +use the rest of the string +.I .TP .BI index( s , " t" ) the position in @@ -246,14 +251,14 @@ and .B RLENGTH are set to the position and length of the matched string. .TP -.BI split( s , " a" , " fs\fB) +\fBsplit(\fIs\fB, \fIa \fR[\fB, \fIfs\^\fR]\fB)\fR splits the string .I s into array elements -.IB a [1] , -.IB a [2] , +.IB a [1] \fR, +.IB a [2] \fR, \&..., -.IB a [ n ] , +.IB a [ n ] \fR, and returns .IR n . The separation is done with the regular expression @@ -266,7 +271,7 @@ is not given. An empty string as field separator splits the string into one array element per character. .TP -.BI sub( r , " t" , " s\fB) +\fBsub(\fIr\fB, \fIt \fR[, \fIs\^\fR]\fB) substitutes .I t for the first occurrence of the regular expression @@ -279,7 +284,7 @@ is not given, .B $0 is used. .TP -.B gsub +\fBgsub(\fIr\fB, \fIt \fR[, \fIs\^\fR]\fB) same as .B sub except that all occurrences of the regular expression @@ -289,18 +294,28 @@ and .B gsub return the number of replacements. .TP -.BI sprintf( fmt , " expr" , " ...\fB ) +.BI sprintf( fmt , " expr" , " ...\fB) the string resulting from formatting .I expr ... according to the .IR printf (3) format -.I fmt +.IR fmt . .TP .BI system( cmd ) executes .I cmd -and returns its exit status +and returns its exit status. This will be \-1 upon error, +.IR cmd 's +exit status upon a normal exit, +256 + +.I sig +upon death-by-signal, where +.I sig +is the number of the murdering signal, +or 512 + +.I sig +if there was a core dump. .TP .BI tolower( str ) returns a copy of @@ -321,7 +336,7 @@ sets .B $0 to the next input record from the current input file; .B getline -.BI < file +.BI < " file sets .B $0 to the next record from @@ -363,7 +378,7 @@ Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in relational expressions, using the operators -.BR ~ +.B ~ and .BR !~ . .BI / re / @@ -387,8 +402,12 @@ A relational expression is one of the following: .br .BI ( expr , expr,... ") in " array-name .PP -where a relop is any of the six relational operators in C, -and a matchop is either +where a +.I relop +is any of the six relational operators in C, +and a +.I matchop +is either .B ~ (matches) or @@ -409,57 +428,68 @@ and after the last. and .B END do not combine with other patterns. +They may appear multiple times in a program and execute +in the order they are read by +.IR awk . .PP Variable names with special meanings: .TF FILENAME .TP +.B ARGC +argument count, assignable. +.TP +.B ARGV +argument array, assignable; +non-null members are taken as filenames. +.TP .B CONVFMT conversion format used when converting numbers (default -.BR "%.6g" ) +.BR "%.6g" ). .TP +.B ENVIRON +array of environment variables; subscripts are names. +.TP +.B FILENAME +the name of the current input file. +.TP +.B FNR +ordinal number of the current record in the current file. +.TP .B FS regular expression used to separate fields; also settable by option -.BI \-F fs. +.BI \-F fs\fR. .TP .BR NF -number of fields in the current record +number of fields in the current record. .TP .B NR -ordinal number of the current record +ordinal number of the current record. .TP -.B FNR -ordinal number of the current record in the current file +.B OFMT +output format for numbers (default +.BR "%.6g" ). .TP -.B FILENAME -the name of the current input file -.TP -.B RS -input record separator (default newline) -.TP .B OFS -output field separator (default blank) +output field separator (default space). .TP .B ORS -output record separator (default newline) +output record separator (default newline). .TP -.B OFMT -output format for numbers (default -.BR "%.6g" ) +.B RLENGTH +the length of a string matched by +.BR match . .TP -.B SUBSEP -separates multiple subscripts (default 034) +.B RS +input record separator (default newline). .TP -.B ARGC -argument count, assignable +.B RSTART +the start position of a string matched by +.BR match . .TP -.B ARGV -argument array, assignable; -non-null members are taken as filenames -.TP -.B ENVIRON -array of environment variables; subscripts are names. +.B SUBSEP +separates multiple subscripts (default 034). .PD .PP Functions may be defined (at the position of a pattern-action statement) thus: @@ -490,7 +520,7 @@ BEGIN { FS = ",[ \et]*|[ \et]+" } .EE .ns .IP -Same, with input fields separated by comma and/or blanks and tabs. +Same, with input fields separated by comma and/or spaces and tabs. .PP .EX .nf @@ -516,13 +546,13 @@ BEGIN { # Simulate echo(1) .fi .EE .SH SEE ALSO +.IR grep (1), .IR lex (1), .IR sed (1) .br A. V. Aho, B. W. Kernighan, P. J. Weinberger, -.I -The AWK Programming Language, -Addison-Wesley, 1988. ISBN 0-201-07981-X +.IR "The AWK Programming Language" , +Addison-Wesley, 1988. ISBN 0-201-07981-X. .SH BUGS There are no explicit conversions between numbers and strings. To force an expression to be treated as a number add 0 to it; @@ -531,3 +561,5 @@ to force it to be treated as a string concatenate .br The scope rules for variables in functions are a botch; the syntax is worse. +.br +Only eight-bit characters sets are handled correctly. Modified: head/contrib/one-true-awk/awk.h ============================================================================== --- head/contrib/one-true-awk/awk.h Sun Jun 2 14:05:51 2019 (r348510) +++ head/contrib/one-true-awk/awk.h Sun Jun 2 16:25:07 2019 (r348511) @@ -81,7 +81,8 @@ typedef struct Cell { char *nval; /* name, for variables only */ char *sval; /* string value */ Awkfloat fval; /* value as number */ - int tval; /* type info: STR|NUM|ARR|FCN|FLD|CON|DONTFREE */ + int tval; /* type info: STR|NUM|ARR|FCN|FLD|CON|DONTFREE|CONVC|CONVO */ + char *fmt; /* CONVFMT/OFMT value used to convert from number */ struct Cell *cnext; /* ptr to next if chained */ } Cell; @@ -96,9 +97,14 @@ extern Array *symtab; extern Cell *nrloc; /* NR */ extern Cell *fnrloc; /* FNR */ +extern Cell *fsloc; /* FS */ extern Cell *nfloc; /* NF */ +extern Cell *ofsloc; /* OFS */ +extern Cell *orsloc; /* ORS */ +extern Cell *rsloc; /* RS */ extern Cell *rstartloc; /* RSTART */ extern Cell *rlengthloc; /* RLENGTH */ +extern Cell *subseploc; /* SUBSEP */ /* Cell.tval values: */ #define NUM 01 /* number value is valid */ @@ -109,6 +115,8 @@ extern Cell *rlengthloc; /* RLENGTH */ #define FCN 040 /* this is a function name */ #define FLD 0100 /* this is a field $1, $2, ... */ #define REC 0200 /* this is $0 */ +#define CONVC 0400 /* string was converted from number via CONVFMT */ +#define CONVO 01000 /* string was converted from number via OFMT */ /* function types */ Modified: head/contrib/one-true-awk/awkgram.y ============================================================================== --- head/contrib/one-true-awk/awkgram.y Sun Jun 2 14:05:51 2019 (r348510) +++ head/contrib/one-true-awk/awkgram.y Sun Jun 2 16:25:07 2019 (r348511) @@ -86,7 +86,7 @@ Node *arglist = 0; /* list of args for current functio %left CAT %left '+' '-' %left '*' '/' '%' -%left NOT UMINUS +%left NOT UMINUS UPLUS %right POWER %right DECR INCR %left INDIRECT @@ -357,7 +357,7 @@ term: | term '%' term { $$ = op2(MOD, $1, $3); } | term POWER term { $$ = op2(POWER, $1, $3); } | '-' term %prec UMINUS { $$ = op1(UMINUS, $2); } - | '+' term %prec UMINUS { $$ = $2; } + | '+' term %prec UMINUS { $$ = op1(UPLUS, $2); } | NOT term %prec UMINUS { $$ = op1(NOT, notnull($2)); } | BLTIN '(' ')' { $$ = op2(BLTIN, itonp($1), rectonode()); } | BLTIN '(' patlist ')' { $$ = op2(BLTIN, itonp($1), $3); } Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sun Jun 2 14:05:51 2019 (r348510) +++ head/contrib/one-true-awk/b.c Sun Jun 2 16:25:07 2019 (r348511) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #define DEBUG #include +#include #include #include #include @@ -68,6 +69,11 @@ int rlxval; static uschar *rlxstr; static uschar *prestr; /* current position in current re */ static uschar *lastre; /* origin of last re */ +static uschar *lastatom; /* origin of last Atom */ +static uschar *starttok; +static uschar *basestr; /* starts with original, replaced during + repetition processing */ +static uschar *firstbasestr; static int setcnt; static int poscnt; @@ -85,11 +91,11 @@ fa *makedfa(const char *s, int anchor) /* returns dfa fa *pfa; static int now = 1; - if (setvec == NULL) { /* first time through any RE */ + if (setvec == 0) { /* first time through any RE */ maxsetvec = MAXLIN; setvec = (int *) malloc(maxsetvec * sizeof(int)); tmpset = (int *) malloc(maxsetvec * sizeof(int)); - if (setvec == NULL || tmpset == NULL) + if (setvec == 0 || tmpset == 0) overflo("out of space initializing makedfa"); } @@ -127,6 +133,8 @@ fa *mkdfa(const char *s, int anchor) /* does the real Node *p, *p1; fa *f; + firstbasestr = (uschar *) s; + basestr = firstbasestr; p = reparse(s); p1 = op2(CAT, op2(STAR, op2(ALL, NIL, NIL), NIL), p); /* put ALL STAR in front of reg. exp. */ @@ -140,7 +148,7 @@ fa *mkdfa(const char *s, int anchor) /* does the real f->accept = poscnt-1; /* penter has computed number of positions in re */ cfoll(f, p1); /* set up follow sets */ freetr(p1); - if ((f->posns[0] = (int *) calloc(*(f->re[0].lfollow), sizeof(int))) == NULL) + if ((f->posns[0] = (int *) calloc(1, *(f->re[0].lfollow)*sizeof(int))) == NULL) overflo("out of space in makedfa"); if ((f->posns[1] = (int *) calloc(1, sizeof(int))) == NULL) overflo("out of space in makedfa"); @@ -148,6 +156,10 @@ fa *mkdfa(const char *s, int anchor) /* does the real f->initstat = makeinit(f, anchor); f->anchor = anchor; f->restr = (uschar *) tostring(s); + if (firstbasestr != basestr) { + if (basestr) + xfree(basestr); + } return f; } @@ -160,7 +172,7 @@ int makeinit(fa *f, int anchor) f->reset = 0; k = *(f->re[0].lfollow); xfree(f->posns[2]); - if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) overflo("out of space in makeinit"); for (i=0; i <= k; i++) { (f->posns[2])[i] = (f->re[0].lfollow)[i]; @@ -305,11 +317,11 @@ char *cclenter(const char *argp) /* add a character cl int j; uschar *p = (uschar *) argp; uschar *op, *bp; - static uschar *buf = NULL; + static uschar *buf = 0; static int bufsz = 100; op = p; - if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL) FATAL("out of space for character class [%.10s...] 1", p); bp = buf; for (i = 0; (c = *p++) != 0; ) { @@ -368,14 +380,14 @@ void cfoll(fa *f, Node *v) /* enter follow set of each maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == NULL || tmpset == NULL) + if (setvec == 0 || tmpset == 0) overflo("out of space in cfoll()"); } for (i = 0; i <= f->accept; i++) setvec[i] = 0; setcnt = 0; follow(v); /* computes setvec and setcnt */ - if ((p = (int *) calloc(setcnt+1, sizeof(int))) == NULL) + if ((p = (int *) calloc(1, (setcnt+1)*sizeof(int))) == NULL) overflo("out of space building follow set"); f->re[info(v)].lfollow = p; *p = setcnt; @@ -409,7 +421,7 @@ int first(Node *p) /* collects initially active leaves maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == NULL || tmpset == NULL) + if (setvec == 0 || tmpset == 0) overflo("out of space in first()"); } if (type(p) == EMPTYRE) { @@ -549,7 +561,7 @@ int pmatch(fa *f, const char *p0) /* longest match, fo for (i = 2; i <= f->curstat; i++) xfree(f->posns[i]); k = *f->posns[0]; - if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) overflo("out of space in pmatch"); for (i = 0; i <= k; i++) (f->posns[2])[i] = (f->posns[0])[i]; @@ -606,7 +618,7 @@ int nematch(fa *f, const char *p0) /* non-empty match, for (i = 2; i <= f->curstat; i++) xfree(f->posns[i]); k = *f->posns[0]; - if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) overflo("out of state space"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Jun 2 16:28: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 0405C15B99E4; Sun, 2 Jun 2019 16:28:23 +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 9743B6E5BF; Sun, 2 Jun 2019 16:28:22 +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 556942969E; Sun, 2 Jun 2019 16:28:22 +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 x52GSMeb041017; Sun, 2 Jun 2019 16:28:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52GSLT6041011; Sun, 2 Jun 2019 16:28:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906021628.x52GSLT6041011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 16:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348512 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9743B6E5BF 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,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, 02 Jun 2019 16:28:23 -0000 Author: imp Date: Sun Jun 2 16:28:20 2019 New Revision: 348512 URL: https://svnweb.freebsd.org/changeset/base/348512 Log: Reapply r301289 by pfg: | MFV r300961: one-true-awk: replace 0 with NULL for pointers | Also remove a redundant semicolon. | Also had to rebase on upstream pull. Modified: head/contrib/one-true-awk/b.c head/contrib/one-true-awk/lex.c head/contrib/one-true-awk/maketab.c head/contrib/one-true-awk/parse.c head/contrib/one-true-awk/run.c head/contrib/one-true-awk/tran.c Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sun Jun 2 16:25:07 2019 (r348511) +++ head/contrib/one-true-awk/b.c Sun Jun 2 16:28:20 2019 (r348512) @@ -91,11 +91,11 @@ fa *makedfa(const char *s, int anchor) /* returns dfa fa *pfa; static int now = 1; - if (setvec == 0) { /* first time through any RE */ + if (setvec == NULL) { /* first time through any RE */ maxsetvec = MAXLIN; setvec = (int *) malloc(maxsetvec * sizeof(int)); tmpset = (int *) malloc(maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space initializing makedfa"); } @@ -317,11 +317,11 @@ char *cclenter(const char *argp) /* add a character cl int j; uschar *p = (uschar *) argp; uschar *op, *bp; - static uschar *buf = 0; + static uschar *buf = NULL; static int bufsz = 100; op = p; - if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) FATAL("out of space for character class [%.10s...] 1", p); bp = buf; for (i = 0; (c = *p++) != 0; ) { @@ -380,7 +380,7 @@ void cfoll(fa *f, Node *v) /* enter follow set of each maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in cfoll()"); } for (i = 0; i <= f->accept; i++) @@ -421,7 +421,7 @@ int first(Node *p) /* collects initially active leaves maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in first()"); } if (type(p) == EMPTYRE) { @@ -923,7 +923,7 @@ int relex(void) /* lexical analyzer for reparse */ { int c, n; int cflag; - static uschar *buf = 0; + static uschar *buf = NULL; static int bufsz = 100; uschar *bp; struct charclass *cc; @@ -953,7 +953,7 @@ rescan: rlxval = c; return CHAR; case '[': - if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) FATAL("out of space in reg expr %.10s..", lastre); bp = buf; if (*prestr == '^') { @@ -1129,7 +1129,7 @@ int cgoto(fa *f, int s, int c) maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("out of space in cgoto()"); } for (i = 0; i <= f->accept; i++) @@ -1151,7 +1151,7 @@ int cgoto(fa *f, int s, int c) maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); - if (setvec == 0 || tmpset == 0) + if (setvec == NULL || tmpset == NULL) overflo("cgoto overflow"); } if (setvec[q[j]] == 0) { Modified: head/contrib/one-true-awk/lex.c ============================================================================== --- head/contrib/one-true-awk/lex.c Sun Jun 2 16:25:07 2019 (r348511) +++ head/contrib/one-true-awk/lex.c Sun Jun 2 16:28:20 2019 (r348512) @@ -176,10 +176,10 @@ int reg = 0; /* 1 => return a REGEXPR now */ int yylex(void) { int c; - static char *buf = 0; + static char *buf = NULL; static int bufsize = 5; /* BUG: setting this small causes core dump! */ - if (buf == 0 && (buf = (char *) malloc(bufsize)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsize)) == NULL) FATAL( "out of space in yylex" ); if (sc) { sc = 0; @@ -366,10 +366,10 @@ int string(void) { int c, n; char *s, *bp; - static char *buf = 0; + static char *buf = NULL; static int bufsz = 500; - if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for strings"); for (bp = buf; (c = input()) != '"'; ) { if (!adjbuf(&buf, &bufsz, bp-buf+2, 500, &bp, "string")) @@ -513,11 +513,11 @@ void startreg(void) /* next call to yylex will return int regexpr(void) { int c; - static char *buf = 0; + static char *buf = NULL; static int bufsz = 500; char *bp; - if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for rex expr"); bp = buf; for ( ; (c = input()) != '/' && c != 0; ) { @@ -549,7 +549,7 @@ char ebuf[300]; char *ep = ebuf; char yysbuf[100]; /* pushback buffer */ char *yysptr = yysbuf; -FILE *yyin = 0; +FILE *yyin = NULL; int input(void) /* get next lexical input character */ { Modified: head/contrib/one-true-awk/maketab.c ============================================================================== --- head/contrib/one-true-awk/maketab.c Sun Jun 2 16:25:07 2019 (r348511) +++ head/contrib/one-true-awk/maketab.c Sun Jun 2 16:28:20 2019 (r348512) @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) table[p->token-FIRSTTOKEN] = p->name; printf("\nCell *(*proctab[%d])(Node **, int) = {\n", SIZE); for (i=0; innext, n++) + for (n = 0; p != NULL; p = p->nnext, n++) if (strcmp(((Cell *)(p->narg[0]))->nval, s) == 0) return n; return -1; Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Sun Jun 2 16:25:07 2019 (r348511) +++ head/contrib/one-true-awk/run.c Sun Jun 2 16:28:20 2019 (r348512) @@ -517,7 +517,7 @@ Cell *awkdelete(Node **a, int n) /* a[0] is symtab, a[ x = execute(a[0]); /* Cell* for symbol table */ if (!isarr(x)) return True; - if (a[1] == 0) { /* delete the elements, not the table */ + if (a[1] == NULL) { /* delete the elements, not the table */ freesymtab(x); x->tval &= ~STR; x->tval |= ARR; @@ -603,7 +603,7 @@ Cell *matchop(Node **a, int n) /* ~ and match() */ } x = execute(a[1]); /* a[1] = target text */ s = getsval(x); - if (a[0] == 0) /* a[1] == 0: already-compiled reg expr */ + if (a[0] == NULL) /* a[1] == 0: already-compiled reg expr */ i = (*mf)((fa *) a[2], s); else { y = execute(a[2]); /* a[2] = regular expr */ @@ -719,7 +719,7 @@ Cell *gettemp(void) /* get a tempcell */ FATAL("out of space for temporaries"); for(i = 1; i < 100; i++) tmps[i-1].cnext = &tmps[i]; - tmps[i-1].cnext = 0; + tmps[i-1].cnext = NULL; } x = tmps; tmps = x->cnext; @@ -754,18 +754,18 @@ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], int k, m, n; char *s; int temp; - Cell *x, *y, *z = 0; + Cell *x, *y, *z = NULL; x = execute(a[0]); y = execute(a[1]); - if (a[2] != 0) + if (a[2] != NULL) z = execute(a[2]); s = getsval(x); k = strlen(s) + 1; if (k <= 1) { tempfree(x); tempfree(y); - if (a[2] != 0) { + if (a[2] != NULL) { tempfree(z); } x = gettemp(); @@ -778,7 +778,7 @@ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], else if (m > k) m = k; tempfree(y); - if (a[2] != 0) { + if (a[2] != NULL) { n = (int) getfval(z); tempfree(z); } else @@ -1219,7 +1219,7 @@ Cell *pastat(Node **a, int n) /* a[0] { a[1] } */ { Cell *x; - if (a[0] == 0) + if (a[0] == NULL) x = execute(a[1]); else { x = execute(a[0]); @@ -1256,9 +1256,9 @@ Cell *dopa2(Node **a, int n) /* a[0], a[1] { a[2] } */ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { - Cell *x = 0, *y, *ap; + Cell *x = NULL, *y, *ap; char *s, *origs; - char *fs, *origfs = NULL; + char *fs = NULL, *origfs = NULL; int sep; char *t, temp, num[50]; int n, tempstat, arg3type; @@ -1266,8 +1266,8 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[ y = execute(a[0]); /* source string */ origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); - if (a[2] == 0) /* fs string */ - fs = getsval(fsloc); + if (a[2] == NULL) /* fs string */ + fs = *FS; else if (arg3type == STRING) { /* split(str,arr,"string") */ x = execute(a[2]); origfs = fs = strdup(getsval(x)); @@ -1387,6 +1387,9 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[ tempfree(y); free(origs); free(origfs); + if (a[2] != NULL && arg3type == STRING) { + tempfree(x); + } x = gettemp(); x->tval = NUM; x->fval = n; @@ -1416,7 +1419,7 @@ Cell *ifstat(Node **a, int n) /* if (a[0]) a[1]; else if (istrue(x)) { tempfree(x); x = execute(a[1]); - } else if (a[2] != 0) { + } else if (a[2] != NULL) { tempfree(x); x = execute(a[2]); } @@ -1468,7 +1471,7 @@ Cell *forstat(Node **a, int n) /* for (a[0]; a[1]; a[2 x = execute(a[0]); tempfree(x); for (;;) { - if (a[1]!=0) { + if (a[1]!=NULL) { x = execute(a[1]); if (!istrue(x)) return(x); else tempfree(x); @@ -1551,7 +1554,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0 case FCOS: u = cos(getfval(x)); break; case FATAN: - if (nextarg == 0) { + if (nextarg == NULL) { WARNING("atan2 requires two arguments; returning 1.0"); u = 1.0; } else { @@ -1697,7 +1700,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0 tempfree(x); x = gettemp(); setfval(x, u); - if (nextarg != 0) { + if (nextarg != NULL) { WARNING("warning: function has too many arguments"); for ( ; nextarg; nextarg = nextarg->nnext) execute(nextarg); @@ -1711,7 +1714,7 @@ Cell *printstat(Node **a, int n) /* print a[0] */ Cell *y; FILE *fp; - if (a[1] == 0) /* a[1] is redirection operator, a[2] is file */ + if (a[1] == NULL) /* a[1] is redirection operator, a[2] is file */ fp = stdout; else fp = redirect(ptoi(a[1]), a[2]); @@ -1724,7 +1727,7 @@ Cell *printstat(Node **a, int n) /* print a[0] */ else fputs(getsval(ofsloc), fp); } - if (a[1] != 0) + if (a[1] != NULL) fflush(fp); if (ferror(fp)) FATAL("write error on %s", filename(fp)); @@ -1781,7 +1784,7 @@ FILE *openfile(int a, const char *us) { const char *s = us; int i, m; - FILE *fp = 0; + FILE *fp = NULL; if (*s == '\0') FATAL("null file name in print or getline"); @@ -1796,7 +1799,7 @@ FILE *openfile(int a, const char *us) return NULL; for (i=0; i < nfiles; i++) - if (files[i].fp == 0) + if (files[i].fp == NULL) break; if (i >= nfiles) { struct files *nf; @@ -1912,7 +1915,7 @@ Cell *sub(Node **a, int nnn) /* substitute command */ FATAL("out of memory in sub"); x = execute(a[3]); /* target string */ t = getsval(x); - if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ + if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ pfa = (fa *) a[1]; /* regular expression */ else { y = execute(a[1]); @@ -1952,7 +1955,7 @@ Cell *sub(Node **a, int nnn) /* substitute command */ if (pb > buf + bufsz) FATAL("sub result2 %.30s too big; can't happen", buf); setsval(x, buf); /* BUG: should be able to avoid copy */ - result = True;; + result = True; } tempfree(x); tempfree(y); @@ -1975,7 +1978,7 @@ Cell *gsub(Node **a, int nnn) /* global substitute */ num = 0; x = execute(a[3]); /* target string */ t = getsval(x); - if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ + if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ pfa = (fa *) a[1]; /* regular expression */ else { y = execute(a[1]); Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Sun Jun 2 16:25:07 2019 (r348511) +++ head/contrib/one-true-awk/tran.c Sun Jun 2 16:28:20 2019 (r348512) @@ -194,7 +194,7 @@ void freesymtab(Cell *ap) /* free a symbol table */ free(cp); tp->nelem--; } - tp->tab[i] = 0; + tp->tab[i] = NULL; } if (tp->nelem != 0) WARNING("can't happen: inconsistent element count freeing %s", ap->nval); From owner-svn-src-head@freebsd.org Sun Jun 2 16:30: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 482EA15B9A7E; Sun, 2 Jun 2019 16:30: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 D9B946E767; Sun, 2 Jun 2019 16:30:53 +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 98F7C296C0; Sun, 2 Jun 2019 16:30:53 +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 x52GUrEU044352; Sun, 2 Jun 2019 16:30:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52GUr0X044351; Sun, 2 Jun 2019 16:30:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906021630.x52GUr0X044351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 16:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348513 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9B946E767 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)[-1.000,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: Sun, 02 Jun 2019 16:30:54 -0000 Author: imp Date: Sun Jun 2 16:30:53 2019 New Revision: 348513 URL: https://svnweb.freebsd.org/changeset/base/348513 Log: Reapply r315426 by pfg: | MFV r315425: one-true-awk: have calloc(3) do the multiplication. Modified: head/contrib/one-true-awk/b.c Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sun Jun 2 16:28:20 2019 (r348512) +++ head/contrib/one-true-awk/b.c Sun Jun 2 16:30:53 2019 (r348513) @@ -148,7 +148,7 @@ fa *mkdfa(const char *s, int anchor) /* does the real f->accept = poscnt-1; /* penter has computed number of positions in re */ cfoll(f, p1); /* set up follow sets */ freetr(p1); - if ((f->posns[0] = (int *) calloc(1, *(f->re[0].lfollow)*sizeof(int))) == NULL) + if ((f->posns[0] = (int *) calloc(*(f->re[0].lfollow), sizeof(int))) == NULL) overflo("out of space in makedfa"); if ((f->posns[1] = (int *) calloc(1, sizeof(int))) == NULL) overflo("out of space in makedfa"); @@ -172,7 +172,7 @@ int makeinit(fa *f, int anchor) f->reset = 0; k = *(f->re[0].lfollow); xfree(f->posns[2]); - if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) overflo("out of space in makeinit"); for (i=0; i <= k; i++) { (f->posns[2])[i] = (f->re[0].lfollow)[i]; @@ -387,7 +387,7 @@ void cfoll(fa *f, Node *v) /* enter follow set of each setvec[i] = 0; setcnt = 0; follow(v); /* computes setvec and setcnt */ - if ((p = (int *) calloc(1, (setcnt+1)*sizeof(int))) == NULL) + if ((p = (int *) calloc(setcnt+1, sizeof(int))) == NULL) overflo("out of space building follow set"); f->re[info(v)].lfollow = p; *p = setcnt; @@ -561,7 +561,7 @@ int pmatch(fa *f, const char *p0) /* longest match, fo for (i = 2; i <= f->curstat; i++) xfree(f->posns[i]); k = *f->posns[0]; - if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) overflo("out of space in pmatch"); for (i = 0; i <= k; i++) (f->posns[2])[i] = (f->posns[0])[i]; @@ -618,7 +618,7 @@ int nematch(fa *f, const char *p0) /* non-empty match, for (i = 2; i <= f->curstat; i++) xfree(f->posns[i]); k = *f->posns[0]; - if ((f->posns[2] = (int *) calloc(1, (k+1)*sizeof(int))) == NULL) + if ((f->posns[2] = (int *) calloc(k+1, sizeof(int))) == NULL) overflo("out of state space"); for (i = 0; i <= k; i++) (f->posns[2])[i] = (f->posns[0])[i]; @@ -1194,7 +1194,7 @@ int cgoto(fa *f, int s, int c) for (i = 0; i < NCHARS; i++) f->gototab[f->curstat][i] = 0; xfree(f->posns[f->curstat]); - if ((p = (int *) calloc(1, (setcnt+1)*sizeof(int))) == NULL) + if ((p = (int *) calloc(setcnt+1, sizeof(int))) == NULL) overflo("out of space in cgoto"); f->posns[f->curstat] = p; From owner-svn-src-head@freebsd.org Sun Jun 2 16:33: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 969F915B9C8A; Sun, 2 Jun 2019 16:33:25 +0000 (UTC) (envelope-from trasz@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 2FB176EB68; Sun, 2 Jun 2019 16:33:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C63029843; Sun, 2 Jun 2019 16:33:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52GXOth046189; Sun, 2 Jun 2019 16:33:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52GXOpp046188; Sun, 2 Jun 2019 16:33:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201906021633.x52GXOpp046188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Jun 2019 16:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348514 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 348514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FB176EB68 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,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, 02 Jun 2019 16:33:25 -0000 Author: trasz Date: Sun Jun 2 16:33:24 2019 New Revision: 348514 URL: https://svnweb.freebsd.org/changeset/base/348514 Log: Make tests(7) point people at the atf(7) man page. Other frameworks, such as googletest, should be added there as well, once they become viable. For now let's keep it simple. Discussed with: ngie, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20124 Modified: head/share/man/man7/tests.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Sun Jun 2 16:30:53 2019 (r348513) +++ head/share/man/man7/tests.7 Sun Jun 2 16:33:24 2019 (r348514) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2017 +.Dd June 2, 2019 .Dt TESTS 7 .Os .Sh NAME @@ -58,6 +58,8 @@ hierarchy. .Pp This manual page describes how to run the test suite and how to configure some of its optional features. +For information on writing the tests, see +.Xr atf 7 . .Ss Installing the test suite The test suite is installed by default as of .Fx @@ -222,6 +224,7 @@ Top-level test suite definition file. .El .Sh SEE ALSO .Xr kyua 1 , +.Xr atf 7 , .Xr build 7 .Sh HISTORY The From owner-svn-src-head@freebsd.org Sun Jun 2 16:44: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 1A1B815B9FE7; Sun, 2 Jun 2019 16:44:51 +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 A67D96F2BD; Sun, 2 Jun 2019 16:44:50 +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 7ACF829A1A; Sun, 2 Jun 2019 16:44:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52GioZ3051450; Sun, 2 Jun 2019 16:44:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52GioYV051449; Sun, 2 Jun 2019 16:44:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906021644.x52GioYV051449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 16:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348515 - head/usr.bin/awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/awk X-SVN-Commit-Revision: 348515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A67D96F2BD 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,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, 02 Jun 2019 16:44:51 -0000 Author: imp Date: Sun Jun 2 16:44:50 2019 New Revision: 348515 URL: https://svnweb.freebsd.org/changeset/base/348515 Log: This should have been committed in r348511 with the awk update. It was in my tree, the build worked, but I committed from contrib/one-true-awk rather than the top level, so was omitted. Modified: head/usr.bin/awk/Makefile Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Sun Jun 2 16:33:24 2019 (r348514) +++ head/usr.bin/awk/Makefile Sun Jun 2 16:44:50 2019 (r348515) @@ -25,7 +25,7 @@ ytab.h: awkgram.c awkgram.h .NOMETA ln -sf ${.ALLSRC:M*.h} ${.TARGET} proctab.c: maketab - ${BTOOLSPATH:U.}/maketab > proctab.c + ${BTOOLSPATH:U.}/maketab awkgram.h > proctab.c build-tools: maketab maketab: ytab.h maketab.c ${BUILD_TOOLS_META} From owner-svn-src-head@freebsd.org Sun Jun 2 20:47: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 3462E15BF592; Sun, 2 Jun 2019 20:47:16 +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 C97A477E14; Sun, 2 Jun 2019 20:47:15 +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 A359C2C22C; Sun, 2 Jun 2019 20:47:15 +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 x52KlFlV079219; Sun, 2 Jun 2019 20:47:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52KlFsZ079218; Sun, 2 Jun 2019 20:47:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906022047.x52KlFsZ079218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 20:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348518 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C97A477E14 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 02 Jun 2019 20:47:16 -0000 Author: imp Date: Sun Jun 2 20:47:15 2019 New Revision: 348518 URL: https://svnweb.freebsd.org/changeset/base/348518 Log: Reapply r301691: Revert r301689 - one-true-awk: Avoid a NULL dereference. I got this wrong and the coverity report doesn't match the NetBSD change, which was thought for a different version. The change wouldn't hurt but let's wait until upstream figures this out. Modified: head/contrib/one-true-awk/tran.c Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Sun Jun 2 20:03:00 2019 (r348517) +++ head/contrib/one-true-awk/tran.c Sun Jun 2 20:47:15 2019 (r348518) @@ -366,7 +366,7 @@ char *setsval(Cell *vp, const char *s) /* set string v if (donerec == 0) recbld(); } - t = s ? tostring(s) : tostring(""); /* in case it's self-assign */ + t = tostring(s); /* in case it's self-assign */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~(NUM|CONVC|CONVO); From owner-svn-src-head@freebsd.org Sun Jun 2 20:52: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 8653615BF81C; Sun, 2 Jun 2019 20:52:22 +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 288888025C; Sun, 2 Jun 2019 20:52:22 +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 F383C2C3D9; Sun, 2 Jun 2019 20:52:21 +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 x52KqLHV085340; Sun, 2 Jun 2019 20:52:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52KqLvK085339; Sun, 2 Jun 2019 20:52:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906022052.x52KqLvK085339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Jun 2019 20:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348519 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 288888025C 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)[-1.000,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: Sun, 02 Jun 2019 20:52:22 -0000 Author: imp Date: Sun Jun 2 20:52:21 2019 New Revision: 348519 URL: https://svnweb.freebsd.org/changeset/base/348519 Log: Revert r348518 It should not have happened. The change is actually in upstream and I misread the diffs. Modified: head/contrib/one-true-awk/tran.c Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Sun Jun 2 20:47:15 2019 (r348518) +++ head/contrib/one-true-awk/tran.c Sun Jun 2 20:52:21 2019 (r348519) @@ -366,7 +366,7 @@ char *setsval(Cell *vp, const char *s) /* set string v if (donerec == 0) recbld(); } - t = tostring(s); /* in case it's self-assign */ + t = s ? tostring(s) : tostring(""); /* in case it's self-assign */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~(NUM|CONVC|CONVO); From owner-svn-src-head@freebsd.org Sun Jun 2 22:27: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 991FF15C21C3; Sun, 2 Jun 2019 22:27:27 +0000 (UTC) (envelope-from wulf@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 34271834A9; Sun, 2 Jun 2019 22:27:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0841C2D30F; Sun, 2 Jun 2019 22:27:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52MRQ7a033990; Sun, 2 Jun 2019 22:27:26 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52MRQTp033989; Sun, 2 Jun 2019 22:27:26 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906022227.x52MRQTp033989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 2 Jun 2019 22:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348520 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 348520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34271834A9 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)[-1.000,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: Sun, 02 Jun 2019 22:27:27 -0000 Author: wulf Date: Sun Jun 2 22:27:26 2019 New Revision: 348520 URL: https://svnweb.freebsd.org/changeset/base/348520 Log: psm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops PR: 238291 Submitted by: Andrey Kosachenko MFC after: 2 weeks Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun Jun 2 20:52:21 2019 (r348519) +++ head/sys/dev/atkbdc/psm.c Sun Jun 2 22:27:26 2019 (r348520) @@ -7114,7 +7114,7 @@ enable_elantech(struct psm_softc *sc, enum probearg ar { static const int ic2hw[] = /*IC: 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0 }; + { 0, 0, 2, 0, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; static const int fw_sizes[][3] = { /* FW.vers MaxX MaxY */ { 0x020030, 1152, 768 }, From owner-svn-src-head@freebsd.org Sun Jun 2 23:38: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 35D6C15C3476; Sun, 2 Jun 2019 23:38:22 +0000 (UTC) (envelope-from sobomax@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 8765E8513A; Sun, 2 Jun 2019 23:38:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 536DC2DEB4; Sun, 2 Jun 2019 23:38:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x52NcLrb070790; Sun, 2 Jun 2019 23:38:21 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52NcJV9070782; Sun, 2 Jun 2019 23:38:19 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201906022338.x52NcJV9070782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sun, 2 Jun 2019 23:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb X-SVN-Commit-Revision: 348521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8765E8513A 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)[-1.000,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: Sun, 02 Jun 2019 23:38:22 -0000 Author: sobomax Date: Sun Jun 2 23:38:19 2019 New Revision: 348521 URL: https://svnweb.freebsd.org/changeset/base/348521 Log: Fix several places where tool name has been hardcoded: install -> ${INSTALL} mtree -> ${MTREE_CMD} services_mkdb -> ${SERVICES_MKDB_CMD} cap_mkdb -> ${CAP_MKDB_CMD} pwd_mkdb -> ${PWD_MKDB_CMD} kldxref -> ${KLDXREF_CMD} If you do custom FreeBSD builds you may want to override those in some cases. Sponsored by: Sippy Software, Inc. Modified: head/Makefile.inc1 head/etc/Makefile head/sys/conf/kern.opts.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/usr.bin/login/Makefile head/usr.sbin/services_mkdb/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 2 22:27:26 2019 (r348520) +++ head/Makefile.inc1 Sun Jun 2 23:38:19 2019 (r348521) @@ -887,8 +887,8 @@ MTREEFLAGS+= -W INSTALLFLAGS+= -h sha256 .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) -IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" -IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" +IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" +IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif DESTDIR_MTREEFLAGS= -deU Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Jun 2 22:27:26 2019 (r348520) +++ head/etc/Makefile Sun Jun 2 23:38:19 2019 (r348521) @@ -6,6 +6,7 @@ FILESGROUPS= FILES NLS_ALIASES= POSIX C \ en_US.US_ASCII C +PWD_MKDB_CMD?= pwd_mkdb # No need as it is empty and just causes rebuilds since this file does so much. UPDATE_DEPENDFILE= no Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sun Jun 2 22:27:26 2019 (r348520) +++ head/sys/conf/kern.opts.mk Sun Jun 2 23:38:19 2019 (r348521) @@ -22,6 +22,8 @@ # They have to be listed here so we can build modules outside of the # src tree. +KLDXREF_CMD?= kldxref + __DEFAULT_YES_OPTIONS = \ AUTOFS \ BHYVE \ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sun Jun 2 22:27:26 2019 (r348520) +++ head/sys/conf/kmod.mk Sun Jun 2 23:38:19 2019 (r348521) @@ -348,8 +348,8 @@ afterinstall: _kldxref .ORDER: _installlinks _kldxref _kldxref: .PHONY @if type kldxref >/dev/null 2>&1; then \ - ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ - kldxref ${DESTDIR}${KMODDIR}; \ + ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \ + ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \ fi .endif .endif # !target(realinstall) Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jun 2 22:27:26 2019 (r348520) +++ head/sys/modules/Makefile Sun Jun 2 23:38:19 2019 (r348521) @@ -795,8 +795,8 @@ SUBDIR:= ${SUBDIR:N${reject}} .MAKEFLAGS+= -DNO_XREF afterinstall: .PHONY @if type kldxref >/dev/null 2>&1; then \ - ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ - kldxref ${DESTDIR}${KMODDIR}; \ + ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \ + ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \ fi .endif Modified: head/usr.bin/login/Makefile ============================================================================== --- head/usr.bin/login/Makefile Sun Jun 2 22:27:26 2019 (r348520) +++ head/usr.bin/login/Makefile Sun Jun 2 23:38:19 2019 (r348521) @@ -8,6 +8,7 @@ PROG= login SRCS= login.c login_fbtab.c CFLAGS+=-DLOGALL LIBADD= util pam +CAP_MKDB_CMD?= cap_mkdb WARNS?= 5 @@ -25,7 +26,7 @@ PRECIOUSPROG= .include afterinstallconfig: - cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf + ${CAP_MKDB_CMD} ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf .if defined(NO_ROOT) && defined(METALOG) echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel" | \ cat -l >> ${METALOG} Modified: head/usr.sbin/services_mkdb/Makefile ============================================================================== --- head/usr.sbin/services_mkdb/Makefile Sun Jun 2 22:27:26 2019 (r348520) +++ head/usr.sbin/services_mkdb/Makefile Sun Jun 2 23:38:19 2019 (r348521) @@ -4,12 +4,13 @@ CONFS= services PROG= services_mkdb MAN= services_mkdb.8 SRCS= services_mkdb.c uniq.c extern.h +SERVICES_MKDB_CMD?= ${PROG} .include .include .if ${MK_SERVICESDB} != "no" afterinstallconfig: - services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ + ${SERVICES_MKDB_CMD} ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ ${DESTDIR}/etc/services .if defined(NO_ROOT) && defined(METALOG) echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel" | \ From owner-svn-src-head@freebsd.org Mon Jun 3 01:31: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 0214015C4F53; Mon, 3 Jun 2019 01:31:23 +0000 (UTC) (envelope-from pfg@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 84EF387A1B; Mon, 3 Jun 2019 01:31:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id CD1C3E478; Mon, 3 Jun 2019 01:31:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r348512 - head/contrib/one-true-awk To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906021628.x52GSLT6041011@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <395afabe-1af9-5a0c-f1a5-a9814ea5341b@FreeBSD.org> Date: Sun, 2 Jun 2019 20:31:28 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906021628.x52GSLT6041011@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 84EF387A1B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.90)[-0.901,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, 03 Jun 2019 01:31:24 -0000 On 02/06/2019 11:28, Warner Losh wrote: > Author: imp > Date: Sun Jun 2 16:28:20 2019 > New Revision: 348512 > URL: https://svnweb.freebsd.org/changeset/base/348512 > > Log: > Reapply r301289 by pfg: > > | MFV r300961: one-true-awk: replace 0 with NULL for pointers > | Also remove a redundant semicolon. > | Also had to rebase on upstream pull. Thanks so much for looking at those. They were mostly cosmetic but I had received an email confirmation from bwk so I falsely assumed they had been merged upstream. Pedro. From owner-svn-src-head@freebsd.org Mon Jun 3 02:04: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 8DCE115C595B for ; Mon, 3 Jun 2019 02:04:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 F135F889C5 for ; Mon, 3 Jun 2019 02:04:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id d15so10094321qkl.4 for ; Sun, 02 Jun 2019 19:04:37 -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=c61pC5VN/LxpUDuK0WCW3ml3qezlayuIrA8ESH2CJWU=; b=tFTusox8nMnO034xanuFpe8z+dhGMpgUJ5UDeogH5qlYA2h/5W7PPxeQSViKRnbuRQ jChsMm51RQR35Rt+F2o4Zqv4qqT3qpyo/nLaT8MSIF7ORC/uJmvGJ5b3VDyey2qQtslY fyALZXAyNJxPXGh04YVtNPTyghfEi5Sp61SRbsvuUYva7lnwYgNrRF6r+LA5g5De7uK4 Kzl71KeX4AeaLhdNEGIXW993/p3Y1AO9M3Hvqyume9vok3krYG3kOp6573f878Ic87F/ OiDtFkhn+ekg8tAaYT2xKvu4myCxRu1T8AAUoKVG1it5faqzFhZ1eWvtIM+A7csHgMFC r3Yw== 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=c61pC5VN/LxpUDuK0WCW3ml3qezlayuIrA8ESH2CJWU=; b=p1jDLAbCwlY8YPIiGblT+Y2/dNkqOoL9kpfP+2QmYjsqoHK0On2GiyP5epB8c59Ul4 u+XA7lPHgiaadUTEN5PRdeFXfBImb4L0hsKoMDBlLWEUdkBC96W+E6ASy1WH39f+IhZH QRTD5ImLazWi3y7faIRTDr2liXIzZje1XQiSYKiAxyqzOqBvIGQSburGM+WIE/1y1BLq E3vHAiywTZV3odrX43CiXycvdX2pYHpSzpta3b2aqgUykU9C3O4IE2X299KQct+7Kuv7 040Id0R2576EpOeWvXHE13L9HoianTqhPYLaktyAO0v9NOKFqzkzvZYG2uiQLsdpr3fG JKfg== X-Gm-Message-State: APjAAAUqWbkv1lTSTyQ/lyfdyxpAF5awlZUghsCLzJVNxh5bDzpWQyDo Eop64iDyT0bIH5fiquwH6e0OpueplDfEijqhnyZ2Xw== X-Google-Smtp-Source: APXvYqzaf0B2yO5u0Ao9V8aQ5iroai2DWeQxoxDHme1ou3pmruLwYc7chjX2+b7MV59COUMYtUGPELLE/BNTFzLFUYw= X-Received: by 2002:a37:4b48:: with SMTP id y69mr19840152qka.77.1559527476863; Sun, 02 Jun 2019 19:04:36 -0700 (PDT) MIME-Version: 1.0 References: <201906021628.x52GSLT6041011@repo.freebsd.org> <395afabe-1af9-5a0c-f1a5-a9814ea5341b@FreeBSD.org> In-Reply-To: <395afabe-1af9-5a0c-f1a5-a9814ea5341b@FreeBSD.org> From: Warner Losh Date: Sun, 2 Jun 2019 20:04:25 -0600 Message-ID: Subject: Re: svn commit: r348512 - head/contrib/one-true-awk To: Pedro Giffuni Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: F135F889C5 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] 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, 03 Jun 2019 02:04:38 -0000 On Sun, Jun 2, 2019 at 7:31 PM Pedro Giffuni wrote: > > On 02/06/2019 11:28, Warner Losh wrote: > > Author: imp > > Date: Sun Jun 2 16:28:20 2019 > > New Revision: 348512 > > URL: https://svnweb.freebsd.org/changeset/base/348512 > > > > Log: > > Reapply r301289 by pfg: > > > > | MFV r300961: one-true-awk: replace 0 with NULL for pointers > > | Also remove a redundant semicolon. > > | Also had to rebase on upstream pull. > > Thanks so much for looking at those. They were mostly cosmetic but I had > received an email confirmation from bwk so I falsely assumed they had > been merged upstream. > No worries. the upstream went weird about the time you submitted this stuff, so it's all good... The next step is to work with the revitalized upstream to get things accepted or rejected that we can loop back into our tree faster so it's less of a hassle. :) Warner From owner-svn-src-head@freebsd.org Mon Jun 3 05:15: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 EB1A815C8DC8; Mon, 3 Jun 2019 05:15:37 +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 7C9268E704; Mon, 3 Jun 2019 05:15:37 +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 47A59183F; Mon, 3 Jun 2019 05:15:37 +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 x535Fa89049047; Mon, 3 Jun 2019 05:15:36 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x535Fa4c049045; Mon, 3 Jun 2019 05:15:36 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906030515.x535Fa4c049045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 3 Jun 2019 05:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348525 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C9268E704 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 03 Jun 2019 05:15:38 -0000 Author: alc Date: Mon Jun 3 05:15:36 2019 New Revision: 348525 URL: https://svnweb.freebsd.org/changeset/base/348525 Log: Retire vm_reserv_extend_{contig,page}(). These functions were introduced as part of a false start toward fine-grained reservation locking. In the end, they were not needed, so eliminate them. Order the parameters to vm_reserv_alloc_{contig,page}() consistently with the vm_page functions that call them. Update the comments about the locking requirements for vm_reserv_alloc_{contig,page}(). They no longer require a free page queues lock. Wrap several lines that became too long after the "req" and "domain" parameters were added to vm_reserv_alloc_{contig,page}(). Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20492 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jun 3 04:38:07 2019 (r348524) +++ head/sys/vm/vm_page.c Mon Jun 3 05:15:36 2019 (r348525) @@ -1834,8 +1834,8 @@ again: * Can we allocate the page from a reservation? */ if (vm_object_reserv(object) && - ((m = vm_reserv_extend(req, object, pindex, domain, mpred)) != NULL || - (m = vm_reserv_alloc_page(req, object, pindex, domain, mpred)) != NULL)) { + (m = vm_reserv_alloc_page(object, pindex, domain, req, mpred)) != + NULL) { domain = vm_phys_domain(m); vmd = VM_DOMAIN(domain); goto found; @@ -2039,10 +2039,8 @@ again: * Can we allocate the pages from a reservation? */ if (vm_object_reserv(object) && - ((m_ret = vm_reserv_extend_contig(req, object, pindex, domain, - npages, low, high, alignment, boundary, mpred)) != NULL || - (m_ret = vm_reserv_alloc_contig(req, object, pindex, domain, - npages, low, high, alignment, boundary, mpred)) != NULL)) { + (m_ret = vm_reserv_alloc_contig(object, pindex, domain, req, + mpred, npages, low, high, alignment, boundary)) != NULL) { domain = vm_phys_domain(m_ret); vmd = VM_DOMAIN(domain); goto found; Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Mon Jun 3 04:38:07 2019 (r348524) +++ head/sys/vm/vm_reserv.c Mon Jun 3 05:15:36 2019 (r348525) @@ -576,95 +576,8 @@ vm_reserv_populate(vm_reserv_t rv, int index) } /* - * Attempts to allocate a contiguous set of physical pages from existing - * reservations. See vm_reserv_alloc_contig() for a description of the - * function's parameters. - * - * The page "mpred" must immediately precede the offset "pindex" within the - * specified object. - * - * The object must be locked. - */ -vm_page_t -vm_reserv_extend_contig(int req, vm_object_t object, vm_pindex_t pindex, - int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, - u_long alignment, vm_paddr_t boundary, vm_page_t mpred) -{ - struct vm_domain *vmd; - vm_paddr_t pa, size; - vm_page_t m, msucc; - vm_reserv_t rv; - int i, index; - - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(npages != 0, ("vm_reserv_alloc_contig: npages is 0")); - - /* - * Is a reservation fundamentally impossible? - */ - if (pindex < VM_RESERV_INDEX(object, pindex) || - pindex + npages > object->size || object->resident_page_count == 0) - return (NULL); - - /* - * All reservations of a particular size have the same alignment. - * Assuming that the first page is allocated from a reservation, the - * least significant bits of its physical address can be determined - * from its offset from the beginning of the reservation and the size - * of the reservation. - * - * Could the specified index within a reservation of the smallest - * possible size satisfy the alignment and boundary requirements? - */ - pa = VM_RESERV_INDEX(object, pindex) << PAGE_SHIFT; - if ((pa & (alignment - 1)) != 0) - return (NULL); - size = npages << PAGE_SHIFT; - if (((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) - return (NULL); - - /* - * Look for an existing reservation. - */ - rv = vm_reserv_from_object(object, pindex, mpred, &msucc); - if (rv == NULL) - return (NULL); - KASSERT(object != kernel_object || rv->domain == domain, - ("vm_reserv_extend_contig: Domain mismatch from reservation.")); - index = VM_RESERV_INDEX(object, pindex); - /* Does the allocation fit within the reservation? */ - if (index + npages > VM_LEVEL_0_NPAGES) - return (NULL); - domain = rv->domain; - vmd = VM_DOMAIN(domain); - vm_reserv_lock(rv); - if (rv->object != object) - goto out; - m = &rv->pages[index]; - pa = VM_PAGE_TO_PHYS(m); - if (pa < low || pa + size > high || (pa & (alignment - 1)) != 0 || - ((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) - goto out; - /* Handle vm_page_rename(m, new_object, ...). */ - for (i = 0; i < npages; i++) { - if (popmap_is_set(rv->popmap, index + i)) - goto out; - } - if (!vm_domain_allocate(vmd, req, npages)) - goto out; - for (i = 0; i < npages; i++) - vm_reserv_populate(rv, index + i); - vm_reserv_unlock(rv); - return (m); - -out: - vm_reserv_unlock(rv); - return (NULL); -} - -/* * Allocates a contiguous set of physical pages of the given size "npages" - * from newly created reservations. All of the physical pages + * from existing or newly created reservations. All of the physical pages * must be at or above the given physical address "low" and below the given * physical address "high". The given value "alignment" determines the * alignment of the first physical page in the set. If the given value @@ -672,18 +585,15 @@ out: * physical address boundary that is a multiple of that value. Both * "alignment" and "boundary" must be a power of two. * - * Callers should first invoke vm_reserv_extend_contig() to attempt an - * allocation from existing reservations. - * * The page "mpred" must immediately precede the offset "pindex" within the * specified object. * - * The object and free page queue must be locked. + * The object must be locked. */ vm_page_t -vm_reserv_alloc_contig(int req, vm_object_t object, vm_pindex_t pindex, int domain, - u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, - vm_paddr_t boundary, vm_page_t mpred) +vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, int domain, + int req, vm_page_t mpred, u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary) { struct vm_domain *vmd; vm_paddr_t pa, size; @@ -721,13 +631,42 @@ vm_reserv_alloc_contig(int req, vm_object_t object, vm return (NULL); /* - * Callers should've extended an existing reservation prior to - * calling this function. If a reservation exists it is - * incompatible with the allocation. + * Look for an existing reservation. */ rv = vm_reserv_from_object(object, pindex, mpred, &msucc); - if (rv != NULL) + if (rv != NULL) { + KASSERT(object != kernel_object || rv->domain == domain, + ("vm_reserv_alloc_contig: domain mismatch")); + index = VM_RESERV_INDEX(object, pindex); + /* Does the allocation fit within the reservation? */ + if (index + npages > VM_LEVEL_0_NPAGES) + return (NULL); + domain = rv->domain; + vmd = VM_DOMAIN(domain); + vm_reserv_lock(rv); + /* Handle reclaim race. */ + if (rv->object != object) + goto out; + m = &rv->pages[index]; + pa = VM_PAGE_TO_PHYS(m); + if (pa < low || pa + size > high || + (pa & (alignment - 1)) != 0 || + ((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) + goto out; + /* Handle vm_page_rename(m, new_object, ...). */ + for (i = 0; i < npages; i++) + if (popmap_is_set(rv->popmap, index + i)) + goto out; + if (!vm_domain_allocate(vmd, req, npages)) + goto out; + for (i = 0; i < npages; i++) + vm_reserv_populate(rv, index + i); + vm_reserv_unlock(rv); + return (m); +out: + vm_reserv_unlock(rv); return (NULL); + } /* * Could at least one reservation fit between the first index to the @@ -849,8 +788,7 @@ vm_reserv_alloc_contig(int req, vm_object_t object, vm } /* - * Attempts to extend an existing reservation and allocate the page to the - * object. + * Allocate a physical page from an existing or newly created reservation. * * The page "mpred" must immediately precede the offset "pindex" within the * specified object. @@ -858,70 +796,11 @@ vm_reserv_alloc_contig(int req, vm_object_t object, vm * The object must be locked. */ vm_page_t -vm_reserv_extend(int req, vm_object_t object, vm_pindex_t pindex, int domain, - vm_page_t mpred) +vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex, int domain, + int req, vm_page_t mpred) { struct vm_domain *vmd; vm_page_t m, msucc; - vm_reserv_t rv; - int index; - - VM_OBJECT_ASSERT_WLOCKED(object); - - /* - * Could a reservation currently exist? - */ - if (pindex < VM_RESERV_INDEX(object, pindex) || - pindex >= object->size || object->resident_page_count == 0) - return (NULL); - - /* - * Look for an existing reservation. - */ - rv = vm_reserv_from_object(object, pindex, mpred, &msucc); - if (rv == NULL) - return (NULL); - - KASSERT(object != kernel_object || rv->domain == domain, - ("vm_reserv_extend: Domain mismatch from reservation.")); - domain = rv->domain; - vmd = VM_DOMAIN(domain); - index = VM_RESERV_INDEX(object, pindex); - m = &rv->pages[index]; - vm_reserv_lock(rv); - /* Handle reclaim race. */ - if (rv->object != object || - /* Handle vm_page_rename(m, new_object, ...). */ - popmap_is_set(rv->popmap, index)) { - m = NULL; - goto out; - } - if (vm_domain_allocate(vmd, req, 1) == 0) - m = NULL; - else - vm_reserv_populate(rv, index); -out: - vm_reserv_unlock(rv); - - return (m); -} - -/* - * Attempts to allocate a new reservation for the object, and allocates a - * page from that reservation. Callers should first invoke vm_reserv_extend() - * to attempt an allocation from an existing reservation. - * - * The page "mpred" must immediately precede the offset "pindex" within the - * specified object. - * - * The object and free page queue must be locked. - */ -vm_page_t -vm_reserv_alloc_page(int req, vm_object_t object, vm_pindex_t pindex, int domain, - vm_page_t mpred) -{ - struct vm_domain *vmd; - vm_page_t m, msucc; vm_pindex_t first, leftcap, rightcap; vm_reserv_t rv; int index; @@ -936,13 +815,32 @@ vm_reserv_alloc_page(int req, vm_object_t object, vm_p return (NULL); /* - * Callers should've extended an existing reservation prior to - * calling this function. If a reservation exists it is - * incompatible with the allocation. + * Look for an existing reservation. */ rv = vm_reserv_from_object(object, pindex, mpred, &msucc); - if (rv != NULL) - return (NULL); + if (rv != NULL) { + KASSERT(object != kernel_object || rv->domain == domain, + ("vm_reserv_alloc_page: domain mismatch")); + domain = rv->domain; + vmd = VM_DOMAIN(domain); + index = VM_RESERV_INDEX(object, pindex); + m = &rv->pages[index]; + vm_reserv_lock(rv); + /* Handle reclaim race. */ + if (rv->object != object || + /* Handle vm_page_rename(m, new_object, ...). */ + popmap_is_set(rv->popmap, index)) { + m = NULL; + goto out; + } + if (vm_domain_allocate(vmd, req, 1) == 0) + m = NULL; + else + vm_reserv_populate(rv, index); +out: + vm_reserv_unlock(rv); + return (m); + } /* * Could a reservation fit between the first index to the left that Modified: head/sys/vm/vm_reserv.h ============================================================================== --- head/sys/vm/vm_reserv.h Mon Jun 3 04:38:07 2019 (r348524) +++ head/sys/vm/vm_reserv.h Mon Jun 3 05:15:36 2019 (r348525) @@ -47,17 +47,12 @@ /* * The following functions are only to be used by the virtual memory system. */ -vm_page_t vm_reserv_alloc_contig(int req, vm_object_t object, vm_pindex_t pindex, - int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, - u_long alignment, vm_paddr_t boundary, vm_page_t mpred); -vm_page_t vm_reserv_extend_contig(int req, vm_object_t object, - vm_pindex_t pindex, int domain, u_long npages, +vm_page_t vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, + int domain, int req, vm_page_t mpred, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, - vm_paddr_t boundary, vm_page_t mpred); -vm_page_t vm_reserv_alloc_page(int req, vm_object_t object, vm_pindex_t pindex, - int domain, vm_page_t mpred); -vm_page_t vm_reserv_extend(int req, vm_object_t object, - vm_pindex_t pindex, int domain, vm_page_t mpred); + vm_paddr_t boundary); +vm_page_t vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex, + int domain, int req, vm_page_t mpred); void vm_reserv_break_all(vm_object_t object); boolean_t vm_reserv_free_page(vm_page_t m); void vm_reserv_init(void); From owner-svn-src-head@freebsd.org Mon Jun 3 05:25: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 3BF3B15A41B5; Mon, 3 Jun 2019 05:25:17 +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 CE38A8ECB7; Mon, 3 Jun 2019 05:25:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B330A19E6; Mon, 3 Jun 2019 05:25:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x535PGhT054913; Mon, 3 Jun 2019 05:25:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x535PGFk054912; Mon, 3 Jun 2019 05:25:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906030525.x535PGFk054912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Jun 2019 05:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348526 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE38A8ECB7 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 03 Jun 2019 05:25:17 -0000 Author: imp Date: Mon Jun 3 05:25:16 2019 New Revision: 348526 URL: https://svnweb.freebsd.org/changeset/base/348526 Log: Fix mismerge that crept into r301289. The conversion of 0 -> NULL required a rebase at some point, as noted in r301289 when pfg commited it. In that rebase, three lines remained that had been removed in a prior version of awk, and one of them had a 0 -> NULL change causing a conflict. The conflict should have been resolved by removing the three lines, but wasn't. This introduces a regression into f.split3 test which prior to this commit we were failing, but a pure onetrueawk wasn't. Remove the offending 3 lines. Modified: head/contrib/one-true-awk/run.c Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Mon Jun 3 05:15:36 2019 (r348525) +++ head/contrib/one-true-awk/run.c Mon Jun 3 05:25:16 2019 (r348526) @@ -1387,9 +1387,6 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[ tempfree(y); free(origs); free(origfs); - if (a[2] != NULL && arg3type == STRING) { - tempfree(x); - } x = gettemp(); x->tval = NUM; x->fval = n; From owner-svn-src-head@freebsd.org Mon Jun 3 05:25: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 E99DB15A41E0; Mon, 3 Jun 2019 05:25:26 +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 865618ED71; Mon, 3 Jun 2019 05:25:26 +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 0472A19E7; Mon, 3 Jun 2019 05:25:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x535PMeR054967; Mon, 3 Jun 2019 05:25:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x535PMMv054966; Mon, 3 Jun 2019 05:25:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906030525.x535PMMv054966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Jun 2019 05:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348527 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 348527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 865618ED71 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)[-1.000,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: Mon, 03 Jun 2019 05:25:27 -0000 Author: imp Date: Mon Jun 3 05:25:22 2019 New Revision: 348527 URL: https://svnweb.freebsd.org/changeset/base/348527 Log: Another partial revert of r301289. In this case, a change was made in one-true-awk from *FS to getsval(fsloc) in a line just after one of the lines that had the 0 -> NULL change. It works both ways as far as I can tell. It looks like a bug fix, but I've not tried to track down which ancient version of one-true-awk it was in (github starts too late for tracking this down). Before and after the changes the regression suite is passes 100% relative to the un-modified one-true-awk. Modified: head/contrib/one-true-awk/run.c Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Mon Jun 3 05:25:16 2019 (r348526) +++ head/contrib/one-true-awk/run.c Mon Jun 3 05:25:22 2019 (r348527) @@ -1267,7 +1267,7 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[ origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == NULL) /* fs string */ - fs = *FS; + fs = getsval(fsloc); else if (arg3type == STRING) { /* split(str,arr,"string") */ x = execute(a[2]); origfs = fs = strdup(getsval(x)); From owner-svn-src-head@freebsd.org Mon Jun 3 10:04: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 DBE0815AB493; Mon, 3 Jun 2019 10:04:35 +0000 (UTC) (envelope-from wulf@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 7E79570476; Mon, 3 Jun 2019 10:04:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629344B37; Mon, 3 Jun 2019 10:04:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53A4ZKM002036; Mon, 3 Jun 2019 10:04:35 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53A4ZtQ002035; Mon, 3 Jun 2019 10:04:35 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906031004.x53A4ZtQ002035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 3 Jun 2019 10:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348529 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 348529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E79570476 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)[-1.000,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: Mon, 03 Jun 2019 10:04:36 -0000 Author: wulf Date: Mon Jun 3 10:04:34 2019 New Revision: 348529 URL: https://svnweb.freebsd.org/changeset/base/348529 Log: psm(4): Add natural scrolling support to sysmouse protocol This change enables natural scrolling with two finger scroll enabled and when user is using a trackpad (mouse and trackpoint are not affected). Depending on trackpad model it can be activated with setting of hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl values to 1. Evdev protocol is not affected by this change too. Tune userland client e.g. libinput to enable natural scrolling in that case. Submitted by: nyan_myuji.xyz Reviewed by: wulf MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20447 Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Jun 3 07:57:54 2019 (r348528) +++ head/sys/dev/atkbdc/psm.c Mon Jun 3 10:04:34 2019 (r348529) @@ -236,6 +236,7 @@ typedef struct synapticsinfo { int softbutton3_x; int max_x; int max_y; + int natural_scroll; } synapticsinfo_t; typedef struct synapticspacket { @@ -571,6 +572,8 @@ enum { SYNAPTICS_SYSCTL_SOFTBUTTONS_Y = SYN_OFFSET(softbuttons_y), SYNAPTICS_SYSCTL_SOFTBUTTON2_X = SYN_OFFSET(softbutton2_x), SYNAPTICS_SYSCTL_SOFTBUTTON3_X = SYN_OFFSET(softbutton3_x), + SYNAPTICS_SYSCTL_NATURAL_SCROLL = SYN_OFFSET(natural_scroll), +#define SYNAPTICS_SYSCTL_LAST SYNAPTICS_SYSCTL_NATURAL_SCROLL }; /* packet formatting function */ @@ -4134,6 +4137,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo int len, weight_prev_x, weight_prev_y; int div_max_x, div_max_y, div_x, div_y; int is_fuzzy; + int natural_scroll; /* Read sysctl. */ /* XXX Verify values? */ @@ -4161,6 +4165,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo two_finger_scroll = sc->syninfo.two_finger_scroll; max_x = sc->syninfo.max_x; max_y = sc->syninfo.max_y; + natural_scroll = sc->syninfo.natural_scroll; is_fuzzy = (f->flags & PSM_FINGER_FUZZY) != 0; @@ -4322,14 +4327,24 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo smoother_id, dx, dy, dxp, dyp)); break; case 1: /* Vertical scrolling. */ - if (dyp != 0) - ms->button |= (dyp > 0) ? - MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + if (dyp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dyp > 0) ? + MOUSE_BUTTON5DOWN : MOUSE_BUTTON4DOWN; + else + ms->button |= (dyp > 0) ? + MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN; + } break; case 2: /* Horizontal scrolling. */ - if (dxp != 0) - ms->button |= (dxp > 0) ? - MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + if (dxp != 0) { + if (two_finger_scroll && natural_scroll) + ms->button |= (dxp > 0) ? + MOUSE_BUTTON6DOWN : MOUSE_BUTTON7DOWN; + else + ms->button |= (dxp > 0) ? + MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN; + } break; } @@ -5641,7 +5656,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) int error, arg; if (oidp->oid_arg1 == NULL || oidp->oid_arg2 < 0 || - oidp->oid_arg2 > SYNAPTICS_SYSCTL_SOFTBUTTON3_X) + oidp->oid_arg2 > SYNAPTICS_SYSCTL_LAST) return (EINVAL); sc = oidp->oid_arg1; @@ -5730,6 +5745,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); break; case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + case SYNAPTICS_SYSCTL_NATURAL_SCROLL: if (arg < 0 || arg > 1) return (EINVAL); break; @@ -6121,6 +6137,15 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF, synaptics_sysctl, "I", "Turn off touchpad"); + + /* hw.psm.synaptics.natural_scroll. */ + sc->syninfo.natural_scroll = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "natural_scroll", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, SYNAPTICS_SYSCTL_NATURAL_SCROLL, + synaptics_sysctl, "I", + "Enable natural scrolling"); sc->syninfo.softbuttons_y = 0; sc->syninfo.softbutton2_x = 0; From owner-svn-src-head@freebsd.org Mon Jun 3 11: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 83F3715ACF3A; Mon, 3 Jun 2019 11:06:32 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 1FCF8728A0; Mon, 3 Jun 2019 11:06:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2001:630:212:2a8:a580:d226:f97b:cba8] (unknown [IPv6:2001:630:212:2a8:a580:d226:f97b:cba8]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 1E1014E770; Mon, 3 Jun 2019 11:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1559559954; bh=sXJZFDkN28I0ULT2q96TNOSUnMy0L83tSR2WaoDSPVM=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=mY1x5eONsWDygA7wi9JQaxt5+9nFxSitG5T7VbkVBy0/rzMxDXmeI9FLwUWwtX+4n asVuWAgDWim0XpjlsLvJ07Yv87815bgr6yRX1wImlKQURsyBj1t1mBFkX/kal8qOrK NjCUgXIsoMLMArxsCPzDS3lAEIYbxudnMmZTq9B3uWPpdgZ7HHDvgwaVoeQ8ePc4r/ Xjl2NDShLbDZEDUxo0ZPplZ6Msfn9N7WIp0epjY3428gknPchxrvNc1VBve3GDb9bh oRle6/hE3oTkLN6cyUgLA66/YJqXXGA+DKQNsDJTT5CVzASCUY60ADGFK0P5k2D8Yv cjkXH1oUZt+UhSrk1pYxuM0lydo6caO7+QZbfmh/BPYvC/txWssZGvxqIK5qwaz+DM V/pj6dMaeX/s+34Ur6SBz6aXu6M1VAGVTvdvh946HzJGl3854P1KMeClzWFZom09Yn sog2/tKRoIlUl2eLmI6i1KFGtV5fCin0KL/Nq+Radz5lu5fHHxf2g32wxD8f+6xH5b ogSrGF3zo3XvN8xUMxpz+r0zaV3RrgRM730Q0ZNeaWVeFM8WaVYZW5dURXMqvI/Fge b5MIsw5RzvhFFdqjxnXoFaISmeeVsAoDGYul9dNgCWoZB8d+u/IMCXU8HQ4zCIPTfA DBbj+81L+XyVfVwCZR2oRy9A= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb From: Andrew Turner In-Reply-To: <201906022338.x52NcJV9070782@repo.freebsd.org> Date: Mon, 3 Jun 2019 12:05:53 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz> References: <201906022338.x52NcJV9070782@repo.freebsd.org> To: Maxim Sobolev X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 1FCF8728A0 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.936,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, 03 Jun 2019 11:06:32 -0000 > On 3 Jun 2019, at 00:38, Maxim Sobolev wrote: >=20 > Author: sobomax > Date: Sun Jun 2 23:38:19 2019 > New Revision: 348521 > URL: https://svnweb.freebsd.org/changeset/base/348521 >=20 > Log: > Fix several places where tool name has been hardcoded: >=20 > install -> ${INSTALL} > mtree -> ${MTREE_CMD} > services_mkdb -> ${SERVICES_MKDB_CMD} > cap_mkdb -> ${CAP_MKDB_CMD} > pwd_mkdb -> ${PWD_MKDB_CMD} > kldxref -> ${KLDXREF_CMD} >=20 > If you do custom FreeBSD builds you may want to override those > in some cases. >=20 > Sponsored by: Sippy Software, Inc. This breaks installworld in a local Jenkins instance. I=E2=80=99m = building with -DDB_FROM_SRC and -DNO_ROOT. It looks like INSTALL is = unset. Andrew -------------------------------------------------------------- >>> Making hierarchy -------------------------------------------------------------- cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f = Makefile.inc1 LOCAL_MTREE=3D hierarchy cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; = PATH=3D/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD= -arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/Fre= eBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm6= 4.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/wo= rkspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:= /jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-= head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/Free= BSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64= .aarch64/tmp/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins= /workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jen= kins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head= /freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-h= ead/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tm= p/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/worksp= ace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenk= ins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/= freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ make = LOCAL_MTREE=3D = PATH=3D/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD= -arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/Fre= eBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm6= 4.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/wo= rkspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:= /jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-= head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/Free= BSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64= .aarch64/tmp/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins= /workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jen= kins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head= /freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-h= ead/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tm= p/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/worksp= ace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenk= ins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/= freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ = METALOG=3D/jenkins/workspace/FreeBSD-arm64-head/obj/root//METALOG = -DNO_ROOT distrib-dirs for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit = /usr/share/doc/usd/12.vi /usr/share/doc/usd/13.viref; do if [ -f = /jenkins/workspace/FreeBSD-arm64-head/obj/root/${file} ]; then rm -f = /jenkins/workspace/FreeBSD-arm64-head/obj/root/${file}; fi; done -N /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc -W -deU -i -f = /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc/mtree/BSD.root.dist= -p /jenkins/workspace/FreeBSD-arm64-head/obj/root/ /tmp/install.ZQ3PdXVZ/sh: -N: not found *** Error code 127 Stop. make[4]: stopped in = /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc *** Error code 1 Stop. make[3]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head *** Error code 1 Stop. make[2]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head *** Error code 1 Stop. make[1]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head *** Error code 1 Stop. make: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head= From owner-svn-src-head@freebsd.org Mon Jun 3 11:16: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 4654D15AD611; Mon, 3 Jun 2019 11:16:37 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7602A72F8C; Mon, 3 Jun 2019 11:16:36 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45HXYv4BK3z3c7W; Mon, 3 Jun 2019 11:16:35 +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 ydPFxNBXKKOr; Mon, 3 Jun 2019 11:16:34 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-177-23.mobileonline.telia.com [90.236.177.23]) by mail.daemonic.se (Postfix) with ESMTPSA id 45HXYt3PW3z3c7V; Mon, 3 Jun 2019 11:16:34 +0000 (UTC) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Ian Lepore , Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> Cc: jmd@freebsd.org From: Niclas Zeising Message-ID: Date: Mon, 3 Jun 2019 13:16:33 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7602A72F8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/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, 03 Jun 2019 11:16:37 -0000 On 2019-05-29 22:52, Ian Lepore wrote: > On Wed, 2019-05-29 at 15:12 +0300, Andriy Gapon wrote: >> On 29/05/2019 14:54, Niclas Zeising wrote: >>> On 2019-05-29 11:08, Andriy Gapon wrote: >>>> Author: avg >>>> Date: Wed May 29 09:08:20 2019 >>>> New Revision: 348355 >>>> URL: https://svnweb.freebsd.org/changeset/base/348355 >>>> >>>> Log: >>>> revert r273728 and parts of r306589, iicbus no-stop by default feature >>>> Since drm2 removal, there has not been any consumer of the feature in the >>>> tree. I am also unaware of any out-of-tree consumer. >>>> More importantly, the feature has been broken from the very start, both >>>> before and after r306589, because the ivar was set on a device that does >>>> not support it and it was read from another device that also does not >>>> support it. >>>> A bus-wide no-stop flag cannot be implemented as an ivar as iicbus >>>> attaches as a child of various drivers. Implementing the ivar in each >>>> and every I2C driver is just impractical. >>>> If we ever want to implement this feature properly, then probably the >>>> easiest way to do it would be via a flag in the softc of iicbus. >>>> In fact, we might have to do that in the stable branches if we want to >>>> fix the code for them. >>>> Reported by: ian (long time ago) >>>> MFC after: 1 month (maybe) >>>> X-MFC-note: cannot just merge the change, must keep drm2 happy >>>> >>> >>> Hi! >>> Just a note, be aware that drm2 lives on in ports as drm-legacy-kmod. I haven't >>> tested, but, from the description above I worry that it will affect the port. >>> What do you think? >> >> Oh, I forgot about that one... >> I think that it could be affected if it still uses FreeBSD iic code. >> I guess I might have to revert the change. >> >> > > I don't think so, because I don't think this change ever worked. I'm > not sure how anybody convinced themselves that it did. It attempts to > retrieve ivars from a device that doesn't have them, so the net effect > is that the nostop variable is initialized from stack garbage. Maybe > whoever wrote and tested it was lucky enough to have that accidentally > be consistently zero or non-zero, so their testing appeared to work. > > Looking at the drm2 code that is the only user of this, it appears that > the nostop value is only used in the case where the driver falls back > to using the builtin intel_iicbb_driver. That driver relies on > iicbus_transfer_gen() which is where the nostop kludge was added. > That's the fundamental problem in all of this: the right thing to do, > IMO, would have been to implement the iicbus_transfer method directly > in the intel_iicbb_driver (probably by just cut-and-pasting the code > from iicconf.c then doing whatever is necessary to ignore stops). And > we can still do that, pretty trivially, if necessary. > > -- Ian > Hi! It seems like things broke after all, latest pkg build (on head-amd64) reports this: /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: error: implicit declaration of function 'iicbus_set_nostop' is invalid in C99 [-Werror,-Wimplicit-function-declaration] iicbus_set_nostop(idev, true); ^ /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] 2 errors generated. Full log: http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 3 11:47: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 4688015AE2B3; Mon, 3 Jun 2019 11:47:47 +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 93CF374640; Mon, 3 Jun 2019 11:47:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id XlRDhJeu9sAGkXlREhemCn; Mon, 03 Jun 2019 05:47:43 -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=8nJEP1OIZ-IA:10 a=dq6fvYVFJ5YA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=2XmiEZUna_0MqeyhgvoA:9 a=uHhnFxlJQH1SNMDO:21 a=hOFooyYVQWxnzKIV:21 a=wPNLvfGTeEIA: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 B78113E4; Mon, 3 Jun 2019 04:47:38 -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 x53Blco4013007; Mon, 3 Jun 2019 04:47:38 -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 x53Blc0b013004; Mon, 3 Jun 2019 04:47:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906031147.x53Blc0b013004@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: Andrew Turner cc: Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb In-Reply-To: Message from Andrew Turner of "Mon, 03 Jun 2019 12:05:53 +0100." <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Mon, 03 Jun 2019 04:47:38 -0700 X-CMAE-Envelope: MS4wfG6+9KXayF/nlcWZNpil2sIyH5uQNAed6k39SNeoPgIrjdiHvCn6JfaN5GMpAHLhjTA0x4UQPSz/lF/Xzqv85A7TRFYps6KvoErB5oSpCcmalWssIVWJ LXS6paCLaYJV4KARY7BiiIBXGCGsCVgTJ2Pt6guVnPlwaS3mcZE7I+ZzcYTBoKRcaaL9Bp2kiZNd5Am0liBNNvIFAnK5gvJ3E7/4kHcAyI33MbwLP1UaIfos Wb/m4yDUCSPSikRJXQKZinqF/I+gP+wHwKThL9LS1jt1LlgvkHeX2B1hwVZpZEKkFepnZ12uLU1eN5zvNiBJ+U4tGNHb6acs6qFVLWsG3ek= X-Rspamd-Queue-Id: 93CF374640 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.99)[-0.992,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)[]; IP_SCORE(-2.53)[ip: (-6.75), ipnet: 64.59.128.0/20(-3.27), asn: 6327(-2.53), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] 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, 03 Jun 2019 11:47:47 -0000 In message <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz>, Andrew Turner writes: > > > > On 3 Jun 2019, at 00:38, Maxim Sobolev wrote: > > > > Author: sobomax > > Date: Sun Jun 2 23:38:19 2019 > > New Revision: 348521 > > URL: https://svnweb.freebsd.org/changeset/base/348521 > > > > Log: > > Fix several places where tool name has been hardcoded: > > > > install -> ${INSTALL} > > mtree -> ${MTREE_CMD} > > services_mkdb -> ${SERVICES_MKDB_CMD} > > cap_mkdb -> ${CAP_MKDB_CMD} > > pwd_mkdb -> ${PWD_MKDB_CMD} > > kldxref -> ${KLDXREF_CMD} > > > > If you do custom FreeBSD builds you may want to override those > > in some cases. > > > > Sponsored by: Sippy Software, Inc. > > This breaks installworld in a local Jenkins instance. I’m building with -DD > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset. > > Andrew > > -------------------------------------------------------------- > >>> Making hierarchy > -------------------------------------------------------------- > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f Makefile.inc1 > LOCAL_MTREE= hierarchy > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; PATH=/jenkins/work > space/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-hea > d/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkin > s/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkin > s/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freeb > sd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-he > ad/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/le > gacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/Free > BSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/jenkins/workspace/ > FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm6 > 4.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/work > space/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/work > space/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-hea > d/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj > /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/u > sr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-ar > m64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ mak > e LOCAL_MTREE= PATH=/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspa > ce/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/worksp > ace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/ > arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/w > orkspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/j > enkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/ > freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm6 > 4-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tm > p/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/Fre > eBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/Fr > eeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64. > aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspa > ce/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins > /workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebs > d-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head > /obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/lega > cy/bin::/tmp/install.ZQ3PdXVZ METALOG=/jenkins/workspace/FreeBSD-arm64-head/o > bj/root//METALOG -DNO_ROOT distrib-dirs > for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit /usr/share > /doc/usd/12.vi /usr/share/doc/usd/13.viref; do if [ -f /jenkins/workspace/Fr > eeBSD-arm64-head/obj/root/${file} ]; then rm -f /jenkins/workspace/FreeBSD-a > rm64-head/obj/root/${file}; fi; done > -N /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc -W -deU -i -f /jenk > ins/workspace/FreeBSD-arm64-head/freebsd-head/etc/mtree/BSD.root.dist -p /jen > kins/workspace/FreeBSD-arm64-head/obj/root/ > /tmp/install.ZQ3PdXVZ/sh: -N: not found > *** Error code 127 > > Stop. > make[4]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc > *** Error code 1 > > Stop. > make[3]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head > *** Error code 1 > > Stop. > make[2]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head > *** Error code 1 > > Stop. > make[1]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head > *** Error code 1 > > Stop. > make: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head > It also breaks poudirere builds at make distrib-dirs, amd64 and i386, i386 distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs target is the failing one. bob# poudriere jail -j HEADi386 -u && _poudriere-check-version -f [00:00:01] Upgrading using src=/opt/src/svn-current [00:00:01] Copying /opt/src/svn-current to /poudriere/i386/jails/HEADi386/usr/src... done [00:03:49] Starting make installworld --- installworld --- make[1]: "/export/obj/opt/src/svn-current/i386.i386/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at bob on Sun Jun 2 23:24:27 PDT 2019 --- _installcheck_world --- -------------------------------------------------------------- >>> Install check world -------------------------------------------------------------- --- installworld --- mkdir -p /tmp/install.POsc3ffM progs=$(for prog in [ awk cap_mkdb cat chflags chmod chown cmp cp date echo egrep find grep id install ln make mkdir mtree mv pwd_mkdb rm sed services_mkdb sh sort strip sysctl test true uname wc zic tzsetup makewhatis; do if progpath=`which $prog`; then echo $progpath; else echo "Required tool $prog not found in PATH." >&2; exit 1; fi; done); libs=$(ldd -f "%o %p\n" -f "%o %p\n" $progs 2>/dev/null | sort -u | while read line; do $line; if [ "$2 $3" != "not found" ]; then echo $2; else echo "Required library $1 not found." >&2; exit 1; fi; done); cp $libs $progs /tmp/install.POsc3ffM cp -R ${PATH_LOCALE:-"/usr/share/locale"} /tmp/install.POsc3ffM/locale cd /opt/src/svn-current; MACHINE_ARCH=i386 MACHINE=i386 CPUTYPE= CC="/usr/local/bin/ccache cc -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" CXX="/usr/local/bin/ccache c++ -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" CPP="cpp -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" AS="as" AR="ar" LD="ld" LLVM_LINK="" NM=nm OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" PATH=/export/obj/opt/src/svn-current/i386.i386/tmp/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/bin::/tmp/install.POsc3! ffM LD_LIBRARY_PATH=/tmp/install.POsc3ffM PATH_LOCALE=/tmp/install.POsc3ffM/locale make -f Makefile.inc1 INSTALL="install -N /opt/src/svn-current/etc" MTREE_CMD=" -N /opt/src/svn-current/etc" __MAKE_SHELL=/tmp/install.POsc3ffM/sh reinstall; MACHINE_ARCH=i386 MACHINE=i386 CPUTYPE= CC="/usr/local/bin/ccache cc -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" CXX="/usr/local/bin/ccache c++ -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" CPP="cpp -target i386-unknown-freebsd13.0 --sysroot=/export/obj/opt/src/svn-current/i386.i386/tmp -B/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin" AS="as" AR="ar" LD="ld" LLVM_LINK="" NM=nm OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" PATH=/export/obj/opt/src/svn-current/i386.i386/tmp/usr/sbin:/export/obj/opt/src/svn-current/! i386.i386/tmp/usr/bin:/export/obj/opt/src/svn-current/i386.i38! 6/tmp/legacy/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/bin::/tmp/install.POsc3ffM LD_LIBRARY_PATH=/tmp/install.POsc3ffM PATH_LOCALE=/tmp/install.POsc3ffM/locale rm -rf /tmp/install.POsc3ffM --- reinstall --- -------------------------------------------------------------- >>> Making hierarchy -------------------------------------------------------------- cd /opt/src/svn-current; make -f Makefile.inc1 LOCAL_MTREE= hierarchy --- hierarchy --- cd /opt/src/svn-current/etc; PATH=/export/obj/opt/src/svn-current/i386.i386/tmp/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/bin::/export/obj/opt/src/svn-current/i386.i386/tmp/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/sbin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/usr/bin:/export/obj/opt/src/svn-current/i386.i386/tmp/legacy/bin::/tmp/install.POsc3ffM make LOCAL_MTREE= distrib-dirs --- distrib-cleanup --- for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit /usr/share/doc/usd/12.vi /usr/share/doc/usd/13.viref; do if [ -f /poudriere/i386/jails/HEADi386/${file} ]; then rm -f /poudriere/i386/jails/HEADi386/${file}; fi; done --- distrib-dirs --- -N /opt/src/svn-current/etc -deU -i -f /opt/src/svn-current/etc/mtree/BSD.root.dist -p /poudriere/i386/jails/HEADi386/ sh: -N: not found *** [distrib-dirs] Error code 127 make[4]: stopped in /opt/src/svn-current/etc 1 error make[4]: stopped in /opt/src/svn-current/etc *** [hierarchy] Error code 2 make[3]: stopped in /opt/src/svn-current 1 error make[3]: stopped in /opt/src/svn-current *** [reinstall] Error code 2 make[2]: stopped in /opt/src/svn-current 1 error make[2]: stopped in /opt/src/svn-current *** [installworld] Error code 2 make[1]: stopped in /opt/src/svn-current 1 error make[1]: stopped in /opt/src/svn-current *** [installworld] Error code 2 make: stopped in /opt/src/svn-current 1 error make: stopped in /opt/src/svn-current [00:03:51] Error: Failed to 'make installworld' bob# -- 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 Mon Jun 3 12:14: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 42CDD15AF7F4; Mon, 3 Jun 2019 12:14:20 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.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 8A8D575779; Mon, 3 Jun 2019 12:14:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f195.google.com with SMTP id a10so12709918ljf.6; Mon, 03 Jun 2019 05:14:19 -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:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=SJKBFwPNyTZmreRqEsJT1yDMDyx8JYvJAtmoybi5rog=; b=J8+DQ33qEOSVrxQ34fUsQrKfpO+ZubdiAsqzeeQPAbR6/HqTv42g672eYDN4sNszxC mhWn4CDWYJlNSMefBU0XGN0kWQPGw5LP2o8bGtgTG9cFMc6hoX0vU7NEbsRVxLejVKcf hPwSAiieNsYVzfs8O5wNzv+xsrayhzrjwWMcmoMVrDTEqhJO5N00aZAMbry5pD6TbB7a BYHe9aPebPJWqtEzRML2JSXkCPv/Tb9Zp1wnNLHtg8nUhsrygl05bynB3T/q+Iahj87R KUdEwwNo3gCMtBTflBT71UdHRoPQjTCa7wE2YKEEtfLSuVUS3M1wolHDtR5Xqn0Vz4o9 9oPg== X-Gm-Message-State: APjAAAWnackh8coxe2sUJL5APwCSqbUGQe3jZdrFBq0VoPQRwo5uszKC w4WvwUEewFJLxWwmjVfeti1KB5lZ X-Google-Smtp-Source: APXvYqwNDSrN+JbGGhv8xmweMGdjKByTtSiTlYQzcf1TivtbtiEPj6N7DYwFjjVDfOry27vaDsda8g== X-Received: by 2002:a2e:4a1a:: with SMTP id x26mr14017207lja.207.1559563685271; Mon, 03 Jun 2019 05:08:05 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id d2sm3063624ljc.84.2019.06.03.05.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 05:08:03 -0700 (PDT) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Niclas Zeising , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org References: <201905290908.x4T98L89066643@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, 3 Jun 2019 15:08:02 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A8D575779 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, 03 Jun 2019 12:14:20 -0000 On 03/06/2019 14:16, Niclas Zeising wrote: > Hi! > It seems like things broke after all, latest pkg build (on head-amd64) reports > this: > > > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: > error: implicit declaration of function 'iicbus_set_nostop' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] >         iicbus_set_nostop(idev, true); >         ^ > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: > error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] > 2 errors generated. > > Full log: > > http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log Hi! Thank you for the report. I am going to restore iicbus_set_nostop, but this time as a function that modifies iicbus softc (instead of an ivar accessor for the bus). I am including a patch that I would like to commit. However, for the drm code to request the nostop mode correctly it needs to be fixed as well. My proposed patch is here: https://github.com/FreeBSDDesktop/drm-legacy/pull/9 Index: sys/dev/iicbus/iicbus.h =================================================================== --- sys/dev/iicbus/iicbus.h (revision 348529) +++ sys/dev/iicbus/iicbus.h (working copy) @@ -46,6 +46,8 @@ struct iicbus_softc * 0 if no start condition succeeded */ u_char strict; /* deny operations that violate the * I2C protocol */ + bool nostop; /* iicbus_transfer defaults to repeated + * start between messages */ struct mtx lock; u_int bus_freq; /* Configured bus Hz. */ }; @@ -77,6 +79,7 @@ IICBUS_ACCESSOR(addr, ADDR, uint32_t) int iicbus_generic_intr(device_t dev, int event, char *buf); void iicbus_init_frequency(device_t dev, u_int bus_freq); +void iicbus_set_nostop(device_t dev, bool val); extern driver_t iicbus_driver; extern devclass_t iicbus_devclass; Index: sys/dev/iicbus/iiconf.c =================================================================== --- sys/dev/iicbus/iiconf.c (revision 348529) +++ sys/dev/iicbus/iiconf.c (working copy) @@ -383,6 +383,14 @@ iicbus_block_read(device_t bus, u_char slave, char return (error); } +void +iicbus_set_nostop(device_t bus, bool val) +{ + struct iicbus_softc *sc = device_get_softc(bus); + + sc->nostop = val; +} + /* * iicbus_transfer() * @@ -427,7 +435,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg * { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; - bool started; + struct iicbus_softc *sc; + bool nostop, started; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (IIC_ERESOURCE); @@ -438,6 +447,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg * bus = children[0]; rpstart = 0; free(children, M_TEMP); + sc = device_get_softc(bus); + nostop = sc->nostop; started = false; for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; @@ -465,11 +476,12 @@ iicbus_transfer_gen(device_t dev, struct iic_msg * if (error != 0) break; - if (!(msgs[i].flags & IIC_M_NOSTOP)) { + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || + (nostop && i + 1 < nmsgs)) { + rpstart = 1; /* Next message gets repeated start */ + } else { rpstart = 0; iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ } } if (error != 0 && started) -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 3 13:54: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 2C03315B1C4A; Mon, 3 Jun 2019 13:54:38 +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 8A3738164B; Mon, 3 Jun 2019 13:54:37 +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 x53DsV3I043189; Mon, 3 Jun 2019 06:54:31 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x53DsV3X043188; Mon, 3 Jun 2019 06:54:31 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906031354.x53DsV3X043188@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb In-Reply-To: <201906031147.x53Blc0b013004@slippy.cwsent.com> To: Cy Schubert Date: Mon, 3 Jun 2019 06:54:31 -0700 (PDT) CC: Andrew Turner , Maxim Sobolev , 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: 8A3738164B 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.941,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, 03 Jun 2019 13:54:38 -0000 > In message <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz>, Andrew Turner > writes: > > > > > > > On 3 Jun 2019, at 00:38, Maxim Sobolev wrote: > > > > > > Author: sobomax > > > Date: Sun Jun 2 23:38:19 2019 > > > New Revision: 348521 > > > URL: https://svnweb.freebsd.org/changeset/base/348521 > > > > > > Log: > > > Fix several places where tool name has been hardcoded: > > > > > > install -> ${INSTALL} > > > mtree -> ${MTREE_CMD} > > > services_mkdb -> ${SERVICES_MKDB_CMD} > > > cap_mkdb -> ${CAP_MKDB_CMD} > > > pwd_mkdb -> ${PWD_MKDB_CMD} > > > kldxref -> ${KLDXREF_CMD} > > > > > > If you do custom FreeBSD builds you may want to override those > > > in some cases. > > > > > > Sponsored by: Sippy Software, Inc. > > > > This breaks installworld in a local Jenkins instance. I???m building with -DD > > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset. > > > > Andrew > > > > -------------------------------------------------------------- > > >>> Making hierarchy > > -------------------------------------------------------------- > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f Makefile.inc1 > > LOCAL_MTREE= hierarchy > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; PATH=/jenkins/work ... > > It also breaks poudirere builds at make distrib-dirs, amd64 and i386, i386 > distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs target > is the failing one. Something is pretty broke here then, as INSTALL has been defined for ever in sys.mk: sys.mk:INSTALL ?= install -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 3 14:10: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 5CAC615B20C6 for ; Mon, 3 Jun 2019 14:10:48 +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 E7BA281EC1 for ; Mon, 3 Jun 2019 14:10:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id a15so9467964qtn.7 for ; Mon, 03 Jun 2019 07:10:47 -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=iwt3i3Gt0svCjH5TW40kp1/uE2umHkl+LtWx2EXZJEY=; b=ooT8ACe929p07rHhzN+sGE/SohZHIO3GsT1JxwlpXNaxNUt8o6LQyQVhvELISfIJYU 3xZoZJP5Z8yV37tRVZxrSdMWq6Ck3Ezv741dYbB6noaDWS89OiH/xyGrNbDYfg0xURwE v7z9EJI2P39SvWo8k++oJ0Bm7plTJTwCz+a3fN4aGRLFvCTKXVqi6jCElX9jGhasFWsR mHCHqle7n8j+Fs343qERUXE1pZauDRRMgCDmCRVYn9nzYq7T7c0gUBaq3Rr/sh1Zm3nq bfJiFDDV798urf8bKxa6rgWXmLwIKWfVudBfv0d+wie32bQ/ihS2f1I0y0pGwQsXhjef mwcw== 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=iwt3i3Gt0svCjH5TW40kp1/uE2umHkl+LtWx2EXZJEY=; b=GsSq/3bx/lFH+TYl0izwKzUiOmHfm81TfKF6wOE73HYYdKWhQDOuiZZeRsZm7d5oXv RmlJsbxMQZL/gXHQmAIeDVpxVVfXIQF8GD8t9VJDL/u8/e2iWehn8wj+2csddMcXFxtF I4IUIOMUyphIklU07bQkmVnuZCuOtE4Spf4+heLcxFeV7xMuDyVY07C0z4M4xDlbx6mt fExUtwS1NSuKkki3u4UuipGegxEYTMYSqUohpGgKTSh6R5/p5lwIJ/0g/gNZ4vTfAJMt xennnTo+DRzLAUTkvsM2HhUOVeeh28I2WGcyPW3wOHEadDysk/hMxCtfmcrbMIHqyH4p RrsA== X-Gm-Message-State: APjAAAWtRxBPJipnJlAol3xpMZwotsl1BB+LS/6gcLZynZLGueQyYYeC hYG2+ecD5+oQUSBVI5OFlrxw7u+UhBtGbyEcP97/XQ== X-Google-Smtp-Source: APXvYqylWHYmKKsl/SB5psrIIWMGly0yWWwFrABLBnZX2L/Xr4GKBGIRYoXyTqkqrPtMlnd6LvY94TLkEXHEl4uwVx0= X-Received: by 2002:a0c:b66f:: with SMTP id q47mr22109717qvf.102.1559571047194; Mon, 03 Jun 2019 07:10:47 -0700 (PDT) MIME-Version: 1.0 References: <201906031147.x53Blc0b013004@slippy.cwsent.com> <201906031354.x53DsV3X043188@gndrsh.dnsmgr.net> In-Reply-To: <201906031354.x53DsV3X043188@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 3 Jun 2019 08:10:36 -0600 Message-ID: Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb To: "Rodney W. Grimes" Cc: Cy Schubert , Andrew Turner , Maxim Sobolev , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: E7BA281EC1 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)[]; 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, 03 Jun 2019 14:10:48 -0000 On Mon, Jun 3, 2019 at 7:54 AM Rodney W. Grimes wrote: > > In message <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz>, Andrew > Turner > > writes: > > > > > > > > > > On 3 Jun 2019, at 00:38, Maxim Sobolev wrote: > > > > > > > > Author: sobomax > > > > Date: Sun Jun 2 23:38:19 2019 > > > > New Revision: 348521 > > > > URL: https://svnweb.freebsd.org/changeset/base/348521 > > > > > > > > Log: > > > > Fix several places where tool name has been hardcoded: > > > > > > > > install -> ${INSTALL} > > > > mtree -> ${MTREE_CMD} > > > > services_mkdb -> ${SERVICES_MKDB_CMD} > > > > cap_mkdb -> ${CAP_MKDB_CMD} > > > > pwd_mkdb -> ${PWD_MKDB_CMD} > > > > kldxref -> ${KLDXREF_CMD} > > > > > > > > If you do custom FreeBSD builds you may want to override those > > > > in some cases. > > > > > > > > Sponsored by: Sippy Software, Inc. > > > > > > This breaks installworld in a local Jenkins instance. I???m building > with -DD > > > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset. > > > > > > Andrew > > > > > > -------------------------------------------------------------- > > > >>> Making hierarchy > > > -------------------------------------------------------------- > > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f > Makefile.inc1 > > > LOCAL_MTREE= hierarchy > > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; > PATH=/jenkins/work > ... > > > > It also breaks poudirere builds at make distrib-dirs, amd64 and i386, > i386 > > distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs > target > > is the failing one. > > Something is pretty broke here then, as INSTALL has been defined for > ever in sys.mk: > sys.mk:INSTALL ?= install > The problem is that MTREE isn't defined, which makes MTREE_CMD start with -N. Warner From owner-svn-src-head@freebsd.org Mon Jun 3 14:13:26 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 3B10215B2329 for ; Mon, 3 Jun 2019 14:13:26 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (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 A4D798243F for ; Mon, 3 Jun 2019 14:13:25 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it1-f173.google.com with SMTP id i21so7934044ita.5 for ; Mon, 03 Jun 2019 07:13:25 -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=e5k99/l5+bjQDBJMv9ieqMVq0QWuCWBWCyFThhq9HUI=; b=Mcl5Fh+cNq5ONn3XtGTEEB0D0vtCS7ol34oHwZ+KA5NaeLgCFmHgmlRSMQTGye4oRp Gmdg/S0fbv0DaNG5b4Psh0LCHWKMsLaF9ofOxc3bSXl31QI6FVkEtOerg+1bCxBB75HF rtb1cIWKrVkW03Z4HYRyRF1HaPqmTV1vbu6QWOtow9CSQzySz6rWnDu9tUDAx90s9qIS WieHhf/uhGEGUK+kDnH5ZWTgvnyOtxXZgsuhkNGCK7EuftTY7UB5Ge8CBIOxWxSaEwiV qZgWazj5iQPmqG1G93FAj33sjSRKmp5LDIww8PO8vdcULzzvV0kuPtMBlTMywKQFsW2o b7rg== X-Gm-Message-State: APjAAAVc5eOWhOL0NUBYGIWUKmMM93UbBmKxI3nY1BlxUdpVVKFYRiVj 5QxWQytcrdyH8DMhMzml2Rb5vgnPH2ym62pPCrozPw4PJIc= X-Google-Smtp-Source: APXvYqzzNb6xj5lL4wwFEhPJVSonRnF3CpdMworIf5eiql5UGSGr5wxhXNUeqeHZJXwOG6nNE4znDLa/2MdQ3Dav1d4= X-Received: by 2002:a02:950a:: with SMTP id y10mr18088106jah.26.1559571198821; Mon, 03 Jun 2019 07:13:18 -0700 (PDT) MIME-Version: 1.0 References: <201906031147.x53Blc0b013004@slippy.cwsent.com> <201906031354.x53DsV3X043188@gndrsh.dnsmgr.net> In-Reply-To: From: Maxim Sobolev Date: Mon, 3 Jun 2019 07:13:07 -0700 Message-ID: Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb To: Warner Losh Cc: "Rodney W. Grimes" , Cy Schubert , Andrew Turner , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: A4D798243F 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)[] 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, 03 Jun 2019 14:13:26 -0000 Looking into it, sorry for breakage. Somehow it worked here. :( I'll backout if I cannot figure it out in a 30 minutes or so. Sorry about that. -Max On Mon, Jun 3, 2019 at 7:10 AM Warner Losh wrote: > > > On Mon, Jun 3, 2019 at 7:54 AM Rodney W. Grimes > wrote: > >> > In message <7BD6B7AD-5950-4015-B95D-9FFB609F51E9@fubar.geek.nz>, >> Andrew Turner >> > writes: >> > > >> > > >> > > > On 3 Jun 2019, at 00:38, Maxim Sobolev wrote: >> > > > >> > > > Author: sobomax >> > > > Date: Sun Jun 2 23:38:19 2019 >> > > > New Revision: 348521 >> > > > URL: https://svnweb.freebsd.org/changeset/base/348521 >> > > > >> > > > Log: >> > > > Fix several places where tool name has been hardcoded: >> > > > >> > > > install -> ${INSTALL} >> > > > mtree -> ${MTREE_CMD} >> > > > services_mkdb -> ${SERVICES_MKDB_CMD} >> > > > cap_mkdb -> ${CAP_MKDB_CMD} >> > > > pwd_mkdb -> ${PWD_MKDB_CMD} >> > > > kldxref -> ${KLDXREF_CMD} >> > > > >> > > > If you do custom FreeBSD builds you may want to override those >> > > > in some cases. >> > > > >> > > > Sponsored by: Sippy Software, Inc. >> > > >> > > This breaks installworld in a local Jenkins instance. I???m building >> with -DD >> > > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset. >> > > >> > > Andrew >> > > >> > > -------------------------------------------------------------- >> > > >>> Making hierarchy >> > > -------------------------------------------------------------- >> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f >> Makefile.inc1 >> > > LOCAL_MTREE= hierarchy >> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; >> PATH=/jenkins/work >> ... >> > >> > It also breaks poudirere builds at make distrib-dirs, amd64 and i386, >> i386 >> > distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs >> target >> > is the failing one. >> >> Something is pretty broke here then, as INSTALL has been defined for >> ever in sys.mk: >> sys.mk:INSTALL ?= install >> > > The problem is that MTREE isn't defined, which makes MTREE_CMD start with > -N. > > Warner > From owner-svn-src-head@freebsd.org Mon Jun 3 14:14: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 70A5815B23E0; Mon, 3 Jun 2019 14:14: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 11551825AE; Mon, 3 Jun 2019 14:14: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 ECCE674C2; Mon, 3 Jun 2019 14:14:53 +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 x53EEr8Q034904; Mon, 3 Jun 2019 14:14:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53EErT4034903; Mon, 3 Jun 2019 14:14:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906031414.x53EErT4034903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Jun 2019 14:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348530 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11551825AE 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,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, 03 Jun 2019 14:14:54 -0000 Author: imp Date: Mon Jun 3 14:14:53 2019 New Revision: 348530 URL: https://svnweb.freebsd.org/changeset/base/348530 Log: Stopgap fix to breakage from r348521. MTREE is defined, while MTREE_CMD isn't, use it instead. This may not be 'right' but it fixes the CI and other issues. Submitted by: Andreas Nilsson Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jun 3 10:04:34 2019 (r348529) +++ head/Makefile.inc1 Mon Jun 3 14:14:53 2019 (r348530) @@ -888,7 +888,7 @@ INSTALLFLAGS+= -h sha256 .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" -IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" +IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}" .endif DESTDIR_MTREEFLAGS= -deU From owner-svn-src-head@freebsd.org Mon Jun 3 14:17: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 242BB15B24E6; Mon, 3 Jun 2019 14:17:14 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44DB827F4; Mon, 3 Jun 2019 14:17:13 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45HcZG505Dz3c7W; Mon, 3 Jun 2019 14:17:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id BmCTDeXf072P; Mon, 3 Jun 2019 14:17:10 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-177-23.mobileonline.telia.com [90.236.177.23]) by mail.daemonic.se (Postfix) with ESMTPSA id 45HcZF5WB5z3c7V; Mon, 3 Jun 2019 14:17:09 +0000 (UTC) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Andriy Gapon , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> From: Niclas Zeising Message-ID: <72b2ce5e-4c4f-8857-b79b-0b2a412f23fe@freebsd.org> Date: Mon, 3 Jun 2019 16:17:09 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: B44DB827F4 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]; 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, 03 Jun 2019 14:17:14 -0000 On 2019-06-03 14:08, Andriy Gapon wrote: > On 03/06/2019 14:16, Niclas Zeising wrote: >> Hi! >> It seems like things broke after all, latest pkg build (on head-amd64)= reports >> this: >> >> >> /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/sr= c/dev/drm2/i915/intel_iic.c:570:2: >> error: implicit declaration of function 'iicbus_set_nostop' is invalid= in C99 >> [-Werror,-Wimplicit-function-declaration] >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 iicbus_set_nostop(idev, tr= ue); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/sr= c/dev/drm2/i915/intel_iic.c:570:2: >> error: this function declaration is not a prototype [-Werror,-Wstrict-= prototypes] >> 2 errors generated. >> >> Full log: >> >> http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376= /logs/drm-legacy-kmod-g20190523.log >=20 > Hi! Thank you for the report. > I am going to restore iicbus_set_nostop, but this time as a function th= at > modifies iicbus softc (instead of an ivar accessor for the bus). > I am including a patch that I would like to commit. >=20 > However, for the drm code to request the nostop mode correctly it needs= to be > fixed as well. > My proposed patch is here: https://github.com/FreeBSDDesktop/drm-legacy= /pull/9 >=20 Thank you, I will try it out. Will this break drm-legacy-kmod on 12, which doesn't have the iic bus=20 change you proposed? Regards --=20 Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 3 14:20: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 6EB3515B276C; Mon, 3 Jun 2019 14:20:51 +0000 (UTC) (envelope-from danfe@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 1499782C98; Mon, 3 Jun 2019 14:20:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id DF130195F8; Mon, 3 Jun 2019 14:20:50 +0000 (UTC) Date: Mon, 3 Jun 2019 14:20:50 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: Peter Wemm , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296467 - head/sys/kern Message-ID: <20190603142050.GA34128@FreeBSD.org> References: <201603071844.u27Ii7Ip026875@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603071844.u27Ii7Ip026875@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 1499782C98 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.88 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.89)[-0.886,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, 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, 03 Jun 2019 14:20:51 -0000 On Mon, Mar 07, 2016 at 06:44:07PM +0000, Konstantin Belousov wrote: > New Revision: 296467 > URL: https://svnweb.freebsd.org/changeset/base/296467 > > Log: > Convert all panics from the link_elf_obj kernel linker for object > files format into printfs and errors to caller. Some leaks of > resources are there, but the same leaks are present in other error > pathes. With the change, the kernel at least boots even when module > with unexpected or corrupted ELF structure is preloaded. > > Modified: head/sys/kern/link_elf_obj.c > ... > @@ -634,8 +645,11 @@ link_elf_load_file(linker_class_t cls, c > ef->relatab = malloc(ef->nrelatab * sizeof(*ef->relatab), > M_LINKER, M_WAITOK | M_ZERO); > > - if (symtabindex == -1) > - panic("lost symbol table index"); > + if (symtabindex == -1) { > + link_elf_error(filename, "lost symbol table index"); > + error = ENOEXEC; > + goto out; > + } > /* Allocate space for and load the symbol table */ > ef->ddbsymcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym); > ef->ddbsymtab = malloc(shdr[symtabindex].sh_size, M_LINKER, M_WAITOK); > @@ -650,8 +664,11 @@ link_elf_load_file(linker_class_t cls, c > goto out; > } > > - if (symstrindex == -1) > - panic("lost symbol string index"); > + if (symstrindex == -1) { > + link_elf_error(filename, "lost symbol string index"); > + error = ENOEXEC; > + goto out; > + } PVS Studio reports: /usr/src/sys/kern/link_elf_obj.c:717:1: warning: V547 Expression 'symstrindex == - 1' is always false. Original panic()s were added by peter@ in r129362 (CC'ed). Could one of you guys take a look? Thanks, ./danfe From owner-svn-src-head@freebsd.org Mon Jun 3 14:28: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 DD7C815B2AA3; Mon, 3 Jun 2019 14:28:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (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 5981C83026; Mon, 3 Jun 2019 14:28:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42d.google.com with SMTP id u17so10723288pfn.7; Mon, 03 Jun 2019 07:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UhkldZ3cBQqWEajdOftToOW1UnFewLPEE7V8hS1koE4=; b=UW86+YZ78mx8SasjxferzwMxr0KK0xf7n61gKaVUlMEF17SQkm68luIKXLUvQ+qdk8 rIZYQ49YvMM61T9akXL3emojeiqsqt7DxYBLCpqpldJRbvhQ/+gU5PedGQ/VgB7+Wi5f P7WU0F7oulQDRLseuLt7hly7qbzMt1ooPOOlh/GsG/yk9gKfpCJHY+OiiN5aTfHJekbi 2uZejkd9Hi/F6aJGd7s9c8WoRe6NV8DElbR87so8hiIMSoJkevPnlvz3lAj3lwGX5kGK 8JQOqr3A6L8zzBdYA54S1ONRq7abAaYbbPeEQZeMg8uCblcwErt6tMqewrpwbVWnlAh/ tK5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UhkldZ3cBQqWEajdOftToOW1UnFewLPEE7V8hS1koE4=; b=JXayemositk1tj6qLSBBBrqUWVcosL95gKOQL/pB6QRJD6IRD5jIJLuZcgTvao7/s9 +butOyREAv0MMI5iKNCScMu/yfaV55wmCeVC0VTBdYgNI4o7qABtvs6gVQ51MW5N1ugg 2ZIOrlaucCQzdWxNNduAp7e0mYnwea5DoYU5mA8IMWxDeegO0ikRQW67fw+4N37rMS2D MnAMcojCHy2B0oGodduqwotgbRqLOYg9/Ltx48RxElEhODd88yGYTfXvS3MdmUDxg09c SHZ9tr2BSuC4WkUl5uyaz3VtkCJodb0dBeJmzmqmSHFwHz8AH1J6GnkvqTNDO8ISxQoY 0iHg== X-Gm-Message-State: APjAAAV9jcmPxsG58RlKyrokcT+O6Qt/ROx79OJCvFjrSJU1Rl+JDawO oTv9ryvO8VHPsjyuZSK4+KVtEUj9qR4= X-Google-Smtp-Source: APXvYqz8wCA0HwK9zqcv4rUPBgD92UBt4ffUJNaAwvLbjKBR+BkQpVfSr9ez0CtjcoXcTG3zyqIVKw== X-Received: by 2002:aa7:9a92:: with SMTP id w18mr2304467pfi.167.1559572127897; Mon, 03 Jun 2019 07:28:47 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id ce3sm3945550pjb.11.2019.06.03.07.28.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 07:28:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb From: Enji Cooper X-Mailer: iPhone Mail (16F156) In-Reply-To: <201906022338.x52NcJV9070782@repo.freebsd.org> Date: Mon, 3 Jun 2019 07:28:46 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <99965642-23AF-492C-9D3E-19AE069AB323@gmail.com> References: <201906022338.x52NcJV9070782@repo.freebsd.org> To: Maxim Sobolev X-Rspamd-Queue-Id: 5981C83026 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.965,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, 03 Jun 2019 14:28:50 -0000 Hi Maxim, > On Jun 2, 2019, at 16:38, Maxim Sobolev wrote: >=20 > Author: sobomax > Date: Sun Jun 2 23:38:19 2019 > New Revision: 348521 > URL: https://svnweb.freebsd.org/changeset/base/348521 >=20 > Log: > Fix several places where tool name has been hardcoded: >=20 > install -> ${INSTALL} > mtree -> ${MTREE_CMD} > services_mkdb -> ${SERVICES_MKDB_CMD} > cap_mkdb -> ${CAP_MKDB_CMD} > pwd_mkdb -> ${PWD_MKDB_CMD} > kldxref -> ${KLDXREF_CMD} >=20 > If you do custom FreeBSD builds you may want to override those > in some cases. >=20 > Sponsored by: Sippy Software, Inc. Please get review from Bryan, Simon, or Warner next time, per MAINTAINER= S, to avoid breakage in the future. There are some sand traps in our build i= nfrastructure. ... > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/Makefile.inc1 Sun Jun 2 22:27:26 2019 (r348520) > +++ head/Makefile.inc1 Sun Jun 2 23:38:19 2019 (r348521) > @@ -887,8 +887,8 @@ MTREEFLAGS+=3D -W > INSTALLFLAGS+=3D -h sha256 > .endif > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > -IMAKE_INSTALL=3D INSTALL=3D"install ${INSTALLFLAGS}" > -IMAKE_MTREE=3D MTREE_CMD=3D"mtree ${MTREEFLAGS}" > +IMAKE_INSTALL=3D INSTALL=3D"${INSTALL} ${INSTALLFLAGS}" > +IMAKE_MTREE=3D MTREE_CMD=3D"${MTREE_CMD} ${MTREEFLAGS}" > .endif Please back out this part of the change as it is unnecessary and adds a d= ependency on sys.mk=E2=80=99s definitions. $PATH should contain, i.e., be po= pulated, with these tools when running make installworld. This is part of th= e logic behind how $ITOOLS, etc, works. Thank you very much for your work and the rest of the change though! -Enji= From owner-svn-src-head@freebsd.org Mon Jun 3 14:39: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 F082915B2D12; Mon, 3 Jun 2019 14:39:11 +0000 (UTC) (envelope-from danfe@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 830A083539; Mon, 3 Jun 2019 14:39:11 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 598EA19A36; Mon, 3 Jun 2019 14:39:11 +0000 (UTC) Date: Mon, 3 Jun 2019 14:39:11 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r248514 - head/sys/vm Message-ID: <20190603143911.GA49021@FreeBSD.org> References: <201303191439.r2JEdRJB020366@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303191439.r2JEdRJB020366@svn.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 830A083539 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 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.89)[-0.888,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, 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, 03 Jun 2019 14:39:12 -0000 On Tue, Mar 19, 2013 at 02:39:27PM +0000, Konstantin Belousov wrote: > New Revision: 248514 > URL: http://svnweb.freebsd.org/changeset/base/248514 > > Log: > Do not map the swap i/o pbufs if the geom provider for the swap > partition accepts unmapped requests. > > Modified: head/sys/vm/swap_pager.c > ... > @@ -2180,6 +2190,7 @@ swaponsomething(struct vnode *vp, void * > sp->sw_flags = 0; > sp->sw_nblks = nblks; > sp->sw_used = 0; > sp->sw_strategy = strategy; > sp->sw_close = close; > + sp->sw_flags = flags; PVS Studio complains here: /usr/src/sys/vm/swap_pager.c:2238:1: warning: V519 The 'sp->sw_flags' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2233, 2238. Looks like "sp->sw_flags = 0" should've been removed, can you confirm? ./danfe From owner-svn-src-head@freebsd.org Mon Jun 3 14:52:58 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 EE36515B3926 for ; Mon, 3 Jun 2019 14:52:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBA48434A for ; Mon, 3 Jun 2019 14:52:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559573566; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=D3Jb2TwUPRUt+gf+LhuLdom8U7PRP099wmK3T7nRlAg9Jao7kjNJBcNoFZR1noQ95ZJz9uLcp0XM0 H/tOaANnNaNmYAUqmOCQY0m7RkXDHtLNU+ASly+FEgNT3YQ+DiuwdCPuAdyDneVsdS8lvAAcC4plmI lqjjKXSpFM+FsOZkit3/L7j3WPuF5D9L4NdarOtfLOgbLo/L/nJQZSpOqdpVEi0YERzdjnkgUhfPUu Bz7JQY6kpv0qJou3tm5a3Nhdip1Msd0vcTbqMNU/mjir7cYOT9E7muFM2Z4X2SvQqkocvVFSNdWaZp A5ZTlN2lGjXo0Hmuu/z4fdO+Nst1pLA== 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=qyenNvNTH52a0KXewTd7CkhxTQemCgKs7MHhWX6XmDA=; b=c4OJugBmfNnocCNvgk0Y5xAHl2d4ZfXzyUs6XXQ1tfHsleAjdbRJhmMn5II8msDuw5blh5XSj/lJJ URDDSfrACpDwwlSHXrW1roQ/Dga8CaUyCSQj0Blnn4Bu5a9yn3fMYXNd/mCXoJjB6EgrNhHYDWVk6M Lp92OpkHvCnourYvdzWBnZBADSj2chnNASCmIQBJiPauL3tnwq5c+A4vtk9kB5LVG0HH2ZXDBMDuvb dvJbxy3YWaq24DtzF2jyEc+234WkgDt/niAhdeD6dq5hACnCTHQZ0huM7kB2R2G9YJ5IOz3qQeN1T8 I9+9XTERZrAjpwHYTcNOdnbmblWlLyw== ARC-Authentication-Results: i=1; outbound3.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:cc:to:from:subject:message-id:from; bh=qyenNvNTH52a0KXewTd7CkhxTQemCgKs7MHhWX6XmDA=; b=EMPz3a2/iyJinV2nLkL/gTJ/lU6lbiaVkNlhmVgUlgobNzbEP2wapRy3vUcGQoloiHHNcbbNvvcwh //sBEw8ZED1cOVwqikzC4YAUNfrzG0RFlUtuHIRi94CLp7mnGT4EKzeT3r83IycTIqL+PHDiBtQdpc 5TW200qKhY88s6F0NbhZI7sgtKvVWGLMFhIIiaPTL+97SsC9ft6OHoF1WwOS/bUMi65h2yYZ3vKgQV 92GqACaoiWXTGoAX2sp43QllYauXn+aFw6Mt5hMZGB23oDQCIxqzqeFjfl9OFJMuxJiGJZGbTSPN2f D7RpocfgOjTYZT4QO/cCK2Kr1QkNpIg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 3d1aa7f2-860f-11e9-91aa-b56e4e6b5865 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 outbound3.eu.mailhop.org (Halon) with ESMTPSA id 3d1aa7f2-860f-11e9-91aa-b56e4e6b5865; Mon, 03 Jun 2019 14:52:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x53EqfIv055818; Mon, 3 Jun 2019 08:52:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <75cec0b83709f48bbd52e2444d7af17569093f60.camel@freebsd.org> Subject: Re: svn commit: r348355 - head/sys/dev/iicbus From: Ian Lepore To: Andriy Gapon , Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org Date: Mon, 03 Jun 2019 08:52:41 -0600 In-Reply-To: References: <201905290908.x4T98L89066643@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: 4DBA48434A 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.987,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, 03 Jun 2019 14:52:58 -0000 On Mon, 2019-06-03 at 15:08 +0300, Andriy Gapon wrote: > On 03/06/2019 14:16, Niclas Zeising wrote: > > Hi! > > It seems like things broke after all, latest pkg build (on head- > > amd64) reports > > this: > > > > > > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy- > > 12bd551/src/dev/drm2/i915/intel_iic.c:570:2: > > error: implicit declaration of function 'iicbus_set_nostop' is > > invalid in C99 > > [-Werror,-Wimplicit-function-declaration] > > iicbus_set_nostop(idev, true); > > ^ > > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy- > > 12bd551/src/dev/drm2/i915/intel_iic.c:570:2: > > error: this function declaration is not a prototype [-Werror,- > > Wstrict-prototypes] > > 2 errors generated. > > > > Full log: > > > > http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log > > Hi! Thank you for the report. > I am going to restore iicbus_set_nostop, but this time as a function > that > modifies iicbus softc (instead of an ivar accessor for the bus). > I am including a patch that I would like to commit. > > However, for the drm code to request the nostop mode correctly it > needs to be > fixed as well. > My proposed patch is here: > https://github.com/FreeBSDDesktop/drm-legacy/pull/9 > > Index: sys/dev/iicbus/iicbus.h > =================================================================== > --- sys/dev/iicbus/iicbus.h (revision 348529) > +++ sys/dev/iicbus/iicbus.h (working copy) > @@ -46,6 +46,8 @@ struct iicbus_softc > * 0 if no start condition succeeded */ > u_char strict; /* deny operations that violate the > * I2C protocol */ > + bool nostop; /* iicbus_transfer defaults to > repeated > + * start between messages */ > struct mtx lock; > u_int bus_freq; /* Configured bus Hz. */ > }; > @@ -77,6 +79,7 @@ IICBUS_ACCESSOR(addr, ADDR, > uint32_t) > > int iicbus_generic_intr(device_t dev, int event, char *buf); > void iicbus_init_frequency(device_t dev, u_int bus_freq); > +void iicbus_set_nostop(device_t dev, bool val); > > extern driver_t iicbus_driver; > extern devclass_t iicbus_devclass; > Index: sys/dev/iicbus/iiconf.c > =================================================================== > --- sys/dev/iicbus/iiconf.c (revision 348529) > +++ sys/dev/iicbus/iiconf.c (working copy) > @@ -383,6 +383,14 @@ iicbus_block_read(device_t bus, u_char slave, > char > return (error); > } > > +void > +iicbus_set_nostop(device_t bus, bool val) > +{ > + struct iicbus_softc *sc = device_get_softc(bus); > + > + sc->nostop = val; > +} > + > /* > * iicbus_transfer() > * > @@ -427,7 +435,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg > * > { > int i, error, lenread, lenwrote, nkid, rpstart, addr; > device_t *children, bus; > - bool started; > + struct iicbus_softc *sc; > + bool nostop, started; > > if ((error = device_get_children(dev, &children, &nkid)) != 0) > return (IIC_ERESOURCE); > @@ -438,6 +447,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg > * > bus = children[0]; > rpstart = 0; > free(children, M_TEMP); > + sc = device_get_softc(bus); > + nostop = sc->nostop; > started = false; > for (i = 0, error = 0; i < nmsgs && error == 0; i++) { > addr = msgs[i].slave; > @@ -465,11 +476,12 @@ iicbus_transfer_gen(device_t dev, struct > iic_msg * > if (error != 0) > break; > > - if (!(msgs[i].flags & IIC_M_NOSTOP)) { > + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || > + (nostop && i + 1 < nmsgs)) { > + rpstart = 1; /* Next message gets repeated > start */ > + } else { > rpstart = 0; > iicbus_stop(bus); > - } else { > - rpstart = 1; /* Next message gets repeated > start */ > } > } > if (error != 0 && started) > > Please don't. We still have a situation where nobody has shown a runtime failure at all. This build failure could be fixed by simply defining a do-nothing iicbus_set_nostop() function if a quick fix is needed. Putting this nostop concept into code that is shared by many drivers is an abomination. We have exactly one driver that needs this functionality, so the right fix is to implement it wholly within that one driver. I'll put together a diff for that. -- Ian From owner-svn-src-head@freebsd.org Mon Jun 3 15:11: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 DD14915B4133; Mon, 3 Jun 2019 15:11:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 3C32384FE5; Mon, 3 Jun 2019 15:11:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id p67so100404ljp.11; Mon, 03 Jun 2019 08:11:08 -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:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=b/kKzYvkNZYCTGD74Jn8XZeJC08HwxfY/Qa+ByZzXDA=; b=C6e88K7uF5BWUlj7JF9aRawNZOWsuBJUpsOWWj4to0PrydLYNUrf+8LuZF1W8JgeJm DA6rRJ8YyFcCs/ukcvBW58aGv70WdwDfuOaBKr9qamw+VkVv1cN3VcCgcuvdZgrc56qB EzepstpoUyUGgGPFkezovURxaBZBTS4ufbCEagk/gexwGEHPDMjVwNHW/GpKAqYRFQvx 2cv2BwWR1kkNfus9OvXK1YeLmGbgY7XVBANDP1p19quu/rWXi4LC91e6JPExwVEr823M wfTP2y3SzTt30dlWZ/Q5VDZxV+GRrRVtJQJ547fWG+23zTk+VmUIgujJjJ9ooFpWYmrM l4GQ== X-Gm-Message-State: APjAAAXFBctMIzRCu1fxWrnEEcJCz0zAR/maxZc6YRsnrTIZKmS3VEHT aG08U3qUe54tN3FgLNl6wiJEsfNI X-Google-Smtp-Source: APXvYqxf1dE1VZSZFgt+jOPzyDLkGDRhpA8DDIqy6EXtNky0S+dACCgpm51W5GaFDA0S0okHOQCG6w== X-Received: by 2002:a2e:9e85:: with SMTP id f5mr8297365ljk.104.1559574660178; Mon, 03 Jun 2019 08:11:00 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id n24sm283344ljc.25.2019.06.03.08.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 08:10:59 -0700 (PDT) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Niclas Zeising , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> <72b2ce5e-4c4f-8857-b79b-0b2a412f23fe@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, 3 Jun 2019 18:10:57 +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: <72b2ce5e-4c4f-8857-b79b-0b2a412f23fe@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C32384FE5 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.969,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, 03 Jun 2019 15:11:09 -0000 On 03/06/2019 17:17, Niclas Zeising wrote: > On 2019-06-03 14:08, Andriy Gapon wrote: >> Hi!  Thank you for the report. >> I am going to restore iicbus_set_nostop, but this time as a function that >> modifies iicbus softc (instead of an ivar accessor for the bus). >> I am including a patch that I would like to commit. >> >> However, for the drm code to request the nostop mode correctly it needs to be >> fixed as well. >> My proposed patch is here: https://github.com/FreeBSDDesktop/drm-legacy/pull/9 >> > > > Thank you, I will try it out. > Will this break drm-legacy-kmod on 12, which doesn't have the iic bus change you > proposed? No, it should not change anything for 12 / 11. But see Ian's reaction. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 3 15:12: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 1F0B815B42B4; Mon, 3 Jun 2019 15:12:46 +0000 (UTC) (envelope-from sobomax@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 ADC508543C; Mon, 3 Jun 2019 15:12:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 86C907EB5; Mon, 3 Jun 2019 15:12:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FCjOO066559; Mon, 3 Jun 2019 15:12:45 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FCjHh066558; Mon, 3 Jun 2019 15:12:45 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201906031512.x53FCjHh066558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 3 Jun 2019 15:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348532 - in head: . etc X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: . etc X-SVN-Commit-Revision: 348532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADC508543C 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 03 Jun 2019 15:12:46 -0000 Author: sobomax Date: Mon Jun 3 15:12:44 2019 New Revision: 348532 URL: https://svnweb.freebsd.org/changeset/base/348532 Log: Leave mtree hardcoded for now. Reverting partially 348521 and also the followup stopgap change, because I don't think it's a correct. I still need to figure out where to stick it in. In cannot be in Makefile.inc1 and it cannot be in etc/Makefile from the looks of it to avoid chicken-and-egg problem. Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jun 3 15:10:37 2019 (r348531) +++ head/Makefile.inc1 Mon Jun 3 15:12:44 2019 (r348532) @@ -888,7 +888,7 @@ INSTALLFLAGS+= -h sha256 .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" -IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}" +IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" .endif DESTDIR_MTREEFLAGS= -deU Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jun 3 15:10:37 2019 (r348531) +++ head/etc/Makefile Mon Jun 3 15:12:44 2019 (r348532) @@ -93,8 +93,6 @@ distribution: .endif .endif -MTREE_CMD?= mtree - MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ From owner-svn-src-head@freebsd.org Mon Jun 3 15:19: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 D5C5A15B4496; Mon, 3 Jun 2019 15:19:12 +0000 (UTC) (envelope-from kib@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 784D68578B; Mon, 3 Jun 2019 15:19:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 443227EB9; Mon, 3 Jun 2019 15:19:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FJC6X066983; Mon, 3 Jun 2019 15:19:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FJCBr066982; Mon, 3 Jun 2019 15:19:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031519.x53FJCBr066982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Jun 2019 15:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348533 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 784D68578B 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 03 Jun 2019 15:19:13 -0000 Author: kib Date: Mon Jun 3 15:19:11 2019 New Revision: 348533 URL: https://svnweb.freebsd.org/changeset/base/348533 Log: Remove dead store. sw_flags is set to the function argument several lines later. Reported by: danfe using PVS-studio Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Jun 3 15:12:44 2019 (r348532) +++ head/sys/vm/swap_pager.c Mon Jun 3 15:19:11 2019 (r348533) @@ -2230,7 +2230,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sp->sw_vp = vp; sp->sw_id = id; sp->sw_dev = dev; - sp->sw_flags = 0; sp->sw_nblks = nblks; sp->sw_used = 0; sp->sw_strategy = strategy; From owner-svn-src-head@freebsd.org Mon Jun 3 15:19: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 B5CD215B44E4; Mon, 3 Jun 2019 15:19:34 +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 EB3B285931; Mon, 3 Jun 2019 15:19:33 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id s21so5963434lji.8; Mon, 03 Jun 2019 08:19:33 -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:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KCa+rBSR8F8XlWVwps+1W1EKkmJqZEIAazZk6Cbn9Vo=; b=SjX/0JUkchfVNdW78utKn+TZUwxkANKKgNz2af+M7Nj14amIm53GjsFtM/YY1FbQ+j V7K0845gougWO1QwOVRyScSOxENt7l5PsSwafif7DOaQ0HmmC5Sr0EsBmiCn0l/JUKfD uNJBVkywjpWxqWyWwmdXKwspq3IsWm9DqW9GvagD1CeH3BUhB+FU7O3lEmxKHDVqgE8J FJy3N34cnQ3OG/Mu7VN1fepHyvwVqQNX1Jp11fAbC2915q+KAaOvqlTwVl0/FVld3GKy Sn3rZNV8RCU9LV1EkdxjTh1ViZc3iY127XghcW+/N9c+EHRhAaqWt+6ZXqpVp7NeaNL7 TRTQ== X-Gm-Message-State: APjAAAW8Bnog7JW8CBLQBrwglbMK2eOyRxXkRnoEPTIiW8CAaTAGTBNv 1Jw2JkhBPkn7uu2qGxzmoyBWXL+P X-Google-Smtp-Source: APXvYqxA0apWQWXyhlEcmnHPafsvrBN6ub2CI+rXNr/rJQIv0+EnHiOY+ZbHFREJPrTGxJSRPldQXw== X-Received: by 2002:a2e:9b92:: with SMTP id z18mr14537083lji.190.1559575164456; Mon, 03 Jun 2019 08:19:24 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id v2sm2005318ljb.65.2019.06.03.08.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 08:19:23 -0700 (PDT) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Ian Lepore , Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> <75cec0b83709f48bbd52e2444d7af17569093f60.camel@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, 3 Jun 2019 18:19:21 +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: <75cec0b83709f48bbd52e2444d7af17569093f60.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EB3B285931 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.968,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, 03 Jun 2019 15:19:35 -0000 On 03/06/2019 17:52, Ian Lepore wrote: > Please don't. We still have a situation where nobody has shown a > runtime failure at all. This build failure could be fixed by simply > defining a do-nothing iicbus_set_nostop() function if a quick fix is > needed. Well, I am quite certain that the run-time failure will follow after the build time failure is fixed. > Putting this nostop concept into code that is shared by many drivers is > an abomination. We have exactly one driver that needs this > functionality, so the right fix is to implement it wholly within that > one driver. I'll put together a diff for that. That's true that we have just one such driver. At the same time, the "no stop" (or rather, repeated start) behavior makes more sense. If stop+start between transfers are needed then that can be done with multiple calls to iicbus_transfer. If multiple messages are given to iicbus_transfer, then it's reasonable to assume that a repeated started is wanted between them. But it would be a big change to review and, if needed, fix or tidy up all code that uses iicbus_transfer. So, iicbus_set_nostop() could be just a small step towards the bigger goal. But I really don't have a strong opinion. Fixing drm2 directly is just as good for me as iicbus_set_nostop. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 3 15:23: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 1AE9315B47FD; Mon, 3 Jun 2019 15:23:38 +0000 (UTC) (envelope-from kib@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 AFC8385F57; Mon, 3 Jun 2019 15:23:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BBBC8071; Mon, 3 Jun 2019 15:23:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FNbTY072069; Mon, 3 Jun 2019 15:23:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FNbr3072068; Mon, 3 Jun 2019 15:23:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031523.x53FNbr3072068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Jun 2019 15:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348536 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFC8385F57 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 03 Jun 2019 15:23:38 -0000 Author: kib Date: Mon Jun 3 15:23:37 2019 New Revision: 348536 URL: https://svnweb.freebsd.org/changeset/base/348536 Log: Remove dead check. We already handled the case when symstrindex < 0 at line 680. Reported by: danfe using PVS-studio Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Mon Jun 3 15:23:21 2019 (r348535) +++ head/sys/kern/link_elf_obj.c Mon Jun 3 15:23:37 2019 (r348536) @@ -714,11 +714,6 @@ link_elf_load_file(linker_class_t cls, const char *fil goto out; } - if (symstrindex == -1) { - link_elf_error(filename, "lost symbol string index"); - error = ENOEXEC; - goto out; - } /* Allocate space for and load the symbol strings */ ef->ddbstrcnt = shdr[symstrindex].sh_size; ef->ddbstrtab = malloc(shdr[symstrindex].sh_size, M_LINKER, M_WAITOK); From owner-svn-src-head@freebsd.org Mon Jun 3 15:32: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 F130A15B4BB8; Mon, 3 Jun 2019 15:32:43 +0000 (UTC) (envelope-from kib@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 8BD72866CF; Mon, 3 Jun 2019 15:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 717388214; Mon, 3 Jun 2019 15:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FWhUa077337; Mon, 3 Jun 2019 15:32:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FWgcB077335; Mon, 3 Jun 2019 15:32:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031532.x53FWgcB077335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Jun 2019 15:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348539 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 348539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8BD72866CF 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)[-1.000,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: Mon, 03 Jun 2019 15:32:44 -0000 Author: kib Date: Mon Jun 3 15:32:42 2019 New Revision: 348539 URL: https://svnweb.freebsd.org/changeset/base/348539 Log: amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service. If service code faulted, we might end up unwinding with interrupts disabled. Top-level kernel code should have interrupts enabled, which is enforced by checks. Save %rflags before entering EFI, and restore to the known good value on return. This handles situation with disabled interrupts on fault and perhaps other potential bugs, e.g. invalid value for PSL_D. Reported and tested by: Jan Martin Mikkelsen Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/efirt_support.S head/sys/amd64/amd64/genassym.c head/sys/amd64/include/efi.h Modified: head/sys/amd64/amd64/efirt_support.S ============================================================================== --- head/sys/amd64/amd64/efirt_support.S Mon Jun 3 15:28:37 2019 (r348538) +++ head/sys/amd64/amd64/efirt_support.S Mon Jun 3 15:32:42 2019 (r348539) @@ -47,6 +47,9 @@ ENTRY(efi_rt_arch_call) movq %r13, EC_R13(%rdi) movq %r14, EC_R14(%rdi) movq %r15, EC_R15(%rdi) + pushfq + popq %rax + movq %rax, EC_RFLAGS(%rdi) movq PCPU(CURTHREAD), %rax movq %rdi, TD_MD+MD_EFIRT_TMP(%rax) movq PCPU(CURPCB), %rsi @@ -98,6 +101,8 @@ efi_rt_arch_call_tail: movq EC_RBP(%rdi), %rbp movq EC_RSP(%rdi), %rsp movq EC_RBX(%rdi), %rbx + pushq EC_RFLAGS(%rdi) + popfq popq %rbp ret Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Jun 3 15:28:37 2019 (r348538) +++ head/sys/amd64/amd64/genassym.c Mon Jun 3 15:32:42 2019 (r348539) @@ -272,3 +272,4 @@ ASSYM(EC_R12, offsetof(struct efirt_callinfo, ec_r12)) ASSYM(EC_R13, offsetof(struct efirt_callinfo, ec_r13)); ASSYM(EC_R14, offsetof(struct efirt_callinfo, ec_r14)); ASSYM(EC_R15, offsetof(struct efirt_callinfo, ec_r15)); +ASSYM(EC_RFLAGS, offsetof(struct efirt_callinfo, ec_rflags)); Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Mon Jun 3 15:28:37 2019 (r348538) +++ head/sys/amd64/include/efi.h Mon Jun 3 15:32:42 2019 (r348539) @@ -72,6 +72,7 @@ struct efirt_callinfo { register_t ec_r13; register_t ec_r14; register_t ec_r15; + register_t ec_rflags; }; #endif /* __AMD64_INCLUDE_EFI_H_ */ From owner-svn-src-head@freebsd.org Mon Jun 3 15:34: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 C2B5615B4C4C; Mon, 3 Jun 2019 15:34:01 +0000 (UTC) (envelope-from sobomax@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 5FF878684D; Mon, 3 Jun 2019 15:34:01 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4AD338219; Mon, 3 Jun 2019 15:34:01 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FY1wD077454; Mon, 3 Jun 2019 15:34:01 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FY1cW077453; Mon, 3 Jun 2019 15:34:01 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201906031534.x53FY1cW077453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 3 Jun 2019 15:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348540 - head X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FF878684D 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 03 Jun 2019 15:34:01 -0000 Author: sobomax Date: Mon Jun 3 15:34:00 2019 New Revision: 348540 URL: https://svnweb.freebsd.org/changeset/base/348540 Log: Rollback the rest of the botched r348521. Re-work would be posted to reviews. Sorry. Reported by: Enji Cooper Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jun 3 15:32:42 2019 (r348539) +++ head/Makefile.inc1 Mon Jun 3 15:34:00 2019 (r348540) @@ -887,7 +887,7 @@ MTREEFLAGS+= -W INSTALLFLAGS+= -h sha256 .endif .if defined(DB_FROM_SRC) || defined(NO_ROOT) -IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" +IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" .endif From owner-svn-src-head@freebsd.org Mon Jun 3 15:41: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 80D0E15B4DF1; Mon, 3 Jun 2019 15:41:46 +0000 (UTC) (envelope-from kib@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 2791D86CFD; Mon, 3 Jun 2019 15:41:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED7EF8281; Mon, 3 Jun 2019 15:41:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FfjkW081531; Mon, 3 Jun 2019 15:41:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Ffjl9081530; Mon, 3 Jun 2019 15:41:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031541.x53Ffjl9081530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Jun 2019 15:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348541 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 348541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2791D86CFD 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)[-1.000,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, 03 Jun 2019 15:41:46 -0000 Author: kib Date: Mon Jun 3 15:41:45 2019 New Revision: 348541 URL: https://svnweb.freebsd.org/changeset/base/348541 Log: efirt efi_enter(): Release acquired locks and restore FPU ownership if efi_arch_enter() returned an error. Submitted: Jan Martin Mikkelsen MFC after: 1 week Modified: head/sys/dev/efidev/efirt.c Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Mon Jun 3 15:34:00 2019 (r348540) +++ head/sys/dev/efidev/efirt.c Mon Jun 3 15:41:45 2019 (r348541) @@ -275,6 +275,7 @@ efi_enter(void) { struct thread *td; pmap_t curpmap; + int error; if (efi_runtime == NULL) return (ENXIO); @@ -283,7 +284,13 @@ efi_enter(void) PMAP_LOCK(curpmap); mtx_lock(&efi_lock); fpu_kern_enter(td, NULL, FPU_KERN_NOCTX); - return (efi_arch_enter()); + error = efi_arch_enter(); + if (error != 0) { + fpu_kern_leave(td, NULL); + mtx_unlock(&efi_lock); + PMAP_UNLOCK(curpmap); + } + return (error); } static void From owner-svn-src-head@freebsd.org Mon Jun 3 15:42: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 946BA15B4F58; Mon, 3 Jun 2019 15:42:00 +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 81D8186E0B; Mon, 3 Jun 2019 15:41:59 +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 68B888291; Mon, 3 Jun 2019 15:41:55 +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 x53Fft8Y081585; Mon, 3 Jun 2019 15:41:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FftO0081584; Mon, 3 Jun 2019 15:41:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906031541.x53FftO0081584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Jun 2019 15:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348542 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81D8186E0B 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)[-1.000,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, 03 Jun 2019 15:42:00 -0000 Author: jhb Date: Mon Jun 3 15:41:54 2019 New Revision: 348542 URL: https://svnweb.freebsd.org/changeset/base/348542 Log: Add 'device cxgbe' explicitly in the synopsis. ccr depends on symbols exported by the cxgbe driver as well as having a runtime dependency. While the runtime depenency was noted in the manpage already, the compile-time dependency wasn't as clear. PR: 238265 MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/share/man/man4/ccr.4 Modified: head/share/man/man4/ccr.4 ============================================================================== --- head/share/man/man4/ccr.4 Mon Jun 3 15:41:45 2019 (r348541) +++ head/share/man/man4/ccr.4 Mon Jun 3 15:41:54 2019 (r348542) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2019 +.Dd June 3, 2019 .Dt CCR 4 .Os .Sh NAME @@ -36,6 +36,7 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device ccr" +.Cd "device cxgbe" .Ed .Pp To load the driver as a From owner-svn-src-head@freebsd.org Mon Jun 3 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 9509B15B5019; Mon, 3 Jun 2019 15:43:41 +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 3B1AC8702D; Mon, 3 Jun 2019 15:43:41 +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 1668383BF; Mon, 3 Jun 2019 15:43:41 +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 x53FheZw082634; Mon, 3 Jun 2019 15:43:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FheNd082633; Mon, 3 Jun 2019 15:43:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906031543.x53FheNd082633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Jun 2019 15:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348543 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B1AC8702D 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,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, 03 Jun 2019 15:43:41 -0000 Author: jhb Date: Mon Jun 3 15:43:40 2019 New Revision: 348543 URL: https://svnweb.freebsd.org/changeset/base/348543 Log: Warn about deprecated features on all major OS versions. Reviewed by: imp MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20490 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Jun 3 15:41:54 2019 (r348542) +++ head/sys/kern/subr_bus.c Mon Jun 3 15:43:40 2019 (r348543) @@ -5948,7 +5948,7 @@ _gone_in(int major, const char *msg) gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); if (P_OSREL_MAJOR(__FreeBSD_version) >= major) printf("Obsolete code will removed soon: %s\n", msg); - else if (P_OSREL_MAJOR(__FreeBSD_version) + 1 == major) + else printf("Deprecated code (to be removed in FreeBSD %d): %s\n", major, msg); } @@ -5961,7 +5961,7 @@ _gone_in_dev(device_t dev, int major, const char *msg) if (P_OSREL_MAJOR(__FreeBSD_version) >= major) device_printf(dev, "Obsolete code will removed soon: %s\n", msg); - else if (P_OSREL_MAJOR(__FreeBSD_version) + 1 == major) + else device_printf(dev, "Deprecated code (to be removed in FreeBSD %d): %s\n", major, msg); From owner-svn-src-head@freebsd.org Mon Jun 3 16:03:57 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 3736915B5BAF for ; Mon, 3 Jun 2019 16:03:57 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 C0D578824E for ; Mon, 3 Jun 2019 16:03:56 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io1-f43.google.com with SMTP id m24so1363996ioo.2 for ; Mon, 03 Jun 2019 09:03:56 -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=kxj31LewPvbp6zwgtdAYYqM15GbbsTRrLi3fReZbnb0=; b=gkbnQtCZSDipZBvrT3UWsMvDcRISjkvB3ySfXqQJ2AK/DzXphxRId0P9C1iqPeGMT1 JHgGcwEyyyrC6OqjZd6yNKrY5ReJuWfj5v55U8h0FcheE+zWakUv8PMByymg/Ugp7cfC rB8vwn4pLKXcHi3jKUYWxMC1ND/E8JkNHTnquMQDnSmEqM8zDNDeVnBtt0kSWsOPEOQV fV2wNanHQYzBxdE8mpch47PyLTZijasC4lykEVFslNeibeDuAB354aQNnPHwSiIjFhS5 EEnQ59cZ9w745uLadwSvEYHJISNXq0mVrjQFXDrRCnr/8kmUG8ed6cdy8oGaKJDL3f5u hOuw== X-Gm-Message-State: APjAAAV3s8i8rq2H1eduWd220kCnaaqoQ3xVkCa4X0bdsrQ2TngnFDg6 /JzN2Cmg70m1B31pEYvJsn2BHh71GbCdjYYJLoF/IA== X-Google-Smtp-Source: APXvYqytdRQQWYCja+z4p/mFyf8Qkqw22TO7Laa8ZCQgXgStmIaMMmp+GP/BzapLrq0cD/WlHh/Gi995nmTxKNG0B5Q= X-Received: by 2002:a5d:9b04:: with SMTP id y4mr10830441ion.195.1559577413178; Mon, 03 Jun 2019 08:56:53 -0700 (PDT) MIME-Version: 1.0 References: <201906022338.x52NcJV9070782@repo.freebsd.org> <99965642-23AF-492C-9D3E-19AE069AB323@gmail.com> In-Reply-To: <99965642-23AF-492C-9D3E-19AE069AB323@gmail.com> From: Maxim Sobolev Date: Mon, 3 Jun 2019 08:56:41 -0700 Message-ID: Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: C0D578824E 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.972,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, 03 Jun 2019 16:03:57 -0000 On Mon, Jun 3, 2019 at 7:28 AM Enji Cooper wrote: > Hi Maxim, > > > > Modified: head/Makefile.inc1 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/Makefile.inc1 Sun Jun 2 22:27:26 2019 (r348520) > > +++ head/Makefile.inc1 Sun Jun 2 23:38:19 2019 (r348521) > > @@ -887,8 +887,8 @@ MTREEFLAGS+=3D -W > > INSTALLFLAGS+=3D -h sha256 > > .endif > > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > > -IMAKE_INSTALL=3D INSTALL=3D"install ${INSTALLFLAGS}" > > -IMAKE_MTREE=3D MTREE_CMD=3D"mtree ${MTREEFLAGS}" > > +IMAKE_INSTALL=3D INSTALL=3D"${INSTALL} ${INSTALLFLAGS}" > > +IMAKE_MTREE=3D MTREE_CMD=3D"${MTREE_CMD} ${MTREEFLAGS}" > > .endif > > Please back out this part of the change as it is unnecessary and adds > a dependency on sys.mk=E2=80=99s definitions. $PATH should contain, i.e.,= be > populated, with these tools when running make installworld. This is part = of > the logic behind how $ITOOLS, etc, works. > Thank you very much for your work and the rest of the change though! > Thanks Enji, for a clarification, will do. I still cannot understand why can't we have those tools being re-defined with top-level make environment? What I am striving at is being able to do say, make INSTALL=3D"abcd" installworld. Yes, I understand I can call "abcd" "install" (or make a symlink to it) and put it into PATH, but there are at least one issue here, namely what if I need to pass some distinct argument to abcd based on usage scenario. E.g. make INSTALL=3D"abcd foo" distributiuon. In your case I shou= ld be resorting to setting up some global environment variable and hope it won't get erased somewhere in the call chain, but that's bit "how you doing" IMHO. My approach makes certain things so much easier by cutting those un-neded steps. At any rate thank for a feedback and some background info, I will do more work on this. I was thinking more in terms of having some sort of bsd.bootools.mk where this can be defined in a centralized manner. -Max From owner-svn-src-head@freebsd.org Mon Jun 3 16:21: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 6226015B628F; Mon, 3 Jun 2019 16:21:10 +0000 (UTC) (envelope-from kib@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 0638B88AB3; Mon, 3 Jun 2019 16:21:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D6888F9; Mon, 3 Jun 2019 16:21:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53GL9Z1000934; Mon, 3 Jun 2019 16:21:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53GL9RI000917; Mon, 3 Jun 2019 16:21:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031621.x53GL9RI000917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Jun 2019 16:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348544 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 348544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0638B88AB3 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)[-1.000,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: Mon, 03 Jun 2019 16:21:10 -0000 Author: kib Date: Mon Jun 3 16:21:09 2019 New Revision: 348544 URL: https://svnweb.freebsd.org/changeset/base/348544 Log: hwpmc_intel: List all Silvermont ids. PR: 238310 Based on submission by: Masse Nicolas MFC after: 1 week Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Mon Jun 3 15:43:40 2019 (r348543) +++ head/sys/dev/hwpmc/hwpmc_intel.c Mon Jun 3 16:21:09 2019 (r348544) @@ -195,7 +195,11 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; + case 0x37: + case 0x4A: case 0x4D: /* Per Intel document 330061-001 01/2014. */ + case 0x5A: + case 0x5D: cputype = PMC_CPU_INTEL_ATOM_SILVERMONT; nclasses = 3; break; From owner-svn-src-head@freebsd.org Mon Jun 3 16:24: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 9477515B634C; Mon, 3 Jun 2019 16:24:43 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C27188D4D; Mon, 3 Jun 2019 16:24:43 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45HgPN59Kqz3c7W; Mon, 3 Jun 2019 16:24:40 +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 1NdwpaS5r9xW; Mon, 3 Jun 2019 16:24:40 +0000 (UTC) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:2::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 45HgPM6Xdpz3c7V; Mon, 3 Jun 2019 16:24:39 +0000 (UTC) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Andriy Gapon , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> <75cec0b83709f48bbd52e2444d7af17569093f60.camel@freebsd.org> From: Niclas Zeising Message-ID: <10eb223b-5c18-99a0-4eb5-97acd9f91807@freebsd.org> Date: Mon, 3 Jun 2019 18:24:31 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2C27188D4D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,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, 03 Jun 2019 16:24:43 -0000 On 2019-06-03 17:19, Andriy Gapon wrote: > On 03/06/2019 17:52, Ian Lepore wrote: >> Please don't. We still have a situation where nobody has shown a >> runtime failure at all. This build failure could be fixed by simply >> defining a do-nothing iicbus_set_nostop() function if a quick fix is >> needed. > > Well, I am quite certain that the run-time failure will follow after the build > time failure is fixed. > >> Putting this nostop concept into code that is shared by many drivers is >> an abomination. We have exactly one driver that needs this >> functionality, so the right fix is to implement it wholly within that >> one driver. I'll put together a diff for that. > > That's true that we have just one such driver. > At the same time, the "no stop" (or rather, repeated start) behavior makes more > sense. If stop+start between transfers are needed then that can be done with > multiple calls to iicbus_transfer. If multiple messages are given to > iicbus_transfer, then it's reasonable to assume that a repeated started is > wanted between them. But it would be a big change to review and, if needed, fix > or tidy up all code that uses iicbus_transfer. So, iicbus_set_nostop() could be > just a small step towards the bigger goal. > > But I really don't have a strong opinion. > Fixing drm2 directly is just as good for me as iicbus_set_nostop. > Hi! From my perspective, either solution is fine, as long as the drm-legacy drivers keep on working, and I get some help fixing the issue. Is there any way we can revert this change while we're discussing the best solution to this? Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 3 16:31: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 23AC415B64C7 for ; Mon, 3 Jun 2019 16:31:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 834C289189 for ; Mon, 3 Jun 2019 16:31:07 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559579463; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=WiGEqaox9x8lZQfcIQmG+Ve7QVE5SEJ4nBmwgEEIXuWpqWHiQcKtWDPsFpzye/3W2Td8F0Uk6AS6k VZZIVkXPRpMCNUM9F3eAWJMuVaFTbrWm8n2uGCTHT5Bz8LwABfd3Eu/BTuGBqv3zUr/BqW0Tn1NSM2 1cjE9Zv8VAi8UZzPA7wPOksOJHmOCBRHWJCi9G0oS+0vFgEc0HrP5Kxj1fyCwifdquoIuVx+aBMwKm mFN1EZZlmWbkvly//vxYGUZ3CFcseskUdPbh8Vs9XP8Xocr9G6PtmdlCb9vQD2hVk+hPng7wY0am/P wmfJE8NZjkIfPqQfUqpVSvKmJHol4Ww== 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=fPW7oxX55LoL0E1QRCGh6oYHZcl3KT3aSw1i8ft7q3c=; b=ZwqnT0oICvPaiOS+8ty4vrbfB8VCRqbPQj4E7KdBUf/PB87bb8+0+bNJutO4mKoA6iHznrXvUNBCC J5DcapAbBH8dI2M30FjpzmuL6Q7DPKQig7CMgN1tx2GmueezFFbrdNWYjZBtSRy89XAxJ0mi9e/CMq 7dFynxaV024dJfzQiT81YX4A3XNVgki99wXpz9jgCIJrorQs+GV4k/iR/b7pZjrYA7YtU19E20VXrE Qn6xOD9RSKKnj0ctiM66RahYY0KClbZAWUpt+xYSf009pB3uFoQOJZDGII1heQvKJbrwXW4knPt7XU QHGwN7rIaIbdJW/B4/EGbOF0C7+ny+Q== ARC-Authentication-Results: i=1; outbound3.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:cc:to:from:subject:message-id:from; bh=fPW7oxX55LoL0E1QRCGh6oYHZcl3KT3aSw1i8ft7q3c=; b=o6vLMQ2qTvpmqskcjl9NdMoEJkBxXXhHW1wCQf9oxfkI1tiL0vMlyAbZYQIl9ETF/pfVFAVTQdShF 1wbTq1Nd72O2Qfs8jYwdsNCXj0nJvz4AhOQIufEezp6TmYZ0RqgApGjCiOrMebx7kcwvavcG0yswYe dYrrt97C8Hp/50fDiqnvGOWS/Uv2L9kcnTITxIZ3us2oiQvdwmgX1aSPS1mhpVhsOADijhuVlQa7a7 11EFP9o8zh66FnrVEhlXOc8fN9ZMTgzie40EBRYSX6Ncklaarw/dgEuc5ke5wNTImvazOx9d0VMT+5 Mag25NHqm1sy1hETfqe3n4EzRatTvPw== X-MHO-RoutePath: aGlwcGll X-MHO-User: f81f2188-861c-11e9-91aa-b56e4e6b5865 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 outbound3.eu.mailhop.org (Halon) with ESMTPSA id f81f2188-861c-11e9-91aa-b56e4e6b5865; Mon, 03 Jun 2019 16:31:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x53GUwlj056421; Mon, 3 Jun 2019 10:30:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <68e39f5f8b18569a406ec6bafe8d60fbe9e6d87f.camel@freebsd.org> Subject: Re: svn commit: r348355 - head/sys/dev/iicbus From: Ian Lepore To: Andriy Gapon , Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: jmd@freebsd.org Date: Mon, 03 Jun 2019 10:30:58 -0600 In-Reply-To: References: <201905290908.x4T98L89066643@repo.freebsd.org> <75cec0b83709f48bbd52e2444d7af17569093f60.camel@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: 834C289189 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.994,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, 03 Jun 2019 16:31:08 -0000 On Mon, 2019-06-03 at 18:19 +0300, Andriy Gapon wrote: > On 03/06/2019 17:52, Ian Lepore wrote: > > Please don't. We still have a situation where nobody has shown a > > runtime failure at all. This build failure could be fixed by > > simply > > defining a do-nothing iicbus_set_nostop() function if a quick fix > > is > > needed. > > Well, I am quite certain that the run-time failure will follow after > the build > time failure is fixed. > > > Putting this nostop concept into code that is shared by many > > drivers is > > an abomination. We have exactly one driver that needs this > > functionality, so the right fix is to implement it wholly within > > that > > one driver. I'll put together a diff for that. > > That's true that we have just one such driver. > At the same time, the "no stop" (or rather, repeated start) behavior > makes more > sense. If stop+start between transfers are needed then that can be > done with > multiple calls to iicbus_transfer. If multiple messages are given to > iicbus_transfer, then it's reasonable to assume that a repeated > started is > wanted between them. But it would be a big change to review and, if > needed, fix > or tidy up all code that uses iicbus_transfer. So, > iicbus_set_nostop() could be > just a small step towards the bigger goal. > > But I really don't have a strong opinion. > Fixing drm2 directly is just as good for me as iicbus_set_nostop. > I agree with you that the freebsd iic stuff is a Big Mess, poorly designed. But it is what it is, we can't change things now without breaking every out-of-tree driver in the world (and I know for sure they exist, because we have some at $work). So we're stuck with explicitly setting NOSTOP flags in iic_msg descriptors even though it would be sensible to assume NOSTOP on all but the last one. Anyway, the bad news is I mis-remembered how the iicbb interface and driver are structured. The hook point I wanted isn't there, making it hard to put the fix I was picturing in the intel_iic code. I'd still like to think of a better fix, but it's going to take more than a few minutes. So I guess we'd better go with your fix to get things working right away. If I can think up something more elegant we can always switch to it later. -- Ian From owner-svn-src-head@freebsd.org Mon Jun 3 16: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 955F915B69F5; Mon, 3 Jun 2019 16:47:01 +0000 (UTC) (envelope-from markj@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 37BE589914; Mon, 3 Jun 2019 16:47:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 261278DCA; Mon, 3 Jun 2019 16:47:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53Gl0LC014650; Mon, 3 Jun 2019 16:47:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Gl09W014649; Mon, 3 Jun 2019 16:47:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906031647.x53Gl09W014649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Jun 2019 16:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348545 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 348545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37BE589914 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)[-1.000,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: Mon, 03 Jun 2019 16:47:01 -0000 Author: markj Date: Mon Jun 3 16:47:00 2019 New Revision: 348545 URL: https://svnweb.freebsd.org/changeset/base/348545 Log: Typo. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Mon Jun 3 16:21:09 2019 (r348544) +++ head/lib/libutil/pw_util.3 Mon Jun 3 16:47:00 2019 (r348545) @@ -58,7 +58,7 @@ .Ft void .Fn pw_fini "void" .Ft int -.Fn pw_init "const char *dir" const char *master" +.Fn pw_init "const char *dir" "const char *master" .Ft void .Fn pw_initpwd "struct passwd *pw" .Ft "char *" From owner-svn-src-head@freebsd.org Mon Jun 3 16:51: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 5097115B6CAC; Mon, 3 Jun 2019 16:51:08 +0000 (UTC) (envelope-from markj@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 E9E4589C4E; Mon, 3 Jun 2019 16:51:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5BEF8DF8; Mon, 3 Jun 2019 16:51:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53Gp7ID019230; Mon, 3 Jun 2019 16:51:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Gp7FD019209; Mon, 3 Jun 2019 16:51:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906031651.x53Gp7FD019209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Jun 2019 16:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348547 - head/usr.sbin/rpc.yppasswdd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rpc.yppasswdd X-SVN-Commit-Revision: 348547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9E4589C4E 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)[-1.000,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, 03 Jun 2019 16:51:08 -0000 Author: markj Date: Mon Jun 3 16:51:07 2019 New Revision: 348547 URL: https://svnweb.freebsd.org/changeset/base/348547 Log: rpc.yppasswdd: Fix dirname(3) usage after r305952. PR: 234972 Submitted by: Edward Fuhr (original) MFC after: 3 days Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Mon Jun 3 16:47:51 2019 (r348546) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Mon Jun 3 16:51:07 2019 (r348547) @@ -468,7 +468,9 @@ yppasswdproc_update_1_svc(yppasswd *argp, struct svc_r char *cryptpw; char *oldshell = NULL; char *oldgecos = NULL; + char *passdir; char *passfile_hold; + char passdir_buf[MAXPATHLEN + 2]; char passfile_buf[MAXPATHLEN + 2]; char passfile_hold_buf[MAXPATHLEN + 2]; char *domain = yppasswd_domain; @@ -602,11 +604,14 @@ yppasswdproc_update_1_svc(yppasswd *argp, struct svc_r snprintf(passfile_hold_buf, sizeof(passfile_hold_buf), "%s.hold", passfile); passfile_hold = (char *)&passfile_hold_buf; - + /* Step 5: make a new password file with the updated info. */ - if (pw_init(dirname(passfile), passfile)) { + snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile); + passdir = dirname(passdir_buf); + + if (pw_init(passdir, passfile)) { yp_error("pw_init() failed"); return &result; } @@ -726,7 +731,9 @@ yppasswdproc_update_master_1_svc(master_yppasswd *argp uid_t uid; int rval = 0; DBT key, data; + char *passdir; char *passfile_hold; + char passdir_buf[MAXPATHLEN + 2]; char passfile_buf[MAXPATHLEN + 2]; char passfile_hold_buf[MAXPATHLEN + 2]; struct sockaddr_in *rqhost; @@ -829,7 +836,10 @@ allow additions to be made to the password database"); "%s.hold", passfile); passfile_hold = (char *)&passfile_hold_buf; - if (pw_init(dirname(passfile), passfile)) { + snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile); + passdir = dirname(passdir_buf); + + if (pw_init(passdir, passfile)) { yp_error("pw_init() failed"); return &result; } From owner-svn-src-head@freebsd.org Mon Jun 3 17:19: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 D1A1F15B7F5A; Mon, 3 Jun 2019 17:19:06 +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 7440C8BC0A; Mon, 3 Jun 2019 17:19:06 +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 415F392E7; Mon, 3 Jun 2019 17:19:06 +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 x53HJ6gP031037; Mon, 3 Jun 2019 17:19:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HJ6ji031036; Mon, 3 Jun 2019 17:19:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031719.x53HJ6ji031036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348557 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 348557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7440C8BC0A 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.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 03 Jun 2019 17:19:07 -0000 Author: mav Date: Mon Jun 3 17:19:05 2019 New Revision: 348557 URL: https://svnweb.freebsd.org/changeset/base/348557 Log: MFV r348534: 9616 Bogus error when attempting to set property on read-only pool illumos/illumos-gate@f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391 Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Robert Mustacchi Author: Andrew Stormont Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Jun 3 17:14:54 2019 (r348556) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Jun 3 17:19:05 2019 (r348557) @@ -30,7 +30,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov - * Copyright 2017 RackTop Systems. + * Copyright 2017-2018 RackTop Systems. */ #include @@ -1842,13 +1842,18 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props) ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc); if (ret != 0) { + if (zc.zc_nvlist_dst_filled == B_FALSE) { + (void) zfs_standard_error(hdl, errno, errbuf); + goto error; + } + /* Get the list of unset properties back and report them. */ nvlist_t *errorprops = NULL; if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0) goto error; - for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + for (nvpair_t *elem = nvlist_next_nvpair(errorprops, NULL); elem != NULL; - elem = nvlist_next_nvpair(nvl, elem)) { + elem = nvlist_next_nvpair(errorprops, elem)) { zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem)); zfs_setprop_error(hdl, prop, errno, errbuf); } From owner-svn-src-head@freebsd.org Mon Jun 3 17:27: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 DCC1B15B83D5; Mon, 3 Jun 2019 17:27:27 +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 9F5528C2D3; Mon, 3 Jun 2019 17:27:26 +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 5D4209489; Mon, 3 Jun 2019 17:27:26 +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 x53HRQ0F036084; Mon, 3 Jun 2019 17:27:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HRQid036083; Mon, 3 Jun 2019 17:27:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031727.x53HRQid036083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348558 - 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: 348558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F5528C2D3 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,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, 03 Jun 2019 17:27:28 -0000 Author: mav Date: Mon Jun 3 17:27:25 2019 New Revision: 348558 URL: https://svnweb.freebsd.org/changeset/base/348558 Log: MFV r348535: 9677 panic from zio_write_gang_block() when creating dump device on fragmented rpool illumos/illumos-gate@7341a7de4f0489193e0cfe11049a7bcf1596a4db Reviewed by: Matt Ahrens Reviewed by: George Wilson Reviewed by: Prashanth Sreenivasa Approved by: Robert Mustacchi Author: Brad Lewis Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jun 3 17:19:05 2019 (r348557) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jun 3 17:27:25 2019 (r348558) @@ -2319,7 +2319,13 @@ zio_write_gang_member_ready(zio_t *zio) static void zio_write_gang_done(zio_t *zio) { - abd_put(zio->io_abd); + /* + * The io_abd field will be NULL for a zio with no data. The io_flags + * will initially have the ZIO_FLAG_NODATA bit flag set, but we can't + * check for it here as it is cleared in zio_ready. + */ + if (zio->io_abd != NULL) + abd_put(zio->io_abd); } static zio_t * @@ -2340,11 +2346,12 @@ zio_write_gang_block(zio_t *pio) int gbh_copies = MIN(copies + 1, spa_max_replication(spa)); zio_prop_t zp; int error; + boolean_t has_data = !(pio->io_flags & ZIO_FLAG_NODATA); int flags = METASLAB_HINTBP_FAVOR | METASLAB_GANG_HEADER; if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) { ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE); - ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA)); + ASSERT(has_data); flags |= METASLAB_ASYNC_ALLOC; VERIFY(refcount_held(&mc->mc_alloc_slots[pio->io_allocator], @@ -2368,7 +2375,7 @@ zio_write_gang_block(zio_t *pio) if (error) { if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) { ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE); - ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA)); + ASSERT(has_data); /* * If we failed to allocate the gang block header then @@ -2421,14 +2428,15 @@ zio_write_gang_block(zio_t *pio) zp.zp_nopwrite = B_FALSE; zio_t *cio = zio_write(zio, spa, txg, &gbh->zg_blkptr[g], - abd_get_offset(pio->io_abd, pio->io_size - resid), lsize, - lsize, &zp, zio_write_gang_member_ready, NULL, NULL, + has_data ? abd_get_offset(pio->io_abd, pio->io_size - + resid) : NULL, lsize, lsize, &zp, + zio_write_gang_member_ready, NULL, NULL, zio_write_gang_done, &gn->gn_child[g], pio->io_priority, ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark); if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) { ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE); - ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA)); + ASSERT(has_data); /* * Gang children won't throttle but we should From owner-svn-src-head@freebsd.org Mon Jun 3 17:29:58 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 81F9215B8485; Mon, 3 Jun 2019 17:29:58 +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 245DC8C46D; Mon, 3 Jun 2019 17:29:58 +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 EC046948E; Mon, 3 Jun 2019 17:29:57 +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 x53HTvmx036235; Mon, 3 Jun 2019 17:29:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HTvl6036234; Mon, 3 Jun 2019 17:29:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031729.x53HTvl6036234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348559 - 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: 348559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 245DC8C46D 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,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, 03 Jun 2019 17:29:58 -0000 Author: mav Date: Mon Jun 3 17:29:57 2019 New Revision: 348559 URL: https://svnweb.freebsd.org/changeset/base/348559 Log: MFV r348537: 8601 memory leak in get_special_prop() illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1 Reviewed by: Serapheim Dimitropoulos Reviewed by: Sara Hartse Reviewed by: Pavel Zakharov Reviewed by: Matt Ahrens Reviewed by: Robert Mustacchi Approved by: Dan McDonald Author: John Gallagher Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Jun 3 17:27:25 2019 (r348558) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Jun 3 17:29:57 2019 (r348559) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include "lua.h" @@ -431,16 +431,21 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, case ZFS_PROP_INCONSISTENT: numval = dsl_get_inconsistent(ds); break; - case ZFS_PROP_RECEIVE_RESUME_TOKEN: - VERIFY3U(strlcpy(strval, get_receive_resume_stats_impl(ds), - ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN); + case ZFS_PROP_RECEIVE_RESUME_TOKEN: { + char *token = get_receive_resume_stats_impl(ds); + VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <, + ZAP_MAXVALUELEN); + strfree(token); if (strcmp(strval, "") == 0) { - VERIFY3U(strlcpy(strval, get_child_receive_stats(ds), - ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN); + token = get_child_receive_stats(ds); + VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <, + ZAP_MAXVALUELEN); + strfree(token); if (strcmp(strval, "") == 0) error = ENOENT; } break; + } case ZFS_PROP_VOLSIZE: ASSERT(ds_type == ZFS_TYPE_VOLUME); error = dmu_objset_from_ds(ds, &os); From owner-svn-src-head@freebsd.org Mon Jun 3 17:40: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 AD46F15B88E7; Mon, 3 Jun 2019 17:40:12 +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 4D2878CD07; Mon, 3 Jun 2019 17:40:12 +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 23B089637; Mon, 3 Jun 2019 17:40:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53HeBgZ041503; Mon, 3 Jun 2019 17:40:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HeBgg041501; Mon, 3 Jun 2019 17:40:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031740.x53HeBgg041501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348561 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 348561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D2878CD07 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,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, 03 Jun 2019 17:40:13 -0000 Author: mav Date: Mon Jun 3 17:40:11 2019 New Revision: 348561 URL: https://svnweb.freebsd.org/changeset/base/348561 Log: MFV r348548: 9617 too-frequent TXG sync causes excessive write inflation illumos/illumos-gate@7928f4baf4ab3230557eb6289be68aa7a3003f38 Reviewed by: Serapheim Dimitropoulos Reviewed by: Brad Lewis Reviewed by: George Wilson Reviewed by: Andrew Stormont Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Jun 3 17:34:01 2019 (r348560) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Jun 3 17:40:11 2019 (r348561) @@ -108,9 +108,11 @@ uint64_t zfs_dirty_data_max_max = 4ULL * 1024 * 1024 * int zfs_dirty_data_max_percent = 10; /* - * If there is at least this much dirty data, push out a txg. + * If there's at least this much dirty data (as a percentage of + * zfs_dirty_data_max), push out a txg. This should be less than + * zfs_vdev_async_write_active_min_dirty_percent. */ -uint64_t zfs_dirty_data_sync = 64 * 1024 * 1024; +uint64_t zfs_dirty_data_sync_pct = 20; /* * Once there is this amount of dirty data, the dmu_tx_delay() will kick in @@ -190,9 +192,9 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, dirty_data_max_percent sysctl_zfs_dirty_data_max_percent, "I", "The percent of physical memory used to auto calculate dirty_data_max"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN, - &zfs_dirty_data_sync, 0, - "Force a txg if the number of dirty buffer bytes exceed this value"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync_pct, CTLFLAG_RWTUN, + &zfs_dirty_data_sync_pct, 0, + "Force a txg if the percent of dirty buffer bytes exceed this value"); static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS); /* No zfs_delay_min_dirty_percent tunable due to limit requirements */ @@ -926,10 +928,12 @@ dsl_pool_need_dirty_delay(dsl_pool_t *dp) { uint64_t delay_min_bytes = zfs_dirty_data_max * zfs_delay_min_dirty_percent / 100; + uint64_t dirty_min_bytes = + zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100; boolean_t rv; mutex_enter(&dp->dp_lock); - if (dp->dp_dirty_total > zfs_dirty_data_sync) + if (dp->dp_dirty_total > dirty_min_bytes) txg_kick(dp); rv = (dp->dp_dirty_total > delay_min_bytes); mutex_exit(&dp->dp_lock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Mon Jun 3 17:34:01 2019 (r348560) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Mon Jun 3 17:40:11 2019 (r348561) @@ -53,7 +53,7 @@ struct dsl_scan; extern uint64_t zfs_dirty_data_max; extern uint64_t zfs_dirty_data_max_max; -extern uint64_t zfs_dirty_data_sync; +extern uint64_t zfs_dirty_data_sync_pct; extern int zfs_dirty_data_max_percent; extern int zfs_delay_min_dirty_percent; extern uint64_t zfs_delay_scale; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Jun 3 17:34:01 2019 (r348560) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Jun 3 17:40:11 2019 (r348561) @@ -490,6 +490,8 @@ txg_sync_thread(void *arg) uint64_t timeout = zfs_txg_timeout * hz; uint64_t timer; uint64_t txg; + uint64_t dirty_min_bytes = + zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100; /* * We sync when we're scanning, there's someone waiting @@ -501,7 +503,7 @@ txg_sync_thread(void *arg) !tx->tx_exiting && timer > 0 && tx->tx_synced_txg >= tx->tx_sync_txg_waiting && !txg_has_quiesced_to_sync(dp) && - dp->dp_dirty_total < zfs_dirty_data_sync) { + dp->dp_dirty_total < dirty_min_bytes) { dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n", tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp); txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer); From owner-svn-src-head@freebsd.org Mon Jun 3 17:43: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 BF2FB15B8B1F; Mon, 3 Jun 2019 17:43: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 5E7048D13E; Mon, 3 Jun 2019 17:43: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 3421397EA; Mon, 3 Jun 2019 17:43: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 x53HhXJU046200; Mon, 3 Jun 2019 17:43:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HhXwm046199; Mon, 3 Jun 2019 17:43:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031743.x53HhXwm046199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348562 - 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: 348562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E7048D13E 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-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: Mon, 03 Jun 2019 17:43:34 -0000 Author: mav Date: Mon Jun 3 17:43:32 2019 New Revision: 348562 URL: https://svnweb.freebsd.org/changeset/base/348562 Log: MFV r348550: 1700 Add SCSI UNMAP support illumos/illumos-gate@047c81d31d0f571d6652e97143cd15281de61e84 Reviewed by: Jerry Jelinek Reviewed by: Garrett D'Amore Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Saso Kiselkov This is irrelevant to FreeBSD, just a diff reduction. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Jun 3 17:40:11 2019 (r348561) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Jun 3 17:43:32 2019 (r348562) @@ -26,7 +26,7 @@ * * Portions Copyright 2010 Robert Milkowski * - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -2259,44 +2259,64 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, case DKIOCFREE: { - dkioc_free_t df; + dkioc_free_list_t *dfl; dmu_tx_t *tx; if (!zvol_unmap_enabled) break; - if (ddi_copyin((void *)arg, &df, sizeof (df), flag)) { - error = SET_ERROR(EFAULT); - break; + if (!(flag & FKIOCTL)) { + error = dfl_copyin((void *)arg, &dfl, flag, KM_SLEEP); + if (error != 0) + break; + } else { + dfl = (dkioc_free_list_t *)arg; + ASSERT3U(dfl->dfl_num_exts, <=, DFL_COPYIN_MAX_EXTS); + if (dfl->dfl_num_exts > DFL_COPYIN_MAX_EXTS) { + error = SET_ERROR(EINVAL); + break; + } } - /* - * Apply Postel's Law to length-checking. If they overshoot, - * just blank out until the end, if there's a need to blank - * out anything. - */ - if (df.df_start >= zv->zv_volsize) - break; /* No need to do anything... */ - mutex_exit(&zfsdev_state_lock); - rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length, - RL_WRITER); - tx = dmu_tx_create(zv->zv_objset); - dmu_tx_mark_netfree(tx); - error = dmu_tx_assign(tx, TXG_WAIT); - if (error != 0) { - dmu_tx_abort(tx); - } else { - zvol_log_truncate(zv, tx, df.df_start, - df.df_length, B_TRUE); - dmu_tx_commit(tx); - error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, - df.df_start, df.df_length); - } + for (int i = 0; i < dfl->dfl_num_exts; i++) { + uint64_t start = dfl->dfl_exts[i].dfle_start, + length = dfl->dfl_exts[i].dfle_length, + end = start + length; - zfs_range_unlock(rl); + /* + * Apply Postel's Law to length-checking. If they + * overshoot, just blank out until the end, if there's + * a need to blank out anything. + */ + if (start >= zv->zv_volsize) + continue; /* No need to do anything... */ + if (end > zv->zv_volsize) { + end = DMU_OBJECT_END; + length = end - start; + } + rl = zfs_range_lock(&zv->zv_znode, start, length, + RL_WRITER); + tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, start, length, + B_TRUE); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, + ZVOL_OBJ, start, length); + } + + zfs_range_unlock(rl); + + if (error != 0) + break; + } + /* * If the write-cache is disabled, 'sync' property * is set to 'always', or if the caller is asking for @@ -2308,9 +2328,12 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, if ((error == 0) && zvol_unmap_sync_enabled && (!(zv->zv_flags & ZVOL_WCE) || (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS) || - (df.df_flags & DF_WAIT_SYNC))) { + (dfl->dfl_flags & DF_WAIT_SYNC))) { zil_commit(zv->zv_zilog, ZVOL_OBJ); } + + if (!(flag & FKIOCTL)) + dfl_free(dfl); return (error); } From owner-svn-src-head@freebsd.org Mon Jun 3 17:44: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 448A815B8BA5; Mon, 3 Jun 2019 17:44:48 +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 DB43B8D299; Mon, 3 Jun 2019 17:44:47 +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 B2B2097EB; Mon, 3 Jun 2019 17:44:47 +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 x53Hil3l046329; Mon, 3 Jun 2019 17:44:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Hilf3046328; Mon, 3 Jun 2019 17:44:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031744.x53Hilf3046328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348563 - 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: 348563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB43B8D299 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,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, 03 Jun 2019 17:44:48 -0000 Author: mav Date: Mon Jun 3 17:44:47 2019 New Revision: 348563 URL: https://svnweb.freebsd.org/changeset/base/348563 Log: MFV r348551: 9862 fix typo in comment in vdev_impl.h illumos/illumos-gate@84927f52bd837f6e4882a19e43fd026f1828d910 Reviewed by: Matthew Ahrens Reviewed by: Brian Behlendorf Approved by: Robert Mustacchi Author: Allan Jude Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 3 17:43:32 2019 (r348562) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 3 17:44:47 2019 (r348563) @@ -319,7 +319,7 @@ struct vdev { /* * The queue depth parameters determine how many async writes are - * still pending (i.e. allocated by net yet issued to disk) per + * still pending (i.e. allocated but not yet issued to disk) per * top-level (vdev_async_write_queue_depth) and the maximum allowed * (vdev_max_async_write_queue_depth). These values only apply to * top-level vdevs. From owner-svn-src-head@freebsd.org Mon Jun 3 17:56: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 07E5415B8ED0; Mon, 3 Jun 2019 17:56:46 +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 9E6458DA41; Mon, 3 Jun 2019 17:56:45 +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 81BF09994; Mon, 3 Jun 2019 17:56:45 +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 x53Hujav052094; Mon, 3 Jun 2019 17:56:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Huidj052092; Mon, 3 Jun 2019 17:56:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031756.x53Huidj052092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348564 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E6458DA41 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,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, 03 Jun 2019 17:56:46 -0000 Author: mav Date: Mon Jun 3 17:56:44 2019 New Revision: 348564 URL: https://svnweb.freebsd.org/changeset/base/348564 Log: MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047 Reviewed by: Brad Lewis Reviewed by: Matt Ahrens Reviewed by: Sara Hartse Approved by: Robert Mustacchi Author: Serapheim Dimitropoulos Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 3 17:44:47 2019 (r348563) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 3 17:56:44 2019 (r348564) @@ -2271,10 +2271,11 @@ dump_dir(objset_t *os) dmu_objset_name(os, osname); (void) printf("Dataset %s [%s], ID %llu, cr_txg %llu, " - "%s, %llu objects%s\n", + "%s, %llu objects%s%s\n", osname, type, (u_longlong_t)dmu_objset_id(os), (u_longlong_t)dds.dds_creation_txg, - numbuf, (u_longlong_t)usedobjs, blkbuf); + numbuf, (u_longlong_t)usedobjs, blkbuf, + (dds.dds_inconsistent) ? " (inconsistent)" : ""); if (zopt_objects != 0) { for (i = 0; i < zopt_objects; i++) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Jun 3 17:44:47 2019 (r348563) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Jun 3 17:56:44 2019 (r348564) @@ -3953,8 +3953,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char */ spa_history_log_version(spa, "open"); + spa_restart_removal(spa); + spa_spawn_aux_threads(spa); + /* * Delete any inconsistent datasets. + * + * Note: + * Since we may be issuing deletes for clones here, + * we make sure to do so after we've spawned all the + * auxiliary threads above (from which the livelist + * deletion zthr is part of). */ (void) dmu_objset_find(spa_name(spa), dsl_destroy_inconsistent, NULL, DS_FIND_CHILDREN); @@ -3963,10 +3972,6 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char * Clean up any stale temporary dataset userrefs. */ dsl_pool_clean_tmp_userrefs(spa->spa_dsl_pool); - - spa_restart_removal(spa); - - spa_spawn_aux_threads(spa); spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER); vdev_initialize_restart(spa->spa_root_vdev); From owner-svn-src-head@freebsd.org Mon Jun 3 18:32:58 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 4369C15B9C7B; Mon, 3 Jun 2019 18:32:58 +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 D70228EDBD; Mon, 3 Jun 2019 18:32:57 +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 ABEBAA041; Mon, 3 Jun 2019 18:32:57 +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 x53IWvau072679; Mon, 3 Jun 2019 18:32:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53IWvSr072676; Mon, 3 Jun 2019 18:32:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031832.x53IWvSr072676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 18:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348565 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 348565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D70228EDBD 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-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: Mon, 03 Jun 2019 18:32:58 -0000 Author: mav Date: Mon Jun 3 18:32:56 2019 New Revision: 348565 URL: https://svnweb.freebsd.org/changeset/base/348565 Log: MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename() illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728 Reviewed by: Prakash Surya Reviewed by: Serapheim Dimitropoulos Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun 3 17:56:44 2019 (r348564) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun 3 18:32:56 2019 (r348565) @@ -338,7 +338,6 @@ ztest_func_t ztest_spa_create_destroy; ztest_func_t ztest_fault_inject; ztest_func_t ztest_ddt_repair; ztest_func_t ztest_dmu_snapshot_hold; -ztest_func_t ztest_spa_rename; ztest_func_t ztest_scrub; ztest_func_t ztest_dsl_dataset_promote_busy; ztest_func_t ztest_vdev_attach_detach; @@ -384,7 +383,6 @@ ztest_info_t ztest_info[] = { { ztest_ddt_repair, 1, &zopt_sometimes }, { ztest_dmu_snapshot_hold, 1, &zopt_sometimes }, { ztest_reguid, 1, &zopt_rarely }, - { ztest_spa_rename, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_often }, { ztest_spa_upgrade, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, @@ -5550,59 +5548,6 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id) VERIFY3U(load, ==, spa_load_guid(spa)); } -/* - * Rename the pool to a different name and then rename it back. - */ -/* ARGSUSED */ -void -ztest_spa_rename(ztest_ds_t *zd, uint64_t id) -{ - char *oldname, *newname; - spa_t *spa; - - rw_enter(&ztest_name_lock, RW_WRITER); - - oldname = ztest_opts.zo_pool; - newname = umem_alloc(strlen(oldname) + 5, UMEM_NOFAIL); - (void) strcpy(newname, oldname); - (void) strcat(newname, "_tmp"); - - /* - * Do the rename - */ - VERIFY3U(0, ==, spa_rename(oldname, newname)); - - /* - * Try to open it under the old name, which shouldn't exist - */ - VERIFY3U(ENOENT, ==, spa_open(oldname, &spa, FTAG)); - - /* - * Open it under the new name and make sure it's still the same spa_t. - */ - VERIFY3U(0, ==, spa_open(newname, &spa, FTAG)); - - ASSERT(spa == ztest_spa); - spa_close(spa, FTAG); - - /* - * Rename it back to the original - */ - VERIFY3U(0, ==, spa_rename(newname, oldname)); - - /* - * Make sure it can still be opened - */ - VERIFY3U(0, ==, spa_open(oldname, &spa, FTAG)); - - ASSERT(spa == ztest_spa); - spa_close(spa, FTAG); - - umem_free(newname, strlen(newname) + 1); - - rw_exit(&ztest_name_lock); -} - static vdev_t * ztest_random_concrete_vdev_leaf(vdev_t *vd) { @@ -6661,7 +6606,6 @@ main(int argc, char **argv) ztest_shared_callstate_t *zc; char timebuf[100]; char numbuf[NN_NUMBUF_SZ]; - spa_t *spa; char *cmd; boolean_t hasalt; char *fd_data_str = getenv("ZTEST_FD_DATA"); @@ -6835,24 +6779,6 @@ main(int argc, char **argv) } (void) printf("\n"); } - - /* - * It's possible that we killed a child during a rename test, - * in which case we'll have a 'ztest_tmp' pool lying around - * instead of 'ztest'. Do a blind rename in case this happened. - */ - kernel_init(FREAD); - if (spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0) { - spa_close(spa, FTAG); - } else { - char tmpname[ZFS_MAX_DATASET_NAME_LEN]; - kernel_fini(); - kernel_init(FREAD | FWRITE); - (void) snprintf(tmpname, sizeof (tmpname), "%s_tmp", - ztest_opts.zo_pool); - (void) spa_rename(tmpname, ztest_opts.zo_pool); - } - kernel_fini(); ztest_run_zdb(ztest_opts.zo_pool); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Jun 3 17:56:44 2019 (r348564) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Jun 3 18:32:56 2019 (r348565) @@ -229,9 +229,6 @@ * vdev state is protected by spa_vdev_state_enter() / spa_vdev_state_exit(). * Like spa_vdev_enter/exit, these are convenience wrappers -- the actual * locking is, always, based on spa_namespace_lock and spa_config_lock[]. - * - * spa_rename() is also implemented within this file since it requires - * manipulation of the namespace. */ static avl_tree_t spa_namespace_avl; @@ -1450,56 +1447,6 @@ spa_deactivate_mos_feature(spa_t *spa, const char *fea { if (nvlist_remove_all(spa->spa_label_features, feature) == 0) vdev_config_dirty(spa->spa_root_vdev); -} - -/* - * Rename a spa_t. - */ -int -spa_rename(const char *name, const char *newname) -{ - spa_t *spa; - int err; - - /* - * Lookup the spa_t and grab the config lock for writing. We need to - * actually open the pool so that we can sync out the necessary labels. - * It's OK to call spa_open() with the namespace lock held because we - * allow recursive calls for other reasons. - */ - mutex_enter(&spa_namespace_lock); - if ((err = spa_open(name, &spa, FTAG)) != 0) { - mutex_exit(&spa_namespace_lock); - return (err); - } - - spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); - - avl_remove(&spa_namespace_avl, spa); - (void) strlcpy(spa->spa_name, newname, sizeof (spa->spa_name)); - avl_add(&spa_namespace_avl, spa); - - /* - * Sync all labels to disk with the new names by marking the root vdev - * dirty and waiting for it to sync. It will pick up the new pool name - * during the sync. - */ - vdev_config_dirty(spa->spa_root_vdev); - - spa_config_exit(spa, SCL_ALL, FTAG); - - txg_wait_synced(spa->spa_dsl_pool, 0); - - /* - * Sync the updated config cache. - */ - spa_write_cachefile(spa, B_FALSE, B_TRUE); - - spa_close(spa, FTAG); - - mutex_exit(&spa_namespace_lock); - - return (0); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Jun 3 17:56:44 2019 (r348564) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Jun 3 18:32:56 2019 (r348565) @@ -841,7 +841,6 @@ extern void spa_load_note(spa_t *spa, const char *fmt, extern void spa_activate_mos_feature(spa_t *spa, const char *feature, dmu_tx_t *tx); extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature); -extern int spa_rename(const char *oldname, const char *newname); extern spa_t *spa_by_guid(uint64_t pool_guid, uint64_t device_guid); extern boolean_t spa_guid_exists(uint64_t pool_guid, uint64_t device_guid); extern char *spa_strdup(const char *); From owner-svn-src-head@freebsd.org Mon Jun 3 18:42: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 0634615BA338; Mon, 3 Jun 2019 18:42:55 +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 88C1D8FBBC; Mon, 3 Jun 2019 18:42:54 +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 x53IgoqS044143; Mon, 3 Jun 2019 11:42:50 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x53IgoVw044142; Mon, 3 Jun 2019 11:42:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906031842.x53IgoVw044142@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb In-Reply-To: To: Maxim Sobolev Date: Mon, 3 Jun 2019 11:42:50 -0700 (PDT) CC: Enji Cooper , src-committers , svn-src-all , svn-src-head 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: 88C1D8FBBC 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.972,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, 03 Jun 2019 18:42:55 -0000 > On Mon, Jun 3, 2019 at 7:28 AM Enji Cooper wrote: > > > Hi Maxim, > > > > > > > Modified: head/Makefile.inc1 > > > > > ============================================================================== > > > --- head/Makefile.inc1 Sun Jun 2 22:27:26 2019 (r348520) > > > +++ head/Makefile.inc1 Sun Jun 2 23:38:19 2019 (r348521) > > > @@ -887,8 +887,8 @@ MTREEFLAGS+= -W > > > INSTALLFLAGS+= -h sha256 > > > .endif > > > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > > > -IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" > > > -IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > > > +IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > > > +IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" I see the bugger with this change now, it is a loop, MTREE_CMD=${MTREE_CMD}... and I do not think MTREE_CMD is defined at this point, see below. > > > .endif > > > > Please back out this part of the change as it is unnecessary and adds > > a dependency on sys.mk?s definitions. $PATH should contain, i.e., be > > populated, with these tools when running make installworld. This is part of > > the logic behind how $ITOOLS, etc, works. That would be in direct conflict with how preceding tools worked, INSTALL?=install has been there for a very very long time and any direct invoke of install in our Makefile/.mk files is just wrong, and for the very reasoning that Max is trying to do. I made the mistake of following someone else earlier that thought it was INSTALL that was undefined, and as we known now that was not the case, it was MTREE_CMD that was undefined, and that is less clear, as iirc when that was originally done mtree was contained soly in src/etc/Makefile by design. It appears as if that hos how crept up directly into head/Makefile.inc1, and the definition for MTREE_CMD?= did not get moved to a more appropriate place. > > Thank you very much for your work and the rest of the change though! > > > > Thanks Enji, for a clarification, will do. I still cannot understand why > can't we have those tools being re-defined with top-level make environment? You should and must be able to do this. Especially for INSTALL, I fully support that part of this change staying. > What I am striving at is being able to do say, make INSTALL="abcd" > installworld. Yes, I understand I can call "abcd" "install" (or make a > symlink to it) and put it into PATH, but there are at least one issue here, > namely what if I need to pass some distinct argument to abcd based on usage > scenario. E.g. make INSTALL="abcd foo" distributiuon. In your case I should > be resorting to setting up some global environment variable and hope it > won't get erased somewhere in the call chain, but that's bit "how you > doing" IMHO. My approach makes certain things so much easier by cutting > those un-neded steps. > > At any rate thank for a feedback and some background info, I will do more > work on this. I was thinking more in terms of having some sort of > bsd.bootools.mk where this can be defined in a centralized manner. > > -Max -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 3 19:00: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 7E1D815BA968; Mon, 3 Jun 2019 19:00:25 +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 1F3ED6867D; Mon, 3 Jun 2019 19:00:25 +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 E9513A3B7; Mon, 3 Jun 2019 19:00:24 +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 x53J0Oxa084540; Mon, 3 Jun 2019 19:00:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53J0OBR084538; Mon, 3 Jun 2019 19:00:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031900.x53J0OBR084538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 19:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348566 - 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: 348566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F3ED6867D 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)[-1.000,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: Mon, 03 Jun 2019 19:00:25 -0000 Author: mav Date: Mon Jun 3 19:00:24 2019 New Revision: 348566 URL: https://svnweb.freebsd.org/changeset/base/348566 Log: MFC r348554: 9688 aggsum_fini leaks memory illumos/illumos-gate@29bf2d68bef208274f5a54a14cc80c4a8cb76f53 Reviewed by: Serapheim Dimitropoulos Reviewed by: Matt Ahrens Reviewed by: Prashanth Sreenivasa Reviewed by: Jorgen Lundman Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Paul Dagnelie Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c Mon Jun 3 18:32:56 2019 (r348565) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c Mon Jun 3 19:00:24 2019 (r348566) @@ -13,7 +13,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2017 by Delphix. All rights reserved. + * Copyright (c) 2017, 2018 by Delphix. All rights reserved. */ #include @@ -99,6 +99,7 @@ aggsum_fini(aggsum_t *as) { for (int i = 0; i < as->as_numbuckets; i++) mutex_destroy(&as->as_buckets[i].asc_lock); + kmem_free(as->as_buckets, as->as_numbuckets * sizeof (aggsum_bucket_t)); mutex_destroy(&as->as_lock); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 3 18:32:56 2019 (r348565) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 3 19:00:24 2019 (r348566) @@ -7074,6 +7074,16 @@ arc_state_fini(void) multilist_destroy(arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); multilist_destroy(arc_mfu->arcs_list[ARC_BUFC_DATA]); multilist_destroy(arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); + + aggsum_fini(&arc_meta_used); + aggsum_fini(&arc_size); + aggsum_fini(&astat_data_size); + aggsum_fini(&astat_metadata_size); + aggsum_fini(&astat_hdr_size); + aggsum_fini(&astat_bonus_size); + aggsum_fini(&astat_dnode_size); + aggsum_fini(&astat_dbuf_size); + aggsum_fini(&astat_l2_hdr_size); } uint64_t @@ -7357,8 +7367,13 @@ arc_fini(void) mutex_destroy(&arc_adjust_lock); cv_destroy(&arc_adjust_waiters_cv); - arc_state_fini(); + /* + * buf_fini() must proceed arc_state_fini() because buf_fin() may + * trigger the release of kmem magazines, which can callback to + * arc_space_return() which accesses aggsums freed in act_state_fini(). + */ buf_fini(); + arc_state_fini(); ASSERT0(arc_loaned_bytes); } From owner-svn-src-head@freebsd.org Mon Jun 3 19:03: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 4D25215BAB5D; Mon, 3 Jun 2019 19:03:25 +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 DC38869DF8; Mon, 3 Jun 2019 19:03:24 +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 B1CAAA556; Mon, 3 Jun 2019 19:03:24 +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 x53J3O45089697; Mon, 3 Jun 2019 19:03:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53J3Oqc089696; Mon, 3 Jun 2019 19:03:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031903.x53J3Oqc089696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 19:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348567 - 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: 348567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC38869DF8 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 03 Jun 2019 19:03:25 -0000 Author: mav Date: Mon Jun 3 19:03:24 2019 New Revision: 348567 URL: https://svnweb.freebsd.org/changeset/base/348567 Log: MFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8 Reviewed by: Matt Ahrens Reviewed by: Brad Lewis Approved by: Robert Mustacchi Author: Serapheim Dimitropoulos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 3 19:00:24 2019 (r348566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 3 19:03:24 2019 (r348567) @@ -3031,11 +3031,11 @@ vdev_destroy_spacemaps(vdev_t *vd, dmu_tx_t *tx) } static void -vdev_remove_empty(vdev_t *vd, uint64_t txg) +vdev_remove_empty_log(vdev_t *vd, uint64_t txg) { spa_t *spa = vd->vdev_spa; - dmu_tx_t *tx; + ASSERT(vd->vdev_islog); ASSERT(vd == vd->vdev_top); ASSERT3U(txg, ==, spa_syncing_txg(spa)); @@ -3079,13 +3079,14 @@ vdev_remove_empty(vdev_t *vd, uint64_t txg) ASSERT0(mg->mg_histogram[i]); } - tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg); - vdev_destroy_spacemaps(vd, tx); + dmu_tx_t *tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg); - if (vd->vdev_islog && vd->vdev_top_zap != 0) { + vdev_destroy_spacemaps(vd, tx); + if (vd->vdev_top_zap != 0) { vdev_destroy_unlink_zap(vd, vd->vdev_top_zap, tx); vd->vdev_top_zap = 0; } + dmu_tx_commit(tx); } @@ -3157,14 +3158,11 @@ vdev_sync(vdev_t *vd, uint64_t txg) vdev_dtl_sync(lvd, txg); /* - * Remove the metadata associated with this vdev once it's empty. - * Note that this is typically used for log/cache device removal; - * we don't empty toplevel vdevs when removing them. But if - * a toplevel happens to be emptied, this is not harmful. + * If this is an empty log device being removed, destroy the + * metadata associated with it. */ - if (vd->vdev_stat.vs_alloc == 0 && vd->vdev_removing) { - vdev_remove_empty(vd, txg); - } + if (vd->vdev_islog && vd->vdev_stat.vs_alloc == 0 && vd->vdev_removing) + vdev_remove_empty_log(vd, txg); (void) txg_list_add(&spa->spa_vdev_txg_list, vd, TXG_CLEAN(txg)); } From owner-svn-src-head@freebsd.org Mon Jun 3 19:03:58 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 3AB4E15BABC3; Mon, 3 Jun 2019 19:03:58 +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 867A16A01B; Mon, 3 Jun 2019 19:03:57 +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 x53J3tXr044252; Mon, 3 Jun 2019 12:03:55 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x53J3tQq044251; Mon, 3 Jun 2019 12:03:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906031903.x53J3tQq044251@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348532 - in head: . etc In-Reply-To: <201906031512.x53FCjHh066558@repo.freebsd.org> To: Maxim Sobolev Date: Mon, 3 Jun 2019 12:03:55 -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: 867A16A01B 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.959,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, 03 Jun 2019 19:03:58 -0000 > Author: sobomax > Date: Mon Jun 3 15:12:44 2019 > New Revision: 348532 > URL: https://svnweb.freebsd.org/changeset/base/348532 > > Log: > Leave mtree hardcoded for now. Reverting partially 348521 and also > the followup stopgap change, because I don't think it's a correct. I still > need to figure out where to stick it in. In cannot be in Makefile.inc1 > and it cannot be in etc/Makefile from the looks of it to avoid > chicken-and-egg problem. A quick and incomplete look at this leads me to believe that much of the mtree related stuff in src/Makefile.inc1 should of been in src/etc in the first place. It ends up invoking etc/Makefile in the end anyway. Can someone explain why this is pulled up a level? Why do we now have distrib-dirs, distribution in src/Makefile.inc1, these were and should be in etc/Makefile? iirc hierarchy was pulled up to src/Makefile at one point, but forgetting the reasoning for that. > Modified: > head/Makefile.inc1 > head/etc/Makefile > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Mon Jun 3 15:10:37 2019 (r348531) > +++ head/Makefile.inc1 Mon Jun 3 15:12:44 2019 (r348532) > @@ -888,7 +888,7 @@ INSTALLFLAGS+= -h sha256 > .endif > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > -IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}" > +IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > .endif > > DESTDIR_MTREEFLAGS= -deU > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Mon Jun 3 15:10:37 2019 (r348531) > +++ head/etc/Makefile Mon Jun 3 15:12:44 2019 (r348532) > @@ -93,8 +93,6 @@ distribution: > .endif > .endif > > -MTREE_CMD?= mtree > - > MTREES= mtree/BSD.root.dist / \ > mtree/BSD.var.dist /var \ > mtree/BSD.usr.dist /usr \ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 3 19:06: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 9387515BACBA; Mon, 3 Jun 2019 19:06:51 +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 EC0386A223; Mon, 3 Jun 2019 19:06:50 +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 x53J6mtO044274; Mon, 3 Jun 2019 12:06:48 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x53J6mPi044273; Mon, 3 Jun 2019 12:06:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906031906.x53J6mPi044273@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348540 - head In-Reply-To: <201906031534.x53FY1cW077453@repo.freebsd.org> To: Maxim Sobolev Date: Mon, 3 Jun 2019 12:06:48 -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: EC0386A223 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 03 Jun 2019 19:06:51 -0000 > Author: sobomax > Date: Mon Jun 3 15:34:00 2019 > New Revision: 348540 > URL: https://svnweb.freebsd.org/changeset/base/348540 > > Log: > Rollback the rest of the botched r348521. Re-work would be posted to > reviews. Sorry. > > Reported by: Enji Cooper > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Mon Jun 3 15:32:42 2019 (r348539) > +++ head/Makefile.inc1 Mon Jun 3 15:34:00 2019 (r348540) > @@ -887,7 +887,7 @@ MTREEFLAGS+= -W > INSTALLFLAGS+= -h sha256 > .endif > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > -IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > +IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" This is a correct change, ngie please explain exactly why this is an exception to INSTALL?=install. > IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > .endif -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 3 19:10: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 A656E15BAE37; Mon, 3 Jun 2019 19:10:47 +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 480B26A6AB; Mon, 3 Jun 2019 19:10:47 +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 CF2E5A572; Mon, 3 Jun 2019 19:10:46 +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 x53JAkMo090472; Mon, 3 Jun 2019 19:10:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JAknd090470; Mon, 3 Jun 2019 19:10:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906031910.x53JAknd090470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Jun 2019 19:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348569 - in head/stand: common i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common i386/zfsboot X-SVN-Commit-Revision: 348569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 480B26A6AB 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 03 Jun 2019 19:10:48 -0000 Author: imp Date: Mon Jun 3 19:10:46 2019 New Revision: 348569 URL: https://svnweb.freebsd.org/changeset/base/348569 Log: [zfsboot] Fix boot env back compat (#190) * Fix boot env back compat zfsboot must try zfsloader before loader in order to remain compatible with boot environments created prior to zfs functionality being rolled into loader proper. * Improve comments in zfsboot Explain the significance of the load path order, and put the comment about looping through the paths in the appropriate scope. Obtained From: TrueNAS commit 4c60c62fcf0b6b6eac98ee8d46e7bbea64bc86f5 Submitted by: Ryan Moeller Modified: head/stand/common/paths.h head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/common/paths.h ============================================================================== --- head/stand/common/paths.h Mon Jun 3 19:09:39 2019 (r348568) +++ head/stand/common/paths.h Mon Jun 3 19:10:46 2019 (r348569) @@ -33,6 +33,7 @@ #define PATH_CONFIG "/boot/config" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Mon Jun 3 19:09:39 2019 (r348568) +++ head/stand/i386/zfsboot/zfsboot.c Mon Jun 3 19:10:46 2019 (r348569) @@ -87,6 +87,24 @@ static const unsigned char flags[NOPT] = { }; uint32_t opts; +/* + * Paths to try loading before falling back to the boot2 prompt. + * + * /boot/zfsloader must be tried before /boot/loader in order to remain + * backward compatible with ZFS boot environments where /boot/loader exists + * but does not have ZFS support, which was the case before FreeBSD 12. + * + * If no loader is found, try to load a kernel directly instead. + */ +static const struct string { + const char *p; + size_t len; +} loadpath[] = { + { PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) }, + { PATH_LOADER, sizeof(PATH_LOADER) }, + { PATH_KERNEL, sizeof(PATH_KERNEL) }, +}; + static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static char cmd[512]; @@ -857,16 +875,17 @@ main(void) if (nextboot && !autoboot) reboot(); - /* - * Try to exec /boot/loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ - if (autoboot && !*kname) { - memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); - if (!keyhit(3)) { + /* + * Iterate through the list of loader and kernel paths, trying to load. + * If interrupted by a keypress, or in case of failure, drop the user + * to the boot2 prompt. + */ + for (i = 0; i < nitems(loadpath); i++) { + memcpy(kname, loadpath[i].p, loadpath[i].len); + if (keyhit(3)) + break; load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); } } From owner-svn-src-head@freebsd.org Mon Jun 3 19:15: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 F08AF15BB06E; Mon, 3 Jun 2019 19:15:07 +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 8E6EF6AB86; Mon, 3 Jun 2019 19:15:07 +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 67153A702; Mon, 3 Jun 2019 19:15:07 +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 x53JF7Qc095474; Mon, 3 Jun 2019 19:15:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JF6m4095471; Mon, 3 Jun 2019 19:15:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031915.x53JF6m4095471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 19:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348570 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 348570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E6EF6AB86 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)[-1.000,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: Mon, 03 Jun 2019 19:15:08 -0000 Author: mav Date: Mon Jun 3 19:15:06 2019 New Revision: 348570 URL: https://svnweb.freebsd.org/changeset/base/348570 Log: MFV r348568: 9466 add JSON output support to channel programs illumos/illumos-gate@5267591016146502784860802129b16dab6f135c Reviewed by: Matt Ahrens Reviewed by: Serapheim Dimitropoulos Reviewed by: Sara Hartse Reviewed by: John Kennedy Approved by: Dan McDonald Author: Alek Pinchuk Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Jun 3 19:10:46 2019 (r348569) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Jun 3 19:15:06 2019 (r348570) @@ -9,6 +9,7 @@ .\" .\" .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. +.\" Copyright (c) 2018 Datto Inc. .\" .Dd October 02, 2017 .Dt ZFS-PROGRAM 1M @@ -18,7 +19,7 @@ .Nd executes ZFS channel programs .Sh SYNOPSIS .Cm zfs program -.Op Fl n +.Op Fl jn .Op Fl t Ar instruction-limit .Op Fl m Ar memory-limit .Ar pool @@ -46,6 +47,11 @@ will be run on and any attempts to access or modify other pools will cause an error. .Sh OPTIONS .Bl -tag -width "-t" +.It Fl j +Display channel program output in JSON format. +When this flag is specified and standard output is empty - +channel program encountered an error. +The details of such an error will be printed to standard error in plain text. .It Fl n Executes a read-only channel program, which runs faster. The program cannot change on-disk state by calling functions from the Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jun 3 19:10:46 2019 (r348569) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jun 3 19:15:06 2019 (r348570) @@ -29,6 +29,7 @@ .\" Copyright (c) 2014, Xin LI .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved. .\" Copyright 2018 Joyent, Inc. +.\" Copyright (c) 2018 Datto Inc. .\" .\" $FreeBSD$ .\" @@ -291,7 +292,7 @@ .Op Ar snapshot Ns | Ns Ar filesystem .Nm .Cm program -.Op Fl n +.Op Fl jn .Op Fl t Ar timeout .Op Fl m Ar memory_limit .Ar pool script @@ -3364,7 +3365,7 @@ Display the path's inode change time as the first colu .It Xo .Nm .Cm program -.Op Fl n +.Op Fl jn .Op Fl t Ar timeout .Op Fl m Ar memory_limit .Ar pool script @@ -3387,6 +3388,11 @@ For full documentation of the ZFS channel program inte page for .Xr zfs-program 8 . .Bl -tag -width indent +.It Fl j +Display channel program output in JSON format. +When this flag is specified and standard output is empty - +channel program encountered an error. +The details of such an error will be printed to standard error in plain text. .It Fl n Executes a read-only channel program, which runs faster. The program cannot change on-disk state by calling functions from Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jun 3 19:10:46 2019 (r348569) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jun 3 19:15:06 2019 (r348570) @@ -30,6 +30,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Igor Kozhukhov . * Copyright 2016 Nexenta Systems, Inc. + * Copyright (c) 2018 Datto Inc. */ #include @@ -351,7 +352,7 @@ get_usage(zfs_help_t idx) case HELP_BOOKMARK: return (gettext("\tbookmark \n")); case HELP_CHANNEL_PROGRAM: - return (gettext("\tprogram [-n] [-t ] " + return (gettext("\tprogram [-jn] [-t ] " "[-m ] " "[lua args...]\n")); } @@ -7238,12 +7239,12 @@ zfs_do_channel_program(int argc, char **argv) nvlist_t *outnvl; uint64_t instrlimit = ZCP_DEFAULT_INSTRLIMIT; uint64_t memlimit = ZCP_DEFAULT_MEMLIMIT; - boolean_t sync_flag = B_TRUE; + boolean_t sync_flag = B_TRUE, json_output = B_FALSE; zpool_handle_t *zhp; /* check options */ while (-1 != - (c = getopt(argc, argv, "nt:(instr-limit)m:(memory-limit)"))) { + (c = getopt(argc, argv, "jnt:(instr-limit)m:(memory-limit)"))) { switch (c) { case 't': case 'm': { @@ -7285,6 +7286,10 @@ zfs_do_channel_program(int argc, char **argv) sync_flag = B_FALSE; break; } + case 'j': { + json_output = B_TRUE; + break; + } case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -7407,11 +7412,14 @@ zfs_do_channel_program(int argc, char **argv) gettext("Channel program execution failed:\n%s\n"), errstring); } else { - (void) printf("Channel program fully executed "); - if (nvlist_empty(outnvl)) { - (void) printf("with no return value.\n"); + if (json_output) { + (void) nvlist_print_json(stdout, outnvl); + } else if (nvlist_empty(outnvl)) { + (void) fprintf(stdout, gettext("Channel program fully " + "executed and did not produce output.\n")); } else { - (void) printf("with return value:\n"); + (void) fprintf(stdout, gettext("Channel program fully " + "executed and produced output:\n")); dump_nvlist(outnvl, 4); } } From owner-svn-src-head@freebsd.org Mon Jun 3 19: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 1730515BB162; Mon, 3 Jun 2019 19:19:37 +0000 (UTC) (envelope-from tychon@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 B0D1A6AD5E; Mon, 3 Jun 2019 19:19:36 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 70BF0A707; Mon, 3 Jun 2019 19:19:36 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53JJadc095711; Mon, 3 Jun 2019 19:19:36 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JJZn7095708; Mon, 3 Jun 2019 19:19:35 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201906031919.x53JJZn7095708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 3 Jun 2019 19:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348571 - in head/sys: arm64/arm64 x86/iommu x86/x86 X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys: arm64/arm64 x86/iommu x86/x86 X-SVN-Commit-Revision: 348571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0D1A6AD5E 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 03 Jun 2019 19:19:37 -0000 Author: tychon Date: Mon Jun 3 19:19:35 2019 New Revision: 348571 URL: https://svnweb.freebsd.org/changeset/base/348571 Log: very large dma mappings can cause integer overflow Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20505 Modified: head/sys/arm64/arm64/busdma_bounce.c head/sys/x86/iommu/busdma_dmar.c head/sys/x86/x86/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Mon Jun 3 19:15:06 2019 (r348570) +++ head/sys/arm64/arm64/busdma_bounce.c Mon Jun 3 19:19:35 2019 (r348571) @@ -660,7 +660,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam /* * Add a single contiguous physical range to the segment list. */ -static int +static bus_size_t _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) { Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Mon Jun 3 19:15:06 2019 (r348570) +++ head/sys/x86/iommu/busdma_dmar.c Mon Jun 3 19:19:35 2019 (r348571) @@ -686,7 +686,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam return (ENOMEM); fma = NULL; for (i = 0; i < ma_cnt; i++) { - paddr = pstart + i * PAGE_SIZE; + paddr = pstart + ptoa(i); ma[i] = PHYS_TO_VM_PAGE(paddr); if (ma[i] == NULL || VM_PAGE_TO_PHYS(ma[i]) != paddr) { /* Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Mon Jun 3 19:15:06 2019 (r348570) +++ head/sys/x86/x86/busdma_bounce.c Mon Jun 3 19:19:35 2019 (r348571) @@ -667,7 +667,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam /* * Add a single contiguous physical range to the segment list. */ -static int +static bus_size_t _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t curaddr, bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) { From owner-svn-src-head@freebsd.org Mon Jun 3 19:25: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 E175B15BB820; Mon, 3 Jun 2019 19:25:54 +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 867ED6B690; Mon, 3 Jun 2019 19:25:54 +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 604C0A8B6; Mon, 3 Jun 2019 19:25:54 +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 x53JPss8000754; Mon, 3 Jun 2019 19:25:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JPsUI000753; Mon, 3 Jun 2019 19:25:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031925.x53JPsUI000753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 19:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348574 - 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: 348574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 867ED6B690 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 03 Jun 2019 19:25:55 -0000 Author: mav Date: Mon Jun 3 19:25:53 2019 New Revision: 348574 URL: https://svnweb.freebsd.org/changeset/base/348574 Log: MFV r348573: 9993 zil writes can get delayed in zio pipeline illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd Reviewed by: Prakash Surya Reviewed by: Brad Lewis Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: George Wilson Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jun 3 19:24:40 2019 (r348573) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jun 3 19:25:53 2019 (r348574) @@ -1614,7 +1614,8 @@ zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boo * If this is a high priority I/O, then use the high priority taskq if * available. */ - if (zio->io_priority == ZIO_PRIORITY_NOW && + if ((zio->io_priority == ZIO_PRIORITY_NOW || + zio->io_priority == ZIO_PRIORITY_SYNC_WRITE) && spa->spa_zio_taskq[t][q + 1].stqs_count != 0) q++; From owner-svn-src-head@freebsd.org Mon Jun 3 19:37: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 5846F15BBC1B; Mon, 3 Jun 2019 19:37:15 +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 CC77C6BD15; Mon, 3 Jun 2019 19:37:14 +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 BB7B8AA6F; Mon, 3 Jun 2019 19:37:14 +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 x53JbESb006252; Mon, 3 Jun 2019 19:37:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JbE3T006251; Mon, 3 Jun 2019 19:37:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906031937.x53JbE3T006251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 3 Jun 2019 19:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348575 - 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: 348575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC77C6BD15 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)[-1.000,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: Mon, 03 Jun 2019 19:37:15 -0000 Author: cy Date: Mon Jun 3 19:37:14 2019 New Revision: 348575 URL: https://svnweb.freebsd.org/changeset/base/348575 Log: Properly define the fourth argument to ipf_check, the main entry point into ipfilter. A proper definition simplifies dtrace scripts a little. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 19:25:53 2019 (r348574) +++ head/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 19:37:14 2019 (r348575) @@ -2810,7 +2810,7 @@ ipf_check(ctx, ip, hlen, ifp, out mb_t **mp; ip_t *ip; int hlen; - void *ifp; + struct ifnet *ifp; int out; void *ctx; { Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Mon Jun 3 19:25:53 2019 (r348574) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Mon Jun 3 19:37:14 2019 (r348575) @@ -1655,7 +1655,7 @@ typedef struct ipf_main_softc_s { } while (0) #ifndef _KERNEL -extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **)); +extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, mb_t **)); extern struct ifnet *get_unit __P((char *, int)); extern char *get_ifname __P((struct ifnet *)); extern int ipfioctl __P((ipf_main_softc_t *, int, ioctlcmd_t, @@ -1672,7 +1672,7 @@ extern int ipl_enable __P((void)); extern int ipl_disable __P((void)); # ifdef MENTAT /* XXX MENTAT is always defined for Solaris */ -extern int ipf_check __P((void *, struct ip *, int, void *, int, void *, +extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, void *, mblk_t **)); # if SOLARIS extern void ipf_prependmbt(fr_info_t *, mblk_t *); @@ -1681,7 +1681,7 @@ extern int ipfioctl __P((dev_t, int, intptr_t, int, cr extern int ipf_qout __P((queue_t *, mblk_t *)); # else /* MENTAT */ /* XXX MENTAT is never defined for FreeBSD & NetBSD */ -extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **)); +extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, mb_t **)); extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **)); extern size_t mbufchainlen __P((mb_t *)); # ifdef IPFILTER_LKM From owner-svn-src-head@freebsd.org Mon Jun 3 20:05: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 A4B2E15BC7D8; Mon, 3 Jun 2019 20:05:44 +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 498456D096; Mon, 3 Jun 2019 20:05:44 +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 0313DAF86; Mon, 3 Jun 2019 20:05:44 +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 x53K5hDY021885; Mon, 3 Jun 2019 20:05:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53K5hLa021882; Mon, 3 Jun 2019 20:05:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032005.x53K5hLa021882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 20:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348577 - 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: 348577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 498456D096 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)[-1.000,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, 03 Jun 2019 20:05:44 -0000 Author: mav Date: Mon Jun 3 20:05:43 2019 New Revision: 348577 URL: https://svnweb.freebsd.org/changeset/base/348577 Log: MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca Reviewed by: Matt Ahrens Reviewed by: Brad Lewis Reviewed by: Patrick Mooney Approved by: Dan McDonald Author: Prakash Surya Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 3 19:53:39 2019 (r348576) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 3 20:05:43 2019 (r348577) @@ -217,6 +217,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, standard_sm_blksz, CTLF &vdev_standard_sm_blksz, 0, "Block size for standard space map. Power of 2 and greater than 4096."); +/* + * Tunable parameter for debugging or performance analysis. Setting this + * will cause pool corruption on power loss if a volatile out-of-order + * write cache is enabled. + */ +boolean_t zfs_nocacheflush = B_FALSE; +SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN, + &zfs_nocacheflush, 0, "Disable cache flush"); + /*PRINTFLIKE2*/ void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Jun 3 19:53:39 2019 (r348576) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Jun 3 20:05:43 2019 (r348577) @@ -239,6 +239,10 @@ vdev_file_io_start(zio_t *zio) switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: + + if (zfs_nocacheflush) + break; + zio->io_error = VOP_FSYNC(vf->vf_vnode, FSYNC | FDSYNC, kcred, NULL); break; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Jun 3 19:53:39 2019 (r348576) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Jun 3 20:05:43 2019 (r348577) @@ -98,13 +98,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTL &zil_replay_disable, 0, "Disable intent logging replay"); /* - * Tunable parameter for debugging or performance analysis. Setting - * zfs_nocacheflush will cause corruption on power loss if a volatile - * out-of-order write cache is enabled. + * Disable the DKIOCFLUSHWRITECACHE commands that are normally sent to + * the disk(s) by the ZIL after an LWB write has completed. Setting this + * will cause ZIL corruption on power loss if a volatile out-of-order + * write cache is enabled. */ -boolean_t zfs_nocacheflush = B_FALSE; -SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN, - &zfs_nocacheflush, 0, "Disable cache flush"); +boolean_t zil_nocacheflush = B_FALSE; +SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_nocacheflush, CTLFLAG_RWTUN, + &zil_nocacheflush, 0, "Disable ZIL cache flush"); + boolean_t zfs_trim_enabled = B_TRUE; SYSCTL_DECL(_vfs_zfs_trim); SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, @@ -989,7 +991,7 @@ zil_lwb_add_block(lwb_t *lwb, const blkptr_t *bp) int ndvas = BP_GET_NDVAS(bp); int i; - if (zfs_nocacheflush) + if (zil_nocacheflush) return; mutex_enter(&lwb->lwb_vdev_lock); @@ -1013,7 +1015,7 @@ zil_lwb_add_txg(lwb_t *lwb, uint64_t txg) /* * This function is a called after all VDEVs associated with a given lwb * write have completed their DKIOCFLUSHWRITECACHE command; or as soon - * as the lwb write completes, if "zfs_nocacheflush" is set. + * as the lwb write completes, if "zil_nocacheflush" is set. * * The intention is for this function to be called as soon as the * contents of an lwb are considered "stable" on disk, and will survive From owner-svn-src-head@freebsd.org Mon Jun 3 20:24: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 84FDA15BCD8B; Mon, 3 Jun 2019 20:24:42 +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 23D246DC2C; Mon, 3 Jun 2019 20:24:42 +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 ECD31B2D1; Mon, 3 Jun 2019 20:24:41 +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 x53KOfHj034258; Mon, 3 Jun 2019 20:24:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KOeuB034249; Mon, 3 Jun 2019 20:24:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032024.x53KOeuB034249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 20:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348579 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 348579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23D246DC2C 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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, 03 Jun 2019 20:24:42 -0000 Author: mav Date: Mon Jun 3 20:24:40 2019 New Revision: 348579 URL: https://svnweb.freebsd.org/changeset/base/348579 Log: MFV r348578: 9962 zil_commit should omit cache thrash illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d Reviewed by: Matt Ahrens Reviewed by: Brad Lewis Reviewed by: Patrick Mooney Reviewed by: Jerry Jelinek Approved by: Joshua M. Clulow Author: Prakash Surya Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun 3 20:18:02 2019 (r348578) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun 3 20:24:40 2019 (r348579) @@ -1933,6 +1933,7 @@ zil_replay_func_t *ztest_replay_vector[TX_MAX_TYPE] = * ZIL get_data callbacks */ +/* ARGSUSED */ static void ztest_get_done(zgd_t *zgd, int error) { @@ -1944,9 +1945,6 @@ ztest_get_done(zgd_t *zgd, int error) ztest_range_unlock(zgd->zgd_rl); ztest_object_unlock(zd, object); - - if (error == 0 && zgd->zgd_bp) - zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); umem_free(zgd, sizeof (*zgd)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Jun 3 20:18:02 2019 (r348578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Jun 3 20:24:40 2019 (r348579) @@ -1982,7 +1982,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf, void *varg) dmu_sync_arg_t *dsa = varg; dbuf_dirty_record_t *dr = dsa->dsa_dr; dmu_buf_impl_t *db = dr->dr_dbuf; + zgd_t *zgd = dsa->dsa_zgd; + /* + * Record the vdev(s) backing this blkptr so they can be flushed after + * the writes for the lwb have completed. + */ + if (zio->io_error == 0) { + zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); + } + mutex_enter(&db->db_mtx); ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC); if (zio->io_error == 0) { @@ -2032,13 +2041,22 @@ dmu_sync_late_arrival_done(zio_t *zio) blkptr_t *bp = zio->io_bp; dmu_sync_arg_t *dsa = zio->io_private; blkptr_t *bp_orig = &zio->io_bp_orig; + zgd_t *zgd = dsa->dsa_zgd; - if (zio->io_error == 0 && !BP_IS_HOLE(bp)) { - ASSERT(!(zio->io_flags & ZIO_FLAG_NOPWRITE)); - ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); - ASSERT(zio->io_bp->blk_birth == zio->io_txg); - ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); - zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + if (zio->io_error == 0) { + /* + * Record the vdev(s) backing this blkptr so they can be + * flushed after the writes for the lwb have completed. + */ + zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); + + if (!BP_IS_HOLE(bp)) { + ASSERT(!(zio->io_flags & ZIO_FLAG_NOPWRITE)); + ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_bp->blk_birth == zio->io_txg); + ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); + zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + } } dmu_tx_commit(dsa->dsa_tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Mon Jun 3 20:18:02 2019 (r348578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Mon Jun 3 20:24:40 2019 (r348579) @@ -48,10 +48,11 @@ extern "C" { * via zil_lwb_write_issue(). Again, the zilog's "zl_issuer_lock" must * be held when making this transition. * - * After the lwb's zio completes, and the vdev's are flushed, the lwb - * will transition into the "done" state via zil_lwb_write_done(). When - * transitioning from "issued" to "done", the zilog's "zl_lock" must be - * held, *not* the "zl_issuer_lock". + * After the lwb's write zio completes, it transitions into the "write + * done" state via zil_lwb_write_done(); and then into the "flush done" + * state via zil_lwb_flush_vdevs_done(). When transitioning from + * "issued" to "write done", and then from "write done" to "flush done", + * the zilog's "zl_lock" must be held, *not* the "zl_issuer_lock". * * The zilog's "zl_issuer_lock" can become heavily contended in certain * workloads, so we specifically avoid acquiring that lock when @@ -68,13 +69,14 @@ extern "C" { * "zl_issuer_lock" will prevent a concurrent thread from transitioning * that lwb to the "issued" state. Likewise, if an lwb is already in the * "issued" state, holding the "zl_lock" will prevent a concurrent - * thread from transitioning that lwb to the "done" state. + * thread from transitioning that lwb to the "write done" state. */ typedef enum { LWB_STATE_CLOSED, LWB_STATE_OPENED, LWB_STATE_ISSUED, - LWB_STATE_DONE, + LWB_STATE_WRITE_DONE, + LWB_STATE_FLUSH_DONE, LWB_NUM_STATES } lwb_state_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 3 20:18:02 2019 (r348578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 3 20:24:40 2019 (r348579) @@ -1244,6 +1244,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t return (0); } +/* ARGSUSED */ void zfs_get_done(zgd_t *zgd, int error) { @@ -1261,9 +1262,6 @@ zfs_get_done(zgd_t *zgd, int error) */ VN_RELE_ASYNC(ZTOV(zp), dsl_pool_vnrele_taskq(dmu_objset_pool(os))); - if (error == 0 && zgd->zgd_bp) - zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); - kmem_free(zgd, sizeof (zgd_t)); } @@ -1387,11 +1385,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, str * TX_WRITE2 relies on the data previously * written by the TX_WRITE that caused * EALREADY. We zero out the BP because - * it is the old, currently-on-disk BP, - * so there's no need to zio_flush() its - * vdevs (flushing would needlesly hurt - * performance, and doesn't work on - * indirect vdevs). + * it is the old, currently-on-disk BP. */ zgd->zgd_bp = NULL; BP_ZERO(bp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Jun 3 20:18:02 2019 (r348578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Jun 3 20:24:40 2019 (r348579) @@ -548,7 +548,7 @@ zil_free_lwb(zilog_t *zilog, lwb_t *lwb) ASSERT3P(lwb->lwb_root_zio, ==, NULL); ASSERT3U(lwb->lwb_max_txg, <=, spa_syncing_txg(zilog->zl_spa)); ASSERT(lwb->lwb_state == LWB_STATE_CLOSED || - lwb->lwb_state == LWB_STATE_DONE); + lwb->lwb_state == LWB_STATE_FLUSH_DONE); /* * Clear the zilog's field to indicate this lwb is no longer @@ -960,7 +960,8 @@ zil_commit_waiter_link_lwb(zil_commit_waiter_t *zcw, l ASSERT3P(zcw->zcw_lwb, ==, NULL); ASSERT3P(lwb, !=, NULL); ASSERT(lwb->lwb_state == LWB_STATE_OPENED || - lwb->lwb_state == LWB_STATE_ISSUED); + lwb->lwb_state == LWB_STATE_ISSUED || + lwb->lwb_state == LWB_STATE_WRITE_DONE); list_insert_tail(&lwb->lwb_waiters, zcw); zcw->zcw_lwb = lwb; @@ -1006,6 +1007,42 @@ zil_lwb_add_block(lwb_t *lwb, const blkptr_t *bp) mutex_exit(&lwb->lwb_vdev_lock); } +static void +zil_lwb_flush_defer(lwb_t *lwb, lwb_t *nlwb) +{ + avl_tree_t *src = &lwb->lwb_vdev_tree; + avl_tree_t *dst = &nlwb->lwb_vdev_tree; + void *cookie = NULL; + zil_vdev_node_t *zv; + + ASSERT3S(lwb->lwb_state, ==, LWB_STATE_WRITE_DONE); + ASSERT3S(nlwb->lwb_state, !=, LWB_STATE_WRITE_DONE); + ASSERT3S(nlwb->lwb_state, !=, LWB_STATE_FLUSH_DONE); + + /* + * While 'lwb' is at a point in its lifetime where lwb_vdev_tree does + * not need the protection of lwb_vdev_lock (it will only be modified + * while holding zilog->zl_lock) as its writes and those of its + * children have all completed. The younger 'nlwb' may be waiting on + * future writes to additional vdevs. + */ + mutex_enter(&nlwb->lwb_vdev_lock); + /* + * Tear down the 'lwb' vdev tree, ensuring that entries which do not + * exist in 'nlwb' are moved to it, freeing any would-be duplicates. + */ + while ((zv = avl_destroy_nodes(src, &cookie)) != NULL) { + avl_index_t where; + + if (avl_find(dst, zv, &where) == NULL) { + avl_insert(dst, zv, where); + } else { + kmem_free(zv, sizeof (*zv)); + } + } + mutex_exit(&nlwb->lwb_vdev_lock); +} + void zil_lwb_add_txg(lwb_t *lwb, uint64_t txg) { @@ -1013,9 +1050,13 @@ zil_lwb_add_txg(lwb_t *lwb, uint64_t txg) } /* - * This function is a called after all VDEVs associated with a given lwb + * This function is a called after all vdevs associated with a given lwb * write have completed their DKIOCFLUSHWRITECACHE command; or as soon - * as the lwb write completes, if "zil_nocacheflush" is set. + * as the lwb write completes, if "zil_nocacheflush" is set. Further, + * all "previous" lwb's will have completed before this function is + * called; i.e. this function is called for all previous lwbs before + * it's called for "this" lwb (enforced via zio the dependencies + * configured in zil_lwb_set_zio_dependency()). * * The intention is for this function to be called as soon as the * contents of an lwb are considered "stable" on disk, and will survive @@ -1052,8 +1093,10 @@ zil_lwb_flush_vdevs_done(zio_t *zio) zilog->zl_last_lwb_latency = gethrtime() - lwb->lwb_issued_timestamp; lwb->lwb_root_zio = NULL; - lwb->lwb_state = LWB_STATE_DONE; + ASSERT3S(lwb->lwb_state, ==, LWB_STATE_WRITE_DONE); + lwb->lwb_state = LWB_STATE_FLUSH_DONE; + if (zilog->zl_last_lwb_opened == lwb) { /* * Remember the highest committed log sequence number @@ -1093,14 +1136,17 @@ zil_lwb_flush_vdevs_done(zio_t *zio) } /* - * This is called when an lwb write completes. This means, this specific - * lwb was written to disk, and all dependent lwb have also been - * written to disk. - * - * At this point, a DKIOCFLUSHWRITECACHE command hasn't been issued to - * the VDEVs involved in writing out this specific lwb. The lwb will be - * "done" once zil_lwb_flush_vdevs_done() is called, which occurs in the - * zio completion callback for the lwb's root zio. + * This is called when an lwb's write zio completes. The callback's + * purpose is to issue the DKIOCFLUSHWRITECACHE commands for the vdevs + * in the lwb's lwb_vdev_tree. The tree will contain the vdevs involved + * in writing out this specific lwb's data, and in the case that cache + * flushes have been deferred, vdevs involved in writing the data for + * previous lwbs. The writes corresponding to all the vdevs in the + * lwb_vdev_tree will have completed by the time this is called, due to + * the zio dependencies configured in zil_lwb_set_zio_dependency(), + * which takes deferred flushes into account. The lwb will be "done" + * once zil_lwb_flush_vdevs_done() is called, which occurs in the zio + * completion callback for the lwb's root zio. */ static void zil_lwb_write_done(zio_t *zio) @@ -1111,6 +1157,7 @@ zil_lwb_write_done(zio_t *zio) avl_tree_t *t = &lwb->lwb_vdev_tree; void *cookie = NULL; zil_vdev_node_t *zv; + lwb_t *nlwb; ASSERT3S(spa_config_held(spa, SCL_STATE, RW_READER), !=, 0); @@ -1124,10 +1171,11 @@ zil_lwb_write_done(zio_t *zio) abd_put(zio->io_abd); - ASSERT3S(lwb->lwb_state, ==, LWB_STATE_ISSUED); - mutex_enter(&zilog->zl_lock); + ASSERT3S(lwb->lwb_state, ==, LWB_STATE_ISSUED); + lwb->lwb_state = LWB_STATE_WRITE_DONE; lwb->lwb_write_zio = NULL; + nlwb = list_next(&zilog->zl_lwb_list, lwb); mutex_exit(&zilog->zl_lock); if (avl_numnodes(t) == 0) @@ -1146,6 +1194,27 @@ zil_lwb_write_done(zio_t *zio) return; } + /* + * If this lwb does not have any threads waiting for it to + * complete, we want to defer issuing the DKIOCFLUSHWRITECACHE + * command to the vdevs written to by "this" lwb, and instead + * rely on the "next" lwb to handle the DKIOCFLUSHWRITECACHE + * command for those vdevs. Thus, we merge the vdev tree of + * "this" lwb with the vdev tree of the "next" lwb in the list, + * and assume the "next" lwb will handle flushing the vdevs (or + * deferring the flush(s) again). + * + * This is a useful performance optimization, especially for + * workloads with lots of async write activity and few sync + * write and/or fsync activity, as it has the potential to + * coalesce multiple flush commands to a vdev into one. + */ + if (list_head(&lwb->lwb_waiters) == NULL && nlwb != NULL) { + zil_lwb_flush_defer(lwb, nlwb); + ASSERT(avl_is_empty(&lwb->lwb_vdev_tree)); + return; + } + while ((zv = avl_destroy_nodes(t, &cookie)) != NULL) { vdev_t *vd = vdev_lookup_top(spa, zv->zv_vdev); if (vd != NULL) @@ -1154,6 +1223,73 @@ zil_lwb_write_done(zio_t *zio) } } +static void +zil_lwb_set_zio_dependency(zilog_t *zilog, lwb_t *lwb) +{ + lwb_t *last_lwb_opened = zilog->zl_last_lwb_opened; + + ASSERT(MUTEX_HELD(&zilog->zl_issuer_lock)); + ASSERT(MUTEX_HELD(&zilog->zl_lock)); + + /* + * The zilog's "zl_last_lwb_opened" field is used to build the + * lwb/zio dependency chain, which is used to preserve the + * ordering of lwb completions that is required by the semantics + * of the ZIL. Each new lwb zio becomes a parent of the + * "previous" lwb zio, such that the new lwb's zio cannot + * complete until the "previous" lwb's zio completes. + * + * This is required by the semantics of zil_commit(); the commit + * waiters attached to the lwbs will be woken in the lwb zio's + * completion callback, so this zio dependency graph ensures the + * waiters are woken in the correct order (the same order the + * lwbs were created). + */ + if (last_lwb_opened != NULL && + last_lwb_opened->lwb_state != LWB_STATE_FLUSH_DONE) { + ASSERT(last_lwb_opened->lwb_state == LWB_STATE_OPENED || + last_lwb_opened->lwb_state == LWB_STATE_ISSUED || + last_lwb_opened->lwb_state == LWB_STATE_WRITE_DONE); + + ASSERT3P(last_lwb_opened->lwb_root_zio, !=, NULL); + zio_add_child(lwb->lwb_root_zio, + last_lwb_opened->lwb_root_zio); + + /* + * If the previous lwb's write hasn't already completed, + * we also want to order the completion of the lwb write + * zios (above, we only order the completion of the lwb + * root zios). This is required because of how we can + * defer the DKIOCFLUSHWRITECACHE commands for each lwb. + * + * When the DKIOCFLUSHWRITECACHE commands are defered, + * the previous lwb will rely on this lwb to flush the + * vdevs written to by that previous lwb. Thus, we need + * to ensure this lwb doesn't issue the flush until + * after the previous lwb's write completes. We ensure + * this ordering by setting the zio parent/child + * relationship here. + * + * Without this relationship on the lwb's write zio, + * it's possible for this lwb's write to complete prior + * to the previous lwb's write completing; and thus, the + * vdevs for the previous lwb would be flushed prior to + * that lwb's data being written to those vdevs (the + * vdevs are flushed in the lwb write zio's completion + * handler, zil_lwb_write_done()). + */ + if (last_lwb_opened->lwb_state != LWB_STATE_WRITE_DONE) { + ASSERT(last_lwb_opened->lwb_state == LWB_STATE_OPENED || + last_lwb_opened->lwb_state == LWB_STATE_ISSUED); + + ASSERT3P(last_lwb_opened->lwb_write_zio, !=, NULL); + zio_add_child(lwb->lwb_write_zio, + last_lwb_opened->lwb_write_zio); + } + } +} + + /* * This function's purpose is to "open" an lwb such that it is ready to * accept new itxs being committed to it. To do this, the lwb's zio @@ -1198,33 +1334,8 @@ zil_lwb_write_open(zilog_t *zilog, lwb_t *lwb) lwb->lwb_state = LWB_STATE_OPENED; mutex_enter(&zilog->zl_lock); - - /* - * The zilog's "zl_last_lwb_opened" field is used to - * build the lwb/zio dependency chain, which is used to - * preserve the ordering of lwb completions that is - * required by the semantics of the ZIL. Each new lwb - * zio becomes a parent of the "previous" lwb zio, such - * that the new lwb's zio cannot complete until the - * "previous" lwb's zio completes. - * - * This is required by the semantics of zil_commit(); - * the commit waiters attached to the lwbs will be woken - * in the lwb zio's completion callback, so this zio - * dependency graph ensures the waiters are woken in the - * correct order (the same order the lwbs were created). - */ - lwb_t *last_lwb_opened = zilog->zl_last_lwb_opened; - if (last_lwb_opened != NULL && - last_lwb_opened->lwb_state != LWB_STATE_DONE) { - ASSERT(last_lwb_opened->lwb_state == LWB_STATE_OPENED || - last_lwb_opened->lwb_state == LWB_STATE_ISSUED); - ASSERT3P(last_lwb_opened->lwb_root_zio, !=, NULL); - zio_add_child(lwb->lwb_root_zio, - last_lwb_opened->lwb_root_zio); - } + zil_lwb_set_zio_dependency(zilog, lwb); zilog->zl_last_lwb_opened = lwb; - mutex_exit(&zilog->zl_lock); } @@ -1921,7 +2032,8 @@ zil_prune_commit_list(zilog_t *zilog) mutex_enter(&zilog->zl_lock); lwb_t *last_lwb = zilog->zl_last_lwb_opened; - if (last_lwb == NULL || last_lwb->lwb_state == LWB_STATE_DONE) { + if (last_lwb == NULL || + last_lwb->lwb_state == LWB_STATE_FLUSH_DONE) { /* * All of the itxs this waiter was waiting on * must have already completed (or there were @@ -2002,7 +2114,8 @@ zil_process_commit_list(zilog_t *zilog) lwb = zil_create(zilog); } else { ASSERT3S(lwb->lwb_state, !=, LWB_STATE_ISSUED); - ASSERT3S(lwb->lwb_state, !=, LWB_STATE_DONE); + ASSERT3S(lwb->lwb_state, !=, LWB_STATE_WRITE_DONE); + ASSERT3S(lwb->lwb_state, !=, LWB_STATE_FLUSH_DONE); } while (itx = list_head(&zilog->zl_itx_commit_list)) { @@ -2104,7 +2217,8 @@ zil_process_commit_list(zilog_t *zilog) ASSERT(list_is_empty(&nolwb_waiters)); ASSERT3P(lwb, !=, NULL); ASSERT3S(lwb->lwb_state, !=, LWB_STATE_ISSUED); - ASSERT3S(lwb->lwb_state, !=, LWB_STATE_DONE); + ASSERT3S(lwb->lwb_state, !=, LWB_STATE_WRITE_DONE); + ASSERT3S(lwb->lwb_state, !=, LWB_STATE_FLUSH_DONE); /* * At this point, the ZIL block pointed at by the "lwb" @@ -2225,7 +2339,8 @@ zil_commit_waiter_timeout(zilog_t *zilog, zil_commit_w * acquiring it when it's not necessary to do so. */ if (lwb->lwb_state == LWB_STATE_ISSUED || - lwb->lwb_state == LWB_STATE_DONE) + lwb->lwb_state == LWB_STATE_WRITE_DONE || + lwb->lwb_state == LWB_STATE_FLUSH_DONE) return; /* @@ -2273,7 +2388,8 @@ zil_commit_waiter_timeout(zilog_t *zilog, zil_commit_w * more details on the lwb states, and locking requirements. */ if (lwb->lwb_state == LWB_STATE_ISSUED || - lwb->lwb_state == LWB_STATE_DONE) + lwb->lwb_state == LWB_STATE_WRITE_DONE || + lwb->lwb_state == LWB_STATE_FLUSH_DONE) goto out; ASSERT3S(lwb->lwb_state, ==, LWB_STATE_OPENED); @@ -2458,7 +2574,8 @@ zil_commit_waiter(zilog_t *zilog, zil_commit_waiter_t IMPLY(lwb != NULL, lwb->lwb_state == LWB_STATE_ISSUED || - lwb->lwb_state == LWB_STATE_DONE); + lwb->lwb_state == LWB_STATE_WRITE_DONE || + lwb->lwb_state == LWB_STATE_FLUSH_DONE); cv_wait(&zcw->zcw_cv, &zcw->zcw_lock); } } @@ -3099,13 +3216,13 @@ zil_suspend(const char *osname, void **cookiep) * to disk before proceeding. If we used zil_commit instead, it * would just call txg_wait_synced(), because zl_suspend is set. * txg_wait_synced() doesn't wait for these lwb's to be - * LWB_STATE_DONE before returning. + * LWB_STATE_FLUSH_DONE before returning. */ zil_commit_impl(zilog, 0); /* - * Now that we've ensured all lwb's are LWB_STATE_DONE, we use - * txg_wait_synced() to ensure the data from the zilog has + * Now that we've ensured all lwb's are LWB_STATE_FLUSH_DONE, we + * use txg_wait_synced() to ensure the data from the zilog has * migrated to the main pool before calling zil_destroy(). */ txg_wait_synced(zilog->zl_dmu_pool, 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Jun 3 20:18:02 2019 (r348578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Jun 3 20:24:40 2019 (r348579) @@ -1321,6 +1321,7 @@ zvol_close(struct g_provider *pp, int flag, int count) return (error); } +/* ARGSUSED */ static void zvol_get_done(zgd_t *zgd, int error) { @@ -1328,9 +1329,6 @@ zvol_get_done(zgd_t *zgd, int error) dmu_buf_rele(zgd->zgd_db, zgd); zfs_range_unlock(zgd->zgd_rl); - - if (error == 0 && zgd->zgd_bp) - zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); kmem_free(zgd, sizeof (zgd_t)); } From owner-svn-src-head@freebsd.org Mon Jun 3 20:40: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 BC44015BD514; Mon, 3 Jun 2019 20:40: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 5AB0A6E750; Mon, 3 Jun 2019 20:40: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 35E04B481; Mon, 3 Jun 2019 20:40: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 x53KeXAo039800; Mon, 3 Jun 2019 20:40:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KeXIF039799; Mon, 3 Jun 2019 20:40:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032040.x53KeXIF039799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 20:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348581 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 348581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AB0A6E750 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-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: Mon, 03 Jun 2019 20:40:34 -0000 Author: mav Date: Mon Jun 3 20:40:32 2019 New Revision: 348581 URL: https://svnweb.freebsd.org/changeset/base/348581 Log: MFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b Reviewed by: Joshua M. Clulow Approved by: Richard Lowe Author: Paul Dagnelie Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Jun 3 20:39:13 2019 (r348580) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Jun 3 20:40:32 2019 (r348581) @@ -22,7 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2015, 2017 by Delphix. All rights reserved. + * Copyright (c) 2015, 2018 by Delphix. All rights reserved. * Copyright 2016 Joyent, Inc. * Copyright 2016 Igor Kozhukhov */ @@ -47,7 +47,7 @@ #include "libzfs_impl.h" #define ZDIFF_SNAPDIR "/.zfs/snapshot/" -#define ZDIFF_SHARESDIR "/.zfs/shares/" +#define ZDIFF_SHARESDIR "/.zfs/shares/" #define ZDIFF_PREFIX "zfs-diff-%d" #define ZDIFF_ADDED '+' @@ -361,12 +361,12 @@ describe_free(FILE *fp, differ_info_t *di, uint64_t ob if (get_stats_for_obj(di, di->fromsnap, object, namebuf, maxlen, &sb) != 0) { - /* Let it slide, if in the delete queue on from side */ - if (di->zerr == ENOENT && sb.zs_links == 0) { - di->zerr = 0; - return (0); - } return (-1); + } + /* Don't print if in the delete queue on from side */ + if (di->zerr == ESTALE) { + di->zerr = 0; + return (0); } print_file(fp, di, ZDIFF_REMOVED, namebuf, &sb); From owner-svn-src-head@freebsd.org Mon Jun 3 20:49: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 8BAC515BD972; Mon, 3 Jun 2019 20:49:21 +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 2FEEB6EF95; Mon, 3 Jun 2019 20:49:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20DC8B63B; Mon, 3 Jun 2019 20:49:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53KnLvt045155; Mon, 3 Jun 2019 20:49:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KnK5s045153; Mon, 3 Jun 2019 20:49:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032049.x53KnK5s045153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 20:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348584 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FEEB6EF95 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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, 03 Jun 2019 20:49:21 -0000 Author: mav Date: Mon Jun 3 20:49:20 2019 New Revision: 348584 URL: https://svnweb.freebsd.org/changeset/base/348584 Log: MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3 Reviewed by: George Wilson Reviewed by: Serapheim Dimitropoulos Reviewed by: Brian Behlendorf Approved by: Richard Lowe Author: Matthew Ahrens Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 3 20:45:48 2019 (r348583) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 3 20:49:20 2019 (r348584) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #undef verify @@ -111,6 +112,7 @@ static uint64_t max_inflight = 1000; static int leaked_objects = 0; static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *); +static void mos_obj_refd(uint64_t); /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -1592,6 +1594,8 @@ dump_dsl_dir(objset_t *os, uint64_t object, void *data DO(CHILD_RSRV); DO(REFRSRV); #undef DO + (void) printf("\t\tclones = %llu\n", + (u_longlong_t)dd->dd_clones); } /*ARGSUSED*/ @@ -1774,6 +1778,33 @@ dump_full_bpobj(bpobj_t *bpo, const char *name, int in } static void +bpobj_count_refd(bpobj_t *bpo) +{ + mos_obj_refd(bpo->bpo_object); + + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { + mos_obj_refd(bpo->bpo_phys->bpo_subobjs); + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + bpobj_count_refd(&subbpo); + bpobj_close(&subbpo); + } + } +} + +static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; @@ -1781,7 +1812,24 @@ dump_deadlist(dsl_deadlist_t *dl) char bytes[32]; char comp[32]; char uncomp[32]; + uint64_t empty_bpobj = + dmu_objset_spa(dl->dl_os)->spa_dsl_pool->dp_empty_bpobj; + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + + if (dl->dl_oldfmt) { + if (dl->dl_bpobj.bpo_object != empty_bpobj) + bpobj_count_refd(&dl->dl_bpobj); + } else { + mos_obj_refd(dl->dl_object); + for (dle = avl_first(&dl->dl_tree); dle; + dle = AVL_NEXT(&dl->dl_tree, dle)) { + if (dle->dle_bpobj.bpo_object != empty_bpobj) + bpobj_count_refd(&dle->dle_bpobj); + } + } + /* make sure nicenum has enough space */ CTASSERT(sizeof (bytes) >= NN_NUMBUF_SZ); CTASSERT(sizeof (comp) >= NN_NUMBUF_SZ); @@ -1806,9 +1854,6 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); - /* force the tree to be loaded */ - dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); - for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { if (dump_opt['d'] >= 5) { @@ -2219,6 +2264,30 @@ dump_object(objset_t *os, uint64_t object, int verbosi dmu_buf_rele(db, FTAG); } +static void +count_dir_mos_objects(dsl_dir_t *dd) +{ + mos_obj_refd(dd->dd_object); + mos_obj_refd(dsl_dir_phys(dd)->dd_child_dir_zapobj); + mos_obj_refd(dsl_dir_phys(dd)->dd_deleg_zapobj); + mos_obj_refd(dsl_dir_phys(dd)->dd_props_zapobj); + mos_obj_refd(dsl_dir_phys(dd)->dd_clones); +} + +static void +count_ds_mos_objects(dsl_dataset_t *ds) +{ + mos_obj_refd(ds->ds_object); + mos_obj_refd(dsl_dataset_phys(ds)->ds_next_clones_obj); + mos_obj_refd(dsl_dataset_phys(ds)->ds_props_obj); + mos_obj_refd(dsl_dataset_phys(ds)->ds_userrefs_obj); + mos_obj_refd(dsl_dataset_phys(ds)->ds_snapnames_zapobj); + + if (!dsl_dataset_is_snapshot(ds)) { + count_dir_mos_objects(ds->ds_dir); + } +} + static const char *objset_types[DMU_OST_NUMTYPES] = { "NONE", "META", "ZPL", "ZVOL", "OTHER", "ANY" }; @@ -2296,6 +2365,7 @@ dump_dir(objset_t *os) (void) printf("ds_remap_deadlist:\n"); dump_deadlist(&ds->ds_remap_deadlist); } + count_ds_mos_objects(ds); } if (verbosity < 2) @@ -4460,7 +4530,162 @@ verify_checkpoint(spa_t *spa) return (error); } +/* ARGSUSED */ static void +mos_leaks_cb(void *arg, uint64_t start, uint64_t size) +{ + for (uint64_t i = start; i < size; i++) { + (void) printf("MOS object %llu referenced but not allocated\n", + (u_longlong_t)i); + } +} + +static range_tree_t *mos_refd_objs; + +static void +mos_obj_refd(uint64_t obj) +{ + if (obj != 0 && mos_refd_objs != NULL) + range_tree_add(mos_refd_objs, obj, 1); +} + +static void +mos_leak_vdev(vdev_t *vd) +{ + mos_obj_refd(vd->vdev_dtl_object); + mos_obj_refd(vd->vdev_ms_array); + mos_obj_refd(vd->vdev_top_zap); + mos_obj_refd(vd->vdev_indirect_config.vic_births_object); + mos_obj_refd(vd->vdev_indirect_config.vic_mapping_object); + mos_obj_refd(vd->vdev_leaf_zap); + if (vd->vdev_checkpoint_sm != NULL) + mos_obj_refd(vd->vdev_checkpoint_sm->sm_object); + if (vd->vdev_indirect_mapping != NULL) { + mos_obj_refd(vd->vdev_indirect_mapping-> + vim_phys->vimp_counts_object); + } + if (vd->vdev_obsolete_sm != NULL) + mos_obj_refd(vd->vdev_obsolete_sm->sm_object); + + for (uint64_t m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *ms = vd->vdev_ms[m]; + mos_obj_refd(space_map_object(ms->ms_sm)); + } + + for (uint64_t c = 0; c < vd->vdev_children; c++) { + mos_leak_vdev(vd->vdev_child[c]); + } +} + +static int +dump_mos_leaks(spa_t *spa) +{ + int rv = 0; + objset_t *mos = spa->spa_meta_objset; + dsl_pool_t *dp = spa->spa_dsl_pool; + + /* Visit and mark all referenced objects in the MOS */ + + mos_obj_refd(DMU_POOL_DIRECTORY_OBJECT); + mos_obj_refd(spa->spa_pool_props_object); + mos_obj_refd(spa->spa_config_object); + mos_obj_refd(spa->spa_ddt_stat_object); + mos_obj_refd(spa->spa_feat_desc_obj); + mos_obj_refd(spa->spa_feat_enabled_txg_obj); + mos_obj_refd(spa->spa_feat_for_read_obj); + mos_obj_refd(spa->spa_feat_for_write_obj); + mos_obj_refd(spa->spa_history); + mos_obj_refd(spa->spa_errlog_last); + mos_obj_refd(spa->spa_errlog_scrub); + mos_obj_refd(spa->spa_all_vdev_zaps); + mos_obj_refd(spa->spa_dsl_pool->dp_bptree_obj); + mos_obj_refd(spa->spa_dsl_pool->dp_tmp_userrefs_obj); + mos_obj_refd(spa->spa_dsl_pool->dp_scan->scn_phys.scn_queue_obj); + bpobj_count_refd(&spa->spa_deferred_bpobj); + mos_obj_refd(dp->dp_empty_bpobj); + bpobj_count_refd(&dp->dp_obsolete_bpobj); + bpobj_count_refd(&dp->dp_free_bpobj); + mos_obj_refd(spa->spa_l2cache.sav_object); + mos_obj_refd(spa->spa_spares.sav_object); + + mos_obj_refd(spa->spa_condensing_indirect_phys. + scip_next_mapping_object); + mos_obj_refd(spa->spa_condensing_indirect_phys. + scip_prev_obsolete_sm_object); + if (spa->spa_condensing_indirect_phys.scip_next_mapping_object != 0) { + vdev_indirect_mapping_t *vim = + vdev_indirect_mapping_open(mos, + spa->spa_condensing_indirect_phys.scip_next_mapping_object); + mos_obj_refd(vim->vim_phys->vimp_counts_object); + vdev_indirect_mapping_close(vim); + } + + if (dp->dp_origin_snap != NULL) { + dsl_dataset_t *ds; + + dsl_pool_config_enter(dp, FTAG); + VERIFY0(dsl_dataset_hold_obj(dp, + dsl_dataset_phys(dp->dp_origin_snap)->ds_next_snap_obj, + FTAG, &ds)); + count_ds_mos_objects(ds); + dump_deadlist(&ds->ds_deadlist); + dsl_dataset_rele(ds, FTAG); + dsl_pool_config_exit(dp, FTAG); + + count_ds_mos_objects(dp->dp_origin_snap); + dump_deadlist(&dp->dp_origin_snap->ds_deadlist); + } + count_dir_mos_objects(dp->dp_mos_dir); + if (dp->dp_free_dir != NULL) + count_dir_mos_objects(dp->dp_free_dir); + if (dp->dp_leak_dir != NULL) + count_dir_mos_objects(dp->dp_leak_dir); + + mos_leak_vdev(spa->spa_root_vdev); + + for (uint64_t class = 0; class < DDT_CLASSES; class++) { + for (uint64_t type = 0; type < DDT_TYPES; type++) { + for (uint64_t cksum = 0; + cksum < ZIO_CHECKSUM_FUNCTIONS; cksum++) { + ddt_t *ddt = spa->spa_ddt[cksum]; + mos_obj_refd(ddt->ddt_object[type][class]); + } + } + } + + /* + * Visit all allocated objects and make sure they are referenced. + */ + uint64_t object = 0; + while (dmu_object_next(mos, &object, B_FALSE, 0) == 0) { + if (range_tree_contains(mos_refd_objs, object, 1)) { + range_tree_remove(mos_refd_objs, object, 1); + } else { + dmu_object_info_t doi; + const char *name; + dmu_object_info(mos, object, &doi); + if (doi.doi_type & DMU_OT_NEWTYPE) { + dmu_object_byteswap_t bswap = + DMU_OT_BYTESWAP(doi.doi_type); + name = dmu_ot_byteswap[bswap].ob_name; + } else { + name = dmu_ot[doi.doi_type].ot_name; + } + + (void) printf("MOS object %llu (%s) leaked\n", + (u_longlong_t)object, name); + rv = 2; + } + } + (void) range_tree_walk(mos_refd_objs, mos_leaks_cb, NULL); + if (!range_tree_is_empty(mos_refd_objs)) + rv = 2; + range_tree_vacate(mos_refd_objs, NULL, NULL); + range_tree_destroy(mos_refd_objs); + return (rv); +} + +static void dump_zpool(spa_t *spa) { dsl_pool_t *dp = spa_get_dsl(spa); @@ -4491,7 +4716,9 @@ dump_zpool(spa_t *spa) dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { + mos_refd_objs = range_tree_create(NULL, NULL); dump_dir(dp->dp_meta_objset); + if (dump_opt['d'] >= 3) { dsl_pool_t *dp = spa->spa_dsl_pool; dump_full_bpobj(&spa->spa_deferred_bpobj, @@ -4518,6 +4745,9 @@ dump_zpool(spa_t *spa) (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); + if (rc == 0 && !dump_opt['L']) + rc = dump_mos_leaks(spa); + for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { uint64_t refcount; @@ -4547,6 +4777,7 @@ dump_zpool(spa_t *spa) rc = verify_device_removal_feature_counts(spa); } } + if (rc == 0 && (dump_opt['b'] || dump_opt['c'])) rc = dump_block_stats(spa); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Jun 3 20:45:48 2019 (r348583) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Jun 3 20:49:20 2019 (r348584) @@ -786,6 +786,8 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu_tx_t *tx) VERIFY0(zap_destroy(mos, dsl_dir_phys(dd)->dd_child_dir_zapobj, tx)); VERIFY0(zap_destroy(mos, dsl_dir_phys(dd)->dd_props_zapobj, tx)); + if (dsl_dir_phys(dd)->dd_clones != 0) + VERIFY0(zap_destroy(mos, dsl_dir_phys(dd)->dd_clones, tx)); VERIFY0(dsl_deleg_destroy(mos, dsl_dir_phys(dd)->dd_deleg_zapobj, tx)); VERIFY0(zap_remove(mos, dsl_dir_phys(dd->dd_parent)->dd_child_dir_zapobj, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c Mon Jun 3 20:45:48 2019 (r348583) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c Mon Jun 3 20:49:20 2019 (r348584) @@ -279,7 +279,6 @@ vdev_indirect_mapping_entry_for_offset_or_next(vdev_in B_TRUE)); } - void vdev_indirect_mapping_close(vdev_indirect_mapping_t *vim) { From owner-svn-src-head@freebsd.org Mon Jun 3 20:55: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 0F5B215BDD2B; Mon, 3 Jun 2019 20:55:53 +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 A61486F5D5; Mon, 3 Jun 2019 20:55:52 +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 7F7A6B7DC; Mon, 3 Jun 2019 20:55:52 +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 x53Ktqq3050526; Mon, 3 Jun 2019 20:55:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KtqqX050525; Mon, 3 Jun 2019 20:55:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032055.x53KtqqX050525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 20:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348586 - 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: 348586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A61486F5D5 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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, 03 Jun 2019 20:55:53 -0000 Author: mav Date: Mon Jun 3 20:55:52 2019 New Revision: 348586 URL: https://svnweb.freebsd.org/changeset/base/348586 Log: MFV r348585: 9683 Allow bypassing devid in vdev_disk_open() illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb Reviewed by: Sara Hartse Reviewed by: George Wilson Approved by: Dan McDonald Author: Pavel Zakharov This is irrelevant to FreeBSD, just to reduce divergence. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 20:52:19 2019 (r348585) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 20:55:52 2019 (r348586) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -50,6 +50,21 @@ typedef struct vdev_disk_ldi_cb { ldi_callback_id_t lcb_id; } vdev_disk_ldi_cb_t; +/* + * Bypass the devid when opening a disk vdev. + * There have been issues where the devids of several devices were shuffled, + * causing pool open failures. Note, that this flag is intended to be used + * for pool recovery only. + * + * Note that if a pool is imported with the devids bypassed, all its vdevs will + * cease storing devid information permanently. In practice, the devid is rarely + * useful as vdev paths do not tend to change unless the hardware is + * reconfigured. That said, if the paths do change and a pool fails to open + * automatically at boot, a simple zpool import should re-scan the paths and fix + * the issue. + */ +boolean_t vdev_disk_bypass_devid = B_FALSE; + static void vdev_disk_alloc(vdev_t *vd) { @@ -306,6 +321,16 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t * dvd = vd->vdev_tsd; /* + * Allow bypassing the devid. + */ + if (vd->vdev_devid != NULL && vdev_disk_bypass_devid) { + vdev_dbgmsg(vd, "vdev_disk_open, devid %s bypassed", + vd->vdev_devid); + spa_strfree(vd->vdev_devid); + vd->vdev_devid = NULL; + } + + /* * When opening a disk device, we want to preserve the user's original * intent. We always want to open the device by the path the user gave * us, even if it is one of multiple paths to the save device. But we @@ -367,6 +392,19 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t * if (error == 0 && vd->vdev_devid != NULL && ldi_get_devid(dvd->vd_lh, &devid) == 0) { if (ddi_devid_compare(devid, dvd->vd_devid) != 0) { + /* + * A mismatch here is unexpected, log it. + */ + char *devid_str = ddi_devid_str_encode(devid, + dvd->vd_minor); + vdev_dbgmsg(vd, "vdev_disk_open: devid " + "mismatch: %s != %s", vd->vdev_devid, + devid_str); + cmn_err(CE_NOTE, "vdev_disk_open %s: devid " + "mismatch: %s != %s", vd->vdev_path, + vd->vdev_devid, devid_str); + ddi_devid_str_free(devid_str); + error = SET_ERROR(EINVAL); (void) ldi_close(dvd->vd_lh, spa_mode(spa), kcred); @@ -390,6 +428,10 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t * if (error != 0 && vd->vdev_devid != NULL) { error = ldi_open_by_devid(dvd->vd_devid, dvd->vd_minor, spa_mode(spa), kcred, &dvd->vd_lh, zfs_li); + if (error != 0) { + vdev_dbgmsg(vd, "Failed to open by devid (%s)", + vd->vdev_devid); + } } /* @@ -436,6 +478,9 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t * vd_devid = ddi_devid_str_encode(devid, dvd->vd_minor); vdev_dbgmsg(vd, "vdev_disk_open: update devid from " "'%s' to '%s'", vd->vdev_devid, vd_devid); + cmn_err(CE_NOTE, "vdev_disk_open %s: update devid " + "from '%s' to '%s'", vd->vdev_path != NULL ? + vd->vdev_path : "?", vd->vdev_devid, vd_devid); spa_strfree(vd->vdev_devid); vd->vdev_devid = spa_strdup(vd_devid); ddi_devid_str_free(vd_devid); From owner-svn-src-head@freebsd.org Mon Jun 3 21:29: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 4316415BE97C; Mon, 3 Jun 2019 21:29:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 C273A7097A; Mon, 3 Jun 2019 21:29:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd31.google.com with SMTP id h6so15625891ioh.3; Mon, 03 Jun 2019 14:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kCEqiCzh2f3a6M3pgFJ+jsxNS1agAngv8U1lJ2Tt8kQ=; b=UEr9t5y2D45mfmG4Ogm7fAH6dGjs6Ve6zEuE4l+Yfk9myjuXkhGFR3ze8DASr4IRNK I0heziF0+VIV6yeE9MbktcRef6X2nWFMVm1aFRAEb59zbnEqgoUjyBJjdw/N0itWGRor XFS8lVx0uALIhg0J7ViPiTTselU0DI89uZaEm08ojRqSsEVlqIOl0wnuttoL0MDuCPcP g6e9Fw8M9I5AGlBrHBQoTQqZihxgFEdmQ9vDFjqD/GBECdmqFG57YgsL3jQqAytqbz84 qLJAMwWHMxKSkEbF483ME6JwmHE5KF0eKyz2EklDnBwJoF3Kwn85UlF5ArEksgoUgPeW NnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=kCEqiCzh2f3a6M3pgFJ+jsxNS1agAngv8U1lJ2Tt8kQ=; b=iloti3cLz06lM/Hvj3446t2NU4H6roKJukl5kIb8uIHnENRv9/cmUQ++r2WdtsPtBI a5Gbzt7nz04xvTywrMMFUK5tvnKS3A3PPaXu16xtL/QGoVzWocjckrbmkj6+2T7io4Qy mDar66XYa5RP3KTpCchaGC1JoXWLA73a7z0H3Jez30LFkNn4xOBF3d/+QU5jCmWsdPQw tjSbH7xv6eXHqQgu3tDbfw5eE77L9HlBsDZNjWIkaXycJKU/lMW/XMIlx+r+yLm4e2+a Nb3JGhvw/qLqMpkD+57aPF/0ZTy89C57d2y+p1N8xfwZ1p+aX9c3YWZAn6bElj/9jvpB acvA== X-Gm-Message-State: APjAAAVrVQTQHF+TIAYx7KjSsJqmaViaJJm2bqQFnp8yifR8jLpf6HgD 0hTIoCtcgBuohbLCqBveDbkA/DAV X-Google-Smtp-Source: APXvYqyBj3aT6WMQlQQ/IYWtd2eqyQj1x2nOAfMSrf6/tUvYWuAd60IxJdcRKQhQadp33XtqVENDCg== X-Received: by 2002:a6b:4101:: with SMTP id n1mr18409533ioa.138.1559597347301; Mon, 03 Jun 2019 14:29:07 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id m7sm4189032ith.34.2019.06.03.14.29.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jun 2019 14:29:06 -0700 (PDT) Sender: Mark Johnston Date: Mon, 3 Jun 2019 17:29:04 -0400 From: Mark Johnston To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348532 - in head: . etc Message-ID: <20190603212904.GB54699@raichu> References: <201906031512.x53FCjHh066558@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906031512.x53FCjHh066558@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: C273A7097A 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.974,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, 03 Jun 2019 21:29:09 -0000 On Mon, Jun 03, 2019 at 03:12:45PM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Mon Jun 3 15:12:44 2019 > New Revision: 348532 > URL: https://svnweb.freebsd.org/changeset/base/348532 > > Log: > Leave mtree hardcoded for now. Reverting partially 348521 and also > the followup stopgap change, because I don't think it's a correct. I still > need to figure out where to stick it in. In cannot be in Makefile.inc1 > and it cannot be in etc/Makefile from the looks of it to avoid > chicken-and-egg problem. > > Modified: > head/Makefile.inc1 > head/etc/Makefile > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Mon Jun 3 15:10:37 2019 (r348531) > +++ head/Makefile.inc1 Mon Jun 3 15:12:44 2019 (r348532) > @@ -888,7 +888,7 @@ INSTALLFLAGS+= -h sha256 > .endif > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > -IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}" > +IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > .endif > > DESTDIR_MTREEFLAGS= -deU > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Mon Jun 3 15:10:37 2019 (r348531) > +++ head/etc/Makefile Mon Jun 3 15:12:44 2019 (r348532) > @@ -93,8 +93,6 @@ distribution: > .endif > .endif > > -MTREE_CMD?= mtree > - I don't see how this can be right. Nothing sets MTREE_CMD if !defined(DB_FROM_SRC) && !defined(NO_ROOT), so now a regular installworld fails for me: -------------------------------------------------------------- >>> Making hierarchy -------------------------------------------------------------- cd /usr/home/markj/src/freebsd-dev; make -f Makefile.inc1 LOCAL_MTREE= hierarchy [...] -deU -i -f /usr/home/markj/src/freebsd-dev/etc/mtree/BSD.root.dist -p / /tmp/install.ClQih1mt/sh: -deU: not found *** Error code 127 From owner-svn-src-head@freebsd.org Mon Jun 3 21:40: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 D8CEF15BED8E; Mon, 3 Jun 2019 21:40:43 +0000 (UTC) (envelope-from sobomax@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 7FA4070F4F; Mon, 3 Jun 2019 21:40:43 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5A78DC16D; Mon, 3 Jun 2019 21:40:43 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53LehDb071570; Mon, 3 Jun 2019 21:40:43 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Leh9Q071569; Mon, 3 Jun 2019 21:40:43 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201906032140.x53Leh9Q071569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 3 Jun 2019 21:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348589 - head/etc X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 348589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FA4070F4F 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)[-1.000,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: Mon, 03 Jun 2019 21:40:44 -0000 Author: sobomax Date: Mon Jun 3 21:40:42 2019 New Revision: 348589 URL: https://svnweb.freebsd.org/changeset/base/348589 Log: Put back MTREE_CMD here for now. Doh, not my day, perhaps. Reported by: markj, mav Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jun 3 21:04:23 2019 (r348588) +++ head/etc/Makefile Mon Jun 3 21:40:42 2019 (r348589) @@ -93,6 +93,8 @@ distribution: .endif .endif +MTREE_CMD?= mtree + MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ From owner-svn-src-head@freebsd.org Mon Jun 3 22:58: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 68C5C15C06AA; Mon, 3 Jun 2019 22:58:52 +0000 (UTC) (envelope-from rmacklem@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 1674873448; Mon, 3 Jun 2019 22:58:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C92CFCD8D; Mon, 3 Jun 2019 22:58:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53Mwpnb013052; Mon, 3 Jun 2019 22:58:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Mwp56013050; Mon, 3 Jun 2019 22:58:51 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906032258.x53Mwp56013050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 3 Jun 2019 22:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348590 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 348590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1674873448 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,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, 03 Jun 2019 22:58:52 -0000 Author: rmacklem Date: Mon Jun 3 22:58:51 2019 New Revision: 348590 URL: https://svnweb.freebsd.org/changeset/base/348590 Log: Modify mountd so that it incrementally updates the kernel exports upon a reload. Without this patch, mountd would delete/load all exports from the exports file(s) when it receives a SIGHUP. This works fine for small exports file(s), but can take several seconds to do when there are large numbers (10000+) of exported file systems. Most of this time is spent doing the system calls that delete/export each of these file systems. When the "-S" option has been specified (the default these days), the nfsd threads are suspended for several seconds while the reload is done. This patch changes mountd so that it only does system calls for file systems where the exports have been changed/added/deleted as compared to the exports done for the previous load/reload of the exports file(s). Basically, when SIGHUP is posted to mountd, it saves the exportlist structures from the previous load and creates a new set of structures from the current exports file(s). Then it compares the current with the previous and only does system calls for cases that have been changed/added/deleted. The nfsd threads do not need to be suspended until the comparison step is being done. This results in a suspension period of milliseconds for a server with 10000+ exported file systems. There is some code using a LOGDEBUG() macro that allow runtime debugging output via syslog(LOG_DEBUG,...) that can be enabled by creating a file called /var/log/mountd.debug. This code is expected to be replaced with code that uses dtrace by cy@ in the near future, once issues w.r.t. dtrace in stable/12 have been resolved. The patch should not change the usage of the exports file(s), but improves the performance of reloading large exports file(s) where there are only a small number of changes done to the file(s). Tested by: pen@lysator.liu.se PR: 237860 Reviewed by: kib MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20487 Modified: head/usr.sbin/mountd/mountd.c head/usr.sbin/mountd/pathnames.h Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Jun 3 21:40:42 2019 (r348589) +++ head/usr.sbin/mountd/mountd.c Mon Jun 3 22:58:51 2019 (r348590) @@ -120,6 +120,8 @@ struct exportlist { fsid_t ex_fs; char *ex_fsdir; char *ex_indexfile; + struct xucred ex_defanon; + int ex_defexflags; int ex_numsecflavors; int ex_secflavors[MAXSECFLAVORS]; int ex_defnumsecflavors; @@ -129,6 +131,9 @@ struct exportlist { }; /* ex_flag bits */ #define EX_LINKED 0x1 +#define EX_DONE 0x2 +#define EX_DEFSET 0x4 +#define EX_PUBLICFH 0x8 SLIST_HEAD(exportlisthead, exportlist); @@ -147,6 +152,9 @@ struct grouplist { int gr_type; union grouptypes gr_ptr; struct grouplist *gr_next; + struct xucred gr_anon; + int gr_exflags; + int gr_flag; int gr_numsecflavors; int gr_secflavors[MAXSECFLAVORS]; }; @@ -157,6 +165,9 @@ struct grouplist { #define GT_DEFAULT 0x3 #define GT_IGNORE 0x5 +/* Group flags */ +#define GR_FND 0x1 + struct hostlist { int ht_flag; /* Uses DP_xx bits */ struct grouplist *ht_grp; @@ -176,7 +187,8 @@ struct fhreturn { /* Global defs */ static char *add_expdir(struct dirlist **, char *, int); static void add_dlist(struct dirlist **, struct dirlist *, - struct grouplist *, int, struct exportlist *); + struct grouplist *, int, struct exportlist *, + struct xucred *, int); static void add_mlist(char *, char *); static int check_dirpath(char *); static int check_options(struct dirlist *); @@ -189,8 +201,9 @@ static void complete_service(struct netconfig *nconf, static void clearout_service(void); static void del_mlist(char *hostp, char *dirp); static struct dirlist *dirp_search(struct dirlist *, char *); +static int do_export_mount(struct exportlist *, struct statfs *); static int do_mount(struct exportlist *, struct grouplist *, int, - struct xucred *, char *, int, struct statfs *); + struct xucred *, char *, int, struct statfs *, int, int *); static int do_opt(char **, char **, struct exportlist *, struct grouplist *, int *, int *, struct xucred *); static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); @@ -199,10 +212,16 @@ static void free_dir(struct dirlist *); static void free_exp(struct exportlist *); static void free_grp(struct grouplist *); static void free_host(struct hostlist *); -static void get_exportlist(void); +static void free_v4rootexp(void); +static void get_exportlist_one(int); +static void get_exportlist(int); static void insert_exports(struct exportlist *, struct exportlisthead *); static void free_exports(struct exportlisthead *); -static void read_exportfile(void); +static void read_exportfile(int); +static int compare_nmount_exportlist(struct iovec *, int, char *); +static int compare_export(struct exportlist *, struct exportlist *); +static int compare_cred(struct xucred *, struct xucred *); +static int compare_secflavor(int *, int *, int); static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); @@ -212,7 +231,7 @@ static int get_net(char *, struct netmsk *, int); static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, - struct exportlist *, int); + struct exportlist *, int, struct xucred *, int); static void huphandler(int sig); static int makemask(struct sockaddr_storage *ssp, int bitlen); static void mntsrv(struct svc_req *, SVCXPRT *); @@ -237,6 +256,7 @@ static void terminate(int); #define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) static struct exportlisthead *exphead = NULL; +static struct exportlisthead *oldexphead = NULL; static int exphashsize = 0; static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; @@ -269,7 +289,9 @@ static int have_v6 = 1; static int v4root_phase = 0; static char v4root_dirpath[PATH_MAX + 1]; +static struct exportlist *v4root_ep = NULL; static int has_publicfh = 0; +static int has_set_publicfh = 0; static struct pidfh *pfh = NULL; /* Bits for opt_flags above */ @@ -293,6 +315,15 @@ static int debug = 0; #endif /* + * The LOGDEBUG() syslog() calls are always compiled into the daemon. + * To enable them, create a file at _PATH_MOUNTDDEBUG. This file can be empty. + * To disable the logging, just delete the file at _PATH_MOUNTDDEBUG. + */ +static int logdebug = 0; +#define LOGDEBUG(format, ...) \ + (logdebug ? syslog(LOG_DEBUG, format, ## __VA_ARGS__) : 0) + +/* * Similar to strsep(), but it allows for quoted strings * and escaped characters. * @@ -465,7 +496,7 @@ main(int argc, char **argv) openlog("mountd", LOG_PID, LOG_DAEMON); if (debug) warnx("getting export list"); - get_exportlist(); + get_exportlist(0); if (debug) warnx("getting mount list"); get_mountlist(); @@ -636,7 +667,7 @@ main(int argc, char **argv) /* Expand svc_run() here so that we can call get_exportlist(). */ for (;;) { if (got_sighup) { - get_exportlist(); + get_exportlist(1); got_sighup = 0; } readfds = svc_fdset; @@ -1426,10 +1457,10 @@ static FILE *exp_file; * Get the export list from one, currently open file */ static void -get_exportlist_one(void) +get_exportlist_one(int passno) { struct exportlist *ep; - struct grouplist *grp, *tgrp; + struct grouplist *grp, *tgrp, *savgrp; struct dirlist *dirhead; struct statfs fsb; struct xucred anon; @@ -1663,11 +1694,18 @@ get_exportlist_one(void) * Loop through hosts, pushing the exports into the kernel. * After loop, tgrp points to the start of the list and * grp points to the last entry in the list. + * Do not do the do_mount() for passno == 1, since the + * second pass will do it, as required. */ grp = tgrp; do { - if (do_mount(ep, grp, exflags, &anon, dirp, dirplen, - &fsb)) { + grp->gr_exflags = exflags; + grp->gr_anon = anon; + if (v4root_phase == 2 && passno == 0) + LOGDEBUG("do_mount v4root"); + if (passno == 0 && do_mount(ep, grp, exflags, &anon, + dirp, dirplen, &fsb, ep->ex_numsecflavors, + ep->ex_secflavors)) { getexp_err(ep, tgrp, NULL); goto nextline; } @@ -1678,9 +1716,32 @@ get_exportlist_one(void) */ if (v4root_phase > 0 && v4root_phase <= 2) { /* - * Since these structures aren't used by mountd, + * These structures are used for the "-I" reload, + * so save them for that case. Otherwise, just * free them up now. */ + if (passno == 1 && ep != NULL) { + savgrp = tgrp; + while (tgrp != NULL) { + /* + * Save the security flavors and exflags + * for this host set in the groups. + */ + tgrp->gr_numsecflavors = + ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(tgrp->gr_secflavors, + ep->ex_secflavors, + sizeof(ep->ex_secflavors)); + tgrp = tgrp->gr_next; + } + if (v4root_ep == NULL) { + v4root_ep = ep; + ep = NULL; /* Don't free below. */ + } + grp->gr_next = v4root_ep->ex_grphead; + v4root_ep->ex_grphead = savgrp; + } if (ep != NULL) free_exp(ep); while (tgrp != NULL) { @@ -1695,12 +1756,12 @@ get_exportlist_one(void) * Success. Update the data structures. */ if (has_host) { - hang_dirp(dirhead, tgrp, ep, opt_flags); + hang_dirp(dirhead, tgrp, ep, opt_flags, &anon, exflags); grp->gr_next = ep->ex_grphead; ep->ex_grphead = tgrp; } else { hang_dirp(dirhead, (struct grouplist *)NULL, ep, - opt_flags); + opt_flags, &anon, exflags); free_grp(grp); } dirhead = (struct dirlist *)NULL; @@ -1722,7 +1783,7 @@ nextline: * Get the export list from all specified files */ static void -get_exportlist(void) +get_exportlist(int passno) { struct export_args export; struct iovec *iov; @@ -1731,70 +1792,130 @@ get_exportlist(void) int num, i; int iovlen; struct nfsex_args eargs; + FILE *debug_file; - if (suspend_nfsd != 0) - (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); + if ((debug_file = fopen(_PATH_MOUNTDDEBUG, "r")) != NULL) { + fclose(debug_file); + logdebug = 1; + } else + logdebug = 0; + LOGDEBUG("passno=%d", passno); v4root_dirpath[0] = '\0'; + free_v4rootexp(); + if (passno == 1) { + /* + * Save the current lists as old ones, so that the new lists + * can be compared with the old ones in the 2nd pass. + */ + for (i = 0; i < exphashsize; i++) { + SLIST_FIRST(&oldexphead[i]) = SLIST_FIRST(&exphead[i]); + SLIST_INIT(&exphead[i]); + } + + /* Note that the public fh has not yet been set. */ + has_set_publicfh = 0; + + /* Read the export file(s) and process them */ + read_exportfile(passno); + } else { + /* + * Just make the old lists empty. + * exphashsize == 0 for the first call, before oldexphead + * has been initialized-->loop won't be executed. + */ + for (i = 0; i < exphashsize; i++) + SLIST_INIT(&oldexphead[i]); + } + bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; iov = NULL; iovlen = 0; bzero(errmsg, sizeof(errmsg)); + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); /* - * First, get rid of the old list + * Delete the old V4 root dir. */ - if (exphead != NULL) - free_exports(exphead); - - /* - * and the old V4 root dir. - */ bzero(&eargs, sizeof (eargs)); eargs.export.ex_flags = MNT_DELEXPORT; if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&eargs) < 0 && errno != ENOENT) syslog(LOG_ERR, "Can't delete exports for V4:"); - /* - * and clear flag that notes if a public fh has been exported. - */ - has_publicfh = 0; + build_iovec(&iov, &iovlen, "fstype", NULL, 0); + build_iovec(&iov, &iovlen, "fspath", NULL, 0); + build_iovec(&iov, &iovlen, "from", NULL, 0); + build_iovec(&iov, &iovlen, "update", NULL, 0); + build_iovec(&iov, &iovlen, "export", &export, + sizeof(export)); + build_iovec(&iov, &iovlen, "errmsg", errmsg, + sizeof(errmsg)); /* - * And delete exports that are in the kernel for all local - * filesystems. - * XXX: Should know how to handle all local exportable filesystems. + * For passno == 1, compare the old and new lists updating the kernel + * exports for any cases that have changed. + * This call is doing the second pass through the lists. + * If it fails, fall back on the bulk reload. */ - num = getmntinfo(&mntbufp, MNT_NOWAIT); + if (passno == 1 && compare_nmount_exportlist(iov, iovlen, errmsg) == + 0) { + LOGDEBUG("compareok"); + /* Free up the old lists. */ + free_exports(oldexphead); + } else { + LOGDEBUG("doing passno=0"); + /* + * Clear flag that notes if a public fh has been exported. + * It is set by do_mount() if MNT_EXPUBLIC is set for the entry. + */ + has_publicfh = 0; - /* Allocate hash tables, for first call. */ - if (exphead == NULL) { - /* Target an average linked list length of 10. */ - exphashsize = num / 10; - if (exphashsize < 1) - exphashsize = 1; - else if (exphashsize > 100000) - exphashsize = 100000; - exphead = malloc(exphashsize * sizeof(*exphead)); - if (exphead == NULL) - errx(1, "Can't malloc hash table"); + /* exphead == NULL if not yet allocated (first call). */ + if (exphead != NULL) { + /* + * First, get rid of the old lists. + */ + free_exports(exphead); + free_exports(oldexphead); + } - for (i = 0; i < exphashsize; i++) - SLIST_INIT(&exphead[i]); - } - if (num > 0) { - build_iovec(&iov, &iovlen, "fstype", NULL, 0); - build_iovec(&iov, &iovlen, "fspath", NULL, 0); - build_iovec(&iov, &iovlen, "from", NULL, 0); - build_iovec(&iov, &iovlen, "update", NULL, 0); - build_iovec(&iov, &iovlen, "export", &export, sizeof(export)); - build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - } + /* + * And delete exports that are in the kernel for all local + * filesystems. + * XXX: Should know how to handle all local exportable + * filesystems. + */ + num = getmntinfo(&mntbufp, MNT_NOWAIT); - for (i = 0; i < num; i++) - delete_export(iov, iovlen, &mntbufp[i], errmsg); + /* Allocate hash tables, for first call. */ + if (exphead == NULL) { + /* Target an average linked list length of 10. */ + exphashsize = num / 10; + if (exphashsize < 1) + exphashsize = 1; + else if (exphashsize > 100000) + exphashsize = 100000; + exphead = malloc(exphashsize * sizeof(*exphead)); + oldexphead = malloc(exphashsize * sizeof(*oldexphead)); + if (exphead == NULL || oldexphead == NULL) + errx(1, "Can't malloc hash tables"); + for (i = 0; i < exphashsize; i++) { + SLIST_INIT(&exphead[i]); + SLIST_INIT(&oldexphead[i]); + } + } + + for (i = 0; i < num; i++) + delete_export(iov, iovlen, &mntbufp[i], errmsg); + + + /* Read the export file(s) and process them */ + read_exportfile(0); + } + if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ @@ -1809,16 +1930,17 @@ get_exportlist(void) iovlen = 0; } - read_exportfile(); - /* * If there was no public fh, clear any previous one set. */ - if (has_publicfh == 0) + if (has_publicfh == 0) { + LOGDEBUG("clear public fh"); (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + } /* Resume the nfsd. If they weren't suspended, this is harmless. */ (void)nfssvc(NFSSVC_RESUMENFSD, NULL); + LOGDEBUG("eo get_exportlist"); } /* @@ -1830,6 +1952,7 @@ insert_exports(struct exportlist *ep, struct exportlis uint32_t i; i = EXPHASH(&ep->ex_fs); + LOGDEBUG("fs=%s hash=%i", ep->ex_fsdir, i); SLIST_INSERT_HEAD(&exhp[i], ep, entries); } @@ -1855,7 +1978,7 @@ free_exports(struct exportlisthead *exhp) * Read the exports file(s) and call get_exportlist_one() for each line. */ static void -read_exportfile(void) +read_exportfile(int passno) { int done, i; @@ -1871,7 +1994,7 @@ read_exportfile(void) syslog(LOG_WARNING, "can't open %s", exnames[i]); continue; } - get_exportlist_one(); + get_exportlist_one(passno); fclose(exp_file); done++; } @@ -1882,6 +2005,244 @@ read_exportfile(void) } /* + * Compare the export lists against the old ones and do nmount() operations + * for any cases that have changed. This avoids doing nmount() for entries + * that have not changed. + * Return 0 upon success, 1 otherwise. + */ +static int +compare_nmount_exportlist(struct iovec *iov, int iovlen, char *errmsg) +{ + struct exportlist *ep, *oep; + struct grouplist *grp; + struct statfs fs, ofs; + int i, ret; + + /* + * Loop through the current list and look for an entry in the old + * list. + * If found, check to see if it the same. + * If it is not the same, delete and re-export. + * Then mark it done on the old list. + * else (not found) + * export it. + * Any entries left in the old list after processing must have their + * exports deleted. + */ + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(ep, &exphead[i], entries) { + LOGDEBUG("foreach ep=%s", ep->ex_fsdir); + oep = ex_search(&ep->ex_fs, oldexphead); + if (oep != NULL) { + /* + * Check the mount paths are the same. + * If not, return 1 so that the reload of the + * exports will be done in bulk, the + * passno == 0 way. + */ + LOGDEBUG("found old exp"); + if (strcmp(ep->ex_fsdir, oep->ex_fsdir) != 0) + return (1); + LOGDEBUG("same fsdir"); + /* + * Test to see if the entry is the same. + * If not the same delete exports and + * re-export. + */ + if (compare_export(ep, oep) != 0) { + /* + * Clear has_publicfh if if was set + * in the old exports, but only if it + * has not been set during processing of + * the exports for this pass, as + * indicated by has_set_publicfh. + */ + if (has_set_publicfh == 0 && + (oep->ex_flag & EX_PUBLICFH) != 0) + has_publicfh = 0; + + /* Delete and re-export. */ + if (statfs(ep->ex_fsdir, &fs) < 0) + return (1); + delete_export(iov, iovlen, &fs, errmsg); + ret = do_export_mount(ep, &fs); + if (ret != 0) + return (ret); + } + oep->ex_flag |= EX_DONE; + LOGDEBUG("exdone"); + } else { + LOGDEBUG("not found so export"); + /* Not found, so do export. */ + if (statfs(ep->ex_fsdir, &fs) < 0) + return (1); + ret = do_export_mount(ep, &fs); + if (ret != 0) + return (ret); + } + } + + /* Delete exports not done. */ + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(oep, &oldexphead[i], entries) { + if ((oep->ex_flag & EX_DONE) == 0) { + LOGDEBUG("not done delete=%s", oep->ex_fsdir); + if (statfs(oep->ex_fsdir, &ofs) >= 0 && + oep->ex_fs.val[0] == ofs.f_fsid.val[0] && + oep->ex_fs.val[1] == ofs.f_fsid.val[1]) { + LOGDEBUG("do delete"); + /* + * Clear has_publicfh if if was set + * in the old exports, but only if it + * has not been set during processing of + * the exports for this pass, as + * indicated by has_set_publicfh. + */ + if (has_set_publicfh == 0 && + (oep->ex_flag & EX_PUBLICFH) != 0) + has_publicfh = 0; + + delete_export(iov, iovlen, &ofs, + errmsg); + } + } + } + + /* Do the V4 root exports, as required. */ + grp = NULL; + if (v4root_ep != NULL) + grp = v4root_ep->ex_grphead; + v4root_phase = 2; + while (v4root_ep != NULL && grp != NULL) { + LOGDEBUG("v4root expath=%s", v4root_dirpath); + ret = do_mount(v4root_ep, grp, grp->gr_exflags, &grp->gr_anon, + v4root_dirpath, strlen(v4root_dirpath), &fs, + grp->gr_numsecflavors, grp->gr_secflavors); + if (ret != 0) { + v4root_phase = 0; + return (ret); + } + grp = grp->gr_next; + } + v4root_phase = 0; + free_v4rootexp(); + return (0); +} + +/* + * Compare old and current exportlist entries for the fsid and return 0 + * if they are the same, 1 otherwise. + */ +static int +compare_export(struct exportlist *ep, struct exportlist *oep) +{ + struct grouplist *grp, *ogrp; + + if (strcmp(ep->ex_fsdir, oep->ex_fsdir) != 0) + return (1); + if ((ep->ex_flag & EX_DEFSET) != (oep->ex_flag & EX_DEFSET)) + return (1); + if ((ep->ex_defdir != NULL && oep->ex_defdir == NULL) || + (ep->ex_defdir == NULL && oep->ex_defdir != NULL)) + return (1); + if (ep->ex_defdir != NULL && (ep->ex_defdir->dp_flag & DP_DEFSET) != + (oep->ex_defdir->dp_flag & DP_DEFSET)) + return (1); + if ((ep->ex_flag & EX_DEFSET) != 0 && (ep->ex_defnumsecflavors != + oep->ex_defnumsecflavors || ep->ex_defexflags != + oep->ex_defexflags || compare_cred(&ep->ex_defanon, + &oep->ex_defanon) != 0 || compare_secflavor(ep->ex_defsecflavors, + oep->ex_defsecflavors, ep->ex_defnumsecflavors) != 0)) + return (1); + + /* Now, check all the groups. */ + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = ogrp->gr_next) + ogrp->gr_flag = 0; + for (grp = ep->ex_grphead; grp != NULL; grp = grp->gr_next) { + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = + ogrp->gr_next) + if ((ogrp->gr_flag & GR_FND) == 0 && + grp->gr_numsecflavors == ogrp->gr_numsecflavors && + grp->gr_exflags == ogrp->gr_exflags && + compare_cred(&grp->gr_anon, &ogrp->gr_anon) == 0 && + compare_secflavor(grp->gr_secflavors, + ogrp->gr_secflavors, grp->gr_numsecflavors) == 0) + break; + if (ogrp != NULL) + ogrp->gr_flag |= GR_FND; + else + return (1); + } + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = ogrp->gr_next) + if ((ogrp->gr_flag & GR_FND) == 0) + return (1); + return (0); +} + +/* + * This algorithm compares two arrays of "n" items. It returns 0 if they are + * the "same" and 1 otherwise. Although suboptimal, it is always safe to + * return 1, which makes compare_nmount_export() reload the exports entry. + * "same" refers to having the same set of values in the two arrays. + * The arrays are in no particular order and duplicates (multiple entries + * in an array with the same value) is allowed. + * The algorithm is inefficient, but the common case of indentical arrays is + * handled first and "n" is normally fairly small. + * Since the two functions need the same algorithm but for arrays of + * different types (gid_t vs int), this is done as a macro. + */ +#define COMPARE_ARRAYS(a1, a2, n) \ + do { \ + int fnd, fndarray[(n)], i, j; \ + /* Handle common case of identical arrays. */ \ + for (i = 0; i < (n); i++) \ + if ((a1)[i] != (a2)[i]) \ + break; \ + if (i == (n)) \ + return (0); \ + for (i = 0; i < (n); i++) \ + fndarray[i] = 0; \ + for (i = 0; i < (n); i++) { \ + fnd = 0; \ + for (j = 0; j < (n); j++) { \ + if ((a1)[i] == (a2)[j]) { \ + fndarray[j] = 1; \ + fnd = 1; \ + } \ + } \ + if (fnd == 0) \ + return (1); \ + } \ + for (i = 0; i < (n); i++) \ + if (fndarray[i] == 0) \ + return (1); \ + return (0); \ + } while (0) + +/* + * Compare to struct xucred's. Return 0 if the same and 1 otherwise. + */ +static int +compare_cred(struct xucred *cr0, struct xucred *cr1) +{ + + if (cr0->cr_uid != cr1->cr_uid || cr0->cr_ngroups != cr1->cr_ngroups) + return (1); + + COMPARE_ARRAYS(cr0->cr_groups, cr1->cr_groups, cr0->cr_ngroups); +} + +/* + * Compare two lists of security flavors. Return 0 if the same and 1 otherwise. + */ +static int +compare_secflavor(int *sec1, int *sec2, int nsec) +{ + + COMPARE_ARRAYS(sec1, sec2, nsec); +} + +/* * Delete an exports entry. */ static void @@ -2028,7 +2389,7 @@ add_expdir(struct dirlist **dpp, char *cp, int len) */ static void hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, - int flags) + int flags, struct xucred *anoncrp, int exflags) { struct hostlist *hp; struct dirlist *dp2; @@ -2039,12 +2400,15 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s else ep->ex_defdir = dp; if (grp == (struct grouplist *)NULL) { + ep->ex_flag |= EX_DEFSET; ep->ex_defdir->dp_flag |= DP_DEFSET; /* Save the default security flavors list. */ ep->ex_defnumsecflavors = ep->ex_numsecflavors; if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); + ep->ex_defanon = *anoncrp; + ep->ex_defexflags = exflags; } else while (grp) { hp = get_ht(); hp->ht_grp = grp; @@ -2064,7 +2428,8 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s */ while (dp) { dp2 = dp->dp_left; - add_dlist(&ep->ex_dirl, dp, grp, flags, ep); + add_dlist(&ep->ex_dirl, dp, grp, flags, ep, anoncrp, + exflags); dp = dp2; } } @@ -2076,7 +2441,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s */ static void add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, - int flags, struct exportlist *ep) + int flags, struct exportlist *ep, struct xucred *anoncrp, int exflags) { struct dirlist *dp; struct hostlist *hp; @@ -2086,10 +2451,12 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, if (dp) { cmp = strcmp(dp->dp_dirp, newdp->dp_dirp); if (cmp > 0) { - add_dlist(&dp->dp_left, newdp, grp, flags, ep); + add_dlist(&dp->dp_left, newdp, grp, flags, ep, anoncrp, + exflags); return; } else if (cmp < 0) { - add_dlist(&dp->dp_right, newdp, grp, flags, ep); + add_dlist(&dp->dp_right, newdp, grp, flags, ep, anoncrp, + exflags); return; } else free((caddr_t)newdp); @@ -2116,12 +2483,15 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, grp = grp->gr_next; } while (grp); } else { + ep->ex_flag |= EX_DEFSET; dp->dp_flag |= DP_DEFSET; /* Save the default security flavors list. */ ep->ex_defnumsecflavors = ep->ex_numsecflavors; if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); + ep->ex_defanon = *anoncrp; + ep->ex_defexflags = exflags; } } @@ -2487,6 +2857,19 @@ free_exp(struct exportlist *ep) } /* + * Free up the v4root exports. + */ +static void +free_v4rootexp(void) +{ + + if (v4root_ep != NULL) { + free_exp(v4root_ep); + v4root_ep = NULL; + } +} + +/* * Free hosts. */ static void @@ -2526,12 +2909,52 @@ out_of_mem(void) } /* + * Call do_mount() from the struct exportlist, for each case needed. + */ +static int +do_export_mount(struct exportlist *ep, struct statfs *fsp) +{ + struct grouplist *grp, defgrp; + int ret; + size_t dirlen; + + LOGDEBUG("do_export_mount=%s", ep->ex_fsdir); + dirlen = strlen(ep->ex_fsdir); + if ((ep->ex_flag & EX_DEFSET) != 0) { + defgrp.gr_type = GT_DEFAULT; + defgrp.gr_next = NULL; + /* We have an entry for all other hosts/nets. */ + LOGDEBUG("ex_defexflags=0x%x", ep->ex_defexflags); + ret = do_mount(ep, &defgrp, ep->ex_defexflags, &ep->ex_defanon, + ep->ex_fsdir, dirlen, fsp, ep->ex_defnumsecflavors, + ep->ex_defsecflavors); + if (ret != 0) + return (ret); + } + + /* Do a mount for each group. */ + grp = ep->ex_grphead; + while (grp != NULL) { + LOGDEBUG("do mount gr_type=0x%x gr_exflags=0x%x", + grp->gr_type, grp->gr_exflags); + ret = do_mount(ep, grp, grp->gr_exflags, &grp->gr_anon, + ep->ex_fsdir, dirlen, fsp, grp->gr_numsecflavors, + grp->gr_secflavors); + if (ret != 0) + return (ret); + grp = grp->gr_next; + } + return (0); +} + +/* * Do the nmount() syscall with the update flag to push the export info into * the kernel. */ static int do_mount(struct exportlist *ep, struct grouplist *grp, int exflags, - struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb) + struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb, + int numsecflavors, int *secflavors) { struct statfs fsb1; struct addrinfo *ai; @@ -2557,14 +2980,16 @@ do_mount(struct exportlist *ep, struct grouplist *grp, bzero(errmsg, sizeof(errmsg)); eap->ex_flags = exflags; eap->ex_anon = *anoncrp; + LOGDEBUG("do_mount exflags=0x%x", exflags); eap->ex_indexfile = ep->ex_indexfile; if (grp->gr_type == GT_HOST) ai = grp->gr_ptr.gt_addrinfo; else ai = NULL; - eap->ex_numsecflavors = ep->ex_numsecflavors; + eap->ex_numsecflavors = numsecflavors; + LOGDEBUG("do_mount numsec=%d", numsecflavors); for (i = 0; i < eap->ex_numsecflavors; i++) - eap->ex_secflavors[i] = ep->ex_secflavors[i]; + eap->ex_secflavors[i] = secflavors[i]; if (eap->ex_numsecflavors == 0) { eap->ex_numsecflavors = 1; eap->ex_secflavors[0] = AUTH_SYS; @@ -2728,8 +3153,11 @@ do_mount(struct exportlist *ep, struct grouplist *grp, else if (nfssvc(NFSSVC_PUBLICFH, (caddr_t)&fh) < 0) syslog(LOG_ERR, "Can't set public fh for %s", public_name); - else + else { has_publicfh = 1; + has_set_publicfh = 1; + ep->ex_flag |= EX_PUBLICFH; + } } skip: if (ai != NULL) Modified: head/usr.sbin/mountd/pathnames.h ============================================================================== --- head/usr.sbin/mountd/pathnames.h Mon Jun 3 21:40:42 2019 (r348589) +++ head/usr.sbin/mountd/pathnames.h Mon Jun 3 22:58:51 2019 (r348590) @@ -36,3 +36,4 @@ #define _PATH_EXPORTS "/etc/exports" #define _PATH_RMOUNTLIST "/var/db/mountdtab" #define _PATH_MOUNTDPID "/var/run/mountd.pid" +#define _PATH_MOUNTDDEBUG "/var/log/mountd.debug" From owner-svn-src-head@freebsd.org Mon Jun 3 23:07: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 4254815C0963; Mon, 3 Jun 2019 23:07:47 +0000 (UTC) (envelope-from rmacklem@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 DC9F673AE2; Mon, 3 Jun 2019 23:07:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4257CF67; Mon, 3 Jun 2019 23:07:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53N7k5e018462; Mon, 3 Jun 2019 23:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53N7kBU018461; Mon, 3 Jun 2019 23:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906032307.x53N7kBU018461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 3 Jun 2019 23:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348591 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 348591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC9F673AE2 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)[-1.000,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: Mon, 03 Jun 2019 23:07:47 -0000 Author: rmacklem Date: Mon Jun 3 23:07:46 2019 New Revision: 348591 URL: https://svnweb.freebsd.org/changeset/base/348591 Log: r348590 had mention of "-I" in a comment that no longer applied to the patch. Take "-I" out of the comment line, since the patch no longer uses the "-I" option. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Jun 3 22:58:51 2019 (r348590) +++ head/usr.sbin/mountd/mountd.c Mon Jun 3 23:07:46 2019 (r348591) @@ -1716,7 +1716,7 @@ get_exportlist_one(int passno) */ if (v4root_phase > 0 && v4root_phase <= 2) { /* - * These structures are used for the "-I" reload, + * These structures are used for the reload, * so save them for that case. Otherwise, just * free them up now. */ From owner-svn-src-head@freebsd.org Mon Jun 3 23:17: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 22C7E15C0C5A; Mon, 3 Jun 2019 23:17:36 +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 BE0B97452B; Mon, 3 Jun 2019 23:17:35 +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 93480D10B; Mon, 3 Jun 2019 23:17:35 +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 x53NHZ3Z023677; Mon, 3 Jun 2019 23:17:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53NHZxF023676; Mon, 3 Jun 2019 23:17:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906032317.x53NHZxF023676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Jun 2019 23:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348592 - 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: 348592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE0B97452B 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)[-1.000,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: Mon, 03 Jun 2019 23:17:36 -0000 Author: jhb Date: Mon Jun 3 23:17:35 2019 New Revision: 348592 URL: https://svnweb.freebsd.org/changeset/base/348592 Log: Emulate the AMD MSR_LS_CFG MSR used for various Ryzen errata. Writes are ignored and reads always return zero. Submitted by: José Albornoz (write-only version) Reviewed by: Patrick Mooney, cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19506 Modified: head/usr.sbin/bhyve/xmsr.c Modified: head/usr.sbin/bhyve/xmsr.c ============================================================================== --- head/usr.sbin/bhyve/xmsr.c Mon Jun 3 23:07:46 2019 (r348591) +++ head/usr.sbin/bhyve/xmsr.c Mon Jun 3 23:17:35 2019 (r348592) @@ -72,6 +72,7 @@ emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t nu return (0); case MSR_NB_CFG1: + case MSR_LS_CFG: case MSR_IC_CFG: return (0); /* Ignore writes */ @@ -141,6 +142,7 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t nu break; case MSR_NB_CFG1: + case MSR_LS_CFG: case MSR_IC_CFG: /* * The reset value is processor family dependent so From owner-svn-src-head@freebsd.org Mon Jun 3 23:57: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 EEE2915C18BD; Mon, 3 Jun 2019 23:57:30 +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 94E78758A4; Mon, 3 Jun 2019 23:57:30 +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 78A18D7FC; Mon, 3 Jun 2019 23:57:30 +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 x53NvU83044969; Mon, 3 Jun 2019 23:57:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53NvU11044968; Mon, 3 Jun 2019 23:57:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906032357.x53NvU11044968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 3 Jun 2019 23:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348594 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94E78758A4 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,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, 03 Jun 2019 23:57:31 -0000 Author: cem Date: Mon Jun 3 23:57:29 2019 New Revision: 348594 URL: https://svnweb.freebsd.org/changeset/base/348594 Log: style.9: Codify tolerance for eliding blank lines Consensus seems to be that eliding blank lines for functions with no local variables is acceptable. Codify that explicitly in the style document. Reported by: jhb Reviewed by: delphij, imp, vangyzen (earlier version); rgrimes With feedback from: kib Differential Revision: https://reviews.freebsd.org/D20448 Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Mon Jun 3 23:24:07 2019 (r348593) +++ head/share/man/man9/style.9 Mon Jun 3 23:57:29 2019 (r348594) @@ -26,7 +26,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd May 28, 2019 +.Dd June 3, 2019 .Dt STYLE 9 .Os .Sh NAME @@ -779,8 +779,19 @@ vaf(const char *fmt, ...) static void usage(void) { - /* Insert an empty line if the function has no local variables. */ + /* Optional blank line goes here. */ .Ed +.Pp +Optionally, insert a blank line at the beginning of functions with no local +variables. +Older versions of this +.Nm +document required the blank line convention, so it is widely used in existing +code. +.Pp +Do not insert a blank line at the beginning of functions with local variables. +Instead, these should have local variable declarations first, followed by one +blank line, followed by the first statement. .Pp Use .Xr printf 3 , From owner-svn-src-head@freebsd.org Tue Jun 4 00:01: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 63D8115C1DE6; Tue, 4 Jun 2019 00:01:38 +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 053CF75DB3; Tue, 4 Jun 2019 00:01:38 +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 D5435D971; Tue, 4 Jun 2019 00:01:37 +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 x5401brl046777; Tue, 4 Jun 2019 00:01:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5401b3s046776; Tue, 4 Jun 2019 00:01:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906040001.x5401b3s046776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 4 Jun 2019 00:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348595 - head/sys/dev/virtio/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/virtio/random X-SVN-Commit-Revision: 348595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 053CF75DB3 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 04 Jun 2019 00:01:38 -0000 Author: cem Date: Tue Jun 4 00:01:37 2019 New Revision: 348595 URL: https://svnweb.freebsd.org/changeset/base/348595 Log: virtio_random(4): Fix random(4) integration random(4) masks unregistered entropy sources. Prior to this revision, virtio_random(4) did not correctly register a random_source and did not function as a source of entropy. Random source registration for loadable pure sources requires registering a poll callback, which is invoked periodically by random(4)'s harvestq kthread. The periodic poll makes virtio_random(4)'s periodic entropy collection redundant, so this revision removes the callout. The current random source API is somewhat limiting, so simply fail to attach any virtio_random devices if one is already registered as a source. This scenario is expected to be uncommon. While here, handle the possibility of short reads from the hypervisor random device gracefully / correctly. It is not clear why a hypervisor would return a short read or if it is allowed by spec, but we may as well handle it. Reviewed by: bryanv (earlier version), markm Security: yes (note: many other "pure" random sources remain broken) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20419 Modified: head/sys/dev/virtio/random/virtio_random.c Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Mon Jun 3 23:57:29 2019 (r348594) +++ head/sys/dev/virtio/random/virtio_random.c Tue Jun 4 00:01:37 2019 (r348595) @@ -33,21 +33,24 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include #include +#include +#include #include #include struct vtrnd_softc { uint64_t vtrnd_features; - struct callout vtrnd_callout; struct virtqueue *vtrnd_vq; }; @@ -59,8 +62,8 @@ static int vtrnd_detach(device_t); static void vtrnd_negotiate_features(device_t); static int vtrnd_alloc_virtqueue(device_t); -static void vtrnd_harvest(struct vtrnd_softc *); -static void vtrnd_timer(void *); +static int vtrnd_harvest(struct vtrnd_softc *, void *, size_t *); +static unsigned vtrnd_read(void *, unsigned); #define VTRND_FEATURES 0 @@ -68,6 +71,15 @@ static struct virtio_feature_desc vtrnd_feature_desc[] { 0, NULL } }; +static struct random_source random_vtrnd = { + .rs_ident = "VirtIO Entropy Adapter", + .rs_source = RANDOM_PURE_VIRTIO, + .rs_read = vtrnd_read, +}; + +/* Kludge for API limitations of random(4). */ +static _Atomic(struct vtrnd_softc *) g_vtrnd_softc; + static device_method_t vtrnd_methods[] = { /* Device methods. */ DEVMETHOD(device_probe, vtrnd_probe), @@ -125,13 +137,11 @@ vtrnd_probe(device_t dev) static int vtrnd_attach(device_t dev) { - struct vtrnd_softc *sc; + struct vtrnd_softc *sc, *exp; int error; sc = device_get_softc(dev); - callout_init(&sc->vtrnd_callout, 1); - virtio_set_feature_desc(dev, vtrnd_feature_desc); vtrnd_negotiate_features(dev); @@ -141,7 +151,13 @@ vtrnd_attach(device_t dev) goto fail; } - callout_reset(&sc->vtrnd_callout, 5 * hz, vtrnd_timer, sc); + exp = NULL; + if (!atomic_compare_exchange_strong_explicit(&g_vtrnd_softc, &exp, sc, + memory_order_release, memory_order_acquire)) { + error = EEXIST; + goto fail; + } + random_source_register(&random_vtrnd); fail: if (error) @@ -156,9 +172,20 @@ vtrnd_detach(device_t dev) struct vtrnd_softc *sc; sc = device_get_softc(dev); + KASSERT( + atomic_load_explicit(&g_vtrnd_softc, memory_order_acquire) == sc, + ("only one global instance at a time")); - callout_drain(&sc->vtrnd_callout); + random_source_deregister(&random_vtrnd); + atomic_store_explicit(&g_vtrnd_softc, NULL, memory_order_release); + /* + * Unfortunately, deregister does not guarantee our source callback + * will not be invoked after it returns. Use a kludge to prevent some, + * but not all, possible races. + */ + tsleep_sbt(&g_vtrnd_softc, 0, "vtrnddet", mstosbt(50), 0, C_HARDCLOCK); + return (0); } @@ -185,44 +212,64 @@ vtrnd_alloc_virtqueue(device_t dev) return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info)); } -static void -vtrnd_harvest(struct vtrnd_softc *sc) +static int +vtrnd_harvest(struct vtrnd_softc *sc, void *buf, size_t *sz) { struct sglist_seg segs[1]; struct sglist sg; struct virtqueue *vq; - uint32_t value; + uint32_t value[HARVESTSIZE] __aligned(sizeof(uint32_t) * HARVESTSIZE); + uint32_t rdlen; int error; - vq = sc->vtrnd_vq; + _Static_assert(sizeof(value) < PAGE_SIZE, "sglist assumption"); sglist_init(&sg, 1, segs); - error = sglist_append(&sg, &value, sizeof(value)); - KASSERT(error == 0 && sg.sg_nseg == 1, - ("%s: error %d adding buffer to sglist", __func__, error)); + error = sglist_append(&sg, value, *sz); + if (error != 0) + panic("%s: sglist_append error=%d", __func__, error); - if (!virtqueue_empty(vq)) - return; - if (virtqueue_enqueue(vq, &value, &sg, 0, 1) != 0) - return; + vq = sc->vtrnd_vq; + KASSERT(virtqueue_empty(vq), ("%s: non-empty queue", __func__)); + error = virtqueue_enqueue(vq, buf, &sg, 0, 1); + if (error != 0) + return (error); + /* * Poll for the response, but the command is likely already * done when we return from the notify. */ virtqueue_notify(vq); - virtqueue_poll(vq, NULL); + virtqueue_poll(vq, &rdlen); - random_harvest_queue(&value, sizeof(value), RANDOM_PURE_VIRTIO); + if (rdlen > *sz) + panic("%s: random device wrote %zu bytes beyond end of provided" + " buffer %p:%zu", __func__, (size_t)rdlen - *sz, + (void *)value, *sz); + else if (rdlen == 0) + return (EAGAIN); + *sz = MIN(rdlen, *sz); + memcpy(buf, value, *sz); + explicit_bzero(value, *sz); + return (0); } -static void -vtrnd_timer(void *xsc) +static unsigned +vtrnd_read(void *buf, unsigned usz) { struct vtrnd_softc *sc; + size_t sz; + int error; - sc = xsc; + sc = g_vtrnd_softc; + if (sc == NULL) + return (0); - vtrnd_harvest(sc); - callout_schedule(&sc->vtrnd_callout, 5 * hz); + sz = usz; + error = vtrnd_harvest(sc, buf, &sz); + if (error != 0) + return (0); + + return (sz); } From owner-svn-src-head@freebsd.org Tue Jun 4 02:35: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 77FD315C53F8; Tue, 4 Jun 2019 02:35:01 +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 15C7B824DD; Tue, 4 Jun 2019 02:35:01 +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 D84E6F39D; Tue, 4 Jun 2019 02:35:00 +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 x542Z0SW028024; Tue, 4 Jun 2019 02:35:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x542Z0TD028019; Tue, 4 Jun 2019 02:35:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906040235.x542Z0TD028019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 4 Jun 2019 02:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348598 - in head/sys/dev/virtio: . mmio pci X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev/virtio: . mmio pci X-SVN-Commit-Revision: 348598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15C7B824DD 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)[-1.000,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: Tue, 04 Jun 2019 02:35:01 -0000 Author: cem Date: Tue Jun 4 02:34:59 2019 New Revision: 348598 URL: https://svnweb.freebsd.org/changeset/base/348598 Log: virtio(4): Expose PNP metadata through newbus Expose the same fields and widths from both vtio buses, even though they don't quite line up; several virtio drivers can attach to both buses, and sharing a PNP info table for both seems more convenient. In practice, I doubt any virtio driver really needs to match on anything other than bus and device_type (eliminating the unused entries for vtmmio), and also in practice device_type is << 2^16 (so far, values range from 1 to 20). So it might be fine to only expose a 16-bit device_type for PNP purposes. On the other hand, I don't see much harm in overkill here. Reviewed by: bryanv, markj (earlier version) Differential Revision: https://reviews.freebsd.org/D20406 Modified: head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio.h Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Tue Jun 4 01:00:30 2019 (r348597) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Tue Jun 4 02:34:59 2019 (r348598) @@ -145,6 +145,7 @@ static device_method_t vtmmio_methods[] = { /* Bus interface. */ DEVMETHOD(bus_driver_added, vtmmio_driver_added), DEVMETHOD(bus_child_detached, vtmmio_child_detached), + DEVMETHOD(bus_child_pnpinfo_str, virtio_child_pnpinfo_str), DEVMETHOD(bus_read_ivar, vtmmio_read_ivar), DEVMETHOD(bus_write_ivar, vtmmio_write_ivar), @@ -331,6 +332,14 @@ vtmmio_read_ivar(device_t dev, device_t child, int ind break; case VIRTIO_IVAR_VENDOR: *result = vtmmio_read_config_4(sc, VIRTIO_MMIO_VENDOR_ID); + break; + case VIRTIO_IVAR_SUBVENDOR: + case VIRTIO_IVAR_DEVICE: + /* + * Dummy value for fields not present in this bus. Used by + * bus-agnostic virtio_child_pnpinfo_str. + */ + *result = 0; break; default: return (ENOENT); Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Tue Jun 4 01:00:30 2019 (r348597) +++ head/sys/dev/virtio/pci/virtio_pci.c Tue Jun 4 02:34:59 2019 (r348598) @@ -200,6 +200,7 @@ static device_method_t vtpci_methods[] = { /* Bus interface. */ DEVMETHOD(bus_driver_added, vtpci_driver_added), DEVMETHOD(bus_child_detached, vtpci_child_detached), + DEVMETHOD(bus_child_pnpinfo_str, virtio_child_pnpinfo_str), DEVMETHOD(bus_read_ivar, vtpci_read_ivar), DEVMETHOD(bus_write_ivar, vtpci_write_ivar), Modified: head/sys/dev/virtio/virtio.c ============================================================================== --- head/sys/dev/virtio/virtio.c Tue Jun 4 01:00:30 2019 (r348597) +++ head/sys/dev/virtio/virtio.c Tue Jun 4 02:34:59 2019 (r348598) @@ -263,6 +263,30 @@ virtio_write_device_config(device_t dev, bus_size_t of offset, dst, len); } +int +virtio_child_pnpinfo_str(device_t busdev __unused, device_t child, char *buf, + size_t buflen) +{ + + /* + * All of these PCI fields will be only 16 bits, but on the vtmmio bus + * the corresponding fields (only "vendor" and "device_type") are 32 + * bits. Many virtio drivers can attach below either bus. + * Gratuitously expand these two fields to 32-bits to allow sharing PNP + * match table data between the mostly-similar buses. + * + * Subdevice and device_type are redundant in both buses, so I don't + * see a lot of PNP utility in exposing the same value under a + * different name. + */ + snprintf(buf, buflen, "vendor=0x%08x device=0x%04x subvendor=0x%04x " + "device_type=0x%08x", (unsigned)virtio_get_vendor(child), + (unsigned)virtio_get_device(child), + (unsigned)virtio_get_subvendor(child), + (unsigned)virtio_get_device_type(child)); + return (0); +} + static int virtio_modevent(module_t mod, int type, void *unused) { Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Tue Jun 4 01:00:30 2019 (r348597) +++ head/sys/dev/virtio/virtio.h Tue Jun 4 02:34:59 2019 (r348598) @@ -81,6 +81,8 @@ void virtio_stop(device_t dev); int virtio_config_generation(device_t dev); int virtio_reinit(device_t dev, uint64_t features); void virtio_reinit_complete(device_t dev); +int virtio_child_pnpinfo_str(device_t busdev, device_t child, char *buf, + size_t buflen); /* * Read/write a variable amount from the device specific (ie, network) From owner-svn-src-head@freebsd.org Tue Jun 4 02:37: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 353D415C54A0; Tue, 4 Jun 2019 02:37:14 +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 9D9778265B; Tue, 4 Jun 2019 02:37:13 +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 7A18AF3A4; Tue, 4 Jun 2019 02:37:13 +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 x542bDUC028154; Tue, 4 Jun 2019 02:37:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x542bCl8028148; Tue, 4 Jun 2019 02:37:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906040237.x542bCl8028148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 4 Jun 2019 02:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348599 - in head/sys/dev/virtio: . balloon block console network random scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev/virtio: . balloon block console network random scsi X-SVN-Commit-Revision: 348599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D9778265B 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)[-1.000,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: Tue, 04 Jun 2019 02:37:14 -0000 Author: cem Date: Tue Jun 4 02:37:11 2019 New Revision: 348599 URL: https://svnweb.freebsd.org/changeset/base/348599 Log: virtio(4): Add PNP match metadata for virtio devices Register MODULE_PNP_INFO for virtio devices using the newbus PNP information provided by the previous commit. Matching can be quite simple; existing probe routines only matched on bus (implicit) and device_type. The same matching criteria are retained exactly, but is now also available to devmatch(8). Reviewed by: bryanv, markj; imp (earlier version) Differential Revision: https://reviews.freebsd.org/D20407 Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/console/virtio_console.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/random/virtio_random.c head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/virtio.h Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Tue Jun 4 02:37:11 2019 (r348599) @@ -158,16 +158,14 @@ DRIVER_MODULE(virtio_balloon, virtio_pci, vtballoon_dr MODULE_VERSION(virtio_balloon, 1); MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1); +VIRTIO_SIMPLE_PNPTABLE(virtio_balloon, VIRTIO_ID_BALLOON, + "VirtIO Balloon Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_balloon); + static int vtballoon_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_BALLOON) - return (ENXIO); - - device_set_desc(dev, "VirtIO Balloon Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, virtio_balloon)); } static int Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/block/virtio_blk.c Tue Jun 4 02:37:11 2019 (r348599) @@ -261,6 +261,10 @@ DRIVER_MODULE(virtio_blk, virtio_pci, vtblk_driver, vt MODULE_VERSION(virtio_blk, 1); MODULE_DEPEND(virtio_blk, virtio, 1, 1, 1); +VIRTIO_SIMPLE_PNPTABLE(virtio_blk, VIRTIO_ID_BLOCK, "VirtIO Block Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_blk); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_blk); + static int vtblk_modevent(module_t mod, int type, void *unused) { @@ -285,13 +289,7 @@ vtblk_modevent(module_t mod, int type, void *unused) static int vtblk_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_BLOCK) - return (ENXIO); - - device_set_desc(dev, "VirtIO Block Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, virtio_blk)); } static int Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/console/virtio_console.c Tue Jun 4 02:37:11 2019 (r348599) @@ -261,6 +261,10 @@ DRIVER_MODULE(virtio_console, virtio_pci, vtcon_driver MODULE_VERSION(virtio_console, 1); MODULE_DEPEND(virtio_console, virtio, 1, 1, 1); +VIRTIO_SIMPLE_PNPTABLE(virtio_console, VIRTIO_ID_CONSOLE, + "VirtIO Console Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_console); + static int vtcon_modevent(module_t mod, int type, void *unused) { @@ -305,13 +309,7 @@ vtcon_drain_all(void) static int vtcon_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_CONSOLE) - return (ENXIO); - - device_set_desc(dev, "VirtIO Console Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, virtio_console)); } static int Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/network/if_vtnet.c Tue Jun 4 02:37:11 2019 (r348599) @@ -325,6 +325,10 @@ MODULE_DEPEND(vtnet, virtio, 1, 1, 1); MODULE_DEPEND(vtnet, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ +VIRTIO_SIMPLE_PNPTABLE(vtnet, VIRTIO_ID_NETWORK, "VirtIO Networking Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, vtnet); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, vtnet); + static int vtnet_modevent(module_t mod, int type, void *unused) { @@ -361,13 +365,7 @@ vtnet_modevent(module_t mod, int type, void *unused) static int vtnet_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_NETWORK) - return (ENXIO); - - device_set_desc(dev, "VirtIO Networking Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, vtnet)); } static int Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/random/virtio_random.c Tue Jun 4 02:37:11 2019 (r348599) @@ -102,6 +102,10 @@ MODULE_VERSION(virtio_random, 1); MODULE_DEPEND(virtio_random, virtio, 1, 1, 1); MODULE_DEPEND(virtio_random, random_device, 1, 1, 1); +VIRTIO_SIMPLE_PNPTABLE(virtio_random, VIRTIO_ID_ENTROPY, + "VirtIO Entropy Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_random); + static int vtrnd_modevent(module_t mod, int type, void *unused) { @@ -125,13 +129,7 @@ vtrnd_modevent(module_t mod, int type, void *unused) static int vtrnd_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_ENTROPY) - return (ENXIO); - - device_set_desc(dev, "VirtIO Entropy Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, virtio_random)); } static int Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Tue Jun 4 02:37:11 2019 (r348599) @@ -233,6 +233,9 @@ MODULE_VERSION(virtio_scsi, 1); MODULE_DEPEND(virtio_scsi, virtio, 1, 1, 1); MODULE_DEPEND(virtio_scsi, cam, 1, 1, 1); +VIRTIO_SIMPLE_PNPTABLE(virtio_scsi, VIRTIO_ID_SCSI, "VirtIO SCSI Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_scsi); + static int vtscsi_modevent(module_t mod, int type, void *unused) { @@ -256,13 +259,7 @@ vtscsi_modevent(module_t mod, int type, void *unused) static int vtscsi_probe(device_t dev) { - - if (virtio_get_device_type(dev) != VIRTIO_ID_SCSI) - return (ENXIO); - - device_set_desc(dev, "VirtIO SCSI Adapter"); - - return (BUS_PROBE_DEFAULT); + return (VIRTIO_SIMPLE_PROBE(dev, virtio_scsi)); } static int Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Tue Jun 4 02:34:59 2019 (r348598) +++ head/sys/dev/virtio/virtio.h Tue Jun 4 02:37:11 2019 (r348599) @@ -63,6 +63,21 @@ struct virtio_feature_desc { const char *vfd_str; }; +struct virtio_pnp_match { + uint32_t device_type; + const char *description; +}; +#define VIRTIO_SIMPLE_PNPTABLE(driver, devtype, desc) \ + static const struct virtio_pnp_match driver ## _match = { \ + .device_type = devtype, \ + .description = desc, \ + } +#define VIRTIO_SIMPLE_PNPINFO(bus, driver) \ + MODULE_PNP_INFO("U32:device_type;D:#", bus, driver, \ + &driver ## _match, 1) +#define VIRTIO_SIMPLE_PROBE(dev, driver) \ + (virtio_simple_probe(dev, &driver ## _match)) + const char *virtio_device_name(uint16_t devid); void virtio_describe(device_t dev, const char *msg, uint64_t features, struct virtio_feature_desc *feature_desc); @@ -145,5 +160,15 @@ __CONCAT(virtio_set_,name)(device_t dev, void *val) VIRTIO_WRITE_IVAR(feature_desc, VIRTIO_IVAR_FEATURE_DESC); #undef VIRTIO_WRITE_IVAR + +static inline int +virtio_simple_probe(device_t dev, const struct virtio_pnp_match *match) +{ + + if (virtio_get_device_type(dev) != match->device_type) + return (ENXIO); + device_set_desc(dev, match->description); + return (BUS_PROBE_DEFAULT); +} #endif /* _VIRTIO_H_ */ From owner-svn-src-head@freebsd.org Tue Jun 4 06:21: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 1A61515C9D1E; Tue, 4 Jun 2019 06:21:32 +0000 (UTC) (envelope-from slavash@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 B153D8919F; Tue, 4 Jun 2019 06:21:31 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8E79B199BD; Tue, 4 Jun 2019 06:21:31 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x546LVe1047234; Tue, 4 Jun 2019 06:21:31 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x546LV6x047233; Tue, 4 Jun 2019 06:21:31 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201906040621.x546LV6x047233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Tue, 4 Jun 2019 06:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348601 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 348601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B153D8919F 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,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, 04 Jun 2019 06:21:32 -0000 Author: slavash Date: Tue Jun 4 06:21:31 2019 New Revision: 348601 URL: https://svnweb.freebsd.org/changeset/base/348601 Log: Fix prio vs. nonprio tagged traffic in RDMACM In current RDMACM implementation RDMACM server will not find a GID index when the request was prio-tagged and the sever is non prio-tagged and vise-versa. According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be considered as untagged. Treat RDMACM request the same. Reviewed by: hselasky, kib MFC after: 3 Days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Tue Jun 4 03:04:30 2019 (r348600) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Tue Jun 4 06:21:31 2019 (r348601) @@ -414,18 +414,32 @@ struct find_gid_index_context { enum ib_gid_type gid_type; }; + +/* + * This function will return true only if a inspected GID index + * matches the request based on the GID type and VLAN configuration + */ static bool find_gid_index(const union ib_gid *gid, const struct ib_gid_attr *gid_attr, void *context) { + u16 vlan_diff; struct find_gid_index_context *ctx = (struct find_gid_index_context *)context; if (ctx->gid_type != gid_attr->gid_type) return false; - if (rdma_vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id) - return false; - return true; + + /* + * The following will verify: + * 1. VLAN ID matching for VLAN tagged requests. + * 2. prio-tagged/untagged to prio-tagged/untagged matching. + * + * This XOR is valid, since 0x0 < vlan_id < 0x0FFF. + */ + vlan_diff = rdma_vlan_dev_vlan_id(gid_attr->ndev) ^ ctx->vlan_id; + + return (vlan_diff == 0x0000 || vlan_diff == 0xFFFF); } static int get_sgid_index_from_eth(struct ib_device *device, u8 port_num, From owner-svn-src-head@freebsd.org Tue Jun 4 07:02: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 A90F015A497B; Tue, 4 Jun 2019 07:02:21 +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 4B42D8A50C; Tue, 4 Jun 2019 07:02:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F61B1A1B9; Tue, 4 Jun 2019 07:02:21 +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 x5472LiL070236; Tue, 4 Jun 2019 07:02:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5472Lu8070235; Tue, 4 Jun 2019 07:02:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906040702.x5472Lu8070235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 4 Jun 2019 07:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348602 - 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: 348602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B42D8A50C 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)[-1.000,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: Tue, 04 Jun 2019 07:02:21 -0000 Author: delphij Date: Tue Jun 4 07:02:20 2019 New Revision: 348602 URL: https://svnweb.freebsd.org/changeset/base/348602 Log: Don't increment cl after increment. MFC after: 3 days Modified: head/sbin/fsck_msdosfs/fat.c Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Tue Jun 4 06:21:31 2019 (r348601) +++ head/sbin/fsck_msdosfs/fat.c Tue Jun 4 07:02:20 2019 (r348602) @@ -645,8 +645,8 @@ writefat(int fs, struct bootblock *boot, struct fatEnt break; if (fat[cl].next == CLUST_FREE) boot->NumFree++; - *p++ |= (u_char)(fat[cl + 1].next << 4); - *p++ = (u_char)(fat[cl + 1].next >> 4); + *p++ |= (u_char)(fat[cl].next << 4); + *p++ = (u_char)(fat[cl].next >> 4); break; } } From owner-svn-src-head@freebsd.org Tue Jun 4 08: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 30ED415A758F; Tue, 4 Jun 2019 08:06:53 +0000 (UTC) (envelope-from hselasky@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 C7B2E8C2E0; Tue, 4 Jun 2019 08:06:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A48FD1ABD8; Tue, 4 Jun 2019 08:06:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5486q7Y001167; Tue, 4 Jun 2019 08:06:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5486qTx001166; Tue, 4 Jun 2019 08:06:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906040806.x5486qTx001166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 4 Jun 2019 08:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348603 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 348603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7B2E8C2E0 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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, 04 Jun 2019 08:06:53 -0000 Author: hselasky Date: Tue Jun 4 08:06:51 2019 New Revision: 348603 URL: https://svnweb.freebsd.org/changeset/base/348603 Log: Make sure the DMA tags get freed in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Jun 4 07:02:20 2019 (r348602) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Jun 4 08:06:51 2019 (r348603) @@ -1331,6 +1331,7 @@ mlx5e_destroy_rq(struct mlx5e_rq *rq) } free(rq->mbuf, M_MLX5EN); mlx5_wq_destroy(&rq->wq_ctrl); + bus_dma_tag_destroy(rq->dma_tag); } static int @@ -1655,6 +1656,7 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); + bus_dma_tag_destroy(sq->dma_tag); } int Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Tue Jun 4 07:02:20 2019 (r348602) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Tue Jun 4 08:06:51 2019 (r348603) @@ -156,6 +156,7 @@ mlx5e_rl_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); + bus_dma_tag_destroy(sq->dma_tag); } static int From owner-svn-src-head@freebsd.org Tue Jun 4 09:01: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 0178B15A91EA; Tue, 4 Jun 2019 09:01:03 +0000 (UTC) (envelope-from hselasky@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 9AAF48E2A1; Tue, 4 Jun 2019 09:01:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 72A631B484; Tue, 4 Jun 2019 09:01:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54912g1029097; Tue, 4 Jun 2019 09:01:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x549127t029096; Tue, 4 Jun 2019 09:01:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906040901.x549127t029096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 4 Jun 2019 09:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348604 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 348604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AAF48E2A1 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)[-1.000,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: Tue, 04 Jun 2019 09:01:03 -0000 Author: hselasky Date: Tue Jun 4 09:01:02 2019 New Revision: 348604 URL: https://svnweb.freebsd.org/changeset/base/348604 Log: In xhci(4) there is no stream ID in the completion TRB. Instead iterate all the stream IDs in stream mode to find the matching USB transfer. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Jun 4 08:06:51 2019 (r348603) +++ head/sys/dev/usb/controller/xhci.c Tue Jun 4 09:01:02 2019 (r348604) @@ -891,7 +891,7 @@ xhci_check_transfer(struct xhci_softc *sc, struct xhci uint64_t td_event; uint32_t temp; uint32_t remainder; - uint16_t stream_id; + uint16_t stream_id = 0; uint16_t i; uint8_t status; uint8_t halted; @@ -904,7 +904,6 @@ xhci_check_transfer(struct xhci_softc *sc, struct xhci remainder = XHCI_TRB_2_REM_GET(temp); status = XHCI_TRB_2_ERROR_GET(temp); - stream_id = XHCI_TRB_2_STREAM_GET(temp); temp = le32toh(trb->dwTrb3); epno = XHCI_TRB_3_EP_GET(temp); @@ -914,8 +913,8 @@ xhci_check_transfer(struct xhci_softc *sc, struct xhci halted = (status != XHCI_TRB_ERROR_SHORT_PKT && status != XHCI_TRB_ERROR_SUCCESS); - DPRINTF("slot=%u epno=%u stream=%u remainder=%u status=%u\n", - index, epno, stream_id, remainder, status); + DPRINTF("slot=%u epno=%u remainder=%u status=%u\n", + index, epno, remainder, status); if (index > sc->sc_noslot) { DPRINTF("Invalid slot.\n"); @@ -929,18 +928,19 @@ xhci_check_transfer(struct xhci_softc *sc, struct xhci pepext = &sc->sc_hw.devs[index].endp[epno]; - if (pepext->trb_ep_mode != USB_EP_MODE_STREAMS) { - stream_id = 0; - DPRINTF("stream_id=0\n"); - } else if (stream_id >= XHCI_MAX_STREAMS) { - DPRINTF("Invalid stream ID.\n"); - return; - } - /* try to find the USB transfer that generated the event */ - for (i = 0; i != (XHCI_MAX_TRANSFERS - 1); i++) { + for (i = 0;; i++) { struct usb_xfer *xfer; struct xhci_td *td; + + if (i == (XHCI_MAX_TRANSFERS - 1)) { + if (pepext->trb_ep_mode != USB_EP_MODE_STREAMS || + stream_id == (XHCI_MAX_STREAMS - 1)) + break; + stream_id++; + i = 0; + DPRINTFN(5, "stream_id=%u\n", stream_id); + } xfer = pepext->xfer[i + (XHCI_MAX_TRANSFERS * stream_id)]; if (xfer == NULL) From owner-svn-src-head@freebsd.org Tue Jun 4 12:56: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 298B515AFA79; Tue, 4 Jun 2019 12:56:21 +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 BFBB196216; Tue, 4 Jun 2019 12:56:20 +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 958261DC46; Tue, 4 Jun 2019 12:56:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54CuKQu053488; Tue, 4 Jun 2019 12:56:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54CuKA8053487; Tue, 4 Jun 2019 12:56:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041256.x54CuKA8053487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 12:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348609 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFBB196216 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,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, 04 Jun 2019 12:56:21 -0000 Author: emaste Date: Tue Jun 4 12:56:20 2019 New Revision: 348609 URL: https://svnweb.freebsd.org/changeset/base/348609 Log: Makefile.inc1: clean up stale dependency hacks Carrying on from r339607, remove ad-hoc dependency cleanup for changes prior to June 2018. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 4 10:36:26 2019 (r348608) +++ head/Makefile.inc1 Tue Jun 4 12:56:20 2019 (r348609) @@ -939,13 +939,8 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY # Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls -# 20180404 r332048 sigreturn -# 20180405 r332080 shmat -# 20180406 r332119 setlogin -# 20180411 r332443 exect -# 20180525 r334224 vadvise # 20180604 r334626 brk sbrk -.for f in brk exect sbrk setlogin shmat sigreturn vadvise +.for f in brk sbrk @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ echo "Removing stale dependencies for ${f} syscall wrappers"; \ From owner-svn-src-head@freebsd.org Tue Jun 4 13:00: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 B33F915AFCBE; Tue, 4 Jun 2019 13:00:50 +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 57E6F963E8; Tue, 4 Jun 2019 13:00:50 +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 443EE1DC64; Tue, 4 Jun 2019 13:00:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54D0ogJ056001; Tue, 4 Jun 2019 13:00:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54D0n9O056000; Tue, 4 Jun 2019 13:00:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041300.x54D0n9O056000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 13:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348610 - in head: lib/clang/libllvm usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/clang/libllvm usr.bin/clang X-SVN-Commit-Revision: 348610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57E6F963E8 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,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, 04 Jun 2019 13:00:50 -0000 Author: emaste Date: Tue Jun 4 13:00:49 2019 New Revision: 348610 URL: https://svnweb.freebsd.org/changeset/base/348610 Log: build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS) To facilitate experimentation with LTO we require an ar that supports LLVM IR, and to a lesser degree also an nm. As a first step always install llvm-ar and llvm-nm. Sponsored by: The FreeBSD Foundation Modified: head/lib/clang/libllvm/Makefile head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Tue Jun 4 12:56:20 2019 (r348609) +++ head/lib/clang/libllvm/Makefile Tue Jun 4 13:00:49 2019 (r348610) @@ -718,8 +718,8 @@ SRCS_EXT+= MCA/Support.cpp SRCS_MIN+= Object/Archive.cpp SRCS_MIN+= Object/ArchiveWriter.cpp SRCS_MIN+= Object/Binary.cpp -SRCS_EXT+= Object/COFFImportFile.cpp -SRCS_EXT+= Object/COFFModuleDefinition.cpp +SRCS_MIN+= Object/COFFImportFile.cpp +SRCS_MIN+= Object/COFFModuleDefinition.cpp SRCS_MIN+= Object/COFFObjectFile.cpp SRCS_MIN+= Object/Decompressor.cpp SRCS_MIN+= Object/ELF.cpp @@ -1256,7 +1256,7 @@ SRCS_MIN+= Target/X86/X86VZeroUpper.cpp SRCS_MIN+= Target/X86/X86WinAllocaExpander.cpp SRCS_MIN+= Target/X86/X86WinEHState.cpp .endif # MK_LLVM_TARGET_X86 -SRCS_EXT+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp +SRCS_MIN+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp SRCS_EXL+= ToolDrivers/llvm-lib/LibDriver.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/TruncInstCombine.cpp Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Tue Jun 4 12:56:20 2019 (r348609) +++ head/usr.bin/clang/Makefile Tue Jun 4 13:00:49 2019 (r348610) @@ -7,6 +7,8 @@ SUBDIR+= clang-tblgen SUBDIR+= llvm-tblgen .if !defined(TOOLS_PREFIX) +SUBDIR+= llvm-ar +SUBDIR+= llvm-nm SUBDIR+= llvm-objdump SUBDIR+= llvm-symbolizer @@ -15,7 +17,6 @@ SUBDIR+= bugpoint SUBDIR+= clang-format SUBDIR+= llc SUBDIR+= lli -SUBDIR+= llvm-ar SUBDIR+= llvm-as SUBDIR+= llvm-bcanalyzer SUBDIR+= llvm-cxxdump @@ -30,7 +31,6 @@ SUBDIR+= llvm-lto2 SUBDIR+= llvm-mc SUBDIR+= llvm-mca SUBDIR+= llvm-modextract -SUBDIR+= llvm-nm SUBDIR+= llvm-objcopy SUBDIR+= llvm-pdbutil SUBDIR+= llvm-rtdyld From owner-svn-src-head@freebsd.org Tue Jun 4 13: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 1EC8915AFE70; Tue, 4 Jun 2019 13:07:14 +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 B75E696941; Tue, 4 Jun 2019 13:07:13 +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 924A21DDF9; Tue, 4 Jun 2019 13:07:13 +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 x54D7Dmt058702; Tue, 4 Jun 2019 13:07:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54D7Acf058688; Tue, 4 Jun 2019 13:07:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041307.x54D7Acf058688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 13:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348611 - in head/sys: conf kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: conf kern X-SVN-Commit-Revision: 348611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B75E696941 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)[-1.000,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: Tue, 04 Jun 2019 13:07:14 -0000 Author: emaste Date: Tue Jun 4 13:07:10 2019 New Revision: 348611 URL: https://svnweb.freebsd.org/changeset/base/348611 Log: Expose the kernel's build-ID through sysctl After our migration (of certain architectures) to lld the kernel is built with a unique build-ID. Make it available via a sysctl and uname(1) to allow the user to identify their running kernel. Submitted by: Ali Mashtizadeh MFC after: 2 weeks Relnotes: Yes Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20326 Modified: head/sys/conf/ldscript.amd64 head/sys/conf/ldscript.arm head/sys/conf/ldscript.arm64 head/sys/conf/ldscript.i386 head/sys/conf/ldscript.mips head/sys/conf/ldscript.mips.cfe head/sys/conf/ldscript.mips.mips64 head/sys/conf/ldscript.mips.octeon1 head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpc64 head/sys/conf/ldscript.powerpcspe head/sys/conf/ldscript.riscv head/sys/conf/ldscript.sparc64 head/sys/kern/kern_mib.c Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.amd64 Tue Jun 4 13:07:10 2019 (r348611) @@ -74,6 +74,11 @@ SECTIONS PROVIDE (etext = .); .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } Modified: head/sys/conf/ldscript.arm ============================================================================== --- head/sys/conf/ldscript.arm Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.arm Tue Jun 4 13:07:10 2019 (r348611) @@ -27,6 +27,11 @@ SECTIONS .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) } .rela.text : Modified: head/sys/conf/ldscript.arm64 ============================================================================== --- head/sys/conf/ldscript.arm64 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.arm64 Tue Jun 4 13:07:10 2019 (r348611) @@ -27,6 +27,11 @@ SECTIONS .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) } .rela.text : Modified: head/sys/conf/ldscript.i386 ============================================================================== --- head/sys/conf/ldscript.i386 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.i386 Tue Jun 4 13:07:10 2019 (r348611) @@ -62,6 +62,11 @@ SECTIONS PROVIDE (etext = .); .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } Modified: head/sys/conf/ldscript.mips ============================================================================== --- head/sys/conf/ldscript.mips Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.mips Tue Jun 4 13:07:10 2019 (r348611) @@ -63,6 +63,11 @@ SECTIONS .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .rel.init : { *(.rel.init) } .rela.init : { *(.rela.init) } .rel.text : Modified: head/sys/conf/ldscript.mips.cfe ============================================================================== --- head/sys/conf/ldscript.mips.cfe Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.mips.cfe Tue Jun 4 13:07:10 2019 (r348611) @@ -192,6 +192,11 @@ SECTIONS PROVIDE (etext = .); .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .reginfo : { *(.reginfo) } .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } Modified: head/sys/conf/ldscript.mips.mips64 ============================================================================== --- head/sys/conf/ldscript.mips.mips64 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.mips.mips64 Tue Jun 4 13:07:10 2019 (r348611) @@ -176,6 +176,11 @@ SECTIONS PROVIDE (etext = .); .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .reginfo : { *(.reginfo) } .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } Modified: head/sys/conf/ldscript.mips.octeon1 ============================================================================== --- head/sys/conf/ldscript.mips.octeon1 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.mips.octeon1 Tue Jun 4 13:07:10 2019 (r348611) @@ -23,6 +23,12 @@ SECTIONS { *(.rodata) . = ALIGN(32); } + + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .data : { _rwdata = .; Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.powerpc Tue Jun 4 13:07:10 2019 (r348611) @@ -55,6 +55,11 @@ SECTIONS .fini : { *(.fini) } =0 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .sdata2 : { *(.sdata2) } .sbss2 : { *(.sbss2) } /* Adjust the address for the data segment to the next page up. */ Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.powerpc64 Tue Jun 4 13:07:10 2019 (r348611) @@ -46,6 +46,11 @@ SECTIONS .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) } .rela.data : Modified: head/sys/conf/ldscript.powerpcspe ============================================================================== --- head/sys/conf/ldscript.powerpcspe Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.powerpcspe Tue Jun 4 13:07:10 2019 (r348611) @@ -55,6 +55,11 @@ SECTIONS .fini : { *(.fini) } =0 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .sdata2 : { *(.sdata2) } .sbss2 : { *(.sbss2) } /* Adjust the address for the data segment to the next page up. */ Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.riscv Tue Jun 4 13:07:10 2019 (r348611) @@ -27,6 +27,11 @@ SECTIONS .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) } .rela.text : Modified: head/sys/conf/ldscript.sparc64 ============================================================================== --- head/sys/conf/ldscript.sparc64 Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/conf/ldscript.sparc64 Tue Jun 4 13:07:10 2019 (r348611) @@ -146,6 +146,11 @@ SECTIONS PROVIDE (etext = .); .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } + .note.gnu.build-id : { + PROVIDE (__build_id_start = .); + *(.note.gnu.build-id) + PROVIDE (__build_id_end = .); + } .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } . = ALIGN(0x2000) + (. & (0x2000 - 1)); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Jun 4 13:00:49 2019 (r348610) +++ head/sys/kern/kern_mib.c Tue Jun 4 13:07:10 2019 (r348611) @@ -481,6 +481,54 @@ SYSCTL_PROC(_kern, KERN_OSRELDATE, osreldate, CTLTYPE_INT | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_osreldate, "I", "Kernel release date"); +/* + * The build-id is copied from the ELF section .note.gnu.build-id. The linker + * script defines two variables to expose the beginning and end. LLVM + * currently uses a SHA-1 hash, but other formats can be supported by checking + * the length of the section. + */ + +extern char __build_id_start[]; +extern char __build_id_end[]; + +#define BUILD_ID_HEADER_LEN 0x10 +#define BUILD_ID_HASH_MAXLEN 0x14 + +static int +sysctl_build_id(SYSCTL_HANDLER_ARGS) +{ + uintptr_t sectionlen = (uintptr_t)(__build_id_end - __build_id_start); + int hashlen; + char buf[2*BUILD_ID_HASH_MAXLEN+1]; + + /* + * The ELF note section has a four byte length for the vendor name, + * four byte length for the value, and a four byte vendor specific + * type. The name for the build id is "GNU\0". We skip the first 16 + * bytes to read the build hash. We will return the remaining bytes up + * to 20 (SHA-1) hash size. If the hash happens to be a custom number + * of bytes we will pad the value with zeros, as the section should be + * four byte aligned. + */ + if (sectionlen <= BUILD_ID_HEADER_LEN || + sectionlen > (BUILD_ID_HEADER_LEN + BUILD_ID_HASH_MAXLEN)) { + return (ENOENT); + } + + + hashlen = sectionlen - BUILD_ID_HEADER_LEN; + for (int i = 0; i < hashlen; i++) { + uint8_t c = __build_id_start[i+BUILD_ID_HEADER_LEN]; + snprintf(&buf[2*i], 3, "%02x", c); + } + + return (SYSCTL_OUT(req, buf, strlen(buf) + 1)); +} + +SYSCTL_PROC(_kern, OID_AUTO, build_id, + CTLTYPE_STRING | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_build_id, "A", "Operating system build-id"); + SYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD, 0, "Kernel Features"); #ifdef COMPAT_FREEBSD4 From owner-svn-src-head@freebsd.org Tue Jun 4 13:45: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 40C3515B1217; Tue, 4 Jun 2019 13:45:31 +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 D5A51681CE; Tue, 4 Jun 2019 13:45:30 +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 BEB9D1E4B7; Tue, 4 Jun 2019 13:45:30 +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 x54DjUOr079541; Tue, 4 Jun 2019 13:45:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54DjUSu079540; Tue, 4 Jun 2019 13:45:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041345.x54DjUSu079540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 13:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348612 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5A51681CE 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)[-1.000,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: Tue, 04 Jun 2019 13:45:31 -0000 Author: emaste Date: Tue Jun 4 13:45:30 2019 New Revision: 348612 URL: https://svnweb.freebsd.org/changeset/base/348612 Log: style(9) / tidying for r348611 MFC with: r348611 Event: Waterloo Hackathon 2019 Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Jun 4 13:07:10 2019 (r348611) +++ head/sys/kern/kern_mib.c Tue Jun 4 13:45:30 2019 (r348612) @@ -482,9 +482,9 @@ SYSCTL_PROC(_kern, KERN_OSRELDATE, osreldate, NULL, 0, sysctl_osreldate, "I", "Kernel release date"); /* - * The build-id is copied from the ELF section .note.gnu.build-id. The linker - * script defines two variables to expose the beginning and end. LLVM - * currently uses a SHA-1 hash, but other formats can be supported by checking + * The build-id is copied from the ELF section .note.gnu.build-id. The linker + * script defines two variables to expose the beginning and end. LLVM + * currently uses a SHA-1 hash, but other formats can be supported by checking * the length of the section. */ @@ -503,23 +503,23 @@ sysctl_build_id(SYSCTL_HANDLER_ARGS) /* * The ELF note section has a four byte length for the vendor name, - * four byte length for the value, and a four byte vendor specific - * type. The name for the build id is "GNU\0". We skip the first 16 - * bytes to read the build hash. We will return the remaining bytes up - * to 20 (SHA-1) hash size. If the hash happens to be a custom number - * of bytes we will pad the value with zeros, as the section should be + * four byte length for the value, and a four byte vendor specific + * type. The name for the build id is "GNU\0". We skip the first 16 + * bytes to read the build hash. We will return the remaining bytes up + * to 20 (SHA-1) hash size. If the hash happens to be a custom number + * of bytes we will pad the value with zeros, as the section should be * four byte aligned. */ if (sectionlen <= BUILD_ID_HEADER_LEN || sectionlen > (BUILD_ID_HEADER_LEN + BUILD_ID_HASH_MAXLEN)) { - return (ENOENT); + return (ENOENT); } - + hashlen = sectionlen - BUILD_ID_HEADER_LEN; for (int i = 0; i < hashlen; i++) { - uint8_t c = __build_id_start[i+BUILD_ID_HEADER_LEN]; - snprintf(&buf[2*i], 3, "%02x", c); + uint8_t c = __build_id_start[i+BUILD_ID_HEADER_LEN]; + snprintf(&buf[2*i], 3, "%02x", c); } return (SYSCTL_OUT(req, buf, strlen(buf) + 1)); From owner-svn-src-head@freebsd.org Tue Jun 4 14:15: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 1AA7815B22BD for ; Tue, 4 Jun 2019 14:15:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 A47436ADB1 for ; Tue, 4 Jun 2019 14:15:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82e.google.com with SMTP id x47so13851972qtk.11 for ; Tue, 04 Jun 2019 07:15:32 -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=VkpEExDVhc6LmNduZSbQB1sQg8GqJWkaUPbHXUubDf4=; b=FH8UX9PEzsbgch6k0cLsYrN3/PInsdrcLVo8V70Wp60+404ISFX0YlX1a+dyvUJ/L8 bsKQFPQzf89tJnqco6xUbJWgO1kXLrN0+PaWf94qY39MQbI1VnufiDtLWyTfdOyfndHl PA5qT9QPx+yBg00wGdoV9xbR5TO7CAnZSvlZOl26QpSiCpTvlIurzjJoPipfCq2Z+w0/ G1UnB1DsvY++Z0vBEPtmfDm1Ig+yZwTDVjUoFGTmvS6/sosPiOoCGAjhDyolnVemG5HD ADAfWT6lKAux8+VA3YIvsKZDs5y0jv5KQttzHIhodfffA2ZYlee/KjUn+mXe8LiyFSX7 wRRw== 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=VkpEExDVhc6LmNduZSbQB1sQg8GqJWkaUPbHXUubDf4=; b=RfbMmBYfUZRC7iIKkKtxviyyRfrga0AyqfoejjrG9rOpJowSim6aRgJOpZZ4zPw2Xz 4RIMEpjjWFQorgddZ2T8UhbkmVJFZSOJ5ji/GC34209JiWcyIwQaOj63gZYMjdIXzJgk +2HGcjry3+dukfHEkq7EdjzwVzBJjvpSDx28uOZxtOigX04IfjTyCu+BL5/wmrf0Yyo0 RFdvS0N7Dh1O5LBYLMGKMXyPRtgWJv0xC3ijhRurhrXo3bT4XokfLDV9TTPyCgpbni8+ /nXsax8o9+VdMWlfjHiWGrwawiGxUlEqDpfinyUQtL813gdzw8Uwp/D7yjt3Z80sepVJ p5lA== X-Gm-Message-State: APjAAAUo5/de6rsX6FMiz5Ms4sVFuJkh3wRF+MjXKmkGJS0C310UP5pN ztGfs5FkGoG1mw007B9Z9c/csA== X-Google-Smtp-Source: APXvYqxzha74D8wfwkg7JT7Ujwtt78UqoPXjDafKBauGyW66MOQWsNCFITEcTOejHXlKpWN0X5o2aw== X-Received: by 2002:aed:24ae:: with SMTP id t43mr28561191qtc.187.1559657731601; Tue, 04 Jun 2019 07:15:31 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id 29sm11895593qty.87.2019.06.04.07.15.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 07:15:30 -0700 (PDT) Date: Tue, 4 Jun 2019 10:15:30 -0400 From: Shawn Webb To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348611 - in head/sys: conf kern Message-ID: <20190604141530.sbdlvxskwur2wofm@mutt-hbsd> References: <201906041307.x54D7Acf058688@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zy7yc6zpebzosayb" Content-Disposition: inline In-Reply-To: <201906041307.x54D7Acf058688@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: A47436ADB1 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.985,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, 04 Jun 2019 14:15:33 -0000 --zy7yc6zpebzosayb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 04, 2019 at 01:07:10PM +0000, Ed Maste wrote: > Author: emaste > Date: Tue Jun 4 13:07:10 2019 > New Revision: 348611 > URL: https://svnweb.freebsd.org/changeset/base/348611 >=20 > Log: > Expose the kernel's build-ID through sysctl > =20 > After our migration (of certain architectures) to lld the kernel is bui= lt > with a unique build-ID. Make it available via a sysctl and uname(1) to > allow the user to identify their running kernel. > =20 > Submitted by: Ali Mashtizadeh > MFC after: 2 weeks > Relnotes: Yes > Event: Waterloo Hackathon 2019 > Differential Revision: https://reviews.freebsd.org/D20326 Does this impact reproducible builds at all? 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 --zy7yc6zpebzosayb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz2fP0ACgkQ/y5nonf4 4fpMLRAAj+FIjwQWqGCebpegCi8W1iDubqTupipvfXgTAbKllc6hWPlevAnOcjKD JF5Bm2BWDXRUtahniOTpHICNPFIWiGoYh7nNouEjUllkqIgW2Sz8jOJz/44UETJU lF7H0mPwB3aAfPd0sFg1Wj/+az+Ec9x44ZdubU2ic+ywm9t4Jq5Dqsk+fIh4sNsE gBwqLTp3q1vIVS9y24k0mzNPNzrlkGRponDxkQWH6JWIQs6vDiTZCtdBevadtptk gj5FrvLD+leaC+MjESFlCYvuKiIr0cN5yTFpQo1Pwt10TojOYWj80Qz3GuQz3/tZ oA3TRHMoOuQ17LQHZBF4fQ6hKc/SPutCBX6KrxvHrUsBmgRt3ZiyHBWzkmm6Gb0E Tg87cd0pyEFxMrSHOmc6rvIH021gL7XXyoT9mh88lAGsYWlN4EHbq3XlKvvDDoyY FS5U4f5pc2rZ5G26U70c7rL3lyEDwyGHD68CM14+GS/suOscaNVe+SoYYQvvLrvR y6iwcliYgJS2tibpzL/Ki3KxCPv2aEhXYvRQ0+f8yMoNzCxPRt5MUdB8+3vRxB5K Jm6qx+ajhctCbrnEkn15t6HR8kGtiFU60+62a5e3mQTLqN9Mdm31bND8I3LTcYMJ 75vGFXp70sumurnHi85K5alc+wzGVfbw3TxMgzZ20ItEx0UJ8bc= =hpZD -----END PGP SIGNATURE----- --zy7yc6zpebzosayb-- From owner-svn-src-head@freebsd.org Tue Jun 4 14:58: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 BBDDE15B3342 for ; Tue, 4 Jun 2019 14:58:10 +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 1E2A56C747 for ; Tue, 4 Jun 2019 14:58:09 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559660282; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=b1FJQDQSA6h3ZXiQCHZKHvRzPeyqOoNEN9wCuRl4ANndE+VjkpCfOecUpZAtIMMJGruQYscmWzF4L cIOPNWt2MYtp4W1hY1fLBBxm2izeIkhBeh/MF+S7z49hBjkE9pjBH2XG93PpEEMT3dWaS2Dg3iiIuS siUKKjBvt0eP/v62AzSdh90JK4Ui4acc/dz0yli0YaK0mTWXSlNNi6an2JDpoaBohtmpHZObmHgQrv gNdP0br3YSSdZKtuxikTstkUE/i4A09ncxGbSoIVmckfCYPXaUlpRHZxTuYXqVMF2w4v8uII4mp7H6 30d6P1zfGann+IC4o2Ewpr5gJv4RUMw== 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=Dl0OU0jHCACnoKmjvuEFw7JG2N0zMFmOpZWfb3iqNhE=; b=RMeS9KlzwMR1hSGMHPmM4cGy0QKWKdoMQ9d0G65aKYrYZCGC5bQTzFOkv8T/IE8rZmMDY9jwAqkxX bl+GQbEMKNf+mMjQaD6OERJaXNKwEO/0ij1bYE2VlXqJQ88WbkTr4XG7tjwcIVQ82ZYnyZgsvv7iHA pHgvSoHfhR1wi2M4nllCViPZpUeieQccGtwbupaDCj3dMZa7xnugZiXFHdvmTymDfBJCY7p02icaRX oCOiEEgfs6kc2+RhOoLacI1PjLHMHdS0CDKTGvA+25tuYqak9XwAtnArr8foZuuxb0YZY+0ruglB1i PQPZP4pkjCXFFxnDEv7/3ngjw1EbRqQ== 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:to:from:subject:message-id:from; bh=Dl0OU0jHCACnoKmjvuEFw7JG2N0zMFmOpZWfb3iqNhE=; b=NdXOtedKllzmWxWPBZcnGJR7dnfxGNvoJbJ2w0oiSnUWq7hxoDl0E9H2cczM8SyQXn8EehWfbJHxH oaNzaeV0L3tpLBnfxl2Z/QdDEZebbIqh6GNmavKFMjsCKIGQHRpzZxBVjSNL1KsBtVuhGnsJfFmMhU i/91rk8uVMDe8WCsCzyyAunj8kaA0gwOgxpJx0xDWq76jnS3EOQaee484ZzkcoY3FzsD2zBBM0StAD 9serp6efO2EXa7OrV1YRsT2s97LkP6ybSfOZ06v+ZiHwQrpZoG3lfNtUirfc0LcMFHyo0Fg5nfyM1T wTwnnRr8t0ery6irDKjvC+Ko/wiuNLw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 2518b291-86d9-11e9-b399-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 2518b291-86d9-11e9-b399-9d2c53d3dedb; Tue, 04 Jun 2019 14:58:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x54Evxj8060216; Tue, 4 Jun 2019 08:57:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <0708f493570462d065fa0ba3c361832720e60741.camel@freebsd.org> Subject: Re: svn commit: r348611 - in head/sys: conf kern From: Ian Lepore To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 04 Jun 2019 08:57:59 -0600 In-Reply-To: <201906041307.x54D7Acf058688@repo.freebsd.org> References: <201906041307.x54D7Acf058688@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: 1E2A56C747 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.993,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, 04 Jun 2019 14:58:11 -0000 On Tue, 2019-06-04 at 13:07 +0000, Ed Maste wrote: > Author: emaste > Date: Tue Jun 4 13:07:10 2019 > New Revision: 348611 > URL: https://svnweb.freebsd.org/changeset/base/348611 > > Log: > Expose the kernel's build-ID through sysctl > > After our migration (of certain architectures) to lld the kernel is built > with a unique build-ID. Make it available via a sysctl and uname(1) to > allow the user to identify their running kernel. > Won't this impact WITH_REPRODUCIBLE_BUILD? -- Ian > Submitted by: Ali Mashtizadeh > MFC after: 2 weeks > Relnotes: Yes > Event: Waterloo Hackathon 2019 > Differential Revision: https://reviews.freebsd.org/D20326 > > Modified: > head/sys/conf/ldscript.amd64 > head/sys/conf/ldscript.arm > head/sys/conf/ldscript.arm64 > head/sys/conf/ldscript.i386 > head/sys/conf/ldscript.mips > head/sys/conf/ldscript.mips.cfe > head/sys/conf/ldscript.mips.mips64 > head/sys/conf/ldscript.mips.octeon1 > head/sys/conf/ldscript.powerpc > head/sys/conf/ldscript.powerpc64 > head/sys/conf/ldscript.powerpcspe > head/sys/conf/ldscript.riscv > head/sys/conf/ldscript.sparc64 > head/sys/kern/kern_mib.c > > Modified: head/sys/conf/ldscript.amd64 > ===================================================================== > ========= > --- head/sys/conf/ldscript.amd64 Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.amd64 Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -74,6 +74,11 @@ SECTIONS > PROVIDE (etext = .); > .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .eh_frame_hdr : { *(.eh_frame_hdr) } > .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table > .gcc_except_table.*) } > > Modified: head/sys/conf/ldscript.arm > ===================================================================== > ========= > --- head/sys/conf/ldscript.arm Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.arm Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -27,6 +27,11 @@ SECTIONS > .gnu.version : { *(.gnu.version) } > .gnu.version_d : { *(.gnu.version_d) } > .gnu.version_r : { *(.gnu.version_r) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .rel.text : > { *(.rel.text) *(.rel.gnu.linkonce.t*) } > .rela.text : > > Modified: head/sys/conf/ldscript.arm64 > ===================================================================== > ========= > --- head/sys/conf/ldscript.arm64 Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.arm64 Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -27,6 +27,11 @@ SECTIONS > .gnu.version : { *(.gnu.version) } > .gnu.version_d : { *(.gnu.version_d) } > .gnu.version_r : { *(.gnu.version_r) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .rel.text : > { *(.rel.text) *(.rel.gnu.linkonce.t*) } > .rela.text : > > Modified: head/sys/conf/ldscript.i386 > ===================================================================== > ========= > --- head/sys/conf/ldscript.i386 Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.i386 Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -62,6 +62,11 @@ SECTIONS > PROVIDE (etext = .); > .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .eh_frame_hdr : { *(.eh_frame_hdr) } > .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table > .gcc_except_table.*) } > > Modified: head/sys/conf/ldscript.mips > ===================================================================== > ========= > --- head/sys/conf/ldscript.mips Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.mips Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -63,6 +63,11 @@ SECTIONS > .gnu.version : { *(.gnu.version) } > .gnu.version_d : { *(.gnu.version_d) } > .gnu.version_r : { *(.gnu.version_r) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .rel.init : { *(.rel.init) } > .rela.init : { *(.rela.init) } > .rel.text : > > Modified: head/sys/conf/ldscript.mips.cfe > ===================================================================== > ========= > --- head/sys/conf/ldscript.mips.cfe Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.mips.cfe Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -192,6 +192,11 @@ SECTIONS > PROVIDE (etext = .); > .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .reginfo : { *(.reginfo) } > .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } > .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } > > Modified: head/sys/conf/ldscript.mips.mips64 > ===================================================================== > ========= > --- head/sys/conf/ldscript.mips.mips64 Tue Jun 4 13:00:49 > 2019 (r348610) > +++ head/sys/conf/ldscript.mips.mips64 Tue Jun 4 13:07:10 > 2019 (r348611) > @@ -176,6 +176,11 @@ SECTIONS > PROVIDE (etext = .); > .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .reginfo : { *(.reginfo) } > .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } > .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } > > Modified: head/sys/conf/ldscript.mips.octeon1 > ===================================================================== > ========= > --- head/sys/conf/ldscript.mips.octeon1 Tue Jun 4 13:00:49 > 2019 (r348610) > +++ head/sys/conf/ldscript.mips.octeon1 Tue Jun 4 13:07:10 > 2019 (r348611) > @@ -23,6 +23,12 @@ SECTIONS { > *(.rodata) > . = ALIGN(32); > } > + > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > > .data : { > _rwdata = .; > > Modified: head/sys/conf/ldscript.powerpc > ===================================================================== > ========= > --- head/sys/conf/ldscript.powerpc Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.powerpc Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -55,6 +55,11 @@ SECTIONS > .fini : { *(.fini) } =0 > .rodata : { *(.rodata) *(.gnu.linkonce.r*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .sdata2 : { *(.sdata2) } > .sbss2 : { *(.sbss2) } > /* Adjust the address for the data segment to the next page up. */ > > Modified: head/sys/conf/ldscript.powerpc64 > ===================================================================== > ========= > --- head/sys/conf/ldscript.powerpc64 Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.powerpc64 Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -46,6 +46,11 @@ SECTIONS > .gnu.version : { *(.gnu.version) } > .gnu.version_d : { *(.gnu.version_d) } > .gnu.version_r : { *(.gnu.version_r) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .rela.text : > { *(.rela.text) *(.rela.gnu.linkonce.t*) } > .rela.data : > > Modified: head/sys/conf/ldscript.powerpcspe > ===================================================================== > ========= > --- head/sys/conf/ldscript.powerpcspe Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.powerpcspe Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -55,6 +55,11 @@ SECTIONS > .fini : { *(.fini) } =0 > .rodata : { *(.rodata) *(.gnu.linkonce.r*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .sdata2 : { *(.sdata2) } > .sbss2 : { *(.sbss2) } > /* Adjust the address for the data segment to the next page up. */ > > Modified: head/sys/conf/ldscript.riscv > ===================================================================== > ========= > --- head/sys/conf/ldscript.riscv Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.riscv Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -27,6 +27,11 @@ SECTIONS > .gnu.version : { *(.gnu.version) } > .gnu.version_d : { *(.gnu.version_d) } > .gnu.version_r : { *(.gnu.version_r) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .rel.text : > { *(.rel.text) *(.rel.gnu.linkonce.t*) } > .rela.text : > > Modified: head/sys/conf/ldscript.sparc64 > ===================================================================== > ========= > --- head/sys/conf/ldscript.sparc64 Tue Jun 4 13:00:49 2019 (r348 > 610) > +++ head/sys/conf/ldscript.sparc64 Tue Jun 4 13:07:10 2019 (r348 > 611) > @@ -146,6 +146,11 @@ SECTIONS > PROVIDE (etext = .); > .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } > .rodata1 : { *(.rodata1) } > + .note.gnu.build-id : { > + PROVIDE (__build_id_start = .); > + *(.note.gnu.build-id) > + PROVIDE (__build_id_end = .); > + } > .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } > .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } > . = ALIGN(0x2000) + (. & (0x2000 - 1)); > > Modified: head/sys/kern/kern_mib.c > ===================================================================== > ========= > --- head/sys/kern/kern_mib.c Tue Jun 4 13:00:49 2019 (r348610) > +++ head/sys/kern/kern_mib.c Tue Jun 4 13:07:10 2019 (r348611) > @@ -481,6 +481,54 @@ SYSCTL_PROC(_kern, KERN_OSRELDATE, osreldate, > CTLTYPE_INT | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, > NULL, 0, sysctl_osreldate, "I", "Kernel release date"); > > +/* > + * The build-id is copied from the ELF section .note.gnu.build- > id. The linker > + * script defines two variables to expose the beginning and > end. LLVM > + * currently uses a SHA-1 hash, but other formats can be supported > by checking > + * the length of the section. > + */ > + > +extern char __build_id_start[]; > +extern char __build_id_end[]; > + > +#define BUILD_ID_HEADER_LEN 0x10 > +#define BUILD_ID_HASH_MAXLEN 0x14 > + > +static int > +sysctl_build_id(SYSCTL_HANDLER_ARGS) > +{ > + uintptr_t sectionlen = (uintptr_t)(__build_id_end - > __build_id_start); > + int hashlen; > + char buf[2*BUILD_ID_HASH_MAXLEN+1]; > + > + /* > + * The ELF note section has a four byte length for the vendor > name, > + * four byte length for the value, and a four byte vendor > specific > + * type. The name for the build id is "GNU\0". We skip the > first 16 > + * bytes to read the build hash. We will return the remaining > bytes up > + * to 20 (SHA-1) hash size. If the hash happens to be a custom > number > + * of bytes we will pad the value with zeros, as the section > should be > + * four byte aligned. > + */ > + if (sectionlen <= BUILD_ID_HEADER_LEN || > + sectionlen > (BUILD_ID_HEADER_LEN + BUILD_ID_HASH_MAXLEN)) > { > + return (ENOENT); > + } > + > + > + hashlen = sectionlen - BUILD_ID_HEADER_LEN; > + for (int i = 0; i < hashlen; i++) { > + uint8_t c = __build_id_start[i+BUILD_ID_HEADER_LEN]; > + snprintf(&buf[2*i], 3, "%02x", c); > + } > + > + return (SYSCTL_OUT(req, buf, strlen(buf) + 1)); > +} > + > +SYSCTL_PROC(_kern, OID_AUTO, build_id, > + CTLTYPE_STRING | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, > + NULL, 0, sysctl_build_id, "A", "Operating system build-id"); > + > SYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD, 0, "Kernel > Features"); > > #ifdef COMPAT_FREEBSD4 > From owner-svn-src-head@freebsd.org Tue Jun 4 15:44: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 28FE715B538D; Tue, 4 Jun 2019 15:44:32 +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 C29F76F649; Tue, 4 Jun 2019 15:44:31 +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 978131F95A; Tue, 4 Jun 2019 15:44:31 +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 x54FiVvx044088; Tue, 4 Jun 2019 15:44:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FiVXp044087; Tue, 4 Jun 2019 15:44:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041544.x54FiVXp044087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 15:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348628 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C29F76F649 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)[-1.000,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: Tue, 04 Jun 2019 15:44:32 -0000 Author: emaste Date: Tue Jun 4 15:44:31 2019 New Revision: 348628 URL: https://svnweb.freebsd.org/changeset/base/348628 Log: elf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits To support Intel CET IBT/Shadow Stack. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Tue Jun 4 15:42:30 2019 (r348627) +++ head/sys/sys/elf_common.h Tue Jun 4 15:44:31 2019 (r348628) @@ -785,6 +785,21 @@ typedef struct { #define NT_X86_XSTATE 0x202 /* x86 XSAVE extended state. */ #define NT_ARM_VFP 0x400 /* ARM VFP registers */ +/* GNU note types. */ +#define NT_GNU_ABI_TAG 1 +#define NT_GNU_HWCAP 2 +#define NT_GNU_BUILD_ID 3 +#define NT_GNU_GOLD_VERSION 4 +#define NT_GNU_PROPERTY_TYPE_0 5 + +#define GNU_PROPERTY_LOPROC 0xc0000000 +#define GNU_PROPERTY_HIPROC 0xdfffffff + +#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + +#define GNU_PROPERTY_X86_FEATURE_1_IBT 0x00000001 +#define GNU_PROPERTY_X86_FEATURE_1_SHSTK 0x00000002 + /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ #define STB_GLOBAL 1 /* Global symbol */ From owner-svn-src-head@freebsd.org Tue Jun 4 16:07: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 A838515B6173; Tue, 4 Jun 2019 16:07:02 +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 44AAC705EB; Tue, 4 Jun 2019 16:07:02 +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 1D4E61FD20; Tue, 4 Jun 2019 16:07:02 +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 x54G71pm054741; Tue, 4 Jun 2019 16:07:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54G71gb054740; Tue, 4 Jun 2019 16:07:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906041607.x54G71gb054740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 4 Jun 2019 16:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348629 - head/usr.sbin/daemon X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/daemon X-SVN-Commit-Revision: 348629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44AAC705EB 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)[-1.000,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: Tue, 04 Jun 2019 16:07:02 -0000 Author: cem Date: Tue Jun 4 16:07:01 2019 New Revision: 348629 URL: https://svnweb.freebsd.org/changeset/base/348629 Log: daemon(8): Don't block SIGTERM during restart delay I believe this was introduced in the original '-r' commit, r231911 (2012). At the time, the scope was limited to a 1 second sleep. r332518 (2018) added '-R', which increased the potential duration of the affected interval (from 1 to N seconds) by permitting arbitrary restart intervals. Instead, handle SIGTERM normally during restart-sleep, when the monitored process is not running, and shut down promptly. (I noticed this behavior when debugging a child process that exited quickly under the 'daemon -r -R 30' environment. 'kill ' had no immediate effect and the monitor process slept until the next restart attempt. This was annoying.) Reviewed by: allanjude, imp, markj Differential Revision: https://reviews.freebsd.org/D20509 Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Tue Jun 4 15:44:31 2019 (r348628) +++ head/usr.sbin/daemon/daemon.c Tue Jun 4 16:07:01 2019 (r348629) @@ -359,12 +359,13 @@ restart: } } } + if (restart && !terminate) + daemon_sleep(restart, 0); if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); goto exit; } if (restart && !terminate) { - daemon_sleep(restart, 0); close(pfd[0]); pfd[0] = -1; goto restart; @@ -384,7 +385,8 @@ static void daemon_sleep(time_t secs, long nsecs) { struct timespec ts = { secs, nsecs }; - while (nanosleep(&ts, &ts) == -1) { + + while (!terminate && nanosleep(&ts, &ts) == -1) { if (errno != EINTR) err(1, "nanosleep"); } From owner-svn-src-head@freebsd.org Tue Jun 4 16:21: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 303C415B65ED; Tue, 4 Jun 2019 16:21:15 +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 CA6EC70ED5; Tue, 4 Jun 2019 16:21:14 +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 A6F4B2004E; Tue, 4 Jun 2019 16:21:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54GLEf3060855; Tue, 4 Jun 2019 16:21:14 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54GLEWf060854; Tue, 4 Jun 2019 16:21:14 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906041621.x54GLEWf060854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 4 Jun 2019 16:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348630 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA6EC70ED5 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)[-1.000,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: Tue, 04 Jun 2019 16:21:15 -0000 Author: alc Date: Tue Jun 4 16:21:14 2019 New Revision: 348630 URL: https://svnweb.freebsd.org/changeset/base/348630 Log: The changes to pmap_demote_pde_locked()'s control flow in r348476 resulted in the loss of a KASSERT that guarded against the invalidation a wired mapping. Restore this KASSERT. Remove an unnecessary KASSERT from pmap_demote_pde_locked(). It guards against a state that was already handled at the start of the function. Reviewed by: kib X-MFC with: r348476 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jun 4 16:07:01 2019 (r348629) +++ head/sys/amd64/amd64/pmap.c Tue Jun 4 16:21:14 2019 (r348630) @@ -4565,6 +4565,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v * mapping was never accessed. */ if ((oldpde & PG_A) == 0) { + KASSERT((oldpde & PG_W) == 0, + ("pmap_demote_pde: a wired mapping is missing PG_A")); pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); return (FALSE); } @@ -4615,8 +4617,6 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); newpde = mptepa | PG_M | PG_A | (oldpde & PG_U) | PG_RW | PG_V; - KASSERT((oldpde & PG_A) != 0, - ("pmap_demote_pde: oldpde is missing PG_A")); KASSERT((oldpde & (PG_M | PG_RW)) != PG_RW, ("pmap_demote_pde: oldpde is missing PG_M")); newpte = oldpde & ~PG_PS; From owner-svn-src-head@freebsd.org Tue Jun 4 16:21: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 E414015B6634; Tue, 4 Jun 2019 16:21:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.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 8121E7106B; Tue, 4 Jun 2019 16:21:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f194.google.com with SMTP id h11so1075693itf.5; Tue, 04 Jun 2019 09:21:47 -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=YknPZLcM60gK8efVIZbcBVDpXNGOB9Be0Pptm4x94Lk=; b=kmz5sxsSi6r6tOMXgPt3kSzcBzk5CL32F3hYtENX0NKwRcdY72QawTehQcndWeHWxW g5GjA3O1eEF34p1kZLGI0PbenDQDs5s2clFroO9sF2WM0SAHf49MFyXqPLw5jvwyTSBb iGo8wb26aaQtpMgVvtbwfGDbiRsDtacNLcKvP4Ya8vOfC+5PpSiTNxjyYFsS2CzTTbSs WS5XbTVXqQk+opnRQeweLzeuvQyFEElSMC0hBm68T2Pyyg+NvwIAIlCBH7KSO0nBucWG wdt6B9aLGsWyM7jcctCCrT4HdZOvwgDKu+IhJ/rzOGLVr3pFB6tmpQeV2PTeEoZD8ndq F1hw== X-Gm-Message-State: APjAAAVLce9yjhqbT20A04kUr4OSUphSpjnmmCYyQD6OGi9+7NPnl7K9 h1cf4A3Dx1CDP/FEeobWLNajVyVA X-Google-Smtp-Source: APXvYqxXPOuHq3Xmbc3oZF9vs4zNCWShn4vwg1IHNjAccGCavRcFo2ue7LquXZN1rWqgUdlROpdl/w== X-Received: by 2002:a05:660c:48b:: with SMTP id a11mr22962014itk.11.1559664994267; Tue, 04 Jun 2019 09:16:34 -0700 (PDT) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com. [209.85.166.178]) by smtp.gmail.com with ESMTPSA id n21sm5231089ioh.30.2019.06.04.09.16.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 09:16:34 -0700 (PDT) Received: by mail-it1-f178.google.com with SMTP id h11so1046250itf.5; Tue, 04 Jun 2019 09:16:33 -0700 (PDT) X-Received: by 2002:a24:9ac7:: with SMTP id l190mr21725644ite.100.1559664993434; Tue, 04 Jun 2019 09:16:33 -0700 (PDT) MIME-Version: 1.0 References: <201906041307.x54D7Acf058688@repo.freebsd.org> <20190604141530.sbdlvxskwur2wofm@mutt-hbsd> In-Reply-To: <20190604141530.sbdlvxskwur2wofm@mutt-hbsd> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 4 Jun 2019 09:16:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348611 - in head/sys: conf kern To: Shawn Webb Cc: Ed Maste , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8121E7106B 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)[]; 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: Tue, 04 Jun 2019 16:21:48 -0000 On Tue, Jun 4, 2019 at 7:15 AM Shawn Webb wrote: > > On Tue, Jun 04, 2019 at 01:07:10PM +0000, Ed Maste wrote: > > Author: emaste > > Date: Tue Jun 4 13:07:10 2019 > > New Revision: 348611 > > URL: https://svnweb.freebsd.org/changeset/base/348611 > > > > Log: > > Expose the kernel's build-ID through sysctl > > > > After our migration (of certain architectures) to lld the kernel is built > > with a unique build-ID. Make it available via a sysctl and uname(1) to > > allow the user to identify their running kernel. > > Does this impact reproducible builds at all? Not at all, no. From owner-svn-src-head@freebsd.org Tue Jun 4 16:40: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 4A28315B69F7; Tue, 4 Jun 2019 16:40:19 +0000 (UTC) (envelope-from hselasky@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 DC5C5717BB; Tue, 4 Jun 2019 16:40:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9C5A220270; Tue, 4 Jun 2019 16:40:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54GeIb5070475; Tue, 4 Jun 2019 16:40:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54GeIMq070474; Tue, 4 Jun 2019 16:40:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906041640.x54GeIMq070474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 4 Jun 2019 16:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348631 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 348631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC5C5717BB 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-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: Tue, 04 Jun 2019 16:40:19 -0000 Author: hselasky Date: Tue Jun 4 16:40:18 2019 New Revision: 348631 URL: https://svnweb.freebsd.org/changeset/base/348631 Log: In usb(4) fix a lost completion event issue towards libusb(3). It may happen if a USB transfer is cancelled that we need to fake a completion event. Implement missing support in ugen_fs_copy_out() to handle this. This fixes issues with webcamd(8) and firefox. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Tue Jun 4 16:21:14 2019 (r348630) +++ head/sys/dev/usb/usb_generic.c Tue Jun 4 16:40:18 2019 (r348631) @@ -1219,6 +1219,40 @@ complete: } static int +ugen_fs_copy_out_cancelled(struct usb_fs_endpoint *fs_ep_uptr) +{ + struct usb_fs_endpoint fs_ep; + int error; + + error = copyin(fs_ep_uptr, &fs_ep, sizeof(fs_ep)); + if (error) + return (error); + + fs_ep.status = USB_ERR_CANCELLED; + fs_ep.aFrames = 0; + fs_ep.isoc_time_complete = 0; + + /* update "aFrames" */ + error = copyout(&fs_ep.aFrames, &fs_ep_uptr->aFrames, + sizeof(fs_ep.aFrames)); + if (error) + goto done; + + /* update "isoc_time_complete" */ + error = copyout(&fs_ep.isoc_time_complete, + &fs_ep_uptr->isoc_time_complete, + sizeof(fs_ep.isoc_time_complete)); + if (error) + goto done; + + /* update "status" */ + error = copyout(&fs_ep.status, &fs_ep_uptr->status, + sizeof(fs_ep.status)); +done: + return (error); +} + +static int ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) { struct usb_device_request *req; @@ -1243,8 +1277,13 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) return (EINVAL); mtx_lock(f->priv_mtx); - if (usbd_transfer_pending(xfer)) { + if (!xfer->flags_int.transferring && + !xfer->flags_int.started) { mtx_unlock(f->priv_mtx); + DPRINTF("Returning fake cancel event\n"); + return (ugen_fs_copy_out_cancelled(f->fs_ep_ptr + ep_index)); + } else if (usbd_transfer_pending(xfer)) { + mtx_unlock(f->priv_mtx); return (EBUSY); /* should not happen */ } mtx_unlock(f->priv_mtx); @@ -1364,6 +1403,7 @@ complete: sizeof(fs_ep.isoc_time_complete)); if (error) goto done; + /* update "status" */ error = copyout(&fs_ep.status, &fs_ep_uptr->status, sizeof(fs_ep.status)); @@ -1452,12 +1492,15 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, xfer = f->fs_xfer[u.pstart->ep_index]; if (usbd_transfer_pending(xfer)) { usbd_transfer_stop(xfer); + /* * Check if the USB transfer was stopped - * before it was even started. Else a cancel - * callback will be pending. + * before it was even started and fake a + * cancel event. */ - if (!xfer->flags_int.transferring) { + if (!xfer->flags_int.transferring && + !xfer->flags_int.started) { + DPRINTF("Issuing fake completion event\n"); ugen_fs_set_complete(xfer->priv_sc, USB_P2U(xfer->priv_fifo)); } From owner-svn-src-head@freebsd.org Tue Jun 4 16:57: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 0246015B7290; Tue, 4 Jun 2019 16:57:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (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 9861C727C8; Tue, 4 Jun 2019 16:57:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f65.google.com with SMTP id k8so17937370iot.1; Tue, 04 Jun 2019 09:57: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:from:date :message-id:subject:to:cc; bh=cHekSPjKK1SnF4k4XEHNTvIfPjK4BDdbhCd8YjFaiho=; b=s77ASdrA3U3IxxzGNqxAGnc8KdJ3nVizpBXnJka7TDSGPp3s8BiHLQCcGCOcTj+594 /wrew4OlNvfAVOBXRuTNoAwUVNhuFT67QslBfldTwN45sT4Mzwt3Rno0wek88wpcndki bszbMUMlJh4O0LxIDv6B4fmIT8jBpGfO8m/cblNC/hh0cP2Nwy25k2RQd8C/k6TX4ncM Hr7dzfGtWDoKjgGB1n5nQa58A3x4HIWh2L/P5oVbvNSp8AnLFIHEWh5ofLwT9WDKnppV teDP22dB4Kscq/uzDbfr5vEB7EWQuWetjesf9PJkKn/WQWP+0aKNw353rZTa50b2klNP CckQ== X-Gm-Message-State: APjAAAU9waMmmwG3AjF6S59OYRfBIrcwxyay31Jq4MItJoXYEVp4AT11 he0KpKOZ68zWCJhTqNEuI/8pjEsHzOypJp3BPYLaTQ== X-Google-Smtp-Source: APXvYqyuIGo4Ae3IJVeIyNPlTnoXu35vC9SuR5mRK51VSCVz0083eLPYWxy46fFEkFmULbya8VtzAyvPhyi0YlUBGzU= X-Received: by 2002:a6b:b497:: with SMTP id d145mr20044779iof.17.1559667049955; Tue, 04 Jun 2019 09:50:49 -0700 (PDT) MIME-Version: 1.0 References: <201906041307.x54D7Acf058688@repo.freebsd.org> <0708f493570462d065fa0ba3c361832720e60741.camel@freebsd.org> In-Reply-To: <0708f493570462d065fa0ba3c361832720e60741.camel@freebsd.org> From: Ed Maste Date: Tue, 4 Jun 2019 12:50:32 -0400 Message-ID: Subject: Re: svn commit: r348611 - in head/sys: conf kern To: Ian Lepore Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9861C727C8 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.979,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, 04 Jun 2019 16:57:14 -0000 On Tue, 4 Jun 2019 at 10:58, Ian Lepore wrote: > > On Tue, 2019-06-04 at 13:07 +0000, Ed Maste wrote: > > Author: emaste > > Date: Tue Jun 4 13:07:10 2019 > > New Revision: 348611 > > URL: https://svnweb.freebsd.org/changeset/base/348611 > > > > Log: > > Expose the kernel's build-ID through sysctl > > > > After our migration (of certain architectures) to lld the kernel is built > > with a unique build-ID. Make it available via a sysctl and uname(1) to > > allow the user to identify their running kernel. > > > > Won't this impact WITH_REPRODUCIBLE_BUILD? No, if the object is otherwise identical the build-ID will also be identical. (The linker does support --build-id=uuid which will generate a random build-id, but we don't (and nobody should) use that.) From owner-svn-src-head@freebsd.org Tue Jun 4 17:44: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 A64C415B8C97; Tue, 4 Jun 2019 17:44:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 1253A75C92; Tue, 4 Jun 2019 17:44:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x442.google.com with SMTP id y11so13099284pfm.13; Tue, 04 Jun 2019 10:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PJCAZ0uw/huDIc1m6g0NyNkV+/iRYPbKD9sYykszArM=; b=lWYUMyfHztRZqgkMn20yrXGXrv9fi3Lvo9TJY8mXRTCbqay1mcSlzOv6W5H6e1gUJj ZC3HLLp/edHFQ7+ZZ055vuiS4qqUWwq6nb6T1GYlxMEWG4zFQb7dze3CbN9KKYGbR0lG 1fzzdM3Uluhn0lufAmW2oEHx7pVozzOdfEbFq3IJV4Z0rnH4JQ1MQWog27HT2L7zV7um qabvGFwNOzkdbKyiZIudYDot9g3DslZABnWC9U7aNxwOrmi3zTV1klLHqjVg4sdj/yFV oDlnomKZPIOACF5T3cfKey4rXMZKQocRLf1u/rNkhdBcMJUx4/1fcythjQOtdBgNuK93 nhEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PJCAZ0uw/huDIc1m6g0NyNkV+/iRYPbKD9sYykszArM=; b=t6QxbKV+T5mddfzkJwZlvvqtIligFLQBaPHeFvMJ0RpsspMNvzSqcTbjVig3Abbtxb lDG46Itx/t3dSjzAsrGF/qmNa4uHlXeYh84aWKtR2GUalh5t8zDFI/HwS6DWMAiByrSd 4a+z2UygD4f9fkZTIBRFzq5wCkubcyONGsKCwsNQcSGsGunXDvUcA7NqkTr79fJEFNVq C/OuNnnH4sd+bzXVfbVJLL/JSjPkha1WxDVXSTQyEL5+Xg+ie+UItyK/fO07r21Nml/z Cb8Bk6dVz+GaNdTrsqZZ4Rtm6DDTodpmJEbDTt9mktllSSOHvMwIZmRmUSXkn5GydGdM 2jQQ== X-Gm-Message-State: APjAAAU83sjs/UgwsIFHskRvjuhFmS5+jcQJhdKvlGhsaobRJV/gtBjr 7YKnsZtD6LkXH1/VCQoyQensMUUZvaw= X-Google-Smtp-Source: APXvYqw6pvQi0tkDunojVujsquVEh4/ArfcEW2yE6WBGHCl+z28EF/jOTy3YhPX7piCVbFs7QxNEcg== X-Received: by 2002:a62:e710:: with SMTP id s16mr4917890pfh.183.1559670288725; Tue, 04 Jun 2019 10:44:48 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s66sm25296903pgs.87.2019.06.04.10.44.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 10:44:47 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r348611 - in head/sys: conf kern From: Enji Cooper In-Reply-To: <201906041307.x54D7Acf058688@repo.freebsd.org> Date: Tue, 4 Jun 2019 10:44:46 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <13469B81-40A3-4F57-A8D3-FF8172385B5F@gmail.com> References: <201906041307.x54D7Acf058688@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 1253A75C92 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.977,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, 04 Jun 2019 17:44:50 -0000 > On Jun 4, 2019, at 6:07 AM, Ed Maste wrote: >=20 > Author: emaste > Date: Tue Jun 4 13:07:10 2019 > New Revision: 348611 > URL: https://svnweb.freebsd.org/changeset/base/348611 >=20 > Log: > Expose the kernel's build-ID through sysctl >=20 > After our migration (of certain architectures) to lld the kernel is = built > with a unique build-ID. Make it available via a sysctl and uname(1) = to > allow the user to identify their running kernel. This is awesome! One minor critique is that I would have mentioned that = the sysctl is `kern.build_id`. How is this linked into uname(1) though? I don=E2=80=99t see any = additional options added to the utility in this commit. Thank you! -Enji= From owner-svn-src-head@freebsd.org Tue Jun 4 17:46: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 0A52915B8D82; Tue, 4 Jun 2019 17:46:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 8171475F25; Tue, 4 Jun 2019 17:46:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62a.google.com with SMTP id g21so8640736plq.0; Tue, 04 Jun 2019 10:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=982DBNLXyRJph3Wuh6GdMB+XzRyYzis7iz4ByW9k+8I=; b=hucc1hOH+dVcPKL4iEE0BaTkw29pEBQPRAjjT6sVIwBq8T4XB+KuxDMcOjPG5/Bddo +o6jEzDgUxxcOEHiDwW6ets/Cuk+b0MaLOhtwwhlgUt7K5TYWOQA04RUtoCsqpcTOWLv TrpMLaWjrEVOwIrKMoqSG4DxT/sfG5g3xSm6xbAA8ZwQmHDBwXMDoiVMn6jtriif2xsE u8o6U+7qTe9twqHX2op3ilAcU0P+Kdep/pF4nJZYCGMpHeNKW94RRoH2H0KWcxG1qTCH ayvvR2hmujb1File1LMw/5XZeC8GzPvhpBbxoF/6qLYrQD5oFs3wSmcUDMuRNUsMwP/w qa9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=982DBNLXyRJph3Wuh6GdMB+XzRyYzis7iz4ByW9k+8I=; b=iZerxv24Lrz3chQZv25qCi0JKLqWtNU/gCaYTlHHwabFrWqHnJqpTw9Di5FkT9D5Kl H34IGnM7Ig2VkA1K8BBJDw8ELdmFqzOZUl/0x289X2hWuGcngqLTlbZF7pr/MMjYe0f5 yBPClaNGQ+K23QKZ0sM3xRoa+u0MfOgv0cd9oyr2rB5oRQ5UgZYi7TCfYXq0wcbV2ZMJ kFRzppfNVB6AR2QH3Uy/VmqPx7vCPmwno5gQuZShAo+u9fCw5yGFl0nuK+iDkZlwG/i5 e/xvDW95ow0NJcIfNwsF+BQUX/YQMItAOaEMZCEIrVmPy8t8vMtzGB20JXQfaf3iEfwT qXGA== X-Gm-Message-State: APjAAAUjMGbGqY9GDVDpOgaPFpaw38o8aQpzFMPtiXuwSDGduvCrIhF4 zZMC/Osr4eDTHEz/uvPUyds9kda2DqI= X-Google-Smtp-Source: APXvYqzqf1aBdD+oraqvOo1aEVrGjSVGz3kD+y0JXMfz8rZ8YFYVwMBRS5qsDpgQC8f6yvmqewB7Qg== X-Received: by 2002:a17:902:1621:: with SMTP id g30mr37956971plg.326.1559670396157; Tue, 04 Jun 2019 10:46:36 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m2sm3088090pfa.77.2019.06.04.10.46.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 10:46:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r348609 - head From: Enji Cooper In-Reply-To: <201906041256.x54CuKA8053487@repo.freebsd.org> Date: Tue, 4 Jun 2019 10:46:34 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2D480049-9201-4B24-A9BF-7EFD6084BE89@gmail.com> References: <201906041256.x54CuKA8053487@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 8171475F25 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.978,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: Tue, 04 Jun 2019 17:46:38 -0000 > On Jun 4, 2019, at 5:56 AM, Ed Maste wrote: >=20 > Author: emaste > Date: Tue Jun 4 12:56:20 2019 > New Revision: 348609 > URL: https://svnweb.freebsd.org/changeset/base/348609 >=20 > Log: > Makefile.inc1: clean up stale dependency hacks >=20 > Carrying on from r339607, remove ad-hoc dependency cleanup for = changes > prior to June 2018. Thought: maybe the build instructions should be updated so users = from before those commits conditionally wipe out the .depend files to = avoid this issue. Thank you so very much :)! -Enji= From owner-svn-src-head@freebsd.org Tue Jun 4 18:26: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 DA74D15B9CE0; Tue, 4 Jun 2019 18:26:31 +0000 (UTC) (envelope-from markj@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 7EEFF773DD; Tue, 4 Jun 2019 18:26:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DB60214EB; Tue, 4 Jun 2019 18:26:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54IQVxe029742; Tue, 4 Jun 2019 18:26:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IQTep029732; Tue, 4 Jun 2019 18:26:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041826.x54IQTep029732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jun 2019 18:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348652 - head/contrib/elftoolchain/libelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 348652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EEFF773DD 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)[-1.000,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: Tue, 04 Jun 2019 18:26:32 -0000 Author: markj Date: Tue Jun 4 18:26:29 2019 New Revision: 348652 URL: https://svnweb.freebsd.org/changeset/base/348652 Log: libelf: Use a red-black tree to manage the section list. The tree is indexed by section number. This speeds up elf_getscn() and its callers, which previously had to traverse a linked list. In particular, since .shstrtab is often the last section in a file, elf_strptr() would have to traverse the entire list. PR: 234949 Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20443 Modified: head/contrib/elftoolchain/libelf/_libelf.h head/contrib/elftoolchain/libelf/elf_end.c head/contrib/elftoolchain/libelf/elf_scn.c head/contrib/elftoolchain/libelf/elf_update.c head/contrib/elftoolchain/libelf/libelf_allocate.c head/contrib/elftoolchain/libelf/libelf_ehdr.c head/contrib/elftoolchain/libelf/libelf_extended.c Modified: head/contrib/elftoolchain/libelf/_libelf.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf.h Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/_libelf.h Tue Jun 4 18:26:29 2019 (r348652) @@ -30,6 +30,7 @@ #define __LIBELF_H_ #include +#include #include "_libelf_config.h" @@ -80,6 +81,9 @@ extern struct _libelf_globals _libelf; #define LIBELF_F_SHDRS_LOADED 0x200000U /* whether all shdrs were read in */ #define LIBELF_F_SPECIAL_FILE 0x400000U /* non-regular file */ +RB_HEAD(scntree, _Elf_Scn); +RB_PROTOTYPE(scntree, _Elf_Scn, e_scn, elfscn_cmp); + struct _Elf { int e_activations; /* activation count */ unsigned int e_byteorder; /* ELFDATA* */ @@ -122,7 +126,7 @@ struct _Elf { Elf32_Phdr *e_phdr32; Elf64_Phdr *e_phdr64; } e_phdr; - STAILQ_HEAD(, _Elf_Scn) e_scn; /* section list */ + struct scntree e_scn; /* sections */ size_t e_nphdr; /* number of Phdr entries */ size_t e_nscn; /* number of sections */ size_t e_strndx; /* string table section index */ @@ -147,7 +151,7 @@ struct _Elf_Scn { } s_shdr; STAILQ_HEAD(, _Libelf_Data) s_data; /* translated data */ STAILQ_HEAD(, _Libelf_Data) s_rawdata; /* raw data */ - STAILQ_ENTRY(_Elf_Scn) s_next; + RB_ENTRY(_Elf_Scn) s_tree; struct _Elf *s_elf; /* parent ELF descriptor */ unsigned int s_flags; /* flags for the section as a whole */ size_t s_ndx; /* index# for this section */ Modified: head/contrib/elftoolchain/libelf/elf_end.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_end.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/elf_end.c Tue Jun 4 18:26:29 2019 (r348652) @@ -66,8 +66,7 @@ elf_end(Elf *e) /* * Reclaim all section descriptors. */ - STAILQ_FOREACH_SAFE(scn, &e->e_u.e_elf.e_scn, s_next, - tscn) + RB_FOREACH_SAFE(scn, scntree, &e->e_u.e_elf.e_scn, tscn) scn = _libelf_release_scn(scn); break; case ELF_K_NUM: Modified: head/contrib/elftoolchain/libelf/elf_scn.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_scn.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/elf_scn.c Tue Jun 4 18:26:29 2019 (r348652) @@ -38,6 +38,19 @@ ELFTC_VCSID("$Id: elf_scn.c 3632 2018-10-10 21:12:43Z jkoshy $"); +static int +elfscn_cmp(struct _Elf_Scn *s1, struct _Elf_Scn *s2) +{ + + if (s1->s_ndx < s2->s_ndx) + return (-1); + if (s1->s_ndx > s2->s_ndx) + return (1); + return (0); +} + +RB_GENERATE(scntree, _Elf_Scn, s_tree, elfscn_cmp); + /* * Load an ELF section table and create a list of Elf_Scn structures. */ @@ -95,9 +108,9 @@ _libelf_load_section_headers(Elf *e, void *ehdr) */ i = 0; - if (!STAILQ_EMPTY(&e->e_u.e_elf.e_scn)) { - assert(STAILQ_FIRST(&e->e_u.e_elf.e_scn) == - STAILQ_LAST(&e->e_u.e_elf.e_scn, _Elf_Scn, s_next)); + if (!RB_EMPTY(&e->e_u.e_elf.e_scn)) { + assert(RB_MIN(scntree, &e->e_u.e_elf.e_scn) == + RB_MAX(scntree, &e->e_u.e_elf.e_scn)); i = 1; src += fsz; @@ -148,10 +161,16 @@ elf_getscn(Elf *e, size_t index) _libelf_load_section_headers(e, ehdr) == 0) return (NULL); - STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) + for (s = RB_ROOT(&e->e_u.e_elf.e_scn); s != NULL;) { if (s->s_ndx == index) return (s); + if (s->s_ndx < index) + s = RB_RIGHT(s, s_tree); + else + s = RB_LEFT(s, s_tree); + } + LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } @@ -201,7 +220,7 @@ elf_newscn(Elf *e) _libelf_load_section_headers(e, ehdr) == 0) return (NULL); - if (STAILQ_EMPTY(&e->e_u.e_elf.e_scn)) { + if (RB_EMPTY(&e->e_u.e_elf.e_scn)) { assert(e->e_u.e_elf.e_nscn == 0); if ((scn = _libelf_allocate_scn(e, (size_t) SHN_UNDEF)) == NULL) @@ -231,5 +250,5 @@ elf_nextscn(Elf *e, Elf_Scn *s) } return (s == NULL ? elf_getscn(e, (size_t) 1) : - STAILQ_NEXT(s, s_next)); + RB_NEXT(scntree, &e->e_u.e_elf.e_scn, s)); } Modified: head/contrib/elftoolchain/libelf/elf_update.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_update.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/elf_update.c Tue Jun 4 18:26:29 2019 (r348652) @@ -452,7 +452,7 @@ _libelf_resync_sections(Elf *e, off_t rc, struct _Elf_ * Make a pass through sections, computing the extent of each * section. */ - STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) { + RB_FOREACH(s, scntree, &e->e_u.e_elf.e_scn) { if (ec == ELFCLASS32) sh_type = s->s_shdr.s_shdr32.sh_type; else @@ -980,7 +980,7 @@ _libelf_write_shdr(Elf *e, unsigned char *nf, struct _ fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, (size_t) 1); - STAILQ_FOREACH(scn, &e->e_u.e_elf.e_scn, s_next) { + RB_FOREACH(scn, scntree, &e->e_u.e_elf.e_scn) { if (ec == ELFCLASS32) src.d_buf = &scn->s_shdr.s_shdr32; else @@ -1142,7 +1142,7 @@ _libelf_write_elf(Elf *e, off_t newsize, struct _Elf_E e->e_flags &= ~ELF_F_DIRTY; - STAILQ_FOREACH_SAFE(scn, &e->e_u.e_elf.e_scn, s_next, tscn) + RB_FOREACH_SAFE(scn, scntree, &e->e_u.e_elf.e_scn, tscn) _libelf_release_scn(scn); if (e->e_class == ELFCLASS32) { Modified: head/contrib/elftoolchain/libelf/libelf_allocate.c ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_allocate.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/libelf_allocate.c Tue Jun 4 18:26:29 2019 (r348652) @@ -76,7 +76,7 @@ _libelf_init_elf(Elf *e, Elf_Kind kind) switch (kind) { case ELF_K_ELF: - STAILQ_INIT(&e->e_u.e_elf.e_scn); + RB_INIT(&e->e_u.e_elf.e_scn); break; default: break; @@ -111,7 +111,7 @@ _libelf_release_elf(Elf *e) break; } - assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); + assert(RB_EMPTY(&e->e_u.e_elf.e_scn)); if (e->e_flags & LIBELF_F_AR_HEADER) { arh = e->e_hdr.e_arhdr; @@ -174,7 +174,7 @@ _libelf_allocate_scn(Elf *e, size_t ndx) STAILQ_INIT(&s->s_data); STAILQ_INIT(&s->s_rawdata); - STAILQ_INSERT_TAIL(&e->e_u.e_elf.e_scn, s, s_next); + RB_INSERT(scntree, &e->e_u.e_elf.e_scn, s); return (s); } @@ -202,7 +202,7 @@ _libelf_release_scn(Elf_Scn *s) assert(e != NULL); - STAILQ_REMOVE(&e->e_u.e_elf.e_scn, s, _Elf_Scn, s_next); + RB_REMOVE(scntree, &e->e_u.e_elf.e_scn, s); free(s); Modified: head/contrib/elftoolchain/libelf/libelf_ehdr.c ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_ehdr.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/libelf_ehdr.c Tue Jun 4 18:26:29 2019 (r348652) @@ -46,7 +46,7 @@ _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint32_t shtype; _libelf_translator_function *xlator; - assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); + assert(RB_EMPTY(&e->e_u.e_elf.e_scn)); fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, 1); assert(fsz > 0); Modified: head/contrib/elftoolchain/libelf/libelf_extended.c ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_extended.c Tue Jun 4 18:11:12 2019 (r348651) +++ head/contrib/elftoolchain/libelf/libelf_extended.c Tue Jun 4 18:26:29 2019 (r348652) @@ -39,7 +39,7 @@ _libelf_getscn0(Elf *e) { Elf_Scn *s; - if ((s = STAILQ_FIRST(&e->e_u.e_elf.e_scn)) != NULL) + if ((s = RB_MIN(scntree, &e->e_u.e_elf.e_scn)) != NULL) return (s); return (_libelf_allocate_scn(e, (size_t) SHN_UNDEF)); From owner-svn-src-head@freebsd.org Tue Jun 4 18: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 7426115B9D02; Tue, 4 Jun 2019 18:26:43 +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 17EF5774D7; Tue, 4 Jun 2019 18:26:43 +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 91057214ED; Tue, 4 Jun 2019 18:26:42 +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 x54IQgVl029805; Tue, 4 Jun 2019 18:26:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IQgGL029804; Tue, 4 Jun 2019 18:26:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041826.x54IQgGL029804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 18:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348653 - 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: 348653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 17EF5774D7 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:26:43 -0000 Author: emaste Date: Tue Jun 4 18:26:42 2019 New Revision: 348653 URL: https://svnweb.freebsd.org/changeset/base/348653 Log: vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants PR: 205707 Reported by: Dmitry Wagin MFC after: 1 month Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:26:29 2019 (r348652) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:26:42 2019 (r348653) @@ -496,9 +496,9 @@ write_fnt(const char *filename) if (write_glyphs(fp) != 0 || write_mappings(fp, VFNT_MAP_NORMAL) != 0 || - write_mappings(fp, 1) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL_RH) != 0 || write_mappings(fp, VFNT_MAP_BOLD) != 0 || - write_mappings(fp, 3) != 0) { + write_mappings(fp, VFNT_MAP_BOLD_RH) != 0) { perror(filename); fclose(fp); return (1); From owner-svn-src-head@freebsd.org Tue Jun 4 18:29: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 7F72115B9EC3; Tue, 4 Jun 2019 18:29:09 +0000 (UTC) (envelope-from markj@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 236FE7781A; Tue, 4 Jun 2019 18:29:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01097214FC; Tue, 4 Jun 2019 18:29:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54IT81x030082; Tue, 4 Jun 2019 18:29:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IT8bb030081; Tue, 4 Jun 2019 18:29:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041829.x54IT8bb030081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jun 2019 18:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348654 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 236FE7781A 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:29:09 -0000 Author: markj Date: Tue Jun 4 18:29:08 2019 New Revision: 348654 URL: https://svnweb.freebsd.org/changeset/base/348654 Log: elfcopy: Use elf_getscn() instead of iterating over all sections. When removing a section, we would loop over all sections looking for a corresponding relocation section. With r348652 it is much faster to just use elf_getscn(). PR: 234949 Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20471 Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Tue Jun 4 18:26:42 2019 (r348653) +++ head/contrib/elftoolchain/elfcopy/sections.c Tue Jun 4 18:29:08 2019 (r348654) @@ -119,21 +119,19 @@ is_remove_reloc_sec(struct elfcopy *ecp, uint32_t sh_i errx(EXIT_FAILURE, "elf_getshstrndx failed: %s", elf_errmsg(-1)); - is = NULL; - while ((is = elf_nextscn(ecp->ein, is)) != NULL) { - if (sh_info == elf_ndxscn(is)) { - if (gelf_getshdr(is, &ish) == NULL) - errx(EXIT_FAILURE, "gelf_getshdr failed: %s", - elf_errmsg(-1)); - if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == - NULL) - errx(EXIT_FAILURE, "elf_strptr failed: %s", - elf_errmsg(-1)); - if (is_remove_section(ecp, name)) - return (1); - else - return (0); - } + is = elf_getscn(ecp->ein, sh_info); + if (is != NULL) { + if (gelf_getshdr(is, &ish) == NULL) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == + NULL) + errx(EXIT_FAILURE, "elf_strptr failed: %s", + elf_errmsg(-1)); + if (is_remove_section(ecp, name)) + return (1); + else + return (0); } elferr = elf_errno(); if (elferr != 0) From owner-svn-src-head@freebsd.org Tue Jun 4 18:31: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 5C13015BA12B; Tue, 4 Jun 2019 18:31:09 +0000 (UTC) (envelope-from markj@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 01A9A77A20; Tue, 4 Jun 2019 18:31:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D15062152A; Tue, 4 Jun 2019 18:31:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54IV88v030219; Tue, 4 Jun 2019 18:31:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IV8vK030218; Tue, 4 Jun 2019 18:31:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041831.x54IV8vK030218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jun 2019 18:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348655 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 348655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01A9A77A20 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:31:09 -0000 Author: markj Date: Tue Jun 4 18:31:08 2019 New Revision: 348655 URL: https://svnweb.freebsd.org/changeset/base/348655 Log: libelftc: Fix some minor style bugs. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20472 Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Modified: head/contrib/elftoolchain/libelftc/elftc_string_table.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table.c Tue Jun 4 18:29:08 2019 (r348654) +++ head/contrib/elftoolchain/libelftc/elftc_string_table.c Tue Jun 4 18:31:08 2019 (r348655) @@ -167,11 +167,9 @@ elftc_string_table_destroy(Elftc_String_Table *st) for (n = 0; n < st->st_nbuckets; n++) SLIST_FOREACH_SAFE(s, &st->st_buckets[n], ste_next, t) - free(s); + free(s); free(st->st_string_pool); free(st); - - return; } Elftc_String_Table * @@ -318,7 +316,7 @@ elftc_string_table_insert(Elftc_String_Table *st, cons if ((ste = malloc(sizeof(*ste))) == NULL) return (0); if ((ste->ste_idx = elftc_string_table_add_to_pool(st, - string)) == 0) { + string)) == 0) { free(ste); return (0); } Modified: head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Tue Jun 4 18:29:08 2019 (r348654) +++ head/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Tue Jun 4 18:31:08 2019 (r348655) @@ -144,7 +144,7 @@ looks up the string referenced by argument in the string table specified by argument .Ar table , and if found, returns the offset associated with the string. -The returned offset will be valid till the next call to function +The returned offset will be valid until the next call to .Fn elftc_string_table_image . .Pp Function From owner-svn-src-head@freebsd.org Tue Jun 4 18:31: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 6DC2415BA185; Tue, 4 Jun 2019 18:31:53 +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 EAD1177D15; Tue, 4 Jun 2019 18:31:52 +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 C710121682; Tue, 4 Jun 2019 18:31:52 +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 x54IVqU9032174; Tue, 4 Jun 2019 18:31:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IVqgZ032173; Tue, 4 Jun 2019 18:31:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041831.x54IVqgZ032173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 18:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348656 - 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: 348656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAD1177D15 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:31:53 -0000 Author: emaste Date: Tue Jun 4 18:31:52 2019 New Revision: 348656 URL: https://svnweb.freebsd.org/changeset/base/348656 Log: vtfontcvt: unwrap a line per style(9) PR: 205707 Submitted by: Dmitry Wagin Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:31:08 2019 (r348655) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:31:52 2019 (r348656) @@ -201,8 +201,7 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * return (1); if (bytes_r != NULL) { gl = add_glyph(bytes_r, map_idx + 1, 0); - if (add_mapping(gl, curchar, - map_idx + 1) != 0) + if (add_mapping(gl, curchar, map_idx + 1) != 0) return (1); } } From owner-svn-src-head@freebsd.org Tue Jun 4 18:34: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 62C6415BA33B; Tue, 4 Jun 2019 18:34:07 +0000 (UTC) (envelope-from markj@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 0248477F9F; Tue, 4 Jun 2019 18:34:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D264D216B4; Tue, 4 Jun 2019 18:34:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54IY6a0035513; Tue, 4 Jun 2019 18:34:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IY5Qs035508; Tue, 4 Jun 2019 18:34:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041834.x54IY5Qs035508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jun 2019 18:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348657 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0248477F9F 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)[-1.000,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: Tue, 04 Jun 2019 18:34:07 -0000 Author: markj Date: Tue Jun 4 18:34:05 2019 New Revision: 348657 URL: https://svnweb.freebsd.org/changeset/base/348657 Log: elfcopy: Use libelftc's string table routines to build .shstrtab. This replaces some hand-rolled routines and is substantially faster since libelftc uses a hash table for lookups and insertions, whereas elfcopy would perform a linear scan of the table. PR: 234949 Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20473 Modified: head/contrib/elftoolchain/elfcopy/ascii.c head/contrib/elftoolchain/elfcopy/binary.c head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Tue Jun 4 18:31:52 2019 (r348656) +++ head/contrib/elftoolchain/elfcopy/ascii.c Tue Jun 4 18:34:05 2019 (r348657) @@ -378,9 +378,6 @@ done: errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); @@ -604,9 +601,6 @@ done: if (gelf_update_ehdr(ecp->eout, &oeh) == 0) errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Tue Jun 4 18:31:52 2019 (r348656) +++ head/contrib/elftoolchain/elfcopy/binary.c Tue Jun 4 18:34:05 2019 (r348657) @@ -250,11 +250,8 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, c errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - ecp->flags |= SYMTAB_EXIST; - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ + ecp->flags |= SYMTAB_EXIST; update_shdr(ecp, 0); /* Properly set sh_link field of .symtab section. */ Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Tue Jun 4 18:31:52 2019 (r348656) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Tue Jun 4 18:34:05 2019 (r348657) @@ -135,6 +135,8 @@ struct section { int pseudo; int nocopy; + Elftc_String_Table *strtab; + TAILQ_ENTRY(section) sec_list; /* next section */ }; @@ -313,7 +315,6 @@ struct sec_action *lookup_sec_act(struct elfcopy *_ecp struct symop *lookup_symop_list(struct elfcopy *_ecp, const char *_name, unsigned int _op); void resync_sections(struct elfcopy *_ecp); -void set_shstrtab(struct elfcopy *_ecp); void setup_phdr(struct elfcopy *_ecp); void update_shdr(struct elfcopy *_ecp, int _update_link); Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Tue Jun 4 18:31:52 2019 (r348656) +++ head/contrib/elftoolchain/elfcopy/main.c Tue Jun 4 18:34:05 2019 (r348657) @@ -388,9 +388,6 @@ create_elf(struct elfcopy *ecp) */ copy_content(ecp); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* * Second processing of output sections: Update section headers. * At this stage we set name string index, update st_link and st_info @@ -485,6 +482,9 @@ free_elf(struct elfcopy *ecp) /* Free symbol table buffers. */ free_symtab(ecp); + + /* Free section name string table. */ + elftc_string_table_destroy(ecp->shstrtab->strtab); /* Free internal section list. */ if (!TAILQ_EMPTY(&ecp->v_sec)) { Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Tue Jun 4 18:31:52 2019 (r348656) +++ head/contrib/elftoolchain/elfcopy/sections.c Tue Jun 4 18:34:05 2019 (r348657) @@ -42,19 +42,18 @@ static void check_section_rename(struct elfcopy *ecp, static void filter_reloc(struct elfcopy *ecp, struct section *s); static int get_section_flags(struct elfcopy *ecp, const char *name); static void insert_sections(struct elfcopy *ecp); -static void insert_to_strtab(struct section *t, const char *s); static int is_append_section(struct elfcopy *ecp, const char *name); static int is_compress_section(struct elfcopy *ecp, const char *name); static int is_debug_section(const char *name); static int is_dwo_section(const char *name); static int is_modify_section(struct elfcopy *ecp, const char *name); static int is_print_section(struct elfcopy *ecp, const char *name); -static int lookup_string(struct section *t, const char *s); static void modify_section(struct elfcopy *ecp, struct section *s); static void pad_section(struct elfcopy *ecp, struct section *s); static void print_data(const char *d, size_t sz); static void print_section(struct section *s); static void *read_section(struct section *s, size_t *size); +static void set_shstrtab(struct elfcopy *ecp); static void update_reloc(struct elfcopy *ecp, struct section *s); static void update_section_group(struct elfcopy *ecp, struct section *s); @@ -1336,10 +1335,9 @@ insert_sections(struct elfcopy *ecp) void add_to_shstrtab(struct elfcopy *ecp, const char *name) { - struct section *s; - s = ecp->shstrtab; - insert_to_strtab(s, name); + if (elftc_string_table_insert(ecp->shstrtab->strtab, name) == 0) + errx(EXIT_FAILURE, "elftc_string_table_insert failed"); } void @@ -1349,6 +1347,9 @@ update_shdr(struct elfcopy *ecp, int update_link) GElf_Shdr osh; int elferr; + /* Finalize the section name string table (.shstrtab). */ + set_shstrtab(ecp); + TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (s->pseudo) continue; @@ -1358,7 +1359,8 @@ update_shdr(struct elfcopy *ecp, int update_link) elf_errmsg(-1)); /* Find section name in string table and set sh_name. */ - osh.sh_name = lookup_string(ecp->shstrtab, s->name); + osh.sh_name = elftc_string_table_lookup(ecp->shstrtab->strtab, + s->name); /* * sh_link needs to be updated, since the index of the @@ -1408,19 +1410,22 @@ init_shstrtab(struct elfcopy *ecp) s->loadable = 0; s->type = SHT_STRTAB; s->vma = 0; + s->strtab = elftc_string_table_create(0); - insert_to_strtab(s, ""); - insert_to_strtab(s, ".symtab"); - insert_to_strtab(s, ".strtab"); - insert_to_strtab(s, ".shstrtab"); + add_to_shstrtab(ecp, ""); + add_to_shstrtab(ecp, ".symtab"); + add_to_shstrtab(ecp, ".strtab"); + add_to_shstrtab(ecp, ".shstrtab"); } -void +static void set_shstrtab(struct elfcopy *ecp) { struct section *s; Elf_Data *data; GElf_Shdr sh; + const char *image; + size_t sz; s = ecp->shstrtab; @@ -1453,19 +1458,21 @@ set_shstrtab(struct elfcopy *ecp) * which are reserved for this in the beginning of shstrtab. */ if (!(ecp->flags & SYMTAB_EXIST)) { - s->sz -= sizeof(".symtab\0.strtab"); - memmove(s->buf, (char *)s->buf + sizeof(".symtab\0.strtab"), - s->sz); + elftc_string_table_remove(s->strtab, ".symtab"); + elftc_string_table_remove(s->strtab, ".strtab"); } - sh.sh_size = s->sz; + image = elftc_string_table_image(s->strtab, &sz); + s->sz = sz; + + sh.sh_size = sz; if (!gelf_update_shdr(s->os, &sh)) errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s", elf_errmsg(-1)); data->d_align = 1; - data->d_buf = s->buf; - data->d_size = s->sz; + data->d_buf = (void *)(uintptr_t)image; + data->d_size = sz; data->d_off = 0; data->d_type = ELF_T_BYTE; data->d_version = EV_CURRENT; @@ -1589,73 +1596,6 @@ add_gnu_debuglink(struct elfcopy *ecp) STAILQ_INSERT_TAIL(&ecp->v_sadd, sa, sadd_list); ecp->flags |= SEC_ADD; -} - -static void -insert_to_strtab(struct section *t, const char *s) -{ - const char *r; - char *b, *c; - size_t len, slen; - int append; - - if (t->sz == 0) { - t->cap = 512; - if ((t->buf = malloc(t->cap)) == NULL) - err(EXIT_FAILURE, "malloc failed"); - } - - slen = strlen(s); - append = 0; - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (!append && len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return; - } else if (len < slen && len != 0) { - r = s + (slen - len); - if (strcmp(c, r) == 0) { - t->sz -= len + 1; - memmove(c, c + len + 1, t->sz - (c - b)); - append = 1; - continue; - } - } - c += len + 1; - } - - while (t->sz + slen + 1 >= t->cap) { - t->cap *= 2; - if ((t->buf = realloc(t->buf, t->cap)) == NULL) - err(EXIT_FAILURE, "realloc failed"); - } - b = t->buf; - strncpy(&b[t->sz], s, slen); - b[t->sz + slen] = '\0'; - t->sz += slen + 1; -} - -static int -lookup_string(struct section *t, const char *s) -{ - const char *b, *c, *r; - size_t len, slen; - - slen = strlen(s); - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return (r - b); - } - c += len + 1; - } - - return (-1); } static uint32_t crctable[256] = From owner-svn-src-head@freebsd.org Tue Jun 4 18:36: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 C62CF15BA414; Tue, 4 Jun 2019 18:36:08 +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 65C338012A; Tue, 4 Jun 2019 18:36:08 +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 3AC28216BC; Tue, 4 Jun 2019 18:36:08 +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 x54Ia865035660; Tue, 4 Jun 2019 18:36:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Ia7i9035658; Tue, 4 Jun 2019 18:36:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906041836.x54Ia7i9035658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 4 Jun 2019 18:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348658 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 348658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65C338012A 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)[-1.000,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: Tue, 04 Jun 2019 18:36:09 -0000 Author: imp Date: Tue Jun 4 18:36:07 2019 New Revision: 348658 URL: https://svnweb.freebsd.org/changeset/base/348658 Log: Introduce efi_devpath_same_disk This is like efi_devpath_match, but allows differing device media paths. Those just specify the partition information. Differential Revision: https://reviews.freebsd.org/D20513 Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/devpath.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Tue Jun 4 18:34:05 2019 (r348657) +++ head/stand/efi/include/efilib.h Tue Jun 4 18:36:07 2019 (r348658) @@ -90,6 +90,7 @@ bool efi_devpath_match_node(EFI_DEVICE_PATH *, EFI_DEV bool efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); +bool efi_devpath_same_disk(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_to_media_path(EFI_DEVICE_PATH *); UINTN efi_devpath_length(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_name_to_devpath(const char *path); Modified: head/stand/efi/libefi/devpath.c ============================================================================== --- head/stand/efi/libefi/devpath.c Tue Jun 4 18:34:05 2019 (r348657) +++ head/stand/efi/libefi/devpath.c Tue Jun 4 18:36:07 2019 (r348658) @@ -197,14 +197,19 @@ efi_devpath_match_node(EFI_DEVICE_PATH *devpath1, EFI_ return (true); } -bool -efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) +static bool +_efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2, + bool ignore_media) { if (devpath1 == NULL || devpath2 == NULL) return (false); while (true) { + if (ignore_media && + IsDevicePathType(devpath1, MEDIA_DEVICE_PATH) && + IsDevicePathType(devpath2, MEDIA_DEVICE_PATH)) + return (true); if (!efi_devpath_match_node(devpath1, devpath2)) return false; if (IsDevicePathEnd(devpath1)) @@ -213,6 +218,25 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVIC devpath2 = NextDevicePathNode(devpath2); } return (true); +} +/* + * Are two devpaths identical? + */ +bool +efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) +{ + return _efi_devpath_match(devpath1, devpath2, false); +} + +/* + * Like efi_devpath_match, but stops at when we hit the media device + * path node that specifies the partition information. If we match + * up to that point, then we're on the same disk. + */ +bool +efi_devpath_same_disk(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) +{ + return _efi_devpath_match(devpath1, devpath2, true); } bool From owner-svn-src-head@freebsd.org Tue Jun 4 18:36: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 C8E8F15BA43A; Tue, 4 Jun 2019 18:36:15 +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 5EBA48019C; Tue, 4 Jun 2019 18:36:15 +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 4F605216BD; Tue, 4 Jun 2019 18:36:13 +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 x54IaDR9035716; Tue, 4 Jun 2019 18:36:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IaDrO035715; Tue, 4 Jun 2019 18:36:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906041836.x54IaDrO035715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 4 Jun 2019 18:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348659 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EBA48019C 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:36:16 -0000 Author: imp Date: Tue Jun 4 18:36:12 2019 New Revision: 348659 URL: https://svnweb.freebsd.org/changeset/base/348659 Log: Use newly minted efi_devpath_same_disk() instead of efi_devpath_match(). This fixes a regression in r347193. Reported by: Tomoaki AOKI Differential Revision: https://reviews.freebsd.org/D20513 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Tue Jun 4 18:36:07 2019 (r348658) +++ head/stand/efi/boot1/boot1.c Tue Jun 4 18:36:12 2019 (r348659) @@ -273,7 +273,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B if (!blkio->Media->LogicalPartition) return (EFI_UNSUPPORTED); - *preferred = efi_devpath_match(imgpath, devpath); + *preferred = efi_devpath_same_disk(imgpath, devpath); /* Run through each module, see if it can load this partition */ devinfo = malloc(sizeof(*devinfo)); From owner-svn-src-head@freebsd.org Tue Jun 4 18:38: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 8CCBE15BA524; Tue, 4 Jun 2019 18:38:28 +0000 (UTC) (envelope-from markj@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 3213A803F3; Tue, 4 Jun 2019 18:38:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3ECF216C2; Tue, 4 Jun 2019 18:38:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54IcRkK035855; Tue, 4 Jun 2019 18:38:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IcRfe035854; Tue, 4 Jun 2019 18:38:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041838.x54IcRfe035854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Jun 2019 18:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348660 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3213A803F3 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)[-1.000,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: Tue, 04 Jun 2019 18:38:28 -0000 Author: markj Date: Tue Jun 4 18:38:27 2019 New Revision: 348660 URL: https://svnweb.freebsd.org/changeset/base/348660 Log: Remove an outdated header comment for vm_page.c. The listed rules were incomplete and outdated. There is a much more comprehensive comment in vm_page.h. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20503 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Jun 4 18:36:12 2019 (r348659) +++ head/sys/vm/vm_page.c Tue Jun 4 18:38:27 2019 (r348660) @@ -63,23 +63,6 @@ */ /* - * GENERAL RULES ON VM_PAGE MANIPULATION - * - * - A page queue lock is required when adding or removing a page from a - * page queue regardless of other locks or the busy state of a page. - * - * * In general, no thread besides the page daemon can acquire or - * hold more than one page queue lock at a time. - * - * * The page daemon can acquire and hold any pair of page queue - * locks in any order. - * - * - The object lock is required when inserting or removing - * pages from an object (vm_page_insert() or vm_page_remove()). - * - */ - -/* * Resident memory management module. */ From owner-svn-src-head@freebsd.org Tue Jun 4 18:48: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 AA01A15BA836; Tue, 4 Jun 2019 18:48:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com [209.85.166.174]) (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 321F1808CB; Tue, 4 Jun 2019 18:48:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f174.google.com with SMTP id h9so1871176itk.3; Tue, 04 Jun 2019 11:48:54 -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:content-transfer-encoding; bh=2x+Q+rzD7de6rexg5PwYK1ZTvvEG+Sj3jJotQI1bqBU=; b=M/4SGmmz2M438U+eRvK0CsSV8t2331L8C4lZepqUghF/5X3ZUjx8Nq0ajAZr2GHh36 xYSGoJ1lXbonZK7Dp+aMOcA6lxaRGECieb8Go9tru7MhLSwVFR7yq6O6Mf0lkEOyA67O 6L2cEbltHZR6joZmDA9oBbLxgeF63jgUy+lMR/QSrzlDNSBaU1z6jiNA2vq3yqwV7ftQ jArjm9MhvSvUdUZE/KQ6NNA5emnNla2eaSqCEqOuXBDcWlN+gNwTSzUmOHA2FW7UXq9+ IzS2wRH6iOp1Iex1n+3/EOrilvorp/FRn0lwFHwMP/hdjUuZa2j/BvtLvrASUj9CBLuE nr+w== X-Gm-Message-State: APjAAAVri0LEfbCe5LPSyEvl53lAx+FeMWbzZCAx0g1ww92zI3wimNcZ ObZ1/95dg61pvnIz3BHWoS0BlEum13lv9Tu6Q5KPGU77 X-Google-Smtp-Source: APXvYqzINyVuX+stlLpVEqooHfOSE5QqS0gSkhGylbXJeRE5w9EiVyuCpOH3b4hA1gJ+i8/VpBIWk9w2I2x8WXsEYlQ= X-Received: by 2002:a05:660c:383:: with SMTP id x3mr5954714itj.44.1559674133007; Tue, 04 Jun 2019 11:48:53 -0700 (PDT) MIME-Version: 1.0 References: <201906041307.x54D7Acf058688@repo.freebsd.org> <13469B81-40A3-4F57-A8D3-FF8172385B5F@gmail.com> In-Reply-To: <13469B81-40A3-4F57-A8D3-FF8172385B5F@gmail.com> From: Ed Maste Date: Tue, 4 Jun 2019 14:48:35 -0400 Message-ID: Subject: Re: svn commit: r348611 - in head/sys: conf kern To: Enji Cooper 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: 321F1808CB 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,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, 04 Jun 2019 18:48:54 -0000 On Tue, 4 Jun 2019 at 13:44, Enji Cooper wrote: > > This is awesome! One minor critique is that I would have mentioned that t= he sysctl is `kern.build_id`. You mean including the sysctl name in the commit message? > How is this linked into uname(1) though? I don=E2=80=99t see any addition= al options added to the utility in this commit. It's a mistake in the commit message, and it's not yet hooked up - see https://reviews.freebsd.org/D20511. I split it out for a separate commit and forgot to update the submitted commit message. From owner-svn-src-head@freebsd.org Tue Jun 4 18:49: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 4C7F815BA899; Tue, 4 Jun 2019 18:49:50 +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 DFFF8809FE; Tue, 4 Jun 2019 18:49:49 +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 B7DC92186C; Tue, 4 Jun 2019 18:49:49 +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 x54InnVe041192; Tue, 4 Jun 2019 18:49:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54InnrX041191; Tue, 4 Jun 2019 18:49:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041849.x54InnrX041191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 18:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348661 - 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: 348661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFFF8809FE 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:49:50 -0000 Author: emaste Date: Tue Jun 4 18:49:49 2019 New Revision: 348661 URL: https://svnweb.freebsd.org/changeset/base/348661 Log: vtfontcvt: rework height/width setting Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and consistently use set_height and set_width. PR: 205707 Submitted by: Dmitry Wagin Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:38:27 2019 (r348660) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:49:49 2019 (r348661) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #define VFNT_MAP_NORMAL_RH 1 #define VFNT_MAP_BOLD 2 #define VFNT_MAP_BOLD_RH 3 +#define VFNT_MAXDIMENSION 128 static unsigned int width = 8, wbytes, height = 16; @@ -297,10 +298,17 @@ parse_bdf(FILE *fp, unsigned int map_idx) } static void -set_width(int w) +set_height(int h) { + if (h <= 0 || h > VFNT_MAXDIMENSION) + errx(1, "invalid height %d", h); + height = h; +} - if (w <= 0 || w > 128) +static void +set_width(int w) +{ + if (w <= 0 || w > VFNT_MAXDIMENSION) errx(1, "invalid width %d", w); width = w; wbytes = howmany(width, 8); @@ -322,7 +330,7 @@ parse_hex(FILE *fp, unsigned int map_idx) if (strncmp(ln, "# Height: ", 10) == 0) { if (bytes != NULL) errx(1, "malformed input: Height tag after font data"); - height = atoi(ln + 10); + set_height(atoi(ln + 10)); } else if (strncmp(ln, "# Width: ", 9) == 0) { if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); @@ -547,7 +555,7 @@ print_font_info(void) int main(int argc, char *argv[]) { - int ch, val, verbose = 0; + int ch, verbose = 0; assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); @@ -555,16 +563,13 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "h:vw:")) != -1) { switch (ch) { case 'h': - val = atoi(optarg); - if (val <= 0 || val > 128) - errx(1, "Invalid height %d", val); - height = val; + height = atoi(optarg); break; case 'v': verbose = 1; break; case 'w': - set_width(atoi(optarg)); + width = atoi(optarg); break; case '?': default: @@ -577,7 +582,8 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 3) usage(); - wbytes = howmany(width, 8); + set_width(width); + set_height(height); if (parse_file(argv[0], VFNT_MAP_NORMAL) != 0) return (1); From owner-svn-src-head@freebsd.org Tue Jun 4 18:55: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 CF51315BAC2D; Tue, 4 Jun 2019 18:55:03 +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 7292480F68; Tue, 4 Jun 2019 18:55:03 +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 4685E21A27; Tue, 4 Jun 2019 18:55:03 +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 x54It35x046004; Tue, 4 Jun 2019 18:55:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54It3iS046003; Tue, 4 Jun 2019 18:55:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041855.x54It3iS046003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 18:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348662 - 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: 348662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7292480F68 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 18:55:04 -0000 Author: emaste Date: Tue Jun 4 18:55:02 2019 New Revision: 348662 URL: https://svnweb.freebsd.org/changeset/base/348662 Log: vtfontcvt: include width and height in verbose info PR: 205707 Submitted by: Dmitry Wagin Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:49:49 2019 (r348661) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 18:55:02 2019 (r348662) @@ -520,6 +520,8 @@ print_font_info(void) { printf( "Statistics:\n" +"- width: %6u\n" +"- height: %6u\n" "- glyph_total: %6u\n" "- glyph_normal: %6u\n" "- glyph_normal_right: %6u\n" @@ -538,6 +540,7 @@ print_font_info(void) "- mapping_bold_right_folded: %6u\n" "- mapping_unique: %6u\n" "- mapping_dupe: %6u\n", + width, height, glyph_total, glyph_count[0], glyph_count[1], From owner-svn-src-head@freebsd.org Tue Jun 4 19:06: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 11C5D15BAF97; Tue, 4 Jun 2019 19:06:36 +0000 (UTC) (envelope-from sef@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 A389D815B9; Tue, 4 Jun 2019 19:06:35 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E6DAC21BD5; Tue, 4 Jun 2019 19:06:33 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54J6XfN051499; Tue, 4 Jun 2019 19:06:33 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54J6XfY051498; Tue, 4 Jun 2019 19:06:33 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201906041906.x54J6XfY051498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 4 Jun 2019 19:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348664 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A389D815B9 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 04 Jun 2019 19:06:36 -0000 Author: sef Date: Tue Jun 4 19:06:33 2019 New Revision: 348664 URL: https://svnweb.freebsd.org/changeset/base/348664 Log: Add my birthday entry, per Kirk's request Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:06:24 2019 (r348663) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:06:33 2019 (r348664) @@ -469,6 +469,7 @@ 12/28 Soren Schmidt born in Maribo, Denmark, 1960 12/28 Ade Lovett born in London, England, 1969 12/28 Marius Strobl born in Cham, Bavaria, Germany, 1978 +12/30 Sean Eric Fagan born in Los Angeles, California, United States, 1967 12/31 Edwin Groothuis born in Geldrop, the Netherlands, 1970 12/31 Fourth quarter status reports are due on 01/15 From owner-svn-src-head@freebsd.org Tue Jun 4 19:16: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 768F315BB23C; Tue, 4 Jun 2019 19:16:06 +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 1403681BA9; Tue, 4 Jun 2019 19:16:06 +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 D47FB21D90; Tue, 4 Jun 2019 19:16:05 +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 x54JG53W056827; Tue, 4 Jun 2019 19:16:05 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54JG5Ci056826; Tue, 4 Jun 2019 19:16:05 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906041916.x54JG5Ci056826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 4 Jun 2019 19:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348665 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1403681BA9 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)[-1.000,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: Tue, 04 Jun 2019 19:16:06 -0000 Author: dougm Date: Tue Jun 4 19:16:05 2019 New Revision: 348665 URL: https://svnweb.freebsd.org/changeset/base/348665 Log: Add birthday entry. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:06:33 2019 (r348664) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:16:05 2019 (r348665) @@ -440,6 +440,7 @@ 11/25 Fedor Uporov born in Yalta, Crimea, USSR, 1988 11/28 Nik Clayton born in Peterborough, United Kingdom, 1973 11/28 Stanislav Sedov born in Chelyabinsk, USSR, 1985 +11/29 Doug Moore born in Arlington, Texas, United States, 1960 12/01 Hajimu Umemoto born in Nara, Japan, 1961 12/01 Alexey Dokuchaev born in Magadan, USSR, 1980 12/02 Ermal Luçi born in Tirane, Albania, 1980 From owner-svn-src-head@freebsd.org Tue Jun 4 19:16: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 3086615BB262; Tue, 4 Jun 2019 19:16:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 A82D881D8E; Tue, 4 Jun 2019 19:16:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x541.google.com with SMTP id 83so4083867pgg.8; Tue, 04 Jun 2019 12:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Yc76F6lgd49oBZgjIWC8a0iyppFC/3f1ZqRTL/nWh/E=; b=KkamqaE5kRZhJRobzJI7y7C3vn1SyzimQOQFr4XLjkol1bynv74xtXt6C+6QdSA6UH DyV+xhagJSCnnPbcglTuB0SGhoAwHAPLHbkj3hGd9cvvj5c0JhdSPw61QYvdWBoHvZLC cSkLE9tzVwO51gjBRWMsbkcew8w8kO7OAkCxKZjtgi1ULC+vdVC0Vanq8ha5o3CDmKYP 5ujnpYCGsOPmTHPSTLskCkFgwrb8gopZZ3wY6dgE4h6GY5GCmnqOmhSqDniWOGhxA2Fy R1X4AFUYRkCymGUo3Qaw2Thy6kOMeR/zdubt29vgpf7fFuvXSi8Xrv4c3u+xTbP/v9iQ FzyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Yc76F6lgd49oBZgjIWC8a0iyppFC/3f1ZqRTL/nWh/E=; b=Zgd2z5Ta6QJCiGj8cNwmXixeQBRWAXR7PgSiBbp4BcTfOCxlzeVrRJScyF332IbUL8 ZvkkaExV1afIz1+7dXp+zJJFC5krNsiKyHnrZYLrZyhnAm436GI/iZ6kTuw+a7vhjaDl MLKCRY94LrGcYQjq3chfBNbgK7KoV9PQdg1eIQCbvsa+pz+/ULiuhZ7xePpMfZ22D0yd esSCvIrzQ5qnv7FbDl5Pc/W91NhTBOc9svji1KdJ3TtDD642B7X4RGl8oib7TQ+WJPPl /hmD8Pxaz+sZW3yVOgeLtthXkxqSvfSpyGkBOsHUD+hy0TRwMqYI7vxQHF45xHd+UTJp rAxg== X-Gm-Message-State: APjAAAVinoXoWRfCmf+GTBajRIo+0884C8/+q+vvPKwdGC/6t7SwmSeL gPfw3V+WUD+bKgI1vjWyssku3RYcDVA= X-Google-Smtp-Source: APXvYqzOKKWezNcZL6rBpCydmW0Ey8zP7ZSieQrt0EtPJWwg3eHL6hkc4pplsIwjww5HdwHDtagPiQ== X-Received: by 2002:a63:a41:: with SMTP id z1mr145521pgk.389.1559675786312; Tue, 04 Jun 2019 12:16:26 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id h18sm16093255pgv.38.2019.06.04.12.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 12:16:25 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r348611 - in head/sys: conf kern From: Enji Cooper In-Reply-To: Date: Tue, 4 Jun 2019 12:16:25 -0700 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <31D93C6C-D274-40ED-92D3-EB327B5F5656@gmail.com> References: <201906041307.x54D7Acf058688@repo.freebsd.org> <13469B81-40A3-4F57-A8D3-FF8172385B5F@gmail.com> To: Ed Maste X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: A82D881D8E 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.965,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, 04 Jun 2019 19:16:28 -0000 > On Jun 4, 2019, at 11:48 AM, Ed Maste wrote: >=20 > On Tue, 4 Jun 2019 at 13:44, Enji Cooper = wrote: >>=20 >> This is awesome! One minor critique is that I would have mentioned = that the sysctl is `kern.build_id`. >=20 > You mean including the sysctl name in the commit message? Yup =E2=80=94 it would help folks that don=E2=80=99t know how to read = FreeBSD kernel code :). Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue Jun 4 19:22: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 8DD7915BB85A; Tue, 4 Jun 2019 19:22:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (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 7096E8267E; Tue, 4 Jun 2019 19:22:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x430.google.com with SMTP id u17so13274217pfn.7; Tue, 04 Jun 2019 12:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=NXwCn4jHt6aYwNeb0S1mm6odVOB/q9vJf605qno4FrE=; b=NWKNCi9TQnUokhA40F6sEiFDxi+lChSz8Gp+73vTe3wmSSBAz31xDoBKj+I0POEWKY knOPS+Gx0RMks0zAxM3g/yIKKZUJySuA1IspvjmCMCobf1tTKJQAZd9zkOakP8S0DSls GDO9sO4x8zNwFkbjlv5lw2/7qVmi0SDfBLvQ1qPW53ig1kMANh7lvcTPq6C3q6HygIqT smH04u1mmLfuXZCLm6GWZw6lLAr2sUqOz0cuAweSyaqf6/pe8NCY+QGn1czbSXcuc2RU 5NKBm5N1362QrXDn6Qv8cV22Q24APCFDkFKGGHfZN4ZkRTQLZiCMqllzGzCqHv+kTNSa bm8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=NXwCn4jHt6aYwNeb0S1mm6odVOB/q9vJf605qno4FrE=; b=DnyahYzmDq5PVDy+N77DO5q/qkdscn/VggfpArb4g6vwh+INM97yt0ZJ4bSaqoXK64 uU61dKv19sALwTAa4LlpWTIMXtLKQNwG0Tco0dfuTYnD855+CHglbiRnsm9b9xDfwQgN zD9JKqjOTjGjD/yD3HH5Bz/V0w2ymm26BwG4FTiW6hcfTkFzzSI7csvNUpXYG8Q5sqxU /iPSvtJGet2rdaYvW4/jiJ2GJEyAGx80402nN+rL+vBDaJ7tekNy7zw1DZkL4PxDge+q AEqWImjJZ8adhiIod5lR4f4tQEdhwwkWGDqEU2V/6Z/FXnt/F0l6utH30T4FQBsmdyC9 KiRg== X-Gm-Message-State: APjAAAWYagCiKj6HLHTBQZwu7zg8gnCA7JVwIuz3aA2yGIufD42ctrjp T3Oi4lHKZGZchuoODaaGAdPjH3SwT5s= X-Google-Smtp-Source: APXvYqyDeYseBwA/g3oAAz1OtYGOZ7hykBHvCp8K+fEXbVNsIUvBBVBEzj4XZyv6zgq+O0rY4l+phQ== X-Received: by 2002:a63:1343:: with SMTP id 3mr210616pgt.426.1559676147063; Tue, 04 Jun 2019 12:22:27 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b17sm2707959pfb.18.2019.06.04.12.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 12:22:26 -0700 (PDT) From: Enji Cooper Message-Id: <059B57C6-874A-4E27-A7A7-4EEBDE45EA66@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r348540 - head Date: Tue, 4 Jun 2019 12:22:25 -0700 In-Reply-To: <201906031906.x53J6mPi044273@gndrsh.dnsmgr.net> Cc: Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: rgrimes@freebsd.org References: <201906031906.x53J6mPi044273@gndrsh.dnsmgr.net> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 7096E8267E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NWKNCi9T; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::430 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-3.00)[ip: (-9.40), ipnet: 2607:f8b0::/32(-3.24), asn: 15169(-2.30), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[0.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.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: Tue, 04 Jun 2019 19:22:30 -0000 > On Jun 3, 2019, at 12:06 PM, Rodney W. Grimes = wrote: >=20 >> Author: sobomax >> Date: Mon Jun 3 15:34:00 2019 >> New Revision: 348540 >> URL: https://svnweb.freebsd.org/changeset/base/348540 >>=20 >> Log: >> Rollback the rest of the botched r348521. Re-work would be posted to >> reviews. Sorry. >>=20 >> Reported by: Enji Cooper >>=20 >> Modified: >> head/Makefile.inc1 >>=20 >> Modified: head/Makefile.inc1 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/Makefile.inc1 Mon Jun 3 15:32:42 2019 = (r348539) >> +++ head/Makefile.inc1 Mon Jun 3 15:34:00 2019 = (r348540) >> @@ -887,7 +887,7 @@ MTREEFLAGS+=3D -W >> INSTALLFLAGS+=3D -h sha256 >> .endif >> .if defined(DB_FROM_SRC) || defined(NO_ROOT) >> -IMAKE_INSTALL=3D INSTALL=3D"${INSTALL} ${INSTALLFLAGS}" >> +IMAKE_INSTALL=3D INSTALL=3D"install ${INSTALLFLAGS}" >=20 > This is a correct change, > ngie please explain exactly why this is an exception to = INSTALL?=3Dinstall. There are edge cases I=E2=80=99ve had to work around in the = build system in the past, where using $INSTALL would not work here, = e.g., use =E2=80=9CINSTALL=3Dtrue=E2=80=9D. This would break that use. There=E2=80=99s also absolutely no guarantee that =E2=80=9C$INSTAL= L=E2=80=9D knows how to interpret "$INSTALLFLAGS=E2=80=9D; FreeBSD=E2=80=99= s install(1) however, used during make distribution, installworld, = installkernel, etc, does support these flags. The same goes for mtree as well; nmtree isn=E2=80=99t the same = as the older version of mtree that=E2=80=99s on older (pre-9.x) systems = (IIRC). It=E2=80=99s better to use known build/install tools to avoid = maintenance/debugging burden. Thanks, -Enji= From owner-svn-src-head@freebsd.org Tue Jun 4 19:25: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 974BB15BB906; Tue, 4 Jun 2019 19:25:33 +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 3D6598281B; Tue, 4 Jun 2019 19:25:33 +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 1829621F52; Tue, 4 Jun 2019 19:25:33 +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 x54JPW3D062133; Tue, 4 Jun 2019 19:25:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54JPWdC062131; Tue, 4 Jun 2019 19:25:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906041925.x54JPWdC062131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 4 Jun 2019 19:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348666 - 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: 348666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D6598281B 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)[-1.000,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, 04 Jun 2019 19:25:33 -0000 Author: cy Date: Tue Jun 4 19:25:32 2019 New Revision: 348666 URL: https://svnweb.freebsd.org/changeset/base/348666 Log: Clean up #ifdefs from old unsupported releases of FreeBSD. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Tue Jun 4 19:16:05 2019 (r348665) +++ head/sys/contrib/ipfilter/netinet/fil.c Tue Jun 4 19:25:32 2019 (r348666) @@ -2882,8 +2882,7 @@ ipf_check(ctx, ip, hlen, ifp, out */ m->m_flags &= ~M_CANFASTFWD; # endif /* M_CANFASTFWD */ -# if defined(CSUM_DELAY_DATA) && (!defined(__FreeBSD_version) || \ - (__FreeBSD_version < 501108)) +# if defined(CSUM_DELAY_DATA) && !defined(__FreeBSD_version) /* * disable delayed checksums. */ Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 4 19:16:05 2019 (r348665) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 4 19:25:32 2019 (r348666) @@ -22,19 +22,19 @@ #include #include #include -#if __FreeBSD_version >= 500000 +#ifdef __FreeBSD_version # include # include +# ifdef _KERNEL +# include +# else +# define CURVNET_SET(arg) +# define CURVNET_RESTORE() +# define VNET_DEFINE(_t, _v) _t _v +# define VNET_DECLARE(_t, _v) extern _t _v +# define VNET(arg) arg +# endif #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) -#include -#else -#define CURVNET_SET(arg) -#define CURVNET_RESTORE() -#define VNET_DEFINE(_t, _v) _t _v -#define VNET_DECLARE(_t, _v) extern _t _v -#define VNET(arg) arg -#endif #include #include #include @@ -52,7 +52,7 @@ VNET_DECLARE(ipf_main_softc_t, ipfmain); #define V_ipfmain VNET(ipfmain) -#if __FreeBSD_version >= 502116 +#ifdef __FreeBSD_version static struct cdev *ipf_devs[IPL_LOGSIZE]; #else static dev_t ipf_devs[IPL_LOGSIZE]; @@ -68,25 +68,17 @@ static int ipf_modunload(void); static int ipf_fbsd_sysctl_create(void); static int ipf_fbsd_sysctl_destroy(void); -#if (__FreeBSD_version >= 500024) -# if (__FreeBSD_version >= 502116) +#ifdef __FreeBSD_version static int ipfopen __P((struct cdev*, int, int, struct thread *)); static int ipfclose __P((struct cdev*, int, int, struct thread *)); -# else -static int ipfopen __P((dev_t, int, int, struct thread *)); -static int ipfclose __P((dev_t, int, int, struct thread *)); -# endif /* __FreeBSD_version >= 502116 */ -#else -static int ipfopen __P((dev_t, int, int, struct proc *)); -static int ipfclose __P((dev_t, int, int, struct proc *)); -#endif -#if (__FreeBSD_version >= 502116) static int ipfread __P((struct cdev*, struct uio *, int)); static int ipfwrite __P((struct cdev*, struct uio *, int)); #else +static int ipfopen __P((dev_t, int, int, struct proc *)); +static int ipfclose __P((dev_t, int, int, struct proc *)); static int ipfread __P((dev_t, struct uio *, int)); static int ipfwrite __P((dev_t, struct uio *, int)); -#endif /* __FreeBSD_version >= 502116 */ +#endif SYSCTL_DECL(_net_inet); @@ -137,15 +129,13 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG #define CDEV_MAJOR 79 #include -#if __FreeBSD_version >= 500043 +#ifdef __FreeBSD_version # include static int ipfpoll(struct cdev *dev, int events, struct thread *td); static struct cdevsw ipf_cdevsw = { -#if __FreeBSD_version >= 502103 .d_version = D_VERSION, .d_flags = 0, /* D_NEEDGIANT - Should be SMP safe */ -#endif .d_open = ipfopen, .d_close = ipfclose, .d_read = ipfread, @@ -153,9 +143,6 @@ static struct cdevsw ipf_cdevsw = { .d_ioctl = ipfioctl, .d_poll = ipfpoll, .d_name = "ipf", -#if __FreeBSD_version < 600000 - .d_maj = CDEV_MAJOR, -#endif }; #else static int ipfpoll(dev_t dev, int events, struct proc *td); @@ -174,12 +161,6 @@ static struct cdevsw ipf_cdevsw = { /* dump */ nodump, /* psize */ nopsize, /* flags */ 0, -# if (__FreeBSD_version < 500043) - /* bmaj */ -1, -# endif -# if (__FreeBSD_version >= 430000) - /* kqfilter */ NULL -# endif }; #endif @@ -444,7 +425,7 @@ sysctl_ipf_int_frag ( SYSCTL_HANDLER_ARGS ) static int -#if __FreeBSD_version >= 500043 +#ifdef __FreeBSD_version ipfpoll(struct cdev *dev, int events, struct thread *td) #else ipfpoll(dev_t dev, int events, struct proc *td) @@ -497,20 +478,13 @@ ipfpoll(dev_t dev, int events, struct proc *td) * routines below for saving IP headers to buffer */ static int ipfopen(dev, flags -#if ((BSD >= 199506) || (__FreeBSD_version >= 220000)) +#ifdef __FreeBSD_version , devtype, p) int devtype; -# if (__FreeBSD_version >= 500024) struct thread *p; -# else - struct proc *p; -# endif /* __FreeBSD_version >= 500024 */ -#else -) -#endif -#if (__FreeBSD_version >= 502116) struct cdev *dev; #else +) dev_t dev; #endif int flags; @@ -544,20 +518,13 @@ static int ipfopen(dev, flags static int ipfclose(dev, flags -#if ((BSD >= 199506) || (__FreeBSD_version >= 220000)) +#ifdef __FreeBSD_version , devtype, p) int devtype; -# if (__FreeBSD_version >= 500024) struct thread *p; -# else - struct proc *p; -# endif /* __FreeBSD_version >= 500024 */ -#else -) -#endif -#if (__FreeBSD_version >= 502116) struct cdev *dev; #else +) dev_t dev; #endif int flags; @@ -583,7 +550,7 @@ static int ipfread(dev, uio, ioflag) #else static int ipfread(dev, uio) #endif -#if (__FreeBSD_version >= 502116) +#ifdef __FreeBSD_version struct cdev *dev; #else dev_t dev; @@ -630,7 +597,7 @@ static int ipfwrite(dev, uio, ioflag) #else static int ipfwrite(dev, uio) #endif -#if (__FreeBSD_version >= 502116) +#ifdef __FreeBSD_version struct cdev *dev; #else dev_t dev; From owner-svn-src-head@freebsd.org Tue Jun 4 19:37: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 E53E115BBBA6; Tue, 4 Jun 2019 19:37:52 +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 6EC4E83032; Tue, 4 Jun 2019 19:37: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 49ED622105; Tue, 4 Jun 2019 19:37: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 x54Jbquq067198; Tue, 4 Jun 2019 19:37:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54JbqBO067197; Tue, 4 Jun 2019 19:37:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906041937.x54JbqBO067197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 4 Jun 2019 19:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348667 - 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: 348667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EC4E83032 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)[-1.000,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: Tue, 04 Jun 2019 19:37:53 -0000 Author: cy Date: Tue Jun 4 19:37:51 2019 New Revision: 348667 URL: https://svnweb.freebsd.org/changeset/base/348667 Log: While working on a PR, more are discovered. Remove more #ifdefs missed in r343701. MFC after: 1 week 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 Tue Jun 4 19:25:32 2019 (r348666) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Tue Jun 4 19:37:51 2019 (r348667) @@ -16,11 +16,11 @@ static const char rcsid[] = "@(#)$Id$"; # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \ +#if defined(__FreeBSD_version) && \ !defined(KLD_MODULE) && !defined(IPFILTER_LKM) # include "opt_inet6.h" #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 440000) && \ +#if defined(__FreeBSD_version) && \ !defined(KLD_MODULE) && !defined(IPFILTER_LKM) # include "opt_random_ip_id.h" #endif @@ -35,7 +35,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include # include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) +#if defined(__FreeBSD_version) #include #endif # include From owner-svn-src-head@freebsd.org Tue Jun 4 19:39: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 878D515BBC2C; Tue, 4 Jun 2019 19:39:07 +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 277DD831A7; Tue, 4 Jun 2019 19:39:07 +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 034E822106; Tue, 4 Jun 2019 19:39:07 +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 x54Jd6Bd067294; Tue, 4 Jun 2019 19:39:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Jd6NF067293; Tue, 4 Jun 2019 19:39:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041939.x54Jd6NF067293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 4 Jun 2019 19:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348668 - 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: 348668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 277DD831A7 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,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, 04 Jun 2019 19:39:07 -0000 Author: emaste Date: Tue Jun 4 19:39:06 2019 New Revision: 348668 URL: https://svnweb.freebsd.org/changeset/base/348668 Log: vtfontcvt: zero memory allocated by xmalloc PR: 205707 Submitted by: Dmitry Wagin Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 19:37:51 2019 (r348667) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 4 19:39:06 2019 (r348668) @@ -102,7 +102,7 @@ xmalloc(size_t size) { void *m; - if ((m = malloc(size)) == NULL) + if ((m = calloc(1, size)) == NULL) errx(1, "memory allocation failure"); return (m); } From owner-svn-src-head@freebsd.org Tue Jun 4 19:59: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 8F0E815BC147; Tue, 4 Jun 2019 19:59:44 +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 2F0C483F32; Tue, 4 Jun 2019 19:59:44 +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 0A02F22484; Tue, 4 Jun 2019 19:59:44 +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 x54JxhtM078012; Tue, 4 Jun 2019 19:59:43 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Jxhqf078010; Tue, 4 Jun 2019 19:59:43 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906041959.x54Jxhqf078010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 4 Jun 2019 19:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348669 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 348669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F0C483F32 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)[-1.000,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: Tue, 04 Jun 2019 19:59:44 -0000 Author: vmaffione Date: Tue Jun 4 19:59:43 2019 New Revision: 348669 URL: https://svnweb.freebsd.org/changeset/base/348669 Log: Add myself to committers-src.dot and calendar.freebsd Reviewed by: mckusick MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20518 Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Jun 4 19:39:06 2019 (r348668) +++ head/share/misc/committers-src.dot Tue Jun 4 19:59:43 2019 (r348669) @@ -353,6 +353,7 @@ uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2010/01 vangyzen [label="Eric van Gyzen\nvangyzen@FreeBSD.org\n2015/03/08"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] +vmaffione [label="Vincenzo Maffione\nvmaffione@FreeBSD.org\n2018/03/19"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] whu [label="Wei Hu\nwhu@FreeBSD.org\n2015/02/11"] Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:39:06 2019 (r348668) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 19:59:43 2019 (r348669) @@ -383,6 +383,7 @@ 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 +10/09 Vincenzo Maffione born in Foggia, Italy, 1988 10/11 Rick Macklem born in Ontario, Canada, 1955 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 From owner-svn-src-head@freebsd.org Tue Jun 4 20:53: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 B3B2C15BD1A7; Tue, 4 Jun 2019 20:53:36 +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 4E2B285BD6; Tue, 4 Jun 2019 20:53:36 +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 23CF422E8E; Tue, 4 Jun 2019 20:53:36 +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 x54KraRL010089; Tue, 4 Jun 2019 20:53:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54KraoE010088; Tue, 4 Jun 2019 20:53:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906042053.x54KraoE010088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 4 Jun 2019 20:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348671 - head/lib/libc/resolv X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/lib/libc/resolv X-SVN-Commit-Revision: 348671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E2B285BD6 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)[-1.000,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, 04 Jun 2019 20:53:36 -0000 Author: bz Date: Tue Jun 4 20:53:35 2019 New Revision: 348671 URL: https://svnweb.freebsd.org/changeset/base/348671 Log: Rather than using the legacy IP struct fields in the union for the port number, properly access them by their IPv6 names. This will make it easier to slice up and compile out address families in the future. No functional change intended. MFC after: 6 weeks Modified: head/lib/libc/resolv/res_findzonecut.c Modified: head/lib/libc/resolv/res_findzonecut.c ============================================================================== --- head/lib/libc/resolv/res_findzonecut.c Tue Jun 4 20:37:00 2019 (r348670) +++ head/lib/libc/resolv/res_findzonecut.c Tue Jun 4 20:53:35 2019 (r348671) @@ -629,7 +629,7 @@ save_a(res_state statp, ns_msg *msg, ns_sect sect, arr->addr.sin6.sin6_len = sizeof(arr->addr.sin6); #endif memcpy(&arr->addr.sin6.sin6_addr, ns_rr_rdata(rr), 16); - arr->addr.sin.sin_port = htons(NAMESERVER_PORT); + arr->addr.sin6.sin6_port = htons(NAMESERVER_PORT); nsrr->flags |= RR_NS_HAVE_V6; break; default: From owner-svn-src-head@freebsd.org Tue Jun 4 21:54: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 252D115BE2FE; Tue, 4 Jun 2019 21:54:35 +0000 (UTC) (envelope-from adridg@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 B9113878C9; Tue, 4 Jun 2019 21:54:34 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 974B6238DC; Tue, 4 Jun 2019 21:54:34 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54LsY2d041340; Tue, 4 Jun 2019 21:54:34 GMT (envelope-from adridg@FreeBSD.org) Received: (from adridg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54LsY72041339; Tue, 4 Jun 2019 21:54:34 GMT (envelope-from adridg@FreeBSD.org) Message-Id: <201906042154.x54LsY72041339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adridg set sender to adridg@FreeBSD.org using -f From: Adriaan de Groot Date: Tue, 4 Jun 2019 21:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348673 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: adridg X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9113878C9 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,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, 04 Jun 2019 21:54:35 -0000 Author: adridg (ports committer) Date: Tue Jun 4 21:54:34 2019 New Revision: 348673 URL: https://svnweb.freebsd.org/changeset/base/348673 Log: Add self to calendar, per Kirk's request Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 21:06:34 2019 (r348672) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jun 4 21:54:34 2019 (r348673) @@ -15,6 +15,7 @@ 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 01/03 Tetsurou Okazaki born in Mobara, Chiba, Japan, 1972 01/04 Hiroyuki Hanai born in Kagawa pre., Japan, 1969 +01/06 Adriaan de Groot born in Calgary, Canada, 1973 01/06 Philippe Audeoud born in Bretigny-Sur-Orge, France, 1980 01/08 Michael L. Hostbaek born in Copenhagen, Denmark, 1977 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 From owner-svn-src-head@freebsd.org Tue Jun 4 21:57: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 00EFA15BE39D; Tue, 4 Jun 2019 21:57:45 +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 4A73087AC5; Tue, 4 Jun 2019 21:57:43 +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 x54LvfWi049943; Tue, 4 Jun 2019 14:57:41 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x54LvfNV049942; Tue, 4 Jun 2019 14:57:41 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906042157.x54LvfNV049942@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348540 - head In-Reply-To: <059B57C6-874A-4E27-A7A7-4EEBDE45EA66@gmail.com> To: Enji Cooper Date: Tue, 4 Jun 2019 14:57:41 -0700 (PDT) CC: rgrimes@freebsd.org, Maxim Sobolev , 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: 4A73087AC5 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.960,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, 04 Jun 2019 21:57:45 -0000 > > On Jun 3, 2019, at 12:06 PM, Rodney W. Grimes wrote: > > > >> Author: sobomax > >> Date: Mon Jun 3 15:34:00 2019 > >> New Revision: 348540 > >> URL: https://svnweb.freebsd.org/changeset/base/348540 > >> > >> Log: > >> Rollback the rest of the botched r348521. Re-work would be posted to > >> reviews. Sorry. > >> > >> Reported by: Enji Cooper > >> > >> Modified: > >> head/Makefile.inc1 > >> > >> Modified: head/Makefile.inc1 > >> ============================================================================== > >> --- head/Makefile.inc1 Mon Jun 3 15:32:42 2019 (r348539) > >> +++ head/Makefile.inc1 Mon Jun 3 15:34:00 2019 (r348540) > >> @@ -887,7 +887,7 @@ MTREEFLAGS+= -W > >> INSTALLFLAGS+= -h sha256 > >> .endif > >> .if defined(DB_FROM_SRC) || defined(NO_ROOT) > >> -IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > >> +IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" > > > > This is a correct change, > > ngie please explain exactly why this is an exception to INSTALL?=install. > > There are edge cases I?ve had to work around in the build system in the past, where using $INSTALL would not work here, e.g., use ?INSTALL=true?. This would break that use. This holds valid for all places in the three that use INSTALL today, anything that INSTALL is set to must be something that knows how to ignore the flags it may get. This holds true not only for INSTALL but also for any other like variable name. Furthermore true is infact one of those commands that ignores all args and all flags so how can your example break that I want this to do nothing, but not fail? > There?s also absolutely no guarantee that ?$INSTALL? knows how to interpret "$INSTALLFLAGS?; FreeBSD?s install(1) however, used during make distribution, installworld, installkernel, etc, does support these flags. > The same goes for mtree as well; nmtree isn?t the same as the older version of mtree that?s on older (pre-9.x) systems (IIRC). It?s better to use known build/install tools to avoid maintenance/debugging burden. It would be far far better to not have this 1 hard coded install and mtree, and arguing that it is about not parsing -flags is not going to hold water, as that is already true of all the other places that this is done. > Thanks, > -Enji -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 4 22:51: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 19D1915BF336; Tue, 4 Jun 2019 22:51:38 +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 4E20189164; Tue, 4 Jun 2019 22:51:37 +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 x54MpSfA062383 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 4 Jun 2019 15:51:28 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x54MpSCR062382; Tue, 4 Jun 2019 15:51:28 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 4 Jun 2019 15:51:28 -0700 From: Gleb Smirnoff To: Dmitry Chagin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348419 - in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd Message-ID: <20190604225128.GL21836@FreeBSD.org> References: <201905301424.x4UEORXr098755@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905301424.x4UEORXr098755@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 4E20189164 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 04 Jun 2019 22:51:38 -0000 Dmitry, On Thu, May 30, 2019 at 02:24:27PM +0000, Dmitry Chagin wrote: D> Author: dchagin D> Date: Thu May 30 14:24:26 2019 D> New Revision: 348419 D> URL: https://svnweb.freebsd.org/changeset/base/348419 D> D> Log: D> Complete LOCAL_PEERCRED support. Cache pid of the remote process in the D> struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed. D> D> PR: 215202 D> Reviewed by: tijl D> MFC after: 1 week D> Differential Revision: https://reviews.freebsd.org/D20415 ... D> Modified: head/sys/sys/ucred.h D> ============================================================================== D> --- head/sys/sys/ucred.h Thu May 30 14:21:51 2019 (r348418) D> +++ head/sys/sys/ucred.h Thu May 30 14:24:26 2019 (r348419) D> @@ -87,10 +87,14 @@ struct xucred { D> uid_t cr_uid; /* effective user id */ D> short cr_ngroups; /* number of groups */ D> gid_t cr_groups[XU_NGROUPS]; /* groups */ D> - void *_cr_unused1; /* compatibility with old ucred */ D> + union { D> + void *_cr_unused1; /* compatibility with old ucred */ D> + pid_t _pid; D> + } _cr; D> }; D> #define XUCRED_VERSION 0 D> D> +#define cr_pid _cr._pid Why don't use C99 in 2019 instead of preprocessor define? Should be union { void *_cr_unused1; /* compatibility with old ucred */ pid_t cr_pid; }; -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Jun 5 00:04: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 6FEF015C0691; Wed, 5 Jun 2019 00:04:22 +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 1062F8AE35; Wed, 5 Jun 2019 00:04:22 +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 F350F24F44; Wed, 5 Jun 2019 00:04:21 +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 x5504Lk1008276; Wed, 5 Jun 2019 00:04:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5504LVj008275; Wed, 5 Jun 2019 00:04:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906050004.x5504LVj008275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 5 Jun 2019 00:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348674 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1062F8AE35 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,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, 05 Jun 2019 00:04:22 -0000 Author: imp Date: Wed Jun 5 00:04:21 2019 New Revision: 348674 URL: https://svnweb.freebsd.org/changeset/base/348674 Log: Don't shadow a global zfsmount variable. Modified: head/stand/efi/boot1/zfs_module.c Modified: head/stand/efi/boot1/zfs_module.c ============================================================================== --- head/stand/efi/boot1/zfs_module.c Tue Jun 4 21:54:34 2019 (r348673) +++ head/stand/efi/boot1/zfs_module.c Wed Jun 5 00:04:21 2019 (r348674) @@ -141,7 +141,7 @@ static EFI_STATUS load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize) { spa_t *spa; - struct zfsmount zfsmount; + struct zfsmount zmount; dnode_phys_t dn; struct stat st; int err; @@ -163,12 +163,12 @@ load(const char *filepath, dev_info_t *devinfo, void * return (EFI_NOT_FOUND); } - if ((err = zfs_mount(spa, 0, &zfsmount)) != 0) { + if ((err = zfs_mount(spa, 0, &zmount)) != 0) { DPRINTF("Failed to mount pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); } - if ((err = zfs_lookup(&zfsmount, filepath, &dn)) != 0) { + if ((err = zfs_lookup(&zmount, filepath, &dn)) != 0) { if (err == ENOENT) { DPRINTF("Failed to find '%s' on pool '%s' (%d)\n", filepath, spa->spa_name, err); From owner-svn-src-head@freebsd.org Wed Jun 5 00:07: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 20A2815C0795; Wed, 5 Jun 2019 00:07:15 +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 A43E18AFB3; Wed, 5 Jun 2019 00:07:14 +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 0FAC42B47C; Wed, 5 Jun 2019 00:07:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348610 - in head: lib/clang/libllvm usr.bin/clang To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906041300.x54D0n9O056000@repo.freebsd.org> From: John Baldwin 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: Tue, 4 Jun 2019 17:07:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201906041300.x54D0n9O056000@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A43E18AFB3 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,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, 05 Jun 2019 00:07:15 -0000 On 6/4/19 6:00 AM, Ed Maste wrote: > Author: emaste > Date: Tue Jun 4 13:00:49 2019 > New Revision: 348610 > URL: https://svnweb.freebsd.org/changeset/base/348610 > > Log: > build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS) > > To facilitate experimentation with LTO we require an ar that supports > LLVM IR, and to a lesser degree also an nm. As a first step always > install llvm-ar and llvm-nm. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/lib/clang/libllvm/Makefile > head/usr.bin/clang/Makefile I think you missed updating OptionalObsoleteFiles.inc or ObsoleteFiles.inc or some such because 'make delete-old' wants to delete these after they have been installed. Possibly the same for the recently-enabled llvm-symbolizer as well. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Jun 5 00:08: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 DDB9F15C0806; Wed, 5 Jun 2019 00:08:31 +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 7DC808B105; Wed, 5 Jun 2019 00:08:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662A824F47; Wed, 5 Jun 2019 00:08:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5508V6j008479; Wed, 5 Jun 2019 00:08:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5508V6t008478; Wed, 5 Jun 2019 00:08:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906050008.x5508V6t008478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 5 Jun 2019 00:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348675 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DC808B105 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)[-1.000,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: Wed, 05 Jun 2019 00:08:32 -0000 Author: imp Date: Wed Jun 5 00:08:30 2019 New Revision: 348675 URL: https://svnweb.freebsd.org/changeset/base/348675 Log: ufs_module.c can't currently be compiled with -Wcast-align, but the code is safe enough. Turn off the warning for now until I can find the right construct to silence it in the code. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Wed Jun 5 00:04:21 2019 (r348674) +++ head/stand/efi/boot1/Makefile Wed Jun 5 00:08:30 2019 (r348675) @@ -15,6 +15,9 @@ CFLAGS+= -DEFI_BOOT1 # warnings for now. CWARNFLAGS.boot1.c+= -Wno-format +# Disable bogus alignment issues +CWARNFLAGS.ufs_module.c += -Wno-cast-align + # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs_module.c += -Wno-array-bounds CWARNFLAGS.zfs_module.c += -Wno-cast-align From owner-svn-src-head@freebsd.org Wed Jun 5 00:55: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 8D63D15C13B2; Wed, 5 Jun 2019 00:55:23 +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 3395A8C507; Wed, 5 Jun 2019 00:55:23 +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 18F0B25804; Wed, 5 Jun 2019 00:55:23 +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 x550tMTJ034196; Wed, 5 Jun 2019 00:55:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x550tMja034195; Wed, 5 Jun 2019 00:55:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906050055.x550tMja034195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Jun 2019 00:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348677 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 348677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3395A8C507 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)[-1.000,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: Wed, 05 Jun 2019 00:55:23 -0000 Author: emaste Date: Wed Jun 5 00:55:22 2019 New Revision: 348677 URL: https://svnweb.freebsd.org/changeset/base/348677 Log: move llvm-ar and llvm-nm to appropriate location in OptionalObsoleteFiles.inc After r348610 `make delete-old` was still removing llvm-ar and llvm-nm (and associated man pages). Reported by: jhb Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 5 00:51:51 2019 (r348676) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 5 00:55:22 2019 (r348677) @@ -1371,6 +1371,8 @@ OLD_FILES+=usr/bin/clang OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/bin/clang-tblgen +OLD_FILES+=usr/bin/llvm-ar +OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-symbolizer OLD_FILES+=usr/bin/llvm-tblgen @@ -1534,6 +1536,8 @@ OLD_DIRS+=usr/share/doc/llvm OLD_FILES+=usr/share/man/man1/clang.1.gz OLD_FILES+=usr/share/man/man1/clang++.1.gz OLD_FILES+=usr/share/man/man1/clang-cpp.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz +OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .endif @@ -1542,7 +1546,6 @@ OLD_FILES+=usr/bin/bugpoint OLD_FILES+=usr/bin/clang-format OLD_FILES+=usr/bin/llc OLD_FILES+=usr/bin/lli -OLD_FILES+=usr/bin/llvm-ar OLD_FILES+=usr/bin/llvm-as OLD_FILES+=usr/bin/llvm-bcanalyzer OLD_FILES+=usr/bin/llvm-cxxdump @@ -1557,7 +1560,6 @@ OLD_FILES+=usr/bin/llvm-lto2 OLD_FILES+=usr/bin/llvm-mc OLD_FILES+=usr/bin/llvm-mca OLD_FILES+=usr/bin/llvm-modextract -OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-pdbutil OLD_FILES+=usr/bin/llvm-ranlib @@ -1567,7 +1569,6 @@ OLD_FILES+=usr/bin/opt OLD_FILES+=usr/share/man/man1/bugpoint.1.gz OLD_FILES+=usr/share/man/man1/llc.1.gz OLD_FILES+=usr/share/man/man1/lli.1.gz -OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz OLD_FILES+=usr/share/man/man1/llvm-as.1.gz OLD_FILES+=usr/share/man/man1/llvm-bcanalyzer.1.gz OLD_FILES+=usr/share/man/man1/llvm-diff.1.gz @@ -1575,7 +1576,6 @@ OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz OLD_FILES+=usr/share/man/man1/llvm-dwarfdump.1 OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz OLD_FILES+=usr/share/man/man1/llvm-link.1.gz -OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz OLD_FILES+=usr/share/man/man1/llvm-pdbutil.1.gz OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz OLD_FILES+=usr/share/man/man1/opt.1.gz From owner-svn-src-head@freebsd.org Wed Jun 5 01:31: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 1627515C1BAC; Wed, 5 Jun 2019 01:31:37 +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 577388D1D2; Wed, 5 Jun 2019 01:31:35 +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 16B3943B143; Wed, 5 Jun 2019 11:31:25 +1000 (AEST) Date: Wed, 5 Jun 2019 11:31:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff cc: Dmitry Chagin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348419 - in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd In-Reply-To: <20190604225128.GL21836@FreeBSD.org> Message-ID: <20190605095458.S1083@besplex.bde.org> References: <201905301424.x4UEORXr098755@repo.freebsd.org> <20190604225128.GL21836@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=b1b97yAZNUFv8cfJXE8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 577388D1D2 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: Wed, 05 Jun 2019 01:31:37 -0000 On Tue, 4 Jun 2019, Gleb Smirnoff wrote: > On Thu, May 30, 2019 at 02:24:27PM +0000, Dmitry Chagin wrote: > D> Author: dchagin > D> ... > D> Log: > D> Complete LOCAL_PEERCRED support. Cache pid of the remote process in the > D> struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed. > D> > D> PR: 215202 > D> Reviewed by: tijl > D> MFC after: 1 week > D> Differential Revision: https://reviews.freebsd.org/D20415 > ... > D> Modified: head/sys/sys/ucred.h > D> ============================================================================== > D> --- head/sys/sys/ucred.h Thu May 30 14:21:51 2019 (r348418) > D> +++ head/sys/sys/ucred.h Thu May 30 14:24:26 2019 (r348419) > D> @@ -87,10 +87,14 @@ struct xucred { > D> uid_t cr_uid; /* effective user id */ > D> short cr_ngroups; /* number of groups */ > D> gid_t cr_groups[XU_NGROUPS]; /* groups */ > D> - void *_cr_unused1; /* compatibility with old ucred */ > D> + union { > D> + void *_cr_unused1; /* compatibility with old ucred */ > D> + pid_t _pid; > D> + } _cr; > D> }; > D> #define XUCRED_VERSION 0 > D> > D> +#define cr_pid _cr._pid > > Why don't use C99 in 2019 instead of preprocessor define? Should be > > union { > void *_cr_unused1; /* compatibility with old ucred */ > pid_t cr_pid; > }; Anonymous unions are a gnu89 extension. Only broken C99 compilers like clang -std=c99 accept them. The kernel makefiles (kern.mk, kern.pre.mk and kmod.mk) are still very broken in this area: - kern.mk forces CSTD=c99. This prevents users using their preferred standard or even the correct standard. These bugs are missing in bsd.sys.mk. It uses the correct standard gnu99, and assigns it using ?= to not prevent users using their preferred standard or even the correct standard. But see the commit logs fo bsd.sys.mk. It took several rounds of churning to get this almost right. Using c99 for the standard is even wronger in the kernel than in userland, since the kernel uses nonstandard extensions relatively much more often than userland. - after this forcing, there is an ifdef copied (except for removing k&r support) from bsd.kern.mk. Since CSTD is forced, in the kernel this is an obfuscated way of adding the obfuscated standard name iso9899:1999. De-obfuscating 13 lines of this gives CFLAGS+= -std=iso9899:1999 - clang dishonors this request to be a C99 compiler and doesn't even warn about anonymous unions in the kernel. It takes -pedantic as well as -std=c99 to make clang resemble a C99 compiler. With -pedantic, it tells you that "anonymous unions are a C11 extension [-Wc11-extensions]". - anonymous unions are actually a gnu99 extension. But is closer to resembling a C99 compiler when requested to be one. It doesn't take -pedantic to make it warn about anonymous unions in the kernel. - you "fixed" this for gcc in r278913 by adding -fms-extensions for gcc only. This is in kern.pre.mk and kmod.mk. MS apparently added this extension 10-20 years after gnu added it. -fms-extensions gives subtly different (mostly stronger) semantics for anonymous unions. The kernel only needs old gnu semantics. -ms-extensions gives many other unwanted NS extensions. -current still has this bug. - r338128 adds -ms-extensions to CFLAGS for gcc on a different line. This bug is missing in kmod.mk. -current still has this bug. Nearby bugs: - -fms-extensions was added in a wrong place in r278913. It was added after -fno-common, which was already in a wrong place. In FreeBSD-7, -fno-common was added before inline limits, but on the same line as the first inline limit. Inline limits are very gcc-4.2.1-specific, so they needed ifdefs. There are now some ifdefs. Not nearly enough -- only 1 for mips and ones for gcc implemented using CFLAGS.gcc. The bug is now -fno-common is ifdefed for gcc using CFLAGS.gcc, so it is broken for clang (in FreeBSD-7, it was ifdefed for icc using an explicit ifdef. - I once fixed large parts of the kernel (at least all header files) to compile with -pedantic. The fixes included marking extensions using __extension__, expecially in header files. -pedantic is unusuable now even 1 file at a time, due to too many syntax errors and unmarked extensions in headers. E.g., compiling init_main.c now gives 2345 errors in 17312 lines after increasing -ferror-limit from 20 to 1000000. With the default limit of 20, the following errors are detected: XX In file included from ../../../kern/init_main.c:55: XX In file included from ../../../sys/epoch.h:41: XX In file included from ../../../sys/pcpu.h:50: XX ./machine/pcpu.h:49:1: error: _Static_assert is a C11-specific feature [-Werror,-Wc11-extensions] XX _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); XX ^ XX In file included from ../../../kern/init_main.c:56: XX In file included from ../../../sys/eventhandler.h:37: XX In file included from ../../../sys/mutex.h:44: XX In file included from ../../../sys/lockstat.h:41: XX ../../../sys/sdt.h:430:26: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROVIDER_DECLARE(sdt); XX ^ XX In file included from ../../../kern/init_main.c:56: XX In file included from ../../../sys/eventhandler.h:37: XX In file included from ../../../sys/mutex.h:44: XX ../../../sys/lockstat.h:43:31: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROVIDER_DECLARE(lockstat); XX ^ XX ../../../sys/lockstat.h:45:51: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , adaptive__acquire); XX ^ XX ../../../sys/lockstat.h:46:51: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , adaptive__release); XX ^ XX ../../../sys/lockstat.h:47:48: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , adaptive__spin); XX ^ XX ../../../sys/lockstat.h:48:49: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , adaptive__block); XX ^ XX ../../../sys/lockstat.h:50:47: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , spin__acquire); XX ^ XX ../../../sys/lockstat.h:51:47: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , spin__release); XX ^ XX ../../../sys/lockstat.h:52:44: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , spin__spin); XX ^ XX ../../../sys/lockstat.h:54:45: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__acquire); XX ^ XX ../../../sys/lockstat.h:55:45: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__release); XX ^ XX ../../../sys/lockstat.h:56:43: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__block); XX ^ XX ../../../sys/lockstat.h:57:42: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__spin); XX ^ XX ../../../sys/lockstat.h:58:45: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__upgrade); XX ^ XX ../../../sys/lockstat.h:59:47: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , rw__downgrade); XX ^ XX ../../../sys/lockstat.h:61:45: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , sx__acquire); XX ^ XX ../../../sys/lockstat.h:62:45: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , sx__release); XX ^ XX ../../../sys/lockstat.h:63:43: error: extra ';' outside of a function [-Werror,-Wextra-semi] XX SDT_PROBE_DECLARE(lockstat, , , sx__block); XX ^ XX fatal error: too many errors emitted, stopping now [-ferror-limit=] XX 20 errors generated. Many of the other errors are for zero-sized arrays automatically generated in sysproto.h. With gcc, there seem to be still over 2000 errors, but it only takes 2327 lines to report them, and there are only 52 lines left after removing the ones for zero-sized arrays. The others are much as above: - 25 lines for "extra ';' outside of function - 4 lines for gnu statement-expressions (lots of these for bzero()) - 3 lines for forward references to enums - 1 line for an unnamed struct/union. Unfortunately, -pedantic seems to be broken for both clang and gcc in the following way: it seems to kill all gnu extensions, so even with the correct standard -std=-gnu99 (and also with -ms-extensions twice for gcc), adding -pedantic gives the same errors as with -std=c99. I thought that zero-sized arrays were in C99. Actually, they aren't even in C17. It is my design in sysproto.h that generates thousands of them :-(. The forward references to enums are most interesting. These are all auto- generated bugs in syscallsubr.h. The header that declares 'enum idtype' is not encluded, so the size of the enum is not known. 'enum idtype' is forward-declared to break detection of the bug when this enum is used in 2 prototypes, but -pedantic reports all 3 instances of 'enum idtype' as errors. This can only work for compilers that make all enum types have the same size. Bruce From owner-svn-src-head@freebsd.org Wed Jun 5 01:35: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 D512415C1DFD; Wed, 5 Jun 2019 01:35:13 +0000 (UTC) (envelope-from kevans@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 7BFDA8D430; Wed, 5 Jun 2019 01:35:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 184D92BEF7; Wed, 5 Jun 2019 01:35:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id h11so21640113ljb.2; Tue, 04 Jun 2019 18:35:13 -0700 (PDT) X-Gm-Message-State: APjAAAX7HOBbswCtWuYoRgwNVVMHM1J3LwKfbz8YhXTqlfeHbfoLxeQ+ ub59yQY8JfTVl2kiDUa1E668eFKqrRrp5cww8Ak= X-Google-Smtp-Source: APXvYqwR2zjYRIXv/Hz/uLZRl2QErngyQf+cMkZ6XdBIFQenA7COAxQ9lFcx5WA7OAj83l9ewxk4uhaWseqybWVq2Y8= X-Received: by 2002:a2e:7a19:: with SMTP id v25mr5580727ljc.39.1559698511368; Tue, 04 Jun 2019 18:35:11 -0700 (PDT) MIME-Version: 1.0 References: <201906041300.x54D0n9O056000@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Tue, 4 Jun 2019 20:34:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348610 - in head: lib/clang/libllvm usr.bin/clang To: John Baldwin Cc: Ed Maste , src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7BFDA8D430 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.973,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, 05 Jun 2019 01:35:14 -0000 On Tue, Jun 4, 2019 at 7:07 PM John Baldwin wrote: > > On 6/4/19 6:00 AM, Ed Maste wrote: > > Author: emaste > > Date: Tue Jun 4 13:00:49 2019 > > New Revision: 348610 > > URL: https://svnweb.freebsd.org/changeset/base/348610 > > > > Log: > > build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS) > > > > To facilitate experimentation with LTO we require an ar that supports > > LLVM IR, and to a lesser degree also an nm. As a first step always > > install llvm-ar and llvm-nm. > > > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/lib/clang/libllvm/Makefile > > head/usr.bin/clang/Makefile > > I think you missed updating OptionalObsoleteFiles.inc or ObsoleteFiles.inc or > some such because 'make delete-old' wants to delete these after they have been > installed. > > Possibly the same for the recently-enabled llvm-symbolizer as well. > Just to confirm... the commit for llvm-symbolizer included the move from MK_CLANG_EXTRAS to MK_CLANG in OptionalObsoleteFiles. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Wed Jun 5 02:21: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 F014615C28B0; Wed, 5 Jun 2019 02:21:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) (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 8B2508E49C; Wed, 5 Jun 2019 02:21:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f196.google.com with SMTP id s16so1281715ita.2; Tue, 04 Jun 2019 19:21:23 -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=uiJd3EmIrhdOQh+lKLAIBzfEV3jPWU0n+rQVVpbxvKs=; b=O96zTNL7UnUjhXcMbRvJJ4OvRlzYJUPU9EU/oPN34V0gHV5+y7YEOYWQVxknSB26PL ek4SA8sN9IovBPRI7dlrSvVbdMu1noeV7kzZJlqn/rrd5aPlXVoaARY79tbO/i0md9YY JwR7E4v56m02ph/Iy4m4nesmdKnWhdtNPlHs0EQOpEaw2dFzMhjS2TSy82aqn+QCDf3T kSmEqAL1zIdo0AbiPxQuBspRrHfcU4OCfcI6hSKnQR6qkAemFF1YHLkBG4bjzxIgvIjy bUuo+oUpCeQt7h8XN/si4shzIVNffZO8AxB5tel3OsBlGgclVMAqa3NkPNnL9HPmAjiz 67IQ== X-Gm-Message-State: APjAAAUZQBXTuZqBxCRDHt04te6zNsO/9bV1QTioPgl+qrKDwQj8xJIf wM/SUb3QG5c+IS3MpK+cqCXrUQe8 X-Google-Smtp-Source: APXvYqxBYUSIFu14CCDTx/6iJiiczEGuHbDRbvuLumQbAal/uulIeVQjw1tcORSEqXVYUA7GcmsSyg== X-Received: by 2002:a24:8304:: with SMTP id d4mr11140310ite.78.1559701276710; Tue, 04 Jun 2019 19:21:16 -0700 (PDT) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id 14sm8917669itl.1.2019.06.04.19.21.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 19:21:16 -0700 (PDT) Received: by mail-it1-f170.google.com with SMTP id i125so843000ite.0; Tue, 04 Jun 2019 19:21:15 -0700 (PDT) X-Received: by 2002:a02:5502:: with SMTP id e2mr23325149jab.87.1559701275632; Tue, 04 Jun 2019 19:21:15 -0700 (PDT) MIME-Version: 1.0 References: <201905301424.x4UEORXr098755@repo.freebsd.org> <20190604225128.GL21836@FreeBSD.org> <20190605095458.S1083@besplex.bde.org> In-Reply-To: <20190605095458.S1083@besplex.bde.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 4 Jun 2019 19:21:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348419 - in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd To: Bruce Evans Cc: Gleb Smirnoff , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8B2508E49C 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)[]; 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: Wed, 05 Jun 2019 02:21:24 -0000 On Tue, Jun 4, 2019 at 6:31 PM Bruce Evans wrote: > On Tue, 4 Jun 2019, Gleb Smirnoff wrote: > > Why don't use C99 in 2019 instead of preprocessor define? Should be > > > > union { > > void *_cr_unused1; /* compatibility with old ucred *= / > > pid_t cr_pid; > > }; > > Anonymous unions are a gnu89 extension. Only broken C99 compilers like > clang -std=3Dc99 accept them. > > [Pedantic tangent elided.] Gleb simply misspoke. Anonymous unions are part of the standard C11, rather than C99, language; =C2=A76.7.2.1, (13). The point stands; it's 2019 and the feature has been part of the working language long prior to its standardization in 2011. Cheers, Conrad From owner-svn-src-head@freebsd.org Wed Jun 5 02:34: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 A17D115C2CFF; Wed, 5 Jun 2019 02:34:59 +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 48A888EB40; Wed, 5 Jun 2019 02:34:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22C70268C9; Wed, 5 Jun 2019 02:34:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x552YxxO085665; Wed, 5 Jun 2019 02:34:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x552YwtV085662; Wed, 5 Jun 2019 02:34:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906050234.x552YwtV085662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 5 Jun 2019 02:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348678 - in head/stand: i386/gptboot libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: i386/gptboot libsa X-SVN-Commit-Revision: 348678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48A888EB40 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)[-1.000,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: Wed, 05 Jun 2019 02:34:59 -0000 Author: imp Date: Wed Jun 5 02:34:58 2019 New Revision: 348678 URL: https://svnweb.freebsd.org/changeset/base/348678 Log: Eliminate unused uuid parameters from gptread and gptread_table. We only need it for the gptfind() function, where it's used. Modified: head/stand/i386/gptboot/gptboot.c head/stand/libsa/gpt.c head/stand/libsa/gpt.h Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Wed Jun 5 00:55:22 2019 (r348677) +++ head/stand/i386/gptboot/gptboot.c Wed Jun 5 02:34:58 2019 (r348678) @@ -232,7 +232,7 @@ static int gptinit(void) { - if (gptread(&freebsd_ufs_uuid, &gdsk.dsk, dmadat->secbuf) == -1) { + if (gptread(&gdsk.dsk, dmadat->secbuf) == -1) { printf("%s: unable to load GPT\n", BOOTPROG); return (-1); } Modified: head/stand/libsa/gpt.c ============================================================================== --- head/stand/libsa/gpt.c Wed Jun 5 00:55:22 2019 (r348677) +++ head/stand/libsa/gpt.c Wed Jun 5 02:34:58 2019 (r348678) @@ -275,8 +275,8 @@ gptbootconv(const char *which, struct dsk *dskp, struc } static int -gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp, - struct gpt_hdr *hdr, struct gpt_ent *table) +gptread_table(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) { struct gpt_ent *ent; int entries_per_sec; @@ -313,7 +313,7 @@ gptread_table(const char *which, const uuid_t *uuid, s } int -gptread(const uuid_t *uuid, struct dsk *dskp, char *buf) +gptread(struct dsk *dskp, char *buf) { uint64_t altlba; @@ -328,8 +328,7 @@ gptread(const uuid_t *uuid, struct dsk *dskp, char *bu dskp->start = 0; if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 && - gptread_table("primary", uuid, dskp, &hdr_primary, - table_primary) == 0) { + gptread_table("primary", dskp, &hdr_primary, table_primary) == 0) { hdr_primary_lba = hdr_primary.hdr_lba_self; gpthdr = &hdr_primary; gpttable = table_primary; @@ -349,8 +348,7 @@ gptread(const uuid_t *uuid, struct dsk *dskp, char *bu if (altlba == 0) printf("%s: unable to locate backup GPT header\n", BOOTPROG); else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 && - gptread_table("backup", uuid, dskp, &hdr_backup, - table_backup) == 0) { + gptread_table("backup", dskp, &hdr_backup, table_backup) == 0) { hdr_backup_lba = hdr_backup.hdr_lba_self; if (hdr_primary_lba == 0) { gpthdr = &hdr_backup; Modified: head/stand/libsa/gpt.h ============================================================================== --- head/stand/libsa/gpt.h Wed Jun 5 00:55:22 2019 (r348677) +++ head/stand/libsa/gpt.h Wed Jun 5 02:34:58 2019 (r348678) @@ -34,7 +34,7 @@ #define MAXTBLENTS 128 -int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); +int gptread(struct dsk *dskp, char *buf); int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); void gptbootfailed(struct dsk *dskp); From owner-svn-src-head@freebsd.org Wed Jun 5 03:40: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 6986A15C3B8A; Wed, 5 Jun 2019 03:40:35 +0000 (UTC) (envelope-from meta@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 01A7069919; Wed, 5 Jun 2019 03:40:35 +0000 (UTC) (envelope-from meta@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CE09A2737B; Wed, 5 Jun 2019 03:40:34 +0000 (UTC) (envelope-from meta@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x553eY2p018076; Wed, 5 Jun 2019 03:40:34 GMT (envelope-from meta@FreeBSD.org) Received: (from meta@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x553eYFH018075; Wed, 5 Jun 2019 03:40:34 GMT (envelope-from meta@FreeBSD.org) Message-Id: <201906050340.x553eYFH018075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: meta set sender to meta@FreeBSD.org using -f From: Koichiro Iwao Date: Wed, 5 Jun 2019 03:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348679 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: meta X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01A7069919 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)[-1.000,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: Wed, 05 Jun 2019 03:40:35 -0000 Author: meta (ports committer) Date: Wed Jun 5 03:40:34 2019 New Revision: 348679 URL: https://svnweb.freebsd.org/changeset/base/348679 Log: Add self to calendar, per mckusick's request Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 02:34:58 2019 (r348678) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 03:40:34 2019 (r348679) @@ -452,6 +452,7 @@ 12/06 Stefan Farfeleder born in Wien, Austria, 1980 12/08 Michael Tuexen born in Oldenburg, Germany, 1966 12/11 Ganael Laplanche born in Reims, France, 1980 +12/11 Koichiro Iwao born in Oita, Japan, 1987 12/15 James FitzGibbon born in Amersham, Buckinghamshire, United Kingdom, 1974 12/15 Timur I. Bakeyev born in Kazan, Republic of Tatarstan, USSR, 1974 12/18 Chris Timmons born in Ellensburg, Washington, United States, 1964 From owner-svn-src-head@freebsd.org Wed Jun 5 04:01: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 C2B2615C4487; Wed, 5 Jun 2019 04:01:32 +0000 (UTC) (envelope-from scottph@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 6A8A86A4BF; Wed, 5 Jun 2019 04:01:32 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4719827725; Wed, 5 Jun 2019 04:01:32 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5541W15030396; Wed, 5 Jun 2019 04:01:32 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5541Vvm030394; Wed, 5 Jun 2019 04:01:31 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <201906050401.x5541Vvm030394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 5 Jun 2019 04:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348680 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 348680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A8A86A4BF 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)[-1.000,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: Wed, 05 Jun 2019 04:01:33 -0000 Author: scottph Date: Wed Jun 5 04:01:31 2019 New Revision: 348680 URL: https://svnweb.freebsd.org/changeset/base/348680 Log: Add myself to committers-src.dot and calendar.freebsd Approved by: jhb (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jun 5 03:40:34 2019 (r348679) +++ head/share/misc/committers-src.dot Wed Jun 5 04:01:31 2019 (r348680) @@ -318,6 +318,7 @@ sbruno [label="Sean Bruno\nsbruno@FreeBSD.org\n2008/08 scf [label="Sean C. Farley\nscf@FreeBSD.org\n2007/06/24"] schweikh [label="Jens Schweikhardt\nschweikh@FreeBSD.org\n2001/04/06"] scottl [label="Scott Long\nscottl@FreeBSD.org\n2000/09/28"] +scottph [label="D Scott Phillips\nscottph@FreeBSD.org\n2019/05/28"] se [label="Stefan Esser\nse@FreeBSD.org\n1994/08/26"] sephe [label="Sepherosa Ziehau\nsephe@FreeBSD.org\n2007/03/28"] sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] @@ -511,6 +512,7 @@ emaste -> lwhsu emaste -> markj emaste -> ngie emaste -> rstone +emaste -> scottph emax -> markus @@ -608,6 +610,7 @@ jhb -> pfg jhb -> rnoland jhb -> rpokala jhb -> arichardson +jhb -> scottph jhibbits -> bdragon jhibbits -> leitao Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 03:40:34 2019 (r348679) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 04:01:31 2019 (r348680) @@ -15,6 +15,7 @@ 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 01/03 Tetsurou Okazaki born in Mobara, Chiba, Japan, 1972 01/04 Hiroyuki Hanai born in Kagawa pre., Japan, 1969 +01/05 D Scott Phillips born in Anderson, Indiana, 1983 01/06 Adriaan de Groot born in Calgary, Canada, 1973 01/06 Philippe Audeoud born in Bretigny-Sur-Orge, France, 1980 01/08 Michael L. Hostbaek born in Copenhagen, Denmark, 1977 From owner-svn-src-head@freebsd.org Wed Jun 5 04:58: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 6011C15C53B3; Wed, 5 Jun 2019 04:58:43 +0000 (UTC) (envelope-from cperciva@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 00B6F6BAD3; Wed, 5 Jun 2019 04:58:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CD68414F; Wed, 5 Jun 2019 04:58:42 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x554wgfD059125; Wed, 5 Jun 2019 04:58:42 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x554wggM059124; Wed, 5 Jun 2019 04:58:42 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201906050458.x554wggM059124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 5 Jun 2019 04:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348681 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 348681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00B6F6BAD3 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,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, 05 Jun 2019 04:58:43 -0000 Author: cperciva Date: Wed Jun 5 04:58:42 2019 New Revision: 348681 URL: https://svnweb.freebsd.org/changeset/base/348681 Log: Only respond to the PCIe Attention Button if a device is already plugged in. Prior to this commit, if PCIEM_SLOT_STA_ABP and PCIEM_SLOT_STA_PDC are asserted simultaneously, FreeBSD sets a 5 second "hardware going away" timer and then processes the "presence detect" change. In the (physically challenging) case that someone presses the "attention button" and inserts a new PCIe device at exactly the same moment, this results in FreeBSD recognizing that the device is present, attaching it, and then detaching it 5 seconds later. On EC2 "bare metal" hardware this is the precise sequence of events which takes place when a new EBS volume is attached; virtual machines have no difficulty effecting physically implausible simultaneity. This patch changes the handling of PCIEM_SLOT_STA_ABP to only detach a device if the presence of a device was detected *before* the interrupt which reports the Attention Button push. Reported by: Matt Wilson Reviewed by: jhb MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D20499 Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed Jun 5 04:01:31 2019 (r348680) +++ head/sys/dev/pci/pci_pci.c Wed Jun 5 04:58:42 2019 (r348681) @@ -1170,9 +1170,11 @@ pcib_pcie_intr_hotplug(void *arg) { struct pcib_softc *sc; device_t dev; + uint16_t old_slot_sta; sc = arg; dev = sc->dev; + old_slot_sta = sc->pcie_slot_sta; sc->pcie_slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); /* Clear the events just reported. */ @@ -1188,7 +1190,8 @@ pcib_pcie_intr_hotplug(void *arg) "Attention Button Pressed: Detach Cancelled\n"); sc->flags &= ~PCIB_DETACH_PENDING; callout_stop(&sc->pcie_ab_timer); - } else { + } else if (old_slot_sta & PCIEM_SLOT_STA_PDS) { + /* Only initiate detach sequence if device present. */ device_printf(dev, "Attention Button Pressed: Detaching in 5 seconds\n"); sc->flags |= PCIB_DETACH_PENDING; From owner-svn-src-head@freebsd.org Wed Jun 5 06:08: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 D431115C6B6B for ; Wed, 5 Jun 2019 06:08:14 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (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 121E86D9D9 for ; Wed, 5 Jun 2019 06:08:13 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io1-f66.google.com with SMTP id m24so5946778ioo.2 for ; Tue, 04 Jun 2019 23:08: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:from:date :message-id:subject:to:cc; bh=nqvy31M/IhoK922baOhaYrdlIlld7bc1ZInbN0zEc+Y=; b=DLt7KiHmNU+P5nKnOZk7FeRmAVnn2XHzVI9hQJH71LfCTSYdkuU1AO77+O16CeOl/7 +Q9XyIaV4PyqsRxeU5MceTcAtWTwsdnUJJhJC7oez5BtURcog/Ql2FJ1fK60SRPPcY/1 uLnhFu7AXmkpGWRyLKLyMLsvjpPuGH/ImvJ1lsE6cSwDZ+UR5r35UGgAJqWRa9K02h5i 7ShDO5OrV02VOCjbQFb+CNlg6MVQcvs0+10uGzKV4n2X8CsE/7gJAwc6yeZCdLeb/9uV kLPKbFzNYsfcvwqGA7hDDsUk++UszHVCXVOads44k6pvIbEMghzUgoXPsbiVrCYhUVjn TrlQ== X-Gm-Message-State: APjAAAUpczxg7LtxOvSzMnk8wNORfolQ0h5vkekBDPeCJE0fanWLihfS 3JnrryIqIJxF9S70otHz+5I6VnI3CQrBPBsR8WKHFA== X-Google-Smtp-Source: APXvYqzSpIY7HkFL4LUMOZzl8E/Q8R2DO8Qjflrz7JuAwdxDy3vBRoUhP6aUMsv1T4BLBjap/uEHP9SBA8hh7Jp8AH0= X-Received: by 2002:a5d:968e:: with SMTP id m14mr22703245ion.49.1559714438694; Tue, 04 Jun 2019 23:00:38 -0700 (PDT) MIME-Version: 1.0 References: <201906031842.x53IgoVw044142@gndrsh.dnsmgr.net> In-Reply-To: <201906031842.x53IgoVw044142@gndrsh.dnsmgr.net> From: Maxim Sobolev Date: Tue, 4 Jun 2019 23:00:27 -0700 Message-ID: Subject: Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb To: "Rodney W. Grimes" Cc: Enji Cooper , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 121E86D9D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of sobomax@sippysoft.com designates 209.85.166.66 as permitted sender) smtp.mailfrom=sobomax@sippysoft.com X-Spamd-Result: default: False [-2.89 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[5]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.73)[-0.731,0]; RCVD_IN_DNSWL_NONE(0.00)[66.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[sobomax@freebsd.org,sobomax@sippysoft.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[sobomax@freebsd.org,sobomax@sippysoft.com]; IP_SCORE(-1.15)[ipnet: 209.85.128.0/17(-3.39), asn: 15169(-2.30), country: US(-0.06)]; FREEMAIL_CC(0.00)[gmail.com] 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: Wed, 05 Jun 2019 06:08:15 -0000 https://reviews.freebsd.org/D20520 has been created as a follow-up. Give it some feedback, thanks! -Max On Mon, Jun 3, 2019 at 11:42 AM Rodney W. Grimes wrote: > > On Mon, Jun 3, 2019 at 7:28 AM Enji Cooper > wrote: > > > > > Hi Maxim, > > > > > > > > > > Modified: head/Makefile.inc1 > > > > > > > > ============================================================================== > > > > --- head/Makefile.inc1 Sun Jun 2 22:27:26 2019 (r348520) > > > > +++ head/Makefile.inc1 Sun Jun 2 23:38:19 2019 (r348521) > > > > @@ -887,8 +887,8 @@ MTREEFLAGS+= -W > > > > INSTALLFLAGS+= -h sha256 > > > > .endif > > > > .if defined(DB_FROM_SRC) || defined(NO_ROOT) > > > > -IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" > > > > -IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" > > > > +IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}" > > > > +IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" > > I see the bugger with this change now, it is a loop, > MTREE_CMD=${MTREE_CMD}... and I do not think MTREE_CMD is defined > at this point, see below. > > > > > .endif > > > > > > Please back out this part of the change as it is unnecessary and > adds > > > a dependency on sys.mk?s definitions. $PATH should contain, i.e., be > > > populated, with these tools when running make installworld. This is > part of > > > the logic behind how $ITOOLS, etc, works. > > That would be in direct conflict with how preceding tools > worked, INSTALL?=install has been there for a very very long time > and any direct invoke of install in our Makefile/.mk files is just wrong, > and for the very reasoning that Max is trying to do. > > I made the mistake of following someone else earlier that thought > it was INSTALL that was undefined, and as we known now that was > not the case, it was MTREE_CMD that was undefined, and that is > less clear, as iirc when that was originally done mtree was > contained soly in src/etc/Makefile by design. It appears as > if that hos how crept up directly into head/Makefile.inc1, and > the definition for MTREE_CMD?= did not get moved to a more > appropriate place. > > > > Thank you very much for your work and the rest of the change > though! > > > > > > > Thanks Enji, for a clarification, will do. I still cannot understand why > > can't we have those tools being re-defined with top-level make > environment? > > You should and must be able to do this. > Especially for INSTALL, I fully support that part of this change staying. > > > What I am striving at is being able to do say, make INSTALL="abcd" > > installworld. Yes, I understand I can call "abcd" "install" (or make a > > symlink to it) and put it into PATH, but there are at least one issue > here, > > namely what if I need to pass some distinct argument to abcd based on > usage > > scenario. E.g. make INSTALL="abcd foo" distributiuon. In your case I > should > > be resorting to setting up some global environment variable and hope it > > won't get erased somewhere in the call chain, but that's bit "how you > > doing" IMHO. My approach makes certain things so much easier by cutting > > those un-neded steps. > > > > At any rate thank for a feedback and some background info, I will do more > > work on this. I was thinking more in terms of having some sort of > > bsd.bootools.mk where this can be defined in a centralized manner. > > > > -Max > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Wed Jun 5 09: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 D9F1015A6BDF; Wed, 5 Jun 2019 09:25:41 +0000 (UTC) (envelope-from ae@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 7EC7B73374; Wed, 5 Jun 2019 09:25:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 586D82EBF; Wed, 5 Jun 2019 09:25:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x559Pfdb099353; Wed, 5 Jun 2019 09:25:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x559Pfsv099352; Wed, 5 Jun 2019 09:25:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906050925.x559Pfsv099352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Jun 2019 09:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348682 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 348682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EC7B73374 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,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, 05 Jun 2019 09:25:42 -0000 Author: ae Date: Wed Jun 5 09:25:40 2019 New Revision: 348682 URL: https://svnweb.freebsd.org/changeset/base/348682 Log: Initialize V_nat64out methods explicitly. It looks like initialization of static variable doesn't work for VIMAGE and this leads to panic. Reported by: olivier MFC after: 1 week Modified: head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Modified: head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Wed Jun 5 04:58:42 2019 (r348681) +++ head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Wed Jun 5 09:25:40 2019 (r348682) @@ -83,6 +83,8 @@ vnet_ipfw_nat64_init(const void *arg __unused) ch = &V_layer3_chain; first = IS_DEFAULT_VNET(curvnet) ? 1: 0; + /* Initialize V_nat64out methods explicitly. */ + nat64_set_output_method(0); error = nat64stl_init(ch, first); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Wed Jun 5 13:08: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 6630815AD287; Wed, 5 Jun 2019 13:08:22 +0000 (UTC) (envelope-from tychon@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 01D0F8247E; Wed, 5 Jun 2019 13:08:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C8D1756BE; Wed, 5 Jun 2019 13:08:21 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55D8LAw014465; Wed, 5 Jun 2019 13:08:21 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55D8Ltk014464; Wed, 5 Jun 2019 13:08:21 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201906051308.x55D8Ltk014464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 5 Jun 2019 13:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348687 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 348687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01D0F8247E 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)[-1.000,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: Wed, 05 Jun 2019 13:08:22 -0000 Author: tychon Date: Wed Jun 5 13:08:21 2019 New Revision: 348687 URL: https://svnweb.freebsd.org/changeset/base/348687 Log: another occurrence where a very large dma mapping can cause integer overflow Submitted by: rlibby Sponsored by: Dell EMC Isilon Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Wed Jun 5 12:53:36 2019 (r348686) +++ head/sys/x86/iommu/busdma_dmar.c Wed Jun 5 13:08:21 2019 (r348687) @@ -702,7 +702,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam return (ENOMEM); } } - vm_page_initfake(&fma[i], pstart + i * PAGE_SIZE, + vm_page_initfake(&fma[i], pstart + ptoa(i), VM_MEMATTR_DEFAULT); ma[i] = &fma[i]; } From owner-svn-src-head@freebsd.org Wed Jun 5 13:18: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 5C60215AD81C; Wed, 5 Jun 2019 13:18:01 +0000 (UTC) (envelope-from avg@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 00ABC82B9A; Wed, 5 Jun 2019 13:18:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D287D5883; Wed, 5 Jun 2019 13:18:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55DI0YK019549; Wed, 5 Jun 2019 13:18:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55DI0xa019548; Wed, 5 Jun 2019 13:18:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906051318.x55DI0xa019548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 5 Jun 2019 13:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348688 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00ABC82B9A 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)[-1.000,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: Wed, 05 Jun 2019 13:18:01 -0000 Author: avg Date: Wed Jun 5 13:18:00 2019 New Revision: 348688 URL: https://svnweb.freebsd.org/changeset/base/348688 Log: first step towards enforcing must-succeed semantics for bus accessors Unlike BUS_READ_IVAR / BUS_WRITE_IVAR, bus accessors do not have a return code. It is assumed that there is a tight coupling between a bus driver and a driver for a device on the bus with respect to instance variables that the bus defines for its children. So, the driver is supposed to have only valid accesses to the variables and, thus, the accessors must always succeed. Of course, programming errors sometimes happen. At present, such errors go completely unnoticed. The idea of this change is to start catching them. As a first step, there will be a warning about a failed accessor call. This is to give developers a heads-up. I plan to replace the printf with a KASSERT a week later, so that the warning is harder to ignore. Reviewed by: cem, imp, ian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20458 Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Jun 5 13:08:21 2019 (r348687) +++ head/sys/sys/bus.h Wed Jun 5 13:18:00 2019 (r348688) @@ -810,16 +810,30 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mo static __inline type varp ## _get_ ## var(device_t dev) \ { \ uintptr_t v; \ - BUS_READ_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ + if (e != 0) { \ + device_printf(dev, "failed to read ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ return ((type) v); \ } \ \ static __inline void varp ## _set_ ## var(device_t dev, type t) \ { \ uintptr_t v = (uintptr_t) t; \ - BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + int e; \ + e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ + if (e != 0) { \ + device_printf(dev, "failed to write ivar " \ + __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \ + "error = %d\n", \ + device_get_nameunit(device_get_parent(dev)), e); \ + } \ } /** From owner-svn-src-head@freebsd.org Wed Jun 5 14:08: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 9001E15AEE38; Wed, 5 Jun 2019 14:08:40 +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 3802784628; Wed, 5 Jun 2019 14:08:40 +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 14F2C60D4; Wed, 5 Jun 2019 14:08:40 +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 x55E8de1045305; Wed, 5 Jun 2019 14:08:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55E8daE045304; Wed, 5 Jun 2019 14:08:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906051408.x55E8daE045304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Jun 2019 14:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348689 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 348689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3802784628 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 05 Jun 2019 14:08:40 -0000 Author: emaste Date: Wed Jun 5 14:08:39 2019 New Revision: 348689 URL: https://svnweb.freebsd.org/changeset/base/348689 Log: Use CLANG knob to remove llvm-symbolizer man page r348504 moved llvm-symbolizer from the CLANG_EXTRAS knob to CLANG, but the man page was still in the CLANG_EXTRAS section in OptionalObsoleteFiles.inc. Reported by: jhb MFC after: 3 days MFC with: r348504 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 5 13:18:00 2019 (r348688) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 5 14:08:39 2019 (r348689) @@ -1538,6 +1538,7 @@ OLD_FILES+=usr/share/man/man1/clang++.1.gz OLD_FILES+=usr/share/man/man1/clang-cpp.1.gz OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz +OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .endif @@ -1577,7 +1578,6 @@ OLD_FILES+=usr/share/man/man1/llvm-dwarfdump.1 OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz OLD_FILES+=usr/share/man/man1/llvm-link.1.gz OLD_FILES+=usr/share/man/man1/llvm-pdbutil.1.gz -OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz OLD_FILES+=usr/share/man/man1/opt.1.gz .endif From owner-svn-src-head@freebsd.org Wed Jun 5 14:09: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 E09B115AEF4A; Wed, 5 Jun 2019 14:09:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (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 7C99484830; Wed, 5 Jun 2019 14:09:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f173.google.com with SMTP id s16so3691391ita.2; Wed, 05 Jun 2019 07:09:41 -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=qR4BgZFonN5T5dyXscYuMQpGvGINoN2kFDieZRmwK6s=; b=Hr2Fs1PEvrGKJDcPz9rdJhRRCrJZs4utl6JUDWG4YLTazf+/WbZ2uyDq2WjyZkY1kJ ZsKO0V1n266ve+/Mz+K52Rl1Nq4nci+mb9UTp5qankBPdMN1eOe/WbmCrRFGe7DSFUvb ajRlsBgm4Ub219w8D3KHjQbtW1VuGPMqtUEG4ZehQXZ6fknUDTsLCXcGcKi/bkVvhksX myRN2Pm8FWWFDODs075ytokddHfL6Y2r3TgQTbZR5UHfBfI7ujIta4/kxWqoRJBKZxMb ep/VthvikYIAvcE8TVFXEZ4GvRzIzW3tiON1WIYXopRHgVEl/+Q8p/0v53lybpGSxeAO hZHw== X-Gm-Message-State: APjAAAU3+bdx3okY+5JQO3UrXCn2K/SbFFgcKVa+urzApbCFOU+8qhqY 0Z0GRDx/mMHpHUDPvEKBjQe0/4AQTUvtNu5EYZLjPw== X-Google-Smtp-Source: APXvYqwWphXmqbGNaagXbkzb80or1OnQ+uPYmss5x7IONLCIR2leZqaAyfLD9LOu3KGyf6CJVazOFAO5sS8NfXvTP78= X-Received: by 2002:a24:7585:: with SMTP id y127mr13349665itc.48.1559743773894; Wed, 05 Jun 2019 07:09:33 -0700 (PDT) MIME-Version: 1.0 References: <201906041300.x54D0n9O056000@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Wed, 5 Jun 2019 10:09:18 -0400 Message-ID: Subject: Re: svn commit: r348610 - in head: lib/clang/libllvm usr.bin/clang To: Kyle Evans Cc: John Baldwin , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7C99484830 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.940,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: Wed, 05 Jun 2019 14:09:42 -0000 On Tue, 4 Jun 2019 at 21:35, Kyle Evans wrote: > > Just to confirm... the commit for llvm-symbolizer included the move > from MK_CLANG_EXTRAS to MK_CLANG in OptionalObsoleteFiles. Not the man page though, it turns out - I moved it now in r348689. From owner-svn-src-head@freebsd.org Wed Jun 5 14: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 65E5815AF9DF; Wed, 5 Jun 2019 14:34:20 +0000 (UTC) (envelope-from kevans@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 099938582A; Wed, 5 Jun 2019 14:34:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EACA1D2E; Wed, 5 Jun 2019 14:34:19 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f48.google.com with SMTP id m15so19252876lfh.4; Wed, 05 Jun 2019 07:34:19 -0700 (PDT) X-Gm-Message-State: APjAAAWcciPV0wlqlORIXgd0rViswxDPf4HfVPbUK0F8uFkvg1yfgVxb ezeC+GeAnq2dpDif37jN2+XBu9kArobptxWhz5Q= X-Google-Smtp-Source: APXvYqye+/oTDHpMik8cLhbIdkB3EPeOu+b9Wg/VCmlNOZCXXzOGE6ezBufMlSNOlKhUcUubTy6dhSb6oJvruWm5cSI= X-Received: by 2002:a19:3f16:: with SMTP id m22mr20044935lfa.104.1559745258133; Wed, 05 Jun 2019 07:34:18 -0700 (PDT) MIME-Version: 1.0 References: <201906041300.x54D0n9O056000@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 5 Jun 2019 09:33:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348610 - in head: lib/clang/libllvm usr.bin/clang To: Ed Maste Cc: John Baldwin , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 099938582A 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.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: Wed, 05 Jun 2019 14:34:20 -0000 On Wed, Jun 5, 2019 at 9:09 AM Ed Maste wrote: > > On Tue, 4 Jun 2019 at 21:35, Kyle Evans wrote: > > > > Just to confirm... the commit for llvm-symbolizer included the move > > from MK_CLANG_EXTRAS to MK_CLANG in OptionalObsoleteFiles. > > Not the man page though, it turns out - I moved it now in r348689. Aha... Thanks! From owner-svn-src-head@freebsd.org Wed Jun 5 15:23: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 A5E3615B1490; Wed, 5 Jun 2019 15:23:49 +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 4CC018797F; Wed, 5 Jun 2019 15:23:49 +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 255F56E19; Wed, 5 Jun 2019 15:23:49 +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 x55FNnHT086953; Wed, 5 Jun 2019 15:23:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55FNnAk086952; Wed, 5 Jun 2019 15:23:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906051523.x55FNnAk086952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Jun 2019 15:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348692 - 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: 348692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CC018797F 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)[-1.000,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: Wed, 05 Jun 2019 15:23:49 -0000 Author: emaste Date: Wed Jun 5 15:23:48 2019 New Revision: 348692 URL: https://svnweb.freebsd.org/changeset/base/348692 Log: vtfontcvt: exit on error if the input font has too many glyphs The kernel has a limit of 131072 glyphs in a font; add the same check to vtfontcvt so that we won't create a font file that the kernel will not load. PR: 205707 Submitted by: Dmitry Wagin MFC after: 2 weeks Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 5 14:23:10 2019 (r348691) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 5 15:23:48 2019 (r348692) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #define VFNT_MAP_NORMAL_RH 1 #define VFNT_MAP_BOLD 2 #define VFNT_MAP_BOLD_RH 3 +#define VFNT_MAXGLYPHS 131072 #define VFNT_MAXDIMENSION 128 static unsigned int width = 8, wbytes, height = 16; @@ -184,6 +185,8 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, SLIST_INSERT_HEAD(&glyph_hash[hash], gl, g_hash); glyph_unique++; + if (glyph_unique > VFNT_MAXGLYPHS) + errx(1, "too many glyphs (%u)", glyph_unique); return (gl); } From owner-svn-src-head@freebsd.org Wed Jun 5 16:01: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 4AEB815B22DB; Wed, 5 Jun 2019 16:01:06 +0000 (UTC) (envelope-from pkubaj@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 E2CE488C9E; Wed, 5 Jun 2019 16:01:05 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B107B737F; Wed, 5 Jun 2019 16:01:05 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55G15de003260; Wed, 5 Jun 2019 16:01:05 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55G155J003259; Wed, 5 Jun 2019 16:01:05 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <201906051601.x55G155J003259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Wed, 5 Jun 2019 16:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348693 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2CE488C9E 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,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, 05 Jun 2019 16:01:06 -0000 Author: pkubaj (ports committer) Date: Wed Jun 5 16:01:05 2019 New Revision: 348693 URL: https://svnweb.freebsd.org/changeset/base/348693 Log: Add my birthday entry. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 15:23:48 2019 (r348692) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Jun 5 16:01:05 2019 (r348693) @@ -371,6 +371,7 @@ 09/23 Michael Dexter born in Los Angeles, California, 1972 09/23 Martin Matuska born in Bratislava, Slovakia, 1979 09/24 Larry Rosenman born in Queens, New York, United States, 1957 +09/25 Piotr Kubaj born in Lubin, Poland, 1991 09/27 Kyle Evans born in Oklahoma City, Oklahoma, United States, 1991 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 09/27 Renato Botelho born in Araras, Sao Paulo, Brazil, 1979 From owner-svn-src-head@freebsd.org Wed Jun 5 19:29: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 1AB1815B6DD6; Wed, 5 Jun 2019 19:29:03 +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 B1CD18FC7B; Wed, 5 Jun 2019 19:29:02 +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 859AE97A6; Wed, 5 Jun 2019 19:29:02 +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 x55JT29Y012515; Wed, 5 Jun 2019 19:29:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55JT27D012514; Wed, 5 Jun 2019 19:29:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906051929.x55JT27D012514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Jun 2019 19:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348694 - 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: 348694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1CD18FC7B 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,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, 05 Jun 2019 19:29:03 -0000 Author: jhb Date: Wed Jun 5 19:29:02 2019 New Revision: 348694 URL: https://svnweb.freebsd.org/changeset/base/348694 Log: Don't simulate PBA access if the PBA is in a separate BAR. bhyve has to virtualize the MSI-X table to trap reads and writes to that table and map those to virtual interrupts that it maps real host interrupts on to. For the pending-bit-array (PBA), bhyve passes accesses from the guest directly to the hardware. bhyve's virtualization of the MSI-X table is done by intercepting all reads and writes to the BAR holding the MSI-X table. However, if the PBA is stored in the same BAR as the MSI-X table, accesses to the PBA portion of this BAR have to be forwarded to the real BAR. However, in the case that the PBA was stored in a separate BAR and it's offset in that separate BAR overlapped with the portion of the MSI-X table BAR that the table used, the handlers for the table BAR would incorrectly think that some accesses were PBA reads and writes. This caused a crash in bhyve when it indirected a NULL pointer. Fix this case by never trying to handle PBA access if the PBA lives in a separate BAR. Reported by: gallatin Tested by: gallatin Reviewed by: markj, Patrick Mooney MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20523 Modified: head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Wed Jun 5 16:01:05 2019 (r348693) +++ head/usr.sbin/bhyve/pci_passthru.c Wed Jun 5 19:29:02 2019 (r348694) @@ -295,7 +295,7 @@ msix_table_read(struct passthru_softc *sc, uint64_t of int index; pi = sc->psc_pi; - if (offset >= pi->pi_msix.pba_offset && + if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { switch(size) { case 1: @@ -374,7 +374,7 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct p int index; pi = sc->psc_pi; - if (offset >= pi->pi_msix.pba_offset && + if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { switch(size) { case 1: From owner-svn-src-head@freebsd.org Wed Jun 5 19:30: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 2F09C15B6E8C; Wed, 5 Jun 2019 19:30:33 +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 CA1A28FE1C; Wed, 5 Jun 2019 19:30:32 +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 A66EE97C4; Wed, 5 Jun 2019 19:30:32 +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 x55JUWRe012644; Wed, 5 Jun 2019 19:30:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55JUWiX012643; Wed, 5 Jun 2019 19:30:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906051930.x55JUWiX012643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Jun 2019 19:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348695 - head/sys/amd64/vmm/io X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/io X-SVN-Commit-Revision: 348695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA1A28FE1C 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,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, 05 Jun 2019 19:30:33 -0000 Author: jhb Date: Wed Jun 5 19:30:32 2019 New Revision: 348695 URL: https://svnweb.freebsd.org/changeset/base/348695 Log: Support MSI-X for passthrough devices with a separate PBA BAR. pci_alloc_msix() requires both the table and PBA BARs to be allocated by the driver. ppt was only allocating the table BAR so would fail for devices with the PBA in a separate BAR. Fix this by allocating the PBA BAR before pci_alloc_msix() if it is stored in a separate BAR. While here, release BARs after calling pci_release_msi() instead of before. Also, don't call bus_teardown_intr() in error handling code if bus_setup_intr() has just failed. Reported by: gallatin Tested by: gallatin Reviewed by: rgrimes, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20525 Modified: head/sys/amd64/vmm/io/ppt.c Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Wed Jun 5 19:29:02 2019 (r348694) +++ head/sys/amd64/vmm/io/ppt.c Wed Jun 5 19:30:32 2019 (r348695) @@ -102,7 +102,9 @@ struct pptdev { int num_msgs; int startrid; int msix_table_rid; + int msix_pba_rid; struct resource *msix_table_res; + struct resource *msix_pba_res; struct resource **res; void **cookie; struct pptintr_arg *arg; @@ -292,6 +294,12 @@ ppt_teardown_msix(struct pptdev *ppt) for (i = 0; i < ppt->msix.num_msgs; i++) ppt_teardown_msix_intr(ppt, i); + free(ppt->msix.res, M_PPTMSIX); + free(ppt->msix.cookie, M_PPTMSIX); + free(ppt->msix.arg, M_PPTMSIX); + + pci_release_msi(ppt->dev); + if (ppt->msix.msix_table_res) { bus_release_resource(ppt->dev, SYS_RES_MEMORY, ppt->msix.msix_table_rid, @@ -299,13 +307,14 @@ ppt_teardown_msix(struct pptdev *ppt) ppt->msix.msix_table_res = NULL; ppt->msix.msix_table_rid = 0; } + if (ppt->msix.msix_pba_res) { + bus_release_resource(ppt->dev, SYS_RES_MEMORY, + ppt->msix.msix_pba_rid, + ppt->msix.msix_pba_res); + ppt->msix.msix_pba_res = NULL; + ppt->msix.msix_pba_rid = 0; + } - free(ppt->msix.res, M_PPTMSIX); - free(ppt->msix.cookie, M_PPTMSIX); - free(ppt->msix.arg, M_PPTMSIX); - - pci_release_msi(ppt->dev); - ppt->msix.num_msgs = 0; } @@ -634,6 +643,19 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int s } ppt->msix.msix_table_rid = rid; + if (dinfo->cfg.msix.msix_table_bar != + dinfo->cfg.msix.msix_pba_bar) { + rid = dinfo->cfg.msix.msix_pba_bar; + ppt->msix.msix_pba_res = bus_alloc_resource_any( + ppt->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + + if (ppt->msix.msix_pba_res == NULL) { + ppt_teardown_msix(ppt); + return (ENOSPC); + } + ppt->msix.msix_pba_rid = rid; + } + alloced = numvec; error = pci_alloc_msix(ppt->dev, &alloced); if (error || alloced != numvec) { @@ -665,7 +687,6 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int s &ppt->msix.cookie[idx]); if (error != 0) { - bus_teardown_intr(ppt->dev, ppt->msix.res[idx], ppt->msix.cookie[idx]); bus_release_resource(ppt->dev, SYS_RES_IRQ, rid, ppt->msix.res[idx]); ppt->msix.cookie[idx] = NULL; ppt->msix.res[idx] = NULL; From owner-svn-src-head@freebsd.org Wed Jun 5 19:55: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 80D2D15B7B79; Wed, 5 Jun 2019 19:55:31 +0000 (UTC) (envelope-from mizhka@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 209876AC8F; Wed, 5 Jun 2019 19:55:31 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFDFD9D2A; Wed, 5 Jun 2019 19:55:30 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55JtUHi029457; Wed, 5 Jun 2019 19:55:30 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55JtUOd029456; Wed, 5 Jun 2019 19:55:30 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201906051955.x55JtUOd029456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Wed, 5 Jun 2019 19:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348697 - head/tools/tools/ath/athani X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/tools/tools/ath/athani X-SVN-Commit-Revision: 348697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 209876AC8F 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)[-1.000,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: Wed, 05 Jun 2019 19:55:31 -0000 Author: mizhka Date: Wed Jun 5 19:55:30 2019 New Revision: 348697 URL: https://svnweb.freebsd.org/changeset/base/348697 Log: [ath] [fix] athani compilation was broken by recent ath change * This commit is going to fix build of AR724x on 13-CURRENT with additional tools like athani. See r344841 Modified: head/tools/tools/ath/athani/main.c Modified: head/tools/tools/ath/athani/main.c ============================================================================== --- head/tools/tools/ath/athani/main.c Wed Jun 5 19:46:35 2019 (r348696) +++ head/tools/tools/ath/athani/main.c Wed Jun 5 19:55:30 2019 (r348697) @@ -169,7 +169,7 @@ ani_read_state(struct ath_driver_req *req, const char printf(" firstep_level=%d\n", state.firstepLevel); printf(" ofdm_weak_signal_detect=%d\n", state.ofdmWeakSigDetectOff); printf(" cck_weak_signal_threshold=%d\n", state.cckWeakSigThreshold); - printf(" mrc_cck=%d\n", state.mrcCckOff); + printf(" mrc_cck=%d\n", state.mrcCck); /* XXX TODO: cycle counts? */ } From owner-svn-src-head@freebsd.org Wed Jun 5 20:16: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 E2C0815B825C; Wed, 5 Jun 2019 20:16:26 +0000 (UTC) (envelope-from kib@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 8493A6B67C; Wed, 5 Jun 2019 20:16:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D42AA08D; Wed, 5 Jun 2019 20:16:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55KGQbZ040200; Wed, 5 Jun 2019 20:16:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KGQpL040198; Wed, 5 Jun 2019 20:16:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906052016.x55KGQpL040198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 5 Jun 2019 20:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348698 - in head/sys/fs: nullfs tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/fs: nullfs tmpfs X-SVN-Commit-Revision: 348698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8493A6B67C 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)[-1.000,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: Wed, 05 Jun 2019 20:16:27 -0000 Author: kib Date: Wed Jun 5 20:16:25 2019 New Revision: 348698 URL: https://svnweb.freebsd.org/changeset/base/348698 Log: Manually clear text references on reclaim for nullfs and tmpfs. Both filesystems do no use vnode_pager_dealloc() which would handle this case otherwise. Nullfs because vnode vm_object handle never points to nullfs vnode. Tmpfs because its vm_object is never vnode object at all. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Wed Jun 5 19:55:30 2019 (r348697) +++ head/sys/fs/nullfs/null_vnops.c Wed Jun 5 20:16:25 2019 (r348698) @@ -810,6 +810,8 @@ null_reclaim(struct vop_reclaim_args *ap) */ if (vp->v_writecount > 0) VOP_ADD_WRITECOUNT(lowervp, -vp->v_writecount); + else if (vp->v_writecount < 0) + vp->v_writecount = 0; VI_UNLOCK(vp); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 5 19:55:30 2019 (r348697) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 5 20:16:25 2019 (r348698) @@ -488,6 +488,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t ob VI_LOCK(vp); vm_object_clear_flag(obj, OBJ_TMPFS); obj->un_pager.swp.swp_tmpfs = NULL; + if (vp->v_writecount < 0) + vp->v_writecount = 0; VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(obj); } From owner-svn-src-head@freebsd.org Wed Jun 5 20:18: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 74AB615B830F; Wed, 5 Jun 2019 20:18:09 +0000 (UTC) (envelope-from allanjude@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 151996B7F7; Wed, 5 Jun 2019 20:18:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFF36A08E; Wed, 5 Jun 2019 20:18:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55KI89V040309; Wed, 5 Jun 2019 20:18:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KI88C040308; Wed, 5 Jun 2019 20:18:08 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906052018.x55KI88C040308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 5 Jun 2019 20:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348699 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 348699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 151996B7F7 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)[-1.000,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: Wed, 05 Jun 2019 20:18:09 -0000 Author: allanjude Date: Wed Jun 5 20:18:08 2019 New Revision: 348699 URL: https://svnweb.freebsd.org/changeset/base/348699 Log: sha.3: clarify admonition against use in NEW signature schemes Reported by: cem, cperciva (grammar) Modified: head/lib/libmd/sha.3 Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Wed Jun 5 20:16:25 2019 (r348698) +++ head/lib/libmd/sha.3 Wed Jun 5 20:18:08 2019 (r348699) @@ -195,7 +195,7 @@ The .Tn SHA1 algorithm has been proven to be vulnerable to practical collision attacks and should not be relied upon to produce unique outputs, -.Em nor should they be used as part of a cryptographic signature scheme. +.Em nor should it be used as part of a new cryptographic signature scheme. .Pp The .Tn IA32 From owner-svn-src-head@freebsd.org Wed Jun 5 20: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 220C715B8458; Wed, 5 Jun 2019 20:21:18 +0000 (UTC) (envelope-from kib@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 B70036BB0A; Wed, 5 Jun 2019 20:21:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2E54A0D2; Wed, 5 Jun 2019 20:21:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x55KLHSn043526; Wed, 5 Jun 2019 20:21:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KLHYs043525; Wed, 5 Jun 2019 20:21:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906052021.x55KLHYs043525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 5 Jun 2019 20:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348701 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B70036BB0A 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)[-1.000,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: Wed, 05 Jun 2019 20:21:18 -0000 Author: kib Date: Wed Jun 5 20:21:17 2019 New Revision: 348701 URL: https://svnweb.freebsd.org/changeset/base/348701 Log: In vm_map_entry_set_vnode_text(), tolerate tmpfs mappings for which vnode is no longer resident. Mapping of tmpfs file does not bump use count on the vnode, because backing object has swap type. As result, even during normal operations, and of course on forced unmount, we might end up with text mapping from tmpfs node which has no vnode in memory. In this case, there is no v_writecount to clear (this was done during reclaim), and no reason to assert that the vnode is present. Restructure the code to silently ignore OBJ_SWAP objects with OBJ_TMPFS_NODE flag set, but OBJ_TMPFS flag clear. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jun 5 20:18:56 2019 (r348700) +++ head/sys/vm/vm_map.c Wed Jun 5 20:21:17 2019 (r348701) @@ -526,19 +526,31 @@ vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool object = object1; } - /* - * For OBJT_DEAD objects, v_writecount was handled in - * vnode_pager_dealloc(). - */ - if (object->type != OBJT_DEAD) { - KASSERT(((object->flags & OBJ_TMPFS) == 0 && - object->type == OBJT_VNODE) || - ((object->flags & OBJ_TMPFS) != 0 && - object->type == OBJT_SWAP), + vp = NULL; + if (object->type == OBJT_DEAD) { + /* + * For OBJT_DEAD objects, v_writecount was handled in + * vnode_pager_dealloc(). + */ + } else if (object->type == OBJT_VNODE) { + vp = object->handle; + } else if (object->type == OBJT_SWAP) { + KASSERT((object->flags & OBJ_TMPFS_NODE) != 0, + ("vm_map_entry_set_vnode_text: swap and !TMPFS " + "entry %p, object %p, add %d", entry, object, add)); + /* + * Tmpfs VREG node, which was reclaimed, has + * OBJ_TMPFS_NODE flag set, but not OBJ_TMPFS. In + * this case there is no v_writecount to adjust. + */ + if ((object->flags & OBJ_TMPFS) != 0) + vp = object->un_pager.swp.swp_tmpfs; + } else { + KASSERT(0, ("vm_map_entry_set_vnode_text: wrong object type, " "entry %p, object %p, add %d", entry, object, add)); - vp = (object->flags & OBJ_TMPFS) == 0 ? object->handle : - object->un_pager.swp.swp_tmpfs; + } + if (vp != NULL) { if (add) VOP_SET_TEXT_CHECKED(vp); else From owner-svn-src-head@freebsd.org Wed Jun 5 22:29: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 180E315BAE2B; Wed, 5 Jun 2019 22:29:06 +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 B19C56F6AA; Wed, 5 Jun 2019 22:29:05 +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 8A27FB631; Wed, 5 Jun 2019 22:29:05 +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 x55MT5aH007709; Wed, 5 Jun 2019 22:29:05 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55MT554007708; Wed, 5 Jun 2019 22:29:05 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052229.x55MT554007708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348705 - head/sys/cddl/dev/dtrace/amd64 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 348705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B19C56F6AA 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)[-1.000,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: Wed, 05 Jun 2019 22:29:06 -0000 Author: oshogbo Date: Wed Jun 5 22:29:05 2019 New Revision: 348705 URL: https://svnweb.freebsd.org/changeset/base/348705 Log: dtrace: 64-bits registers support The registers in ilumos and FreeBSD have a different number. In the illumos, last 32-bits register defined is SS an in FreeBSD is GS. This off-by-one caused the uregs array to returns the wrong 64-bits register on amd64. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20363 Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Wed Jun 5 21:46:56 2019 (r348704) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Wed Jun 5 22:29:05 2019 (r348705) @@ -514,7 +514,11 @@ dtrace_getreg(struct trapframe *rp, uint_t reg) reg = regmap[reg]; } else { /* This is dependent on reg.d. */ +#ifdef illumos reg -= SS + 1; +#else /* !illumos */ + reg -= GS + 1; +#endif } switch (reg) { From owner-svn-src-head@freebsd.org Wed Jun 5 22:32: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 E750515BB0FD; Wed, 5 Jun 2019 22:32: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 896FF6FB46; Wed, 5 Jun 2019 22:32:28 +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 5AED8B7CB; Wed, 5 Jun 2019 22:32:28 +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 x55MWSVD013095; Wed, 5 Jun 2019 22:32:28 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55MWQTX013086; Wed, 5 Jun 2019 22:32:26 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052232.x55MWQTX013086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348706 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64 cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays cddl/usr.sbin/dtrace/tests cddl/usr.sbin/dtrace/tests/amd... X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64 cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays cddl/usr.sbin/dtrace/tests cddl/usr.sbin/dtrace/tests/amd64 cddl/usr.sbin/dtrace/t... X-SVN-Commit-Revision: 348706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 896FF6FB46 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,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, 05 Jun 2019 22:32:29 -0000 Author: oshogbo Date: Wed Jun 5 22:32:26 2019 New Revision: 348706 URL: https://svnweb.freebsd.org/changeset/base/348706 Log: DTrace: create an amd64 test suit Create two tests checking if we can read urgs registers and if the rax register returns a correct number. Reviewed by: markj Discussed with: lwhsu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20364 Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.uregsarray.d (contents, props changed) head/cddl/usr.sbin/dtrace/tests/amd64/ head/cddl/usr.sbin/dtrace/tests/amd64/arrays/ head/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/tests/Makefile head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh head/etc/mtree/BSD.tests.dist Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c Wed Jun 5 22:32:26 2019 (r348706) @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2019 Mariusz Zaborski + * Use is subject to license terms. + */ + +__attribute__((optnone)) void +frax(void) +{ + asm volatile("mov $0x41414141, %%rax" + : : : "rax" + ); +} + +int +main(void) +{ + + while (1) { + frax(); + } + return (0); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.d Wed Jun 5 22:32:26 2019 (r348706) @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2019 Mariusz Zaborski + * Use is subject to license terms. + */ + +#pragma D option quiet + +pid$1::frax:return / uregs[R_RAX] == 0x41414141 / { + exit(0); +} + +pid$1::frax:return / uregs[R_RAX] != 0x41414141 / { + printf("wrong rax value: %d\n", uregs[R_RAX]); + exit(1); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.uregsarray.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.uregsarray.d Wed Jun 5 22:32:26 2019 (r348706) @@ -0,0 +1,82 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2019 Mariusz Zaborski + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Positive test to make sure that we can invoke amd64 + * ureg[] aliases. + * + * SECTION: User Process Tracing/uregs Array + * + * NOTES: This test does no verification - the value of the output + * is not deterministic. + */ + +#pragma D option quiet + +BEGIN +{ + printf("R_GS = 0x%x\n", uregs[R_GS]); + printf("R_ES = 0x%x\n", uregs[R_ES]); + printf("R_DS = 0x%x\n", uregs[R_DS]); + printf("R_CS = 0x%x\n", uregs[R_CS]); + printf("R_RFL = 0x%x\n", uregs[R_RFL]); + printf("R_SS = 0x%x\n", uregs[R_SS]); + printf("R_TRAPNO = 0x%x\n", uregs[R_TRAPNO]); + + printf("R_URSP = 0x%x\n", uregs[R_RSP]); + printf("R_RDI = 0x%x\n", uregs[R_RDI]); + printf("R_RSI = 0x%x\n", uregs[R_RSI]); + printf("R_RBP = 0x%x\n", uregs[R_RBP]); + printf("R_RBX = 0x%x\n", uregs[R_RBX]); + printf("R_RDX = 0x%x\n", uregs[R_RDX]); + printf("R_RCX = 0x%x\n", uregs[R_RCX]); + printf("R_RAX = 0x%x\n", uregs[R_RAX]); + printf("R_RIP = 0x%x\n", uregs[R_RIP]); + printf("R_RDI = 0x%x\n", uregs[R_RDI]); + printf("R_R9 = 0x%x\n", uregs[R_R9]); + printf("R_R10 = 0x%x\n", uregs[R_R10]); + printf("R_R11 = 0x%x\n", uregs[R_R11]); + printf("R_R12 = 0x%x\n", uregs[R_R12]); + printf("R_R13 = 0x%x\n", uregs[R_R13]); + printf("R_R14 = 0x%x\n", uregs[R_R14]); + printf("R_R15 = 0x%x\n", uregs[R_R15]); + + /* 32 bits */ + printf("R_EFL = 0x%x\n", uregs[R_EFL]); + printf("R_UESP = 0x%x\n", uregs[R_UESP]); + printf("R_ERR = 0x%x\n", uregs[R_ERR]); + printf("R_EIP = 0x%x\n", uregs[R_EIP]); + printf("R_EDI = 0x%x\n", uregs[R_EDI]); + printf("R_ESI = 0x%x\n", uregs[R_ESI]); + printf("R_EBP = 0x%x\n", uregs[R_EBP]); + printf("R_EBX = 0x%x\n", uregs[R_EBX]); + printf("R_EDX = 0x%x\n", uregs[R_EDX]); + printf("R_ECX = 0x%x\n", uregs[R_ECX]); + printf("R_EAX = 0x%x\n", uregs[R_EAX]); + + exit(0); +} Modified: head/cddl/usr.sbin/dtrace/tests/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/Makefile Wed Jun 5 22:29:05 2019 (r348705) +++ head/cddl/usr.sbin/dtrace/tests/Makefile Wed Jun 5 22:32:26 2019 (r348706) @@ -8,6 +8,10 @@ TESTS_SUBDIRS+= common TESTS_SUBDIRS+= i386 .endif +.if ${MACHINE_CPUARCH} == "amd64" +TESTS_SUBDIRS+= amd64 +.endif + .PATH: ${SRCTOP}/tests KYUAFILE= yes Added: head/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/amd64/arrays/Makefile Wed Jun 5 22:32:26 2019 (r348706) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.rax.d \ + tst.uregsarray.d \ + +TESTEXES= \ + + +CFILES= \ + tst.rax.c \ + + +.include "../../dtrace.test.mk" Modified: head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed Jun 5 22:29:05 2019 (r348705) +++ head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed Jun 5 22:32:26 2019 (r348706) @@ -96,7 +96,7 @@ readonly ORIGINDIR=$(realpath $(dirname $0)) readonly TOPDIR=$(realpath ${ORIGINDIR}/../../../../..) readonly CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst -for class in common i386; do +for class in common i386 amd64; do for group in $(find ${CONTRIB_TESTDIR}/$class -mindepth 1 -maxdepth 1 -type d); do genmakefile $class $(basename $group) done Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Jun 5 22:29:05 2019 (r348705) +++ head/etc/mtree/BSD.tests.dist Wed Jun 5 22:32:26 2019 (r348706) @@ -248,6 +248,10 @@ ustack .. .. + amd64 + arrays + .. + .. .. zfsd .. From owner-svn-src-head@freebsd.org Wed Jun 5 22:36: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 4182F15BB238; Wed, 5 Jun 2019 22:36:20 +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 DD6886FDA1; Wed, 5 Jun 2019 22:36:19 +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 B9897B7EB; Wed, 5 Jun 2019 22:36:19 +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 x55MaJTH013312; Wed, 5 Jun 2019 22:36:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55MaJn6013311; Wed, 5 Jun 2019 22:36:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052236.x55MaJn6013311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348707 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 348707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD6886FDA1 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)[-1.000,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: Wed, 05 Jun 2019 22:36:20 -0000 Author: oshogbo Date: Wed Jun 5 22:36:19 2019 New Revision: 348707 URL: https://svnweb.freebsd.org/changeset/base/348707 Log: unlink: add missing function to unlink.2 man page Modified: head/lib/libc/sys/unlink.2 Modified: head/lib/libc/sys/unlink.2 ============================================================================== --- head/lib/libc/sys/unlink.2 Wed Jun 5 22:32:26 2019 (r348706) +++ head/lib/libc/sys/unlink.2 Wed Jun 5 22:36:19 2019 (r348707) @@ -28,12 +28,13 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2019 +.Dd June 6, 2019 .Dt UNLINK 2 .Os .Sh NAME .Nm unlink , -.Nm unlinkat +.Nm unlinkat , +.Nm funlinkat .Nd remove directory entry .Sh LIBRARY .Lb libc From owner-svn-src-head@freebsd.org Wed Jun 5 22:40: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 DD6F915BB552; Wed, 5 Jun 2019 22:40:50 +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 814D27004F; Wed, 5 Jun 2019 22:40:50 +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 5BB73B811; Wed, 5 Jun 2019 22:40:50 +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 x55Meoti013554; Wed, 5 Jun 2019 22:40:50 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55MeosV013552; Wed, 5 Jun 2019 22:40:50 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052240.x55MeosV013552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348708 - 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: 348708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 814D27004F 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)[-1.000,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, 05 Jun 2019 22:40:51 -0000 Author: oshogbo Date: Wed Jun 5 22:40:49 2019 New Revision: 348708 URL: https://svnweb.freebsd.org/changeset/base/348708 Log: tail: capsicumize Submitted by: Nik Sultana Differential Revision: https://reviews.freebsd.org/D20393 Modified: head/usr.bin/tail/Makefile head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/Makefile ============================================================================== --- head/usr.bin/tail/Makefile Wed Jun 5 22:36:19 2019 (r348707) +++ head/usr.bin/tail/Makefile Wed Jun 5 22:40:49 2019 (r348708) @@ -6,6 +6,12 @@ PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c +.if ${MK_CASPER} != "no" +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+= -DWITH_CASPER +.endif + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Wed Jun 5 22:36:19 2019 (r348707) +++ head/usr.bin/tail/tail.c Wed Jun 5 22:40:49 2019 (r348708) @@ -46,9 +46,11 @@ static const char copyright[] = static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93"; #endif +#include #include #include +#include #include #include #include @@ -57,6 +59,9 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley #include #include +#include +#include + #include "extern.h" int Fflag, fflag, qflag, rflag, rval, no_files; @@ -85,7 +90,14 @@ 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); + if (caph_rights_limit(STDIN_FILENO, &rights) < 0 || + caph_limit_stderr() < 0 || caph_limit_stdout() < 0) + err(1, "can't limit stdio rights"); + /* * Tail's options are weird. First, -n10 is the same as -n-10, not * -n+10. Second, the number options are 1 based and not offsets, @@ -155,6 +167,15 @@ main(int argc, char *argv[]) no_files = argc ? argc : 1; + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); + if (fa == NULL) + errx(1, "unable to init casper"); + + caph_cache_catpages(); + if (caph_enter_casper() < 0) + err(1, "unable to enter capability mode"); + + /* * If displaying in reverse, don't permit follow option, and convert * style values. @@ -192,7 +213,7 @@ 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 = fopen(file->file_name, "r")) == NULL || + if ((file->fp = fileargs_fopen(fa, file->file_name, "r")) == NULL || fstat(fileno(file->fp), &file->st)) { if (file->fp != NULL) { fclose(file->fp); @@ -209,7 +230,7 @@ main(int argc, char *argv[]) free(files); } else if (*argv) { for (first = 1; (fn = *argv++);) { - if ((fp = fopen(fn, "r")) == NULL || + if ((fp = fileargs_fopen(fa, fn, "r")) == NULL || fstat(fileno(fp), &sb)) { ierr(fn); continue; @@ -247,6 +268,7 @@ main(int argc, char *argv[]) else forward(stdin, fn, style, off, &sb); } + fileargs_free(fa); exit(rval); } From owner-svn-src-head@freebsd.org Wed Jun 5 22:46: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 C6AAA15BB627; Wed, 5 Jun 2019 22:46:20 +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 2E3EB70424; Wed, 5 Jun 2019 22:46:20 +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 18414B9B2; Wed, 5 Jun 2019 22:46:20 +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 x55MkJMq018341; Wed, 5 Jun 2019 22:46:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55MkJvd018338; Wed, 5 Jun 2019 22:46:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052246.x55MkJvd018338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348709 - 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: 348709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E3EB70424 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,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, 05 Jun 2019 22:46:21 -0000 Author: oshogbo Date: Wed Jun 5 22:46:18 2019 New Revision: 348709 URL: https://svnweb.freebsd.org/changeset/base/348709 Log: geli: build warning fixes Submitted by: Aaron Prieger Reviewed by: sbruno Differential Revision: https://reviews.freebsd.org/D11068 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 5 22:40:49 2019 (r348708) +++ head/sys/geom/eli/g_eli.h Wed Jun 5 22:46:18 2019 (r348709) @@ -721,12 +721,12 @@ struct hmac_ctx { SHA512_CTX outerctx; }; -void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *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 uint8_t *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 5 22:40:49 2019 (r348708) +++ head/sys/geom/eli/g_eli_hmac.c Wed Jun 5 22:46:18 2019 (r348709) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include void -g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *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 uint8_t *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 5 22:40:49 2019 (r348708) +++ head/sys/geom/eli/pkcs5v2.c Wed Jun 5 22:46:18 2019 (r348709) @@ -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; @@ -97,7 +97,7 @@ static int pkcs5v2_probe(int iterations) { uint8_t key[G_ELI_USERKEYLEN], salt[G_ELI_SALTLEN]; - uint8_t passphrase[] = "passphrase"; + const char passphrase[] = "passphrase"; struct rusage start, end; int usecs; Modified: head/sys/geom/eli/pkcs5v2.h ============================================================================== --- head/sys/geom/eli/pkcs5v2.h Wed Jun 5 22:40:49 2019 (r348708) +++ head/sys/geom/eli/pkcs5v2.h Wed Jun 5 22:46:18 2019 (r348709) @@ -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 5 22:47: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 2A3D215BB69E; Wed, 5 Jun 2019 22:47:38 +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 C1B887058D; Wed, 5 Jun 2019 22:47:37 +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 97943B9BA; Wed, 5 Jun 2019 22:47:37 +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 x55Mlbim018432; Wed, 5 Jun 2019 22:47:37 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Mlb2w018431; Wed, 5 Jun 2019 22:47:37 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052247.x55Mlb2w018431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348710 - 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: 348710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1B887058D 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)[-1.000,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: Wed, 05 Jun 2019 22:47:38 -0000 Author: oshogbo Date: Wed Jun 5 22:47:37 2019 New Revision: 348710 URL: https://svnweb.freebsd.org/changeset/base/348710 Log: tail: fix style nit introduced in the r348708 Modified: head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Wed Jun 5 22:46:18 2019 (r348709) +++ head/usr.bin/tail/tail.c Wed Jun 5 22:47:37 2019 (r348710) @@ -175,7 +175,6 @@ main(int argc, char *argv[]) if (caph_enter_casper() < 0) err(1, "unable to enter capability mode"); - /* * If displaying in reverse, don't permit follow option, and convert * style values. From owner-svn-src-head@freebsd.org Wed Jun 5 22:55: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 750E715BBB6D; Wed, 5 Jun 2019 22:55:01 +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 1A21C70B14; Wed, 5 Jun 2019 22:55:01 +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 E51ADBD03; Wed, 5 Jun 2019 22:55:00 +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 x55Mt0IF023308; Wed, 5 Jun 2019 22:55:00 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Mt0Wq023307; Wed, 5 Jun 2019 22:55:00 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201906052255.x55Mt0Wq023307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 5 Jun 2019 22:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348711 - 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: 348711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A21C70B14 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)[-1.000,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: Wed, 05 Jun 2019 22:55:01 -0000 Author: oshogbo Date: Wed Jun 5 22:55:00 2019 New Revision: 348711 URL: https://svnweb.freebsd.org/changeset/base/348711 Log: tail: disable capsicum in rescue mode All rescue application are not capsicumized. Reported by: jenkins Modified: head/usr.bin/tail/Makefile Modified: head/usr.bin/tail/Makefile ============================================================================== --- head/usr.bin/tail/Makefile Wed Jun 5 22:47:37 2019 (r348710) +++ head/usr.bin/tail/Makefile Wed Jun 5 22:55:00 2019 (r348711) @@ -6,7 +6,7 @@ PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c -.if ${MK_CASPER} != "no" +.if ${MK_CASPER} != "no" && !defined(RESCUE) LIBADD+= casper LIBADD+= cap_fileargs CFLAGS+= -DWITH_CASPER From owner-svn-src-head@freebsd.org Wed Jun 5 23:37: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 4E81E15BC388; Wed, 5 Jun 2019 23:37:51 +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 D46A971A6B; Wed, 5 Jun 2019 23:37:50 +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 AADC7C3BA; Wed, 5 Jun 2019 23:37:50 +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 x55Nbos4043966; Wed, 5 Jun 2019 23:37:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Nboku043965; Wed, 5 Jun 2019 23:37:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906052337.x55Nboku043965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Jun 2019 23:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348712 - 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: 348712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D46A971A6B 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)[-1.000,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: Wed, 05 Jun 2019 23:37:51 -0000 Author: jhb Date: Wed Jun 5 23:37:50 2019 New Revision: 348712 URL: https://svnweb.freebsd.org/changeset/base/348712 Log: Use parse_integer to avoid sign extension. Coverity warned about gdb_write_mem sign extending the result of parse_byte shifted left by 24 bits when generating a 32-bit memory write value for MMIO. Simplify the code by using parse_integer instead of unrolled parse_byte calls. CID: 1401600 Reviewed by: cem MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20508 Modified: head/usr.sbin/bhyve/gdb.c Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Wed Jun 5 22:55:00 2019 (r348711) +++ head/usr.sbin/bhyve/gdb.c Wed Jun 5 23:37:50 2019 (r348712) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #ifndef WITHOUT_CAPSICUM #include #endif +#include #include #include #include @@ -953,14 +954,10 @@ gdb_write_mem(const uint8_t *data, size_t len) val = parse_byte(data); } else if (gpa & 2 || todo == 2) { bytes = 2; - val = parse_byte(data) | - (parse_byte(data + 2) << 8); + val = be16toh(parse_integer(data, 4)); } else { bytes = 4; - val = parse_byte(data) | - (parse_byte(data + 2) << 8) | - (parse_byte(data + 4) << 16) | - (parse_byte(data + 6) << 24); + val = be32toh(parse_integer(data, 8)); } error = write_mem(ctx, cur_vcpu, gpa, val, bytes); From owner-svn-src-head@freebsd.org Thu Jun 6 01:32: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 744DE15BE89C; Thu, 6 Jun 2019 01:32:01 +0000 (UTC) (envelope-from allanjude@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 0FD127668D; Thu, 6 Jun 2019 01:32:01 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E192ED6C9; Thu, 6 Jun 2019 01:32:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x561W0sN008797; Thu, 6 Jun 2019 01:32:00 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x561W0iY008796; Thu, 6 Jun 2019 01:32:00 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906060132.x561W0iY008796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 6 Jun 2019 01:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348714 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 348714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FD127668D 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)[-1.000,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: Thu, 06 Jun 2019 01:32:01 -0000 Author: allanjude Date: Thu Jun 6 01:32:00 2019 New Revision: 348714 URL: https://svnweb.freebsd.org/changeset/base/348714 Log: zpool.8: the comment property is not read-only The comment property was listed in the man page twice, once under the list of read-only properties, and again (correctly), under the list of user editable properties. PR: 238355 Reported by: Michael Zuo Sponsored by: Klara Systems Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 01:16:04 2019 (r348713) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 01:32:00 2019 (r348714) @@ -604,10 +604,6 @@ Amount of storage space within the pool that has been .It Sy capacity Percentage of pool space used. This property can also be referred to by its shortened column name, "cap". -.It Sy comment -A text string consisting of printable ASCII characters that will be stored -such that it is available even if the pool becomes faulted. An administrator -can provide additional information about a pool using this property. .It Sy dedupratio The deduplication ratio specified for a pool, expressed as a multiplier. For example, a From owner-svn-src-head@freebsd.org Thu Jun 6 03:02: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 A48FE15C0633; Thu, 6 Jun 2019 03:02:33 +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 3C083810C2; Thu, 6 Jun 2019 03:02:27 +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 5EF2FE754; Thu, 6 Jun 2019 03:02:26 +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 x5632QDq056690; Thu, 6 Jun 2019 03:02:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5632QYL056689; Thu, 6 Jun 2019 03:02:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906060302.x5632QYL056689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 6 Jun 2019 03:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348718 - head/sys/modules/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/modules/ipfilter X-SVN-Commit-Revision: 348718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C083810C2 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)[-1.000,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: Thu, 06 Jun 2019 03:02:33 -0000 Author: cy Date: Thu Jun 6 03:02:25 2019 New Revision: 348718 URL: https://svnweb.freebsd.org/changeset/base/348718 Log: Whitespace adjustment. MFC after: 3 days Modified: head/sys/modules/ipfilter/Makefile Modified: head/sys/modules/ipfilter/Makefile ============================================================================== --- head/sys/modules/ipfilter/Makefile Thu Jun 6 03:01:52 2019 (r348717) +++ head/sys/modules/ipfilter/Makefile Thu Jun 6 03:02:25 2019 (r348718) @@ -9,7 +9,7 @@ SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_prox ip_nat6.c ip_rules.c ip_scan.c ip_dstlist.c radix_ipf.c SRCS+= opt_bpf.h opt_inet6.h -CFLAGS+= -I${SRCTOP}/sys/contrib/ipfilter +CFLAGS+= -I${SRCTOP}/sys/contrib/ipfilter CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP # # If you don't want log functionality remove -DIPFILTER_LOG From owner-svn-src-head@freebsd.org Thu Jun 6 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 5AA5715C0B14; Thu, 6 Jun 2019 03:07:11 +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 C5C45819CD; Thu, 6 Jun 2019 03:07:10 +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 A04E8E776; Thu, 6 Jun 2019 03:07:10 +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 x5637Apn058086; Thu, 6 Jun 2019 03:07:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5637A9P058085; Thu, 6 Jun 2019 03:07:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906060307.x5637A9P058085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Jun 2019 03:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348722 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5C45819CD 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)[-1.000,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: Thu, 06 Jun 2019 03:07:11 -0000 Author: imp Date: Thu Jun 6 03:07:10 2019 New Revision: 348722 URL: https://svnweb.freebsd.org/changeset/base/348722 Log: Don't make the efifat thing if NOFAT is defined. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Thu Jun 6 03:04:33 2019 (r348721) +++ head/stand/efi/boot1/Makefile Thu Jun 6 03:07:10 2019 (r348722) @@ -56,8 +56,10 @@ CFLAGS+= -DEFI_DEBUG .PATH: ${EFISRC}/libefi CFLAGS+= -I${LDRSRC} +.ifndef(NOFAT) FILES= ${BOOT1}.efi ${BOOT1}.efifat FILESMODE_${BOOT1}.efi= ${BINMODE} +.endif LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared @@ -93,6 +95,7 @@ ${BOOT1}.efi: ${PROG} -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} +.ifndef(NOFAT) # The following inserts our objects into a template FAT file system # created by generate-fat.sh @@ -110,5 +113,6 @@ ${BOOT1}.efifat: ${BOOT1}.efi ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES+= ${BOOT1}.efi ${BOOT1}.efifat +.endif .include From owner-svn-src-head@freebsd.org Thu Jun 6 07:49: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 8CA1315A98D7; Thu, 6 Jun 2019 07:49:04 +0000 (UTC) (envelope-from tuexen@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 31C8589CB8; Thu, 6 Jun 2019 07:49:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6AEB196CD; Thu, 6 Jun 2019 07:49:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x567n3wb004843; Thu, 6 Jun 2019 07:49:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x567n3R4004842; Thu, 6 Jun 2019 07:49:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201906060749.x567n3R4004842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 6 Jun 2019 07:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348728 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 348728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31C8589CB8 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,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, 06 Jun 2019 07:49:04 -0000 Author: tuexen Date: Thu Jun 6 07:49:03 2019 New Revision: 348728 URL: https://svnweb.freebsd.org/changeset/base/348728 Log: r347382 added receiver side DSACK support for the TCP base stack. The corresponding changes for the RACK stack where missed and are added by this commit. Reviewed by: Richard Scheffenegger, rrs@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20372 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Jun 6 06:38:29 2019 (r348727) +++ head/sys/netinet/tcp_stacks/rack.c Thu Jun 6 07:49:03 2019 (r348728) @@ -1721,6 +1721,17 @@ rack_drop_checks(struct tcpopt *to, struct mbuf *m, st TCPSTAT_INC(tcps_rcvpartduppack); TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); } + /* + * DSACK - add SACK block for dropped range + */ + if (tp->t_flags & TF_SACK_PERMIT) { + tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen); + /* + * ACK now, as the next in-sequence segment + * will clear the DSACK block again + */ + tp->t_flags |= TF_ACKNOW; + } *drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; tlen -= todrop; @@ -4753,6 +4764,8 @@ dodata: /* XXX */ if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; + tcp_seq save_rnxt = tp->rcv_nxt; + int save_tlen = tlen; m_adj(m, drop_hdrlen); /* delayed header drop */ /* @@ -4795,11 +4808,29 @@ dodata: /* XXX */ * m_adj() doesn't actually frees any mbufs when * trimming from the head. */ - thflags = tcp_reass(tp, th, &save_start, &tlen, m); + tcp_seq temp = save_start; + thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tlen > 0) - tcp_update_sack_list(tp, save_start, save_start + tlen); + if (((tlen == 0) && (save_tlen > 0) && + (SEQ_LT(save_start, save_rnxt)))) { + /* + * DSACK actually handled in the fastpath + * above. + */ + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { + /* + * Cleaning sackblks by using zero length + * update. + */ + tcp_update_sack_list(tp, save_start, save_start); + } else if ((tlen > 0) && (tlen >= save_tlen)) { + /* Update of sackblks. */ + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else if (tlen > 0) { + tcp_update_sack_list(tp, save_start, save_start+tlen); + } } else { m_freem(m); thflags &= ~TH_FIN; From owner-svn-src-head@freebsd.org Thu Jun 6 08:12: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 6047E15AB7AB; Thu, 6 Jun 2019 08:12:50 +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 050F38AA52; Thu, 6 Jun 2019 08:12:50 +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 D1B2E19BF9; Thu, 6 Jun 2019 08:12:49 +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 x568Cnbb020011; Thu, 6 Jun 2019 08:12:49 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x568CngU020010; Thu, 6 Jun 2019 08:12:49 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201906060812.x568CngU020010@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: Thu, 6 Jun 2019 08:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348729 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 050F38AA52 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 06 Jun 2019 08:12:50 -0000 Author: 0mp (ports committer) Date: Thu Jun 6 08:12:49 2019 New Revision: 348729 URL: https://svnweb.freebsd.org/changeset/base/348729 Log: Add my birthday to calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 6 07:49:03 2019 (r348728) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 6 08:12:49 2019 (r348729) @@ -63,6 +63,7 @@ 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 02/02 Yoshihiro Takahashi born in Yokohama, Kanagawa, Japan, 1976 02/03 Jason Helfman born in Royal Oak, Michigan, United States, 1972 +02/03 Mateusz Piotrowski <0mp@FreeBSD.org> born in Warsaw, Poland, 1995 02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/06 Julien Charbon born in Saint Etienne, Loire, France, 1978 From owner-svn-src-head@freebsd.org Thu Jun 6 08:43: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 293E615AC185; Thu, 6 Jun 2019 08:43:24 +0000 (UTC) (envelope-from arrowd@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 AFF9F8B7D1; Thu, 6 Jun 2019 08:43:23 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8A1481A104; Thu, 6 Jun 2019 08:43:23 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x568hNBq035656; Thu, 6 Jun 2019 08:43:23 GMT (envelope-from arrowd@FreeBSD.org) Received: (from arrowd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x568hN3i035655; Thu, 6 Jun 2019 08:43:23 GMT (envelope-from arrowd@FreeBSD.org) Message-Id: <201906060843.x568hN3i035655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arrowd set sender to arrowd@FreeBSD.org using -f From: Gleb Popov Date: Thu, 6 Jun 2019 08:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348730 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: arrowd X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 348730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFF9F8B7D1 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)[-1.000,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: Thu, 06 Jun 2019 08:43:24 -0000 Author: arrowd (ports committer) Date: Thu Jun 6 08:43:23 2019 New Revision: 348730 URL: https://svnweb.freebsd.org/changeset/base/348730 Log: Add myself (arrowd) to calendar.freebsd. Approved by: bapt Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 6 08:12:49 2019 (r348729) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 6 08:43:23 2019 (r348730) @@ -423,6 +423,7 @@ 11/09 Antoine Brodin born in Bagnolet, France, 1981 11/10 Gregory Neil Shapiro born in Providence, Rhode Island, United States, 1970 11/11 Danilo E. Gondolfo born in Lobato, Parana, Brazil, 1987 +11/12 Gleb Popov born in Volgograd, Russia, 1991 11/13 John Baldwin born in Stuart, Virginia, United States, 1977 11/14 Jeremie Le Hen born in Nancy, France, 1980 11/15 Lars Engels born in Hilden, Nordrhein-Westfalen, Germany, 1980 From owner-svn-src-head@freebsd.org Thu Jun 6 15:04: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 BBFD415B621E; Thu, 6 Jun 2019 15:04:51 +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 5C95F706DF; Thu, 6 Jun 2019 15:04:51 +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 319FD1E229; Thu, 6 Jun 2019 15:04:51 +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 x56F4oN7034765; Thu, 6 Jun 2019 15:04:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56F4odw034764; Thu, 6 Jun 2019 15:04:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906061504.x56F4odw034764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 6 Jun 2019 15:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348737 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C95F706DF 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,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, 06 Jun 2019 15:04:52 -0000 Author: asomers Date: Thu Jun 6 15:04:50 2019 New Revision: 348737 URL: https://svnweb.freebsd.org/changeset/base/348737 Log: Add a testing facility to manually reclaim a vnode Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it will be reclaimed, as long as it isn't already or doomed. The purpose is to gain test coverage for vnode reclamation, which is otherwise hard to achieve. Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except that its argument is a file descriptor instead of a pathname. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20519 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jun 6 12:44:43 2019 (r348736) +++ head/sys/kern/vfs_subr.c Thu Jun 6 15:04:50 2019 (r348737) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -338,6 +339,93 @@ SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, static int vnlru_nowhere; SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); + +static int +sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct vnode *vp; + struct nameidata nd; + char *buf; + unsigned long ndflags; + int error; + + if (req->newptr == NULL) + return (EINVAL); + if (req->newlen > PATH_MAX) + return (E2BIG); + + buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK); + error = SYSCTL_IN(req, buf, req->newlen); + if (error != 0) + goto out; + + buf[req->newlen] = '\0'; + + ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME; + NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread); + if ((error = namei(&nd)) != 0) + goto out; + vp = nd.ni_vp; + + if ((vp->v_iflag & VI_DOOMED) != 0) { + /* + * This vnode is being recycled. Return != 0 to let the caller + * know that the sysctl had no effect. Return EAGAIN because a + * subsequent call will likely succeed (since namei will create + * a new vnode if necessary) + */ + error = EAGAIN; + goto putvnode; + } + + counter_u64_add(recycles_count, 1); + vgone(vp); +putvnode: + NDFREE(&nd, 0); +out: + free(buf, M_TEMP); + return (error); +} + +static int +sysctl_ftry_reclaim_vnode(SYSCTL_HANDLER_ARGS) +{ + struct thread *td = curthread; + struct vnode *vp; + struct file *fp; + int error; + int fd; + + if (req->newptr == NULL) + return (EBADF); + + error = sysctl_handle_int(oidp, &fd, 0, req); + if (error != 0) + return (error); + error = getvnode(curthread, fd, &cap_fcntl_rights, &fp); + if (error != 0) + return (error); + vp = fp->f_vnode; + + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) + goto drop; + + counter_u64_add(recycles_count, 1); + vgone(vp); + VOP_UNLOCK(vp, 0); +drop: + fdrop(fp, td); + return (error); +} + +SYSCTL_PROC(_debug, OID_AUTO, try_reclaim_vnode, + CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_try_reclaim_vnode, "A", "Try to reclaim a vnode by its pathname"); +SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, + sysctl_ftry_reclaim_vnode, "I", + "Try to reclaim a vnode by its file descriptor"); /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ static int vnsz2log; From owner-svn-src-head@freebsd.org Thu Jun 6 15: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 EE27A15B6721; Thu, 6 Jun 2019 15:18:23 +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 95BA871028; Thu, 6 Jun 2019 15:18:23 +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 71BFF1E3F4; Thu, 6 Jun 2019 15:18: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 x56FINZj040428; Thu, 6 Jun 2019 15:18:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56FINrQ040427; Thu, 6 Jun 2019 15:18:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906061518.x56FINrQ040427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Jun 2019 15:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348740 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 348740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95BA871028 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,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, 06 Jun 2019 15:18:24 -0000 Author: ian Date: Thu Jun 6 15:18:23 2019 New Revision: 348740 URL: https://svnweb.freebsd.org/changeset/base/348740 Log: Don't refer to the cpu variable in a KASSERT before initializing it. Modified: head/sys/dev/hwpmc/hwpmc_armv7.c Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Thu Jun 6 15:11:36 2019 (r348739) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Thu Jun 6 15:18:23 2019 (r348740) @@ -315,11 +315,11 @@ armv7_intr(struct trapframe *tf) int error; int reg, cpu; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; - cpu = curcpu; pc = armv7_pcpu[cpu]; for (ri = 0; ri < armv7_npmcs; ri++) { From owner-svn-src-head@freebsd.org Thu Jun 6 15:21: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 CB9B115B6ADC; Thu, 6 Jun 2019 15:21: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 6D46C714EE; Thu, 6 Jun 2019 15:21: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 56F461E551; Thu, 6 Jun 2019 15:21: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 x56FLbuL042281; Thu, 6 Jun 2019 15:21:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56FLbBo042280; Thu, 6 Jun 2019 15:21:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906061521.x56FLbBo042280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Jun 2019 15:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348741 - 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: 348741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D46C714EE 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,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, 06 Jun 2019 15:21:38 -0000 Author: ian Date: Thu Jun 6 15:21:36 2019 New Revision: 348741 URL: https://svnweb.freebsd.org/changeset/base/348741 Log: For armv6 and armv7, build hwpmc_armv7.c as well as the base hwpmc_arm.c. Submitted by: Arnaud YSMAL Modified: head/sys/modules/hwpmc/Makefile Modified: head/sys/modules/hwpmc/Makefile ============================================================================== --- head/sys/modules/hwpmc/Makefile Thu Jun 6 15:18:23 2019 (r348740) +++ head/sys/modules/hwpmc/Makefile Thu Jun 6 15:21:36 2019 (r348741) @@ -22,6 +22,10 @@ SRCS+= hwpmc_x86.c hwpmc_uncore.c SRCS+= hwpmc_arm.c .endif +.if ${MACHINE_ARCH:Marmv[67]*} != "" +SRCS+= hwpmc_armv7.c +.endif + .if ${MACHINE_CPUARCH} == "i386" SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c SRCS+= hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c From owner-svn-src-head@freebsd.org Thu Jun 6 16:03: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 067B415B8339; Thu, 6 Jun 2019 16:03:27 +0000 (UTC) (envelope-from markj@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 995F3731AD; Thu, 6 Jun 2019 16:03:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7416E1EC85; Thu, 6 Jun 2019 16:03:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56G3QS6066330; Thu, 6 Jun 2019 16:03:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56G3PjT066327; Thu, 6 Jun 2019 16:03:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061603.x56G3PjT066327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 16:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348742 - in head/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 cddl/contrib/opensolaris/uts/common/dtrace i386/i386 X-SVN-Commit-Revision: 348742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 995F3731AD 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,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, 06 Jun 2019 16:03:27 -0000 Author: markj Date: Thu Jun 6 16:03:25 2019 New Revision: 348742 URL: https://svnweb.freebsd.org/changeset/base/348742 Log: Fix a race between fasttrap and the user breakpoint handler. When disabling the last enabled userspace probe, fasttrap clears the function pointers which hook in to the breakpoint handler. If a traced thread hit a fasttrap breakpoint before it was removed, we must ensure that it is able to call the hook; otherwise fasttrap will not consume the trap and SIGTRAP will be delievered to the thread. Synchronize with such threads by ensuring that they load the hook pointer with interrupts disabled, and by completing an SMP rendezvous after removing breakpoints and before clearing the pointers. Reported by: Alexander Alexeev Tested by: Alexander Alexeev (earlier version) Reviewed by: cem, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20526 Modified: head/sys/amd64/amd64/trap.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Jun 6 15:21:36 2019 (r348741) +++ head/sys/amd64/amd64/trap.c Thu Jun 6 16:03:25 2019 (r348742) @@ -113,6 +113,10 @@ void dblfault_handler(struct trapframe *frame); static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); +#ifdef KDTRACE_HOOKS +static bool trap_user_dtrace(struct trapframe *, + int (**hook)(struct trapframe *)); +#endif #define MAX_TRAP_MSG 32 static char *trap_msg[] = { @@ -284,11 +288,11 @@ trap(struct trapframe *frame) break; case T_BPTFLT: /* bpt instruction fault */ - enable_intr(); #ifdef KDTRACE_HOOKS - if (dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(frame) == 0) + if (trap_user_dtrace(frame, &dtrace_pid_probe_ptr)) return; +#else + enable_intr(); #endif signo = SIGTRAP; ucode = TRAP_BRKPT; @@ -425,9 +429,7 @@ trap(struct trapframe *frame) break; #ifdef KDTRACE_HOOKS case T_DTRACE_RET: - enable_intr(); - if (dtrace_return_probe_ptr != NULL) - dtrace_return_probe_ptr(frame); + (void)trap_user_dtrace(frame, &dtrace_return_probe_ptr); return; #endif } @@ -947,6 +949,25 @@ trap_fatal(frame, eva) else panic("unknown/reserved trap"); } + +#ifdef KDTRACE_HOOKS +/* + * Invoke a userspace DTrace hook. The hook pointer is cleared when no + * userspace probes are enabled, so we must synchronize with DTrace to ensure + * that a trapping thread is able to call the hook before it is cleared. + */ +static bool +trap_user_dtrace(struct trapframe *frame, int (**hookp)(struct trapframe *)) +{ + int (*hook)(struct trapframe *); + + hook = (int (*)(struct trapframe *))atomic_load_ptr(hookp); + enable_intr(); + if (hook != NULL) + return ((hook)(frame) == 0); + return (false); +} +#endif /* * Double fault handler. Called when a fault occurs while writing Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jun 6 15:21:36 2019 (r348741) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jun 6 16:03:25 2019 (r348742) @@ -1125,31 +1125,17 @@ fasttrap_enable_callbacks(void) static void fasttrap_disable_callbacks(void) { -#ifdef illumos - ASSERT(MUTEX_HELD(&cpu_lock)); -#endif - - mutex_enter(&fasttrap_count_mtx); ASSERT(fasttrap_pid_count > 0); fasttrap_pid_count--; if (fasttrap_pid_count == 0) { -#ifdef illumos - cpu_t *cur, *cpu = CPU; - - for (cur = cpu->cpu_next_onln; cur != cpu; - cur = cur->cpu_next_onln) { - rw_enter(&cur->cpu_ft_lock, RW_WRITER); - } -#endif + /* + * Synchronize with the breakpoint handler, which is careful to + * enable interrupts only after loading the hook pointer. + */ + dtrace_sync(); dtrace_pid_probe_ptr = NULL; dtrace_return_probe_ptr = NULL; -#ifdef illumos - for (cur = cpu->cpu_next_onln; cur != cpu; - cur = cur->cpu_next_onln) { - rw_exit(&cur->cpu_ft_lock); - } -#endif } mutex_exit(&fasttrap_count_mtx); } Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Jun 6 15:21:36 2019 (r348741) +++ head/sys/i386/i386/trap.c Thu Jun 6 16:03:25 2019 (r348742) @@ -116,6 +116,10 @@ void syscall(struct trapframe *frame); static int trap_pfault(struct trapframe *, int, vm_offset_t); static void trap_fatal(struct trapframe *, vm_offset_t); +#ifdef KDTRACE_HOOKS +static bool trap_user_dtrace(struct trapframe *, + int (**hook)(struct trapframe *)); +#endif void dblfault_handler(void); extern inthand_t IDTVEC(bpt), IDTVEC(dbg), IDTVEC(int0x80_syscall); @@ -322,11 +326,11 @@ trap(struct trapframe *frame) break; case T_BPTFLT: /* bpt instruction fault */ - enable_intr(); #ifdef KDTRACE_HOOKS - if (dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(frame) == 0) + if (trap_user_dtrace(frame, &dtrace_pid_probe_ptr)) return; +#else + enable_intr(); #endif signo = SIGTRAP; ucode = TRAP_BRKPT; @@ -504,9 +508,7 @@ user_trctrap_out: break; #ifdef KDTRACE_HOOKS case T_DTRACE_RET: - enable_intr(); - if (dtrace_return_probe_ptr != NULL) - dtrace_return_probe_ptr(frame); + (void)trap_user_dtrace(frame, &dtrace_return_probe_ptr); return; #endif } @@ -990,6 +992,25 @@ trap_fatal(frame, eva) else panic("unknown/reserved trap"); } + +#ifdef KDTRACE_HOOKS +/* + * Invoke a userspace DTrace hook. The hook pointer is cleared when no + * userspace probes are enabled, so we must synchronize with DTrace to ensure + * that a trapping thread is able to call the hook before it is cleared. + */ +static bool +trap_user_dtrace(struct trapframe *frame, int (**hookp)(struct trapframe *)) +{ + int (*hook)(struct trapframe *); + + hook = (int (*)(struct trapframe *))atomic_load_ptr(hookp); + enable_intr(); + if (hook != NULL) + return ((hook)(frame) == 0); + return (false); +} +#endif /* * Double fault handler. Called when a fault occurs while writing From owner-svn-src-head@freebsd.org Thu Jun 6 16:09: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 D449D15B8487; Thu, 6 Jun 2019 16:09:20 +0000 (UTC) (envelope-from markj@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 7B0607338E; Thu, 6 Jun 2019 16:09:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F2E1EC8D; Thu, 6 Jun 2019 16:09:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56G9KoS066597; Thu, 6 Jun 2019 16:09:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56G9JLA066595; Thu, 6 Jun 2019 16:09:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061609.x56G9JLA066595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 16:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348743 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 348743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B0607338E 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,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, 06 Jun 2019 16:09:21 -0000 Author: markj Date: Thu Jun 6 16:09:19 2019 New Revision: 348743 URL: https://svnweb.freebsd.org/changeset/base/348743 Log: Make the linuxkpi's alloc_pages() consistently return wired pages. Previously it did this only on platforms without a direct map. This also more closely matches Linux's semantics. Since some DRM v5.0 code assumes the old behaviour, use a LINUXKPI_VERSION guard to preserve that until the out-of-tree module is updated. Reviewed by: hselasky, kib (earlier versions), johalun MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20502 Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Jun 6 16:03:25 2019 (r348742) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Jun 6 16:09:19 2019 (r348743) @@ -52,12 +52,15 @@ #define __GFP_RETRY_MAYFAIL 0 #define __GFP_MOVABLE 0 #define __GFP_COMP 0 -#define __GFP_KSWAPD_RECLAIM 0 +#define __GFP_KSWAPD_RECLAIM 0 #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION == 50000 +#define __GFP_NOTWIRED (1U << 25) +#endif #define __GFP_BITS_SHIFT 25 #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) #define __GFP_NOFAIL M_WAITOK @@ -74,7 +77,7 @@ #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) #define GFP_TRANSHUGE 0 -#define GFP_TRANSHUGE_LIGHT 0 +#define GFP_TRANSHUGE_LIGHT 0 CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); @@ -98,6 +101,9 @@ static inline struct page * alloc_page(gfp_t flags) { +#ifdef __GFP_NOTWIRED + flags |= __GFP_NOTWIRED; +#endif return (linux_alloc_pages(flags, 0)); } @@ -105,6 +111,9 @@ static inline struct page * alloc_pages(gfp_t flags, unsigned int order) { +#ifdef __GFP_NOTWIRED + flags |= __GFP_NOTWIRED; +#endif return (linux_alloc_pages(flags, order)); } @@ -112,6 +121,9 @@ static inline struct page * alloc_pages_node(int node_id, gfp_t flags, unsigned int order) { +#ifdef __GFP_NOTWIRED + flags |= __GFP_NOTWIRED; +#endif return (linux_alloc_pages(flags, order)); } Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Thu Jun 6 16:03:25 2019 (r348742) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Thu Jun 6 16:09:19 2019 (r348743) @@ -91,9 +91,14 @@ linux_alloc_pages(gfp_t flags, unsigned int order) if (PMAP_HAS_DMAP) { unsigned long npages = 1UL << order; - int req = (flags & M_ZERO) ? (VM_ALLOC_ZERO | VM_ALLOC_NOOBJ | - VM_ALLOC_NORMAL) : (VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL); + int req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_NORMAL; +#ifdef __GFP_NOTWIRED + if ((flags & __GFP_NOTWIRED) != 0) + req &= ~VM_ALLOC_WIRED; +#endif + if ((flags & M_ZERO) != 0) + req |= VM_ALLOC_ZERO; if (order == 0 && (flags & GFP_DMA32) == 0) { page = vm_page_alloc(NULL, 0, req); if (page == NULL) @@ -154,7 +159,8 @@ linux_free_pages(vm_page_t page, unsigned int order) vm_page_t pgo = page + x; vm_page_lock(pgo); - vm_page_free(pgo); + if (vm_page_unwire_noq(pgo)) + vm_page_free(pgo); vm_page_unlock(pgo); } } else { From owner-svn-src-head@freebsd.org Thu Jun 6 16:22: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 187CB15B8A24; Thu, 6 Jun 2019 16:22:30 +0000 (UTC) (envelope-from markj@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 B05ED73C9C; Thu, 6 Jun 2019 16:22:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81FE91EFE3; Thu, 6 Jun 2019 16:22:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56GMTj7076526; Thu, 6 Jun 2019 16:22:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56GMTmT076525; Thu, 6 Jun 2019 16:22:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061622.x56GMTmT076525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 16:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348745 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B05ED73C9C 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)[-1.000,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, 06 Jun 2019 16:22:30 -0000 Author: markj Date: Thu Jun 6 16:22:29 2019 New Revision: 348745 URL: https://svnweb.freebsd.org/changeset/base/348745 Log: Conditionalize an in_epoch() call on INVARIANTS. Its result is only used to determine whether to perform further INVARIANTS-only checks. Remove a stale comment while here. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Jun 6 16:20:50 2019 (r348744) +++ head/sys/net/if_lagg.c Thu Jun 6 16:22:29 2019 (r348745) @@ -1955,12 +1955,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po * Search a port which reports an active link state. */ - /* - * This is called with either LAGG_RLOCK() held or - * LAGG_XLOCK(sc) held. - */ +#ifdef INVARIANTS if (!in_epoch(net_epoch_preempt)) LAGG_XLOCK_ASSERT(sc); +#endif if (lp == NULL) goto search; From owner-svn-src-head@freebsd.org Thu Jun 6 16:23: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 87BF715B8AA7; Thu, 6 Jun 2019 16:23:45 +0000 (UTC) (envelope-from markj@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 2E8F674277; Thu, 6 Jun 2019 16:23:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 042A01EFF0; Thu, 6 Jun 2019 16:23:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56GNi4M076622; Thu, 6 Jun 2019 16:23:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56GNiKS076621; Thu, 6 Jun 2019 16:23:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061623.x56GNiKS076621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 16:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348746 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E8F674277 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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, 06 Jun 2019 16:23:45 -0000 Author: markj Date: Thu Jun 6 16:23:44 2019 New Revision: 348746 URL: https://svnweb.freebsd.org/changeset/base/348746 Log: Remove the volatile qualifer from uma_kmem_total. No functional change intended. Reviewed by: alc, dougm, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20514 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 6 16:22:29 2019 (r348745) +++ head/sys/vm/uma_core.c Thu Jun 6 16:23:44 2019 (r348746) @@ -146,7 +146,7 @@ static struct sx uma_drain_lock; /* kmem soft limit. */ static unsigned long uma_kmem_limit = LONG_MAX; -static volatile unsigned long uma_kmem_total; +static unsigned long uma_kmem_total; /* Is the VM done starting up? */ static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, @@ -3737,14 +3737,14 @@ unsigned long uma_size(void) { - return (uma_kmem_total); + return (atomic_load_long(&uma_kmem_total)); } long uma_avail(void) { - return (uma_kmem_limit - uma_kmem_total); + return (uma_kmem_limit - uma_size()); } void From owner-svn-src-head@freebsd.org Thu Jun 6 16:27: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 7366D15B8BA6; Thu, 6 Jun 2019 16:27:02 +0000 (UTC) (envelope-from markj@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 E7922744AA; Thu, 6 Jun 2019 16:27:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A20341F008; Thu, 6 Jun 2019 16:26:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56GQwSL076793; Thu, 6 Jun 2019 16:26:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56GQwR9076792; Thu, 6 Jun 2019 16:26:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061626.x56GQwR9076792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 16:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348747 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7922744AA 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)[-1.000,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, 06 Jun 2019 16:27:02 -0000 Author: markj Date: Thu Jun 6 16:26:58 2019 New Revision: 348747 URL: https://svnweb.freebsd.org/changeset/base/348747 Log: Add sysctls for uma_kmem_{limit,total}. Reviewed by: alc, dougm, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20514 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 6 16:23:44 2019 (r348746) +++ head/sys/vm/uma_core.c Thu Jun 6 16:26:58 2019 (r348747) @@ -144,9 +144,16 @@ static int boot_pages; static struct sx uma_drain_lock; -/* kmem soft limit. */ +/* + * kmem soft limit, initialized by uma_set_limit(). Ensure that early + * allocations don't trigger a wakeup of the reclaim thread. + */ static unsigned long uma_kmem_limit = LONG_MAX; +SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_limit, CTLFLAG_RD, &uma_kmem_limit, 0, + "UMA kernel memory soft limit"); static unsigned long uma_kmem_total; +SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD, &uma_kmem_total, 0, + "UMA kernel memory usage"); /* Is the VM done starting up? */ static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, From owner-svn-src-head@freebsd.org Thu Jun 6 16:27: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 A064815B8BCF; Thu, 6 Jun 2019 16:27:06 +0000 (UTC) (envelope-from tsoome@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 4222D744D6; Thu, 6 Jun 2019 16:27:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D30861F009; Thu, 6 Jun 2019 16:27:05 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56GR5as076848; Thu, 6 Jun 2019 16:27:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56GR5qv076847; Thu, 6 Jun 2019 16:27:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201906061627.x56GR5qv076847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 6 Jun 2019 16:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348748 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4222D744D6 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 06 Jun 2019 16:27:07 -0000 Author: tsoome Date: Thu Jun 6 16:27:05 2019 New Revision: 348748 URL: https://svnweb.freebsd.org/changeset/base/348748 Log: loader: disk_open() should honor D_PARTNONE The D_PARTNONE is documented to make it possible to open raw MBR partition, but the current disk_open() does not really implement this statement. The current code is checking partition against -1 (D_PARTNONE) but does attempt to open partition table in case we do have FreeBSD MBR partition type. Instead, we should check -2 (D_PARTWILD). In case we do have MBR + BSD label, this code is only working because by default, the first BSD partiton is created starting with relative sector 0, and we can still access the BSD table from that MBR slice. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20501 Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Thu Jun 6 16:26:58 2019 (r348747) +++ head/stand/common/disk.c Thu Jun 6 16:27:05 2019 (r348748) @@ -263,8 +263,8 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize slice = dev->d_slice; partition = dev->d_partition; - DPRINTF("%s unit %d, slice %d, partition %d => %p", - disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, od); + DPRINTF("%s unit %d, slice %d, partition %d => %p", disk_fmtdev(dev), + dev->dd.d_unit, dev->d_slice, dev->d_partition, od); /* Determine disk layout. */ od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize, @@ -309,17 +309,25 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize } else if (partition == D_PARTISGPT) { /* * When we try to open GPT partition, but partition - * table isn't GPT, reset d_partition value to -1 - * and try to autodetect appropriate value. + * table isn't GPT, reset partition value to + * D_PARTWILD and try to autodetect appropriate value. */ - partition = -1; + partition = D_PARTWILD; } + /* - * If d_partition < 0 and we are looking at a BSD slice, + * If partition is D_PARTNONE, then disk_open() was called + * to open raw MBR slice. + */ + if (partition == D_PARTNONE) + goto out; + + /* + * If partition is D_PARTWILD and we are looking at a BSD slice, * then try to read BSD label, otherwise return the * whole MBR slice. */ - if (partition == -1 && + if (partition == D_PARTWILD && part.type != PART_FREEBSD) goto out; /* Try to read BSD label */ @@ -331,7 +339,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize goto out; } /* - * If slice contains BSD label and d_partition < 0, then + * If slice contains BSD label and partition < 0, then * assume the 'a' partition. Otherwise just return the * whole MBR slice, because it can contain ZFS. */ From owner-svn-src-head@freebsd.org Thu Jun 6 16:28: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 7D67715B8CFE; Thu, 6 Jun 2019 16:28:35 +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 219B4747C1; Thu, 6 Jun 2019 16:28:35 +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 EBD831F00E; Thu, 6 Jun 2019 16:28:34 +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 x56GSYIP076948; Thu, 6 Jun 2019 16:28:34 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56GSYqT076947; Thu, 6 Jun 2019 16:28:34 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906061628.x56GSYqT076947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 6 Jun 2019 16:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348749 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 219B4747C1 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 06 Jun 2019 16:28:35 -0000 Author: dougm Date: Thu Jun 6 16:28:34 2019 New Revision: 348749 URL: https://svnweb.freebsd.org/changeset/base/348749 Log: The means of finding ranges of free pages was changed for vm_reserv_break in r348484, and there was found to improve performance minutely and reduce code size. This change applies a similar change to vm_reserv_reclaim_config, expecting similar benefits. This change also allows quick rejection of page ranges that are unsuitable on account of alignment or boundary issues, where those issues are processed a page at a time in the current implementation. For contrived test cases, this can make finding a reservation satisfying a major alignment requirement around 30 times faster. Tested by: pho Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20274 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Jun 6 16:27:05 2019 (r348748) +++ head/sys/vm/vm_reserv.c Thu Jun 6 16:28:34 2019 (r348749) @@ -1167,10 +1167,89 @@ vm_reserv_reclaim_inactive(int domain) } /* + * Determine whether this reservation has free pages that satisfy the given + * request for contiguous physical memory. Start searching from the lower + * bound, defined by low_index. + * + * The free page queue lock must be held. + */ +static bool +vm_reserv_test_contig(vm_reserv_t rv, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary) +{ + vm_paddr_t pa, size; + u_long changes; + int bitpos, bits_left, i, hi, lo, n; + + vm_reserv_assert_locked(rv); + size = npages << PAGE_SHIFT; + pa = VM_PAGE_TO_PHYS(&rv->pages[0]); + lo = (pa < low) ? + ((low + PAGE_MASK - pa) >> PAGE_SHIFT) : 0; + i = lo / NBPOPMAP; + changes = rv->popmap[i] | ((1UL << (lo % NBPOPMAP)) - 1); + hi = (pa + VM_LEVEL_0_SIZE > high) ? + ((high + PAGE_MASK - pa) >> PAGE_SHIFT) : VM_LEVEL_0_NPAGES; + n = hi / NBPOPMAP; + bits_left = hi % NBPOPMAP; + hi = lo = -1; + for (;;) { + /* + * "changes" is a bitmask that marks where a new sequence of + * 0s or 1s begins in popmap[i], with last bit in popmap[i-1] + * considered to be 1 if and only if lo == hi. The bits of + * popmap[-1] and popmap[NPOPMAP] are considered all 1s. + */ + changes ^= (changes << 1) | (lo == hi); + while (changes != 0) { + /* + * If the next change marked begins a run of 0s, set + * lo to mark that position. Otherwise set hi and + * look for a satisfactory first page from lo up to hi. + */ + bitpos = ffsl(changes) - 1; + changes ^= 1UL << bitpos; + if (lo == hi) { + lo = NBPOPMAP * i + bitpos; + continue; + } + hi = NBPOPMAP * i + bitpos; + pa = VM_PAGE_TO_PHYS(&rv->pages[lo]); + if ((pa & (alignment - 1)) != 0) { + /* Skip to next aligned page. */ + lo += (((pa - 1) | (alignment - 1)) + 1) >> + PAGE_SHIFT; + if (lo >= VM_LEVEL_0_NPAGES) + return (false); + pa = VM_PAGE_TO_PHYS(&rv->pages[lo]); + } + if (((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) { + /* Skip to next boundary-matching page. */ + lo += (((pa - 1) | (boundary - 1)) + 1) >> + PAGE_SHIFT; + if (lo >= VM_LEVEL_0_NPAGES) + return (false); + pa = VM_PAGE_TO_PHYS(&rv->pages[lo]); + } + if (lo * PAGE_SIZE + size <= hi * PAGE_SIZE) + return (true); + lo = hi; + } + if (++i < n) + changes = rv->popmap[i]; + else if (i == n) + changes = bits_left == 0 ? -1UL : + (rv->popmap[n] | (-1UL << bits_left)); + else + return (false); + } +} + +/* * Searches the partially populated reservation queue for the least recently * changed reservation with free pages that satisfy the given request for * contiguous physical memory. If a satisfactory reservation is found, it is - * broken. Returns TRUE if a reservation is broken and FALSE otherwise. + * broken. Returns true if a reservation is broken and false otherwise. * * The free page queue lock must be held. */ @@ -1180,21 +1259,19 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm { vm_paddr_t pa, size; vm_reserv_t rv, rvn; - int hi, i, lo, low_index, next_free; if (npages > VM_LEVEL_0_NPAGES - 1) - return (FALSE); + return (false); size = npages << PAGE_SHIFT; vm_reserv_domain_lock(domain); again: for (rv = TAILQ_FIRST(&vm_rvq_partpop[domain]); rv != NULL; rv = rvn) { rvn = TAILQ_NEXT(rv, partpopq); - pa = VM_PAGE_TO_PHYS(&rv->pages[VM_LEVEL_0_NPAGES - 1]); - if (pa + PAGE_SIZE - size < low) { + pa = VM_PAGE_TO_PHYS(&rv->pages[0]); + if (pa + VM_LEVEL_0_SIZE - size < low) { /* This entire reservation is too low; go to next. */ continue; } - pa = VM_PAGE_TO_PHYS(&rv->pages[0]); if (pa + size > high) { /* This entire reservation is too high; go to next. */ continue; @@ -1210,73 +1287,19 @@ again: } } else vm_reserv_domain_unlock(domain); - if (pa < low) { - /* Start the search for free pages at "low". */ - low_index = (low + PAGE_MASK - pa) >> PAGE_SHIFT; - i = low_index / NBPOPMAP; - hi = low_index % NBPOPMAP; - } else - i = hi = 0; - do { - /* Find the next free page. */ - lo = ffsl(~(((1UL << hi) - 1) | rv->popmap[i])); - while (lo == 0 && ++i < NPOPMAP) - lo = ffsl(~rv->popmap[i]); - if (i == NPOPMAP) - break; - /* Convert from ffsl() to ordinary bit numbering. */ - lo--; - next_free = NBPOPMAP * i + lo; - pa = VM_PAGE_TO_PHYS(&rv->pages[next_free]); - KASSERT(pa >= low, - ("vm_reserv_reclaim_contig: pa is too low")); - if (pa + size > high) { - /* The rest of this reservation is too high. */ - break; - } else if ((pa & (alignment - 1)) != 0 || - ((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) { - /* - * The current page doesn't meet the alignment - * and/or boundary requirements. Continue - * searching this reservation until the rest - * of its free pages are either excluded or - * exhausted. - */ - hi = lo + 1; - if (hi >= NBPOPMAP) { - hi = 0; - i++; - } - continue; - } - /* Find the next used page. */ - hi = ffsl(rv->popmap[i] & ~((1UL << lo) - 1)); - while (hi == 0 && ++i < NPOPMAP) { - if ((NBPOPMAP * i - next_free) * PAGE_SIZE >= - size) { - vm_reserv_reclaim(rv); - vm_reserv_unlock(rv); - return (TRUE); - } - hi = ffsl(rv->popmap[i]); - } - /* Convert from ffsl() to ordinary bit numbering. */ - if (i != NPOPMAP) - hi--; - if ((NBPOPMAP * i + hi - next_free) * PAGE_SIZE >= - size) { - vm_reserv_reclaim(rv); - vm_reserv_unlock(rv); - return (TRUE); - } - } while (i < NPOPMAP); + if (vm_reserv_test_contig(rv, npages, low, high, + alignment, boundary)) { + vm_reserv_reclaim(rv); + vm_reserv_unlock(rv); + return (true); + } vm_reserv_unlock(rv); vm_reserv_domain_lock(domain); if (rvn != NULL && !rvn->inpartpopq) goto again; } vm_reserv_domain_unlock(domain); - return (FALSE); + return (false); } /* From owner-svn-src-head@freebsd.org Thu Jun 6 17:13: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 36B7415B9CDC; Thu, 6 Jun 2019 17:13:20 +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 D027876065; Thu, 6 Jun 2019 17:13:19 +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 2F700DBC5; Thu, 6 Jun 2019 17:13:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348745 - head/sys/net To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906061622.x56GMTmT076525@repo.freebsd.org> From: John Baldwin 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: <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> Date: Thu, 6 Jun 2019 10:13:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201906061622.x56GMTmT076525@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D027876065 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.987,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, 06 Jun 2019 17:13:20 -0000 On 6/6/19 9:22 AM, Mark Johnston wrote: > Author: markj > Date: Thu Jun 6 16:22:29 2019 > New Revision: 348745 > URL: https://svnweb.freebsd.org/changeset/base/348745 > > Log: > Conditionalize an in_epoch() call on INVARIANTS. > > Its result is only used to determine whether to perform further > INVARIANTS-only checks. Remove a stale comment while here. > > Submitted by: Sebastian Huber > MFC after: 1 week > > Modified: > head/sys/net/if_lagg.c > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Thu Jun 6 16:20:50 2019 (r348744) > +++ head/sys/net/if_lagg.c Thu Jun 6 16:22:29 2019 (r348745) > @@ -1955,12 +1955,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po > * Search a port which reports an active link state. > */ > > - /* > - * This is called with either LAGG_RLOCK() held or > - * LAGG_XLOCK(sc) held. > - */ > +#ifdef INVARIANTS > if (!in_epoch(net_epoch_preempt)) > LAGG_XLOCK_ASSERT(sc); > +#endif FWIW, the comment wasn't stale but on purpose (I added it when I added the check). The idea is to be the equivalent of assert(in_epoch(net_epoch_preempt) || lagg_xlocked(sc)) However, I couldn't write it that way, so I use LAGG_XLOCK_ASSERT when !in_epoch returns false. Note that LAGG_RLOCK == epoch_enter, hence why the comment isn't stale. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 6 17:20: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 598AF15B9EA0; Thu, 6 Jun 2019 17:20:36 +0000 (UTC) (envelope-from markj@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 F2B6D76387; Thu, 6 Jun 2019 17:20:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD4741F9A6; Thu, 6 Jun 2019 17:20:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56HKZoW003923; Thu, 6 Jun 2019 17:20:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56HKZ1o003922; Thu, 6 Jun 2019 17:20:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906061720.x56HKZ1o003922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Jun 2019 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348751 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2B6D76387 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)[-1.000,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: Thu, 06 Jun 2019 17:20:36 -0000 Author: markj Date: Thu Jun 6 17:20:35 2019 New Revision: 348751 URL: https://svnweb.freebsd.org/changeset/base/348751 Log: Restore the comment removed in r348745. LAGG_RLOCK() enters an epoch section, so the comment wasn't stale. Reported by: jhb MFC with: r348745 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Jun 6 16:29:08 2019 (r348750) +++ head/sys/net/if_lagg.c Thu Jun 6 17:20:35 2019 (r348751) @@ -1956,6 +1956,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po */ #ifdef INVARIANTS + /* + * This is called with either LAGG_RLOCK() held or + * LAGG_XLOCK(sc) held. + */ if (!in_epoch(net_epoch_preempt)) LAGG_XLOCK_ASSERT(sc); #endif From owner-svn-src-head@freebsd.org Thu Jun 6 17:35: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 79BFE15BA405; Thu, 6 Jun 2019 17:35:25 +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 E2B5076C07; Thu, 6 Jun 2019 17:35:24 +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 x56HZGf5058846; Thu, 6 Jun 2019 10:35:16 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x56HZGIJ058845; Thu, 6 Jun 2019 10:35:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348737 - head/sys/kern In-Reply-To: <201906061504.x56F4odw034764@repo.freebsd.org> To: Alan Somers Date: Thu, 6 Jun 2019 10:35:16 -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: E2B5076C07 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,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: Thu, 06 Jun 2019 17:35:25 -0000 > Author: asomers > Date: Thu Jun 6 15:04:50 2019 > New Revision: 348737 > URL: https://svnweb.freebsd.org/changeset/base/348737 > > Log: > Add a testing facility to manually reclaim a vnode > > Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > will be reclaimed, as long as it isn't already or doomed. The purpose is to > gain test coverage for vnode reclamation, which is otherwise hard to > achieve. > > Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > that its argument is a file descriptor instead of a pathname. Should not this all be wrapped in some #ifdef or other protection, is it really a good idea to have this on every single box running FreeBSD? > > Reviewed by: kib > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D20519 > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Thu Jun 6 12:44:43 2019 (r348736) > +++ head/sys/kern/vfs_subr.c Thu Jun 6 15:04:50 2019 (r348737) > @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -338,6 +339,93 @@ SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, > static int vnlru_nowhere; > SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, > &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); > + > +static int > +sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) > +{ > + struct vnode *vp; > + struct nameidata nd; > + char *buf; > + unsigned long ndflags; > + int error; > + > + if (req->newptr == NULL) > + return (EINVAL); > + if (req->newlen > PATH_MAX) > + return (E2BIG); > + > + buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK); > + error = SYSCTL_IN(req, buf, req->newlen); > + if (error != 0) > + goto out; > + > + buf[req->newlen] = '\0'; > + > + ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME; > + NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread); > + if ((error = namei(&nd)) != 0) > + goto out; > + vp = nd.ni_vp; > + > + if ((vp->v_iflag & VI_DOOMED) != 0) { > + /* > + * This vnode is being recycled. Return != 0 to let the caller > + * know that the sysctl had no effect. Return EAGAIN because a > + * subsequent call will likely succeed (since namei will create > + * a new vnode if necessary) > + */ > + error = EAGAIN; > + goto putvnode; > + } > + > + counter_u64_add(recycles_count, 1); > + vgone(vp); > +putvnode: > + NDFREE(&nd, 0); > +out: > + free(buf, M_TEMP); > + return (error); > +} > + > +static int > +sysctl_ftry_reclaim_vnode(SYSCTL_HANDLER_ARGS) > +{ > + struct thread *td = curthread; > + struct vnode *vp; > + struct file *fp; > + int error; > + int fd; > + > + if (req->newptr == NULL) > + return (EBADF); > + > + error = sysctl_handle_int(oidp, &fd, 0, req); > + if (error != 0) > + return (error); > + error = getvnode(curthread, fd, &cap_fcntl_rights, &fp); > + if (error != 0) > + return (error); > + vp = fp->f_vnode; > + > + error = vn_lock(vp, LK_EXCLUSIVE); > + if (error != 0) > + goto drop; > + > + counter_u64_add(recycles_count, 1); > + vgone(vp); > + VOP_UNLOCK(vp, 0); > +drop: > + fdrop(fp, td); > + return (error); > +} > + > +SYSCTL_PROC(_debug, OID_AUTO, try_reclaim_vnode, > + CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, > + sysctl_try_reclaim_vnode, "A", "Try to reclaim a vnode by its pathname"); > +SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode, > + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, > + sysctl_ftry_reclaim_vnode, "I", > + "Try to reclaim a vnode by its file descriptor"); > > /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ > static int vnsz2log; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 6 17:43: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 0066E15BA735; Thu, 6 Jun 2019 17:43:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (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 8DD5B7710D; Thu, 6 Jun 2019 17:43:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2e.google.com with SMTP id u13so901046iop.0; Thu, 06 Jun 2019 10:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fXGT8BP5UeZ02hYFCrmYGNXSrCJCxnalRjfA8iFJFio=; b=q2nGjPKbfm3pThGn6O1+LXcPwEFhaOolzYaY5wnDOsXw97ffBqSTdbYS2huPpjIY+4 DHe9+tonZziwSr0qmcyGWUkPQnVijMxy5mxvf6QwlpBAkJlhwpgL46pK9bUfouE/WAiP 6jXRlZ53ZCqVzpEV7GzcRh/4H2NJKHM+DNuqswOdxZ+c7fgvfHUEsYjOFdH20VRpxPPZ vEcoPY1kTv7ZpG5G/1GPJM4wxaFYU/Dl40K1nBuxk//T9XRR7kN51Naht32QqydvIZUZ MTvllD8GpkgnS+9Onxx0jvwxQbiKl0d/BEEU4QBu20cKJ71ng7LGpWXqGONPEihiwsM7 Z2dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fXGT8BP5UeZ02hYFCrmYGNXSrCJCxnalRjfA8iFJFio=; b=HjDifKXDVlTxKOypLC8XT2pG0MybJtvkcKvfV3qL8rLPaDfrYcRuJRSydO3IYSF9p0 QTPn7xXO9iVbQtAElCwmc5yht5va/lZJbjow2bu0PBO4JhHTLCUdEa73oyVD1yyqgLGW YgQcL6+sSETvhenah4+bsR9GmAZJ7ivXXRQE/ObobEVdLSr1nIBtMENZAneoMyGaAHDa 0q3L21B6mcxll08M/sn6LIcfMXbCqKlpDqdRli1MPo6PaXlS+6Ng2i8mjJaRJo1nfiWB aOb3xbtcYOPhinmFaRPWMQqH0K32oN3nz1URncjyLh0LPzOXucpBlkobublEG+H7Lznp CMzw== X-Gm-Message-State: APjAAAVc4no6UR+B0BR9S+ikdZ1eBtxI/1+l1GYIk7abiKPx8J0k9kcL TxInm437JDuUe1vITr9waHGeB2EV X-Google-Smtp-Source: APXvYqxYHPloxH1A28yTFNq4it8heUmV4dZmMuUq0g9rqxFfJa6jh1I2C1oFZkuStXhRTnC3w9lFsQ== X-Received: by 2002:a5d:8456:: with SMTP id w22mr22558253ior.136.1559843024449; Thu, 06 Jun 2019 10:43:44 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id v130sm1148214itc.8.2019.06.06.10.43.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 10:43:43 -0700 (PDT) Sender: Mark Johnston Date: Thu, 6 Jun 2019 13:43:39 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348745 - head/sys/net Message-ID: <20190606174339.GA3015@raichu> References: <201906061622.x56GMTmT076525@repo.freebsd.org> <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Rspamd-Queue-Id: 8DD5B7710D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,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, 06 Jun 2019 17:43:46 -0000 On Thu, Jun 06, 2019 at 10:13:13AM -0700, John Baldwin wrote: > On 6/6/19 9:22 AM, Mark Johnston wrote: > > Author: markj > > Date: Thu Jun 6 16:22:29 2019 > > New Revision: 348745 > > URL: https://svnweb.freebsd.org/changeset/base/348745 > > > > Log: > > Conditionalize an in_epoch() call on INVARIANTS. > > > > Its result is only used to determine whether to perform further > > INVARIANTS-only checks. Remove a stale comment while here. > > > > Submitted by: Sebastian Huber > > MFC after: 1 week > > > > Modified: > > head/sys/net/if_lagg.c > > > > Modified: head/sys/net/if_lagg.c > > ============================================================================== > > --- head/sys/net/if_lagg.c Thu Jun 6 16:20:50 2019 (r348744) > > +++ head/sys/net/if_lagg.c Thu Jun 6 16:22:29 2019 (r348745) > > @@ -1955,12 +1955,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po > > * Search a port which reports an active link state. > > */ > > > > - /* > > - * This is called with either LAGG_RLOCK() held or > > - * LAGG_XLOCK(sc) held. > > - */ > > +#ifdef INVARIANTS > > if (!in_epoch(net_epoch_preempt)) > > LAGG_XLOCK_ASSERT(sc); > > +#endif > > FWIW, the comment wasn't stale but on purpose (I added it when I added the check). > The idea is to be the equivalent of > > assert(in_epoch(net_epoch_preempt) || lagg_xlocked(sc)) > > However, I couldn't write it that way, so I use LAGG_XLOCK_ASSERT when !in_epoch > returns false. We could add #ifdef INVARIANTS #define LAGG_ASSERT_LOCKED(_sc) (sx_xlocked(&(_sc)->sc_sx) || in_epoch(net_epoch_preempt)) #else #define LAGG_ASSERT_LOCKED(_sc) #endif > Note that LAGG_RLOCK == epoch_enter, hence why the comment isn't stale. I noticed that, but thought it was oddly phrased and decided it was stale without checking when the comment was added. I re-added it. From owner-svn-src-head@freebsd.org Thu Jun 6 17:48: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 75B1115BA9E7; Thu, 6 Jun 2019 17:48:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 07735774BE; Thu, 6 Jun 2019 17:48:00 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id a25so810546lfg.2; Thu, 06 Jun 2019 10:48:00 -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=E8bHlqHrw3mz7p0hHVU3cGkeyp6WfViZT3c199TJWmA=; b=GLSez7KT9Vf+POPtBrjN8JoNsNlkSEPy1bn/025qndPAwiAhks3f+JGjTduQIiL0qt +sYaSPtxdFNZQYY4+CHTUrY3uc7FxvcAnY9x2uJp4UAu/Mvjn6OZpixCnAi9IlH9+CFX Wll/vgPsa9ProIlo5htWCYxkEVLapwXFdmbqWI1Wb1rsFw8D7Zl6JMyiMadIrhqDRUWk oj4W2evCGxkILMdsJUEeVbgCTPwLWmXsEXcVFNDrbnvRDMiNWvBXJozemtAxnuvPw5fK hxF/peDXGws0GnL6so+9XWmV1sY+pMiIDmWhQ86wxF9/tLNdm1pjfM5wwJzqtanSQN04 tAHQ== X-Gm-Message-State: APjAAAVXI/YQH6oKqN76BMHgCwx8y94n5+KMpoFkJpVtwbWOP88vU3y3 j6HUtYZ6d2D6/+YGroxwLnaiS+zjvZcdelTbvTm5Jg== X-Google-Smtp-Source: APXvYqw+rRLhZZpxo4CSz2vlbyVRz3HiZTM8NgQe9s7emI2kz11j+vhM20G8uoYo6Rerr0cE0v/DjkokRuTqvJ098x8= X-Received: by 2002:ac2:4202:: with SMTP id y2mr6866589lfh.178.1559842775229; Thu, 06 Jun 2019 10:39:35 -0700 (PDT) MIME-Version: 1.0 References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> In-Reply-To: <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> From: Alan Somers Date: Thu, 6 Jun 2019 11:39:23 -0600 Message-ID: Subject: Re: svn commit: r348737 - head/sys/kern To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 07735774BE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,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: Thu, 06 Jun 2019 17:48:01 -0000 On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes wrote: > > > Author: asomers > > Date: Thu Jun 6 15:04:50 2019 > > New Revision: 348737 > > URL: https://svnweb.freebsd.org/changeset/base/348737 > > > > Log: > > Add a testing facility to manually reclaim a vnode > > > > Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > > will be reclaimed, as long as it isn't already or doomed. The purpose is to > > gain test coverage for vnode reclamation, which is otherwise hard to > > achieve. > > > > Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > > that its argument is a file descriptor instead of a pathname. > > Should not this all be wrapped in some #ifdef or other protection, > is it really a good idea to have this on every single box running > FreeBSD? I initially thought so too, but kib thought that it could be useful for debugging problems in the field. The potential downside is limited, because only root can write to the sysctls, and the worse-case damage is similar to a "umount -f". -Alan From owner-svn-src-head@freebsd.org Thu Jun 6 17: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 18A2015BB0AE; Thu, 6 Jun 2019 17:57:34 +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 8C52377E32; Thu, 6 Jun 2019 17:57:33 +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 x56HvU3t058979; Thu, 6 Jun 2019 10:57: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 x56HvU51058978; Thu, 6 Jun 2019 10:57:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906061757.x56HvU51058978@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348737 - head/sys/kern In-Reply-To: To: Alan Somers Date: Thu, 6 Jun 2019 10:57:30 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head 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: 8C52377E32 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,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: Thu, 06 Jun 2019 17:57:34 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > wrote: > > > > > Author: asomers > > > Date: Thu Jun 6 15:04:50 2019 > > > New Revision: 348737 > > > URL: https://svnweb.freebsd.org/changeset/base/348737 > > > > > > Log: > > > Add a testing facility to manually reclaim a vnode > > > > > > Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > > > will be reclaimed, as long as it isn't already or doomed. The purpose is to > > > gain test coverage for vnode reclamation, which is otherwise hard to > > > achieve. > > > > > > Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > > > that its argument is a file descriptor instead of a pathname. > > > > Should not this all be wrapped in some #ifdef or other protection, > > is it really a good idea to have this on every single box running > > FreeBSD? > > I initially thought so too, but kib thought that it could be useful > for debugging problems in the field. The potential downside is > limited, because only root can write to the sysctls, and the > worse-case damage is similar to a "umount -f". Things that are useful for diagnostics and debugging do not belong on all production machines. I could live with INVARIANTS so it is only in all ^/head machines, but imho shipping this type of stuff in -RELEASE is not a good idea. > -Alan -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 6 18:00: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 A8F2F15BB14C; Thu, 6 Jun 2019 18:00:03 +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 501CF77FD8; Thu, 6 Jun 2019 18:00:03 +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 9C968E076; Thu, 6 Jun 2019 18:00:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348745 - head/sys/net To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906061622.x56GMTmT076525@repo.freebsd.org> <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> <20190606174339.GA3015@raichu> From: John Baldwin 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: Thu, 6 Jun 2019 11:00:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190606174339.GA3015@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 501CF77FD8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,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, 06 Jun 2019 18:00:03 -0000 On 6/6/19 10:43 AM, Mark Johnston wrote: > On Thu, Jun 06, 2019 at 10:13:13AM -0700, John Baldwin wrote: >> On 6/6/19 9:22 AM, Mark Johnston wrote: >>> Author: markj >>> Date: Thu Jun 6 16:22:29 2019 >>> New Revision: 348745 >>> URL: https://svnweb.freebsd.org/changeset/base/348745 >>> >>> Log: >>> Conditionalize an in_epoch() call on INVARIANTS. >>> >>> Its result is only used to determine whether to perform further >>> INVARIANTS-only checks. Remove a stale comment while here. >>> >>> Submitted by: Sebastian Huber >>> MFC after: 1 week >>> >>> Modified: >>> head/sys/net/if_lagg.c >>> >>> Modified: head/sys/net/if_lagg.c >>> ============================================================================== >>> --- head/sys/net/if_lagg.c Thu Jun 6 16:20:50 2019 (r348744) >>> +++ head/sys/net/if_lagg.c Thu Jun 6 16:22:29 2019 (r348745) >>> @@ -1955,12 +1955,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po >>> * Search a port which reports an active link state. >>> */ >>> >>> - /* >>> - * This is called with either LAGG_RLOCK() held or >>> - * LAGG_XLOCK(sc) held. >>> - */ >>> +#ifdef INVARIANTS >>> if (!in_epoch(net_epoch_preempt)) >>> LAGG_XLOCK_ASSERT(sc); >>> +#endif >> >> FWIW, the comment wasn't stale but on purpose (I added it when I added the check). >> The idea is to be the equivalent of >> >> assert(in_epoch(net_epoch_preempt) || lagg_xlocked(sc)) >> >> However, I couldn't write it that way, so I use LAGG_XLOCK_ASSERT when !in_epoch >> returns false. > > We could add > > #ifdef INVARIANTS > #define LAGG_ASSERT_LOCKED(_sc) (sx_xlocked(&(_sc)->sc_sx) || in_epoch(net_epoch_preempt)) > #else > #define LAGG_ASSERT_LOCKED(_sc) > #endif Hmm, ok I guess. I just like using sx_assert when possible as you get line numbers, etc. Maybe MPASS would work though since it does that. You also don't need the extra #ifdef in that case either: #define LAGG_ASSERT_LOCKED(_sc) MPASS(sx_xlocked(&(_sc)->sc_sx) || in_epoch(net_epoch_preempt)) -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 6 18:01: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 9C8B015BB352; Thu, 6 Jun 2019 18:01:56 +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 4217A8034C; Thu, 6 Jun 2019 18:01:56 +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 72399E1B2; Thu, 6 Jun 2019 18:01:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348737 - head/sys/kern To: Alan Somers , "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> From: John Baldwin 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: Thu, 6 Jun 2019 11:01:54 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4217A8034C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,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, 06 Jun 2019 18:01:57 -0000 On 6/6/19 10:39 AM, Alan Somers wrote: > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > wrote: >> >>> Author: asomers >>> Date: Thu Jun 6 15:04:50 2019 >>> New Revision: 348737 >>> URL: https://svnweb.freebsd.org/changeset/base/348737 >>> >>> Log: >>> Add a testing facility to manually reclaim a vnode >>> >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it >>> will be reclaimed, as long as it isn't already or doomed. The purpose is to >>> gain test coverage for vnode reclamation, which is otherwise hard to >>> achieve. >>> >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except >>> that its argument is a file descriptor instead of a pathname. >> >> Should not this all be wrapped in some #ifdef or other protection, >> is it really a good idea to have this on every single box running >> FreeBSD? > > I initially thought so too, but kib thought that it could be useful > for debugging problems in the field. The potential downside is > limited, because only root can write to the sysctls, and the > worse-case damage is similar to a "umount -f". A compromise might be to stick this in a kernel module instead of in the base kernel. You could still kldload it in the field for debugging but not necessarily have it directly available out of the box. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 6 18:05: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 3354015BB4A7; Thu, 6 Jun 2019 18:05:06 +0000 (UTC) (envelope-from asomers@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 A925080558; Thu, 6 Jun 2019 18:05:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id m15so2894869ljg.13; Thu, 06 Jun 2019 11:05:05 -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=qNUUyCnd1So/6UxEWlM97/ku+fqnwAqOgS0O28JNK0E=; b=EUGmbh8kM8oakc2212QbXh70o4ajQA3JMGMOMDBxPKB9yL/jKSFfY+f6xzUnmWxY0w SSvewEpzSeb10h20SUEsCDQ56t3dn/7jE/qNU4k21VnwR4PV2BOqW/kCAbxY2iO1cAwD w1AknyZFTZYD1yQIuBXxxyWhOlgIVKeOmOG2w7WbZh051tebtI/y/rOk6lmfcBgtV2oN su1/U0Z6cuksdfQFMicyDC555cJ+VGTpbMokHuaplN00Ngk+Dr2MHNugh7BobWOTPi7V rPHQ02jocDx9SovrkIPnhns/qUz8cUIknsYQVIf6gUfouUAw6P1hpfxKJBlALYoNo0kM ZTHw== X-Gm-Message-State: APjAAAUw6OcPV45aNj+VNIvDG5H0JMSM7HieQ1leiaxO8YFhs4ejNsjo XDQxIBiZVFQMNZywLQ3A/ylArUj4odfFR6FI6XbhF5d8d24= X-Google-Smtp-Source: APXvYqweFGkfvAgjbYtckUfBxK5M4XoQTyqhWBePy5JZmDkOJAh7TxlP/06QiTLsRdV3tiJ6BRyVpPh/Z6X5vIdEKnE= X-Received: by 2002:a2e:635d:: with SMTP id x90mr15849758ljb.140.1559844303655; Thu, 06 Jun 2019 11:05:03 -0700 (PDT) MIME-Version: 1.0 References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> In-Reply-To: From: Alan Somers Date: Thu, 6 Jun 2019 12:04:52 -0600 Message-ID: Subject: Re: svn commit: r348737 - head/sys/kern To: John Baldwin Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A925080558 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,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: Thu, 06 Jun 2019 18:05:06 -0000 On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > > On 6/6/19 10:39 AM, Alan Somers wrote: > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > wrote: > >> > >>> Author: asomers > >>> Date: Thu Jun 6 15:04:50 2019 > >>> New Revision: 348737 > >>> URL: https://svnweb.freebsd.org/changeset/base/348737 > >>> > >>> Log: > >>> Add a testing facility to manually reclaim a vnode > >>> > >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > >>> will be reclaimed, as long as it isn't already or doomed. The purpose is to > >>> gain test coverage for vnode reclamation, which is otherwise hard to > >>> achieve. > >>> > >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > >>> that its argument is a file descriptor instead of a pathname. > >> > >> Should not this all be wrapped in some #ifdef or other protection, > >> is it really a good idea to have this on every single box running > >> FreeBSD? > > > > I initially thought so too, but kib thought that it could be useful > > for debugging problems in the field. The potential downside is > > limited, because only root can write to the sysctls, and the > > worse-case damage is similar to a "umount -f". > > A compromise might be to stick this in a kernel module instead of in the > base kernel. You could still kldload it in the field for debugging but > not necessarily have it directly available out of the box. > > -- > John Baldwin If we already had such a module, it would make sense to put these sysctls in there. But I don't want to create an entire module for just a few dozen LOC. Nor do I want to mediate a bike shed. So let's vote. kib already registered a vote for making them available all of the time. rgrimes voted to guard them by INVARIANTS. Anybody else who cares can reply to this thread. I'll count the votes in 24 hours. -Alan From owner-svn-src-head@freebsd.org Thu Jun 6 18:21: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 A6C7815BC131 for ; Thu, 6 Jun 2019 18:21:48 +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 1D25F814B8 for ; Thu, 6 Jun 2019 18:21:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559845306; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=RvB37OqSZMMNCc+LlfzQSMsaeYxp70wALpq7/kKgft3IRyio6fpXGCXzdHPPT1AF+1YyzwD6qXZHc TYdi8/QoHIeLxSNAonEIP2m+US6Zlu6q/cSzv8HjrHbqvdKeNUoqEUAFWVGpe65mFu3O7X0XacKj9j VXzp5mrxKUnr8igPTYh5EUZ2VVBIM5jy4zdBYr3/Bj8wqJMFgYcT0PMHQ19LABxXsyBOFx8KXOFBkk Nm3e6W8dk0v237YYxAN8sX/vxYgUj7rdqkhSl6Qd8tilADGYkFwJA+Mrq2JO7w4wUwA9RbtOXMnu2B MCCjHxwkD6EHKSd46CTJkWHTFEOeqHg== 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=OcaJKj5YqoPvpIHLBwxSp6aC4vT1CsuZDKZ1kcWWEEY=; b=m5yrD43URR5CbJeUWN8qfUWtguP6lXLtlVjM3PvndpG/GjMxHCycmSAa5jQqm+s1JdSQLYPNAFlYM viy8Rvm6i2kxFVTtRrsgihF/KWDhFN1cmjNkSf1Ca6g0Ty5f+F1mvv6IuuzZEvokU0ywKXUC4jAjes y18+jN8RxM0n0mAiVjJav+7B0h8AZfCQcnF6/GW9ZHX6/3oWnA8oflm/OplB3/aAGjb+h1cMn9V5wR rK2HARTnttirrZ0EWK2Hhzvx1NHLEkTj1LyOy2CxXq4o6RI6tCRQZJZETywnme+WJyW0/KkFkblYXi 8eaP794vR6Tl+kBhEpnkKLlsUI1rFFw== 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=OcaJKj5YqoPvpIHLBwxSp6aC4vT1CsuZDKZ1kcWWEEY=; b=TKKwWh/gLVXgHVmsIWlly6YLm7WYOxuMj41t/71q53R116cEnTDa3kuqQqqyRfoJrRvXhi5UD5Fvb Uba+5Cz94N+Iyd79QmezwqNUphLTK/UZqMEzdTPkZM6FCVS65urazswSxRw/N8c2KCFW0GNCrXU3+X a//M8HEyf02/upTjN+u/kcVNxMvIsff+Db1kMWZC59LvHGZ9zJ0jPobnby8m9Znb/tqrUBtyBcFfNi grRqsfpzsWl4Nber70EdgjA6fJmLrcJtW2Z3XnHx77m46KdUQXz1euDIfWV81FlqleJrhO8ZJdZIFN o7JEkk0v7k1E/Ofs4hhbFmR8Nx8xAbA== X-MHO-RoutePath: aGlwcGll X-MHO-User: efe39edc-8887-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 efe39edc-8887-11e9-b39a-9d2c53d3dedb; Thu, 06 Jun 2019 18:21:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x56ILhPl068985; Thu, 6 Jun 2019 12:21:43 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> Subject: Re: svn commit: r348737 - head/sys/kern From: Ian Lepore To: Alan Somers , John Baldwin Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Date: Thu, 06 Jun 2019 12:21:43 -0600 In-Reply-To: References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> 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: 1D25F814B8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,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, 06 Jun 2019 18:21:48 -0000 On Thu, 2019-06-06 at 12:04 -0600, Alan Somers wrote: > On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > > > > On 6/6/19 10:39 AM, Alan Somers wrote: > > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > > wrote: > > > > > > > > > Author: asomers > > > > > Date: Thu Jun 6 15:04:50 2019 > > > > > New Revision: 348737 > > > > > URL: https://svnweb.freebsd.org/changeset/base/348737 > > > > > > > > > > Log: > > > > > Add a testing facility to manually reclaim a vnode > > > > > > > > > > Add the debug.try_reclaim_vnode sysctl. When a pathname is > > > > > written to it, it > > > > > will be reclaimed, as long as it isn't already or doomed. > > > > > The purpose is to > > > > > gain test coverage for vnode reclamation, which is > > > > > otherwise hard to > > > > > achieve. > > > > > > > > > > Add the debug.ftry_reclaim_vnode sysctl. It does the same > > > > > thing, except > > > > > that its argument is a file descriptor instead of a > > > > > pathname. > > > > > > > > Should not this all be wrapped in some #ifdef or other > > > > protection, > > > > is it really a good idea to have this on every single box > > > > running > > > > FreeBSD? > > > > > > I initially thought so too, but kib thought that it could be > > > useful > > > for debugging problems in the field. The potential downside is > > > limited, because only root can write to the sysctls, and the > > > worse-case damage is similar to a "umount -f". > > > > A compromise might be to stick this in a kernel module instead of > > in the > > base kernel. You could still kldload it in the field for debugging > > but > > not necessarily have it directly available out of the box. > > > > -- > > John Baldwin > > If we already had such a module, it would make sense to put these > sysctls in there. But I don't want to create an entire module for > just a few dozen LOC. Nor do I want to mediate a bike shed. So > let's > vote. kib already registered a vote for making them available all of > the time. rgrimes voted to guard them by INVARIANTS. Anybody else > who cares can reply to this thread. I'll count the votes in 24 > hours. > -Alan > If our new policy is to remove sysctls that aren't used often "because something bad might happen" (without any requirement for the complainer to elaborate on just what might happen or why it's so much worse than the damage a root user could do with any other sysctl), I think several people could be employed full time doing that removal work. Or we could all just get on with doing some real work. -- Ian From owner-svn-src-head@freebsd.org Thu Jun 6 18:28: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 D0C3F15BC2E7; Thu, 6 Jun 2019 18:28:22 +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 2EB70817CB; Thu, 6 Jun 2019 18:28:21 +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 x56ISKLH059208; Thu, 6 Jun 2019 11:28:20 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x56ISKJI059207; Thu, 6 Jun 2019 11:28:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906061828.x56ISKJI059207@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348737 - head/sys/kern In-Reply-To: To: John Baldwin Date: Thu, 6 Jun 2019 11:28:20 -0700 (PDT) CC: Alan Somers , "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head 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: 2EB70817CB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,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, 06 Jun 2019 18:28:23 -0000 [ Charset UTF-8 unsupported, converting... ] > On 6/6/19 10:39 AM, Alan Somers wrote: > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > wrote: > >> > >>> Author: asomers > >>> Date: Thu Jun 6 15:04:50 2019 > >>> New Revision: 348737 > >>> URL: https://svnweb.freebsd.org/changeset/base/348737 > >>> > >>> Log: > >>> Add a testing facility to manually reclaim a vnode > >>> > >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > >>> will be reclaimed, as long as it isn't already or doomed. The purpose is to > >>> gain test coverage for vnode reclamation, which is otherwise hard to > >>> achieve. > >>> > >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > >>> that its argument is a file descriptor instead of a pathname. > >> > >> Should not this all be wrapped in some #ifdef or other protection, > >> is it really a good idea to have this on every single box running > >> FreeBSD? > > > > I initially thought so too, but kib thought that it could be useful > > for debugging problems in the field. The potential downside is > > limited, because only root can write to the sysctls, and the > > worse-case damage is similar to a "umount -f". > > A compromise might be to stick this in a kernel module instead of in the > base kernel. You could still kldload it in the field for debugging but > not necessarily have it directly available out of the box. Oh, yes, I like this solution, then avaliable on demand at anytime to anyone, but not present by default. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 6 18:29: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 E614915BC37C; Thu, 6 Jun 2019 18:29:12 +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 47C6981915; Thu, 6 Jun 2019 18:29:12 +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 x56ITA0G059224; Thu, 6 Jun 2019 11:29: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 x56ITAgb059223; Thu, 6 Jun 2019 11:29:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906061829.x56ITAgb059223@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348737 - head/sys/kern In-Reply-To: To: Alan Somers Date: Thu, 6 Jun 2019 11:29:10 -0700 (PDT) CC: John Baldwin , "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head 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: 47C6981915 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,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, 06 Jun 2019 18:29:13 -0000 > On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > > > > On 6/6/19 10:39 AM, Alan Somers wrote: > > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > > wrote: > > >> > > >>> Author: asomers > > >>> Date: Thu Jun 6 15:04:50 2019 > > >>> New Revision: 348737 > > >>> URL: https://svnweb.freebsd.org/changeset/base/348737 > > >>> > > >>> Log: > > >>> Add a testing facility to manually reclaim a vnode > > >>> > > >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > > >>> will be reclaimed, as long as it isn't already or doomed. The purpose is to > > >>> gain test coverage for vnode reclamation, which is otherwise hard to > > >>> achieve. > > >>> > > >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > > >>> that its argument is a file descriptor instead of a pathname. > > >> > > >> Should not this all be wrapped in some #ifdef or other protection, > > >> is it really a good idea to have this on every single box running > > >> FreeBSD? > > > > > > I initially thought so too, but kib thought that it could be useful > > > for debugging problems in the field. The potential downside is > > > limited, because only root can write to the sysctls, and the > > > worse-case damage is similar to a "umount -f". > > > > A compromise might be to stick this in a kernel module instead of in the > > base kernel. You could still kldload it in the field for debugging but > > not necessarily have it directly available out of the box. > > > > -- > > John Baldwin > > If we already had such a module, it would make sense to put these > sysctls in there. But I don't want to create an entire module for > just a few dozen LOC. Nor do I want to mediate a bike shed. So let's > vote. kib already registered a vote for making them available all of > the time. rgrimes voted to guard them by INVARIANTS. Anybody else > who cares can reply to this thread. I'll count the votes in 24 hours. Change my vote to module, and if need be I'll write the module. > -Alan -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 6 18:35:58 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 BC94F15BC62A; Thu, 6 Jun 2019 18:35:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 4EF4281F18; Thu, 6 Jun 2019 18:35:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd44.google.com with SMTP id n5so996668ioc.7; Thu, 06 Jun 2019 11:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KwsHt2yqefjW9j3PDas+CEWouX1RqORRnurjyP596vA=; b=YNMtMfI2036HHrvyQycjLSlJzsKxsFtIVhgOg99fW2r/Yg1gEK44VJhCCDQwNBHJK7 6KUhrBFK6sWAohDcLGEltcweGCTzebN5rhS6nyktqTduvbspAnvE3+Wlo8mnHKUoIaMS WpjthTRs9wC2hP2PMVPVEnJOZRbXO+Vpj/sr0JkHvS19GouFicziC/DH4M6rja3Q6SE4 p37ceYXg+2kw4FfXzVcWvc3FkhaF+1VF6tiJG4ewprX61ziVQU5017x2GmsxTOct6lcG lTn4PyYjBE8fWdj4qMDCx5QJ3PsqO0V7RM6ML0Nuu5rKVpRa/hO7jEh+hfAufbbqq/Hd NG5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KwsHt2yqefjW9j3PDas+CEWouX1RqORRnurjyP596vA=; b=hHcr1Ue0YkACVHoMTyEFLWcw8cW/+7JDUNxTiKOjpCGZC0+jPv/yI67dWBBj1HfjvM RWNUHDtM18e948Gj6EFWwttfBNTlim8g7yAAG5fa21OMYQFXvXO3BRYHSD9ZnoIfY+Ic cHkc97h443MVADkb2CycUUbyfG38w4+QCQKmgg2JMtVGYpn++7A5HLoZBdgoPOpCKsYX Dfpw7YaaX5GBzegukmxlml4Ajy2WR8u0MHFpUcmrE+c/1tUlgnn3j1vQtYnd8+2eE9d3 2mfo4Qb6rP+ITlgcduFiDgDMS6HQMpw34NEOWvqxknlOpNfpKPdCMFkXFcrfz7SijjZd Nxbg== X-Gm-Message-State: APjAAAWWPztWEucGw2JhUj9YKT95NQzGkdSQH+0qLtaFrcvrX+TedbOu MSlazbpCTVNkBYGC7f6ekg+xSdx3 X-Google-Smtp-Source: APXvYqyrndu1duQgdkOxSQGE1rl0WOO0siLECGAv+SrFtTYw6s6Ni5W2N1/dC1TXdiLQrF6XXnpHXg== X-Received: by 2002:a6b:e608:: with SMTP id g8mr797098ioh.88.1559846156049; Thu, 06 Jun 2019 11:35:56 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id z202sm621869itb.2.2019.06.06.11.35.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2019 11:35:54 -0700 (PDT) Sender: Mark Johnston Date: Thu, 6 Jun 2019 14:35:52 -0400 From: Mark Johnston To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348737 - head/sys/kern Message-ID: <20190606183552.GD3015@raichu> References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> 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-Rspamd-Queue-Id: 4EF4281F18 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,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, 06 Jun 2019 18:35:58 -0000 On Thu, Jun 06, 2019 at 12:04:52PM -0600, Alan Somers wrote: > On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > > > > On 6/6/19 10:39 AM, Alan Somers wrote: > > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > > wrote: > > >> > > >>> Author: asomers > > >>> Date: Thu Jun 6 15:04:50 2019 > > >>> New Revision: 348737 > > >>> URL: https://svnweb.freebsd.org/changeset/base/348737 > > >>> > > >>> Log: > > >>> Add a testing facility to manually reclaim a vnode > > >>> > > >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it > > >>> will be reclaimed, as long as it isn't already or doomed. The purpose is to > > >>> gain test coverage for vnode reclamation, which is otherwise hard to > > >>> achieve. > > >>> > > >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same thing, except > > >>> that its argument is a file descriptor instead of a pathname. > > >> > > >> Should not this all be wrapped in some #ifdef or other protection, > > >> is it really a good idea to have this on every single box running > > >> FreeBSD? > > > > > > I initially thought so too, but kib thought that it could be useful > > > for debugging problems in the field. The potential downside is > > > limited, because only root can write to the sysctls, and the > > > worse-case damage is similar to a "umount -f". > > > > A compromise might be to stick this in a kernel module instead of in the > > base kernel. You could still kldload it in the field for debugging but > > not necessarily have it directly available out of the box. > > > > -- > > John Baldwin > > If we already had such a module, it would make sense to put these > sysctls in there. But I don't want to create an entire module for > just a few dozen LOC. Nor do I want to mediate a bike shed. So let's > vote. kib already registered a vote for making them available all of > the time. rgrimes voted to guard them by INVARIANTS. Anybody else > who cares can reply to this thread. I'll count the votes in 24 hours. +1 to making it unconditional. We already have lots of debugging sysctls enabled in !INVARIANTS kernels, and these sorts of things end up being handy in unexpected ways. For a long time I've carried a patch which unconditionally compiles debug.vm_lowmem because I kept having to recompile to get it. From owner-svn-src-head@freebsd.org Thu Jun 6 19:40: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 B99B215BE18E for ; Thu, 6 Jun 2019 19:40:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (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 2154384A91 for ; Thu, 6 Jun 2019 19:40:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-lj1-x22b.google.com with SMTP id k18so1743295ljc.11 for ; Thu, 06 Jun 2019 12:40: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=M2T7QC7j9LLpfl7lUKLkA7xVGFZXggy1Trus31U5HXk=; b=xHEWTmGMW4UF1fKXjhURmVLDk3lwaKSVUPwbdkcxhBeiHAMj9loVqmYlIvD9uyFYkC rGOTdtUQKQEytU0Aj+EHvmJXi1L5So5djLJayuIN5GcDp0rd7ywqyvBj8sN3XQ4AXt9O fJb3ELrOO+xTh8BpMI7sxct4toLNASPoqCfnOtedKdxYvYCaf9pUq32K9xDIZBWzNGzt Ti6Y5cgXmGzbSZjYaX6oYAfLPMg7vle7VWMmhW1ftevqmFNp8N8RvtxFQhTvGBBF85dN RNOIh3TTMe1oico1qFc+cBZ0ITF49XuakmQzPDuz0Rr6hc+9lg8Xw7oe+qa/ZO0yjyKQ uzNA== 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=M2T7QC7j9LLpfl7lUKLkA7xVGFZXggy1Trus31U5HXk=; b=LGaQSMcutVtieXrwPOcrRzIpB1pVCPSYf+nezLdId8Ofh/XVrXX++E7P2ylQS42LCa HbKn3bC4P16pre+BQ3iFYB1Ekg9x61HaHFvHUEGTC8RiK/025gkrUGmrk0tJ85ocxSay 9/TLwsel/8WztRdcwbOB3gapwPuZLx9HNaFsIespuXZkGmOib2qOXdDkiUOj+KRagVQ2 Welz3hNbAG3HWjEODQbNhCH0qhWJSzMx19p2KArJD9ViEXbptnA+MiZMr1n6m88WfoLS rc+swj2akL1fcJEomA4cVrZ4MEs1ceARNt6Lb0oq9ua3z7PwxHtrBKeW5QdpRoZp/CBj wX9g== X-Gm-Message-State: APjAAAWbsFmqKO4Xl11D+Hq5mInANTYEHJcpxaVeL0xDbSvSML7ODjzx +jG4SyA3Mo53QkjO2v85P3gsB7OwhUNRjpJ6TgCg1g== X-Google-Smtp-Source: APXvYqy2Pg8q1uJDNpxA5mLuo68OwvaUbIHH1Av15n+Q+ikR1NIc9376xe1dPLVxFw4emB7E9pF1+8PVGEmV2jTwFrc= X-Received: by 2002:a2e:8850:: with SMTP id z16mr26456245ljj.69.1559850013337; Thu, 06 Jun 2019 12:40:13 -0700 (PDT) MIME-Version: 1.0 References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> <20190606183552.GD3015@raichu> In-Reply-To: <20190606183552.GD3015@raichu> From: Warner Losh Date: Thu, 6 Jun 2019 13:39:59 -0600 Message-ID: Subject: Re: svn commit: r348737 - head/sys/kern To: Mark Johnston Cc: Alan Somers , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 2154384A91 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,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, 06 Jun 2019 19:40:16 -0000 On Thu, Jun 6, 2019, 12:36 PM Mark Johnston wrote: > On Thu, Jun 06, 2019 at 12:04:52PM -0600, Alan Somers wrote: > > On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > > > > > > On 6/6/19 10:39 AM, Alan Somers wrote: > > > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > > > > wrote: > > > >> > > > >>> Author: asomers > > > >>> Date: Thu Jun 6 15:04:50 2019 > > > >>> New Revision: 348737 > > > >>> URL: https://svnweb.freebsd.org/changeset/base/348737 > > > >>> > > > >>> Log: > > > >>> Add a testing facility to manually reclaim a vnode > > > >>> > > > >>> Add the debug.try_reclaim_vnode sysctl. When a pathname is > written to it, it > > > >>> will be reclaimed, as long as it isn't already or doomed. The > purpose is to > > > >>> gain test coverage for vnode reclamation, which is otherwise > hard to > > > >>> achieve. > > > >>> > > > >>> Add the debug.ftry_reclaim_vnode sysctl. It does the same > thing, except > > > >>> that its argument is a file descriptor instead of a pathname. > > > >> > > > >> Should not this all be wrapped in some #ifdef or other protection, > > > >> is it really a good idea to have this on every single box running > > > >> FreeBSD? > > > > > > > > I initially thought so too, but kib thought that it could be useful > > > > for debugging problems in the field. The potential downside is > > > > limited, because only root can write to the sysctls, and the > > > > worse-case damage is similar to a "umount -f". > > > > > > A compromise might be to stick this in a kernel module instead of in > the > > > base kernel. You could still kldload it in the field for debugging but > > > not necessarily have it directly available out of the box. > > > > > > -- > > > John Baldwin > > > > If we already had such a module, it would make sense to put these > > sysctls in there. But I don't want to create an entire module for > > just a few dozen LOC. Nor do I want to mediate a bike shed. So let's > > vote. kib already registered a vote for making them available all of > > the time. rgrimes voted to guard them by INVARIANTS. Anybody else > > who cares can reply to this thread. I'll count the votes in 24 hours. > > +1 to making it unconditional. We already have lots of debugging > sysctls enabled in !INVARIANTS kernels, and these sorts of things end up > being handy in unexpected ways. For a long time I've carried a patch > which unconditionally compiles debug.vm_lowmem because I kept having to > recompile to get it. > Unconditional. I strongly disagree that things useful for diagnosis of a problem don't belong in the kernel. It's not the 80s or 90s where a few bytes would help. Having run a huge network of machines that have weird random stuff happen has convinced me the more tools to debug the better. Especially for random stuff that goes away when I reboot the debug kernel. Warner > From owner-svn-src-head@freebsd.org Thu Jun 6 20:02: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 4A8A715BEB1D; Thu, 6 Jun 2019 20:02:14 +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 E4BCF85C41; Thu, 6 Jun 2019 20:02:13 +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 D9B4BEFC5; Thu, 6 Jun 2019 20:02:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348737 - head/sys/kern To: Ian Lepore , Alan Somers Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> From: John Baldwin 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: Thu, 6 Jun 2019 13:02:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4BCF85C41 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,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, 06 Jun 2019 20:02:14 -0000 On 6/6/19 11:21 AM, Ian Lepore wrote: > On Thu, 2019-06-06 at 12:04 -0600, Alan Somers wrote: >> On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: >>> >>> On 6/6/19 10:39 AM, Alan Somers wrote: >>>> On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes >>>> wrote: >>>>> >>>>>> Author: asomers >>>>>> Date: Thu Jun 6 15:04:50 2019 >>>>>> New Revision: 348737 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/348737 >>>>>> >>>>>> Log: >>>>>> Add a testing facility to manually reclaim a vnode >>>>>> >>>>>> Add the debug.try_reclaim_vnode sysctl. When a pathname is >>>>>> written to it, it >>>>>> will be reclaimed, as long as it isn't already or doomed. >>>>>> The purpose is to >>>>>> gain test coverage for vnode reclamation, which is >>>>>> otherwise hard to >>>>>> achieve. >>>>>> >>>>>> Add the debug.ftry_reclaim_vnode sysctl. It does the same >>>>>> thing, except >>>>>> that its argument is a file descriptor instead of a >>>>>> pathname. >>>>> >>>>> Should not this all be wrapped in some #ifdef or other >>>>> protection, >>>>> is it really a good idea to have this on every single box >>>>> running >>>>> FreeBSD? >>>> >>>> I initially thought so too, but kib thought that it could be >>>> useful >>>> for debugging problems in the field. The potential downside is >>>> limited, because only root can write to the sysctls, and the >>>> worse-case damage is similar to a "umount -f". >>> >>> A compromise might be to stick this in a kernel module instead of >>> in the >>> base kernel. You could still kldload it in the field for debugging >>> but >>> not necessarily have it directly available out of the box. >>> >>> -- >>> John Baldwin >> >> If we already had such a module, it would make sense to put these >> sysctls in there. But I don't want to create an entire module for >> just a few dozen LOC. Nor do I want to mediate a bike shed. So >> let's >> vote. kib already registered a vote for making them available all of >> the time. rgrimes voted to guard them by INVARIANTS. Anybody else >> who cares can reply to this thread. I'll count the votes in 24 >> hours. >> -Alan >> > > If our new policy is to remove sysctls that aren't used often "because > something bad might happen" (without any requirement for the complainer > to elaborate on just what might happen or why it's so much worse than > the damage a root user could do with any other sysctl), I think several > people could be employed full time doing that removal work. Or we > could all just get on with doing some real work. What I find a bit different about this case is when it's a debugging knob. For that sort of thing, kernel modules are a pretty decent way to inject new functionality into the system that is rarely needed. A while back I had a problem with resume on a laptop seemingly not unsticking all of the processes that had been paused via stop_all and had a hacky kernel module with a magic sysctl that would try to unstick things. That worked better as a module that I only loaded if needed. Similar for a hacky kernel module at a previous job (killsmi.ko) that would write to the appropriate ICH register to disable all SMIs when loaded, etc. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 6 20:12: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 5E2D915BEE69; Thu, 6 Jun 2019 20:12:05 +0000 (UTC) (envelope-from scottph@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 03EF986556; Thu, 6 Jun 2019 20:12:05 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A2C0E2164E; Thu, 6 Jun 2019 20:12:04 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56KC4Ou097340; Thu, 6 Jun 2019 20:12:04 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56KC4oh097339; Thu, 6 Jun 2019 20:12:04 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <201906062012.x56KC4oh097339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Thu, 6 Jun 2019 20:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348757 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 348757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03EF986556 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.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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, 06 Jun 2019 20:12:05 -0000 Author: scottph Date: Thu Jun 6 20:12:04 2019 New Revision: 348757 URL: https://svnweb.freebsd.org/changeset/base/348757 Log: nvdimm: Provide nvdimm location information Provide the acpi handle path as the location string for the nvdimm children of the nvdimm_root device. Reviewed by: kib Approved by: jhb (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20528 Modified: head/sys/dev/nvdimm/nvdimm.c Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Thu Jun 6 20:03:55 2019 (r348756) +++ head/sys/dev/nvdimm/nvdimm.c Thu Jun 6 20:12:04 2019 (r348757) @@ -560,6 +560,24 @@ nvdimm_root_write_ivar(device_t dev, device_t child, i return (0); } +static int +nvdimm_root_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + ACPI_HANDLE handle; + int res; + + handle = nvdimm_root_get_acpi_handle(child); + if (handle != NULL) + res = snprintf(buf, buflen, "handle=%s", acpi_name(handle)); + else + res = snprintf(buf, buflen, "unknown"); + + if (res >= buflen) + return (EOVERFLOW); + return (0); +} + static device_method_t nvdimm_methods[] = { DEVMETHOD(device_probe, nvdimm_probe), DEVMETHOD(device_attach, nvdimm_attach), @@ -582,6 +600,7 @@ static device_method_t nvdimm_root_methods[] = { DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), + DEVMETHOD(bus_child_location_str, nvdimm_root_child_location_str), DEVMETHOD_END }; From owner-svn-src-head@freebsd.org Thu Jun 6 20:54: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 CCB4715C019E; Thu, 6 Jun 2019 20:54:10 +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 6B4E287AF9; Thu, 6 Jun 2019 20:54:10 +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 4049C21E83; Thu, 6 Jun 2019 20:54:10 +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 x56KsAiw019091; Thu, 6 Jun 2019 20:54:10 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56KsAHC019090; Thu, 6 Jun 2019 20:54:10 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906062054.x56KsAHC019090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 6 Jun 2019 20:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348759 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 348759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4E287AF9 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.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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, 06 Jun 2019 20:54:11 -0000 Author: loos Date: Thu Jun 6 20:54:09 2019 New Revision: 348759 URL: https://svnweb.freebsd.org/changeset/base/348759 Log: Zero the GPIO regulator pins memory. This fixes a panic in Espressobin when gpioregulator fails to allocate the GPIO pin (the GPIO controller is not there). Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/gpio/gpioregulator.c Modified: head/sys/dev/gpio/gpioregulator.c ============================================================================== --- head/sys/dev/gpio/gpioregulator.c Thu Jun 6 20:35:41 2019 (r348758) +++ head/sys/dev/gpio/gpioregulator.c Thu Jun 6 20:54:09 2019 (r348759) @@ -248,7 +248,7 @@ gpioregulator_parse_fdt(struct gpioregulator_softc *sc /* "gpios" property */ sc->init_def.npins = 32 - __builtin_clz(mask); sc->init_def.pins = malloc(sc->init_def.npins * - sizeof(sc->init_def.pins), M_DEVBUF, M_WAITOK); + sizeof(sc->init_def.pins), M_DEVBUF, M_WAITOK | M_ZERO); for (n = 0; n < sc->init_def.npins; n++) { error = gpio_pin_get_by_ofw_idx(sc->dev, node, n, &sc->init_def.pins[n]); From owner-svn-src-head@freebsd.org Thu Jun 6 21:04: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 2533D15C0530; Thu, 6 Jun 2019 21:04:39 +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 BA46F8816B; Thu, 6 Jun 2019 21:04:38 +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 94FA42204A; Thu, 6 Jun 2019 21:04:38 +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 x56L4cGB024648; Thu, 6 Jun 2019 21:04:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56L4cQE024644; Thu, 6 Jun 2019 21:04:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906062104.x56L4cQE024644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Jun 2019 21:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348760 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA46F8816B 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.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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, 06 Jun 2019 21:04:39 -0000 Author: imp Date: Thu Jun 6 21:04:37 2019 New Revision: 348760 URL: https://svnweb.freebsd.org/changeset/base/348760 Log: Use simple malloc/free instead of dropping down to the UEFI BootServices AllocatePool/FreePool calls. They are simpler to use and result in the same thing happening. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20540 Modified: head/stand/efi/boot1/ufs_module.c head/stand/efi/boot1/zfs_module.c Modified: head/stand/efi/boot1/ufs_module.c ============================================================================== --- head/stand/efi/boot1/ufs_module.c Thu Jun 6 20:54:09 2019 (r348759) +++ head/stand/efi/boot1/ufs_module.c Thu Jun 6 21:04:37 2019 (r348760) @@ -167,18 +167,18 @@ load(const char *filepath, dev_info_t *dev, void **buf return (EFI_INVALID_PARAMETER); } - if ((status = BS->AllocatePool(EfiLoaderData, size, &buf)) != - EFI_SUCCESS) { - printf("Failed to allocate read buffer %zu for '%s' (%lu)\n", - size, filepath, EFI_ERROR_CODE(status)); - return (status); + buf = malloc(size); + if (buf == NULL) { + printf("Failed to allocate read buffer %zu for '%s'\n", + size, filepath); + return (EFI_OUT_OF_RESOURCES); } read = fsread(ino, buf, size); if ((size_t)read != size) { printf("Failed to read '%s' (%zd != %zu)\n", filepath, read, size); - (void)BS->FreePool(buf); + free(buf); return (EFI_INVALID_PARAMETER); } Modified: head/stand/efi/boot1/zfs_module.c ============================================================================== --- head/stand/efi/boot1/zfs_module.c Thu Jun 6 20:54:09 2019 (r348759) +++ head/stand/efi/boot1/zfs_module.c Thu Jun 6 21:04:37 2019 (r348760) @@ -115,19 +115,17 @@ probe(dev_info_t *dev) { spa_t *spa; dev_info_t *tdev; - EFI_STATUS status; /* ZFS consumes the dev on success so we need a copy. */ - if ((status = BS->AllocatePool(EfiLoaderData, sizeof(*dev), - (void**)&tdev)) != EFI_SUCCESS) { - DPRINTF("Failed to allocate tdev (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); + tdev = malloc(sizeof(*dev)); + if (tdev == NULL) { + DPRINTF("Failed to allocate tdev\n"); + return (EFI_OUT_OF_RESOURCES); } memcpy(tdev, dev, sizeof(*dev)); if (vdev_probe(vdev_read, tdev, &spa) != 0) { - (void)BS->FreePool(tdev); + free(tdev); return (EFI_UNSUPPORTED); } @@ -185,17 +183,17 @@ load(const char *filepath, dev_info_t *devinfo, void * return (EFI_INVALID_PARAMETER); } - if ((status = BS->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) - != EFI_SUCCESS) { - printf("Failed to allocate load buffer %jd for pool '%s' for '%s' " - "(%lu)\n", (intmax_t)st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); + buf = malloc(st.st_size); + if (buf == NULL) { + printf("Failed to allocate load buffer %jd for pool '%s' for '%s' ", + (intmax_t)st.st_size, spa->spa_name, filepath); return (EFI_INVALID_PARAMETER); } if ((err = dnode_read(spa, &dn, 0, buf, st.st_size)) != 0) { printf("Failed to read node from %s (%d)\n", spa->spa_name, err); - (void)BS->FreePool(buf); + free(buf); return (EFI_INVALID_PARAMETER); } From owner-svn-src-head@freebsd.org Thu Jun 6 21:24: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 909D715C0B7C; Thu, 6 Jun 2019 21:24:41 +0000 (UTC) (envelope-from jkim@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 2EA3288BA3; Thu, 6 Jun 2019 21:24:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1917223AB; Thu, 6 Jun 2019 21:24:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56LOe9O035016; Thu, 6 Jun 2019 21:24:40 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56LOevL035015; Thu, 6 Jun 2019 21:24:40 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201906062124.x56LOevL035015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 6 Jun 2019 21:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348761 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 348761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EA3288BA3 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.996,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: Thu, 06 Jun 2019 21:24:41 -0000 Author: jkim Date: Thu Jun 6 21:24:40 2019 New Revision: 348761 URL: https://svnweb.freebsd.org/changeset/base/348761 Log: Move llvm-ranlib to appropriate location in OptionalObsoleteFiles.inc. Note llvm-ar is linked to llvm-ranlib since r311565. r348677 fixed "make delete-old" issue with llvm-ar but missed it somehow. Discussed with: emaste, jhb Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 6 21:04:37 2019 (r348760) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 6 21:24:40 2019 (r348761) @@ -1374,6 +1374,7 @@ OLD_FILES+=usr/bin/clang-tblgen OLD_FILES+=usr/bin/llvm-ar OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-objdump +OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/bin/llvm-symbolizer OLD_FILES+=usr/bin/llvm-tblgen OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h @@ -1563,7 +1564,6 @@ OLD_FILES+=usr/bin/llvm-mca OLD_FILES+=usr/bin/llvm-modextract OLD_FILES+=usr/bin/llvm-objcopy OLD_FILES+=usr/bin/llvm-pdbutil -OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/bin/llvm-rtdyld OLD_FILES+=usr/bin/llvm-xray OLD_FILES+=usr/bin/opt From owner-svn-src-head@freebsd.org Thu Jun 6 21:25: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 57A9115C0BFB; Thu, 6 Jun 2019 21:25:47 +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 EC01B88CF7; Thu, 6 Jun 2019 21:25:46 +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 C1069223AC; Thu, 6 Jun 2019 21:25:46 +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 x56LPkv6035113; Thu, 6 Jun 2019 21:25:46 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56LPkxH035112; Thu, 6 Jun 2019 21:25:46 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201906062125.x56LPkxH035112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 6 Jun 2019 21:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348762 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/etherswitch/e6000sw X-SVN-Commit-Revision: 348762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC01B88CF7 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.996,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: Thu, 06 Jun 2019 21:25:47 -0000 Author: loos Date: Thu Jun 6 21:25:46 2019 New Revision: 348762 URL: https://svnweb.freebsd.org/changeset/base/348762 Log: Do not overwrite the RGMII bits in the CPU port register of Switch. Fixes the network on Espressobin. The GENERIC kernel now boots over NFS. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/e6000sw/e6000swreg.h Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Thu Jun 6 21:24:40 2019 (r348761) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Thu Jun 6 21:25:46 2019 (r348762) @@ -441,10 +441,12 @@ e6000sw_attach(device_t dev) * Force speed, full-duplex, EEE off and flow-control * on. */ + reg &= ~(PSC_CONTROL_SPD2500 | PSC_CONTROL_ALT_SPD | + PSC_CONTROL_FORCED_EEE); if (e6000sw_is_fixed25port(sc, port)) - reg = PSC_CONTROL_SPD2500; + reg |= PSC_CONTROL_SPD2500; else - reg = PSC_CONTROL_SPD1000; + reg |= PSC_CONTROL_SPD1000; reg |= PSC_CONTROL_FORCED_DPX | PSC_CONTROL_FULLDPX | PSC_CONTROL_FORCED_LINK | PSC_CONTROL_LINK_UP | PSC_CONTROL_FORCED_FC | PSC_CONTROL_FC_ON | Modified: head/sys/dev/etherswitch/e6000sw/e6000swreg.h ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000swreg.h Thu Jun 6 21:24:40 2019 (r348761) +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h Thu Jun 6 21:25:46 2019 (r348762) @@ -74,6 +74,7 @@ struct atu_opt { #define PSC_CONTROL 0x1 #define PSC_CONTROL_FORCED_SPD (1 << 13) +#define PSC_CONTROL_ALT_SPD (1 << 12) #define PSC_CONTROL_EEE_ON (1 << 9) #define PSC_CONTROL_FORCED_EEE (1 << 8) #define PSC_CONTROL_FC_ON (1 << 7) From owner-svn-src-head@freebsd.org Thu Jun 6 22:56: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 B02EF15C2993; Thu, 6 Jun 2019 22:56:56 +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 4F7848B658; Thu, 6 Jun 2019 22:56:56 +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 21852232DD; Thu, 6 Jun 2019 22:56:56 +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 x56Muto6082380; Thu, 6 Jun 2019 22:56:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56Mutua082379; Thu, 6 Jun 2019 22:56:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906062256.x56Mutua082379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Jun 2019 22:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348763 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F7848B658 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.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,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, 06 Jun 2019 22:56:56 -0000 Author: imp Date: Thu Jun 6 22:56:55 2019 New Revision: 348763 URL: https://svnweb.freebsd.org/changeset/base/348763 Log: Fix when NOFAT is defined We need to add the *efi file to the list of things that get built, even if we're not creating the efifat stuff. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Thu Jun 6 21:25:46 2019 (r348762) +++ head/stand/efi/boot1/Makefile Thu Jun 6 22:56:55 2019 (r348763) @@ -56,9 +56,10 @@ CFLAGS+= -DEFI_DEBUG .PATH: ${EFISRC}/libefi CFLAGS+= -I${LDRSRC} -.ifndef(NOFAT) -FILES= ${BOOT1}.efi ${BOOT1}.efifat +FILES= ${BOOT1}.efi FILESMODE_${BOOT1}.efi= ${BINMODE} +.ifndef(NOFAT) +FILES+= ${BOOT1}.efifat .endif LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} From owner-svn-src-head@freebsd.org Thu Jun 6 23:57: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 A61D215C37BA; Thu, 6 Jun 2019 23:57: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 4E3E58CE20; Thu, 6 Jun 2019 23:57: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 24DC523CD6; Thu, 6 Jun 2019 23:57:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56NvSqM013740; Thu, 6 Jun 2019 23:57:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56NvSp7013739; Thu, 6 Jun 2019 23:57:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906062357.x56NvSp7013739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Jun 2019 23:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348764 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E3E58CE20 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.996,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: Thu, 06 Jun 2019 23:57:30 -0000 Author: mav Date: Thu Jun 6 23:57:28 2019 New Revision: 348764 URL: https://svnweb.freebsd.org/changeset/base/348764 Log: Allow UMA hash tables to expand faster then 2x in 20 seconds. ZFS ABD allocates tons of 4KB chunks via UMA, requiring huge hash tables. With initial hash table size of only 32 elements it takes ~20 expansions or ~400 seconds to adapt to handling 220GB ZFS ARC. During that time not only the hash table is highly inefficient, but also each of those expan- sions takes significant time with the lock held, blocking operation. On my test system with 256GB of RAM and ZFS pool of 28 HDDs this change reduces time needed to first time read 240GB from ~300-400s, during which system is quite busy and unresponsive, to only ~150s with light CPU load and just 5 sub-second CPU spikes to expand the hash table. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 6 22:56:55 2019 (r348763) +++ head/sys/vm/uma_core.c Thu Jun 6 23:57:28 2019 (r348764) @@ -261,7 +261,7 @@ static void keg_small_init(uma_keg_t keg); static void keg_large_init(uma_keg_t keg); static void zone_foreach(void (*zfunc)(uma_zone_t)); static void zone_timeout(uma_zone_t zone); -static int hash_alloc(struct uma_hash *); +static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); @@ -572,6 +572,7 @@ static void zone_timeout(uma_zone_t zone) { uma_keg_t keg = zone->uz_keg; + u_int slabs; KEG_LOCK(keg); /* @@ -582,7 +583,8 @@ zone_timeout(uma_zone_t zone) * may be a little aggressive. Should I allow for two collisions max? */ if (keg->uk_flags & UMA_ZONE_HASH && - keg->uk_pages / keg->uk_ppera >= keg->uk_hash.uh_hashsize) { + (slabs = keg->uk_pages / keg->uk_ppera) > + keg->uk_hash.uh_hashsize) { struct uma_hash newhash; struct uma_hash oldhash; int ret; @@ -593,9 +595,8 @@ zone_timeout(uma_zone_t zone) * I have to do everything in stages and check for * races. */ - newhash = keg->uk_hash; KEG_UNLOCK(keg); - ret = hash_alloc(&newhash); + ret = hash_alloc(&newhash, 1 << fls(slabs)); KEG_LOCK(keg); if (ret) { if (hash_expand(&keg->uk_hash, &newhash)) { @@ -627,16 +628,13 @@ zone_timeout(uma_zone_t zone) * 1 on success and 0 on failure. */ static int -hash_alloc(struct uma_hash *hash) +hash_alloc(struct uma_hash *hash, u_int size) { - u_int oldsize; size_t alloc; - oldsize = hash->uh_hashsize; - - /* We're just going to go to a power of two greater */ - if (oldsize) { - hash->uh_hashsize = oldsize * 2; + KASSERT(powerof2(size), ("hash size must be power of 2")); + if (size > UMA_HASH_SIZE_INIT) { + hash->uh_hashsize = size; alloc = sizeof(hash->uh_slab_hash[0]) * hash->uh_hashsize; hash->uh_slab_hash = (struct slabhead *)malloc(alloc, M_UMAHASH, M_NOWAIT); @@ -1711,7 +1709,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) } if (keg->uk_flags & UMA_ZONE_HASH) - hash_alloc(&keg->uk_hash); + hash_alloc(&keg->uk_hash, 0); CTR5(KTR_UMA, "keg_ctor %p zone %s(%p) out %d free %d\n", keg, zone->uz_name, zone, From owner-svn-src-head@freebsd.org Fri Jun 7 00:02: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 4338F15C3B65; Fri, 7 Jun 2019 00:02:03 +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 DE5E98D3B6; Fri, 7 Jun 2019 00:02:02 +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 B8BF923E59; Fri, 7 Jun 2019 00:02:02 +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 x57022xY016678; Fri, 7 Jun 2019 00:02:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x570226C016677; Fri, 7 Jun 2019 00:02:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906070002.x570226C016677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Jun 2019 00:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348766 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE5E98D3B6 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.996,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: Fri, 07 Jun 2019 00:02:03 -0000 Author: imp Date: Fri Jun 7 00:02:02 2019 New Revision: 348766 URL: https://svnweb.freebsd.org/changeset/base/348766 Log: Remove left-over status variables Modified: head/stand/efi/boot1/ufs_module.c head/stand/efi/boot1/zfs_module.c Modified: head/stand/efi/boot1/ufs_module.c ============================================================================== --- head/stand/efi/boot1/ufs_module.c Fri Jun 7 00:00:12 2019 (r348765) +++ head/stand/efi/boot1/ufs_module.c Fri Jun 7 00:02:02 2019 (r348766) @@ -140,7 +140,6 @@ static EFI_STATUS load(const char *filepath, dev_info_t *dev, void **bufp, size_t *bufsize) { ufs_ino_t ino; - EFI_STATUS status; size_t size; ssize_t read; void *buf; Modified: head/stand/efi/boot1/zfs_module.c ============================================================================== --- head/stand/efi/boot1/zfs_module.c Fri Jun 7 00:00:12 2019 (r348765) +++ head/stand/efi/boot1/zfs_module.c Fri Jun 7 00:02:02 2019 (r348766) @@ -144,7 +144,6 @@ load(const char *filepath, dev_info_t *devinfo, void * struct stat st; int err; void *buf; - EFI_STATUS status; spa = devinfo->devdata; From owner-svn-src-head@freebsd.org Fri Jun 7 01:38: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 3D7E015C53A0; Fri, 7 Jun 2019 01:38:52 +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 D4F798F4DC; Fri, 7 Jun 2019 01:38:51 +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 C3B6124D95; Fri, 7 Jun 2019 01:38:51 +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 x571cpe6065820; Fri, 7 Jun 2019 01:38:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x571cppB065819; Fri, 7 Jun 2019 01:38:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906070138.x571cppB065819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 7 Jun 2019 01:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348767 - 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: 348767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4F798F4DC 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.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,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, 07 Jun 2019 01:38:52 -0000 Author: delphij Date: Fri Jun 7 01:38:51 2019 New Revision: 348767 URL: https://svnweb.freebsd.org/changeset/base/348767 Log: preen should work independently with alwaysyes and alwaysno. PR: 238375 MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/main.c Modified: head/sbin/fsck_msdosfs/main.c ============================================================================== --- head/sbin/fsck_msdosfs/main.c Fri Jun 7 00:02:02 2019 (r348766) +++ head/sbin/fsck_msdosfs/main.c Fri Jun 7 01:38:51 2019 (r348767) @@ -87,16 +87,15 @@ main(int argc, char **argv) exit(5); case 'n': alwaysno = 1; - alwaysyes = preen = 0; + alwaysyes = 0; break; case 'y': alwaysyes = 1; - alwaysno = preen = 0; + alwaysno = 0; break; case 'p': preen = 1; - alwaysyes = alwaysno = 0; break; default: From owner-svn-src-head@freebsd.org Fri Jun 7 02:05: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 983F415C599C; Fri, 7 Jun 2019 02:05:24 +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 8F9688FF0C; Fri, 7 Jun 2019 02:05:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75A17252C0; Fri, 7 Jun 2019 02:05:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5725NCg081363; Fri, 7 Jun 2019 02:05:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5725NR3081362; Fri, 7 Jun 2019 02:05:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906070205.x5725NR3081362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Jun 2019 02:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348768 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F9688FF0C 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,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, 07 Jun 2019 02:05:24 -0000 Author: imp Date: Fri Jun 7 02:05:22 2019 New Revision: 348768 URL: https://svnweb.freebsd.org/changeset/base/348768 Log: Rework the reporting of the priority. Simplify the code a bit and rework how we report the results of the probing. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20537 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Fri Jun 7 01:38:51 2019 (r348767) +++ head/stand/efi/boot1/boot1.c Fri Jun 7 02:05:22 2019 (r348768) @@ -101,7 +101,7 @@ Calloc(size_t n1, size_t n2, const char *file, int lin */ static EFI_STATUS load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, - size_t *bufsize, BOOLEAN preferred) + size_t *bufsize, int preferred) { UINTN i; dev_info_t *dev; @@ -141,10 +141,9 @@ try_boot(void) EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 1); if (status != EFI_SUCCESS) { - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, - FALSE); + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 0); if (status != EFI_SUCCESS) { printf("Failed to load '%s'\n", PATH_LOADER_EFI); return (status); @@ -232,108 +231,81 @@ errout: /* * probe_handle determines if the passed handle represents a logical partition * if it does it uses each module in order to probe it and if successful it - * returns EFI_SUCCESS. + * returns 0. */ -static EFI_STATUS -probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) +static int +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) { dev_info_t *devinfo; EFI_BLOCK_IO *blkio; EFI_DEVICE_PATH *devpath; EFI_STATUS status; UINTN i; + int preferred; /* Figure out if we're dealing with an actual partition. */ status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); if (status == EFI_UNSUPPORTED) - return (status); + return (0); if (status != EFI_SUCCESS) { DPRINTF("\nFailed to query DevicePath (%lu)\n", EFI_ERROR_CODE(status)); - return (status); + return (-1); } #ifdef EFI_DEBUG { CHAR16 *text = efi_devpath_name(devpath); - DPRINTF("probing: %S\n", text); + DPRINTF("probing: %S ", text); efi_free_devpath_name(text); } #endif status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); if (status == EFI_UNSUPPORTED) - return (status); + return (0); if (status != EFI_SUCCESS) { DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", EFI_ERROR_CODE(status)); - return (status); + return (-1); } if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); + return (0); - *preferred = efi_devpath_same_disk(imgpath, devpath); + preferred = efi_devpath_same_disk(imgpath, devpath); /* Run through each module, see if it can load this partition */ devinfo = malloc(sizeof(*devinfo)); if (devinfo == NULL) { DPRINTF("\nFailed to allocate devinfo\n"); - return (EFI_UNSUPPORTED); + return (-1); } devinfo->dev = blkio; devinfo->devpath = devpath; devinfo->devhandle = h; - devinfo->preferred = *preferred; + devinfo->preferred = preferred; devinfo->next = NULL; for (i = 0; i < NUM_BOOT_MODULES; i++) { devinfo->devdata = NULL; + status = boot_modules[i]->probe(devinfo); if (status == EFI_SUCCESS) - return (EFI_SUCCESS); + return (preferred + 1); } free(devinfo); - return (EFI_UNSUPPORTED); + return (0); } -/* - * probe_handle_status calls probe_handle and outputs the returned status - * of the call. - */ -static void -probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) -{ - EFI_STATUS status; - BOOLEAN preferred; +const char *prio_str[] = { + "error", + "not supported", + "good", + "better" +}; - preferred = FALSE; - status = probe_handle(h, imgpath, &preferred); - - DPRINTF("probe: "); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - DPRINTF(" not supported\n"); - break; - case EFI_SUCCESS: - if (preferred) { - printf("%c", '*'); - DPRINTF(" supported (preferred)\n"); - } else { - printf("%c", '+'); - DPRINTF(" supported\n"); - } - break; - default: - printf("x"); - DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); - break; - } - DSTALL(500000); -} - EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) { @@ -348,6 +320,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) UINT16 boot_current; size_t sz; UINT16 boot_order[100]; + int rv; /* Basic initialization*/ ST = Xsystab; @@ -449,8 +422,14 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) printf(" Probing %zu block devices...", nhandles); DPRINTF("\n"); - for (i = 0; i < nhandles; i++) - probe_handle_status(handles[i], imgpath); + for (i = 0; i < nhandles; i++) { + rv = probe_handle(handles[i], imgpath); +#ifdef EFI_DEBUG + printf("%c", "x.+*"[rv + 1]); +#else + printf("%s\n", prio_str[rv + 1]); +#endif + } printf(" done\n"); /* Status summary. */ From owner-svn-src-head@freebsd.org Fri Jun 7 04:09: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 EE1A515C7B71; Fri, 7 Jun 2019 04:09:13 +0000 (UTC) (envelope-from rlibby@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 92AE49307C; Fri, 7 Jun 2019 04:09:13 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6204A267D6; Fri, 7 Jun 2019 04:09:13 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5749DX2049290; Fri, 7 Jun 2019 04:09:13 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5749DOn049288; Fri, 7 Jun 2019 04:09:13 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201906070409.x5749DOn049288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 7 Jun 2019 04:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348770 - in head: share/man/man9 sys/sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: share/man/man9 sys/sys X-SVN-Commit-Revision: 348770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92AE49307C 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,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, 07 Jun 2019 04:09:14 -0000 Author: rlibby Date: Fri Jun 7 04:09:12 2019 New Revision: 348770 URL: https://svnweb.freebsd.org/changeset/base/348770 Log: Allow fail points to have separate declarations, definitions, and evals Submitted by: Matthew Bryan Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20546 Modified: head/share/man/man9/fail.9 head/sys/sys/fail.h Modified: head/share/man/man9/fail.9 ============================================================================== --- head/share/man/man9/fail.9 Fri Jun 7 02:36:26 2019 (r348769) +++ head/share/man/man9/fail.9 Fri Jun 7 04:09:12 2019 (r348770) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2009 Isilon Inc http://www.isilon.com/ +.\" Copyright (c) 2009-2019 Dell EMC Isilon http://www.isilon.com/ .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -26,30 +26,36 @@ .\" .\" $FreeBSD$ .\" -.Dd March 15, 2016 +.Dd June 6, 2019 .Dt FAIL 9 .Os .Sh NAME +.Nm DEBUG_FP , .Nm KFAIL_POINT_CODE , .Nm KFAIL_POINT_CODE_FLAGS , .Nm KFAIL_POINT_CODE_COND , -.Nm KFAIL_POINT_RETURN , -.Nm KFAIL_POINT_RETURN_VOID , .Nm KFAIL_POINT_ERROR , +.Nm KFAIL_POINT_EVAL , +.Nm KFAIL_POINT_DECLARE , +.Nm KFAIL_POINT_DEFINE , .Nm KFAIL_POINT_GOTO , +.Nm KFAIL_POINT_RETURN , +.Nm KFAIL_POINT_RETURN_VOID , .Nm KFAIL_POINT_SLEEP_CALLBACKS , -.Nm fail_point , -.Nm DEBUG_FP +.Nm fail_point .Nd fail points .Sh SYNOPSIS .In sys/fail.h .Fn KFAIL_POINT_CODE "parent" "name" "code" .Fn KFAIL_POINT_CODE_FLAGS "parent" "name" "flags" "code" .Fn KFAIL_POINT_CODE_COND "parent" "name" "cond" "flags" "code" -.Fn KFAIL_POINT_RETURN "parent" "name" -.Fn KFAIL_POINT_RETURN_VOID "parent" "name" .Fn KFAIL_POINT_ERROR "parent" "name" "error_var" +.Fn KFAIL_POINT_EVAL "name" "code" +.Fn KFAIL_POINT_DECLARE "name" +.Fn KFAIL_POINT_DEFINE "parent" "name" "flags" .Fn KFAIL_POINT_GOTO "parent" "name" "error_var" "label" +.Fn KFAIL_POINT_RETURN "parent" "name" +.Fn KFAIL_POINT_RETURN_VOID "parent" "name" .Fn KFAIL_POINT_SLEEP_CALLBACKS "parent" "name" "pre_func" "pre_arg" "post_func" "post_arg" "code" .Sh DESCRIPTION Fail points are used to add code points where errors may be injected @@ -139,6 +145,22 @@ is the equivalent of .It Fn KFAIL_POINT_GOTO parent name error_var label is the equivalent of .Sy KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) +.El +.Pp +You can also introduce fail points by separating the declaration, +definition, and evaluation portions. +.Bl -inset +.It Fn KFAIL_POINT_DECLARE name +is used to declare the +.Sy fail_point +struct. +.It Fn KFAIL_POINT_DEFINE parent name flags +defines and initializes the +.Sy fail_point +and sets up its +.Xr sysctl 9 . +.It Fn KFAIL_POINT_EVAL name code +is used at the point that the fail point is executed. .El .Sh SYSCTL VARIABLES The Modified: head/sys/sys/fail.h ============================================================================== --- head/sys/sys/fail.h Fri Jun 7 02:36:26 2019 (r348769) +++ head/sys/sys/fail.h Fri Jun 7 04:09:12 2019 (r348770) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2009 Isilon Inc http://www.isilon.com/ + * Copyright (c) 2009-2019 Dell EMC Isilon http://www.isilon.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -191,10 +191,12 @@ fail_point_eval(struct fail_point *fp, int *ret) __END_DECLS /* Declare a fail_point and its sysctl in a function. */ +#define KFAIL_POINT_DECLARE(name) \ + extern struct fail_point _FAIL_POINT_NAME(name) #define _FAIL_POINT_NAME(name) _fail_point_##name #define _FAIL_POINT_LOCATION() "(" __FILE__ ":" __XSTRING(__LINE__) ")" -#define _FAIL_POINT_INIT(parent, name, flags) \ - static struct fail_point _FAIL_POINT_NAME(name) = { \ +#define KFAIL_POINT_DEFINE(parent, name, flags) \ + struct fail_point _FAIL_POINT_NAME(name) = { \ .fp_name = #name, \ .fp_location = _FAIL_POINT_LOCATION(), \ .fp_ref_cnt = 0, \ @@ -213,6 +215,9 @@ __END_DECLS CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, \ &_FAIL_POINT_NAME(name), 0, \ fail_point_sysctl_status, "A", ""); + +#define _FAIL_POINT_INIT(parent, name, flags) \ + static KFAIL_POINT_DEFINE(parent, name, flags) #define _FAIL_POINT_EVAL(name, cond, code...) \ int RETURN_VALUE; \ \ @@ -222,7 +227,8 @@ __END_DECLS code; \ \ } - +#define KFAIL_POINT_EVAL(name, code...) \ + _FAIL_POINT_EVAL(name, true, code) /** * Instantiate a failpoint which returns "RETURN_VALUE" from the function From owner-svn-src-head@freebsd.org Fri Jun 7 05:03: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 4713715C89B3; Fri, 7 Jun 2019 05:03:04 +0000 (UTC) (envelope-from np@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 D324E9441F; Fri, 7 Jun 2019 05:03:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C19AA271DD; Fri, 7 Jun 2019 05:03:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57533Uu079997; Fri, 7 Jun 2019 05:03:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x575331v079996; Fri, 7 Jun 2019 05:03:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906070503.x575331v079996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 7 Jun 2019 05:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348771 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 348771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D324E9441F 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.996,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: Fri, 07 Jun 2019 05:03:04 -0000 Author: np Date: Fri Jun 7 05:03:03 2019 New Revision: 348771 URL: https://svnweb.freebsd.org/changeset/base/348771 Log: cxgbe(4): Rename the DDP sysctl to rx_zcopy to match the tx_zcopy sysctl and update its description. The old name continues to work for now. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jun 7 04:09:12 2019 (r348770) +++ head/sys/dev/cxgbe/t4_main.c Fri Jun 7 05:03:03 2019 (r348771) @@ -6232,8 +6232,10 @@ t4_sysctls(struct adapter *sc) &sc->tt.sndbuf, 0, "max hardware send buffer size"); sc->tt.ddp = 0; - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", CTLFLAG_RW, - &sc->tt.ddp, 0, "DDP allowed"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", + CTLFLAG_RW | CTLFLAG_SKIP, &sc->tt.ddp, 0, ""); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_zcopy", CTLFLAG_RW, + &sc->tt.ddp, 0, "Enable zero-copy aio_read(2)"); sc->tt.rx_coalesce = 1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", From owner-svn-src-head@freebsd.org Fri Jun 7 06:35: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 654CB15CA035; Fri, 7 Jun 2019 06:35:43 +0000 (UTC) (envelope-from avg@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 05F35967FE; Fri, 7 Jun 2019 06:35:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CECDB121; Fri, 7 Jun 2019 06:35:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x576Zg0g027351; Fri, 7 Jun 2019 06:35:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x576ZgEE027350; Fri, 7 Jun 2019 06:35:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906070635.x576ZgEE027350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 7 Jun 2019 06:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348772 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05F35967FE 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.996,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: Fri, 07 Jun 2019 06:35:43 -0000 Author: avg Date: Fri Jun 7 06:35:42 2019 New Revision: 348772 URL: https://svnweb.freebsd.org/changeset/base/348772 Log: Restore ARC MFU/MRU pressure Before r305323 (MFV r302991: 6950 ARC should cache compressed data) arc_read() code did this for access to a ghost buffer: arc_adapt() (from arc_get_data_buf()) arc_access(hdr, hash_lock) I.e., we first checked access to the MFU ghost/MRU ghost buffer and adapt MFU/MRU sizes (in arc_adapt()) and next move buffer from the ghost state to regular. After r305323 the sequence is different: arc_access(hdr, hash_lock); arc_hdr_alloc_pabd(hdr); I.e., we first move the buffer from the ghost state in arc_access() and then we check access to buffer in ghost state (in arc_hdr_alloc_pabd() -> arc_get_data_abd() -> arc_get_data_impl() -> arc_adapt()). This is incorrect: arc_adapt() never see access to the ghost buffer because arc_access() already migrated the buffer from the ghost state to regular. So, the fix is to restore a call to arc_adapt() before arc_access() and to suppress the call to arc_adapt() after arc_access(). Submitted by: Slawa Olhovchenkov MFC after: 2 weeks Sponsored by: Integros [integros.com] Differential Revision: https://reviews.freebsd.org/D19094 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 7 05:03:03 2019 (r348771) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 7 06:35:42 2019 (r348772) @@ -1560,14 +1560,14 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *); +static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void *arc_get_data_buf(arc_buf_hdr_t *, uint64_t, void *); -static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *); +static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void arc_free_data_abd(arc_buf_hdr_t *, abd_t *, uint64_t, void *); static void arc_free_data_buf(arc_buf_hdr_t *, void *, uint64_t, void *); static void arc_free_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag); static void arc_hdr_free_pabd(arc_buf_hdr_t *); -static void arc_hdr_alloc_pabd(arc_buf_hdr_t *); +static void arc_hdr_alloc_pabd(arc_buf_hdr_t *, boolean_t); static void arc_access(arc_buf_hdr_t *, kmutex_t *); static boolean_t arc_is_overflowing(); static void arc_buf_watch(arc_buf_t *); @@ -3353,14 +3353,14 @@ arc_buf_destroy_impl(arc_buf_t *buf) } static void -arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr) +arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr, boolean_t do_adapt) { ASSERT3U(HDR_GET_LSIZE(hdr), >, 0); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(!HDR_SHARED_DATA(hdr)); ASSERT3P(hdr->b_l1hdr.b_pabd, ==, NULL); - hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr); + hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr, do_adapt); hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS; ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); @@ -3424,7 +3424,7 @@ arc_hdr_alloc(uint64_t spa, int32_t psize, int32_t lsi * the compressed or uncompressed data depending on the block * it references and compressed arc enablement. */ - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt)); return (hdr); @@ -5145,11 +5145,11 @@ arc_is_overflowing(void) } static abd_t * -arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, do_adapt); if (type == ARC_BUFC_METADATA) { return (abd_alloc(size, B_TRUE)); } else { @@ -5163,7 +5163,7 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, B_TRUE); if (type == ARC_BUFC_METADATA) { return (zio_buf_alloc(size)); } else { @@ -5179,12 +5179,13 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo * limit, we'll only signal the reclaim thread and continue on. */ static void -arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_state_t *state = hdr->b_l1hdr.b_state; arc_buf_contents_t type = arc_buf_type(hdr); - arc_adapt(size, state); + if (do_adapt) + arc_adapt(size, state); /* * If arc_size is currently overflowing, and has grown past our @@ -5935,8 +5936,9 @@ top: * do this after we've called arc_access() to * avoid hitting an assert in remove_reference(). */ + arc_adapt(arc_hdr_size(hdr), hdr->b_l1hdr.b_state); arc_access(hdr, hash_lock); - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_FALSE); } ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); size = arc_hdr_size(hdr); @@ -6350,7 +6352,7 @@ arc_release(arc_buf_t *buf, void *tag) if (arc_can_share(hdr, lastbuf)) { arc_share_buf(hdr, lastbuf); } else { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); abd_copy_from_buf(hdr->b_l1hdr.b_pabd, buf->b_data, psize); } @@ -6513,7 +6515,7 @@ arc_write_ready(zio_t *zio) * the data into it; otherwise, we share the data directly if we can. */ if (zfs_abd_scatter_enabled || !arc_can_share(hdr, buf)) { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); /* * Ideally, we would always copy the io_abd into b_pabd, but the From owner-svn-src-head@freebsd.org Fri Jun 7 08:30: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 C617E15CBF0A; Fri, 7 Jun 2019 08:30:36 +0000 (UTC) (envelope-from ae@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 643236AD6B; Fri, 7 Jun 2019 08:30:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FD5D1435; Fri, 7 Jun 2019 08:30:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x578Uawi084765; Fri, 7 Jun 2019 08:30:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x578UaRh084764; Fri, 7 Jun 2019 08:30:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906070830.x578UaRh084764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 7 Jun 2019 08:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348774 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 643236AD6B 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.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,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, 07 Jun 2019 08:30:37 -0000 Author: ae Date: Fri Jun 7 08:30:35 2019 New Revision: 348774 URL: https://svnweb.freebsd.org/changeset/base/348774 Log: Use underscores for internal variable name to avoid conflicts. MFC after: 1 week Modified: head/sys/sys/counter.h Modified: head/sys/sys/counter.h ============================================================================== --- head/sys/sys/counter.h Fri Jun 7 08:21:01 2019 (r348773) +++ head/sys/sys/counter.h Fri Jun 7 08:30:35 2019 (r348774) @@ -43,23 +43,23 @@ void counter_u64_zero(counter_u64_t); uint64_t counter_u64_fetch(counter_u64_t); #define COUNTER_ARRAY_ALLOC(a, n, wait) do { \ - for (int i = 0; i < (n); i++) \ - (a)[i] = counter_u64_alloc(wait); \ + for (int _i = 0; _i < (n); _i++) \ + (a)[_i] = counter_u64_alloc(wait); \ } while (0) #define COUNTER_ARRAY_FREE(a, n) do { \ - for (int i = 0; i < (n); i++) \ - counter_u64_free((a)[i]); \ + for (int _i = 0; _i < (n); _i++) \ + counter_u64_free((a)[_i]); \ } while (0) #define COUNTER_ARRAY_COPY(a, dstp, n) do { \ - for (int i = 0; i < (n); i++) \ - ((uint64_t *)(dstp))[i] = counter_u64_fetch((a)[i]);\ + for (int _i = 0; _i < (n); _i++) \ + ((uint64_t *)(dstp))[_i] = counter_u64_fetch((a)[_i]);\ } while (0) #define COUNTER_ARRAY_ZERO(a, n) do { \ - for (int i = 0; i < (n); i++) \ - counter_u64_zero((a)[i]); \ + for (int _i = 0; _i < (n); _i++) \ + counter_u64_zero((a)[_i]); \ } while (0) /* From owner-svn-src-head@freebsd.org Fri Jun 7 13:04: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 3FD1315ACC0C; Fri, 7 Jun 2019 13:04:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB1B5722D6; Fri, 7 Jun 2019 13:04:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1hZEXl-0005ZZ-8P; Fri, 07 Jun 2019 16:04:29 +0300 Date: Fri, 7 Jun 2019 16:04:29 +0300 From: Slawa Olhovchenkov To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348772 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190607130429.GH47119@zxy.spb.ru> References: <201906070635.x576ZgEE027350@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906070635.x576ZgEE027350@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: CB1B5722D6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,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: Fri, 07 Jun 2019 13:04:38 -0000 On Fri, Jun 07, 2019 at 06:35:42AM +0000, Andriy Gapon wrote: > Author: avg > Date: Fri Jun 7 06:35:42 2019 > New Revision: 348772 > URL: https://svnweb.freebsd.org/changeset/base/348772 > > Log: > Restore ARC MFU/MRU pressure > > Before r305323 (MFV r302991: 6950 ARC should cache compressed data) > arc_read() code did this for access to a ghost buffer: > arc_adapt() (from arc_get_data_buf()) > arc_access(hdr, hash_lock) > I.e., we first checked access to the MFU ghost/MRU ghost buffer and > adapt MFU/MRU sizes (in arc_adapt()) and next move buffer from the ghost > state to regular. > > After r305323 the sequence is different: > arc_access(hdr, hash_lock); > arc_hdr_alloc_pabd(hdr); > I.e., we first move the buffer from the ghost state in arc_access() and > then we check access to buffer in ghost state (in arc_hdr_alloc_pabd() > -> arc_get_data_abd() -> arc_get_data_impl() -> arc_adapt()). This is > incorrect: arc_adapt() never see access to the ghost buffer because > arc_access() already migrated the buffer from the ghost state to > regular. > > So, the fix is to restore a call to arc_adapt() before arc_access() and > to suppress the call to arc_adapt() after arc_access(). > > Submitted by: Slawa Olhovchenkov > MFC after: 2 weeks > Sponsored by: Integros [integros.com] > Differential Revision: https://reviews.freebsd.org/D19094 Include in 11.3-RELEASE planed? From owner-svn-src-head@freebsd.org Fri Jun 7 14:51:57 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 5EC7715AEE2D; Fri, 7 Jun 2019 14:51:57 +0000 (UTC) (envelope-from csjp@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 05F93754C7; Fri, 7 Jun 2019 14:51:57 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D184858A8; Fri, 7 Jun 2019 14:51:56 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57EpuZb084013; Fri, 7 Jun 2019 14:51:56 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57EpuHL084010; Fri, 7 Jun 2019 14:51:56 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <201906071451.x57EpuHL084010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 7 Jun 2019 14:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348776 - in head: contrib/elftoolchain/elfdump contrib/elftoolchain/readelf sys/sys X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: in head: contrib/elftoolchain/elfdump contrib/elftoolchain/readelf sys/sys X-SVN-Commit-Revision: 348776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05F93754C7 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.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: Fri, 07 Jun 2019 14:51:57 -0000 Author: csjp Date: Fri Jun 7 14:51:55 2019 New Revision: 348776 URL: https://svnweb.freebsd.org/changeset/base/348776 Log: Teach readelf about some OpenBSD ELF program headers - Add constants for OpenBSD wxneeded, bootdata and randomize to the FreeBSD elf_common.h file. This is the file that gets used by the elftoolchain library. - Update readelf and elfdump utilities to decode these program headers if they are encountered. Note: FreeBSD has it's own version of elfdump(1), which will be updated in a subsequent commit. I am adding it here anyway because this diff is going to be submitted upstream. Discussed with: emaste Reviewed by: imp MFC afer: 2 weeks Differential Revision: https://reviews.freebsd.org/D20548 M contrib/elftoolchain/elfdump/elfdump.c M contrib/elftoolchain/readelf/readelf.c M sys/sys/elf_common.h Modified: head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/readelf/readelf.c head/sys/sys/elf_common.h Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Fri Jun 7 10:09:43 2019 (r348775) +++ head/contrib/elftoolchain/elfdump/elfdump.c Fri Jun 7 14:51:55 2019 (r348776) @@ -343,17 +343,20 @@ elf_phdr_type_str(unsigned int type) static char s_type[32]; switch (type) { - case PT_NULL: return "PT_NULL"; - case PT_LOAD: return "PT_LOAD"; - case PT_DYNAMIC: return "PT_DYNAMIC"; - case PT_INTERP: return "PT_INTERP"; - case PT_NOTE: return "PT_NOTE"; - case PT_SHLIB: return "PT_SHLIB"; - case PT_PHDR: return "PT_PHDR"; - case PT_TLS: return "PT_TLS"; - case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; - case PT_GNU_STACK: return "PT_GNU_STACK"; - case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_NULL: return "PT_NULL"; + case PT_LOAD: return "PT_LOAD"; + case PT_DYNAMIC: return "PT_DYNAMIC"; + case PT_INTERP: return "PT_INTERP"; + case PT_NOTE: return "PT_NOTE"; + case PT_SHLIB: return "PT_SHLIB"; + case PT_PHDR: return "PT_PHDR"; + case PT_TLS: return "PT_TLS"; + case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; + case PT_GNU_STACK: return "PT_GNU_STACK"; + case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_OPENBSD_RANDOMIZE: return "PT_OPENBSD_RANDOMIZE"; + case PT_OPENBSD_WXNEEDED: return "PT_OPENBSD_WXNEEDED"; + case PT_OPENBSD_BOOTDATA: return "PT_OPENBSD_BOOTDATA"; } snprintf(s_type, sizeof(s_type), "", type); return (s_type); Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jun 7 10:09:43 2019 (r348775) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jun 7 14:51:55 2019 (r348776) @@ -674,6 +674,9 @@ phdr_type(unsigned int mach, unsigned int ptype) case PT_GNU_EH_FRAME: return "GNU_EH_FRAME"; case PT_GNU_STACK: return "GNU_STACK"; case PT_GNU_RELRO: return "GNU_RELRO"; + case PT_OPENBSD_RANDOMIZE: return "OPENBSD_RANDOMIZE"; + case PT_OPENBSD_WXNEEDED: return "OPENBSD_WXNEEDED"; + case PT_OPENBSD_BOOTDATA: return "OPENBSD_BOOTDATA"; default: if (ptype >= PT_LOOS && ptype <= PT_HIOS) snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x", Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Jun 7 10:09:43 2019 (r348775) +++ head/sys/sys/elf_common.h Fri Jun 7 14:51:55 2019 (r348776) @@ -535,6 +535,10 @@ typedef struct { #define PT_ARM_EXIDX 0x70000001 /* ARM exception unwind tables. */ #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ +#define PT_OPENBSD_RANDOMIZE 0x65A3DBE6 /* OpenBSD random data segment */ +#define PT_OPENBSD_WXNEEDED 0x65A3DBE7 /* OpenBSD EXEC/WRITE pages needed */ +#define PT_OPENBSD_BOOTDATA 0x65A41BE6 /* OpenBSD section for boot args */ + /* Values for p_flags. */ #define PF_X 0x1 /* Executable. */ #define PF_W 0x2 /* Writable. */ From owner-svn-src-head@freebsd.org Fri Jun 7 14:57: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 C5CBE15AF099; Fri, 7 Jun 2019 14:57:02 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (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 2A7FF75818; Fri, 7 Jun 2019 14:57:02 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f65.google.com with SMTP id a25so1864140lfg.2; Fri, 07 Jun 2019 07:57:01 -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:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=TZV/oQG3Bkpb809NVmGHJFL+uDIsRC7M9+R0Sb6HR9s=; b=LsPb71RschPvYn1JfFqhLwDfoNnuGQFPExLlFHilTgjzeOCs6cfBN1/fl3QHYcM5FN 3z0H5ooR7D/Bc6EVtKhwffpevU3glyqOHRH0tZ70CkTEuuuKQCdkl4KK+3s0kjZFKzJU IgAtPhMcDY632EqZ/akIc8Uz6utKvFZFSuAo3PSh/UV9sPO5yOI1gjOi9Gs7EXb3Z6N+ 23GH9GtbWu5CiJXfI+p4V8q6vkQZiNHW1ZqZP20B1fmTrFIh+9kDH5AEQpnCoY8kBpZc bd8hqnSufoPz+N1OTZgC04yHpArc03tgup1yJ/MeiJmBA+Z63Jfl4X8ui2HW0MzBJd6k LfcA== X-Gm-Message-State: APjAAAWtCNHAVzRu2nSKoK50CL7KeKdUzdP2BowOnIPef8lIxUQSjLwo w9KWEuSCObGMoqwxa4BEA0TWaYTg X-Google-Smtp-Source: APXvYqw1SL7O45HE3VzSoDV+hWOLrv15T8+M0CoEMX4MmIMr2fGFIPu+9zQTxl3mkzZZYFblY7WdZA== X-Received: by 2002:ac2:4908:: with SMTP id n8mr25871408lfi.10.1559919418876; Fri, 07 Jun 2019 07:56:58 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id j11sm447497lfm.29.2019.06.07.07.56.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 07:56:57 -0700 (PDT) Subject: Re: svn commit: r348772 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906070635.x576ZgEE027350@repo.freebsd.org> <20190607130429.GH47119@zxy.spb.ru> 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: <1e0ac4cf-d737-fbfd-a9b7-f728ef654d0a@FreeBSD.org> Date: Fri, 7 Jun 2019 17:56:56 +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: <20190607130429.GH47119@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2A7FF75818 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.985,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, 07 Jun 2019 14:57:03 -0000 On 07/06/2019 16:04, Slawa Olhovchenkov wrote: > On Fri, Jun 07, 2019 at 06:35:42AM +0000, Andriy Gapon wrote: > >> Author: avg >> Date: Fri Jun 7 06:35:42 2019 >> New Revision: 348772 >> URL: https://svnweb.freebsd.org/changeset/base/348772 >> >> Log: >> Restore ARC MFU/MRU pressure >> >> Before r305323 (MFV r302991: 6950 ARC should cache compressed data) >> arc_read() code did this for access to a ghost buffer: >> arc_adapt() (from arc_get_data_buf()) >> arc_access(hdr, hash_lock) >> I.e., we first checked access to the MFU ghost/MRU ghost buffer and >> adapt MFU/MRU sizes (in arc_adapt()) and next move buffer from the ghost >> state to regular. >> >> After r305323 the sequence is different: >> arc_access(hdr, hash_lock); >> arc_hdr_alloc_pabd(hdr); >> I.e., we first move the buffer from the ghost state in arc_access() and >> then we check access to buffer in ghost state (in arc_hdr_alloc_pabd() >> -> arc_get_data_abd() -> arc_get_data_impl() -> arc_adapt()). This is >> incorrect: arc_adapt() never see access to the ghost buffer because >> arc_access() already migrated the buffer from the ghost state to >> regular. >> >> So, the fix is to restore a call to arc_adapt() before arc_access() and >> to suppress the call to arc_adapt() after arc_access(). >> >> Submitted by: Slawa Olhovchenkov >> MFC after: 2 weeks >> Sponsored by: Integros [integros.com] >> Differential Revision: https://reviews.freebsd.org/D19094 > > Include in 11.3-RELEASE planed? I didn't plan it, given the release schedule. But I can be convinced that this is a really important fix. So far, I am not :) -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Jun 7 15:23: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 26D8415AFBFE; Fri, 7 Jun 2019 15:23:54 +0000 (UTC) (envelope-from arichardson@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 BDAB3769A3; Fri, 7 Jun 2019 15:23:53 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 981005DF1; Fri, 7 Jun 2019 15:23:53 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57FNrqK003860; Fri, 7 Jun 2019 15:23:53 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57FNrxs003858; Fri, 7 Jun 2019 15:23:53 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201906071523.x57FNrxs003858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Jun 2019 15:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348777 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDAB3769A3 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.970,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, 07 Jun 2019 15:23:54 -0000 Author: arichardson Date: Fri Jun 7 15:23:52 2019 New Revision: 348777 URL: https://svnweb.freebsd.org/changeset/base/348777 Log: Add a basic clang-format configuration file This gets reasonably close to the existing format in sys/kern but will probably require some changes to upstream clang-format before it can be used as the default formatting tool. I tried formatting a few files in sys/kern and the result is pretty close to the existing code. However, this configuration file is not ready to be used without manually checking the output. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D20533 Added: head/.clang-format (contents, props changed) Modified: head/.gitattributes Added: head/.clang-format ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/.clang-format Fri Jun 7 15:23:52 2019 (r348777) @@ -0,0 +1,77 @@ +# $FreeBSD$ +# Basic .clang-format +--- +BasedOnStyle: WebKit +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: false +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: TopLevelDefinitions +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: WebKit +BreakBeforeTernaryOperators: false +# TODO: BreakStringLiterals can cause very strange formatting so turn it off? +BreakStringLiterals: false +PenaltyBreakBeforeFirstCallParameter: 1000 +CompactNamespaces: true +DerivePointerAlignment: false +DisableFormat: false +ForEachMacros: + - SLIST_FOREACH + - SLIST_FOREACH_SAFE + - LIST_FOREACH + - LIST_FOREACH_SAFE + - STAILQ_FOREACH + - STAILQ_FOREACH_SAFE + - TAILQ_FOREACH + - TAILQ_FOREACH_SAFE + - TAILQ_FOREACH_REVERSE + - TAILQ_FOREACH_REVERSE_SAFE + - RB_FOREACH + - RB_FOREACH_SAFE + - RB_FOREACH_FROM + - RB_FOREACH_REVERSE + - RB_FOREACH_REVERSE_FROM + - RB_FOREACH_REVERSE_SAFE + - FOREACH_THREAD_IN_PROC + - FOREACH_PROC_IN_SYSTEM + - FOREACH_PRISON_CHILD + - FOREACH_PRISON_DESCENDANT + - FOREACH_PRISON_DESCENDANT_LOCKED + - FOREACH_PRISON_DESCENDANT_LOCKED_LEVEL + - MNT_VNODE_FOREACH_ALL + - MNT_VNODE_FOREACH_ACTIVE +IndentCaseLabels: false +IndentPPDirectives: None +Language: Cpp +NamespaceIndentation: None +PointerAlignment: Right +ContinuationIndentWidth: 4 +IndentWidth: 8 +TabWidth: 8 +ColumnLimit: 80 +UseTab: Always +SpaceAfterCStyleCast: false +SortIncludes: false +KeepEmptyLinesAtTheStartOfBlocks: true +# The options below will only be supported starting with clang 9.0: +# TODO-CLANG-9: TypenameMacros: +# TODO-CLANG-9: - SLIST_HEAD +# TODO-CLANG-9: - SLIST_ENTRY +# TODO-CLANG-9: - TAILQ_ENTRY +# TODO-CLANG-9: - TAILQ_HEAD +# TODO-CLANG-9: - STAILQ_ENTRY +# TODO-CLANG-9: - STAILQ_HEAD +... Modified: head/.gitattributes ============================================================================== --- head/.gitattributes Fri Jun 7 14:51:55 2019 (r348776) +++ head/.gitattributes Fri Jun 7 15:23:52 2019 (r348777) @@ -4,3 +4,4 @@ *.hpp diff=cpp *.py diff=python . svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS +.clang-format svn-properties=svn:keywords=FreeBSD=%H From owner-svn-src-head@freebsd.org Fri Jun 7 15:48: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 D47A715B03AD; Fri, 7 Jun 2019 15:48:13 +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 74AB877553; Fri, 7 Jun 2019 15:48:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F3C26136; Fri, 7 Jun 2019 15:48:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57FmDN8014160; Fri, 7 Jun 2019 15:48:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57FmDb7014159; Fri, 7 Jun 2019 15:48:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906071548.x57FmDb7014159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 7 Jun 2019 15:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348778 - 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: 348778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74AB877553 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.948,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, 07 Jun 2019 15:48:14 -0000 Author: jhb Date: Fri Jun 7 15:48:12 2019 New Revision: 348778 URL: https://svnweb.freebsd.org/changeset/base/348778 Log: Enable memory and I/O decoding in PCI devices on demand. Rather than uncoditionally setting the MEMEN and PORTEN bits in PCIR_COMMAND for PCI devices, set the respective bit when the first BAR of a given type is added to the device. This more closely matches what firmware does on bare metal. BUSMASTEREN is still set unconditionally. Eventually this bit should move into the device models as not all device models need this set. Reviewed by: rgrimes MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20530 Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 15:23:52 2019 (r348777) +++ head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 15:48:12 2019 (r348778) @@ -586,6 +586,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, { int error; uint64_t *baseptr, limit, addr, mask, lobits, bar; + uint16_t cmd, enbit; assert(idx >= 0 && idx <= PCI_BARMAX); @@ -604,13 +605,14 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, switch (type) { case PCIBAR_NONE: baseptr = NULL; - addr = mask = lobits = 0; + addr = mask = lobits = enbit = 0; break; case PCIBAR_IO: baseptr = &pci_emul_iobase; limit = PCI_EMUL_IOLIMIT; mask = PCIM_BAR_IO_BASE; lobits = PCIM_BAR_IO_SPACE; + enbit = PCIM_CMD_PORTEN; break; case PCIBAR_MEM64: /* @@ -639,12 +641,14 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64; } + enbit = PCIM_CMD_MEMEN; break; case PCIBAR_MEM32: baseptr = &pci_emul_membase32; limit = PCI_EMUL_MEMLIMIT32; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_32; + enbit = PCIM_CMD_MEMEN; break; default: printf("pci_emul_alloc_base: invalid bar type %d\n", type); @@ -671,6 +675,9 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, pci_set_cfgdata32(pdi, PCIR_BAR(idx + 1), bar >> 32); } + cmd = pci_get_cfgdata16(pdi, PCIR_COMMAND); + if ((cmd & enbit) != enbit) + pci_set_cfgdata16(pdi, PCIR_COMMAND, cmd | enbit); register_bar(pdi, idx); return (0); @@ -756,8 +763,7 @@ pci_emul_init(struct vmctx *ctx, struct pci_devemu *pd pci_set_cfgdata8(pdi, PCIR_INTLINE, 255); pci_set_cfgdata8(pdi, PCIR_INTPIN, 0); - pci_set_cfgdata8(pdi, PCIR_COMMAND, - PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); err = (*pde->pe_init)(ctx, pdi, fi->fi_param); if (err == 0) From owner-svn-src-head@freebsd.org Fri Jun 7 15:53: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 754BA15B08FC; Fri, 7 Jun 2019 15:53:28 +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 1A26E77C28; Fri, 7 Jun 2019 15:53:28 +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 D1D916310; Fri, 7 Jun 2019 15:53:27 +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 x57FrRwS019506; Fri, 7 Jun 2019 15:53:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57FrRDe019503; Fri, 7 Jun 2019 15:53:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906071553.x57FrRDe019503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 7 Jun 2019 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348779 - 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: 348779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A26E77C28 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.948,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, 07 Jun 2019 15:53:28 -0000 Author: jhb Date: Fri Jun 7 15:53:27 2019 New Revision: 348779 URL: https://svnweb.freebsd.org/changeset/base/348779 Log: Keep the shadow PCIR_COMMAND synced with the real one for pass through. This ensures that bhyve properly recognizes when decoding is disabled for BARs on passthru devices. To properly handle writes to the register, export a pci_emul_cmd_changed function from pci_emul.c that the pass through device model invokes for config writes that change PCIR_COMMAND. Reviewed by: rgrimes MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20531 Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 15:48:12 2019 (r348778) +++ head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 15:53:27 2019 (r348779) @@ -1679,33 +1679,20 @@ pci_emul_hdrtype_fixup(int bus, int slot, int off, int } } -static void -pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes) +/* + * Update device state in response to changes to the PCI command + * register. + */ +void +pci_emul_cmd_changed(struct pci_devinst *pi, uint16_t old) { - int i, rshift; - uint32_t cmd, cmd2, changed, old, readonly; + int i; + uint16_t changed, new; - cmd = pci_get_cfgdata16(pi, PCIR_COMMAND); /* stash old value */ + new = pci_get_cfgdata16(pi, PCIR_COMMAND); + changed = old ^ new; /* - * From PCI Local Bus Specification 3.0 sections 6.2.2 and 6.2.3. - * - * XXX Bits 8, 11, 12, 13, 14 and 15 in the status register are - * 'write 1 to clear'. However these bits are not set to '1' by - * any device emulation so it is simpler to treat them as readonly. - */ - rshift = (coff & 0x3) * 8; - readonly = 0xFFFFF880 >> rshift; - - old = CFGREAD(pi, coff, bytes); - new &= ~readonly; - new |= (old & readonly); - CFGWRITE(pi, coff, new, bytes); /* update config */ - - cmd2 = pci_get_cfgdata16(pi, PCIR_COMMAND); /* get updated value */ - changed = cmd ^ cmd2; - - /* * If the MMIO or I/O address space decoding has changed then * register/unregister all BARs that decode that address space. */ @@ -1717,7 +1704,7 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff case PCIBAR_IO: /* I/O address space decoding changed? */ if (changed & PCIM_CMD_PORTEN) { - if (porten(pi)) + if (new & PCIM_CMD_PORTEN) register_bar(pi, i); else unregister_bar(pi, i); @@ -1727,7 +1714,7 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff case PCIBAR_MEM64: /* MMIO address space decoding changed? */ if (changed & PCIM_CMD_MEMEN) { - if (memen(pi)) + if (new & PCIM_CMD_MEMEN) register_bar(pi, i); else unregister_bar(pi, i); @@ -1743,6 +1730,32 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff * interrupt. */ pci_lintr_update(pi); +} + +static void +pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes) +{ + int rshift; + uint32_t cmd, old, readonly; + + cmd = pci_get_cfgdata16(pi, PCIR_COMMAND); /* stash old value */ + + /* + * From PCI Local Bus Specification 3.0 sections 6.2.2 and 6.2.3. + * + * XXX Bits 8, 11, 12, 13, 14 and 15 in the status register are + * 'write 1 to clear'. However these bits are not set to '1' by + * any device emulation so it is simpler to treat them as readonly. + */ + rshift = (coff & 0x3) * 8; + readonly = 0xFFFFF880 >> rshift; + + old = CFGREAD(pi, coff, bytes); + new &= ~readonly; + new |= (old & readonly); + CFGWRITE(pi, coff, new, bytes); /* update config */ + + pci_emul_cmd_changed(pi, cmd); } static void Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Fri Jun 7 15:48:12 2019 (r348778) +++ head/usr.sbin/bhyve/pci_emul.h Fri Jun 7 15:53:27 2019 (r348779) @@ -223,6 +223,7 @@ int pci_emul_alloc_pbar(struct pci_devinst *pdi, int i uint64_t hostbase, enum pcibar_type type, uint64_t size); int pci_emul_add_msicap(struct pci_devinst *pi, int msgnum); int pci_emul_add_pciecap(struct pci_devinst *pi, int pcie_device_type); +void pci_emul_cmd_changed(struct pci_devinst *pi, uint16_t old); void pci_generate_msi(struct pci_devinst *pi, int msgnum); void pci_generate_msix(struct pci_devinst *pi, int msgnum); void pci_lintr_assert(struct pci_devinst *pi); Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Fri Jun 7 15:48:12 2019 (r348778) +++ head/usr.sbin/bhyve/pci_passthru.c Fri Jun 7 15:53:27 2019 (r348779) @@ -639,6 +639,9 @@ cfginit(struct vmctx *ctx, struct pci_devinst *pi, int goto done; } + pci_set_cfgdata16(pi, PCIR_COMMAND, read_config(&sc->psc_sel, + PCIR_COMMAND, 2)); + error = 0; /* success */ done: return (error); @@ -815,6 +818,7 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct { int error, msix_table_entries, i; struct passthru_softc *sc; + uint16_t cmd_old; sc = pi->pi_arg; @@ -871,6 +875,14 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct #endif write_config(&sc->psc_sel, coff, bytes, val); + if (coff == PCIR_COMMAND) { + cmd_old = pci_get_cfgdata16(pi, PCIR_COMMAND); + if (bytes == 1) + pci_set_cfgdata8(pi, PCIR_COMMAND, val); + else if (bytes == 2) + pci_set_cfgdata16(pi, PCIR_COMMAND, val); + pci_emul_cmd_changed(pi, cmd_old); + } return (0); } From owner-svn-src-head@freebsd.org Fri Jun 7 17:09: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 5280315B21E9; Fri, 7 Jun 2019 17:09:51 +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 EBEAB825FC; Fri, 7 Jun 2019 17:09:50 +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 7EDBF6F16; Fri, 7 Jun 2019 17:09:50 +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 x57H9oQe056844; Fri, 7 Jun 2019 17:09:50 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57H9oGT056842; Fri, 7 Jun 2019 17:09:50 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201906071709.x57H9oGT056842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 7 Jun 2019 17:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348781 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBEAB825FC 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.968,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, 07 Jun 2019 17:09:51 -0000 Author: chuck Date: Fri Jun 7 17:09:49 2019 New Revision: 348781 URL: https://svnweb.freebsd.org/changeset/base/348781 Log: bhyve: Add PCIe Integrated Endpoint capability The NVMe CAM driver reports the PCIe Link Capability and Status for devices. For emulated bhyve NVMe devices, this looks like: nda0: nvme version 1.3 x63 (max x63) lanes PCIe Gen15 (max Gen15) link The driver outputs this because the emulated device doesn't include the PCIe Capability structure. The NVMe specification requires these registers, so the fix is to add this set of capability registers to the emulated device. Note that PCI Express devices that are integrated into the Root Complex (i.e. Bus 0x0) do not have to support the Link Capability or Status registers. Windows will fail to start (i.e. Code 10) devices that appear to be part of the Root Complex but report being a PCI Express Endpoint. So also add a check to pci_emul_add_pciecap() to check if the device is integrated and change the device type. Reviewed by: imp, ken, araujo, jhb, rgrimes Approved by: imp (mentor), ken (mentor), jhb (maintainer) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19904 Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 17:05:58 2019 (r348780) +++ head/usr.sbin/bhyve/pci_emul.c Fri Jun 7 17:09:49 2019 (r348781) @@ -953,15 +953,23 @@ pci_emul_add_pciecap(struct pci_devinst *pi, int type) int err; struct pciecap pciecap; - if (type != PCIEM_TYPE_ROOT_PORT) - return (-1); - bzero(&pciecap, sizeof(pciecap)); + /* + * Use the integrated endpoint type for endpoints on a root complex bus. + * + * NB: bhyve currently only supports a single PCI bus that is the root + * complex bus, so all endpoints are integrated. + */ + if ((type == PCIEM_TYPE_ENDPOINT) && (pi->pi_bus == 0)) + type = PCIEM_TYPE_ROOT_INT_EP; + pciecap.capid = PCIY_EXPRESS; - pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT; - pciecap.link_capabilities = 0x411; /* gen1, x1 */ - pciecap.link_status = 0x11; /* gen1, x1 */ + pciecap.pcie_capabilities = PCIECAP_VERSION | type; + if (type != PCIEM_TYPE_ROOT_INT_EP) { + pciecap.link_capabilities = 0x411; /* gen1, x1 */ + pciecap.link_status = 0x11; /* gen1, x1 */ + } err = pci_emul_add_capability(pi, (u_char *)&pciecap, sizeof(pciecap)); return (err); Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Fri Jun 7 17:05:58 2019 (r348780) +++ head/usr.sbin/bhyve/pci_nvme.c Fri Jun 7 17:09:49 2019 (r348781) @@ -1925,6 +1925,12 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p goto done; } + error = pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_INT_EP); + if (error) { + WPRINTF(("%s pci add Express capability failed\r\n", __func__)); + goto done; + } + pthread_mutex_init(&sc->mtx, NULL); sem_init(&sc->iosemlock, 0, sc->ioslots); From owner-svn-src-head@freebsd.org Fri Jun 7 17:54: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 90F1415B2FC0; Fri, 7 Jun 2019 17:54:27 +0000 (UTC) (envelope-from markj@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 304AD83D18; Fri, 7 Jun 2019 17:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B3F3779A; Fri, 7 Jun 2019 17:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57HsQHC082900; Fri, 7 Jun 2019 17:54:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57HsQ6Z082899; Fri, 7 Jun 2019 17:54:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906071754.x57HsQ6Z082899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Jun 2019 17:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348782 - head/share/examples/bhyve X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/examples/bhyve X-SVN-Commit-Revision: 348782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 304AD83D18 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.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: Fri, 07 Jun 2019 17:54:27 -0000 Author: markj Date: Fri Jun 7 17:54:26 2019 New Revision: 348782 URL: https://svnweb.freebsd.org/changeset/base/348782 Log: vmrun: Add a missing close-paren to the usage message. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Fri Jun 7 17:09:49 2019 (r348781) +++ head/share/examples/bhyve/vmrun.sh Fri Jun 7 17:54:26 2019 (r348782) @@ -75,7 +75,7 @@ usage() { echo " -E: Use UEFI mode" echo " -f: Use a specific UEFI firmware" echo " -F: Use a custom UEFI GOP framebuffer size" \ - "(default: ${DEFAULT_VNCSIZE}" + "(default: ${DEFAULT_VNCSIZE})" echo " -g: listen for connection from kgdb at " echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" From owner-svn-src-head@freebsd.org Fri Jun 7 17:59: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 824BF15B31C6; Fri, 7 Jun 2019 17:59:01 +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 2643283FE0; Fri, 7 Jun 2019 17:59:01 +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 F2B19779D; Fri, 7 Jun 2019 17:59:00 +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 x57Hx06i083148; Fri, 7 Jun 2019 17:59:00 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57Hx0Hh083144; Fri, 7 Jun 2019 17:59:00 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906071759.x57Hx0Hh083144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 7 Jun 2019 17:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348783 - in head/sys/powerpc: aim pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys/powerpc: aim pseries X-SVN-Commit-Revision: 348783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2643283FE0 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_SHORT(-0.95)[-0.948,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: Fri, 07 Jun 2019 17:59:01 -0000 Author: luporl Date: Fri Jun 7 17:58:59 2019 New Revision: 348783 URL: https://svnweb.freebsd.org/changeset/base/348783 Log: [PPC64] Support QEMU/KVM pseries without hugepages This set of changes make it possible to run FreeBSD for PowerPC64/pseries, under QEMU/KVM, without requiring the host to make hugepages available to the guest. While there was already this possibility, by means of setting hw_direct_map to 0, on PowerPC64 there were a couple of issues/wrong assumptions that prevented this from working, before this changelist. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20522 Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mmu_oea64.h head/sys/powerpc/aim/slb.c head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Jun 7 17:54:26 2019 (r348782) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Jun 7 17:58:59 2019 (r348783) @@ -638,7 +638,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel { struct pvo_entry *pvo; register_t msr; - vm_paddr_t pa; + vm_paddr_t pa, pkernelstart, pkernelend; vm_offset_t size, off; uint64_t pte_lo; int i; @@ -686,9 +686,11 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel */ if (!hw_direct_map || kernelstart < DMAP_BASE_ADDRESS) { - for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; + pkernelstart = kernelstart & ~DMAP_BASE_ADDRESS; + pkernelend = kernelend & ~DMAP_BASE_ADDRESS; + for (pa = pkernelstart & ~PAGE_MASK; pa < pkernelend; pa += PAGE_SIZE) - moea64_kenter(mmup, pa, pa); + moea64_kenter(mmup, pa | DMAP_BASE_ADDRESS, pa); } if (!hw_direct_map) { @@ -696,6 +698,10 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel off = (vm_offset_t)(moea64_bpvo_pool); for (pa = off; pa < off + size; pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); + + /* Map exception vectors */ + for (pa = EXC_RSVD; pa < EXC_LAST; pa += PAGE_SIZE) + moea64_kenter(mmup, pa | DMAP_BASE_ADDRESS, pa); } ENABLE_TRANS(msr); @@ -875,7 +881,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta * Initialise the bootstrap pvo pool. */ moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( - moea64_bpvo_pool_size*sizeof(struct pvo_entry), 0); + moea64_bpvo_pool_size*sizeof(struct pvo_entry), PAGE_SIZE); moea64_bpvo_pool_index = 0; /* Place at address usable through the direct map */ @@ -1169,15 +1175,19 @@ moea64_unwire(mmu_t mmu, pmap_t pm, vm_offset_t sva, v */ static __inline -void moea64_set_scratchpage_pa(mmu_t mmup, int which, vm_paddr_t pa) { +void moea64_set_scratchpage_pa(mmu_t mmup, int which, vm_paddr_t pa) +{ + struct pvo_entry *pvo; KASSERT(!hw_direct_map, ("Using OEA64 scratchpage with a direct map!")); mtx_assert(&moea64_scratchpage_mtx, MA_OWNED); - moea64_scratchpage_pvo[which]->pvo_pte.pa = + pvo = moea64_scratchpage_pvo[which]; + PMAP_LOCK(pvo->pvo_pmap); + pvo->pvo_pte.pa = moea64_calc_wimg(pa, VM_MEMATTR_DEFAULT) | (uint64_t)pa; - MOEA64_PTE_REPLACE(mmup, moea64_scratchpage_pvo[which], - MOEA64_PTE_INVALIDATE); + MOEA64_PTE_REPLACE(mmup, pvo, MOEA64_PTE_INVALIDATE); + PMAP_UNLOCK(pvo->pvo_pmap); isync(); } Modified: head/sys/powerpc/aim/mmu_oea64.h ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.h Fri Jun 7 17:54:26 2019 (r348782) +++ head/sys/powerpc/aim/mmu_oea64.h Fri Jun 7 17:58:59 2019 (r348783) @@ -81,6 +81,7 @@ extern u_int moea64_pte_overflow; extern int moea64_large_page_shift; extern uint64_t moea64_large_page_size; +extern uint64_t moea64_large_page_mask; extern u_long moea64_pteg_count; extern u_long moea64_pteg_mask; extern int n_slbs; Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Fri Jun 7 17:54:26 2019 (r348782) +++ head/sys/powerpc/aim/slb.c Fri Jun 7 17:58:59 2019 (r348783) @@ -500,10 +500,12 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, i if (m == NULL) return (NULL); - va = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - - if (!hw_direct_map) + if (hw_direct_map) + va = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + else { + va = (void *)(VM_PAGE_TO_PHYS(m) | DMAP_BASE_ADDRESS); pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); + } if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Fri Jun 7 17:54:26 2019 (r348782) +++ head/sys/powerpc/pseries/mmu_phyp.c Fri Jun 7 17:58:59 2019 (r348783) @@ -59,6 +59,16 @@ __FBSDID("$FreeBSD$"); #include "phyp-hvcall.h" +#define MMU_PHYP_DEBUG 0 +#define MMU_PHYP_ID "mmu_phyp: " +#if MMU_PHYP_DEBUG +#define dprintf(fmt, ...) printf(fmt, ## __VA_ARGS__) +#define dprintf0(fmt, ...) dprintf(MMU_PHYP_ID fmt, ## __VA_ARGS__) +#else +#define dprintf(fmt, args...) do { ; } while(0) +#define dprintf0(fmt, args...) do { ; } while(0) +#endif + static struct rmlock mphyp_eviction_lock; /* @@ -149,6 +159,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, v res = OF_getencprop(node, "ibm,slb-size", prop, sizeof(prop[0])); if (res > 0) n_slbs = prop[0]; + dprintf0("slb-size=%i\n", n_slbs); moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); @@ -185,11 +196,22 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, v shift = arr[idx]; slb_encoding = arr[idx + 1]; nptlp = arr[idx + 2]; + + dprintf0("Segment Page Size: " + "%uKB, slb_enc=0x%X: {size, encoding}[%u] =", + shift > 10? 1 << (shift-10) : 0, + slb_encoding, nptlp); + idx += 3; len -= 3; while (len > 0 && nptlp) { lp_size = arr[idx]; lp_encoding = arr[idx+1]; + + dprintf(" {%uKB, 0x%X}", + lp_size > 10? 1 << (lp_size-10) : 0, + lp_encoding); + if (slb_encoding == SLBV_L && lp_encoding == 0) break; @@ -197,17 +219,28 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, v len -= 2; nptlp--; } + dprintf("\n"); if (nptlp && slb_encoding == SLBV_L && lp_encoding == 0) break; } - if (len == 0) - panic("Standard large pages (SLB[L] = 1, PTE[LP] = 0) " - "not supported by this system. Please enable huge " - "page backing if running under PowerKVM."); - - moea64_large_page_shift = shift; - moea64_large_page_size = 1ULL << lp_size; + if (len > 0) { + moea64_large_page_shift = shift; + moea64_large_page_size = 1ULL << lp_size; + moea64_large_page_mask = moea64_large_page_size - 1; + hw_direct_map = 1; + printf(MMU_PHYP_ID + "Support for hugepages of %uKB detected\n", + moea64_large_page_shift > 10? + 1 << (moea64_large_page_shift-10) : 0); + } else { + moea64_large_page_size = 0; + moea64_large_page_shift = 0; + moea64_large_page_mask = 0; + hw_direct_map = 0; + printf(MMU_PHYP_ID + "Support for hugepages not found\n"); + } } moea64_mid_bootstrap(mmup, kernelstart, kernelend); From owner-svn-src-head@freebsd.org Fri Jun 7 18:23: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 B1C3A15B3BDC; Fri, 7 Jun 2019 18:23:33 +0000 (UTC) (envelope-from markj@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 01BF684E89; Fri, 7 Jun 2019 18:23:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAE3A7CB4; Fri, 7 Jun 2019 18:23:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57INWAC098623; Fri, 7 Jun 2019 18:23:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57INUha098611; Fri, 7 Jun 2019 18:23:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906071823.x57INUha098611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Jun 2019 18:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348785 - in head/sys: amd64/amd64 arm/arm arm/nvidia/drm2 compat/linuxkpi/common/src dev/drm2/ttm dev/ti dev/xen/gntdev i386/i386 mips/mips riscv/riscv vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm/nvidia/drm2 compat/linuxkpi/common/src dev/drm2/ttm dev/ti dev/xen/gntdev i386/i386 mips/mips riscv/riscv vm X-SVN-Commit-Revision: 348785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01BF684E89 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.949,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, 07 Jun 2019 18:23:33 -0000 Author: markj Date: Fri Jun 7 18:23:29 2019 New Revision: 348785 URL: https://svnweb.freebsd.org/changeset/base/348785 Log: Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). These calls are not the same in general: the former will dequeue the page if it is enqueued, while the latter will just leave it alone. But, all existing uses of the former apply to unmanaged pages, which are never enqueued in the first place. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20470 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/nvidia/drm2/tegra_bo.c head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/dev/drm2/ttm/ttm_page_alloc.c head/sys/dev/ti/if_ti.c head/sys/dev/xen/gntdev/gntdev.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/riscv/riscv/pmap.c head/sys/vm/uma_core.c head/sys/vm/vm_glue.c head/sys/vm/vm_kern.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/amd64/amd64/pmap.c Fri Jun 7 18:23:29 2019 (r348785) @@ -4081,7 +4081,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/arm/arm/pmap-v6.c Fri Jun 7 18:23:29 2019 (r348785) @@ -2973,7 +2973,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); pmap_pte2list_free(&pv_vafree, (vm_offset_t)pc); } Modified: head/sys/arm/nvidia/drm2/tegra_bo.c ============================================================================== --- head/sys/arm/nvidia/drm2/tegra_bo.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/arm/nvidia/drm2/tegra_bo.c Fri Jun 7 18:23:29 2019 (r348785) @@ -67,7 +67,7 @@ tegra_bo_destruct(struct tegra_bo *bo) cdev_pager_free_page(bo->cdev_pager, m); vm_page_lock(m); m->flags &= ~PG_FICTITIOUS; - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); } Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Fri Jun 7 18:23:29 2019 (r348785) @@ -317,7 +317,7 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(page); - vm_page_unwire(page, PQ_NONE); + vm_page_unwire_noq(page); vm_page_free(page); vm_page_unlock(page); VM_OBJECT_WUNLOCK(obj); Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Fri Jun 7 18:23:29 2019 (r348785) @@ -137,7 +137,7 @@ ttm_vm_page_free(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m)); m->flags &= ~PG_FICTITIOUS; m->oflags |= VPO_UNMANAGED; - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/dev/ti/if_ti.c Fri Jun 7 18:23:29 2019 (r348785) @@ -1623,7 +1623,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct m } sf[i] = sf_buf_alloc(frame, SFB_NOWAIT); if (sf[i] == NULL) { - vm_page_unwire(frame, PQ_NONE); + vm_page_unwire_noq(frame); vm_page_free(frame); device_printf(sc->ti_dev, "buffer allocation " "failed -- packet dropped!\n"); Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/dev/xen/gntdev/gntdev.c Fri Jun 7 18:23:29 2019 (r348785) @@ -278,7 +278,7 @@ gref_list_dtor(struct cleanup_data_struct *cleanup_dat continue; gnttab_free_grant_reference(gref->gref_id); } - vm_page_unwire(gref->page, PQ_NONE); + vm_page_unwire_noq(gref->page); vm_page_free(gref->page); gref->page = NULL; } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/i386/i386/pmap.c Fri Jun 7 18:23:29 2019 (r348785) @@ -2465,7 +2465,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/mips/mips/pmap.c Fri Jun 7 18:23:29 2019 (r348785) @@ -1591,7 +1591,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/riscv/riscv/pmap.c Fri Jun 7 18:23:29 2019 (r348785) @@ -1648,7 +1648,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/vm/uma_core.c Fri Jun 7 18:23:29 2019 (r348785) @@ -1279,9 +1279,9 @@ pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int zkva += PAGE_SIZE; } return ((void*)addr); - fail: +fail: TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) { - vm_page_unwire(p, PQ_NONE); + vm_page_unwire_noq(p); vm_page_free(p); } return (NULL); @@ -1331,7 +1331,7 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, int doma * exit. */ TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) { - vm_page_unwire(p, PQ_NONE); + vm_page_unwire_noq(p); vm_page_free(p); } return (NULL); @@ -1392,7 +1392,7 @@ pcpu_page_free(void *mem, vm_size_t size, uint8_t flag for (curva = sva; curva < sva + size; curva += PAGE_SIZE) { paddr = pmap_kextract(curva); m = PHYS_TO_VM_PAGE(paddr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } pmap_qremove(sva, size >> PAGE_SHIFT); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/vm/vm_glue.c Fri Jun 7 18:23:29 2019 (r348785) @@ -408,7 +408,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t if (m == NULL) panic("vm_thread_dispose: kstack already missing?"); vm_page_lock(m); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); } Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Jun 7 18:01:29 2019 (r348784) +++ head/sys/vm/vm_kern.c Fri Jun 7 18:23:29 2019 (r348785) @@ -586,7 +586,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ #endif for (; offset < end; offset += PAGE_SIZE, m = next) { next = vm_page_next(m); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } VM_OBJECT_WUNLOCK(object); From owner-svn-src-head@freebsd.org Fri Jun 7 18:34: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 7EC3115B3ECD; Fri, 7 Jun 2019 18:34:49 +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 20ADA85497; Fri, 7 Jun 2019 18:34:49 +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 EC0737E5D; Fri, 7 Jun 2019 18:34:48 +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 x57IYmG9004307; Fri, 7 Jun 2019 18:34:48 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57IYm9L004306; Fri, 7 Jun 2019 18:34:48 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201906071834.x57IYm9L004306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 7 Jun 2019 18:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348786 - in head/sys: cam/nvme dev/nvme X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: in head/sys: cam/nvme dev/nvme X-SVN-Commit-Revision: 348786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20ADA85497 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.948,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, 07 Jun 2019 18:34:49 -0000 Author: chuck Date: Fri Jun 7 18:34:48 2019 New Revision: 348786 URL: https://svnweb.freebsd.org/changeset/base/348786 Log: Fix nda(4) PCIe link status output Differentiate between PCI Express Endpoint devices and Root Complex Integrated Endpoints in the nda driver. The Link Status and Capability registers are not valid for Integrated Endpoints and should not be displayed. The bhyve emulated NVMe device will advertise as being an Integrated Endpoint. Reviewed by: imp Approved byL imp (mentor) Differential Revision: https://reviews.freebsd.org/D20282 Modified: head/sys/cam/nvme/nvme_xpt.c head/sys/dev/nvme/nvme_sim.c Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Fri Jun 7 18:23:29 2019 (r348785) +++ head/sys/cam/nvme/nvme_xpt.c Fri Jun 7 18:34:48 2019 (r348786) @@ -722,6 +722,8 @@ nvme_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; struct cam_path *path = periph->path; struct ccb_trans_settings_nvme *nvmex; + struct sbuf sb; + char buffer[120]; cam_periph_assert(periph, MA_OWNED); @@ -736,13 +738,18 @@ nvme_announce_periph(struct cam_periph *periph) /* Ask the SIM for its base transfer speed */ xpt_path_inq(&cpi, periph->path); - printf("%s%d: nvme version %d.%d x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + sbuf_printf(&sb, "%s%d: nvme version %d.%d", periph->periph_name, periph->unit_number, NVME_MAJOR(nvmex->spec), - NVME_MINOR(nvmex->spec), - nvmex->lanes, nvmex->max_lanes, - nvmex->speed, nvmex->max_speed); - printf("\n"); + NVME_MINOR(nvmex->spec)); + if (nvmex->valid & CTS_NVME_VALID_LINK) + sbuf_printf(&sb, " x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + nvmex->lanes, nvmex->max_lanes, + nvmex->speed, nvmex->max_speed); + sbuf_printf(&sb, "\n"); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Fri Jun 7 18:23:29 2019 (r348785) +++ head/sys/dev/nvme/nvme_sim.c Fri Jun 7 18:34:48 2019 (r348786) @@ -212,7 +212,7 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) struct ccb_trans_settings_nvme *nvmep; struct ccb_trans_settings_nvme *nvmex; device_t dev; - uint32_t status, caps; + uint32_t status, caps, flags; dev = ctrlr->dev; cts = &ccb->cts; @@ -221,12 +221,16 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) status = pcie_read_config(dev, PCIER_LINK_STA, 2); caps = pcie_read_config(dev, PCIER_LINK_CAP, 2); - nvmex->valid = CTS_NVME_VALID_SPEC | CTS_NVME_VALID_LINK; + flags = pcie_read_config(dev, PCIER_FLAGS, 2); nvmex->spec = nvme_mmio_read_4(ctrlr, vs); - nvmex->speed = status & PCIEM_LINK_STA_SPEED; - nvmex->lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; - nvmex->max_speed = caps & PCIEM_LINK_CAP_MAX_SPEED; - nvmex->max_lanes = (caps & PCIEM_LINK_CAP_MAX_WIDTH) >> 4; + nvmex->valid = CTS_NVME_VALID_SPEC; + if ((flags & PCIEM_FLAGS_TYPE) == PCIEM_TYPE_ENDPOINT) { + nvmex->valid |= CTS_NVME_VALID_LINK; + nvmex->speed = status & PCIEM_LINK_STA_SPEED; + nvmex->lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; + nvmex->max_speed = caps & PCIEM_LINK_CAP_MAX_SPEED; + nvmex->max_lanes = (caps & PCIEM_LINK_CAP_MAX_WIDTH) >> 4; + } /* XXX these should be something else maybe ? */ nvmep->valid = 1; From owner-svn-src-head@freebsd.org Fri Jun 7 19:03: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 07EE615B4838; Fri, 7 Jun 2019 19:03:19 +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 9E42086378; Fri, 7 Jun 2019 19:03:18 +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 776EC8373; Fri, 7 Jun 2019 19:03:18 +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 x57J3I2t019973; Fri, 7 Jun 2019 19:03:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57J3IOf019972; Fri, 7 Jun 2019 19:03:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906071903.x57J3IOf019972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Jun 2019 19:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348788 - 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: 348788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E42086378 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.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: Fri, 07 Jun 2019 19:03:19 -0000 Author: mav Date: Fri Jun 7 19:03:17 2019 New Revision: 348788 URL: https://svnweb.freebsd.org/changeset/base/348788 Log: Explicitly start ARC adjustment on limits change. While formally it is not necessary, but the sooner it start, the sooner it finish, and supposedly less disturbing for workload it will be. MFC after: 2 weeks 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 7 18:52:36 2019 (r348787) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 7 19:03:17 2019 (r348788) @@ -1233,6 +1233,12 @@ sysctl_vfs_zfs_arc_meta_limit(SYSCTL_HANDLER_ARGS) return (EINVAL); arc_meta_limit = val; + + mutex_enter(&arc_adjust_lock); + arc_adjust_needed = B_TRUE; + mutex_exit(&arc_adjust_lock); + zthr_wakeup(arc_adjust_zthr); + return (0); } @@ -1293,6 +1299,11 @@ sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_ARGS) arc_c = arc_c / 2; zfs_arc_max = arc_c; + + mutex_enter(&arc_adjust_lock); + arc_adjust_needed = B_TRUE; + mutex_exit(&arc_adjust_lock); + zthr_wakeup(arc_adjust_zthr); return (0); } From owner-svn-src-head@freebsd.org Fri Jun 7 20:59:26 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 0D96015B6B0F; Fri, 7 Jun 2019 20:59:26 +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 9FF9189884; Fri, 7 Jun 2019 20:59:25 +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 3251C95DD; Fri, 7 Jun 2019 20:59:25 +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 x57KxPUF077804; Fri, 7 Jun 2019 20:59:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57KxPwS077803; Fri, 7 Jun 2019 20:59:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906072059.x57KxPwS077803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Jun 2019 20:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348790 - 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: 348790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FF9189884 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.968,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, 07 Jun 2019 20:59:26 -0000 Author: mav Date: Fri Jun 7 20:59:24 2019 New Revision: 348790 URL: https://svnweb.freebsd.org/changeset/base/348790 Log: Fix comparison signedness in arc_is_overflowing(). When ARC size is very small, aggsum_lower_bound(&arc_size) may return negative values, that due to unsigned comparison caused delays, waiting for arc_adjust() to "fix" it by calling aggsum_value(&arc_size). Use of signed comparison there fixes the problem. 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 7 20:43:34 2019 (r348789) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 7 20:59:24 2019 (r348790) @@ -5140,7 +5140,7 @@ static boolean_t arc_is_overflowing(void) { /* Always allow at least one block of overflow */ - uint64_t overflow = MAX(SPA_MAXBLOCKSIZE, + int64_t overflow = MAX(SPA_MAXBLOCKSIZE, arc_c >> zfs_arc_overflow_shift); /* @@ -5152,7 +5152,7 @@ arc_is_overflowing(void) * in the ARC. In practice, that's in the tens of MB, which is low * enough to be safe. */ - return (aggsum_lower_bound(&arc_size) >= arc_c + overflow); + return (aggsum_lower_bound(&arc_size) >= (int64_t)arc_c + overflow); } static abd_t * From owner-svn-src-head@freebsd.org Fri Jun 7 21:30: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 4F8E915B747E; Fri, 7 Jun 2019 21:30:12 +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 DBECC8A826; Fri, 7 Jun 2019 21:30:11 +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 B1C089B81; Fri, 7 Jun 2019 21:30:11 +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 x57LUBEC093283; Fri, 7 Jun 2019 21:30:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57LUBrK093282; Fri, 7 Jun 2019 21:30:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906072130.x57LUBrK093282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 7 Jun 2019 21:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348791 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 348791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBECC8A826 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.968,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, 07 Jun 2019 21:30:12 -0000 Author: jhb Date: Fri Jun 7 21:30:11 2019 New Revision: 348791 URL: https://svnweb.freebsd.org/changeset/base/348791 Log: Fix debug trace after removal of pdu_overhead. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri Jun 7 20:59:24 2019 (r348790) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Jun 7 21:30:11 2019 (r348791) @@ -1585,8 +1585,8 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head sbappendstream_locked(sb, m, 0); rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; #ifdef VERBOSE_TRACES - CTR5(KTR_CXGBE, "%s: tid %u PDU overhead %d rx_credits %u rcv_wnd %u", - __func__, tid, pdu_overhead, rx_credits, tp->rcv_wnd); + CTR4(KTR_CXGBE, "%s: tid %u rx_credits %u rcv_wnd %u", + __func__, tid, rx_credits, tp->rcv_wnd); #endif if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { rx_credits = send_rx_credits(sc, toep, rx_credits); From owner-svn-src-head@freebsd.org Sat Jun 8 02:36: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 6CB1F15BEFF9; Sat, 8 Jun 2019 02:36:08 +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 128B86E3BD; Sat, 8 Jun 2019 02:36:08 +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 D697FD252; Sat, 8 Jun 2019 02:36:07 +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 x582a7iU059955; Sat, 8 Jun 2019 02:36:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x582a7oX059953; Sat, 8 Jun 2019 02:36:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906080236.x582a7oX059953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 8 Jun 2019 02:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348794 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 348794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 128B86E3BD 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.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: Sat, 08 Jun 2019 02:36:08 -0000 Author: jhibbits Date: Sat Jun 8 02:36:07 2019 New Revision: 348794 URL: https://svnweb.freebsd.org/changeset/base/348794 Log: powerpc/aim: Use nitems() for calculating size of phys_avail in AIM pmaps Same thing was already done in r347164 for Book-E pmap. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Jun 8 02:30:16 2019 (r348793) +++ head/sys/powerpc/aim/mmu_oea.c Sat Jun 8 02:36:07 2019 (r348794) @@ -749,7 +749,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm } while (pa < end); } - if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz) + if (nitems(phys_avail) < regions_sz) panic("moea_bootstrap: phys_avail too small"); phys_avail_count = 0; Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Jun 8 02:30:16 2019 (r348793) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Jun 8 02:36:07 2019 (r348794) @@ -768,7 +768,7 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz); CTR0(KTR_PMAP, "moea64_bootstrap: physical memory"); - if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz) + if (nitems(phys_avail) < regions_sz) panic("moea64_bootstrap: phys_avail too small"); phys_avail_count = 0; From owner-svn-src-head@freebsd.org Sat Jun 8 03:07: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 F2E7F15C016D; Sat, 8 Jun 2019 03:07:09 +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 9343B6F65A; Sat, 8 Jun 2019 03:07:09 +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 26C0ED82E; Sat, 8 Jun 2019 03:07:09 +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 x58379pL076639; Sat, 8 Jun 2019 03:07:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58378fs076635; Sat, 8 Jun 2019 03:07:08 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906080307.x58378fs076635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 8 Jun 2019 03:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348795 - in head/sys/powerpc: aim include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 348795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9343B6F65A 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.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: Sat, 08 Jun 2019 03:07:10 -0000 Author: jhibbits Date: Sat Jun 8 03:07:08 2019 New Revision: 348795 URL: https://svnweb.freebsd.org/changeset/base/348795 Log: powerpc/pmap: Move the SLB spill handlers to a better place The SLB spill handlers are AIM-specific, and belong better with the rest of the SLB code anyway. No functional change. Modified: head/sys/powerpc/aim/slb.c head/sys/powerpc/include/slb.h head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Jun 8 02:36:07 2019 (r348794) +++ head/sys/powerpc/aim/slb.c Sat Jun 8 03:07:08 2019 (r348795) @@ -47,7 +47,10 @@ #include #include #include +#include +#include "mmu_oea64.h" + uintptr_t moea64_get_unique_vsid(void); void moea64_release_vsid(uint64_t vsid); static void slb_zone_init(void *); @@ -540,3 +543,86 @@ slb_free_user_cache(struct slb **slb) { uma_zfree(slb_cache_zone, slb); } + +#if defined(__powerpc64__) +/* Handle kernel SLB faults -- runs in real mode, all seat belts off */ +void +handle_kernel_slb_spill(int type, register_t dar, register_t srr0) +{ + struct slb *slbcache; + uint64_t slbe, slbv; + uint64_t esid, addr; + int i; + + addr = (type == EXC_ISE) ? srr0 : dar; + slbcache = PCPU_GET(aim.slb); + esid = (uintptr_t)addr >> ADDR_SR_SHFT; + slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; + + /* See if the hardware flushed this somehow (can happen in LPARs) */ + for (i = 0; i < n_slbs; i++) + if (slbcache[i].slbe == (slbe | (uint64_t)i)) + return; + + /* Not in the map, needs to actually be added */ + slbv = kernel_va_to_slbv(addr); + if (slbcache[USER_SLB_SLOT].slbe == 0) { + for (i = 0; i < n_slbs; i++) { + if (i == USER_SLB_SLOT) + continue; + if (!(slbcache[i].slbe & SLBE_VALID)) + goto fillkernslb; + } + + if (i == n_slbs) + slbcache[USER_SLB_SLOT].slbe = 1; + } + + /* Sacrifice a random SLB entry that is not the user entry */ + i = mftb() % n_slbs; + if (i == USER_SLB_SLOT) + i = (i+1) % n_slbs; + +fillkernslb: + /* Write new entry */ + slbcache[i].slbv = slbv; + slbcache[i].slbe = slbe | (uint64_t)i; + + /* Trap handler will restore from cache on exit */ +} + +int +handle_user_slb_spill(pmap_t pm, vm_offset_t addr) +{ + struct slb *user_entry; + uint64_t esid; + int i; + + if (pm->pm_slb == NULL) + return (-1); + + esid = (uintptr_t)addr >> ADDR_SR_SHFT; + + PMAP_LOCK(pm); + user_entry = user_va_to_slb_entry(pm, addr); + + if (user_entry == NULL) { + /* allocate_vsid auto-spills it */ + (void)allocate_user_vsid(pm, esid, 0); + } else { + /* + * Check that another CPU has not already mapped this. + * XXX: Per-thread SLB caches would be better. + */ + for (i = 0; i < pm->pm_slb_len; i++) + if (pm->pm_slb[i] == user_entry) + break; + + if (i == pm->pm_slb_len) + slb_insert_user(pm, user_entry); + } + PMAP_UNLOCK(pm); + + return (0); +} +#endif Modified: head/sys/powerpc/include/slb.h ============================================================================== --- head/sys/powerpc/include/slb.h Sat Jun 8 02:36:07 2019 (r348794) +++ head/sys/powerpc/include/slb.h Sat Jun 8 03:07:08 2019 (r348795) @@ -79,4 +79,8 @@ struct slb { uint64_t slbe; }; +struct pmap; +void handle_kernel_slb_spill(int, register_t, register_t); +int handle_user_slb_spill(struct pmap *pm, vm_offset_t addr); + #endif /* !_MACHINE_SLB_H_ */ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sat Jun 8 02:36:07 2019 (r348794) +++ head/sys/powerpc/powerpc/trap.c Sat Jun 8 03:07:08 2019 (r348795) @@ -69,9 +69,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include +#include /* Below matches setjmp.S */ #define FAULTBUF_LR 21 @@ -92,9 +93,6 @@ static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); #if defined(__powerpc64__) && defined(AIM) - void handle_kernel_slb_spill(int, register_t, register_t); -static int handle_user_slb_spill(pmap_t pm, vm_offset_t addr); -extern int n_slbs; static void normalize_inputs(void); #endif @@ -720,89 +718,6 @@ syscall(struct trapframe *frame) error = syscallenter(td); syscallret(td, error); } - -#if defined(__powerpc64__) && defined(AIM) -/* Handle kernel SLB faults -- runs in real mode, all seat belts off */ -void -handle_kernel_slb_spill(int type, register_t dar, register_t srr0) -{ - struct slb *slbcache; - uint64_t slbe, slbv; - uint64_t esid, addr; - int i; - - addr = (type == EXC_ISE) ? srr0 : dar; - slbcache = PCPU_GET(aim.slb); - esid = (uintptr_t)addr >> ADDR_SR_SHFT; - slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; - - /* See if the hardware flushed this somehow (can happen in LPARs) */ - for (i = 0; i < n_slbs; i++) - if (slbcache[i].slbe == (slbe | (uint64_t)i)) - return; - - /* Not in the map, needs to actually be added */ - slbv = kernel_va_to_slbv(addr); - if (slbcache[USER_SLB_SLOT].slbe == 0) { - for (i = 0; i < n_slbs; i++) { - if (i == USER_SLB_SLOT) - continue; - if (!(slbcache[i].slbe & SLBE_VALID)) - goto fillkernslb; - } - - if (i == n_slbs) - slbcache[USER_SLB_SLOT].slbe = 1; - } - - /* Sacrifice a random SLB entry that is not the user entry */ - i = mftb() % n_slbs; - if (i == USER_SLB_SLOT) - i = (i+1) % n_slbs; - -fillkernslb: - /* Write new entry */ - slbcache[i].slbv = slbv; - slbcache[i].slbe = slbe | (uint64_t)i; - - /* Trap handler will restore from cache on exit */ -} - -static int -handle_user_slb_spill(pmap_t pm, vm_offset_t addr) -{ - struct slb *user_entry; - uint64_t esid; - int i; - - if (pm->pm_slb == NULL) - return (-1); - - esid = (uintptr_t)addr >> ADDR_SR_SHFT; - - PMAP_LOCK(pm); - user_entry = user_va_to_slb_entry(pm, addr); - - if (user_entry == NULL) { - /* allocate_vsid auto-spills it */ - (void)allocate_user_vsid(pm, esid, 0); - } else { - /* - * Check that another CPU has not already mapped this. - * XXX: Per-thread SLB caches would be better. - */ - for (i = 0; i < pm->pm_slb_len; i++) - if (pm->pm_slb[i] == user_entry) - break; - - if (i == pm->pm_slb_len) - slb_insert_user(pm, user_entry); - } - PMAP_UNLOCK(pm); - - return (0); -} -#endif static int trap_pfault(struct trapframe *frame, int user) From owner-svn-src-head@freebsd.org Sat Jun 8 08:25: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 DB09F15C540D; Sat, 8 Jun 2019 08:25:44 +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 7F48577E36; Sat, 8 Jun 2019 08:25:44 +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 6E55C18EBE; Sat, 8 Jun 2019 08:25:44 +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 x588PieM044129; Sat, 8 Jun 2019 08:25:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x588PiB4044128; Sat, 8 Jun 2019 08:25:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906080825.x588PiB4044128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 8 Jun 2019 08:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348796 - 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: 348796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F48577E36 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.964,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, 08 Jun 2019 08:25:45 -0000 Author: emaste Date: Sat Jun 8 08:25:43 2019 New Revision: 348796 URL: https://svnweb.freebsd.org/changeset/base/348796 Log: vtfontcvt: allow out-of-order glyphs PR: 205707 Reported by: mi MFC after: 2 weeks Event: Vienna Hackathon 2019 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 8 03:07:08 2019 (r348795) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 8 08:25:43 2019 (r348796) @@ -111,7 +111,7 @@ xmalloc(size_t size) static int add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) { - struct mapping *mp; + struct mapping *mp, *mp_temp; struct mapping_list *ml; mapping_total++; @@ -122,10 +122,19 @@ add_mapping(struct glyph *gl, unsigned int c, unsigned mp->m_length = 0; ml = &maps[map_idx]; - if (TAILQ_LAST(ml, mapping_list) != NULL && - TAILQ_LAST(ml, mapping_list)->m_char >= c) - errx(1, "Bad ordering at character %u", c); - TAILQ_INSERT_TAIL(ml, mp, m_list); + if (TAILQ_LAST(ml, mapping_list) == NULL || + TAILQ_LAST(ml, mapping_list)->m_char < c) { + /* Common case: empty list or new char at end of list. */ + TAILQ_INSERT_TAIL(ml, mp, m_list); + } else { + /* Find insertion point for char; cannot be at end. */ + TAILQ_FOREACH(mp_temp, ml, m_list) { + if (mp_temp->m_char >= c) { + TAILQ_INSERT_BEFORE(mp_temp, mp, m_list); + break; + } + } + } map_count[map_idx]++; mapping_unique++; From owner-svn-src-head@freebsd.org Sat Jun 8 09:34: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 6609515C69E5; Sat, 8 Jun 2019 09:34:03 +0000 (UTC) (envelope-from hselasky@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 0B60482CC3; Sat, 8 Jun 2019 09:34:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D61C519A85; Sat, 8 Jun 2019 09:34:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x589Y25p080408; Sat, 8 Jun 2019 09:34:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x589Y2Cv080407; Sat, 8 Jun 2019 09:34:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201906080934.x589Y2Cv080407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 8 Jun 2019 09:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348797 - head/lib/libusb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/lib/libusb X-SVN-Commit-Revision: 348797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B60482CC3 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.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: Sat, 08 Jun 2019 09:34:03 -0000 Author: hselasky Date: Sat Jun 8 09:34:02 2019 New Revision: 348797 URL: https://svnweb.freebsd.org/changeset/base/348797 Log: Fix for reading the configuration descriptor in libusb. Catch invalid configuration descriptor reads early on to avoid issues with devices that don't check for a valid USB configuration read request. Submitted by: takahiro.kurosawa@gmail.com PR: 238412 MFC after: 3 days Modified: head/lib/libusb/libusb20.c Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Sat Jun 8 08:25:43 2019 (r348796) +++ head/lib/libusb/libusb20.c Sat Jun 8 09:34:02 2019 (r348797) @@ -955,6 +955,14 @@ libusb20_dev_alloc_config(struct libusb20_device *pdev uint8_t do_close; int error; + /* + * Catch invalid configuration descriptor reads early on to + * avoid issues with devices that don't check for a valid USB + * configuration read request. + */ + if (configIndex >= pdev->ddesc.bNumConfigurations) + return (NULL); + if (!pdev->is_opened) { error = libusb20_dev_open(pdev, 0); if (error) { From owner-svn-src-head@freebsd.org Sat Jun 8 13:40:58 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 1A3BE15A85A5; Sat, 8 Jun 2019 13:40:58 +0000 (UTC) (envelope-from kib@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 AD3DA8B43D; Sat, 8 Jun 2019 13:40:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85D8E1C332; Sat, 8 Jun 2019 13:40:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58Devqw013601; Sat, 8 Jun 2019 13:40:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58DevdV013600; Sat, 8 Jun 2019 13:40:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906081340.x58DevdV013600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 13:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348798 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD3DA8B43D 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.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, 08 Jun 2019 13:40:58 -0000 Author: kib Date: Sat Jun 8 13:40:57 2019 New Revision: 348798 URL: https://svnweb.freebsd.org/changeset/base/348798 Log: amd64 trap.c: Modernize syntax around trap_msg[]. Convert the array to use C99 initializers. Make it constant. Replace MAX_TRAP_MSG with nitems(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jun 8 09:34:02 2019 (r348797) +++ head/sys/amd64/amd64/trap.c Sat Jun 8 13:40:57 2019 (r348798) @@ -118,41 +118,41 @@ static bool trap_user_dtrace(struct trapframe *, int (**hook)(struct trapframe *)); #endif -#define MAX_TRAP_MSG 32 -static char *trap_msg[] = { - "", /* 0 unused */ - "privileged instruction fault", /* 1 T_PRIVINFLT */ - "", /* 2 unused */ - "breakpoint instruction fault", /* 3 T_BPTFLT */ - "", /* 4 unused */ - "", /* 5 unused */ - "arithmetic trap", /* 6 T_ARITHTRAP */ - "", /* 7 unused */ - "", /* 8 unused */ - "general protection fault", /* 9 T_PROTFLT */ - "debug exception", /* 10 T_TRCTRAP */ - "", /* 11 unused */ - "page fault", /* 12 T_PAGEFLT */ - "", /* 13 unused */ - "alignment fault", /* 14 T_ALIGNFLT */ - "", /* 15 unused */ - "", /* 16 unused */ - "", /* 17 unused */ - "integer divide fault", /* 18 T_DIVIDE */ - "non-maskable interrupt trap", /* 19 T_NMI */ - "overflow trap", /* 20 T_OFLOW */ - "FPU bounds check fault", /* 21 T_BOUND */ - "FPU device not available", /* 22 T_DNA */ - "double fault", /* 23 T_DOUBLEFLT */ - "FPU operand fetch fault", /* 24 T_FPOPFLT */ - "invalid TSS fault", /* 25 T_TSSFLT */ - "segment not present fault", /* 26 T_SEGNPFLT */ - "stack fault", /* 27 T_STKFLT */ - "machine check trap", /* 28 T_MCHK */ - "SIMD floating-point exception", /* 29 T_XMMFLT */ - "reserved (unknown) fault", /* 30 T_RESERVED */ - "", /* 31 unused (reserved) */ - "DTrace pid return trap", /* 32 T_DTRACE_RET */ +static const char UNKNOWN[] = "unknown"; +static const char *trap_msg[] = { + [0] = UNKNOWN, /* unused */ + [T_PRIVINFLT] = "privileged instruction fault", + [2] = UNKNOWN, /* unused */ + [T_BPTFLT] = "breakpoint instruction fault", + [4] = UNKNOWN, /* unused */ + [5] = UNKNOWN, /* unused */ + [T_ARITHTRAP] = "arithmetic trap", + [7] = UNKNOWN, /* unused */ + [8] = UNKNOWN, /* unused */ + [T_PROTFLT] = "general protection fault", + [T_TRCTRAP] = "debug exception", + [11] = UNKNOWN, /* unused */ + [T_PAGEFLT] = "page fault", + [13] = UNKNOWN, /* unused */ + [T_ALIGNFLT] = "alignment fault", + [15] = UNKNOWN, /* unused */ + [16] = UNKNOWN, /* unused */ + [17] = UNKNOWN, /* unused */ + [T_DIVIDE] = "integer divide fault", + [T_NMI] = "non-maskable interrupt trap", + [T_OFLOW] = "overflow trap", + [T_BOUND] = "FPU bounds check fault", + [T_DNA] = "FPU device not available", + [T_DOUBLEFLT] = "double fault", + [T_FPOPFLT] = "FPU operand fetch fault", + [T_TSSFLT] = "invalid TSS fault", + [T_SEGNPFLT] = "segment not present fault", + [T_STKFLT] = "stack fault", + [T_MCHK] = "machine check trap", + [T_XMMFLT] = "SIMD floating-point exception", + [T_RESERVED] = "reserved (unknown) fault", + [31] = UNKNOWN, /* reserved */ + [T_DTRACE_RET] = "DTrace pid return trap", }; static int prot_fault_translation; @@ -879,7 +879,6 @@ trap_fatal(frame, eva) int code, ss; u_int type; struct soft_segment_descriptor softseg; - char *msg; #ifdef KDB bool handled; #endif @@ -889,11 +888,8 @@ trap_fatal(frame, eva) sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)], &softseg); - if (type <= MAX_TRAP_MSG) - msg = trap_msg[type]; - else - msg = "UNKNOWN"; - printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, + printf("\n\nFatal trap %d: %s while in %s mode\n", type, + type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN, TRAPF_USERMODE(frame) ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ @@ -944,10 +940,8 @@ trap_fatal(frame, eva) } #endif printf("trap number = %d\n", type); - if (type <= MAX_TRAP_MSG) - panic("%s", trap_msg[type]); - else - panic("unknown/reserved trap"); + panic("%s", type < nitems(trap_msg) ? trap_msg[type] : + "unknown/reserved trap"); } #ifdef KDTRACE_HOOKS From owner-svn-src-head@freebsd.org Sat Jun 8 13:41: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 DE52615A85FF; Sat, 8 Jun 2019 13:41:39 +0000 (UTC) (envelope-from kib@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 833438B721; Sat, 8 Jun 2019 13:41:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78FB81C46E; Sat, 8 Jun 2019 13:41:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58DfdhH014626; Sat, 8 Jun 2019 13:41:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58DfdPR014625; Sat, 8 Jun 2019 13:41:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906081341.x58DfdPR014625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 13:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348799 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 348799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 833438B721 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.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, 08 Jun 2019 13:41:40 -0000 Author: kib Date: Sat Jun 8 13:41:39 2019 New Revision: 348799 URL: https://svnweb.freebsd.org/changeset/base/348799 Log: i386 trap.c: Remove unused MAX_TRAP_MSG define. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Jun 8 13:40:57 2019 (r348798) +++ head/sys/i386/i386/trap.c Sat Jun 8 13:41:39 2019 (r348799) @@ -125,8 +125,6 @@ void dblfault_handler(void); extern inthand_t IDTVEC(bpt), IDTVEC(dbg), IDTVEC(int0x80_syscall); extern uint64_t pg_nx; -#define MAX_TRAP_MSG 32 - struct trap_data { bool ei; const char *msg; From owner-svn-src-head@freebsd.org Sat Jun 8 15:19: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 3D98A15AAC3B; Sat, 8 Jun 2019 15:19:52 +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 D76F58DF05; Sat, 8 Jun 2019 15:19:51 +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 B196D1D40F; Sat, 8 Jun 2019 15:19:51 +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 x58FJptR065108; Sat, 8 Jun 2019 15:19:51 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58FJp2N065106; Sat, 8 Jun 2019 15:19:51 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081519.x58FJp2N065106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 15:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348800 - in head/sys: cam dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: cam dev/sdhci X-SVN-Commit-Revision: 348800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D76F58DF05 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.97)[-0.967,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, 08 Jun 2019 15:19:52 -0000 Author: bz Date: Sat Jun 8 15:19:50 2019 New Revision: 348800 URL: https://svnweb.freebsd.org/changeset/base/348800 Log: Introduce sim_dev and cam_sim_alloc_dev(). Add cam_sim_alloc_dev() as a wrapper to cam_sim_alloc() which takes a device_t instead of the unit_number (which we can derive from the dev again). Add device_t sim_dev to struct cam_sim. It will be used to pass through the bus for cases when both sides of CAM speak newbus already and we want to link them (yet make the calls through CAM for now). SDIO will be the first consumer of this. For that make use of cam_sim_alloc_dev() in sdhci under MMCCAM. This will also allow people to start iterating more on the idea to newbus-ify CAM without changing 50+ device drivers from the start. Also to be clear there are callers to cam_sim_alloc() which do not have a device_t (e.g., XPT) or provide their own unit number so we cannot simply switch the KPI entirely. Submitted by: kibab (original idea, see https://reviews.freebsd.org/D12467) Reviewed by: imp, chuck MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19746 Modified: head/sys/cam/cam_sim.c head/sys/cam/cam_sim.h head/sys/dev/sdhci/sdhci.c Modified: head/sys/cam/cam_sim.c ============================================================================== --- head/sys/cam/cam_sim.c Sat Jun 8 13:41:39 2019 (r348799) +++ head/sys/cam/cam_sim.c Sat Jun 8 15:19:50 2019 (r348800) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -82,6 +83,7 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_fun sim->sim_name = sim_name; sim->softc = softc; sim->path_id = CAM_PATH_ANY; + sim->sim_dev = NULL; /* set only by cam_sim_alloc_dev */ sim->unit_number = unit; sim->bus_id = 0; /* set in xpt_bus_register */ sim->max_tagged_dev_openings = max_tagged_dev_transactions; @@ -97,6 +99,25 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_fun sim->flags |= CAM_SIM_MPSAFE; callout_init(&sim->callout, 1); } + return (sim); +} + +struct cam_sim * +cam_sim_alloc_dev(sim_action_func sim_action, sim_poll_func sim_poll, + const char *sim_name, void *softc, device_t dev, + struct mtx *mtx, int max_dev_transactions, + int max_tagged_dev_transactions, struct cam_devq *queue) +{ + struct cam_sim *sim; + + KASSERT(dev != NULL, ("%s: dev is null for sim_name %s softc %p\n", + __func__, sim_name, softc)); + + sim = cam_sim_alloc(sim_action, sim_poll, sim_name, softc, + device_get_unit(dev), mtx, max_dev_transactions, + max_tagged_dev_transactions, queue); + if (sim != NULL) + sim->sim_dev = dev; return (sim); } Modified: head/sys/cam/cam_sim.h ============================================================================== --- head/sys/cam/cam_sim.h Sat Jun 8 13:41:39 2019 (r348799) +++ head/sys/cam/cam_sim.h Sat Jun 8 15:19:50 2019 (r348800) @@ -62,6 +62,15 @@ struct cam_sim * cam_sim_alloc(sim_action_func sim_ac int max_dev_transactions, int max_tagged_dev_transactions, struct cam_devq *queue); +struct cam_sim * cam_sim_alloc_dev(sim_action_func sim_action, + sim_poll_func sim_poll, + const char *sim_name, + void *softc, + device_t dev, + struct mtx *mtx, + int max_dev_transactions, + int max_tagged_dev_transactions, + struct cam_devq *queue); void cam_sim_free(struct cam_sim *sim, int free_devq); void cam_sim_hold(struct cam_sim *sim); void cam_sim_release(struct cam_sim *sim); @@ -109,6 +118,7 @@ struct cam_sim { struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ + device_t sim_dev; /* For attached peripherals. */ }; #define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx) Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jun 8 13:41:39 2019 (r348799) +++ head/sys/dev/sdhci/sdhci.c Sat Jun 8 15:19:50 2019 (r348800) @@ -2513,8 +2513,8 @@ sdhci_start_slot(struct sdhci_slot *slot) goto fail; mtx_init(&slot->sim_mtx, "sdhcisim", NULL, MTX_DEF); - slot->sim = cam_sim_alloc(sdhci_cam_action, sdhci_cam_poll, - "sdhci_slot", slot, device_get_unit(slot->bus), + slot->sim = cam_sim_alloc_dev(sdhci_cam_action, sdhci_cam_poll, + "sdhci_slot", slot, slot->bus, &slot->sim_mtx, 1, 1, slot->devq); if (slot->sim == NULL) { From owner-svn-src-head@freebsd.org Sat Jun 8 15:24: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 65E4015AAFE9; Sat, 8 Jun 2019 15:24:04 +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 0CE5E8E41A; Sat, 8 Jun 2019 15:24:04 +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 DCF031D5BA; Sat, 8 Jun 2019 15:24:03 +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 x58FO3L3070328; Sat, 8 Jun 2019 15:24:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58FO3Sb070327; Sat, 8 Jun 2019 15:24:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081524.x58FO3Sb070327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 15:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348801 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 348801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CE5E8E41A 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.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: Sat, 08 Jun 2019 15:24:04 -0000 Author: bz Date: Sat Jun 8 15:24:03 2019 New Revision: 348801 URL: https://svnweb.freebsd.org/changeset/base/348801 Log: Improve sdhci slot_printf() debug printing. Currently slot_printf() uses two printf() calls to print the device-slot name, and actual message. When other printf()s are ongoing in parallel this can lead to interleaved message on the console, which is especially unhelpful for debugging or error messages. Take a hit on the stack and vsnprintf() the message to the buffer. This way it can be printed along with the device-slot name in one go avoiding console gibberish. Reviewed by: marius MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19747 Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jun 8 15:19:50 2019 (r348800) +++ head/sys/dev/sdhci/sdhci.c Sat Jun 8 15:24:03 2019 (r348801) @@ -185,15 +185,20 @@ sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int static int slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) { + char buf[128]; va_list ap; int retval; - retval = printf("%s-slot%d: ", - device_get_nameunit(slot->bus), slot->num); - + /* + * Make sure we print a single line all together rather than in two + * halves to avoid console gibberish bingo. + */ va_start(ap, fmt); - retval += vprintf(fmt, ap); + retval = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + + retval += printf("%s-slot%d: %s", + device_get_nameunit(slot->bus), slot->num, buf); return (retval); } From owner-svn-src-head@freebsd.org Sat Jun 8 16:03: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 1D6F715AC042; Sat, 8 Jun 2019 16:03:35 +0000 (UTC) (envelope-from kib@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 B58618F4D4; Sat, 8 Jun 2019 16:03:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9122A1DC63; Sat, 8 Jun 2019 16:03:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58G3Yu3093882; Sat, 8 Jun 2019 16:03:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58G3YRm093881; Sat, 8 Jun 2019 16:03:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906081603.x58G3YRm093881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 16:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348802 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B58618F4D4 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: Sat, 08 Jun 2019 16:03:35 -0000 Author: kib Date: Sat Jun 8 16:03:34 2019 New Revision: 348802 URL: https://svnweb.freebsd.org/changeset/base/348802 Log: Remove lazy FPU switch support from amd64. It is incompatible with some future features. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jun 8 15:24:03 2019 (r348801) +++ head/sys/amd64/amd64/fpu.c Sat Jun 8 16:03:34 2019 (r348802) @@ -154,11 +154,6 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); -int lazy_fpu_switch = 0; -SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, - &lazy_fpu_switch, 0, - "Lazily load FPU context after context switch"); - int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -269,7 +264,6 @@ fpuinit_bsp1(void) uint64_t xsave_mask_user; bool old_wp; - TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (!use_xsave) return; cpuid_count(0xd, 0x0, cp); @@ -774,8 +768,7 @@ void fpu_activate_sw(struct thread *td) { - if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || - !PCB_USER_FPU(td->td_pcb)) { + if ((td->td_pflags & TDP_KTHREAD) != 0 || !PCB_USER_FPU(td->td_pcb)) { PCPU_SET(fpcurthread, NULL); start_emulating(); } else if (PCPU_GET(fpcurthread) != td) { From owner-svn-src-head@freebsd.org Sat Jun 8 16:05: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 51CF115AC1D1; Sat, 8 Jun 2019 16:05:44 +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 EA5A78F709; Sat, 8 Jun 2019 16:05:43 +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 C70521DC66; Sat, 8 Jun 2019 16:05:43 +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 x58G5h8k094011; Sat, 8 Jun 2019 16:05:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58G5hKf094010; Sat, 8 Jun 2019 16:05:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081605.x58G5hKf094010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 16:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348803 - 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: 348803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA5A78F709 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.967,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, 08 Jun 2019 16:05:44 -0000 Author: bz Date: Sat Jun 8 16:05:43 2019 New Revision: 348803 URL: https://svnweb.freebsd.org/changeset/base/348803 Log: bcm2835_sdhci.c: save block registers to avoid controller bug Extending what the initial revision, r273264, r276985, r277346 have started for the transfer mode and command registers, another pair of 16bit registers written in sequence are block size and block count, which fall together onto the same 32bit line and hence the same register(s) would be written twice in sequence for those as well. Use a similar approach to transfer mode and command and save the writes to either of the block regiters and then only execute a write once. We can do this as with transfer mode their values are meaningless until a command is issued so we can use that write to command as a trigger to also write out the block registers. Compared to transfer mode and command the value of block count can change, so we need to keep state and actually read the block registers back the first time after a write. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20197 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 Sat Jun 8 16:03:34 2019 (r348802) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sat Jun 8 16:05:43 2019 (r348803) @@ -107,12 +107,14 @@ struct bcm_sdhci_softc { bus_dma_tag_t sc_dma_tag; bus_dmamap_t sc_dma_map; vm_paddr_t sc_sdhci_buffer_phys; - uint32_t cmd_and_mode; bus_addr_t dmamap_seg_addrs[NUM_DMA_SEGS]; bus_size_t dmamap_seg_sizes[NUM_DMA_SEGS]; int dmamap_seg_count; int dmamap_seg_index; int dmamap_status; + uint32_t blksz_and_count; + uint32_t cmd_and_mode; + bool need_update_blk; }; static int bcm_sdhci_probe(device_t); @@ -269,6 +271,10 @@ bcm_sdhci_attach(device_t dev) sdhci_start_slot(&sc->sc_slot); + /* Seed our copies. */ + sc->blksz_and_count = SDHCI_READ_4(dev, &sc->sc_slot, SDHCI_BLOCK_SIZE); + sc->cmd_and_mode = SDHCI_READ_4(dev, &sc->sc_slot, SDHCI_TRANSFER_MODE); + return (0); fail: @@ -338,17 +344,21 @@ static uint16_t bcm_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct bcm_sdhci_softc *sc = device_get_softc(dev); - uint32_t val = RD4(sc, off & ~3); + uint32_t val32; /* - * Standard 32-bit handling of command and transfer mode. + * Standard 32-bit handling of command and transfer mode, as + * well as block size and count. */ - if (off == SDHCI_TRANSFER_MODE) { - return (sc->cmd_and_mode >> 16); - } else if (off == SDHCI_COMMAND_FLAGS) { - return (sc->cmd_and_mode & 0x0000ffff); - } - return ((val >> (off & 3)*8) & 0xffff); + if ((off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) && + sc->need_update_blk) + val32 = sc->blksz_and_count; + else if (off == SDHCI_TRANSFER_MODE || off == SDHCI_COMMAND_FLAGS) + val32 = sc->cmd_and_mode; + else + val32 = RD4(sc, off & ~3); + + return ((val32 >> (off & 3)*8) & 0xffff); } static uint32_t @@ -383,18 +393,43 @@ bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slo { struct bcm_sdhci_softc *sc = device_get_softc(dev); uint32_t val32; - if (off == SDHCI_COMMAND_FLAGS) + + /* + * If we have a queued up 16bit value for blk size or count, use and + * update the saved value rather than doing any real register access. + * If we did not touch either since the last write, then read from + * register as at least block count can change. + * Similarly, if we are about to issue a command, always use the saved + * value for transfer mode as we can never write that without issuing + * a command. + */ + if ((off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) && + sc->need_update_blk) + val32 = sc->blksz_and_count; + else if (off == SDHCI_COMMAND_FLAGS) val32 = sc->cmd_and_mode; else val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3)*8); val32 |= (val << (off & 3)*8); + if (off == SDHCI_TRANSFER_MODE) sc->cmd_and_mode = val32; - else { - WR4(sc, off & ~3, val32); - if (off == SDHCI_COMMAND_FLAGS) + else if (off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) { + sc->blksz_and_count = val32; + sc->need_update_blk = true; + } else { + if (off == SDHCI_COMMAND_FLAGS) { + /* If we saved blk writes, do them now before cmd. */ + if (sc->need_update_blk) { + WR4(sc, SDHCI_BLOCK_SIZE, sc->blksz_and_count); + sc->need_update_blk = false; + } + /* Always save cmd and mode registers. */ sc->cmd_and_mode = val32; + } + WR4(sc, off & ~3, val32); } } From owner-svn-src-head@freebsd.org Sat Jun 8 16:15: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 78BBF15AC69D; Sat, 8 Jun 2019 16:15:01 +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 1DFD58FC3A; Sat, 8 Jun 2019 16:15:01 +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 D405D1DE28; Sat, 8 Jun 2019 16:15:00 +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 x58GF0eQ099188; Sat, 8 Jun 2019 16:15:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58GF0pV099187; Sat, 8 Jun 2019 16:15:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081615.x58GF0pV099187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 16:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348804 - 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: 348804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DFD58FC3A 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: Sat, 08 Jun 2019 16:15:01 -0000 Author: bz Date: Sat Jun 8 16:15:00 2019 New Revision: 348804 URL: https://svnweb.freebsd.org/changeset/base/348804 Log: bcm2835_sdhci.c: exit DMA if not enough data left to avoid timeout errors In the DMA case, given we disable the data interrupts, we never seem to get DATA_END. Given we are relying on DMA interrupts we are not using the SDHCI state machine and hence only call into sdhci_platform_will_handle() for the first check of data. We do not call "will handle" for any following round trips of the same transaction if block size * count > BCM_DMA_BLOCK_SIZE. Manually check "left" in the DMA interrupt handler to see if we have at least another full BCM_DMA_BLOCK_SIZE to handle. Without this change we would DMA that and then even start a DMA with left == 0 which would lead to a timeout and error. Now we re-enable data interrupts and return and let the SDHCI generic interrupt handler and state machine pick the SPACE_AVAIL up and then find that it should punt to the pio_handler for the remaining bytes or finish the data transaction. With this change block mode seems to work beyond 7 * 64byte blocks, which worked as it was below BCM_DMA_BLOCK_SIZE. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20199 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 Sat Jun 8 16:05:43 2019 (r348803) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sat Jun 8 16:15:00 2019 (r348804) @@ -539,6 +539,22 @@ bcm_sdhci_dma_intr(int ch, void *arg) left = min(BCM_SDHCI_BUFFER_SIZE, slot->curcmd->data->len - slot->offset); + /* + * If there is less than buffer size outstanding, we would not handle + * it anymore using DMA if bcm_sdhci_will_handle_transfer() were asked. + * Re-enable interrupts and return and let the SDHCI state machine + * finish the job. + */ + if (left < BCM_SDHCI_BUFFER_SIZE) { + /* Re-enable data interrupts. */ + slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | + SDHCI_INT_DATA_END; + bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, + slot->intmask); + mtx_unlock(&slot->mtx); + return; + } + /* DATA END? */ reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS); From owner-svn-src-head@freebsd.org Sat Jun 8 16:26:58 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 88EF415ACACC; Sat, 8 Jun 2019 16:26:58 +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 D63196847B; Sat, 8 Jun 2019 16:26:57 +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 B1ABC1E012; Sat, 8 Jun 2019 16:26:57 +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 x58GQvCZ004857; Sat, 8 Jun 2019 16:26:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58GQuKF004850; Sat, 8 Jun 2019 16:26:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081626.x58GQuKF004850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 16:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348805 - in head/sys: conf dev/sdio modules modules/sdio tools X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: conf dev/sdio modules modules/sdio tools X-SVN-Commit-Revision: 348805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D63196847B 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: Sat, 08 Jun 2019 16:26:58 -0000 Author: bz Date: Sat Jun 8 16:26:56 2019 New Revision: 348805 URL: https://svnweb.freebsd.org/changeset/base/348805 Log: Add SDIO support. Add a CAM-Newbus SDIO support module. This works provides a newbus infrastructure for device drivers wanting to use SDIO. On the lower end while it is connected by newbus to SDHCI, it talks CAM using the MMCCAM framework to get to it. This also duplicates the usbdevs framework to equally create sdiodev header files with #defines for "vendors" and "products". Submitted by: kibab (initial work, see https://reviews.freebsd.org/D12467) Reviewed by: kibab, imp (comments on earlier version) MFC after: 6 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19749 Added: head/sys/dev/sdio/ head/sys/dev/sdio/sdio_if.m (contents, props changed) head/sys/dev/sdio/sdio_subr.c (contents, props changed) head/sys/dev/sdio/sdio_subr.h (contents, props changed) head/sys/dev/sdio/sdiob.c (contents, props changed) head/sys/dev/sdio/sdiob.h (contents, props changed) head/sys/dev/sdio/sdiodevs (contents, props changed) head/sys/modules/sdio/ head/sys/modules/sdio/Makefile (contents, props changed) head/sys/tools/sdiodevs2h.awk (contents, props changed) Modified: head/sys/conf/files head/sys/conf/kmod.mk head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 8 16:15:00 2019 (r348804) +++ head/sys/conf/files Sat Jun 8 16:26:56 2019 (r348805) @@ -68,6 +68,16 @@ usbdevs_data.h optional usb \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ no-obj no-implicit-rule before-depend \ clean "usbdevs_data.h" +sdiodevs.h optional mmccam \ + dependency "$S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs" \ + compile-with "${AWK} -f $S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs -h" \ + no-obj no-implicit-rule before-depend \ + clean "sdiodevs.h" +sdiodevs_data.h optional mmccam \ + dependency "$S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs" \ + compile-with "${AWK} -f $S/tools/sdiodevs2h.awk $S/dev/sdio/sdiodevs -d" \ + no-obj no-implicit-rule before-depend \ + clean "sdiodevs_data.h" cam/cam.c optional scbus cam/cam_compat.c optional scbus cam/cam_iosched.c optional scbus @@ -3009,6 +3019,9 @@ dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci ++dev/sdio/sdio_if.m optional mmccam ++dev/sdio/sdio_subr.c optional mmccam ++dev/sdio/sdiob.c optional mmccam dev/sge/if_sge.c optional sge pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Jun 8 16:15:00 2019 (r348804) +++ head/sys/conf/kmod.mk Sat Jun 8 16:26:56 2019 (r348805) @@ -475,6 +475,18 @@ usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d .endif +.if !empty(SRCS:Msdiodevs.h) +CLEANFILES+= sdiodevs.h +sdiodevs.h: ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs + ${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -h +.endif + +.if !empty(SRCS:Msdiodevs_data.h) +CLEANFILES+= sdiodevs_data.h +sdiodevs_data.h: ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs + ${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -d +.endif + .if !empty(SRCS:Macpi_quirks.h) CLEANFILES+= acpi_quirks.h acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks Added: head/sys/dev/sdio/sdio_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdio/sdio_if.m Sat Jun 8 16:26:56 2019 (r348805) @@ -0,0 +1,79 @@ +#- +# Copyright (c) 2019 The FreeBSD Foundation +# +# Portions of this software were developed by Björn Zeeb +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include + +INTERFACE sdio; + +# +# READ DIRECT (1byte) +# +METHOD int read_direct { + device_t dev; + uint8_t fn; + uint32_t addr; + uint8_t *val; +}; + +# +# WRITE DIRECT (1byte) +# +METHOD int write_direct { + device_t dev; + uint8_t fn; + uint32_t addr; + uint8_t val; +}; + +# +# READ EXTENDED +# +METHOD int read_extended { + device_t dev; + uint8_t fn; + uint32_t addr; + uint32_t size; + uint8_t *buffer; + bool incaddr; +}; + +# +# WRITE EXTENDED +# +METHOD int write_extended { + device_t dev; + uint8_t fn; + uint32_t addr; + uint32_t size; + uint8_t *buffer; + bool incaddr; +}; + +# end Added: head/sys/dev/sdio/sdio_subr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdio/sdio_subr.c Sat Jun 8 16:26:56 2019 (r348805) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin. All rights reserved. + * Copyright (c) 2018-2019 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * + * Portions of this software may have been developed with reference to + * the SD Simplified Specification. The following disclaimer may apply: + * + * The following conditions apply to the release of the simplified + * specification ("Simplified Specification") by the SD Card Association and + * the SD Group. The Simplified Specification is a subset of the complete SD + * Specification which is owned by the SD Card Association and the SD + * Group. This Simplified Specification is provided on a non-confidential + * basis subject to the disclaimers below. Any implementation of the + * Simplified Specification may require a license from the SD Card + * Association, SD Group, SD-3C LLC or other third parties. + * + * Disclaimers: + * + * The information contained in the Simplified Specification is presented only + * as a standard specification for SD Cards and SD Host/Ancillary products and + * is provided "AS-IS" without any representations or warranties of any + * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD + * Card Association for any damages, any infringements of patents or other + * right of the SD Group, SD-3C LLC, the SD Card Association or any third + * parties, which may result from its use. No license is granted by + * implication, estoppel or otherwise under any patent or other rights of the + * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing + * herein shall be construed as an obligation by the SD Group, the SD-3C LLC + * or the SD Card Association to disclose or distribute any technical + * information, know-how or other confidential information to any third party. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "sdio_if.h" + +/* Works on F0. */ +static int +sdio_set_bool_for_func(device_t dev, uint32_t addr, uint8_t fn, bool enable) +{ + device_t pdev; + int error; + uint8_t val; + bool enabled; + + pdev = device_get_parent(dev); + error = SDIO_READ_DIRECT(pdev, 0, addr, &val); + if (error != 0) + return (error); + + enabled = (val & (1 << fn)) ? true : false; + if (enabled == enable) + return (0); + + if (enable) + val |= (1 << fn); + else + val &= ~(1 << fn); + error = SDIO_WRITE_DIRECT(pdev, 0, addr, val); + return (error); +} + +int +sdio_enable_func(struct sdio_func *f) +{ + + return (sdio_set_bool_for_func(f->dev, SD_IO_CCCR_FN_ENABLE, + f->fn, true)); +} + +int +sdio_disable_func(struct sdio_func *f) +{ + + return (sdio_set_bool_for_func(f->dev, SD_IO_CCCR_FN_ENABLE, + f->fn, false)); +} + +int +sdio_set_block_size(struct sdio_func *f, uint16_t bs) +{ + device_t pdev; + int error; + uint32_t addr; + uint16_t v; + + if (!sdio_get_support_multiblk(f->dev)) + return (EOPNOTSUPP); + + pdev = device_get_parent(f->dev); + addr = SD_IO_FBR_START * f->fn + SD_IO_FBR_IOBLKSZ; + v = htole16(bs); + /* Always write through F0. */ + error = SDIO_WRITE_DIRECT(pdev, 0, addr, v & 0xff); + if (error == 0) + error = SDIO_WRITE_DIRECT(pdev, 0, addr + 1, + (v >> 8) & 0xff); + if (error == 0) + f->cur_blksize = bs; + + return (error); +} + +uint8_t +sdio_readb(struct sdio_func *f, uint32_t addr, int *err) +{ + int error; + uint8_t v; + + error = SDIO_READ_DIRECT(device_get_parent(f->dev), f->fn, addr, &v); + if (error) { + if (err != NULL) + *err = error; + return (0xff); + } else { + if (err != NULL) + *err = 0; + return (v); + } +} + +void +sdio_writeb(struct sdio_func *f, uint8_t val, uint32_t addr, int *err) +{ + int error; + + error = SDIO_WRITE_DIRECT(device_get_parent(f->dev), f->fn, addr, val); + if (err != NULL) + *err = error; +} + +uint32_t +sdio_readl(struct sdio_func *f, uint32_t addr, int *err) +{ + int error; + uint32_t v; + + error = SDIO_READ_EXTENDED(device_get_parent(f->dev), f->fn, addr, + sizeof(v), (uint8_t *)&v, false); + if (error) { + if (err != NULL) + *err = error; + return (0xffffffff); + } else { + if (err != NULL) + *err = 0; + return (le32toh(v)); + } +} + +void +sdio_writel(struct sdio_func *f, uint32_t val, uint32_t addr, int *err) +{ + int error; + + error = SDIO_WRITE_EXTENDED(device_get_parent(f->dev), f->fn, addr, + sizeof(val), (uint8_t *)&val, false); + if (err != NULL) + *err = error; +} + +uint8_t +sdio_f0_readb(struct sdio_func *f, uint32_t addr, int *err) +{ + int error; + uint8_t v; + + error = SDIO_READ_DIRECT(device_get_parent(f->dev), 0, addr, &v); + if (error) { + if (err != NULL) + *err = error; + return (0xff); + } else { + if (err != NULL) + *err = 0; + return (v); + } +} + +void +sdio_f0_writeb(struct sdio_func *f, uint8_t val, uint32_t addr, int *err) +{ + int error; + + error = SDIO_WRITE_DIRECT(device_get_parent(f->dev), 0, addr, val); + if (err != NULL) + *err = error; +} + +/* end */ Added: head/sys/dev/sdio/sdio_subr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdio/sdio_subr.h Sat Jun 8 16:26:56 2019 (r348805) @@ -0,0 +1,107 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin. All rights reserved. + * Copyright (c) 2018-2019 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * + * Portions of this software may have been developed with reference to + * the SD Simplified Specification. The following disclaimer may apply: + * + * The following conditions apply to the release of the simplified + * specification ("Simplified Specification") by the SD Card Association and + * the SD Group. The Simplified Specification is a subset of the complete SD + * Specification which is owned by the SD Card Association and the SD + * Group. This Simplified Specification is provided on a non-confidential + * basis subject to the disclaimers below. Any implementation of the + * Simplified Specification may require a license from the SD Card + * Association, SD Group, SD-3C LLC or other third parties. + * + * Disclaimers: + * + * The information contained in the Simplified Specification is presented only + * as a standard specification for SD Cards and SD Host/Ancillary products and + * is provided "AS-IS" without any representations or warranties of any + * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD + * Card Association for any damages, any infringements of patents or other + * right of the SD Group, SD-3C LLC, the SD Card Association or any third + * parties, which may result from its use. No license is granted by + * implication, estoppel or otherwise under any patent or other rights of the + * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing + * herein shall be construed as an obligation by the SD Group, the SD-3C LLC + * or the SD Card Association to disclose or distribute any technical + * information, know-how or other confidential information to any third party. + * + * + * $FreeBSD$ + */ + +#ifndef _SDIO_SUBR_H_ +#define _SDIO_SUBR_H_ + +/* + * This file contains structures and functions to work with SDIO cards. + */ + +struct sdio_func { + device_t dev; /* The device to talk to CAM. */ + uintptr_t drvdata; /* Driver specific data. */ + + uint8_t fn; /* Function number. */ + + uint8_t class; /* Class of function. */ + uint16_t vendor; /* Manufacturer ID. */ + uint16_t device; /* Card ID. */ + + uint16_t max_blksize; /* Maximum block size of function. */ + uint16_t cur_blksize; /* Current block size of function. */ + + uint16_t retries; /* Retires for CAM operations. */ + uint32_t timeout; /* Timeout. */ +}; + +struct card_info { + struct sdio_func f[8]; + + /* Compared to R4 Number of I/O Functions we DO count F0 here. */ + uint8_t num_funcs; + + bool support_multiblk; /* Support Multiple Block Transfer */ +}; + +#ifdef _KERNEL +int sdio_enable_func(struct sdio_func *); +int sdio_disable_func(struct sdio_func *); +int sdio_set_block_size(struct sdio_func *, uint16_t); + +uint8_t sdio_readb(struct sdio_func *, uint32_t, int *); +void sdio_writeb(struct sdio_func *, uint8_t, uint32_t, int *); +uint32_t sdio_readl(struct sdio_func *, uint32_t, int *); +void sdio_writel(struct sdio_func *, uint32_t, uint32_t, int *); + +uint8_t sdio_f0_readb(struct sdio_func *, uint32_t, int *); +void sdio_f0_writeb(struct sdio_func *, uint8_t, uint32_t, int *); +#endif /* _KERNEL */ + +#endif /* _SDIO_SUBR_H_ */ Added: head/sys/dev/sdio/sdiob.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdio/sdiob.c Sat Jun 8 16:26:56 2019 (r348805) @@ -0,0 +1,1188 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin. All rights reserved. + * Copyright (c) 2018-2019 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * + * Portions of this software may have been developed with reference to + * the SD Simplified Specification. The following disclaimer may apply: + * + * The following conditions apply to the release of the simplified + * specification ("Simplified Specification") by the SD Card Association and + * the SD Group. The Simplified Specification is a subset of the complete SD + * Specification which is owned by the SD Card Association and the SD + * Group. This Simplified Specification is provided on a non-confidential + * basis subject to the disclaimers below. Any implementation of the + * Simplified Specification may require a license from the SD Card + * Association, SD Group, SD-3C LLC or other third parties. + * + * Disclaimers: + * + * The information contained in the Simplified Specification is presented only + * as a standard specification for SD Cards and SD Host/Ancillary products and + * is provided "AS-IS" without any representations or warranties of any + * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD + * Card Association for any damages, any infringements of patents or other + * right of the SD Group, SD-3C LLC, the SD Card Association or any third + * parties, which may result from its use. No license is granted by + * implication, estoppel or otherwise under any patent or other rights of the + * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing + * herein shall be construed as an obligation by the SD Group, the SD-3C LLC + * or the SD Card Association to disclose or distribute any technical + * information, know-how or other confidential information to any third party. + */ +/* + * Implements the (kernel specific) SDIO parts. + * This will hide all cam(4) functionality from the SDIO driver implementations + * which will just be newbus/device(9) and hence look like any other driver for, + * e.g., PCI. + * The sdiob(4) parts effetively "translate" between the two worlds "bridging" + * messages from MMCCAM to newbus and back. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_cam.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include /* for cam_path */ +#include + +#include + +#include +#include + +#include "sdio_if.h" + +#ifdef DEBUG +#define DPRINTF(...) printf(__VA_ARGS__) +#define DPRINTFDEV(_dev, ...) device_printf((_dev), __VA_ARGS__) +#else +#define DPRINTF(...) +#define DPRINTFDEV(_dev, ...) +#endif + +struct sdiob_softc { + uint32_t sdio_state; +#define SDIO_STATE_DEAD 0x0001 +#define SDIO_STATE_INITIALIZING 0x0002 +#define SDIO_STATE_READY 0x0004 + uint32_t nb_state; +#define NB_STATE_DEAD 0x0001 +#define NB_STATE_SIM_ADDED 0x0002 +#define NB_STATE_READY 0x0004 + + /* CAM side (including sim_dev). */ + struct card_info cardinfo; + struct cam_periph *periph; + union ccb *ccb; + struct task discover_task; + + /* Newbus side. */ + device_t dev; /* Ourselves. */ + device_t child[8]; +}; + +/* -------------------------------------------------------------------------- */ +/* + * SDIO CMD52 and CM53 implementations along with wrapper functions for + * read/write and a CAM periph helper function. + * These are the backend implementations of the sdio_if.m framework talking + * through CAM to sdhci. + * Note: these functions are also called during early discovery stage when + * we are not a device(9) yet. Hence they cannot always use device_printf() + * to log errors and have to call CAM_DEBUG() during these early stages. + */ + +static int +sdioerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) +{ + + return (cam_periph_error(ccb, cam_flags, sense_flags)); +} + +/* CMD52: direct byte access. */ +static int +sdiob_rw_direct_sc(struct sdiob_softc *sc, uint8_t fn, uint32_t addr, bool wr, + uint8_t *val) +{ + uint32_t arg, flags; + int error; + + KASSERT((val != NULL), ("%s val passed as NULL\n", __func__)); + + if (sc->ccb == NULL) + sc->ccb = xpt_alloc_ccb(); + else + memset(sc->ccb, 0, sizeof(*sc->ccb)); + xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, CAM_PRIORITY_NONE); + CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("%s(fn=%d, addr=%#02x, wr=%d, *val=%#02x)\n", __func__, + fn, addr, wr, *val)); + + flags = MMC_RSP_R5 | MMC_CMD_AC; + arg = SD_IO_RW_FUNC(fn) | SD_IO_RW_ADR(addr); + if (wr) + arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(*val); + + cam_fill_mmcio(&sc->ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ CAM_DIR_NONE, + /*mmc_opcode*/ SD_IO_RW_DIRECT, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ 0, + /*timeout*/ sc->cardinfo.f[fn].timeout); + error = cam_periph_runccb(sc->ccb, sdioerror, CAM_FLAG_NONE, 0, NULL); + if (error != 0) { + if (sc->dev != NULL) + device_printf(sc->dev, + "%s: Failed to %s address %#10x error=%d\n", + __func__, (wr) ? "write" : "read", addr, error); + else + CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_INFO, + ("%s: Failed to %s address: %#10x error=%d\n", + __func__, (wr) ? "write" : "read", addr, error)); + return (error); + } + + /* TODO: Add handling of MMC errors */ + /* ccb->mmcio.cmd.error ? */ + if (wr == false) + *val = sc->ccb->mmcio.cmd.resp[0] & 0xff; + + return (0); +} + +static int +sdio_rw_direct(device_t dev, uint8_t fn, uint32_t addr, bool wr, + uint8_t *val) +{ + struct sdiob_softc *sc; + int error; + + sc = device_get_softc(dev); + cam_periph_lock(sc->periph); + error = sdiob_rw_direct_sc(sc, fn, addr, wr, val); + cam_periph_unlock(sc->periph); + return (error); +} + +static int +sdiob_read_direct(device_t dev, uint8_t fn, uint32_t addr, uint8_t *val) +{ + int error; + uint8_t v; + + error = sdio_rw_direct(dev, fn, addr, false, &v); + /* Be polite and do not touch the value on read error. */ + if (error == 0 && val != NULL) + *val = v; + return (error); +} + +static int +sdiob_write_direct(device_t dev, uint8_t fn, uint32_t addr, uint8_t val) +{ + + return (sdio_rw_direct(dev, fn, addr, true, &val)); +} + +/* + * CMD53: IO_RW_EXTENDED, read and write multiple I/O registers. + * Increment false gets FIFO mode (single register address). + */ +/* + * A b_count of 0 means byte mode, b_count > 0 gets block mode. + * A b_count of >= 512 would mean infinitive block transfer, which would become + * b_count = 0, is not yet supported. + * For b_count == 0, blksz is the len of bytes, otherwise it is the amount of + * full sized blocks (you must not round the blocks up and leave the last one + * partial!) + * For byte mode, the maximum of blksz is the functions cur_blksize. + * This function should ever only be called by sdio_rw_extended_sc()! + */ +static int +sdiob_rw_extended_cam(struct sdiob_softc *sc, uint8_t fn, uint32_t addr, + bool wr, uint8_t *buffer, bool incaddr, uint32_t b_count, uint16_t blksz) +{ + struct mmc_data mmcd; + uint32_t arg, cam_flags, flags, len; + int error; + + if (sc->ccb == NULL) + sc->ccb = xpt_alloc_ccb(); + else + memset(sc->ccb, 0, sizeof(*sc->ccb)); + xpt_setup_ccb(&sc->ccb->ccb_h, sc->periph->path, CAM_PRIORITY_NONE); + CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("%s(fn=%d addr=%#0x wr=%d b_count=%u blksz=%u buf=%p incr=%d)\n", + __func__, fn, addr, wr, b_count, blksz, buffer, incaddr)); + + KASSERT((b_count <= 511), ("%s: infinitive block transfer not yet " + "supported: b_count %u blksz %u, sc %p, fn %u, addr %#10x, %s, " + "buffer %p, %s\n", __func__, b_count, blksz, sc, fn, addr, + wr ? "wr" : "rd", buffer, incaddr ? "incaddr" : "fifo")); + /* Blksz needs to be within bounds for both byte and block mode! */ + KASSERT((blksz <= sc->cardinfo.f[fn].cur_blksize), ("%s: blksz " + "%u > bur_blksize %u, sc %p, fn %u, addr %#10x, %s, " + "buffer %p, %s, b_count %u\n", __func__, blksz, + sc->cardinfo.f[fn].cur_blksize, sc, fn, addr, + wr ? "wr" : "rd", buffer, incaddr ? "incaddr" : "fifo", + b_count)); + if (b_count == 0) { + /* Byte mode */ + len = blksz; + if (blksz == 512) + blksz = 0; + arg = SD_IOE_RW_LEN(blksz); + } else { + /* Block mode. */ +#ifdef __notyet__ + if (b_count > 511) { + /* Infinitive block transfer. */ + b_count = 0; + } +#endif + len = b_count * blksz; + arg = SD_IOE_RW_BLK | SD_IOE_RW_LEN(b_count); + } + + flags = MMC_RSP_R5 | MMC_CMD_ADTC; + arg |= SD_IOE_RW_FUNC(fn) | SD_IOE_RW_ADR(addr); + if (incaddr) + arg |= SD_IOE_RW_INCR; + + memset(&mmcd, 0, sizeof(mmcd)); + mmcd.data = buffer; + mmcd.len = len; + if (arg & SD_IOE_RW_BLK) { + /* XXX both should be known from elsewhere, aren't they? */ + mmcd.block_size = blksz; + mmcd.block_count = b_count; + } + + if (wr) { + arg |= SD_IOE_RW_WR; + cam_flags = CAM_DIR_OUT; + mmcd.flags = MMC_DATA_WRITE; + } else { + cam_flags = CAM_DIR_IN; + mmcd.flags = MMC_DATA_READ; + } +#ifdef __notyet__ + if (b_count == 0) { + /* XXX-BZ TODO FIXME. Cancel I/O: CCCR -> ASx */ + /* Stop cmd. */ + } +#endif + cam_fill_mmcio(&sc->ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ cam_flags, + /*mmc_opcode*/ SD_IO_RW_EXTENDED, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ &mmcd, + /*timeout*/ sc->cardinfo.f[fn].timeout); + if (arg & SD_IOE_RW_BLK) { + mmcd.flags |= MMC_DATA_BLOCK_SIZE; + if (b_count != 1) + sc->ccb->mmcio.cmd.data->flags |= MMC_DATA_MULTI; + } + + /* Execute. */ + error = cam_periph_runccb(sc->ccb, sdioerror, CAM_FLAG_NONE, 0, NULL); + if (error != 0) { + if (sc->dev != NULL) + device_printf(sc->dev, + "%s: Failed to %s address %#10x buffer %p size %u " + "%s b_count %u blksz %u error=%d\n", + __func__, (wr) ? "write to" : "read from", addr, + buffer, len, (incaddr) ? "incr" : "fifo", + b_count, blksz, error); + else + CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_INFO, + ("%s: Failed to %s address %#10x buffer %p size %u " + "%s b_count %u blksz %u error=%d\n", + __func__, (wr) ? "write to" : "read from", addr, + buffer, len, (incaddr) ? "incr" : "fifo", + b_count, blksz, error)); + return (error); + } + + /* TODO: Add handling of MMC errors */ + /* ccb->mmcio.cmd.error ? */ + error = sc->ccb->mmcio.cmd.resp[0] & 0xff; + if (error != 0) { + if (sc->dev != NULL) + device_printf(sc->dev, + "%s: Failed to %s address %#10x buffer %p size %u " + "%s b_count %u blksz %u mmcio resp error=%d\n", + __func__, (wr) ? "write to" : "read from", addr, + buffer, len, (incaddr) ? "incr" : "fifo", + b_count, blksz, error); + else + CAM_DEBUG(sc->ccb->ccb_h.path, CAM_DEBUG_INFO, + ("%s: Failed to %s address %#10x buffer %p size %u " + "%s b_count %u blksz %u mmcio resp error=%d\n", + __func__, (wr) ? "write to" : "read from", addr, + buffer, len, (incaddr) ? "incr" : "fifo", + b_count, blksz, error)); + } + return (error); +} + +static int +sdiob_rw_extended_sc(struct sdiob_softc *sc, uint8_t fn, uint32_t addr, + bool wr, uint32_t size, uint8_t *buffer, bool incaddr) +{ + int error; + uint32_t len; + uint32_t b_count; + + /* + * If block mode is supported and we have at least 4 bytes to write and + * the size is at least one block, then start doing blk transfers. + */ + while (sc->cardinfo.support_multiblk && + size > 4 && size >= sc->cardinfo.f[fn].cur_blksize) { + + b_count = size / sc->cardinfo.f[fn].cur_blksize; + KASSERT(b_count >= 1, ("%s: block count too small %u size %u " + "cur_blksize %u\n", __func__, b_count, size, + sc->cardinfo.f[fn].cur_blksize)); + +#ifdef __notyet__ + /* XXX support inifinite transfer with b_count = 0. */ +#else + if (b_count > 511) + b_count = 511; +#endif + len = b_count * sc->cardinfo.f[fn].cur_blksize; + error = sdiob_rw_extended_cam(sc, fn, addr, wr, buffer, incaddr, + b_count, sc->cardinfo.f[fn].cur_blksize); + if (error != 0) + return (error); + + size -= len; + buffer += len; + if (incaddr) + addr += len; + } + + while (size > 0) { + len = MIN(size, sc->cardinfo.f[fn].cur_blksize); + + error = sdiob_rw_extended_cam(sc, fn, addr, wr, buffer, incaddr, + 0, len); + if (error != 0) + return (error); + + /* Prepare for next iteration. */ + size -= len; + buffer += len; + if (incaddr) + addr += len; + } + + return (0); +} + +static int +sdiob_rw_extended(device_t dev, uint8_t fn, uint32_t addr, bool wr, + uint32_t size, uint8_t *buffer, bool incaddr) +{ + struct sdiob_softc *sc; + int error; + + sc = device_get_softc(dev); + cam_periph_lock(sc->periph); + error = sdiob_rw_extended_sc(sc, fn, addr, wr, size, buffer, incaddr); + cam_periph_unlock(sc->periph); + return (error); +} + +static int +sdiob_read_extended(device_t dev, uint8_t fn, uint32_t addr, uint32_t size, + uint8_t *buffer, bool incaddr) +{ + + return (sdiob_rw_extended(dev, fn, addr, false, size, buffer, incaddr)); +} + +static int +sdiob_write_extended(device_t dev, uint8_t fn, uint32_t addr, uint32_t size, + uint8_t *buffer, bool incaddr) +{ + + return (sdiob_rw_extended(dev, fn, addr, true, size, buffer, incaddr)); +} + +/* -------------------------------------------------------------------------- */ +/* Bus interface, ivars handling. */ + +static int +sdiob_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct sdiob_softc *sc; + struct sdio_func *f; + + f = device_get_ivars(child); + KASSERT(f != NULL, ("%s: dev %p child %p which %d, child ivars NULL\n", + __func__, dev, child, which)); + + switch (which) { + case SDIOB_IVAR_SUPPORT_MULTIBLK: + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("%s: dev %p child %p which %d, sc NULL\n", + __func__, dev, child, which)); + *result = sc->cardinfo.support_multiblk; + break; + case SDIOB_IVAR_FUNCTION: + *result = (uintptr_t)f; + break; + case SDIOB_IVAR_FUNCNUM: + *result = f->fn; + break; + case SDIOB_IVAR_CLASS: + *result = f->class; + break; + case SDIOB_IVAR_VENDOR: + *result = f->vendor; + break; + case SDIOB_IVAR_DEVICE: + *result = f->device; + break; + case SDIOB_IVAR_DRVDATA: + *result = f->drvdata; + break; + default: + return (ENOENT); + } + return (0); +} + +static int +sdiob_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct sdio_func *f; + + f = device_get_ivars(child); + KASSERT(f != NULL, ("%s: dev %p child %p which %d, child ivars NULL\n", + __func__, dev, child, which)); + + switch (which) { + case SDIOB_IVAR_SUPPORT_MULTIBLK: + case SDIOB_IVAR_FUNCTION: + case SDIOB_IVAR_FUNCNUM: + case SDIOB_IVAR_CLASS: + case SDIOB_IVAR_VENDOR: + case SDIOB_IVAR_DEVICE: + return (EINVAL); /* Disallowed. */ + case SDIOB_IVAR_DRVDATA: + f->drvdata = value; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jun 8 17:10: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 29C1115ADE2D for ; Sat, 8 Jun 2019 17:10:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (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 BC1CE6AE05 for ; Sat, 8 Jun 2019 17:10:46 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82a.google.com with SMTP id j19so5994481qtr.12 for ; Sat, 08 Jun 2019 10:10:46 -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=7m0CRoHYsrmszx9vNJKAkk4u+24PA1LA4VtcppekxXc=; b=ekv0LwBzXqwapr8EM+aa6Co08khz6+3fSEhc1uHwp7umEOq7Yq0Ki1Gv+z1uRdzlWD rdkTK+lvLVnSEvx6oAKqM9KIc/zSpSPnrp30+Xn1pdT6TX0Da/vCpQrnLqo8dTN1y/ih Sis3DrjhQuNYyjjkVVUUYxtFCA/JyZD0PqGl4BvkH9wLPTXN3kDvfPy0qzjYpJKk8kjJ ml8I+2ywXrMM1NhWYi0oRWD1h80/RrbfeAVkcfKOAIN3Euf08hGzZC3YxMQ3enNB8Yt7 H9lO9B8RRd1OrRVXmVJwbr9cRiR8Yrerhty2C61uxMjkEzJd/PSzTSyVJSH1LBdiN9hV 9TCA== 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=7m0CRoHYsrmszx9vNJKAkk4u+24PA1LA4VtcppekxXc=; b=SUnw9S668tRTMY72Du4V54d3BEEWrCHYYXGll+wuFhCNOUSs1TwJlFw5XgZVPWrDoX 6CEO3iw3OTDdGWWgJ2TD+ux5jPNVaWmwqoyYvOrCTtXCw4BGU0RQE+1hVRMqcRKT9S4B ju0KJ/yMKbdLWXa042l6Jf2bJPFZTT3VhrzOvy7J2tsm1lzgZdxjIB9eEbrR3UduKSqf zSBrMYtJn2K7+c1lTV0aW4MbbXUYVOFdsS1sW3UwLc/bQGTZIj1h5638++7iZd8Ta1cW OFoejYKLuHKlDBgodDMzowLY4RSSB/Q/yj96hSTzf1tNnZ34o1P1nEXMIvowrOc+gxEJ zatw== X-Gm-Message-State: APjAAAU1Ey19+hEYI6ea/8X2BAvudzkjt0f3ELHNx2HwmXNt9pPAhdss hIhuqtho8knUswjvzPaxFYx3kg== X-Google-Smtp-Source: APXvYqxdLB8mUULDSZf2X+7TWW1OpY9ZO6hBroaSB2u+fy3rGO4Jbm9cZPQtgn7/HiR7ZDWwA1yN4Q== X-Received: by 2002:ac8:17c8:: with SMTP id r8mr52301869qtk.319.1560013845873; Sat, 08 Jun 2019 10:10:45 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id o66sm685179qkb.90.2019.06.08.10.10.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 08 Jun 2019 10:10:44 -0700 (PDT) Date: Sat, 8 Jun 2019 13:10:44 -0400 From: Shawn Webb To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348802 - head/sys/amd64/amd64 Message-ID: <20190608171044.x6hbrehjfpsomwcb@mutt-hbsd> References: <201906081603.x58G3YRm093881@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3ewdu6l2ftrqrwkr" Content-Disposition: inline In-Reply-To: <201906081603.x58G3YRm093881@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: BC1CE6AE05 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.995,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: Sat, 08 Jun 2019 17:10:47 -0000 --3ewdu6l2ftrqrwkr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 08, 2019 at 04:03:34PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 8 16:03:34 2019 > New Revision: 348802 > URL: https://svnweb.freebsd.org/changeset/base/348802 >=20 > Log: > Remove lazy FPU switch support from amd64. > =20 > It is incompatible with some future features. Hey Kostik, Great work! I'm curious what those future features could be. Can you elaborate a little more? :) 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 --3ewdu6l2ftrqrwkr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAlz77A8ACgkQ/y5nonf4 4fokiA//QFYDxsoj67XuXhtT1hSJEFh3S4MrghMPI8PB8emwDvx9o3yzSXbh5kBJ FK5zGfqaJhN4tmgs/m9fmo7sQqzZL4ThKHCHYABluBzsNTQKnrF8I1Q1P8xBIlmq 5mJXFMHFHwNmpbS/DrQEisyJEW+9nHGfTY+u3vjDnNHOqUlPnhJajsf6xB98CoR3 fIL5bjJP+d5CGdd0IsRGfgq1u9rZpicsxvcewRffld7bLhFbHzvdHLfh3gagDAbq sR6JM7uiE2pTF4AcABVSgH4RhZuTHsm7GFNxAsJPaqVowWlxL/zqMIwKyYFckPvD oTNywdINe8BbziyqNSYdkQyGduT3vE8lEcvAgCgaR122Vg+cU30mrQlKvy+7ypj/ W70tx/j0UAfzH83QlKv4QbJliIvtKODt7/fzZzz45hylMcOK+BY9h0a7QSX9EHPc 4hPNFjnLpu+gp5Ep7ry7CgcH4rUF+KUXEt1oQxD31Z3KeNXXmpFrjJD9cjU0ivK5 N7yT9tv9U8vJboiii1S6Q5uBSvgZPMjUeUFDmNN7VOVrbw/Qo3rrblKoxhLYlMoC 7lXmStdBCkIN65n99Iz9VWsfSd5vFI/JzLs1c1TYIVLVh7rgEwEnQW/fI6pgQagL /O2Fh1oivToUjTQtqTYJsfvvwB3Y0+jzfi4h3obh57XWyiUL2jI= =U4LP -----END PGP SIGNATURE----- --3ewdu6l2ftrqrwkr-- From owner-svn-src-head@freebsd.org Sat Jun 8 17:17: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 A09FB15AE0B1; Sat, 8 Jun 2019 17:17:18 +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 428196B1FF; Sat, 8 Jun 2019 17:17:18 +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 17DFA1E8A0; Sat, 8 Jun 2019 17:17:18 +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 x58HHHRF031099; Sat, 8 Jun 2019 17:17:17 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58HHHST031098; Sat, 8 Jun 2019 17:17:17 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201906081717.x58HHHST031098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 8 Jun 2019 17:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348806 - 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: 348806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 428196B1FF 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.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: Sat, 08 Jun 2019 17:17:19 -0000 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 Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Sat Jun 8 16:26:56 2019 (r348805) +++ head/usr.sbin/camdd/camdd.c Sat Jun 8 17:17:17 2019 (r348806) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -463,6 +464,9 @@ int camdd_probe_tape(int fd, char *filename, uint64_t int camdd_probe_pass_scsi(struct cam_device *cam_dev, union ccb *ccb, camdd_argmask arglist, int probe_retry_count, int probe_timeout, uint64_t *maxsector, uint32_t *block_len); +int camdd_probe_pass_nvme(struct cam_device *cam_dev, union ccb *ccb, + camdd_argmask arglist, int probe_retry_count, + int probe_timeout, uint64_t *maxsector, uint32_t *block_len); struct camdd_dev *camdd_probe_file(int fd, struct camdd_io_opts *io_opts, int retry_count, int timeout); struct camdd_dev *camdd_probe_pass(struct cam_device *cam_dev, @@ -470,6 +474,11 @@ struct camdd_dev *camdd_probe_pass(struct cam_device * camdd_argmask arglist, int probe_retry_count, int probe_timeout, int io_retry_count, int io_timeout); +void nvme_read_write(struct ccb_nvmeio *nvmeio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint32_t nsid, int readop, uint64_t lba, + uint32_t block_count, uint8_t *data_ptr, uint32_t dxfer_len, + uint32_t timeout); void *camdd_file_worker(void *arg); camdd_buf_status camdd_ccb_status(union ccb *ccb, int protocol); int camdd_get_cgd(struct cam_device *device, struct ccb_getdev *cgd); @@ -1379,6 +1388,72 @@ bailout: return retval; } +int +camdd_probe_pass_nvme(struct cam_device *cam_dev, union ccb *ccb, + camdd_argmask arglist, int probe_retry_count, + int probe_timeout, uint64_t *maxsector, uint32_t *block_len) +{ + struct nvme_command *nc = NULL; + struct nvme_namespace_data nsdata; + uint32_t nsid = cam_dev->target_lun & UINT32_MAX; + uint8_t format = 0, lbads = 0; + int retval = -1; + + if (ccb == NULL) { + warnx("%s: error passed ccb is NULL", __func__); + goto bailout; + } + + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->nvmeio); + + /* Send Identify Namespace to get block size and capacity */ + nc = &ccb->nvmeio.cmd; + nc->opc = NVME_OPC_IDENTIFY; + + nc->nsid = nsid; + nc->cdw10 = 0; /* Identify Namespace is CNS = 0 */ + + cam_fill_nvmeadmin(&ccb->nvmeio, + /*retries*/ probe_retry_count, + /*cbfcnp*/ NULL, + CAM_DIR_IN, + (uint8_t *)&nsdata, + sizeof(nsdata), + probe_timeout); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + if (arglist & CAMDD_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + if (cam_send_ccb(cam_dev, ccb) < 0) { + warn("error sending Identify Namespace command"); + + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + goto bailout; + } + + *maxsector = nsdata.nsze; + /* The LBA Data Size (LBADS) is reported as a power of 2 */ + format = nsdata.flbas & NVME_NS_DATA_FLBAS_FORMAT_MASK; + lbads = (nsdata.lbaf[format] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & + NVME_NS_DATA_LBAF_LBADS_MASK; + *block_len = 1 << lbads; + + retval = 0; + +bailout: + return retval; +} + /* * Need to implement this. Do a basic probe: * - Check the inquiry data, make sure we're talking to a device that we @@ -1442,6 +1517,13 @@ camdd_probe_pass(struct cam_device *cam_dev, struct ca goto bailout; } break; + case PROTO_NVME: + if ((retval = camdd_probe_pass_nvme(cam_dev, ccb, probe_retry_count, + arglist, probe_timeout, &maxsector, + &block_len))) { + goto bailout; + } + break; default: errx(1, "Unsupported PROTO type %d", cgd.protocol); break; /*NOTREACHED*/ @@ -1576,6 +1658,34 @@ bailout_error: return (NULL); } +void +nvme_read_write(struct ccb_nvmeio *nvmeio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint32_t nsid, int readop, uint64_t lba, + uint32_t block_count, uint8_t *data_ptr, uint32_t dxfer_len, + uint32_t timeout) +{ + struct nvme_command *nc = &nvmeio->cmd; + + nc->opc = readop ? NVME_OPC_READ : NVME_OPC_WRITE; + + nc->nsid = nsid; + + nc->cdw10 = lba & UINT32_MAX; + nc->cdw11 = lba >> 32; + + /* NLB (bits 15:0) is a zero based value */ + nc->cdw12 = (block_count - 1) & UINT16_MAX; + + cam_fill_nvmeio(nvmeio, + retries, + cbfcnp, + readop ? CAM_DIR_IN : CAM_DIR_OUT, + data_ptr, + dxfer_len, + timeout); +} + void * camdd_worker(void *arg) { @@ -1831,6 +1941,16 @@ camdd_ccb_status(union ccb *ccb, int protocol) break; } break; + case PROTO_NVME: + switch (ccb_status) { + case CAM_REQ_CMP: + status = CAMDD_STATUS_OK; + break; + default: + status = CAMDD_STATUS_ERROR; + break; + } + break; default: status = CAMDD_STATUS_ERROR; break; @@ -2233,6 +2353,10 @@ camdd_pass_fetch(struct camdd_dev *dev) data->resid = ccb.csio.resid; dev->bytes_transferred += (ccb.csio.dxfer_len - ccb.csio.resid); break; + case PROTO_NVME: + data->resid = 0; + dev->bytes_transferred += ccb.nvmeio.dxfer_len; + break; default: return -1; break; @@ -2554,6 +2678,23 @@ camdd_pass_run(struct camdd_dev *dev) if (data->sg_count != 0) { ccb->csio.sglist_cnt = data->sg_count; } + break; + case PROTO_NVME: + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->nvmeio); + + nvme_read_write(&ccb->nvmeio, + /*retries*/ dev->retry_count, + /*cbfcnp*/ NULL, + /*nsid*/ pass_dev->dev->target_lun & UINT32_MAX, + /*readop*/ dev->write_dev == 0, + /*lba*/ buf->lba, + /*block_count*/ num_blocks, + /*data_ptr*/ (data->sg_count != 0) ? + (uint8_t *)data->segs : data->buf, + /*dxfer_len*/ (num_blocks * pass_dev->block_len), + /*timeout*/ dev->io_timeout); + + ccb->nvmeio.sglist_cnt = data->sg_count; break; default: retval = -1; From owner-svn-src-head@freebsd.org Sat Jun 8 17:38: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 C76C215AE6E8; Sat, 8 Jun 2019 17:38:28 +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 6953F6BA65; Sat, 8 Jun 2019 17:38:28 +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 3F2521EC41; Sat, 8 Jun 2019 17:38:28 +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 x58HcRfp041043; Sat, 8 Jun 2019 17:38:27 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58HcRxE041042; Sat, 8 Jun 2019 17:38:27 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081738.x58HcRxE041042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 17:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348807 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 348807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6953F6BA65 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: Sat, 08 Jun 2019 17:38:29 -0000 Author: bz Date: Sat Jun 8 17:38:27 2019 New Revision: 348807 URL: https://svnweb.freebsd.org/changeset/base/348807 Log: Remove extra stray + from a diff from the beginning of the lines after r348805 to fix the build. Please do not ask how 3 more local builds succeeded without barfing. Pointyhat to: bz MFC after: 6 weeks X-MFC with: r348805 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 8 17:17:17 2019 (r348806) +++ head/sys/conf/files Sat Jun 8 17:38:27 2019 (r348807) @@ -3019,9 +3019,9 @@ dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci -+dev/sdio/sdio_if.m optional mmccam -+dev/sdio/sdio_subr.c optional mmccam -+dev/sdio/sdiob.c optional mmccam +dev/sdio/sdio_if.m optional mmccam +dev/sdio/sdio_subr.c optional mmccam +dev/sdio/sdiob.c optional mmccam dev/sge/if_sge.c optional sge pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci From owner-svn-src-head@freebsd.org Sat Jun 8 17:44: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 7369A15AE950; Sat, 8 Jun 2019 17:44:44 +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 19F406BEAF; Sat, 8 Jun 2019 17:44:44 +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 E9A821EDFF; Sat, 8 Jun 2019 17:44:43 +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 x58HihgV046311; Sat, 8 Jun 2019 17:44:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58HigVH046303; Sat, 8 Jun 2019 17:44:42 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906081744.x58HigVH046303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Jun 2019 17:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348808 - in head: . sys/conf sys/kern sys/netinet sys/sys X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: . sys/conf sys/kern sys/netinet sys/sys X-SVN-Commit-Revision: 348808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19F406BEAF 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.98)[-0.975,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, 08 Jun 2019 17:44:44 -0000 Author: bz Date: Sat Jun 8 17:44:42 2019 New Revision: 348808 URL: https://svnweb.freebsd.org/changeset/base/348808 Log: Fix dpcpu and vnet panics with complex types at the end of the section. Apply a linker script when linking i386 kernel modules to apply padding to a set_pcpu or set_vnet section. The padding value is kind-of random and is used to catch modules not compiled with the linker-script, so possibly still having problems leading to kernel panics. This is needed as the code generated on certain architectures for non-simple-types, e.g., an array can generate an absolute relocation on the edge (just outside) the section and thus will not be properly relocated. Adding the padding to the end of the section will ensure that even absolute relocations of complex types will be inside the section, if they are the last object in there and hence relocation will work properly and avoid panics such as observed with carp.ko or ipsec.ko. There is a rather lengthy discussion of various options to apply in the mentioned PRs and their depends/blocks, and the review. There seems no best solution working across multiple toolchains and multiple version of them, so I took the liberty of taking one, as currently our users (and our CI system) are hitting this on just i386 and we need some solution. I wish we would have a proper fix rather than another "hack". Also backout r340009 which manually, temporarily fixed CARP before 12.0-R "by chance" after a lead-up of various other link-elf.c and related fixes. PR: 230857,238012 With suggestions from: arichardson (originally last year) Tested by: lwhsu Event: Waterloo Hackathon 2019 Reported by: lwhsu, olivier MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D17512 Added: head/sys/conf/ldscript.set_padding (contents, props changed) Modified: head/UPDATING head/sys/conf/kmod.mk head/sys/kern/link_elf.c head/sys/netinet/ip_carp.c head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jun 8 17:38:27 2019 (r348807) +++ head/UPDATING Sat Jun 8 17:44:42 2019 (r348808) @@ -31,6 +31,11 @@ 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".) +20190608: + A fix was applied to i386 kernel modules to avoid panics with + dpcpu or vnet. Users need to recompile i386 kernel modules + having pcpu or vnet sections or they will refuse to load. + 20190513: User-wired pages now have their own counter, vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Jun 8 17:38:27 2019 (r348807) +++ head/sys/conf/kmod.mk Sat Jun 8 17:44:42 2019 (r348808) @@ -242,7 +242,13 @@ ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} .endif +.if !defined(FIRMWS) && (${MACHINE_CPUARCH} == "i386") + ${LD} -m ${LD_EMULATION} ${_LDFLAGS} -r \ + -T ${SYSDIR}/conf/ldscript.set_padding \ + -d -o ${.TARGET} ${OBJS} +.else ${LD} -m ${LD_EMULATION} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} +.endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif Added: head/sys/conf/ldscript.set_padding ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.set_padding Sat Jun 8 17:44:42 2019 (r348808) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Bjoern A. Zeeb + * + * 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$ + */ +SECTIONS +{ + set_pcpu : + { + *(set_pcpu) + LONG(0x90909090) ; + } +} + +SECTIONS +{ + set_vnet : + { + *(set_vnet) + LONG(0x90909090) ; + } +} +/* end */ Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sat Jun 8 17:38:27 2019 (r348807) +++ head/sys/kern/link_elf.c Sat Jun 8 17:44:42 2019 (r348808) @@ -615,10 +615,14 @@ parse_dynamic(elf_file_t ef) return (0); } +#define LS_PADDING 0x90909090 static int parse_dpcpu(elf_file_t ef) { int error, size; +#if defined(__i386__) + uint32_t pad; +#endif ef->pcpu_start = 0; ef->pcpu_stop = 0; @@ -631,6 +635,26 @@ parse_dpcpu(elf_file_t ef) /* Empty set? */ if (size < 1) return (0); +#if defined(__i386__) + /* In case we do find __start/stop_set_ symbols double-check. */ + if (size < 4) { + uprintf("Kernel module '%s' must be recompiled with " + "linker script\n", ef->lf.pathname); + return (ENOEXEC); + } + + /* Padding from linker-script correct? */ + pad = *(uint32_t *)((uintptr_t)ef->pcpu_stop - sizeof(pad)); + if (pad != LS_PADDING) { + uprintf("Kernel module '%s' must be recompiled with " + "linker script, invalid padding %#04x (%#04x)\n", + ef->lf.pathname, pad, LS_PADDING); + return (ENOEXEC); + } + /* If we only have valid padding, nothing to do. */ + if (size == 4) + return (0); +#endif /* * Allocate space in the primary pcpu area. Copy in our * initialization from the data section and then initialize @@ -656,6 +680,9 @@ static int parse_vnet(elf_file_t ef) { int error, size; +#if defined(__i386__) + uint32_t pad; +#endif ef->vnet_start = 0; ef->vnet_stop = 0; @@ -668,6 +695,26 @@ parse_vnet(elf_file_t ef) /* Empty set? */ if (size < 1) return (0); +#if defined(__i386__) + /* In case we do find __start/stop_set_ symbols double-check. */ + if (size < 4) { + uprintf("Kernel module '%s' must be recompiled with " + "linker script\n", ef->lf.pathname); + return (ENOEXEC); + } + + /* Padding from linker-script correct? */ + pad = *(uint32_t *)((uintptr_t)ef->vnet_stop - sizeof(pad)); + if (pad != LS_PADDING) { + uprintf("Kernel module '%s' must be recompiled with " + "linker script, invalid padding %#04x (%#04x)\n", + ef->lf.pathname, pad, LS_PADDING); + return (ENOEXEC); + } + /* If we only have valid padding, nothing to do. */ + if (size == 4) + return (0); +#endif /* * Allocate space in the primary vnet area. Copy in our * initialization from the data section and then initialize @@ -688,6 +735,7 @@ parse_vnet(elf_file_t ef) return (0); } #endif +#undef LS_PADDING static int link_elf_link_preload(linker_class_t cls, Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Sat Jun 8 17:38:27 2019 (r348807) +++ head/sys/netinet/ip_carp.c Sat Jun 8 17:44:42 2019 (r348808) @@ -2180,21 +2180,6 @@ static struct protosw in6_carp_protosw = { }; #endif -#ifdef VIMAGE -#if defined(__i386__) -/* - * XXX This is a hack to work around an absolute relocation outside - * set_vnet by one (on the stop symbol) for carpstats. Add a dummy variable - * to the end of the file in the hope that the linker will just keep the - * order (as it seems to do at the moment). It is understood to be fragile. - * See PR 230857 for a longer discussion of the problem and the referenced - * review for possible alternate solutions. Each is a hack; we just need - * the least intrusive one for the next release. - */ -VNET_DEFINE(char, carp_zzz) = 0xde; -#endif -#endif - static void carp_mod_cleanup(void) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 8 17:38:27 2019 (r348807) +++ head/sys/sys/param.h Sat Jun 8 17:44:42 2019 (r348808) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300030 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300031 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Jun 8 17:49: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 1357F15AEB1B; Sat, 8 Jun 2019 17:49:18 +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 AA29C6C1AE; Sat, 8 Jun 2019 17:49:17 +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 7A8131EE1F; Sat, 8 Jun 2019 17:49:17 +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 x58HnHdC046560; Sat, 8 Jun 2019 17:49:17 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58HnHWC046559; Sat, 8 Jun 2019 17:49:17 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906081749.x58HnHWC046559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 8 Jun 2019 17:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348809 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA29C6C1AE 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.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: Sat, 08 Jun 2019 17:49:18 -0000 Author: dougm Date: Sat Jun 8 17:49:17 2019 New Revision: 348809 URL: https://svnweb.freebsd.org/changeset/base/348809 Log: Simple code refactoring originally in D13484. Extract swp_pager_force_dirty() and swp_pager_force_launder() out of swp_pager_force_pagein(). Extract swap_pager_swapoff_object() out of swap_pager_swapoff(). Submitted by: ota_j.email.ne.jp Reviewed by: alc, dougm Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20545 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Jun 8 17:44:42 2019 (r348808) +++ head/sys/vm/swap_pager.c Sat Jun 8 17:49:17 2019 (r348809) @@ -1650,6 +1650,31 @@ swap_pager_nswapdev(void) return (nswapdev); } +static void +swp_pager_force_dirty(vm_page_t m) +{ + + vm_page_dirty(m); +#ifdef INVARIANTS + vm_page_lock(m); + if (!vm_page_wired(m) && m->queue == PQ_NONE) + panic("page %p is neither wired nor queued", m); + vm_page_unlock(m); +#endif + vm_page_xunbusy(m); +} + +static void +swp_pager_force_launder(vm_page_t m) +{ + + vm_page_dirty(m); + vm_page_lock(m); + vm_page_launder(m); + vm_page_unlock(m); + vm_page_xunbusy(m); +} + /* * SWP_PAGER_FORCE_PAGEIN() - force a swap block to be paged in * @@ -1667,7 +1692,7 @@ swap_pager_nswapdev(void) * XXX - The code to page the whole block in doesn't work, so we * revert to the one-by-one behavior for now. Sigh. */ -static inline void +static void swp_pager_force_pagein(vm_object_t object, vm_pindex_t pindex) { vm_page_t m; @@ -1676,14 +1701,7 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_wakeup(object); - vm_page_dirty(m); -#ifdef INVARIANTS - vm_page_lock(m); - if (!vm_page_wired(m) && m->queue == PQ_NONE) - panic("page %p is neither wired nor queued", m); - vm_page_unlock(m); -#endif - vm_page_xunbusy(m); + swp_pager_force_dirty(m); vm_pager_page_unswapped(m); return; } @@ -1691,15 +1709,36 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t if (swap_pager_getpages(object, &m, 1, NULL, NULL) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ vm_object_pip_wakeup(object); - vm_page_dirty(m); - vm_page_lock(m); - vm_page_launder(m); - vm_page_unlock(m); - vm_page_xunbusy(m); + swp_pager_force_launder(m); vm_pager_page_unswapped(m); } /* + * swap_pager_swapoff_object: + * + * Page in all of the pages that have been paged out for an object + * from a given swap device. + */ +static void +swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object) +{ + struct swblk *sb; + vm_pindex_t pi; + int i; + + for (pi = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pi)) != NULL; ) { + pi = sb->p + SWAP_META_PAGES; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] == SWAPBLK_NONE) + continue; + if (swp_pager_isondev(sb->d[i], sp)) + swp_pager_force_pagein(object, sb->p + i); + } + } +} + +/* * swap_pager_swapoff: * * Page in all of the pages that have been paged out to the @@ -1712,10 +1751,8 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t static void swap_pager_swapoff(struct swdevt *sp) { - struct swblk *sb; vm_object_t object; - vm_pindex_t pi; - int i, retries; + int retries; sx_assert(&swdev_syscall_lock, SA_XLOCKED); @@ -1745,17 +1782,7 @@ full_rescan: if (object->type != OBJT_SWAP) goto next_obj; - for (pi = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( - &object->un_pager.swp.swp_blks, pi)) != NULL; ) { - pi = sb->p + SWAP_META_PAGES; - for (i = 0; i < SWAP_META_PAGES; i++) { - if (sb->d[i] == SWAPBLK_NONE) - continue; - if (swp_pager_isondev(sb->d[i], sp)) - swp_pager_force_pagein(object, - sb->p + i); - } - } + swap_pager_swapoff_object(sp, object); next_obj: VM_OBJECT_WUNLOCK(object); mtx_lock(&vm_object_list_mtx); From owner-svn-src-head@freebsd.org Sat Jun 8 18:26: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 AFC7F15AFB7D; Sat, 8 Jun 2019 18:26:49 +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 56AF16D57B; Sat, 8 Jun 2019 18:26:49 +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 2F7381F4E8; Sat, 8 Jun 2019 18:26:49 +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 x58IQnh9067744; Sat, 8 Jun 2019 18:26:49 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58IQnQe067743; Sat, 8 Jun 2019 18:26:49 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201906081826.x58IQnQe067743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 8 Jun 2019 18:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348810 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 348810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56AF16D57B 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.98)[-0.975,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, 08 Jun 2019 18:26:49 -0000 Author: jtl Date: Sat Jun 8 18:26:48 2019 New Revision: 348810 URL: https://svnweb.freebsd.org/changeset/base/348810 Log: Currently, MCA entries remain on an every-growing linked list. This means that it becomes increasingly expensive to process a steady stream of correctable errors. Additionally, the memory used by the MCA entries can grow without bound. Change the code to maintain two separate lists: a list of entries which still need to be logged, and a list of entries which have already been logged. Additionally, allow a user-configurable limit on the number of entries which will be saved after they are logged. (The limit defaults to -1 [unlimited], which is the current behavior.) Reviewed by: imp, jhb MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20482 Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Sat Jun 8 17:49:17 2019 (r348809) +++ head/sys/x86/x86/mca.c Sat Jun 8 18:26:48 2019 (r348810) @@ -86,7 +86,6 @@ struct amd_et_state { struct mca_internal { struct mca_record rec; - int logged; STAILQ_ENTRY(mca_internal) link; }; @@ -101,6 +100,7 @@ static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Arch static volatile int mca_count; /* Number of records stored. */ static int mca_banks; /* Number of per-CPU register banks. */ +static int mca_maxcount = -1; /* Limit on records stored. (-1 = unlimited) */ static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture"); @@ -125,10 +125,11 @@ SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RDTU static STAILQ_HEAD(, mca_internal) mca_freelist; static int mca_freecount; static STAILQ_HEAD(, mca_internal) mca_records; +static STAILQ_HEAD(, mca_internal) mca_pending; static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ static struct taskqueue *mca_tq; -static struct task mca_refill_task, mca_scan_task; +static struct task mca_resize_task, mca_scan_task; static struct mtx mca_lock; static unsigned int @@ -557,32 +558,49 @@ mca_check_status(int bank, struct mca_record *rec) } static void -mca_fill_freelist(void) +mca_resize_freelist(void) { - struct mca_internal *rec; - int desired; + struct mca_internal *next, *rec; + STAILQ_HEAD(, mca_internal) tmplist; + int count, i, desired_max, desired_min; /* * Ensure we have at least one record for each bank and one - * record per CPU. + * record per CPU, but no more than twice that amount. */ - desired = imax(mp_ncpus, mca_banks); + desired_min = imax(mp_ncpus, mca_banks); + desired_max = imax(mp_ncpus, mca_banks) * 2; + STAILQ_INIT(&tmplist); mtx_lock_spin(&mca_lock); - while (mca_freecount < desired) { + while (mca_freecount > desired_max) { + rec = STAILQ_FIRST(&mca_freelist); + KASSERT(rec != NULL, ("mca_freecount is %d, but list is empty", + mca_freecount)); + STAILQ_REMOVE_HEAD(&mca_freelist, link); + mca_freecount--; + STAILQ_INSERT_TAIL(&tmplist, rec, link); + } + while (mca_freecount < desired_min) { + count = desired_min - mca_freecount; mtx_unlock_spin(&mca_lock); - rec = malloc(sizeof(*rec), M_MCA, M_WAITOK); + for (i = 0; i < count; i++) { + rec = malloc(sizeof(*rec), M_MCA, M_WAITOK); + STAILQ_INSERT_TAIL(&tmplist, rec, link); + } mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_freelist, rec, link); - mca_freecount++; + STAILQ_CONCAT(&mca_freelist, &tmplist); + mca_freecount += count; } mtx_unlock_spin(&mca_lock); + STAILQ_FOREACH_SAFE(rec, &tmplist, link, next) + free(rec, M_MCA); } static void -mca_refill(void *context, int pending) +mca_resize(void *context, int pending) { - mca_fill_freelist(); + mca_resize_freelist(); } static void @@ -607,12 +625,8 @@ mca_record_entry(enum scan_mode mode, const struct mca } rec->rec = *record; - rec->logged = 0; - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; + STAILQ_INSERT_TAIL(&mca_pending, rec, link); mtx_unlock_spin(&mca_lock); - if (mode == CMCI && !cold) - taskqueue_enqueue(mca_tq, &mca_refill_task); } #ifdef DEV_APIC @@ -788,14 +802,69 @@ mca_scan(enum scan_mode mode, int *recoverablep) } #endif } - if (mode == POLLED) - mca_fill_freelist(); if (recoverablep != NULL) *recoverablep = recoverable; return (count); } /* + * Store a new record on the mca_records list while enforcing + * mca_maxcount. + */ +static void +mca_store_record(struct mca_internal *mca) +{ + + /* + * If we are storing no records (mca_maxcount == 0), + * we just free this record. + * + * If we are storing records (mca_maxcount != 0) and + * we have free space on the list, store the record + * and increment mca_count. + * + * If we are storing records and we do not have free + * space on the list, store the new record at the + * tail and free the oldest one from the head. + */ + if (mca_maxcount != 0) + STAILQ_INSERT_TAIL(&mca_records, mca, link); + if (mca_maxcount < 0 || mca_count < mca_maxcount) + mca_count++; + else { + if (mca_maxcount != 0) { + mca = STAILQ_FIRST(&mca_records); + STAILQ_REMOVE_HEAD(&mca_records, link); + } + STAILQ_INSERT_TAIL(&mca_freelist, mca, link); + mca_freecount++; + } +} + +/* + * Do the work to process machine check records which have just been + * gathered. Print any pending logs to the console. Queue them for storage. + * Trigger a resizing of the free list. + */ +static void +mca_process_records(enum scan_mode mode) +{ + struct mca_internal *mca; + + mtx_lock_spin(&mca_lock); + while ((mca = STAILQ_FIRST(&mca_pending)) != NULL) { + STAILQ_REMOVE_HEAD(&mca_pending, link); + mca_log(&mca->rec); + mca_store_record(mca); + } + mtx_unlock_spin(&mca_lock); + if (mode == POLLED) + mca_resize_freelist(); + else if (!cold) + taskqueue_enqueue(mca_tq, &mca_resize_task); +} + +/* * Scan the machine check banks on all CPUs by binding to each CPU in * turn. If any of the CPUs contained new machine check records, log * them to the console. @@ -803,11 +872,10 @@ mca_scan(enum scan_mode mode, int *recoverablep) static void mca_scan_cpus(void *context, int pending) { - struct mca_internal *mca; struct thread *td; int count, cpu; - mca_fill_freelist(); + mca_resize_freelist(); td = curthread; count = 0; thread_lock(td); @@ -819,16 +887,8 @@ mca_scan_cpus(void *context, int pending) sched_unbind(td); } thread_unlock(td); - if (count != 0) { - mtx_lock_spin(&mca_lock); - STAILQ_FOREACH(mca, &mca_records, link) { - if (!mca->logged) { - mca->logged = 1; - mca_log(&mca->rec); - } - } - mtx_unlock_spin(&mca_lock); - } + if (count != 0) + mca_process_records(POLLED); } static void @@ -853,6 +913,35 @@ sysctl_mca_scan(SYSCTL_HANDLER_ARGS) return (0); } +static int +sysctl_mca_maxcount(SYSCTL_HANDLER_ARGS) +{ + struct mca_internal *mca; + int error, i; + bool doresize; + + i = mca_maxcount; + error = sysctl_handle_int(oidp, &i, 0, req); + if (error || req->newptr == NULL) + return (error); + mtx_lock_spin(&mca_lock); + mca_maxcount = i; + doresize = false; + if (mca_maxcount >= 0) + while (mca_count > mca_maxcount) { + mca = STAILQ_FIRST(&mca_records); + STAILQ_REMOVE_HEAD(&mca_records, link); + mca_count--; + STAILQ_INSERT_TAIL(&mca_freelist, mca, link); + mca_freecount++; + doresize = true; + } + mtx_unlock_spin(&mca_lock); + if (doresize && !cold) + taskqueue_enqueue(mca_tq, &mca_resize_task); + return (error); +} + static void mca_createtq(void *dummy) { @@ -864,7 +953,7 @@ mca_createtq(void *dummy) taskqueue_start_threads(&mca_tq, 1, PI_SWI(SWI_TQ), "mca taskq"); /* CMCIs during boot may have claimed items from the freelist. */ - mca_fill_freelist(); + mca_resize_freelist(); } SYSINIT(mca_createtq, SI_SUB_CONFIGURE, SI_ORDER_ANY, mca_createtq, NULL); @@ -933,15 +1022,20 @@ mca_setup(uint64_t mcg_cap) mca_banks = mcg_cap & MCG_CAP_COUNT; mtx_init(&mca_lock, "mca", NULL, MTX_SPIN); STAILQ_INIT(&mca_records); + STAILQ_INIT(&mca_pending); TASK_INIT(&mca_scan_task, 0, mca_scan_cpus, NULL); callout_init(&mca_timer, 1); STAILQ_INIT(&mca_freelist); - TASK_INIT(&mca_refill_task, 0, mca_refill, NULL); - mca_fill_freelist(); + TASK_INIT(&mca_resize_task, 0, mca_resize, NULL); + mca_resize_freelist(); SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "count", CTLFLAG_RD, (int *)(uintptr_t)&mca_count, 0, "Record count"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, + "maxcount", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &mca_maxcount, 0, sysctl_mca_maxcount, "I", + "Maximum record count (-1 is unlimited)"); + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "interval", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &mca_ticks, 0, sysctl_positive_int, "I", "Periodic interval in seconds to scan for machine checks"); @@ -1322,25 +1416,14 @@ mca_intr(void) void cmc_intr(void) { - struct mca_internal *mca; - int count; /* * Serialize MCA bank scanning to prevent collisions from * sibling threads. + * + * If we found anything, log them to the console. */ - count = mca_scan(CMCI, NULL); - - /* If we found anything, log them to the console. */ - if (count != 0) { - mtx_lock_spin(&mca_lock); - STAILQ_FOREACH(mca, &mca_records, link) { - if (!mca->logged) { - mca->logged = 1; - mca_log(&mca->rec); - } - } - mtx_unlock_spin(&mca_lock); - } + if (mca_scan(CMCI, NULL) != 0) + mca_process_records(CMCI); } #endif From owner-svn-src-head@freebsd.org Sat Jun 8 18:59: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 6DA8A15B0844; Sat, 8 Jun 2019 18:59:52 +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 0D8A96E895; Sat, 8 Jun 2019 18:59:52 +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 E511F1F9FE; Sat, 8 Jun 2019 18:59:51 +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 x58Ixp7U083430; Sat, 8 Jun 2019 18:59:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58IxpZc083426; Sat, 8 Jun 2019 18:59:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906081859.x58IxpZc083426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 8 Jun 2019 18:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348811 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D8A96E895 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.968,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, 08 Jun 2019 18:59:52 -0000 Author: imp Date: Sat Jun 8 18:59:50 2019 New Revision: 348811 URL: https://svnweb.freebsd.org/changeset/base/348811 Log: Break out the disk selection protocol from the rest of boot1. Segregate the disk probing and selection protocol from the rest of the boot loader. Reviewed by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20547 Added: head/stand/efi/boot1/proto.c (contents, props changed) head/stand/efi/boot1/proto.h (contents, props changed) Modified: head/stand/efi/boot1/Makefile head/stand/efi/boot1/boot1.c head/stand/efi/boot1/boot_module.h Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Sat Jun 8 18:26:48 2019 (r348810) +++ head/stand/efi/boot1/Makefile Sat Jun 8 18:59:50 2019 (r348811) @@ -5,7 +5,7 @@ BOOT1?= boot1 PROG= ${BOOT1}.sym INTERNALPROG= -WARNS?= 6 +WARNS= 6 CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a @@ -28,7 +28,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code -SRCS+= boot1.c self_reloc.c start.S ufs_module.c devpath.c +SRCS+= boot1.c proto.c self_reloc.c start.S ufs_module.c devpath.c .if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Sat Jun 8 18:26:48 2019 (r348810) +++ head/stand/efi/boot1/boot1.c Sat Jun 8 18:59:50 2019 (r348811) @@ -33,10 +33,11 @@ __FBSDID("$FreeBSD$"); #include "boot_module.h" #include "paths.h" +#include "proto.h" static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); -static const boot_module_t *boot_modules[] = +const boot_module_t *boot_modules[] = { #ifdef EFI_ZFS_BOOT &zfs_module, @@ -45,9 +46,8 @@ static const boot_module_t *boot_modules[] = &ufs_module #endif }; +const UINTN num_boot_modules = nitems(boot_modules); -#define NUM_BOOT_MODULES nitems(boot_modules) - static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; @@ -91,65 +91,19 @@ Calloc(size_t n1, size_t n2, const char *file, int lin } /* - * load_loader attempts to load the loader image data. - * - * It tries each module and its respective devices, identified by mod->probe, - * in order until a successful load occurs at which point it returns EFI_SUCCESS - * and EFI_NOT_FOUND otherwise. - * - * Only devices which have preferred matching the preferred parameter are tried. - */ -static EFI_STATUS -load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, - size_t *bufsize, int preferred) -{ - UINTN i; - dev_info_t *dev; - const boot_module_t *mod; - - for (i = 0; i < NUM_BOOT_MODULES; i++) { - mod = boot_modules[i]; - for (dev = mod->devices(); dev != NULL; dev = dev->next) { - if (dev->preferred != preferred) - continue; - - if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == - EFI_SUCCESS) { - *devinfop = dev; - *modp = mod; - return (EFI_SUCCESS); - } - } - } - - return (EFI_NOT_FOUND); -} - -/* * try_boot only returns if it fails to load the loader. If it succeeds * it simply boots, otherwise it returns the status of last EFI call. */ -static EFI_STATUS -try_boot(void) +EFI_STATUS +try_boot(const boot_module_t *mod, dev_info_t *dev, void *loaderbuf, size_t loadersize) { - size_t bufsize, loadersize, cmdsize; - void *buf, *loaderbuf; + size_t bufsize, cmdsize; + void *buf; char *cmd; - dev_info_t *dev; - const boot_module_t *mod; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 1); - if (status != EFI_SUCCESS) { - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 0); - if (status != EFI_SUCCESS) { - printf("Failed to load '%s'\n", PATH_LOADER_EFI); - return (status); - } - } - /* * Read in and parse the command line from /boot.config or /boot/config, * if present. We'll pass it the next stage via a simple ASCII @@ -228,84 +182,6 @@ errout: return (status); } -/* - * probe_handle determines if the passed handle represents a logical partition - * if it does it uses each module in order to probe it and if successful it - * returns 0. - */ -static int -probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) -{ - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; - int preferred; - - /* Figure out if we're dealing with an actual partition. */ - status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status == EFI_UNSUPPORTED) - return (0); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (-1); - } -#ifdef EFI_DEBUG - { - CHAR16 *text = efi_devpath_name(devpath); - DPRINTF("probing: %S ", text); - efi_free_devpath_name(text); - } -#endif - status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); - if (status == EFI_UNSUPPORTED) - return (0); - - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (-1); - } - - if (!blkio->Media->LogicalPartition) - return (0); - - preferred = efi_devpath_same_disk(imgpath, devpath); - - /* Run through each module, see if it can load this partition */ - devinfo = malloc(sizeof(*devinfo)); - if (devinfo == NULL) { - DPRINTF("\nFailed to allocate devinfo\n"); - return (-1); - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; - devinfo->preferred = preferred; - devinfo->next = NULL; - - for (i = 0; i < NUM_BOOT_MODULES; i++) { - devinfo->devdata = NULL; - - status = boot_modules[i]->probe(devinfo); - if (status == EFI_SUCCESS) - return (preferred + 1); - } - free(devinfo); - - return (0); -} - -const char *prio_str[] = { - "error", - "not supported", - "good", - "better" -}; - EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) { @@ -317,10 +193,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; UINTN i, hsize, nhandles; CHAR16 *text; - UINT16 boot_current; - size_t sz; - UINT16 boot_order[100]; - int rv; /* Basic initialization*/ ST = Xsystab; @@ -348,13 +220,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) printf("\n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n\n", PATH_LOADER_EFI); printf(" Initializing modules:"); - for (i = 0; i < NUM_BOOT_MODULES; i++) { + for (i = 0; i < num_boot_modules; i++) { printf(" %s", boot_modules[i]->name); if (boot_modules[i]->init != NULL) boot_modules[i]->init(); } putchar('\n'); + /* Fetch all the block I/O handles, we have to search through them later */ + hsize = 0; + BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + &hsize, NULL); + handles = malloc(hsize); + if (handles == NULL) + efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", + hsize); + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + NULL, &hsize, handles); + if (status != EFI_SUCCESS) + efi_panic(status, "Failed to get device handles\n"); + nhandles = hsize / sizeof(*handles); + /* Determine the devpath of our image so we can prefer it. */ status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); imgpath = NULL; @@ -381,64 +267,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } } - boot_current = 0; - sz = sizeof(boot_current); - if (efi_global_getenv("BootCurrent", &boot_current, &sz) == EFI_SUCCESS) { - printf(" BootCurrent: %04x\n", boot_current); - - sz = sizeof(boot_order); - if (efi_global_getenv("BootOrder", &boot_order, &sz) == EFI_SUCCESS) { - printf(" BootOrder:"); - for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x%s", boot_order[i], - boot_order[i] == boot_current ? "[*]" : ""); - printf("\n"); - } - } - -#ifdef TEST_FAILURE - /* - * For testing failover scenarios, it's nice to be able to fail fast. - * Define TEST_FAILURE to create a boot1.efi that always fails after - * reporting the boot manager protocol details. - */ - BS->Exit(IH, EFI_OUT_OF_RESOURCES, 0, NULL); -#endif - - hsize = 0; - BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, - &hsize, NULL); - handles = malloc(hsize); - if (handles == NULL) - efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", - hsize); - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, - NULL, &hsize, handles); - if (status != EFI_SUCCESS) - efi_panic(status, "Failed to get device handles\n"); - - /* Scan all partitions, probing with all modules. */ - nhandles = hsize / sizeof(*handles); - printf(" Probing %zu block devices...", nhandles); - DPRINTF("\n"); - - for (i = 0; i < nhandles; i++) { - rv = probe_handle(handles[i], imgpath); -#ifdef EFI_DEBUG - printf("%c", "x.+*"[rv + 1]); -#else - printf("%s\n", prio_str[rv + 1]); -#endif - } - printf(" done\n"); - - /* Status summary. */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - printf(" "); - boot_modules[i]->status(); - } - - try_boot(); + choice_protocol(handles, nhandles, imgpath); /* If we get here, we're out of luck... */ efi_panic(EFI_LOAD_ERROR, "No bootable partitions found!"); Modified: head/stand/efi/boot1/boot_module.h ============================================================================== --- head/stand/efi/boot1/boot_module.h Sat Jun 8 18:26:48 2019 (r348810) +++ head/stand/efi/boot1/boot_module.h Sat Jun 8 18:59:50 2019 (r348811) @@ -96,6 +96,9 @@ typedef struct boot_module_t dev_info_t *(*devices)(void); } boot_module_t; +extern const boot_module_t *boot_modules[]; +extern const UINTN num_boot_modules; + /* Standard boot modules. */ #ifdef EFI_UFS_BOOT extern const boot_module_t ufs_module; Added: head/stand/efi/boot1/proto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/boot1/proto.c Sat Jun 8 18:59:50 2019 (r348811) @@ -0,0 +1,223 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * Copyright (c) 2001 Robert Drehmel + * All rights reserved. + * Copyright (c) 2014 Nathan Whitehorn + * All rights reserved. + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include "boot_module.h" +#include "paths.h" +#include "proto.h" + +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; +static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; + +static const char *prio_str[] = { + "error", + "not supported", + "good", + "better" +}; + +/* + * probe_handle determines if the passed handle represents a logical partition + * if it does it uses each module in order to probe it and if successful it + * returns EFI_SUCCESS. + */ +static int +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) +{ + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + UINTN i; + int preferred; + + /* Figure out if we're dealing with an actual partition. */ + status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (0); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (-1); + } +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devpath); + DPRINTF("probing: %S ", text); + efi_free_devpath_name(text); + } +#endif + status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (0); + + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (-1); + } + + if (!blkio->Media->LogicalPartition) + return (0); + + preferred = efi_devpath_same_disk(imgpath, devpath); + + /* Run through each module, see if it can load this partition */ + devinfo = malloc(sizeof(*devinfo)); + if (devinfo == NULL) { + DPRINTF("\nFailed to allocate devinfo\n"); + return (-1); + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->preferred = preferred; + devinfo->next = NULL; + + for (i = 0; i < num_boot_modules; i++) { + devinfo->devdata = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (preferred + 1); + } + free(devinfo); + + return (0); +} + +/* + * load_loader attempts to load the loader image data. + * + * It tries each module and its respective devices, identified by mod->probe, + * in order until a successful load occurs at which point it returns EFI_SUCCESS + * and EFI_NOT_FOUND otherwise. + * + * Only devices which have preferred matching the preferred parameter are tried. + */ +static EFI_STATUS +load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, + size_t *bufsize, int preferred) +{ + UINTN i; + dev_info_t *dev; + const boot_module_t *mod; + + for (i = 0; i < num_boot_modules; i++) { + mod = boot_modules[i]; + for (dev = mod->devices(); dev != NULL; dev = dev->next) { + if (dev->preferred != preferred) + continue; + + if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == + EFI_SUCCESS) { + *devinfop = dev; + *modp = mod; + return (EFI_SUCCESS); + } + } + } + + return (EFI_NOT_FOUND); +} + +void +choice_protocol(EFI_HANDLE *handles, UINTN nhandles, EFI_DEVICE_PATH *imgpath) +{ + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + unsigned i; + int rv; + EFI_STATUS status; + const boot_module_t *mod; + dev_info_t *dev; + void *loaderbuf; + size_t loadersize; + + /* Report UEFI Boot Manager Protocol details */ + boot_current = 0; + sz = sizeof(boot_current); + if (efi_global_getenv("BootCurrent", &boot_current, &sz) == EFI_SUCCESS) { + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + if (efi_global_getenv("BootOrder", &boot_order, &sz) == EFI_SUCCESS) { + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + } + } + +#ifdef TEST_FAILURE + /* + * For testing failover scenarios, it's nice to be able to fail fast. + * Define TEST_FAILURE to create a boot1.efi that always fails after + * reporting the boot manager protocol details. + */ + BS->Exit(IH, EFI_OUT_OF_RESOURCES, 0, NULL); +#endif + + /* Scan all partitions, probing with all modules. */ + printf(" Probing %zu block devices...", nhandles); + DPRINTF("\n"); + for (i = 0; i < nhandles; i++) { + rv = probe_handle(handles[i], imgpath); +#ifdef EFI_DEBUG + printf("%c", "x.+*"[rv + 1]); +#else + printf("%s\n", prio_str[rv + 1]); +#endif + } + printf(" done\n"); + + + /* Status summary. */ + for (i = 0; i < num_boot_modules; i++) { + printf(" "); + boot_modules[i]->status(); + } + + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 1); + if (status != EFI_SUCCESS) { + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, 0); + if (status != EFI_SUCCESS) { + printf("Failed to load '%s'\n", PATH_LOADER_EFI); + return; + } + } + + try_boot(mod, dev, loaderbuf, loadersize); +} Added: head/stand/efi/boot1/proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/boot1/proto.h Sat Jun 8 18:59:50 2019 (r348811) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2019 Netflix, 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$ + */ + +void choice_protocol(EFI_HANDLE *handles, UINTN nhandles, EFI_DEVICE_PATH *imgpath); +EFI_STATUS try_boot(const boot_module_t *mod, dev_info_t *dev, void *loaderbuf, size_t loadersize); From owner-svn-src-head@freebsd.org Sat Jun 8 19:02: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 0234D15B0A79; Sat, 8 Jun 2019 19:02:19 +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 9698B6EC51; Sat, 8 Jun 2019 19:02:18 +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 7161D1FB93; Sat, 8 Jun 2019 19:02:18 +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 x58J2IKV088168; Sat, 8 Jun 2019 19:02:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58J2HDp088164; Sat, 8 Jun 2019 19:02:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906081902.x58J2HDp088164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 8 Jun 2019 19:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348812 - in head/stand/efi: . gptboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: . gptboot X-SVN-Commit-Revision: 348812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9698B6EC51 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: Sat, 08 Jun 2019 19:02:19 -0000 Author: imp Date: Sat Jun 8 19:02:17 2019 New Revision: 348812 URL: https://svnweb.freebsd.org/changeset/base/348812 Log: Create gptboot.efi This is a primary boot loader that is intended to implement the gptboot partition selection algorithm just like we did for BIOS booting. While the preferred method for UEFI is to use the UEFI Boot Manager protocol, there are situations where that can't be done: some BIOS makers interfere with the protocol in unhelpful ways, there's a new standard for a zero variable write from the client OS, and finally for USB drives that might be mobile between systems with multiple partitions there needs to be a media stable way to select. Reviewed by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20547 Added: head/stand/efi/gptboot/ head/stand/efi/gptboot/Makefile (contents, props changed) head/stand/efi/gptboot/drv.h (contents, props changed) head/stand/efi/gptboot/proto.c (contents, props changed) Modified: head/stand/efi/Makefile Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Sat Jun 8 18:59:50 2019 (r348811) +++ head/stand/efi/Makefile Sat Jun 8 19:02:17 2019 (r348812) @@ -9,7 +9,7 @@ NO_OBJ=t .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 SUBDIR.${MK_FDT}+= fdt -SUBDIR.yes+= libefi boot1 +SUBDIR.yes+= libefi boot1 gptboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.yes+= loader_simp Added: head/stand/efi/gptboot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/gptboot/Makefile Sat Jun 8 19:02:17 2019 (r348812) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +# ZFS is not supported, we want debugging until this is vetted and +# we don't want the gptboot.efifat thing created. +MK_LOADER_ZFS=no +EFI_DEBUG=yes +NOFAT=yes + +BOOT1?= gptboot +.PATH: ${SRCTOP}/stand/efi/boot1 ${SRCTOP}/stand/libsa +CFLAGS+= -I${SRCTOP}/stand/efi/boot1 +CFLAGS+= -I${.CURDIR} +CFLAGS+= -DBOOTPROG=\"gptboot.efi\" +SRCS+= gpt.c +CWARNFLAGS.gpt.c+= -Wno-sign-compare -Wno-cast-align +WARNS=6 +.include "${.CURDIR}/../boot1/Makefile" Added: head/stand/efi/gptboot/drv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/gptboot/drv.h Sat Jun 8 19:02:17 2019 (r348812) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2019 Netflix, 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$ + */ + +#ifndef _DRV_H_ +#define _DRV_H_ + +struct dsk { + int part; + daddr_t start; + void *devinfo; /* Really a dev_into_t *, but that's not in scope */ +}; + +int drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); +int drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); +uint64_t drvsize(struct dsk *dskp); + +#endif /* !_DRV_H_ */ Added: head/stand/efi/gptboot/proto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/gptboot/proto.c Sat Jun 8 19:02:17 2019 (r348812) @@ -0,0 +1,279 @@ +/*- + * Copyright (c) 2019 Netflix, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include "boot_module.h" +#include "paths.h" +#include "proto.h" + +#include "gpt.h" +#include +static const uuid_t freebsd_ufs_uuid = GPT_ENT_TYPE_FREEBSD_UFS; +static char secbuf[4096]; +static struct dsk dsk; +static dev_info_t *devices = NULL; +static dev_info_t *raw_device = NULL; + +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; +static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; + +/* + * Shim routine for the gpt code to read in the gpt table. The + * devinfo is always going to be for the raw device. + */ +int +drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk) +{ + int size; + EFI_STATUS status; + dev_info_t *devinfo = (dev_info_t *)dskp->devinfo; + EFI_BLOCK_IO *dev = devinfo->dev; + + lba = lba / (dev->Media->BlockSize / DEV_BSIZE); + size = nblk * DEV_BSIZE; + + status = dev->ReadBlocks(dev, dev->Media->MediaId, lba, size, buf); + if (status != EFI_SUCCESS) { + DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " + "status: %lu\n", devinfo->dev, + dev->Media->MediaId, (uintmax_t)lba, size, + EFI_ERROR_CODE(status)); + return (-1); + } + + return (0); +} + +/* + * Shim routine for the gpt code to write in the gpt table. The + * devinfo is always going to be for the raw device. + */ +int +drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk) +{ + int size; + EFI_STATUS status; + dev_info_t *devinfo = (dev_info_t *)dskp->devinfo; + EFI_BLOCK_IO *dev = devinfo->dev; + + if (dev->Media->ReadOnly) + return -1; + + lba = lba / (dev->Media->BlockSize / DEV_BSIZE); + size = nblk * DEV_BSIZE; + + status = dev->WriteBlocks(dev, dev->Media->MediaId, lba, size, buf); + if (status != EFI_SUCCESS) { + DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " + "status: %lu\n", devinfo->dev, + dev->Media->MediaId, (uintmax_t)lba, size, + EFI_ERROR_CODE(status)); + return (-1); + } + + return (0); +} + +/* + * Return the number of LBAs the drive has. + */ +uint64_t +drvsize(struct dsk *dskp) +{ + dev_info_t *devinfo = (dev_info_t *)dskp->devinfo; + EFI_BLOCK_IO *dev = devinfo->dev; + + return (dev->Media->LastBlock + 1); +} + +static int +partition_number(EFI_DEVICE_PATH *devpath) +{ + EFI_DEVICE_PATH *md; + HARDDRIVE_DEVICE_PATH *hd; + + md = efi_devpath_last_node(devpath); + if (md == NULL) + return (-1); + if (DevicePathSubType(md) != MEDIA_HARDDRIVE_DP) + return (-1); + hd = (HARDDRIVE_DEVICE_PATH *)md; + return (hd->PartitionNumber); +} + +/* + * Find the raw partition for the imgpath and save it + */ +static void +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) +{ + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath, *trimmed = NULL; + EFI_STATUS status; + + /* Figure out if we're dealing with an actual partition. */ + status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status != EFI_SUCCESS) + return; +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devpath); + DPRINTF("probing: %S ", text); + efi_free_devpath_name(text); + } +#endif + /* + * The RAW device is the same as the imgpath with the last + * MEDIA_DEVICE bit trimmed off. imgpath will end with the + * MEDIA_DEVICE for the ESP we booted off of. + */ + if (!efi_devpath_same_disk(imgpath, devpath)) { + trimmed = efi_devpath_trim(imgpath); + if (!efi_devpath_match(trimmed, devpath)) { + free(trimmed); + DPRINTF("Not the same disk\n"); + return; + } + } + status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status != EFI_SUCCESS) { + DPRINTF("Can't get the block I/O protocol block\n"); + return; + } + devinfo = malloc(sizeof(*devinfo)); + if (devinfo == NULL) { + DPRINTF("Failed to allocate devinfo\n"); + return; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->preferred = 1; + devinfo->next = NULL; + devinfo->devdata = NULL; + if (trimmed == NULL) { + DPRINTF("Found partition %d\n", partition_number(devpath)); + add_device(&devices, devinfo); + } else { + free(trimmed); + DPRINTF("Found raw device\n"); + if (raw_device) { + printf(BOOTPROG": Found two raw devices, inconceivable?\n"); + return; + } + raw_device = devinfo; + } +} + +static void +probe_handles(EFI_HANDLE *handles, UINTN nhandles, EFI_DEVICE_PATH *imgpath) +{ + UINTN i; + + for (i = 0; i < nhandles; i++) + probe_handle(handles[i], imgpath); +} + +static dev_info_t * +find_partition(int part) +{ + dev_info_t *dev; + + if (part == 0) + return (NULL); + for (dev = devices; dev != NULL; dev = dev->next) + if (partition_number(dev->devpath) == part) + break; + return (dev); +} + +void +choice_protocol(EFI_HANDLE *handles, UINTN nhandles, EFI_DEVICE_PATH *imgpath) +{ + const boot_module_t *mod = &ufs_module; + dev_info_t *bootdev; + void *loaderbuf; + size_t loadersize; + int parts; + const char *fn = PATH_LOADER_EFI; + + /* + * Probe the provided handles to find the partitions that + * are on the same drive. + */ + probe_handles(handles, nhandles, imgpath); + dsk.devinfo = raw_device; + if (dsk.devinfo == NULL) { + printf(BOOTPROG": unable to find raw disk to read gpt\n"); + return; + } + + /* + * Read in the GPT table, and then find the right partition. + * gptread, gptfind and gptfaileboot are shared with the + * BIOS version of the gptboot program. + */ + if (gptread(&dsk, secbuf) == -1) { + printf(BOOTPROG ": unable to load GPT\n"); + return; + } + // XXX: + // real gptboot can parse a command line before trying this loop. + // But since we don't parse anything at all, hard wire the partition + // to be -1 (meaning look for the next one). + parts = 0; + while (gptfind(&freebsd_ufs_uuid, &dsk, -1) != -1) { + parts++; + bootdev = find_partition(dsk.part); + if (bootdev == NULL) { + printf(BOOTPROG": Can't find partition %d\n", + dsk.part); + goto next; + } + if (mod->load(fn, bootdev, &loaderbuf, &loadersize) != + EFI_SUCCESS) { + printf(BOOTPROG": Can't load %s from partition %d\n", + fn, dsk.part); + goto next; + } + try_boot(mod, bootdev, loaderbuf, loadersize); +next: + gptbootfailed(&dsk); + } + if (parts == 0) + printf("%s: no UFS partition was found\n", BOOTPROG); +} From owner-svn-src-head@freebsd.org Sat Jun 8 19:16: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 1CF0815B0FC9; Sat, 8 Jun 2019 19:16:45 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) (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 3C6BF6F3AD; Sat, 8 Jun 2019 19:16:44 +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?A2DdAAAFCPxc/1H1sVtlGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBUwQBAQELAQGCD0cSEVEBIBIUFI0QiXYBAYIMNQGKCI4igXsJAQE?= =?us-ascii?q?CAQEBAQErDAEBhEACgmkkNgcOAQMBAQUBAQEBBG0cDEIWAYRyAQU6HCMQCw4?= =?us-ascii?q?GBAklD0gGE4Mjgg4LqA6EMgELAYRcgQoGgTQBi3OBf4EQAYMSPoREhWIElAi?= =?us-ascii?q?URVoJghGGRIxyJ5cbhAqQHJElBSyBWE0wCIMnghsXiGGFQT0DMIsMhREBAQ?= X-IPAS-Result: =?us-ascii?q?A2DdAAAFCPxc/1H1sVtlGwEBAQEDAQEBBwMBAQGBUwQBA?= =?us-ascii?q?QELAQGCD0cSEVEBIBIUFI0QiXYBAYIMNQGKCI4igXsJAQECAQEBAQErDAEBh?= =?us-ascii?q?EACgmkkNgcOAQMBAQUBAQEBBG0cDEIWAYRyAQU6HCMQCw4GBAklD0gGE4Mjg?= =?us-ascii?q?g4LqA6EMgELAYRcgQoGgTQBi3OBf4EQAYMSPoREhWIElAiURVoJghGGRIxyJ?= =?us-ascii?q?5cbhAqQHJElBSyBWE0wCIMnghsXiGGFQT0DMIsMhREBAQ?= 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; 08 Jun 2019 21:15:33 +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 x58JFWVM039169; Sat, 8 Jun 2019 21:15:32 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 8 Jun 2019 21:15:32 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348798 - head/sys/amd64/amd64 Message-ID: <20190608211532.37dd2f38@kalimero.tijl.coosemans.org> In-Reply-To: <201906081340.x58DevdV013600@repo.freebsd.org> References: <201906081340.x58DevdV013600@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3C6BF6F3AD 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_SHORT(-0.96)[-0.957,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, 08 Jun 2019 19:16:45 -0000 On Sat, 8 Jun 2019 13:40:57 +0000 (UTC) Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 8 13:40:57 2019 > New Revision: 348798 > URL: https://svnweb.freebsd.org/changeset/base/348798 > > Log: > amd64 trap.c: Modernize syntax around trap_msg[]. > > Convert the array to use C99 initializers. > Make it constant. > Replace MAX_TRAP_MSG with nitems(). > > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/amd64/amd64/trap.c > > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Sat Jun 8 09:34:02 2019 (r348797) > +++ head/sys/amd64/amd64/trap.c Sat Jun 8 13:40:57 2019 (r348798) > @@ -118,41 +118,41 @@ static bool trap_user_dtrace(struct trapframe *, > int (**hook)(struct trapframe *)); > #endif > > -#define MAX_TRAP_MSG 32 > -static char *trap_msg[] = { > - "", /* 0 unused */ > - "privileged instruction fault", /* 1 T_PRIVINFLT */ > - "", /* 2 unused */ > - "breakpoint instruction fault", /* 3 T_BPTFLT */ > - "", /* 4 unused */ > - "", /* 5 unused */ > - "arithmetic trap", /* 6 T_ARITHTRAP */ > - "", /* 7 unused */ > - "", /* 8 unused */ > - "general protection fault", /* 9 T_PROTFLT */ > - "debug exception", /* 10 T_TRCTRAP */ > - "", /* 11 unused */ > - "page fault", /* 12 T_PAGEFLT */ > - "", /* 13 unused */ > - "alignment fault", /* 14 T_ALIGNFLT */ > - "", /* 15 unused */ > - "", /* 16 unused */ > - "", /* 17 unused */ > - "integer divide fault", /* 18 T_DIVIDE */ > - "non-maskable interrupt trap", /* 19 T_NMI */ > - "overflow trap", /* 20 T_OFLOW */ > - "FPU bounds check fault", /* 21 T_BOUND */ > - "FPU device not available", /* 22 T_DNA */ > - "double fault", /* 23 T_DOUBLEFLT */ > - "FPU operand fetch fault", /* 24 T_FPOPFLT */ > - "invalid TSS fault", /* 25 T_TSSFLT */ > - "segment not present fault", /* 26 T_SEGNPFLT */ > - "stack fault", /* 27 T_STKFLT */ > - "machine check trap", /* 28 T_MCHK */ > - "SIMD floating-point exception", /* 29 T_XMMFLT */ > - "reserved (unknown) fault", /* 30 T_RESERVED */ > - "", /* 31 unused (reserved) */ > - "DTrace pid return trap", /* 32 T_DTRACE_RET */ > +static const char UNKNOWN[] = "unknown"; > +static const char *trap_msg[] = { Maybe the array itself can also be const: static const char *const trap_msg[] From owner-svn-src-head@freebsd.org Sat Jun 8 19:50: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 022EF15B2006; Sat, 8 Jun 2019 19:50:59 +0000 (UTC) (envelope-from kib@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 906FA7058D; Sat, 8 Jun 2019 19:50:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36F8D2028D; Sat, 8 Jun 2019 19:50:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58Jowaj010385; Sat, 8 Jun 2019 19:50:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58JowFt010384; Sat, 8 Jun 2019 19:50:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906081950.x58JowFt010384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 19:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348813 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 906FA7058D 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.966,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, 08 Jun 2019 19:50:59 -0000 Author: kib Date: Sat Jun 8 19:50:57 2019 New Revision: 348813 URL: https://svnweb.freebsd.org/changeset/base/348813 Log: Make trap_msg array constant as well. Suggested by: tijl Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jun 8 19:02:17 2019 (r348812) +++ head/sys/amd64/amd64/trap.c Sat Jun 8 19:50:57 2019 (r348813) @@ -119,7 +119,7 @@ static bool trap_user_dtrace(struct trapframe *, #endif static const char UNKNOWN[] = "unknown"; -static const char *trap_msg[] = { +static const char *const trap_msg[] = { [0] = UNKNOWN, /* unused */ [T_PRIVINFLT] = "privileged instruction fault", [2] = UNKNOWN, /* unused */ From owner-svn-src-head@freebsd.org Sat Jun 8 19:58: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 2BC4E15B2115; Sat, 8 Jun 2019 19:58:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 8B5B170A1E; Sat, 8 Jun 2019 19:58:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x634.google.com with SMTP id bi6so1691123plb.12; Sat, 08 Jun 2019 12:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dkMC8bYvkxImUCK9nuqkIf72SFxZmZ3pMoXr7gqVKbA=; b=Pjv2DK88wN+TNSSuXlJATm1hQQonbUP4O5GeK/1H7KcLRFHM/eDD7n6X2LnFSkVSrC pSl+V5L7UwzS4XKW9uU5dDlFoRr8fXnBWbqKszn14BB+BdWTzF97jupfzJq98g6Cu+vO fPZbOYapf8s1TN6syEwOo7JKfcXboqGlY1Uqop0PmRTfaBCWHhWTOdzZmm9gynnEDZsm pLTMPUXEu8TErvzOpg266+mTcv76baPgmeKiHaubHK4dHQJ/Yt3LB9futk9JBzbGkXwx fYp7Ed1NiUnvFiO0bMg3D0dI3HV9hkrdXHkw7LCY/c9CXaEVWQQG4v8ImgouCDjhB1t3 /TbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dkMC8bYvkxImUCK9nuqkIf72SFxZmZ3pMoXr7gqVKbA=; b=l/lM7habilhHJLta5GpR5b2+cRoAC1qEYhTN1c/Mss+pqc+EIg8Yo9qKGmzOb0O9SK EAO96Q8gXsLhnBX2Fr2BS84YFxBtRfyqO22mOGgvsDsct4TExp0tcAwJkGedHeYgh4G/ CuHuZQCG1xjsSTXpSPGwv/30L6fWBQSPAOCmo+IiE/+/xknrlIktFKpBLKVS0BMHzxUb EeqjXyO+kdCvTt3wBzQfgInMwrd9cqLWcLbHaGEUvgG8ozc2ivNAxtu0EoPXuNI+97Ux FawuuRQsRo9/gPtPNjVOSEhc0lS7WhsGWUVNBjeXkH8LraQ/bS8oViAjeWA2XqVMxFdq bTmA== X-Gm-Message-State: APjAAAWgzymkr/el9lu+QO/1auZpUVnwSazCwz8RJowBVj1sCSoOHjaV vYISD/ev2/c+64Sd0rG4+5EBs4Mx X-Google-Smtp-Source: APXvYqyDIhKlXTZmKeZ4qcvLl+tt6bSeVIa6lgs0NEwZZl32FEvP2stJmacZkiutzrCD+id78elC9g== X-Received: by 2002:a17:902:42e2:: with SMTP id h89mr60511879pld.271.1560023904902; Sat, 08 Jun 2019 12:58:24 -0700 (PDT) Received: from ?IPv6:2601:204:d980:655e:4d4c:6779:c49b:bec? ([2601:204:d980:655e:4d4c:6779:c49b:bec]) by smtp.gmail.com with ESMTPSA id d123sm10531545pfc.144.2019.06.08.12.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2019 12:58:24 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r348810 - head/sys/x86/x86 From: Enji Cooper X-Mailer: iPhone Mail (16F203) In-Reply-To: <201906081826.x58IQnQe067743@repo.freebsd.org> Date: Sat, 8 Jun 2019 12:58:23 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <760B9EAA-6FD7-4B23-9BE3-5011B3F4C21C@gmail.com> References: <201906081826.x58IQnQe067743@repo.freebsd.org> To: "Jonathan T. Looney" X-Rspamd-Queue-Id: 8B5B170A1E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.943,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, 08 Jun 2019 19:58:27 -0000 Hi! > On Jun 8, 2019, at 11:26, Jonathan T. Looney wrote: >=20 > Author: jtl > Date: Sat Jun 8 18:26:48 2019 > New Revision: 348810 > URL: https://svnweb.freebsd.org/changeset/base/348810 >=20 > Log: > Currently, MCA entries remain on an every-growing linked list. This means= > that it becomes increasingly expensive to process a steady stream of > correctable errors. Additionally, the memory used by the MCA entries can > grow without bound. >=20 > Change the code to maintain two separate lists: a list of entries which > still need to be logged, and a list of entries which have already been > logged. Additionally, allow a user-configurable limit on the number of > entries which will be saved after they are logged. (The limit defaults > to -1 [unlimited], which is the current behavior.) >=20 > Reviewed by: imp, jhb > MFC after: 2 weeks > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D20482 Briefly looking through the code, I was wondering if the type/locking for mc= a_freecount (before and after this commit) was correct, given that it seems l= ike it can be modified in multiple call sites and in different tasks. Thank you! -Enji > Modified: > head/sys/x86/x86/mca.c >=20 > Modified: head/sys/x86/x86/mca.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/x86/x86/mca.c Sat Jun 8 17:49:17 2019 (r348809) > +++ head/sys/x86/x86/mca.c Sat Jun 8 18:26:48 2019 (r348810) > @@ -86,7 +86,6 @@ struct amd_et_state { >=20 > struct mca_internal { > struct mca_record rec; > - int logged; > STAILQ_ENTRY(mca_internal) link; > }; >=20 > @@ -101,6 +100,7 @@ static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Arch= >=20 > static volatile int mca_count; /* Number of records stored. */ > static int mca_banks; /* Number of per-CPU register banks. */ > +static int mca_maxcount =3D -1; /* Limit on records stored. (-1 =3D un= limited) */ >=20 > static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, > "Machine Check Architecture"); > @@ -125,10 +125,11 @@ SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD= TU > static STAILQ_HEAD(, mca_internal) mca_freelist; > static int mca_freecount; > static STAILQ_HEAD(, mca_internal) mca_records; > +static STAILQ_HEAD(, mca_internal) mca_pending; > static struct callout mca_timer; > static int mca_ticks =3D 3600; /* Check hourly by default. */ > static struct taskqueue *mca_tq; > -static struct task mca_refill_task, mca_scan_task; > +static struct task mca_resize_task, mca_scan_task; > static struct mtx mca_lock; >=20 > static unsigned int > @@ -557,32 +558,49 @@ mca_check_status(int bank, struct mca_record *rec) > } >=20 > static void > -mca_fill_freelist(void) > +mca_resize_freelist(void) > { > - struct mca_internal *rec; > - int desired; > + struct mca_internal *next, *rec; > + STAILQ_HEAD(, mca_internal) tmplist; > + int count, i, desired_max, desired_min; >=20 > /* > * Ensure we have at least one record for each bank and one > - * record per CPU. > + * record per CPU, but no more than twice that amount. > */ > - desired =3D imax(mp_ncpus, mca_banks); > + desired_min =3D imax(mp_ncpus, mca_banks); > + desired_max =3D imax(mp_ncpus, mca_banks) * 2; > + STAILQ_INIT(&tmplist); > mtx_lock_spin(&mca_lock); > - while (mca_freecount < desired) { > + while (mca_freecount > desired_max) { > + rec =3D STAILQ_FIRST(&mca_freelist); > + KASSERT(rec !=3D NULL, ("mca_freecount is %d, but list is empty",= > + mca_freecount)); > + STAILQ_REMOVE_HEAD(&mca_freelist, link); > + mca_freecount--; > + STAILQ_INSERT_TAIL(&tmplist, rec, link); > + } > + while (mca_freecount < desired_min) { > + count =3D desired_min - mca_freecount; > mtx_unlock_spin(&mca_lock); Should this also be outside the loop, like it was before, to ensure the lock= ing is correct, the lock is always unlocked, and the current thread yields t= o the other threads, or should the lock be held over both loops? > - rec =3D malloc(sizeof(*rec), M_MCA, M_WAITOK); > + for (i =3D 0; i < count; i++) { > + rec =3D malloc(sizeof(*rec), M_MCA, M_WAITOK); > + STAILQ_INSERT_TAIL(&tmplist, rec, link); > + } > mtx_lock_spin(&mca_lock); > - STAILQ_INSERT_TAIL(&mca_freelist, rec, link); > - mca_freecount++; > + STAILQ_CONCAT(&mca_freelist, &tmplist); > + mca_freecount +=3D count; > } > mtx_unlock_spin(&mca_lock); > + STAILQ_FOREACH_SAFE(rec, &tmplist, link, next) > + free(rec, M_MCA); > } Thanks! -Enji= From owner-svn-src-head@freebsd.org Sat Jun 8 19:58: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 2A07815B216B; Sat, 8 Jun 2019 19:58:59 +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 C419770B5A; Sat, 8 Jun 2019 19:58:58 +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 9D5942040F; Sat, 8 Jun 2019 19:58:58 +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 x58JwweX014534; Sat, 8 Jun 2019 19:58:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58JwwAf014533; Sat, 8 Jun 2019 19:58:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906081958.x58JwwAf014533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 8 Jun 2019 19:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348814 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C419770B5A 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.966,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, 08 Jun 2019 19:58:59 -0000 Author: imp Date: Sat Jun 8 19:58:58 2019 New Revision: 348814 URL: https://svnweb.freebsd.org/changeset/base/348814 Log: Add stuff to disable warning for %S Add the customary warnings to disable format checking on armv7. Code move to new files, and the unconditional setting of WARNS to 6 provoked it on tinerbox... Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Sat Jun 8 19:50:57 2019 (r348813) +++ head/stand/efi/boot1/Makefile Sat Jun 8 19:58:58 2019 (r348814) @@ -13,9 +13,11 @@ CFLAGS+= -DEFI_BOOT1 # seems to matter on arm64 where wchar_t defaults to an int instead # of a short. There's no good cast to use here so just ignore the # warnings for now. +CWARNFLAGS.proto.c+= -Wno-format CWARNFLAGS.boot1.c+= -Wno-format # Disable bogus alignment issues +CWARNFLAGS.ufs_module.c += -Wno-format CWARNFLAGS.ufs_module.c += -Wno-cast-align # Disable warnings that are currently incompatible with the zfs boot code From owner-svn-src-head@freebsd.org Sat Jun 8 20:26: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 47A2415B2A86; Sat, 8 Jun 2019 20:26:05 +0000 (UTC) (envelope-from kib@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 E37B071975; Sat, 8 Jun 2019 20:26:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE28520930; Sat, 8 Jun 2019 20:26:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58KQ4fK030068; Sat, 8 Jun 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58KQ4Rk030067; Sat, 8 Jun 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906082026.x58KQ4Rk030067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348815 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 348815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E37B071975 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.94)[-0.937,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, 08 Jun 2019 20:26:05 -0000 Author: kib Date: Sat Jun 8 20:26:04 2019 New Revision: 348815 URL: https://svnweb.freebsd.org/changeset/base/348815 Log: Correct definition for PGEX_SGX. At the moment it is only used for page fault error code textual representation. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Sat Jun 8 19:58:58 2019 (r348814) +++ head/sys/amd64/include/pmap.h Sat Jun 8 20:26:04 2019 (r348815) @@ -138,7 +138,7 @@ #define PGEX_RSV 0x08 /* reserved PTE field is non-zero */ #define PGEX_I 0x10 /* during an instruction fetch */ #define PGEX_PK 0x20 /* protection key violation */ -#define PGEX_SGX 0x40 /* SGX-related */ +#define PGEX_SGX 0x8000 /* SGX-related */ /* * undef the PG_xx macros that define bits in the regular x86 PTEs that From owner-svn-src-head@freebsd.org Sat Jun 8 20: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 05E5415B2BDE; Sat, 8 Jun 2019 20:28:05 +0000 (UTC) (envelope-from kib@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 9DFD871B17; Sat, 8 Jun 2019 20:28:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76C5D20935; Sat, 8 Jun 2019 20:28:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58KS4RK030183; Sat, 8 Jun 2019 20:28:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58KS4Iw030182; Sat, 8 Jun 2019 20:28:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906082028.x58KS4Iw030182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Jun 2019 20:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348816 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DFD871B17 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,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, 08 Jun 2019 20:28:05 -0000 Author: kib Date: Sat Jun 8 20:28:04 2019 New Revision: 348816 URL: https://svnweb.freebsd.org/changeset/base/348816 Log: Style MAP_ENTRY_ and MAP_ definitions. Spell all bits in the hex constants. Since all lines are modified, consistently use after #define. Reviewed by: alc (previous version), dougm Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D20560 Modified: head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Jun 8 20:26:04 2019 (r348815) +++ head/sys/vm/vm_map.h Sat Jun 8 20:28:04 2019 (r348816) @@ -119,34 +119,38 @@ struct vm_map_entry { struct thread *wiring_thread; }; -#define MAP_ENTRY_NOSYNC 0x0001 -#define MAP_ENTRY_IS_SUB_MAP 0x0002 -#define MAP_ENTRY_COW 0x0004 -#define MAP_ENTRY_NEEDS_COPY 0x0008 -#define MAP_ENTRY_NOFAULT 0x0010 -#define MAP_ENTRY_USER_WIRED 0x0020 +#define MAP_ENTRY_NOSYNC 0x00000001 +#define MAP_ENTRY_IS_SUB_MAP 0x00000002 +#define MAP_ENTRY_COW 0x00000004 +#define MAP_ENTRY_NEEDS_COPY 0x00000008 +#define MAP_ENTRY_NOFAULT 0x00000010 +#define MAP_ENTRY_USER_WIRED 0x00000020 -#define MAP_ENTRY_BEHAV_NORMAL 0x0000 /* default behavior */ -#define MAP_ENTRY_BEHAV_SEQUENTIAL 0x0040 /* expect sequential access */ -#define MAP_ENTRY_BEHAV_RANDOM 0x0080 /* expect random access */ -#define MAP_ENTRY_BEHAV_RESERVED 0x00C0 /* future use */ +#define MAP_ENTRY_BEHAV_NORMAL 0x00000000 /* default behavior */ +#define MAP_ENTRY_BEHAV_SEQUENTIAL 0x00000040 /* expect sequential + access */ +#define MAP_ENTRY_BEHAV_RANDOM 0x00000080 /* expect random + access */ +#define MAP_ENTRY_BEHAV_RESERVED 0x000000c0 /* future use */ +#define MAP_ENTRY_BEHAV_MASK 0x000000c0 +#define MAP_ENTRY_IN_TRANSITION 0x00000100 /* entry being + changed */ +#define MAP_ENTRY_NEEDS_WAKEUP 0x00000200 /* waiters in + transition */ +#define MAP_ENTRY_NOCOREDUMP 0x00000400 /* don't include in + a core */ +#define MAP_ENTRY_VN_EXEC 0x00000800 /* text vnode mapping */ +#define MAP_ENTRY_GROWS_DOWN 0x00001000 /* top-down stacks */ +#define MAP_ENTRY_GROWS_UP 0x00002000 /* bottom-up stacks */ -#define MAP_ENTRY_BEHAV_MASK 0x00C0 +#define MAP_ENTRY_WIRE_SKIPPED 0x00004000 +#define MAP_ENTRY_VN_WRITECNT 0x00008000 /* writeable vnode + mapping */ +#define MAP_ENTRY_GUARD 0x00010000 +#define MAP_ENTRY_STACK_GAP_DN 0x00020000 +#define MAP_ENTRY_STACK_GAP_UP 0x00040000 +#define MAP_ENTRY_HEADER 0x00080000 -#define MAP_ENTRY_IN_TRANSITION 0x0100 /* entry being changed */ -#define MAP_ENTRY_NEEDS_WAKEUP 0x0200 /* waiters in transition */ -#define MAP_ENTRY_NOCOREDUMP 0x0400 /* don't include in a core */ -#define MAP_ENTRY_VN_EXEC 0x0800 /* text vnode mapping */ -#define MAP_ENTRY_GROWS_DOWN 0x1000 /* Top-down stacks */ -#define MAP_ENTRY_GROWS_UP 0x2000 /* Bottom-up stacks */ - -#define MAP_ENTRY_WIRE_SKIPPED 0x4000 -#define MAP_ENTRY_VN_WRITECNT 0x8000 /* writeable vnode mapping */ -#define MAP_ENTRY_GUARD 0x10000 -#define MAP_ENTRY_STACK_GAP_DN 0x20000 -#define MAP_ENTRY_STACK_GAP_UP 0x40000 -#define MAP_ENTRY_HEADER 0x80000 - #ifdef _KERNEL static __inline u_char vm_map_entry_behavior(vm_map_entry_t entry) @@ -334,25 +338,25 @@ long vmspace_resident_count(struct vmspace *vmspace); /* * Copy-on-write flags for vm_map operations */ -#define MAP_INHERIT_SHARE 0x0001 -#define MAP_COPY_ON_WRITE 0x0002 -#define MAP_NOFAULT 0x0004 -#define MAP_PREFAULT 0x0008 -#define MAP_PREFAULT_PARTIAL 0x0010 -#define MAP_DISABLE_SYNCER 0x0020 -#define MAP_CHECK_EXCL 0x0040 -#define MAP_CREATE_GUARD 0x0080 -#define MAP_DISABLE_COREDUMP 0x0100 -#define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ -#define MAP_VN_WRITECOUNT 0x0400 -#define MAP_REMAP 0x0800 -#define MAP_STACK_GROWS_DOWN 0x1000 -#define MAP_STACK_GROWS_UP 0x2000 -#define MAP_ACC_CHARGED 0x4000 -#define MAP_ACC_NO_CHARGE 0x8000 -#define MAP_CREATE_STACK_GAP_UP 0x10000 -#define MAP_CREATE_STACK_GAP_DN 0x20000 -#define MAP_VN_EXEC 0x40000 +#define MAP_INHERIT_SHARE 0x00000001 +#define MAP_COPY_ON_WRITE 0x00000002 +#define MAP_NOFAULT 0x00000004 +#define MAP_PREFAULT 0x00000008 +#define MAP_PREFAULT_PARTIAL 0x00000010 +#define MAP_DISABLE_SYNCER 0x00000020 +#define MAP_CHECK_EXCL 0x00000040 +#define MAP_CREATE_GUARD 0x00000080 +#define MAP_DISABLE_COREDUMP 0x00000100 +#define MAP_PREFAULT_MADVISE 0x00000200 /* from (user) madvise request */ +#define MAP_VN_WRITECOUNT 0x00000400 +#define MAP_REMAP 0x00000800 +#define MAP_STACK_GROWS_DOWN 0x00001000 +#define MAP_STACK_GROWS_UP 0x00002000 +#define MAP_ACC_CHARGED 0x00004000 +#define MAP_ACC_NO_CHARGE 0x00008000 +#define MAP_CREATE_STACK_GAP_UP 0x00010000 +#define MAP_CREATE_STACK_GAP_DN 0x00020000 +#define MAP_VN_EXEC 0x00040000 /* * vm_fault option flags From owner-svn-src-head@freebsd.org Sat Jun 8 21:33: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 60C3C15B4341; Sat, 8 Jun 2019 21:33:35 +0000 (UTC) (envelope-from wulf@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 F2F627456B; Sat, 8 Jun 2019 21:33:34 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA3A22151E; Sat, 8 Jun 2019 21:33:34 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58LXYOx067632; Sat, 8 Jun 2019 21:33:34 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58LXYFf067631; Sat, 8 Jun 2019 21:33:34 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906082133.x58LXYFf067631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 8 Jun 2019 21:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348817 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 348817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2F627456B 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.97)[-0.966,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: Sat, 08 Jun 2019 21:33:35 -0000 Author: wulf Date: Sat Jun 8 21:33:34 2019 New Revision: 348817 URL: https://svnweb.freebsd.org/changeset/base/348817 Log: psm(4): Fix Elantech trackpoint support. Sign bits for X and Y motion data were taken from wrong places. PR: 238291 Reported by: Andrey Kosachenko Tested by: Andrey Kosachenko MFC after: 2 weeks Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Jun 8 20:28:04 2019 (r348816) +++ head/sys/dev/atkbdc/psm.c Sat Jun 8 21:33:34 2019 (r348817) @@ -4676,7 +4676,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m case ELANTECH_PKT_TRACKPOINT: /* 7 6 5 4 3 2 1 0 (LSB) * ------------------------------------------- - * ipacket[0]: 0 0 SX SY 0 M R L + * ipacket[0]: 0 0 SY SX 0 M R L * ipacket[1]: ~SX 0 0 0 0 0 0 0 * ipacket[2]: ~SY 0 0 0 0 0 0 0 * ipacket[3]: 0 0 ~SY ~SX 0 1 1 0 @@ -4687,9 +4687,9 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m * over 9 bits with SX/SY the relative top bit and * X7..X0 and Y7..Y0 the lower bits. */ - *x = (pb->ipacket[0] & 0x20) ? + *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? pb->ipacket[4] - 256 : pb->ipacket[4]; - *y = (pb->ipacket[0] & 0x10) ? + *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? pb->ipacket[5] - 256 : pb->ipacket[5]; trackpoint_button = From owner-svn-src-head@freebsd.org Sat Jun 8 21:36: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 8682615B43F6; Sat, 8 Jun 2019 21:36:23 +0000 (UTC) (envelope-from wulf@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 275A17472A; Sat, 8 Jun 2019 21:36:23 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1899921520; Sat, 8 Jun 2019 21:36:23 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x58LaMS8067721; Sat, 8 Jun 2019 21:36:22 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58LaMm0067720; Sat, 8 Jun 2019 21:36:22 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201906082136.x58LaMm0067720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 8 Jun 2019 21:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348818 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 348818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 275A17472A 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.968,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, 08 Jun 2019 21:36:23 -0000 Author: wulf Date: Sat Jun 8 21:36:22 2019 New Revision: 348818 URL: https://svnweb.freebsd.org/changeset/base/348818 Log: psm(4): Add extra sanity checks to Elantech trackpoint packet parser. Add strict checks for unused bit states in Elantech trackpoint packet parser to filter out spurious events produces by some hardware which are detected as trackpoint packets. See comment on r328191 for example. Tested by: Andrey Kosachenko Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Jun 8 21:33:34 2019 (r348817) +++ head/sys/dev/atkbdc/psm.c Sat Jun 8 21:36:22 2019 (r348818) @@ -4687,22 +4687,32 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m * over 9 bits with SX/SY the relative top bit and * X7..X0 and Y7..Y0 the lower bits. */ - *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? - pb->ipacket[4] - 256 : pb->ipacket[4]; - *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? - pb->ipacket[5] - 256 : pb->ipacket[5]; + if (!(pb->ipacket[0] & 0xC8) && !(pb->ipacket[1] & 0x7F) && + !(pb->ipacket[2] & 0x7F) && !(pb->ipacket[3] & 0xC9) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[1] & 0x80) && + !(pb->ipacket[0] & 0x10) != !(pb->ipacket[3] & 0x10) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[2] & 0x80) && + !(pb->ipacket[0] & 0x20) != !(pb->ipacket[3] & 0x20)) { - trackpoint_button = - ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | - ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | - ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); + *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? + pb->ipacket[4] - 256 : pb->ipacket[4]; + *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? + pb->ipacket[5] - 256 : pb->ipacket[5]; + + trackpoint_button = + ((pb->ipacket[0] & 0x01) ? MOUSE_BUTTON1DOWN : 0) | + ((pb->ipacket[0] & 0x02) ? MOUSE_BUTTON3DOWN : 0) | + ((pb->ipacket[0] & 0x04) ? MOUSE_BUTTON2DOWN : 0); #ifdef EVDEV_SUPPORT - evdev_push_rel(sc->evdev_r, REL_X, *x); - evdev_push_rel(sc->evdev_r, REL_Y, -*y); - evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); - evdev_sync(sc->evdev_r); + evdev_push_rel(sc->evdev_r, REL_X, *x); + evdev_push_rel(sc->evdev_r, REL_Y, -*y); + evdev_push_mouse_btn(sc->evdev_r, trackpoint_button); + evdev_sync(sc->evdev_r); #endif - ms->button = touchpad_button | trackpoint_button; + ms->button = touchpad_button | trackpoint_button; + } else + VLOG(3, (LOG_DEBUG, "elantech: " + "unexpected trackpoint packet skipped\n")); return (0); case ELANTECH_PKT_NOP: From owner-svn-src-head@freebsd.org Sat Jun 8 23:35:58 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 994A015B66D0; Sat, 8 Jun 2019 23:35:58 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 10B0B77880; Sat, 8 Jun 2019 23:35:57 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id k8so6930987eds.7; Sat, 08 Jun 2019 16:35:57 -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=B3xQYw66SVv/rNQdesJ/VynH/G2IegPCkS/sdXuA9sM=; b=sw2T1/OF2cPGi/CL6qZbQtvBk2iZr2EN8EBEBFx7XgWBaK5JrwzMEZRuNfBYZxDiFe gzfXtPHchAsG82SbTATsIrWeKI4okrt61iTf/ijaLayuwOeEs9X8kID0L6STyBQUSUnd NXF+vHBOr1dfKUptdcEUEI+VJ2UdIU2qsNd0RCgIeSGh/KlKHW2pVEqrMdZ7W6F9vq31 E7jy4nRm5QpYHmTT23ha7KvER+6EjaR6bxfM+EMvvY66yDmw6TdzBIJxbv8VgcRfR9FJ YOOgWPQPIVuYA2674OKTL+uJc6TX+LJITMle+47w10qIRtt3/8WlsAttmb2sjDvrYdxn lUyQ== X-Gm-Message-State: APjAAAWPGDjcok/ThEeEM25inZZ+A2GD1eM3jOyV74s852omWzbcaWfp Y3059MgyxI4Ro94nLTftOs3IY12f X-Google-Smtp-Source: APXvYqzDrp/wgwxO5eSC07e73TpQr/HbQSt67O20xrc6vB9WaJa+MZO+AGQrwFBT3sruRL/MXL366w== X-Received: by 2002:a50:ac4a:: with SMTP id w10mr43770071edc.33.1560036950530; Sat, 08 Jun 2019 16:35:50 -0700 (PDT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com. [209.85.128.44]) by smtp.gmail.com with ESMTPSA id bo11sm1109262ejb.12.2019.06.08.16.35.49 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2019 16:35:50 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id a15so5256542wmj.5; Sat, 08 Jun 2019 16:35:49 -0700 (PDT) X-Received: by 2002:a7b:ce8a:: with SMTP id q10mr7833920wmj.109.1560036949651; Sat, 08 Jun 2019 16:35:49 -0700 (PDT) MIME-Version: 1.0 References: <201906081826.x58IQnQe067743@repo.freebsd.org> <760B9EAA-6FD7-4B23-9BE3-5011B3F4C21C@gmail.com> In-Reply-To: <760B9EAA-6FD7-4B23-9BE3-5011B3F4C21C@gmail.com> From: "Jonathan T. Looney" Date: Sat, 8 Jun 2019 19:35:38 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348810 - head/sys/x86/x86 To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 10B0B77880 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 08 Jun 2019 23:35:58 -0000 Hi Enji, On Sat, Jun 8, 2019 at 3:58 PM Enji Cooper wrote: > > Modified: > > head/sys/x86/x86/mca.c > > > > Modified: head/sys/x86/x86/mca.c > > > ============================================================================== > > --- head/sys/x86/x86/mca.c Sat Jun 8 17:49:17 2019 (r348809) > > +++ head/sys/x86/x86/mca.c Sat Jun 8 18:26:48 2019 (r348810) > > @@ -86,7 +86,6 @@ struct amd_et_state { > > > > struct mca_internal { > > struct mca_record rec; > > - int logged; > > STAILQ_ENTRY(mca_internal) link; > > }; > > > > @@ -101,6 +100,7 @@ static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check > Arch > > > > static volatile int mca_count; /* Number of records stored. */ > > static int mca_banks; /* Number of per-CPU register banks. */ > > +static int mca_maxcount = -1; /* Limit on records stored. (-1 = > unlimited) */ > > > > static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, > > "Machine Check Architecture"); > > @@ -125,10 +125,11 @@ SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, > CTLFLAG_RDTU > > static STAILQ_HEAD(, mca_internal) mca_freelist; > > static int mca_freecount; > > static STAILQ_HEAD(, mca_internal) mca_records; > > +static STAILQ_HEAD(, mca_internal) mca_pending; > > static struct callout mca_timer; > > static int mca_ticks = 3600; /* Check hourly by default. */ > > static struct taskqueue *mca_tq; > > -static struct task mca_refill_task, mca_scan_task; > > +static struct task mca_resize_task, mca_scan_task; > > static struct mtx mca_lock; > > > > static unsigned int > > @@ -557,32 +558,49 @@ mca_check_status(int bank, struct mca_record *rec) > > } > > > > static void > > -mca_fill_freelist(void) > > +mca_resize_freelist(void) > > { > > - struct mca_internal *rec; > > - int desired; > > + struct mca_internal *next, *rec; > > + STAILQ_HEAD(, mca_internal) tmplist; > > + int count, i, desired_max, desired_min; > > > > /* > > * Ensure we have at least one record for each bank and one > > - * record per CPU. > > + * record per CPU, but no more than twice that amount. > > */ > > - desired = imax(mp_ncpus, mca_banks); > > + desired_min = imax(mp_ncpus, mca_banks); > > + desired_max = imax(mp_ncpus, mca_banks) * 2; > > + STAILQ_INIT(&tmplist); > > mtx_lock_spin(&mca_lock); > > - while (mca_freecount < desired) { > > + while (mca_freecount > desired_max) { > > + rec = STAILQ_FIRST(&mca_freelist); > > + KASSERT(rec != NULL, ("mca_freecount is %d, but list is empty", > > + mca_freecount)); > > + STAILQ_REMOVE_HEAD(&mca_freelist, link); > > + mca_freecount--; > > + STAILQ_INSERT_TAIL(&tmplist, rec, link); > > + } > > + while (mca_freecount < desired_min) { > > + count = desired_min - mca_freecount; > > mtx_unlock_spin(&mca_lock); > > Should this also be outside the loop, like it was before, to ensure the > locking is correct, the lock is always unlocked, and the current thread > yields to the other threads, or should the lock be held over both loops? > I think it is correct as is, but welcome feedback if you still think it is incorrect after my explanation. Here is what the new code does: 1. While holding the lock, we figure out how many entries we want to add to the free list. We store it in a local variable (count). 2. We drop the lock and allocate count entries. 3. We reacquire the lock, add those entries to the list, and increment mca_freecount by count. 4. We then check to see if we need to allocate more entries (which might occur if, for example, the free list had been depleted by other threads between steps 1 and 3, while we didn't hold the lock). The key thing is that we must hold the lock while reading or writing mca_freecount and mca_freelist. This code meets that criteria. Even if mca_freecount changes between steps 1 and 3 above, we still add count entries to the list. And, we still increment mca_freecount by count. So, in the end, mca_freecount should match the number of entries on the list. (It might be more or less than our target, but it will be accurate.) The only reason we need to drop the lock is to allocate more entries, which we can't do while holding a spin lock. I don't think there is particularly an impetus to want to yield more often than that. Also, note that you'll only ever enter one of the two loops. (If you are freeing excess entries, you won't need to allocate more to meet a shortage.) Finally, note that you'll never leave this function with less than the desired minimum, but you might leave with more than the desired maximum (if entries are freed by other threads between steps 1 and 3). I considered that to be an acceptable tradeoff between complexity and functionality. And, in any case, if you are using and freeing so many entries so quickly that this occurs, it seems like two things are true: you could probably use the extra headroom on the free list and also it is very likely that something will call the resize task again very soon. If I haven't explained this well enough and you still have questions, feel free to let me know. Jonathan