From owner-svn-src-all@freebsd.org Sun Jun 2 00:08:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 01:00:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 02:38:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 04:04:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 04:23:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A6D515AA79B; Sun, 2 Jun 2019 04:23: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 D54B68A502; Sun, 2 Jun 2019 04:23: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 A912F21E6F; Sun, 2 Jun 2019 04:23: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 x524Nwgt063194; Sun, 2 Jun 2019 04:23:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x524NvQX063185; Sun, 2 Jun 2019 04:23:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906020423.x524NvQX063185@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 04:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348505 - in vendor/one-true-awk/dist: . bugs-fixed X-SVN-Group: vendor X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in vendor/one-true-awk/dist: . bugs-fixed X-SVN-Commit-Revision: 348505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D54B68A502 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 04:23:59 -0000 Author: imp Date: Sun Jun 2 04:23:56 2019 New Revision: 348505 URL: https://svnweb.freebsd.org/changeset/base/348505 Log: Import latest one-true-awk from upstream Import git hash 4189ef5d from https://github.com/onetrueawk/awk.git as there's not been a release in a while. Upstream one-true-awk woke-up! Time to catch up. This may also revert FreeBSD changes that we'd placed in the vendor branch in anticipation of their inclusion in upstream. That's not yet the case, and these will be resolved in the merge. See FIXES for a complete list of bugs fixed (starting with the Jun 7, 2018 entry). Added: vendor/one-true-awk/dist/ChangeLog vendor/one-true-awk/dist/LICENSE vendor/one-true-awk/dist/REGRESS (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/ vendor/one-true-awk/dist/bugs-fixed/README vendor/one-true-awk/dist/bugs-fixed/a-format.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/a-format.bad vendor/one-true-awk/dist/bugs-fixed/a-format.ok vendor/one-true-awk/dist/bugs-fixed/concat-assign-same.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/concat-assign-same.bad vendor/one-true-awk/dist/bugs-fixed/concat-assign-same.ok vendor/one-true-awk/dist/bugs-fixed/decr-NF.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/decr-NF.bad vendor/one-true-awk/dist/bugs-fixed/decr-NF.ok vendor/one-true-awk/dist/bugs-fixed/fmt-overflow.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/fmt-overflow.ok vendor/one-true-awk/dist/bugs-fixed/fs-overflow.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/getline-numeric.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/getline-numeric.bad vendor/one-true-awk/dist/bugs-fixed/getline-numeric.in (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/getline-numeric.ok vendor/one-true-awk/dist/bugs-fixed/missing-precision.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/missing-precision.ok vendor/one-true-awk/dist/bugs-fixed/negative-nf.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/negative-nf.ok vendor/one-true-awk/dist/bugs-fixed/nf-self-assign.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/nf-self-assign.bad vendor/one-true-awk/dist/bugs-fixed/nf-self-assign.ok vendor/one-true-awk/dist/bugs-fixed/numeric-fs.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/numeric-fs.ok vendor/one-true-awk/dist/bugs-fixed/numeric-output-seps.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/numeric-output-seps.bad vendor/one-true-awk/dist/bugs-fixed/numeric-output-seps.ok vendor/one-true-awk/dist/bugs-fixed/numeric-rs.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/numeric-rs.bad vendor/one-true-awk/dist/bugs-fixed/numeric-rs.ok vendor/one-true-awk/dist/bugs-fixed/numeric-subsep.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/numeric-subsep.bad (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/numeric-subsep.ok vendor/one-true-awk/dist/bugs-fixed/ofs-rebuild.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/ofs-rebuild.bad vendor/one-true-awk/dist/bugs-fixed/ofs-rebuild.ok vendor/one-true-awk/dist/bugs-fixed/space.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/space.bad vendor/one-true-awk/dist/bugs-fixed/space.ok vendor/one-true-awk/dist/bugs-fixed/split-fs-from-array.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/split-fs-from-array.ok vendor/one-true-awk/dist/bugs-fixed/string-conv.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/string-conv.bad vendor/one-true-awk/dist/bugs-fixed/string-conv.ok vendor/one-true-awk/dist/bugs-fixed/subsep-overflow.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/subsep-overflow.ok vendor/one-true-awk/dist/bugs-fixed/system-status.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/system-status.bad vendor/one-true-awk/dist/bugs-fixed/system-status.ok vendor/one-true-awk/dist/bugs-fixed/unary-plus.awk (contents, props changed) vendor/one-true-awk/dist/bugs-fixed/unary-plus.bad vendor/one-true-awk/dist/bugs-fixed/unary-plus.ok vendor/one-true-awk/dist/proctab.c (contents, props changed) Modified: vendor/one-true-awk/dist/FIXES vendor/one-true-awk/dist/awk.1 vendor/one-true-awk/dist/awk.h vendor/one-true-awk/dist/awkgram.y vendor/one-true-awk/dist/b.c vendor/one-true-awk/dist/lex.c vendor/one-true-awk/dist/lib.c vendor/one-true-awk/dist/main.c vendor/one-true-awk/dist/makefile vendor/one-true-awk/dist/maketab.c vendor/one-true-awk/dist/parse.c vendor/one-true-awk/dist/proto.h vendor/one-true-awk/dist/run.c vendor/one-true-awk/dist/tran.c Added: vendor/one-true-awk/dist/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/dist/ChangeLog Sun Jun 2 04:23:56 2019 (r348505) @@ -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: vendor/one-true-awk/dist/FIXES ============================================================================== --- vendor/one-true-awk/dist/FIXES Sun Jun 2 04:04:21 2019 (r348504) +++ vendor/one-true-awk/dist/FIXES Sun Jun 2 04:23:56 2019 (r348505) @@ -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 Added: vendor/one-true-awk/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/dist/LICENSE Sun Jun 2 04:23:56 2019 (r348505) @@ -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. +****************************************************************/ Added: vendor/one-true-awk/dist/REGRESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/dist/REGRESS Sun Jun 2 04:23:56 2019 (r348505) @@ -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: vendor/one-true-awk/dist/awk.1 ============================================================================== --- vendor/one-true-awk/dist/awk.1 Sun Jun 2 04:04:21 2019 (r348504) +++ vendor/one-true-awk/dist/awk.1 Sun Jun 2 04:23:56 2019 (r348505) @@ -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 @@ -359,7 +374,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 / @@ -383,8 +398,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 @@ -405,57 +424,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: @@ -486,7 +516,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 @@ -512,13 +542,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; @@ -527,3 +557,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: vendor/one-true-awk/dist/awk.h ============================================================================== --- vendor/one-true-awk/dist/awk.h Sun Jun 2 04:04:21 2019 (r348504) +++ vendor/one-true-awk/dist/awk.h Sun Jun 2 04:23:56 2019 (r348505) @@ -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: vendor/one-true-awk/dist/awkgram.y ============================================================================== --- vendor/one-true-awk/dist/awkgram.y Sun Jun 2 04:04:21 2019 (r348504) +++ vendor/one-true-awk/dist/awkgram.y Sun Jun 2 04:23:56 2019 (r348505) @@ -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: vendor/one-true-awk/dist/b.c ============================================================================== --- vendor/one-true-awk/dist/b.c Sun Jun 2 04:04:21 2019 (r348504) +++ vendor/one-true-awk/dist/b.c Sun Jun 2 04:23:56 2019 (r348505) @@ -27,6 +27,7 @@ THIS SOFTWARE. #define DEBUG #include +#include #include #include #include @@ -65,6 +66,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; @@ -82,11 +88,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"); } @@ -124,6 +130,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. */ @@ -137,7 +145,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"); @@ -145,6 +153,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; } @@ -157,7 +169,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]; @@ -290,11 +302,11 @@ char *cclenter(const char *argp) /* add a character cl int i, c, c2; 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; ) { @@ -350,14 +362,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; @@ -391,7 +403,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) { @@ -531,7 +543,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]; @@ -588,7 +600,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-all@freebsd.org Sun Jun 2 04:28:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE96B15AA911; Sun, 2 Jun 2019 04:28: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 51FB58A699; Sun, 2 Jun 2019 04:28:11 +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 0C84421E74; Sun, 2 Jun 2019 04:28:11 +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 x524SAj9063411; Sun, 2 Jun 2019 04:28:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x524SAmN063410; Sun, 2 Jun 2019 04:28:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906020428.x524SAmN063410@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 04:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348506 - vendor/one-true-awk/4189ef5d X-SVN-Group: vendor X-SVN-Commit-Author: imp X-SVN-Commit-Paths: vendor/one-true-awk/4189ef5d X-SVN-Commit-Revision: 348506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51FB58A699 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 04:28:11 -0000 Author: imp Date: Sun Jun 2 04:28:10 2019 New Revision: 348506 URL: https://svnweb.freebsd.org/changeset/base/348506 Log: Record the vendor import of git has 4189ef5d from https://github.com/onetrueawk/awk.git Added: vendor/one-true-awk/4189ef5d/ - copied from r348505, vendor/one-true-awk/dist/ From owner-svn-src-all@freebsd.org Sun Jun 2 09:27:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE5715B004D; Sun, 2 Jun 2019 09:27: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 7C5E8912AB; Sun, 2 Jun 2019 09:27: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 63308250A4; Sun, 2 Jun 2019 09:27: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 x529RdJZ021015; Sun, 2 Jun 2019 09:27:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x529Rdpm021014; Sun, 2 Jun 2019 09:27:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906020927.x529Rdpm021014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Jun 2019 09:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348507 - stable/12/usr.bin/posixshmcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C5E8912AB 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 09:27:40 -0000 Author: kib Date: Sun Jun 2 09:27:38 2019 New Revision: 348507 URL: https://svnweb.freebsd.org/changeset/base/348507 Log: MFC r348432: Minor tweaks to the layout. Modified: stable/12/usr.bin/posixshmcontrol/posixshmcontrol.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- stable/12/usr.bin/posixshmcontrol/posixshmcontrol.1 Sun Jun 2 04:28:10 2019 (r348506) +++ stable/12/usr.bin/posixshmcontrol/posixshmcontrol.1 Sun Jun 2 09:27:38 2019 (r348507) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2019 +.Dd May 30, 2019 .Dt POSIXSHMCONTROL 1 .Os .Sh NAME @@ -97,14 +97,14 @@ utility. Change the length of the segments. Argument to the .Fl s -option specifies new length, the human-friendly 'k', 'm', 'g' suffixes -can be used, see +option specifies new length. +The human-friendly 'k', 'm', 'g' suffixes can be used, see .Xr expand_number 3. If the option is not specified, assumed length is zero. .El .Pp For some commands, the following options may be provided: -.Bl -tag XX +.Bl -tag -width XXX .It Fl h If specified, requests human-readable display of size, see .Xr humanize_number 3 . From owner-svn-src-all@freebsd.org Sun Jun 2 09:29:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 394B215B0087; Sun, 2 Jun 2019 09:29:07 +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 B6D27913D8; Sun, 2 Jun 2019 09:28:50 +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 8E81A250A6; Sun, 2 Jun 2019 09:28:50 +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 x529SoIt021114; Sun, 2 Jun 2019 09:28:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x529Sor3021113; Sun, 2 Jun 2019 09:28:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906020928.x529Sor3021113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Jun 2019 09:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348508 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 348508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6D27913D8 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.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 09:29:07 -0000 Author: kib Date: Sun Jun 2 09:28:50 2019 New Revision: 348508 URL: https://svnweb.freebsd.org/changeset/base/348508 Log: MFC r348433: Remove TODO comment after posixshmcontrol(1) added. Modified: stable/12/sys/kern/uipc_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_shm.c ============================================================================== --- stable/12/sys/kern/uipc_shm.c Sun Jun 2 09:27:38 2019 (r348507) +++ stable/12/sys/kern/uipc_shm.c Sun Jun 2 09:28:50 2019 (r348508) @@ -36,16 +36,10 @@ * shm_open(2) and shm_unlink(2). While most of the implementation is * here, vm_mmap.c contains mapping logic changes. * - * TODO: - * - * (1) Need to export data to a userland tool via a sysctl. Should ipcs(1) - * and ipcrm(1) be expanded or should new tools to manage both POSIX - * kernel semaphores and POSIX shared memory be written? - * - * (2) Add support for this file type to fstat(1). - * - * (3) Resource limits? Does this need its own resource limits or are the - * existing limits in mmap(2) sufficient? + * posixshmcontrol(1) allows users to inspect the state of the memory + * objects. Per-uid swap resource limit controls total amount of + * memory that user can consume for anonymous objects, including + * shared. */ #include From owner-svn-src-all@freebsd.org Sun Jun 2 11:56:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FFEA15B34B7 for ; Sun, 2 Jun 2019 11:56:37 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (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 C8C84956FC for ; Sun, 2 Jun 2019 11:56:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x843.google.com with SMTP id a15so6421259qtn.7 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=BB9GvYI0rYJ5R3fNO2NAdW9vC4J/1dk1fhbVsULija+lfTBtMA0UjNTAX30QveHt/N i1I6J7KPZ4CV3RMegaLyViR4u5rHaiGL0T3YpRRnQg51hvJlB2mAQoNhBMS0NndV6KKs ZkoNBtBNQnneSMjXbk2zmQvH8mM34PfEn/Cj0rya0T8B+CZHpTFtJmVzArH8T6JfA8kJ jvA6ArD2HgkIXEKJF1qFT6XzBooGXRDh/k6C0Z+mpAybJCirvRdzoO6ZAS270ZyNObNs XXz76edru4U5gr7tPF4rLUfWucIFlE4YPIwzoofZ68M86YWiZy/0HgG5RAaew5nV8LP9 i17g== X-Gm-Message-State: APjAAAUBKU5sYNN3nl4zo6muQ0adBn8zyhugSg5Qw0HezG2kh/2creo5 ah0KmnrWkTcZb5aHMga/JhtZ6A== 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: C8C84956FC 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.994,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 14:03:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 14:05:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 14:10:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 16:25:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 16:28:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 16:30:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 16:33:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 16:44:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 18:46:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF4115BCF83; Sun, 2 Jun 2019 18:46:28 +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 38986747B8; Sun, 2 Jun 2019 18:46:27 +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 22D1A2AE2B; Sun, 2 Jun 2019 18:46:22 +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 x52IkMnt015066; Sun, 2 Jun 2019 18:46:22 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52IkM19015065; Sun, 2 Jun 2019 18:46:22 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906021846.x52IkM19015065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 2 Jun 2019 18:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348516 - stable/12/tests/sys/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tests/sys/netmap X-SVN-Commit-Revision: 348516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38986747B8 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 18:46:28 -0000 Author: vmaffione Date: Sun Jun 2 18:46:21 2019 New Revision: 348516 URL: https://svnweb.freebsd.org/changeset/base/348516 Log: MFC r346184 netmap: add test cases for multiple host rings Extend the netmap unit tests with new test cases for the multiple-host-rings feature introduced by r345269. Modified: stable/12/tests/sys/netmap/ctrl-api-test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- stable/12/tests/sys/netmap/ctrl-api-test.c Sun Jun 2 16:44:50 2019 (r348515) +++ stable/12/tests/sys/netmap/ctrl-api-test.c Sun Jun 2 18:46:21 2019 (r348516) @@ -50,20 +50,16 @@ #ifdef __FreeBSD__ #include "freebsd_test_suite/macros.h" -#endif - -#ifdef __linux__ -#include -#else - static int eventfd(int x __unused, int y __unused) { errno = ENODEV; return -1; } -#endif /* __linux__ */ +#else /* __linux__ */ +#include +#endif static int exec_command(int argc, const char *const argv[]) @@ -144,6 +140,8 @@ struct TestContext { uint32_t nr_rx_slots; /* slots in rx rings */ uint16_t nr_tx_rings; /* number of tx rings */ uint16_t nr_rx_rings; /* number of rx rings */ + uint16_t nr_host_tx_rings; /* number of host tx rings */ + uint16_t nr_host_rx_rings; /* number of host rx rings */ uint16_t nr_mem_id; /* id of the memory allocator */ uint16_t nr_ringid; /* ring(s) we care about */ uint32_t nr_mode; /* specify NR_REG_* modes */ @@ -242,6 +240,8 @@ port_register(struct TestContext *ctx) req.nr_tx_slots = ctx->nr_tx_slots; req.nr_rx_slots = ctx->nr_rx_slots; req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_host_tx_rings = ctx->nr_host_tx_rings; + req.nr_host_rx_rings = ctx->nr_host_rx_rings; req.nr_rx_rings = ctx->nr_rx_rings; req.nr_extra_bufs = ctx->nr_extra_bufs; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); @@ -255,23 +255,29 @@ port_register(struct TestContext *ctx) printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_host_tx_rings %u\n", req.nr_host_tx_rings); + printf("nr_host_rx_rings %u\n", req.nr_host_rx_rings); printf("nr_mem_id %u\n", req.nr_mem_id); printf("nr_extra_bufs %u\n", req.nr_extra_bufs); success = req.nr_memsize && (ctx->nr_mode == req.nr_mode) && - (ctx->nr_ringid == req.nr_ringid) && - (ctx->nr_flags == req.nr_flags) && - ((!ctx->nr_tx_slots && req.nr_tx_slots) || - (ctx->nr_tx_slots == req.nr_tx_slots)) && - ((!ctx->nr_rx_slots && req.nr_rx_slots) || - (ctx->nr_rx_slots == req.nr_rx_slots)) && - ((!ctx->nr_tx_rings && req.nr_tx_rings) || - (ctx->nr_tx_rings == req.nr_tx_rings)) && - ((!ctx->nr_rx_rings && req.nr_rx_rings) || - (ctx->nr_rx_rings == req.nr_rx_rings)) && - ((!ctx->nr_mem_id && req.nr_mem_id) || - (ctx->nr_mem_id == req.nr_mem_id)) && - (ctx->nr_extra_bufs == req.nr_extra_bufs); + (ctx->nr_ringid == req.nr_ringid) && + (ctx->nr_flags == req.nr_flags) && + ((!ctx->nr_tx_slots && req.nr_tx_slots) || + (ctx->nr_tx_slots == req.nr_tx_slots)) && + ((!ctx->nr_rx_slots && req.nr_rx_slots) || + (ctx->nr_rx_slots == req.nr_rx_slots)) && + ((!ctx->nr_tx_rings && req.nr_tx_rings) || + (ctx->nr_tx_rings == req.nr_tx_rings)) && + ((!ctx->nr_rx_rings && req.nr_rx_rings) || + (ctx->nr_rx_rings == req.nr_rx_rings)) && + ((!ctx->nr_host_tx_rings && req.nr_host_tx_rings) || + (ctx->nr_host_tx_rings == req.nr_host_tx_rings)) && + ((!ctx->nr_host_rx_rings && req.nr_host_rx_rings) || + (ctx->nr_host_rx_rings == req.nr_host_rx_rings)) && + ((!ctx->nr_mem_id && req.nr_mem_id) || + (ctx->nr_mem_id == req.nr_mem_id)) && + (ctx->nr_extra_bufs == req.nr_extra_bufs); if (!success) { return -1; } @@ -281,6 +287,8 @@ port_register(struct TestContext *ctx) ctx->nr_rx_slots = req.nr_rx_slots; ctx->nr_tx_rings = req.nr_tx_rings; ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_host_tx_rings = req.nr_host_tx_rings; + ctx->nr_host_rx_rings = req.nr_host_rx_rings; ctx->nr_mem_id = req.nr_mem_id; ctx->nr_extra_bufs = req.nr_extra_bufs; @@ -448,7 +456,7 @@ port_register_hwall_host(struct TestContext *ctx) } static int -port_register_host(struct TestContext *ctx) +port_register_hostall(struct TestContext *ctx) { ctx->nr_mode = NR_REG_SW; return port_register(ctx); @@ -462,7 +470,7 @@ port_register_hwall(struct TestContext *ctx) } static int -port_register_single_ring_couple(struct TestContext *ctx) +port_register_single_hw_pair(struct TestContext *ctx) { ctx->nr_mode = NR_REG_ONE_NIC; ctx->nr_ringid = 0; @@ -470,6 +478,25 @@ port_register_single_ring_couple(struct TestContext *c } static int +port_register_single_host_pair(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ONE_SW; + ctx->nr_host_tx_rings = 2; + ctx->nr_host_rx_rings = 2; + ctx->nr_ringid = 1; + return port_register(ctx); +} + +static int +port_register_hostall_many(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_SW; + ctx->nr_host_tx_rings = 5; + ctx->nr_host_rx_rings = 4; + return port_register(ctx); +} + +static int port_register_hwall_tx(struct TestContext *ctx) { ctx->nr_mode = NR_REG_ALL_NIC; @@ -1701,8 +1728,10 @@ static struct mytest tests[] = { decltest(port_info_get), decltest(port_register_hwall_host), decltest(port_register_hwall), - decltest(port_register_host), - decltest(port_register_single_ring_couple), + decltest(port_register_hostall), + decltest(port_register_single_hw_pair), + decltest(port_register_single_host_pair), + decltest(port_register_hostall_many), decltest(vale_attach_detach), decltest(vale_attach_detach_host_rings), decltest(vale_ephemeral_port_hdr_manipulation), From owner-svn-src-all@freebsd.org Sun Jun 2 20:03:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2584015BE784; Sun, 2 Jun 2019 20:03:01 +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 B9DB376CAF; Sun, 2 Jun 2019 20:03:00 +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 8AE6A2BB73; Sun, 2 Jun 2019 20:03:00 +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 x52K30sq056902; Sun, 2 Jun 2019 20:03:00 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x52K30Ks056901; Sun, 2 Jun 2019 20:03:00 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906022003.x52K30Ks056901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 2 Jun 2019 20:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348517 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 348517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9DB376CAF 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 20:03:01 -0000 Author: vmaffione Date: Sun Jun 2 20:03:00 2019 New Revision: 348517 URL: https://svnweb.freebsd.org/changeset/base/348517 Log: MFC r347944 netmap: align if_ptnet to the changes introduced by r347233 This removes non-functional SCTP checksum offload support. More information in the log message of r347233. Modified: stable/12/sys/dev/netmap/if_ptnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_ptnet.c ============================================================================== --- stable/12/sys/dev/netmap/if_ptnet.c Sun Jun 2 18:46:21 2019 (r348516) +++ stable/12/sys/dev/netmap/if_ptnet.c Sun Jun 2 20:03:00 2019 (r348517) @@ -68,7 +68,6 @@ #include #include #include -#include #include #include @@ -281,9 +280,8 @@ static inline void ptnet_kick(struct ptnet_queue *pq) #define PTNET_HDR_SIZE sizeof(struct virtio_net_hdr_mrg_rxbuf) #define PTNET_MAX_PKT_SIZE 65536 -#define PTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP | CSUM_SCTP) -#define PTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 |\ - CSUM_SCTP_IPV6) +#define PTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP) +#define PTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) #define PTNET_ALL_OFFLOAD (CSUM_TSO | PTNET_CSUM_OFFLOAD |\ PTNET_CSUM_OFFLOAD_IPV6) @@ -1539,9 +1537,6 @@ ptnet_rx_csum_by_offset(struct mbuf *m, uint16_t eth_t m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; break; - case offsetof(struct sctphdr, checksum): - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; - break; default: /* Here we should increment the rx_csum_bad_offset counter. */ return (1); @@ -1595,11 +1590,6 @@ ptnet_rx_csum_by_parse(struct mbuf *m, uint16_t eth_ty return (1); m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; - break; - case IPPROTO_SCTP: - if (__predict_false(m->m_len < offset + sizeof(struct sctphdr))) - return (1); - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; break; default: /* From owner-svn-src-all@freebsd.org Sun Jun 2 20:47:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 20:52:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 22:27:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sun Jun 2 23:38:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 01:31:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 02:04:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EED15C595A for ; Mon, 3 Jun 2019 02:04:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 EBC80889C4 for ; Mon, 3 Jun 2019 02:04:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id i125so10078341qkd.6 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=dvH4HIwKE52xqZgjnI6ioCP6G5AIqZpL4JixgkY9J7shIg+zqTxtRmgDg2tE43ZwAv TQcjU8e4w+fWmTNNx654p7+1eAGaMDv1WMn63Ikpp+GHayETmHv83kn5tp53zNXEUTmH crmqk1g+maAmDRi0dy7C85xLFRD3jPNFbKzL+yL0ILNHkmumydvxVbVymtY3MjrpPxOh 7ODOVezRUP3pZ7knpaKDU5MrXPHCaq8v2EpFpuDzlrHjh96Gnp3sSa8PIyE39QEnuGq+ OaF0c9dlENpKOPKPHf4AEMJZkNvvzS4fc9tOSfaPad3U18lYV4T1AbGtVlLKiPolLZkv 6+0Q== X-Gm-Message-State: APjAAAWHGqY7yx/bOgM+crbrz1lHjMMB5N+3liNB27Dx05NHSSU/zli+ 8BZ59mrPLIMJHFqPO8oXfC81ALdu/YtWt6llN6JD2A== 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: EBC80889C4 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 04:35:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DAE315C83A0; Mon, 3 Jun 2019 04:35:29 +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 3E9C38D42A; Mon, 3 Jun 2019 04:35:29 +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 2748F1163; Mon, 3 Jun 2019 04:35:29 +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 x534ZSHo027725; Mon, 3 Jun 2019 04:35:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x534ZS0s027724; Mon, 3 Jun 2019 04:35:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906030435.x534ZS0s027724@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 04:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348522 - stable/12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E9C38D42A 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.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 04:35:29 -0000 Author: cy Date: Mon Jun 3 04:35:28 2019 New Revision: 348522 URL: https://svnweb.freebsd.org/changeset/base/348522 Log: MFC r348310: Remove compile-time tests for unsupported versions of FreeBSD. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Sun Jun 2 23:38:19 2019 (r348521) +++ stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Mon Jun 3 04:35:28 2019 (r348522) @@ -30,9 +30,9 @@ #if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) # include #endif -#if defined(__FreeBSD__) && (__FreeBSD_version > 220000) +#if defined(__FreeBSD__) # include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#if defined(_KERNEL) #include #else #define CURVNET_SET(arg) From owner-svn-src-all@freebsd.org Mon Jun 3 04:36:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A5B15C8417; Mon, 3 Jun 2019 04:36:59 +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 7573D8D564; Mon, 3 Jun 2019 04:36:58 +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 4A3961164; Mon, 3 Jun 2019 04:36:58 +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 x534aw2x027848; Mon, 3 Jun 2019 04:36:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x534awH3027847; Mon, 3 Jun 2019 04:36:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906030436.x534awH3027847@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 04:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348523 - stable/12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7573D8D564 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 04:36:59 -0000 Author: cy Date: Mon Jun 3 04:36:57 2019 New Revision: 348523 URL: https://svnweb.freebsd.org/changeset/base/348523 Log: MFC r348311: Fix indentation and while at it simplfy the code. Reported by: lwhsu@ Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 04:35:28 2019 (r348522) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 04:36:57 2019 (r348523) @@ -4982,16 +4982,16 @@ frrequest(softc, unit, req, data, set, makecopy) error = ipf_outobj(softc, data, fp, IPFOBJ_FRENTRY); if (error == 0) { - if ((f->fr_dsize != 0) && (uptr != NULL)) + if ((f->fr_dsize != 0) && (uptr != NULL)) { error = COPYOUT(f->fr_data, uptr, f->fr_dsize); - if (error != 0) { + if (error == 0) { + f->fr_hits = 0; + f->fr_bytes = 0; + } else { IPFERROR(28); error = EFAULT; } - if (error == 0) { - f->fr_hits = 0; - f->fr_bytes = 0; } } } From owner-svn-src-all@freebsd.org Mon Jun 3 04:38:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDACE15C8483; Mon, 3 Jun 2019 04:38:08 +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 525188D69E; Mon, 3 Jun 2019 04:38:08 +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 2F4FC1165; Mon, 3 Jun 2019 04:38:08 +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 x534c8FX027941; Mon, 3 Jun 2019 04:38:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x534c8Ag027940; Mon, 3 Jun 2019 04:38:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906030438.x534c8Ag027940@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 04:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348524 - stable/12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 525188D69E 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.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 04:38:09 -0000 Author: cy Date: Mon Jun 3 04:38:07 2019 New Revision: 348524 URL: https://svnweb.freebsd.org/changeset/base/348524 Log: MFC r348312: style(9) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 04:36:57 2019 (r348523) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Mon Jun 3 04:38:07 2019 (r348524) @@ -3913,7 +3913,7 @@ ipf_fixskip(listp, rp, addremove) for (fp = *listp; (fp != NULL) && (fp != rp); fp = fp->fr_next) rules++; - if (!fp) + if (fp == NULL) return; for (rn = 0, fp = *listp; fp && (fp != rp); fp = fp->fr_next, rn++) @@ -5006,7 +5006,7 @@ frrequest(softc, unit, req, data, set, makecopy) return error; } - if (!f) { + if (f == NULL) { /* * At the end of this, ftail must point to the place where the * new rule is to be saved/inserted/added. @@ -5052,7 +5052,7 @@ frrequest(softc, unit, req, data, set, makecopy) * Request to remove a rule. */ if (addrem == 1) { - if (!f) { + if (f == NULL) { IPFERROR(29); error = ESRCH; } else { From owner-svn-src-all@freebsd.org Mon Jun 3 05:15:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 05:25:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 05:25:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 07:57:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD5B15A7D72; Mon, 3 Jun 2019 07:57:55 +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 812FB6BEC0; Mon, 3 Jun 2019 07:57:55 +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 4EA9F32CE; Mon, 3 Jun 2019 07:57:55 +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 x537vtFP033515; Mon, 3 Jun 2019 07:57:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x537vtYb033514; Mon, 3 Jun 2019 07:57:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906030757.x537vtYb033514@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 07:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r348528 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: kib X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 348528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 812FB6BEC0 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 07:57:56 -0000 Author: kib Date: Mon Jun 3 07:57:54 2019 New Revision: 348528 URL: https://svnweb.freebsd.org/changeset/base/348528 Log: Release slavash. Discussed with: hselasky, slavash Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Jun 3 05:25:22 2019 (r348527) +++ svnadmin/conf/mentors Mon Jun 3 07:57:54 2019 (r348528) @@ -27,7 +27,6 @@ miwi araujo mjoras rstone ram ken Co-mentor: mav scottph jhb Co-mentor: emaste -slavash kib Co-mentor: hselasky slm ken Co-mentor: scottl, ambrisko thj jtl Co-mentor: bz tmunro mjg Co-mentor: allanjude From owner-svn-src-all@freebsd.org Mon Jun 3 10:04:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 11:06:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 11:16:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 11:47:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 12:14:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 13:54:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:10:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8789D15B20C7 for ; Mon, 3 Jun 2019 14:10:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 208B981EC5 for ; Mon, 3 Jun 2019 14:10:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id i34so9473225qta.6 for ; Mon, 03 Jun 2019 07:10:48 -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=qn0PsLLEl/O4AivK48Y2OAu4Wz2OvuU7/S429VIzYunea6glFqBB+cQywNXvsGetfz JBdF1zNCNVuryCdz2wPBd3YYuPR1VFQZ3pcj6Rxv5wwKVzCgphWsD9QzLuJTHG7vkAzK yzCBP++0kna/NXN8dI7ltb0QdU7iO9PvzDEO3rYDR6dhGG3C00K29P7g5TwmRioyZ3YQ s/maR7yOLW/hSoI/mo7tkswY7lUsgQUVEbdG8VXt+Z0oc/pWV0+BDCvWcEcz1qERJc58 uyOqkMaERHeT1iH8XLrXWYmx+RD/c5m5c4+TruSiT69nS8rjo6c4QAdXxixKPncRQt5m hl4w== X-Gm-Message-State: APjAAAURDpiaP+eqnpTFxR7YFirB/Eu/p1wMLg805ouKbv04Dw6aaA2k 4pBIc6ZFkU93YRCeGlUlI/4rq07GI/LYcVOGAvgung== 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: 208B981EC5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:13:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1756F15B2328 for ; Mon, 3 Jun 2019 14:13:26 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (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 A4C838243D for ; Mon, 3 Jun 2019 14:13:25 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it1-f176.google.com with SMTP id j204so21436391ite.4 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=okUQkFjY6QWN8kPFz8sBZkV8GHqgfSF4ku3Ak25vlw/i6fiLVO7zSVx+Dn0NWKciro FogJ3Dg79T/4OrOcWfOo6rRB5WYXTrvVA7Scgv4gGOl1CMm7ef16JhWn153sB2UHWNKh 2nqTGUM4O1wOl3pi7peAxUxkLXPfccA9eUjqe0f/V0x+7fdVEomSHjdTFPcU8QL/5nHF ps0RqXBXbI687lBt7NDkuDP4VO+rk0bItPrDoYFmxAfxrIjR1LPjVoK3AFlvljOH3If9 e1VUivoDC+uBMQTyMHkoWRH8krhPt98uoKb1n/P36qnyXSzM6PGiP37LgVOTcvtuu84U c4UQ== X-Gm-Message-State: APjAAAUmyzqZmXgL+VAVrnAulkA83K8AmiOFqZ813RlgbU4t69AotS5x eX7qO80s4Yd7KZna9fZeYd/zeVxqGXVtYa3X3NBvtA== 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: A4C838243D 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:14:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:17:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:20:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:28:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:39:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 14:52:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF03515B3928 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 4DB5984348 for ; Mon, 3 Jun 2019 14:52:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559573567; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=jsOCvaE52N8/5c28EvkOifaVUkwPhMH6escjoevKJPO/oUHudrDbV4hzpIdWlZm13vhA3b+mDSMLF eE+hR+FMiO/kWXXk9H6unBQJAv8V45ks1l0APShvqwLAolUHJa57mu45sDQq09taWR/c8ct+OzE9vM gGMSflLVvmKrsZeqjCVNkJhnkKmZiPRvMRjjDb8jrMdvsz3o+RndHxIPJN2UJgAAosoY8lW2Q+K11k RcRKwMZLYGn48rRUkLpjMz7ECfAHgvoay7ob957Q1VSSLK85IGsVhKuEggsAAWNl8+j70YpMfaWZsv NWbwZTErI2aSWMGlTs+nbP02ZlXNq4Q== 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: 4DB5984348 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:10:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B767015B3F49; Mon, 3 Jun 2019 15:10: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 5AB9484E41; Mon, 3 Jun 2019 15:10:38 +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 344557D1B; Mon, 3 Jun 2019 15:10:38 +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 x53FAcPv061552; Mon, 3 Jun 2019 15:10:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FAc56061551; Mon, 3 Jun 2019 15:10:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906031510.x53FAc56061551@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:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348531 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 348531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AB9484E41 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 15:10:39 -0000 Author: kib Date: Mon Jun 3 15:10:37 2019 New Revision: 348531 URL: https://svnweb.freebsd.org/changeset/base/348531 Log: MFC r348306: Correct some inconsistencies in the earliest created kernel page tables which affect demotion. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Mon Jun 3 14:14:53 2019 (r348530) +++ stable/12/sys/amd64/amd64/pmap.c Mon Jun 3 15:10:37 2019 (r348531) @@ -964,7 +964,6 @@ static void create_pagetables(vm_paddr_t *firstaddr) { int i, j, ndm1g, nkpdpe, nkdmpde; - pt_entry_t *pt_p; pd_entry_t *pd_p; pdp_entry_t *pdp_p; pml4_entry_t *p4_p; @@ -1025,20 +1024,21 @@ create_pagetables(vm_paddr_t *firstaddr) KPTphys = allocpages(firstaddr, nkpt); KPDphys = allocpages(firstaddr, nkpdpe); - /* Fill in the underlying page table pages */ - /* XXX not fully used, underneath 2M pages */ - pt_p = (pt_entry_t *)KPTphys; - for (i = 0; ptoa(i) < *firstaddr; i++) - pt_p[i] = ptoa(i) | X86_PG_V | pg_g | bootaddr_rwx(ptoa(i)); - - /* Now map the page tables at their location within PTmap */ + /* + * Connect the zero-filled PT pages to their PD entries. This + * implicitly maps the PT pages at their correct locations within + * the PTmap. + */ pd_p = (pd_entry_t *)KPDphys; for (i = 0; i < nkpt; i++) pd_p[i] = (KPTphys + ptoa(i)) | X86_PG_RW | X86_PG_V; - /* Map from zero to end of allocations under 2M pages */ - /* This replaces some of the KPTphys entries above */ - for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) + /* + * Map from physical address zero to the end of loader preallocated + * memory using 2MB pages. This replaces some of the PD entries + * created above. + */ + for (i = 0; (i << PDRSHIFT) < KERNend; i++) /* Preset PG_M and PG_A because demotion expects it. */ pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | X86_PG_M | X86_PG_A | bootaddr_rwx(i << PDRSHIFT); @@ -1048,7 +1048,8 @@ create_pagetables(vm_paddr_t *firstaddr) * to record the physical blocks we've actually mapped into kernel * virtual address space. */ - *firstaddr = round_2mpage(*firstaddr); + if (*firstaddr < round_2mpage(KERNend)) + *firstaddr = round_2mpage(KERNend); /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); @@ -1155,7 +1156,10 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); - virtual_avail = (vm_offset_t) KERNBASE + *firstaddr; + /* + * Account for the virtual addresses mapped by create_pagetables(). + */ + virtual_avail = (vm_offset_t)KERNBASE + round_2mpage(KERNend); virtual_end = VM_MAX_KERNEL_ADDRESS; /* From owner-svn-src-all@freebsd.org Mon Jun 3 15:11:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:12:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:19:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:19:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DBF15B44C0; Mon, 3 Jun 2019 15:19:24 +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 6E44C85875; Mon, 3 Jun 2019 15:19: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 E483F7EBA; Mon, 3 Jun 2019 15:19:23 +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 x53FJNtv067036; Mon, 3 Jun 2019 15:19:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FJNK1067035; Mon, 3 Jun 2019 15:19:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031519.x53FJNK1067035@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 15:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348534 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor/illumos/dist/lib/libzfs/common X-SVN-Commit-Revision: 348534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E44C85875 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 15:19:25 -0000 Author: mav Date: Mon Jun 3 15:19:23 2019 New Revision: 348534 URL: https://svnweb.freebsd.org/changeset/base/348534 Log: 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: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Mon Jun 3 15:19:11 2019 (r348533) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Mon Jun 3 15:19:23 2019 (r348534) @@ -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 @@ -1808,13 +1808,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-all@freebsd.org Mon Jun 3 15:19:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:23:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB03C15B47C4; Mon, 3 Jun 2019 15:23:22 +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 8718F85E4C; Mon, 3 Jun 2019 15:23:22 +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 42DF68070; Mon, 3 Jun 2019 15:23:22 +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 x53FNMGd072016; Mon, 3 Jun 2019 15:23:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FNM8D072015; Mon, 3 Jun 2019 15:23:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031523.x53FNM8D072015@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 15:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348535 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8718F85E4C 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 15:23:23 -0000 Author: mav Date: Mon Jun 3 15:23:21 2019 New Revision: 348535 URL: https://svnweb.freebsd.org/changeset/base/348535 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Jun 3 15:19:23 2019 (r348534) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Jun 3 15:23:21 2019 (r348535) @@ -2192,7 +2192,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 int @@ -2213,11 +2219,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], @@ -2241,7 +2248,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 @@ -2294,14 +2301,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-all@freebsd.org Mon Jun 3 15:23:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:25:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB67A15B48EE; Mon, 3 Jun 2019 15:25:13 +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 7DC7B86128; Mon, 3 Jun 2019 15:25:13 +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 593D88072; Mon, 3 Jun 2019 15:25:13 +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 x53FPDq1072208; Mon, 3 Jun 2019 15:25:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FPDLD072207; Mon, 3 Jun 2019 15:25:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031525.x53FPDLD072207@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 15:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348537 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DC7B86128 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 15:25:14 -0000 Author: mav Date: Mon Jun 3 15:25:12 2019 New Revision: 348537 URL: https://svnweb.freebsd.org/changeset/base/348537 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_get.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_get.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_get.c Mon Jun 3 15:23:37 2019 (r348536) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_get.c Mon Jun 3 15:25:12 2019 (r348537) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include "lua.h" @@ -422,16 +422,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-all@freebsd.org Mon Jun 3 15:28:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 929B515B49B1; Mon, 3 Jun 2019 15:28:38 +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 31E05862B7; Mon, 3 Jun 2019 15:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 055C88074; Mon, 3 Jun 2019 15:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53FSbiE072390; Mon, 3 Jun 2019 15:28:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53FSbvH072389; Mon, 3 Jun 2019 15:28:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906031528.x53FSbvH072389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 3 Jun 2019 15:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348538 - stable/12/lib/libjail X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libjail X-SVN-Commit-Revision: 348538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31E05862B7 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.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 15:28:38 -0000 Author: kevans Date: Mon Jun 3 15:28:37 2019 New Revision: 348538 URL: https://svnweb.freebsd.org/changeset/base/348538 Log: MFC r348509: 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. Approved by: re (early MFC) Modified: stable/12/lib/libjail/jail_getid.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libjail/jail_getid.c ============================================================================== --- stable/12/lib/libjail/jail_getid.c Mon Jun 3 15:25:12 2019 (r348537) +++ stable/12/lib/libjail/jail_getid.c Mon Jun 3 15:28:37 2019 (r348538) @@ -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-all@freebsd.org Mon Jun 3 15:32:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:34:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:41:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:42:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 15:43:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:02:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168C415B583F for ; Mon, 3 Jun 2019 16:02:11 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 9DDFD87FC4 for ; Mon, 3 Jun 2019 16:02:10 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io1-f41.google.com with SMTP id e3so14726706ioc.12 for ; Mon, 03 Jun 2019 09:02:10 -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=dfdFF/Ca4LfYCcoPdXYP35PYOLDe+WdFzc4K+P9g8n7hWJ1lvIrD2YT6hxHmZX6uJn PL0MVD5xMKZziwJeSgZHlNFrTxtX51/99oa66kb/1VJWDHNB9IQjYp0q9Ee0LCKwPblz UgzISPa5Gz11jrErzBeBGGHAjdeOBNQOn7t+ihgjoIfahZk7PyVKPHAlgTIy68YLBO/f KbWeea889yccUwY4/KMn2aNPebY2cQzo4v0rdYxxEfuUxA5NLBzm5UZhlaq4qDngC2PB xd2Nf1csb8QNPopeg3kqjgXHLSSKtY52eky7IIDIQFe49CrRHqljp8VMTWUypURymXVr HyUA== X-Gm-Message-State: APjAAAUi+e2D9Q/Jj0/Jux+0t4H6ian5HLt8bOeXtQMXbiw8u5CRqqkG TRsMQybU5ow1isBum6NZ98tc+soZaJ6ApaWZQSk9Gw== 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: 9DDFD87FC4 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.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 16:02:11 -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-all@freebsd.org Mon Jun 3 16:21:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:24:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:31:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272C015B64C8 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 835A98918B for ; Mon, 3 Jun 2019 16:31:07 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559579464; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=XNb1EOUL/JvWnM4HFt+g4gnkwbqosacSPv50gx/jfKyzJXkZLfPDcBMdTcVqj6Q5XP9j9kCzdDdez Xwd6r6gkk1AtxWPVMCMH5N0n+Tcl33w0AqypQzw8tU/I7OTgHPD0rnm5GUD4k11wnHtz7L3Rdln47h IOedrWKUpOJ4uDFwlsQk6On5lp05CF0mxl236jON4ghl6IXMEi0AyyVln9Jjj9pwvePx6Bvi+dL5Hl IfpssNylRySnvaj4LFkNvuK1iYEIrLcCUMPLvSBMnnmOjDkHS3hA+pUc9N1hBZNBWQZ+gvAX/UbIZ5 d8f0OdApYxxOXancK7giSRs6AkOutOw== 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: 835A98918B 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:47:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 493F815B6A6D; Mon, 3 Jun 2019 16:47: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 DC36C89A66; Mon, 3 Jun 2019 16:47: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 B5FA58DCB; Mon, 3 Jun 2019 16:47: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 x53GlpqH014728; Mon, 3 Jun 2019 16:47:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53GlpX1014727; Mon, 3 Jun 2019 16:47:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201906031647.x53GlpX1014727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 3 Jun 2019 16:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348546 - stable/11/lib/libjail X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libjail X-SVN-Commit-Revision: 348546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC36C89A66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 16:47:52 -0000 Author: kevans Date: Mon Jun 3 16:47:51 2019 New Revision: 348546 URL: https://svnweb.freebsd.org/changeset/base/348546 Log: MFC r348509: 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. Approved by: re (gjb) Modified: stable/11/lib/libjail/jail_getid.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libjail/jail_getid.c ============================================================================== --- stable/11/lib/libjail/jail_getid.c Mon Jun 3 16:47:00 2019 (r348545) +++ stable/11/lib/libjail/jail_getid.c Mon Jun 3 16:47:51 2019 (r348546) @@ -52,6 +52,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-all@freebsd.org Mon Jun 3 16:51:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 16:57:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E7915B7052; Mon, 3 Jun 2019 16:57: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 8A2598A346; Mon, 3 Jun 2019 16:57: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 651A98F76; Mon, 3 Jun 2019 16:57: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 x53Gv7l2019849; Mon, 3 Jun 2019 16:57:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Gv6ik019846; Mon, 3 Jun 2019 16:57:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031657.x53Gv6ik019846@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 16:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348548 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 348548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A2598A346 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 16:57:08 -0000 Author: mav Date: Mon Jun 3 16:57:06 2019 New Revision: 348548 URL: https://svnweb.freebsd.org/changeset/base/348548 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Jun 3 16:51:07 2019 (r348547) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Jun 3 16:57:06 2019 (r348548) @@ -103,9 +103,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 @@ -824,10 +826,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: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Mon Jun 3 16:51:07 2019 (r348547) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Mon Jun 3 16:57:06 2019 (r348548) @@ -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: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Mon Jun 3 16:51:07 2019 (r348547) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Mon Jun 3 16:57:06 2019 (r348548) @@ -484,6 +484,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 @@ -495,7 +497,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-all@freebsd.org Mon Jun 3 16:59:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA7F415B71D0; Mon, 3 Jun 2019 16:59:57 +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 503FB8A58A; Mon, 3 Jun 2019 16:59:57 +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 27B498F78; Mon, 3 Jun 2019 16:59:57 +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 x53GxvAE019990; Mon, 3 Jun 2019 16:59:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Gxu8I019988; Mon, 3 Jun 2019 16:59:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906031659.x53Gxu8I019988@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:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348549 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 348549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 503FB8A58A 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 16:59:58 -0000 Author: markj Date: Mon Jun 3 16:59:56 2019 New Revision: 348549 URL: https://svnweb.freebsd.org/changeset/base/348549 Log: MFC r348003, r348011: Add a man page for DEFINE_IFUNC. Added: stable/12/share/man/man9/DEFINE_IFUNC.9 - copied unchanged from r348003, head/share/man/man9/DEFINE_IFUNC.9 Modified: stable/12/share/man/man9/Makefile Directory Properties: stable/12/ (props changed) Copied: stable/12/share/man/man9/DEFINE_IFUNC.9 (from r348003, head/share/man/man9/DEFINE_IFUNC.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man9/DEFINE_IFUNC.9 Mon Jun 3 16:59:56 2019 (r348549, copy of r348003, head/share/man/man9/DEFINE_IFUNC.9) @@ -0,0 +1,143 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation +.\" +.\" This documentation was written by Mark Johnston +.\" 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 AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 18, 2019 +.Dt DEFINE_IFUNC 9 +.Os +.Sh NAME +.Nm DEFINE_IFUNC +.Nd define a kernel function with an implementation selected at run-time +.Sh SYNOPSIS +.In machine/ifunc.h +.Fn DEFINE_IFUNC qual ret_type name args +.Sh DESCRIPTION +ifuncs are a linker feature which allows the programmer to define functions +whose implementation is selected at boot-time or module load-time. +The +.Nm +macro can be used to define an ifunc. +The selection is performed by a resolver function, which returns a pointer +to the selected function. +ifunc resolvers are invoked very early during the machine-dependent +initialization routine, or at load time for dynamically loaded modules. +Resolution must occur before the first call to an ifunc. +ifunc resolution is performed after CPU features are enumerated and after the +kernel's environment is initialized. +The typical use-case for an ifunc is a routine whose behavior depends on +optional CPU features. +For example, newer generations of a given CPU architecture may provide an +instruction to optimize a common operation. +To avoid the overhead of testing for the CPU feature each time the operation +is performed, an ifunc can be used to provide two implementations for the +operation: one targeting platforms with the extra instruction, and one +for older platforms. +.Pp +Because +.Nm +is a macro that defines a dynamically typed function, its usage looks somewhat +unusual. +The +.Ar qual +parameter is a list of zero or more C function qualifiers to be applied to the +ifunc. +This parameter is typically empty or the +.Dv static +qualifier. +.Ar ret_type +is the return type of the ifunc. +.Ar name +is the name of the ifunc. +.Ar args +is a parenthesized, comma-separated list of the parameter types of the function, +as they would appear in a C function declaration. +.Pp +The +.Nm +usage must be followed by the resolver function body. +The resolver must return a function with return type +.Ar ret_type +and parameter types +.Ar args . +The resolver function is defined with the +.Ql resolver +gcc-style function attribute, causing the corresponding +.Xr elf 5 +function symbol to be of type +.Dv STT_GNU_IFUNC +instead of +.Dv STT_FUNC . +The kernel linker invokes the resolver to process relocations targeting ifunc +calls and PLT entries referencing such symbols. +.Sh EXAMPLES +ifunc resolvers are executed early during boot, before most kernel facilities +are available. +They are effectively limited to checking CPU feature flags and tunables. +.Bd -literal +static size_t +fast_strlen(const char *s __unused) +{ + size_t len; + + /* Fast, but may not be correct in all cases. */ + __asm("movq $42,%0\\n" : "=r" (len)); + return (len); +} + +static size_t +slow_strlen(const char *s) +{ + const char *t; + + for (t = s; *t != '\\0'; t++); + return (t - s); +} + +DEFINE_IFUNC(, size_t, strlen, (const char *)) +{ + int enabled; + + enabled = 1; + TUNABLE_INT_FETCH("debug.use_fast_strlen", &enabled); + if (enabled && (cpu_features & CPUID_FAST_STRLEN) != 0) + return (fast_strlen); + else + return (slow_strlen); +} +.Ed +.Pp +This defines a +.Fn strlen +function with an optimized implementation for CPUs that advertise support. +.Sh SEE ALSO +.Xr elf 5 +.Sh NOTES +ifuncs are not supported on all architectures. +They require both toolchain support, to emit function symbols of type +.Dv STT_GNU_IFUNC , +and kernel linker support to invoke ifunc resolvers during boot or +during module load. Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Mon Jun 3 16:57:06 2019 (r348548) +++ stable/12/share/man/man9/Makefile Mon Jun 3 16:59:56 2019 (r348549) @@ -75,6 +75,7 @@ MAN= accept_filter.9 \ DB_COMMAND.9 \ DECLARE_GEOM_CLASS.9 \ DECLARE_MODULE.9 \ + DEFINE_IFUNC.9 \ DELAY.9 \ devclass.9 \ devclass_find.9 \ From owner-svn-src-all@freebsd.org Mon Jun 3 17:01:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED6215B7544; Mon, 3 Jun 2019 17:01:17 +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 420398A91D; Mon, 3 Jun 2019 17:01:17 +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 EE04E8FB9; Mon, 3 Jun 2019 17:01:16 +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 x53H1GOs021588; Mon, 3 Jun 2019 17:01:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H1GJX021587; Mon, 3 Jun 2019 17:01:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031701.x53H1GJX021587@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:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348550 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 420398A91D 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.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:01:17 -0000 Author: mav Date: Mon Jun 3 17:01:16 2019 New Revision: 348550 URL: https://svnweb.freebsd.org/changeset/base/348550 Log: 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 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Jun 3 16:59:56 2019 (r348549) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Jun 3 17:01:16 2019 (r348550) @@ -23,7 +23,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] @@ -89,6 +89,7 @@ #include #include #include +#include #include "zfs_namecheck.h" @@ -1778,44 +1779,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 @@ -1827,9 +1848,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-all@freebsd.org Mon Jun 3 17:02:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 748CC15B781E; Mon, 3 Jun 2019 17:02:36 +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 1B5968ACA4; Mon, 3 Jun 2019 17:02:36 +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 EA93D912F; Mon, 3 Jun 2019 17:02:35 +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 x53H2ZQg024737; Mon, 3 Jun 2019 17:02:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H2ZN2024736; Mon, 3 Jun 2019 17:02:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031702.x53H2ZN2024736@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:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348551 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 348551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B5968ACA4 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:02:36 -0000 Author: mav Date: Mon Jun 3 17:02:35 2019 New Revision: 348551 URL: https://svnweb.freebsd.org/changeset/base/348551 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 3 17:01:16 2019 (r348550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 3 17:02:35 2019 (r348551) @@ -297,7 +297,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-all@freebsd.org Mon Jun 3 17:06:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16FE215B791E; Mon, 3 Jun 2019 17:06:04 +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 AE3E78AEB2; Mon, 3 Jun 2019 17:06:03 +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 888FC9133; Mon, 3 Jun 2019 17:06:03 +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 x53H63Zb024940; Mon, 3 Jun 2019 17:06:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H632X024939; Mon, 3 Jun 2019 17:06:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031706.x53H632X024939@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:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348552 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Commit-Revision: 348552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE3E78AEB2 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:06:04 -0000 Author: mav Date: Mon Jun 3 17:06:02 2019 New Revision: 348552 URL: https://svnweb.freebsd.org/changeset/base/348552 Log: 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: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Mon Jun 3 17:02:35 2019 (r348551) +++ vendor/illumos/dist/cmd/zdb/zdb.c Mon Jun 3 17:06:02 2019 (r348552) @@ -2245,10 +2245,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++) From owner-svn-src-all@freebsd.org Mon Jun 3 17:06:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B7D15B7919; Mon, 3 Jun 2019 17:06:03 +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 329048AEB1; Mon, 3 Jun 2019 17:06:03 +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 233D49132; Mon, 3 Jun 2019 17:06:03 +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 x53H62N7024934; Mon, 3 Jun 2019 17:06:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H629V024933; Mon, 3 Jun 2019 17:06:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031706.x53H629V024933@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:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348552 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Commit-Revision: 348552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 329048AEB1 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:06:03 -0000 Author: mav Date: Mon Jun 3 17:06:02 2019 New Revision: 348552 URL: https://svnweb.freebsd.org/changeset/base/348552 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Jun 3 17:02:35 2019 (r348551) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Jun 3 17:06:02 2019 (r348552) @@ -3862,8 +3862,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); @@ -3872,10 +3881,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-all@freebsd.org Mon Jun 3 17:08:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B48615B7AC4; Mon, 3 Jun 2019 17:08:50 +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 120AC8B1D9; Mon, 3 Jun 2019 17:08:50 +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 DDD8A9137; Mon, 3 Jun 2019 17:08:49 +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 x53H8nDE025086; Mon, 3 Jun 2019 17:08:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H8n2S025085; Mon, 3 Jun 2019 17:08:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031708.x53H8n2S025085@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:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348553 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 120AC8B1D9 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:08:50 -0000 Author: mav Date: Mon Jun 3 17:08:49 2019 New Revision: 348553 URL: https://svnweb.freebsd.org/changeset/base/348553 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Mon Jun 3 17:06:02 2019 (r348552) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Mon Jun 3 17:08:49 2019 (r348553) @@ -222,9 +222,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; @@ -1331,56 +1328,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: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Mon Jun 3 17:06:02 2019 (r348552) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Mon Jun 3 17:08:49 2019 (r348553) @@ -821,7 +821,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-all@freebsd.org Mon Jun 3 17:08:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C2F15B7AC8; Mon, 3 Jun 2019 17:08:50 +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 67A8D8B1DA; Mon, 3 Jun 2019 17:08:50 +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 418869138; Mon, 3 Jun 2019 17:08:50 +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 x53H8oHY025092; Mon, 3 Jun 2019 17:08:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53H8oGr025091; Mon, 3 Jun 2019 17:08:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031708.x53H8oGr025091@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:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348553 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67A8D8B1DA 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:08:51 -0000 Author: mav Date: Mon Jun 3 17:08:49 2019 New Revision: 348553 URL: https://svnweb.freebsd.org/changeset/base/348553 Log: 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: vendor/illumos/dist/cmd/ztest/ztest.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Mon Jun 3 17:06:02 2019 (r348552) +++ vendor/illumos/dist/cmd/ztest/ztest.c Mon Jun 3 17:08:49 2019 (r348553) @@ -334,7 +334,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; @@ -379,7 +378,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_rarely }, { ztest_spa_upgrade, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, @@ -5420,59 +5418,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) { @@ -6525,7 +6470,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"); @@ -6699,24 +6643,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); } From owner-svn-src-all@freebsd.org Mon Jun 3 17:11:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD6C715B7BCF; Mon, 3 Jun 2019 17:11: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 706008B522; Mon, 3 Jun 2019 17:11:27 +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 31C19918B; Mon, 3 Jun 2019 17:11:27 +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 x53HBRNx027052; Mon, 3 Jun 2019 17:11:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HBQBg027050; Mon, 3 Jun 2019 17:11:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031711.x53HBQBg027050@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:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348554 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 706008B522 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:11:28 -0000 Author: mav Date: Mon Jun 3 17:11:26 2019 New Revision: 348554 URL: https://svnweb.freebsd.org/changeset/base/348554 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/aggsum.c vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/aggsum.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/aggsum.c Mon Jun 3 17:08:49 2019 (r348553) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/aggsum.c Mon Jun 3 17:11:26 2019 (r348554) @@ -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: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Jun 3 17:08:49 2019 (r348553) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Jun 3 17:11:26 2019 (r348554) @@ -6159,6 +6159,14 @@ 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_other_size); + aggsum_fini(&astat_l2_hdr_size); } uint64_t @@ -6328,8 +6336,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-all@freebsd.org Mon Jun 3 17:13:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0237815B7DDF; Mon, 3 Jun 2019 17:13:36 +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 9AE2D8B85E; Mon, 3 Jun 2019 17:13:35 +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 7276D92E3; Mon, 3 Jun 2019 17:13:35 +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 x53HDZbq030591; Mon, 3 Jun 2019 17:13:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HDZSa030590; Mon, 3 Jun 2019 17:13:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031713.x53HDZSa030590@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:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348555 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AE2D8B85E 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:13:36 -0000 Author: mav Date: Mon Jun 3 17:13:35 2019 New Revision: 348555 URL: https://svnweb.freebsd.org/changeset/base/348555 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Mon Jun 3 17:11:26 2019 (r348554) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Mon Jun 3 17:13:35 2019 (r348555) @@ -2823,11 +2823,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)); @@ -2871,13 +2871,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); } @@ -2949,14 +2950,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-all@freebsd.org Mon Jun 3 17:14:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685EC15B7E77; Mon, 3 Jun 2019 17:14:55 +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 08CE08B9A8; Mon, 3 Jun 2019 17:14:55 +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 D101892E5; Mon, 3 Jun 2019 17:14: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 x53HEs6d030685; Mon, 3 Jun 2019 17:14:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HEs5Z030684; Mon, 3 Jun 2019 17:14:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031714.x53HEs5Z030684@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:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348556 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08CE08B9A8 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.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:14:55 -0000 Author: mav Date: Mon Jun 3 17:14:54 2019 New Revision: 348556 URL: https://svnweb.freebsd.org/changeset/base/348556 Log: 9738 9112 broke third block copy allocations within one metaslab group illumos/illumos-gate@b86e7e3f0e50748bb5bb5cc91632d72ff17f08dd Reviewed by: Paul Dagnelie Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Alexander Motin Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Mon Jun 3 17:13:35 2019 (r348555) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Mon Jun 3 17:14:54 2019 (r348556) @@ -3080,7 +3080,6 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ metaslab_t *msp = NULL; uint64_t offset = -1ULL; uint64_t activation_weight; - boolean_t tertiary = B_FALSE; activation_weight = METASLAB_WEIGHT_PRIMARY; for (int i = 0; i < d; i++) { @@ -3089,7 +3088,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ activation_weight = METASLAB_WEIGHT_SECONDARY; } else if (activation_weight == METASLAB_WEIGHT_SECONDARY && DVA_GET_VDEV(&dva[i]) == mg->mg_vd->vdev_id) { - tertiary = B_TRUE; + activation_weight = METASLAB_WEIGHT_CLAIM; break; } } @@ -3098,10 +3097,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ * If we don't have enough metaslabs active to fill the entire array, we * just use the 0th slot. */ - if (mg->mg_ms_ready < mg->mg_allocators * 2) { - tertiary = B_FALSE; + if (mg->mg_ms_ready < mg->mg_allocators * 3) allocator = 0; - } ASSERT3U(mg->mg_vd->vdev_ms_count, >=, 2); @@ -3127,7 +3124,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ msp = mg->mg_primaries[allocator]; was_active = B_TRUE; } else if (activation_weight == METASLAB_WEIGHT_SECONDARY && - mg->mg_secondaries[allocator] != NULL && !tertiary) { + mg->mg_secondaries[allocator] != NULL) { msp = mg->mg_secondaries[allocator]; was_active = B_TRUE; } else { @@ -3170,7 +3167,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ continue; } - if (msp->ms_weight & METASLAB_WEIGHT_CLAIM) { + if (msp->ms_weight & METASLAB_WEIGHT_CLAIM && + activation_weight != METASLAB_WEIGHT_CLAIM) { metaslab_passivate(msp, msp->ms_weight & ~METASLAB_WEIGHT_CLAIM); mutex_exit(&msp->ms_lock); From owner-svn-src-all@freebsd.org Mon Jun 3 17:19:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:27:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:29:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:40:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:43:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:44:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 17:56:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 18:32:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 18:42:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:00:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:03:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:03:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:06:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:09:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3210E15BAD9F; Mon, 3 Jun 2019 19:09:41 +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 C6E9E6A52F; Mon, 3 Jun 2019 19:09:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97D35A55C; Mon, 3 Jun 2019 19:09:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53J9e1v090305; Mon, 3 Jun 2019 19:09:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53J9el1090302; Mon, 3 Jun 2019 19:09:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031909.x53J9el1090302@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:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348568 - in vendor/illumos/dist: cmd/zfs man/man1m X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in vendor/illumos/dist: cmd/zfs man/man1m X-SVN-Commit-Revision: 348568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6E9E6A52F 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 19:09:41 -0000 Author: mav Date: Mon Jun 3 19:09:39 2019 New Revision: 348568 URL: https://svnweb.freebsd.org/changeset/base/348568 Log: 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: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/man/man1m/zfs-program.1m vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Mon Jun 3 19:03:24 2019 (r348567) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Mon Jun 3 19:09:39 2019 (r348568) @@ -29,6 +29,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Igor Kozhukhov . * Copyright 2016 Nexenta Systems, Inc. + * Copyright (c) 2018 Datto Inc. */ #include @@ -335,7 +336,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")); } @@ -7072,12 +7073,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': { @@ -7119,6 +7120,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); @@ -7237,11 +7242,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); } } Modified: vendor/illumos/dist/man/man1m/zfs-program.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs-program.1m Mon Jun 3 19:03:24 2019 (r348567) +++ vendor/illumos/dist/man/man1m/zfs-program.1m Mon Jun 3 19:09:39 2019 (r348568) @@ -9,6 +9,7 @@ .\" .\" .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. +.\" Copyright (c) 2018 Datto Inc. .\" .Dd January 21, 2016 .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: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Mon Jun 3 19:03:24 2019 (r348567) +++ vendor/illumos/dist/man/man1m/zfs.1m Mon Jun 3 19:09:39 2019 (r348568) @@ -28,6 +28,7 @@ .\" Copyright (c) 2014 Integros [integros.com] .\" Copyright 2017 Nexenta Systems, Inc. .\" Copyright 2018 Joyent, Inc. +.\" Copyright (c) 2018 Datto Inc. .\" .Dd Feb 10, 2018 .Dt ZFS 1M @@ -271,7 +272,7 @@ .Ar snapshot 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 @@ -3472,7 +3473,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 @@ -3493,6 +3494,11 @@ Channel programs may only be run with root privileges. For full documentation of the ZFS channel program interface, see the manual page for .Bl -tag -width "" +.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 From owner-svn-src-all@freebsd.org Mon Jun 3 19:10:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:15:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:19:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:20:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C6F815BB1AC; Mon, 3 Jun 2019 19:20:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 238B76AE88; Mon, 3 Jun 2019 19:20:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFEEDA712; Mon, 3 Jun 2019 19:20:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53JKAiG095809; Mon, 3 Jun 2019 19:20:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JKAZ9095808; Mon, 3 Jun 2019 19:20:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031920.x53JKAZ9095808@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:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348572 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor/illumos/dist/lib/libzfs/common X-SVN-Commit-Revision: 348572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 238B76AE88 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 19:20:11 -0000 Author: mav Date: Mon Jun 3 19:20:10 2019 New Revision: 348572 URL: https://svnweb.freebsd.org/changeset/base/348572 Log: 9880 Race in ZFS parallel mount illumos/illumos-gate@bc4c0ff1343a311cc24933908ac6c4455af09031 Reviewed by: Jason King Reviewed by: Sebastien Roy Approved by: Joshua M. Clulow Author: Andy Fiddaman Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Mon Jun 3 19:19:35 2019 (r348571) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Mon Jun 3 19:20:10 2019 (r348572) @@ -26,6 +26,7 @@ * Copyright 2016 Igor Kozhukhov * Copyright 2017 Joyent, Inc. * Copyright 2017 RackTop Systems. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -1142,19 +1143,28 @@ zfs_iter_cb(zfs_handle_t *zhp, void *data) /* * Sort comparator that compares two mountpoint paths. We sort these paths so * that subdirectories immediately follow their parents. This means that we - * effectively treat the '/' character as the lowest value non-nul char. An - * example sorted list using this comparator would look like: + * effectively treat the '/' character as the lowest value non-nul char. + * Since filesystems from non-global zones can have the same mountpoint + * as other filesystems, the comparator sorts global zone filesystems to + * the top of the list. This means that the global zone will traverse the + * filesystem list in the correct order and can stop when it sees the + * first zoned filesystem. In a non-global zone, only the delegated + * filesystems are seen. * + * An example sorted list using this comparator would look like: + * * /foo * /foo/bar * /foo/bar/baz * /foo/baz * /foo.bar + * /foo (NGZ1) + * /foo (NGZ2) * * The mounting code depends on this ordering to deterministically iterate * over filesystems in order to spawn parallel mount tasks. */ -int +static int mountpoint_cmp(const void *arga, const void *argb) { zfs_handle_t *const *zap = arga; @@ -1166,7 +1176,15 @@ mountpoint_cmp(const void *arga, const void *argb) const char *a = mounta; const char *b = mountb; boolean_t gota, gotb; + uint64_t zoneda, zonedb; + zoneda = zfs_prop_get_int(za, ZFS_PROP_ZONED); + zonedb = zfs_prop_get_int(zb, ZFS_PROP_ZONED); + if (zoneda && !zonedb) + return (1); + if (!zoneda && zonedb) + return (-1); + gota = (zfs_get_type(za) == ZFS_TYPE_FILESYSTEM); if (gota) { verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, @@ -1379,6 +1397,8 @@ void zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, size_t num_handles, zfs_iter_f func, void *data, boolean_t parallel) { + zoneid_t zoneid = getzoneid(); + /* * The ZFS_SERIAL_MOUNT environment variable is an undocumented * variable that can be used as a convenience to do a/b comparison @@ -1414,6 +1434,14 @@ zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handl */ for (int i = 0; i < num_handles; i = non_descendant_idx(handles, num_handles, i)) { + /* + * Since the mountpoints have been sorted so that the zoned + * filesystems are at the end, a zoned filesystem seen from + * the global zone means that we're done. + */ + if (zoneid == GLOBAL_ZONEID && + zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) + break; zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, tq); } From owner-svn-src-all@freebsd.org Mon Jun 3 19:24:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE88415BB762; Mon, 3 Jun 2019 19:24:41 +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 5C1956B513; Mon, 3 Jun 2019 19:24:41 +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 22EE5A8B5; Mon, 3 Jun 2019 19: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 x53JOepf000638; Mon, 3 Jun 2019 19:24:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JOekq000637; Mon, 3 Jun 2019 19:24:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031924.x53JOekq000637@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:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348573 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C1956B513 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 19:24:41 -0000 Author: mav Date: Mon Jun 3 19:24:40 2019 New Revision: 348573 URL: https://svnweb.freebsd.org/changeset/base/348573 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Jun 3 19:20:10 2019 (r348572) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Jun 3 19:24:40 2019 (r348573) @@ -1497,7 +1497,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-all@freebsd.org Mon Jun 3 19:25:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:37:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 19:53:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B08CF15BC3E4; Mon, 3 Jun 2019 19:53:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B3D6C8DD; Mon, 3 Jun 2019 19:53:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F4009ADCA; Mon, 3 Jun 2019 19:53:39 +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 x53Jrd97016469; Mon, 3 Jun 2019 19:53:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53JrdsH016468; Mon, 3 Jun 2019 19:53:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031953.x53JrdsH016468@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:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348576 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52B3D6C8DD 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 19:53:41 -0000 Author: mav Date: Mon Jun 3 19:53:39 2019 New Revision: 348576 URL: https://svnweb.freebsd.org/changeset/base/348576 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 19:37:14 2019 (r348575) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 19:53:39 2019 (r348576) @@ -38,6 +38,13 @@ #include /* + * 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; + +/* * Virtual device vector for disks. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Jun 3 19:37:14 2019 (r348575) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Jun 3 19:53:39 2019 (r348576) @@ -95,11 +95,12 @@ int zfs_commit_timeout_pct = 5; int zil_replay_disable = 0; /* - * 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; +boolean_t zil_nocacheflush = B_FALSE; /* * Limit SLOG write size per commit executed with synchronous priority. @@ -991,7 +992,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); @@ -1015,7 +1016,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-all@freebsd.org Mon Jun 3 20:05:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 20:18:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB6BB15BCAE5; Mon, 3 Jun 2019 20:18:03 +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 9A1826D6D2; Mon, 3 Jun 2019 20:18:03 +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 750A8B12F; Mon, 3 Jun 2019 20:18:03 +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 x53KI3De029317; Mon, 3 Jun 2019 20:18:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KI20i029312; Mon, 3 Jun 2019 20:18:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032018.x53KI20i029312@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:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348578 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A1826D6D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:18:04 -0000 Author: mav Date: Mon Jun 3 20:18:02 2019 New Revision: 348578 URL: https://svnweb.freebsd.org/changeset/base/348578 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Jun 3 20:05:43 2019 (r348577) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Jun 3 20:18:02 2019 (r348578) @@ -1706,7 +1706,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) { @@ -1756,13 +1765,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: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Mon Jun 3 20:05:43 2019 (r348577) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Mon Jun 3 20:18:02 2019 (r348578) @@ -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: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Mon Jun 3 20:05:43 2019 (r348577) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Mon Jun 3 20:18:02 2019 (r348578) @@ -1015,6 +1015,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) { @@ -1032,9 +1033,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)); } @@ -1158,11 +1156,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: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Jun 3 20:05:43 2019 (r348577) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Jun 3 20:18:02 2019 (r348578) @@ -549,7 +549,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 @@ -961,7 +961,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; @@ -1007,6 +1008,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) { @@ -1014,9 +1051,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 @@ -1053,8 +1094,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 @@ -1094,14 +1137,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) @@ -1112,6 +1158,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); @@ -1125,10 +1172,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) @@ -1147,6 +1195,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) @@ -1155,6 +1224,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 @@ -1199,33 +1335,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); } @@ -1926,7 +2037,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 @@ -2007,7 +2119,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)) { @@ -2109,7 +2222,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" @@ -2230,7 +2344,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; /* @@ -2278,7 +2393,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); @@ -2451,7 +2567,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); } } @@ -3093,13 +3210,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: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Jun 3 20:05:43 2019 (r348577) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Jun 3 20:18:02 2019 (r348578) @@ -973,6 +973,7 @@ zvol_close(dev_t dev, int flag, int otyp, cred_t *cr) return (error); } +/* ARGSUSED */ static void zvol_get_done(zgd_t *zgd, int error) { @@ -980,9 +981,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-all@freebsd.org Mon Jun 3 20:18:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5939115BCAE6; Mon, 3 Jun 2019 20:18:04 +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 EDD0D6D6D3; Mon, 3 Jun 2019 20:18:03 +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 C5BEEB130; Mon, 3 Jun 2019 20:18:03 +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 x53KI3EX029323; Mon, 3 Jun 2019 20:18:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KI36Q029322; Mon, 3 Jun 2019 20:18:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032018.x53KI36Q029322@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:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348578 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDD0D6D6D3 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:18:04 -0000 Author: mav Date: Mon Jun 3 20:18:02 2019 New Revision: 348578 URL: https://svnweb.freebsd.org/changeset/base/348578 Log: 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: vendor/illumos/dist/cmd/ztest/ztest.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Mon Jun 3 20:05:43 2019 (r348577) +++ vendor/illumos/dist/cmd/ztest/ztest.c Mon Jun 3 20:18:02 2019 (r348578) @@ -1840,6 +1840,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) { @@ -1851,9 +1852,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)); } From owner-svn-src-all@freebsd.org Mon Jun 3 20:24:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 20:39:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C3A15BD433; Mon, 3 Jun 2019 20:39:14 +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 4EBEE6E58B; Mon, 3 Jun 2019 20:39:14 +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 E9EA8B47C; Mon, 3 Jun 2019 20:39:13 +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 x53KdDKR039662; Mon, 3 Jun 2019 20:39:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KdDiN039661; Mon, 3 Jun 2019 20:39:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032039.x53KdDiN039661@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:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348580 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor/illumos/dist/lib/libzfs/common X-SVN-Commit-Revision: 348580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EBEE6E58B 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:39:14 -0000 Author: mav Date: Mon Jun 3 20:39:13 2019 New Revision: 348580 URL: https://svnweb.freebsd.org/changeset/base/348580 Log: 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: vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Mon Jun 3 20:24:40 2019 (r348579) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Mon Jun 3 20:39:13 2019 (r348580) @@ -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 */ @@ -49,7 +49,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 '+' @@ -359,12 +359,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-all@freebsd.org Mon Jun 3 20:40:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 20:45:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C3515BD830; Mon, 3 Jun 2019 20:45:49 +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 79D656ECD6; Mon, 3 Jun 2019 20:45:49 +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 54CC3B636; Mon, 3 Jun 2019 20:45:49 +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 x53KjnYo044959; Mon, 3 Jun 2019 20:45:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KjnN3044958; Mon, 3 Jun 2019 20:45:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032045.x53KjnN3044958@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:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348583 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Commit-Revision: 348583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79D656ECD6 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:45:50 -0000 Author: mav Date: Mon Jun 3 20:45:48 2019 New Revision: 348583 URL: https://svnweb.freebsd.org/changeset/base/348583 Log: 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: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Mon Jun 3 20:45:32 2019 (r348582) +++ vendor/illumos/dist/cmd/zdb/zdb.c Mon Jun 3 20:45:48 2019 (r348583) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #undef verify @@ -111,6 +112,7 @@ 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 @@ -1565,6 +1567,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*/ @@ -1747,6 +1751,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; @@ -1754,7 +1785,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); @@ -1779,9 +1827,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) { @@ -1796,7 +1841,6 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("mintxg %llu -> obj %llu\n", (longlong_t)dle->dle_mintxg, (longlong_t)dle->dle_bpobj.bpo_object); - } } } @@ -2193,6 +2237,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" }; @@ -2270,6 +2338,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) @@ -4429,7 +4498,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); @@ -4460,7 +4684,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, @@ -4487,6 +4713,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; @@ -4516,6 +4745,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); From owner-svn-src-all@freebsd.org Mon Jun 3 20:45:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8049315BD82B; Mon, 3 Jun 2019 20:45:49 +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 2751C6ECD5; Mon, 3 Jun 2019 20:45:49 +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 011BAB635; Mon, 3 Jun 2019 20:45:49 +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 x53KjmNK044953; Mon, 3 Jun 2019 20:45:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Kjm0p044951; Mon, 3 Jun 2019 20:45:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032045.x53Kjm0p044951@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:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348583 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Commit-Revision: 348583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2751C6ECD5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:45:49 -0000 Author: mav Date: Mon Jun 3 20:45:48 2019 New Revision: 348583 URL: https://svnweb.freebsd.org/changeset/base/348583 Log: 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: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Mon Jun 3 20:45:32 2019 (r348582) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Mon Jun 3 20:45:48 2019 (r348583) @@ -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: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c Mon Jun 3 20:45:32 2019 (r348582) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c Mon Jun 3 20:45:48 2019 (r348583) @@ -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-all@freebsd.org Mon Jun 3 20:49:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 20:52:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E460015BDBB5; Mon, 3 Jun 2019 20:52:20 +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 89F816F402; Mon, 3 Jun 2019 20:52:20 +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 64127B7CA; Mon, 3 Jun 2019 20:52:20 +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 x53KqKhh048062; Mon, 3 Jun 2019 20:52:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53KqKvX048061; Mon, 3 Jun 2019 20:52:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906032052.x53KqKvX048061@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:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348585 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 348585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89F816F402 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 20:52:21 -0000 Author: mav Date: Mon Jun 3 20:52:19 2019 New Revision: 348585 URL: https://svnweb.freebsd.org/changeset/base/348585 Log: 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 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 20:49:20 2019 (r348584) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Mon Jun 3 20:52:19 2019 (r348585) @@ -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. */ @@ -57,6 +57,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) { @@ -313,6 +328,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 same device. But we @@ -374,6 +399,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); @@ -397,6 +435,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); + } } /* @@ -443,6 +485,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-all@freebsd.org Mon Jun 3 20:55:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 21:03:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1195E15BE0A6; Mon, 3 Jun 2019 21:03:30 +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 AA5426FB85; Mon, 3 Jun 2019 21:03:29 +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 8737DB98E; Mon, 3 Jun 2019 21:03:29 +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 x53L3TQq055441; Mon, 3 Jun 2019 21:03:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53L3SnL055434; Mon, 3 Jun 2019 21:03:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906032103.x53L3SnL055434@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 21:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348587 - in stable/12: lib/geom/eli sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12: lib/geom/eli sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 348587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5426FB85 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 21:03:30 -0000 Author: jhb Date: Mon Jun 3 21:03:28 2019 New Revision: 348587 URL: https://svnweb.freebsd.org/changeset/base/348587 Log: MFC 348206,348231,348454: GELI crypto deprecation warnings. 348206: Add deprecation warnings for weaker algorithms to geli(4). - Triple DES has been formally deprecated in Kerberos (RFC 8429) and is soon to be deprecated in IPsec (RFC 8221). - Blowfish is deprecated. FreeBSD doesn't support its successor (Twofish). - MD5 is generally considered a weak digest that has known attacks. geli refuses to create new volumes using these algorithms via 'geli init'. It also warns when attaching to existing volumes or creating temporary volumes via 'geli onetime' . The plan is to fully remove support for these algorithms in FreeBSD 13. Note that none of these algorithms have ever been the default algorithm used by geli(8). Users would have had to explicitly select these algorithms when creating volumes in the past. 348231: Correct the argument passed to g_eli_algo2str() 348454: Remove tests for the deprecated algorithms in r348206 The tests are failing because the return value and output have changed, but before test code structure adjusted, removing these test cases help people be able to focus on more important cases. Relnotes: yes Modified: stable/12/lib/geom/eli/geli.8 stable/12/lib/geom/eli/geom_eli.c stable/12/sys/geom/eli/g_eli.c stable/12/tests/sys/geom/class/eli/conf.sh stable/12/tests/sys/geom/class/eli/init_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/geom/eli/geli.8 ============================================================================== --- stable/12/lib/geom/eli/geli.8 Mon Jun 3 20:55:52 2019 (r348586) +++ stable/12/lib/geom/eli/geli.8 Mon Jun 3 21:03:28 2019 (r348587) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2018 +.Dd May 23, 2019 .Dt GELI 8 .Os .Sh NAME @@ -877,6 +877,18 @@ specified in .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. +.Sh DEPRECATION NOTICE +Support for the +.Nm Blowfish-CBC +and +.Nm 3DES-CBC +cryptographic algorithms and +.Nm HMAC/MD5 +authentication algorithm will be removed in +.Fx 13.0 . +New volumes cannot be created using these algorithms. +Existing volumes should be migrated to a new volume that uses +non-deprecated algorithms. .Sh EXAMPLES Initialize a provider which is going to be encrypted with a passphrase and random data from a file on the user's pen drive. @@ -1110,7 +1122,7 @@ utility appeared in .Fx 6.0 . Support for the .Nm Camellia -block cipher is implemented by Yoshisato Yanagisawa in +block cipher was implemented by Yoshisato Yanagisawa in .Fx 7.0 . .Pp Highest Modified: stable/12/lib/geom/eli/geom_eli.c ============================================================================== --- stable/12/lib/geom/eli/geom_eli.c Mon Jun 3 20:55:52 2019 (r348586) +++ stable/12/lib/geom/eli/geom_eli.c Mon Jun 3 21:03:28 2019 (r348587) @@ -797,6 +797,22 @@ eli_init(struct gctl_req *req) return; } } + if (md.md_flags & G_ELI_FLAG_AUTH) { + switch (md.md_aalgo) { + case CRYPTO_MD5_HMAC: + gctl_error(req, + "The %s authentication algorithm is deprecated.", + g_eli_algo2str(md.md_aalgo)); + return; + } + } + switch (md.md_ealgo) { + case CRYPTO_3DES_CBC: + case CRYPTO_BLF_CBC: + gctl_error(req, "The %s encryption algorithm is deprecated.", + g_eli_algo2str(md.md_ealgo)); + return; + } val = gctl_get_intmax(req, "keylen"); md.md_keylen = val; md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen); Modified: stable/12/sys/geom/eli/g_eli.c ============================================================================== --- stable/12/sys/geom/eli/g_eli.c Mon Jun 3 20:55:52 2019 (r348586) +++ stable/12/sys/geom/eli/g_eli.c Mon Jun 3 21:03:28 2019 (r348587) @@ -875,8 +875,25 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, G_ELI_DEBUG(0, "Device %s created.", pp->name); G_ELI_DEBUG(0, "Encryption: %s %u", g_eli_algo2str(sc->sc_ealgo), sc->sc_ekeylen); - if (sc->sc_flags & G_ELI_FLAG_AUTH) + switch (sc->sc_ealgo) { + case CRYPTO_3DES_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with 3des"); + break; + case CRYPTO_BLF_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with blowfish"); + break; + } + if (sc->sc_flags & G_ELI_FLAG_AUTH) { G_ELI_DEBUG(0, " Integrity: %s", g_eli_algo2str(sc->sc_aalgo)); + switch (sc->sc_aalgo) { + case CRYPTO_MD5_HMAC: + gone_in(13, + "support for GEOM_ELI volumes authenticated with hmac/md5"); + break; + } + } G_ELI_DEBUG(0, " Crypto: %s", sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); Modified: stable/12/tests/sys/geom/class/eli/conf.sh ============================================================================== --- stable/12/tests/sys/geom/class/eli/conf.sh Mon Jun 3 20:55:52 2019 (r348586) +++ stable/12/tests/sys/geom/class/eli/conf.sh Mon Jun 3 21:03:28 2019 (r348587) @@ -37,15 +37,10 @@ for_each_geli_config() { for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ + for aalgo in hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 $MAX_SECSIZE; do ${func} $cipher $aalgo $secsize @@ -66,11 +61,6 @@ for_each_geli_config_nointegrity() { md=$(attach_md -t malloc -s $bytes) for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} Modified: stable/12/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- stable/12/tests/sys/geom/class/eli/init_test.sh Mon Jun 3 20:55:52 2019 (r348586) +++ stable/12/tests/sys/geom/class/eli/init_test.sh Mon Jun 3 21:03:28 2019 (r348587) @@ -308,13 +308,6 @@ init_alias_body() atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ - 3des:0:3DES-CBC:192 3des:192:3DES-CBC:192 \ - blowfish:0:Blowfish-CBC:128 blowfish:128:Blowfish-CBC:128 \ - blowfish:160:Blowfish-CBC:160 blowfish:192:Blowfish-CBC:192 \ - blowfish:224:Blowfish-CBC:224 blowfish:256:Blowfish-CBC:256 \ - blowfish:288:Blowfish-CBC:288 blowfish:352:Blowfish-CBC:352 \ - blowfish:384:Blowfish-CBC:384 blowfish:416:Blowfish-CBC:416 \ - blowfish:448:Blowfish-CBC:448 \ camellia:0:CAMELLIA-CBC:128 camellia:128:CAMELLIA-CBC:128 \ camellia:256:CAMELLIA-CBC:256 ; do From owner-svn-src-all@freebsd.org Mon Jun 3 21:04:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C03D315BE118; Mon, 3 Jun 2019 21:04:25 +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 4408F6FCC1; Mon, 3 Jun 2019 21:04:25 +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 1EFC7B98F; Mon, 3 Jun 2019 21:04:25 +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 x53L4Pwm055525; Mon, 3 Jun 2019 21:04:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53L4ORr055520; Mon, 3 Jun 2019 21:04:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906032104.x53L4ORr055520@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 21:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348588 - in stable/11: sbin/geom/class/eli sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: sbin/geom/class/eli sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 348588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4408F6FCC1 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 21:04:26 -0000 Author: jhb Date: Mon Jun 3 21:04:23 2019 New Revision: 348588 URL: https://svnweb.freebsd.org/changeset/base/348588 Log: MFC 348206,348231,348454: GELI crypto deprecation warnings. 348206: Add deprecation warnings for weaker algorithms to geli(4). - Triple DES has been formally deprecated in Kerberos (RFC 8429) and is soon to be deprecated in IPsec (RFC 8221). - Blowfish is deprecated. FreeBSD doesn't support its successor (Twofish). - MD5 is generally considered a weak digest that has known attacks. geli refuses to create new volumes using these algorithms via 'geli init'. It also warns when attaching to existing volumes or creating temporary volumes via 'geli onetime' . The plan is to fully remove support for these algorithms in FreeBSD 13. Note that none of these algorithms have ever been the default algorithm used by geli(8). Users would have had to explicitly select these algorithms when creating volumes in the past. 348231: Correct the argument passed to g_eli_algo2str() 348454: Remove tests for the deprecated algorithms in r348206 The tests are failing because the return value and output have changed, but before test code structure adjusted, removing these test cases help people be able to focus on more important cases. Approved by: re (gjb) Relnotes: yes Modified: stable/11/sbin/geom/class/eli/geli.8 stable/11/sbin/geom/class/eli/geom_eli.c stable/11/sys/geom/eli/g_eli.c stable/11/tests/sys/geom/class/eli/conf.sh stable/11/tests/sys/geom/class/eli/init_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/11/sbin/geom/class/eli/geli.8 Mon Jun 3 21:03:28 2019 (r348587) +++ stable/11/sbin/geom/class/eli/geli.8 Mon Jun 3 21:04:23 2019 (r348588) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2018 +.Dd May 23, 2019 .Dt GELI 8 .Os .Sh NAME @@ -856,6 +856,18 @@ specified in .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. +.Sh DEPRECATION NOTICE +Support for the +.Nm Blowfish-CBC +and +.Nm 3DES-CBC +cryptographic algorithms and +.Nm HMAC/MD5 +authentication algorithm will be removed in +.Fx 13.0 . +New volumes cannot be created using these algorithms. +Existing volumes should be migrated to a new volume that uses +non-deprecated algorithms. .Sh EXAMPLES Initialize a provider which is going to be encrypted with a passphrase and random data from a file on the user's pen drive. @@ -1089,7 +1101,7 @@ utility appeared in .Fx 6.0 . Support for the .Nm Camellia -block cipher is implemented by Yoshisato Yanagisawa in +block cipher was implemented by Yoshisato Yanagisawa in .Fx 7.0 . .Pp Highest Modified: stable/11/sbin/geom/class/eli/geom_eli.c ============================================================================== --- stable/11/sbin/geom/class/eli/geom_eli.c Mon Jun 3 21:03:28 2019 (r348587) +++ stable/11/sbin/geom/class/eli/geom_eli.c Mon Jun 3 21:04:23 2019 (r348588) @@ -781,6 +781,22 @@ eli_init(struct gctl_req *req) return; } } + if (md.md_flags & G_ELI_FLAG_AUTH) { + switch (md.md_aalgo) { + case CRYPTO_MD5_HMAC: + gctl_error(req, + "The %s authentication algorithm is deprecated.", + g_eli_algo2str(md.md_aalgo)); + return; + } + } + switch (md.md_ealgo) { + case CRYPTO_3DES_CBC: + case CRYPTO_BLF_CBC: + gctl_error(req, "The %s encryption algorithm is deprecated.", + g_eli_algo2str(md.md_ealgo)); + return; + } val = gctl_get_intmax(req, "keylen"); md.md_keylen = val; md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen); Modified: stable/11/sys/geom/eli/g_eli.c ============================================================================== --- stable/11/sys/geom/eli/g_eli.c Mon Jun 3 21:03:28 2019 (r348587) +++ stable/11/sys/geom/eli/g_eli.c Mon Jun 3 21:04:23 2019 (r348588) @@ -873,8 +873,25 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, G_ELI_DEBUG(0, "Device %s created.", pp->name); G_ELI_DEBUG(0, "Encryption: %s %u", g_eli_algo2str(sc->sc_ealgo), sc->sc_ekeylen); - if (sc->sc_flags & G_ELI_FLAG_AUTH) + switch (sc->sc_ealgo) { + case CRYPTO_3DES_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with 3des"); + break; + case CRYPTO_BLF_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with blowfish"); + break; + } + if (sc->sc_flags & G_ELI_FLAG_AUTH) { G_ELI_DEBUG(0, " Integrity: %s", g_eli_algo2str(sc->sc_aalgo)); + switch (sc->sc_aalgo) { + case CRYPTO_MD5_HMAC: + gone_in(13, + "support for GEOM_ELI volumes authenticated with hmac/md5"); + break; + } + } G_ELI_DEBUG(0, " Crypto: %s", sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); Modified: stable/11/tests/sys/geom/class/eli/conf.sh ============================================================================== --- stable/11/tests/sys/geom/class/eli/conf.sh Mon Jun 3 21:03:28 2019 (r348587) +++ stable/11/tests/sys/geom/class/eli/conf.sh Mon Jun 3 21:04:23 2019 (r348588) @@ -37,15 +37,10 @@ for_each_geli_config() { for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ + for aalgo in hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 $MAX_SECSIZE; do ${func} $cipher $aalgo $secsize @@ -66,11 +61,6 @@ for_each_geli_config_nointegrity() { md=$(attach_md -t malloc -s $bytes) for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} Modified: stable/11/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- stable/11/tests/sys/geom/class/eli/init_test.sh Mon Jun 3 21:03:28 2019 (r348587) +++ stable/11/tests/sys/geom/class/eli/init_test.sh Mon Jun 3 21:04:23 2019 (r348588) @@ -308,13 +308,6 @@ init_alias_body() atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ - 3des:0:3DES-CBC:192 3des:192:3DES-CBC:192 \ - blowfish:0:Blowfish-CBC:128 blowfish:128:Blowfish-CBC:128 \ - blowfish:160:Blowfish-CBC:160 blowfish:192:Blowfish-CBC:192 \ - blowfish:224:Blowfish-CBC:224 blowfish:256:Blowfish-CBC:256 \ - blowfish:288:Blowfish-CBC:288 blowfish:352:Blowfish-CBC:352 \ - blowfish:384:Blowfish-CBC:384 blowfish:416:Blowfish-CBC:416 \ - blowfish:448:Blowfish-CBC:448 \ camellia:0:CAMELLIA-CBC:128 camellia:128:CAMELLIA-CBC:128 \ camellia:256:CAMELLIA-CBC:256 ; do From owner-svn-src-all@freebsd.org Mon Jun 3 21:29:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 21:40:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 22:58:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 23:07:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 23:17:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Mon Jun 3 23:57:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 00:01:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 00:42:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 371B915C2991; Tue, 4 Jun 2019 00:42: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 D3315770E0; Tue, 4 Jun 2019 00:42: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 AFFC8E061; Tue, 4 Jun 2019 00:42: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 x540gq0D070941; Tue, 4 Jun 2019 00:42:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x540gpNl070935; Tue, 4 Jun 2019 00:42:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906040042.x540gpNl070935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Jun 2019 00:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348596 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor-sys X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3315770E0 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 00:42:53 -0000 Author: mav Date: Tue Jun 4 00:42:51 2019 New Revision: 348596 URL: https://svnweb.freebsd.org/changeset/base/348596 Log: 9689 zfs range lock code should not be zpl-specific illumos/illumos-gate@7931524763ef94dc16989451dddd206563d03bb4 Reviewed by: Serapheim Dimitropoulos Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_rlock.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_rlock.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Tue Jun 4 00:01:37 2019 (r348595) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Tue Jun 4 00:42:51 2019 (r348596) @@ -75,6 +75,7 @@ struct nvlist; struct arc_buf; struct zio_prop; struct sa_handle; +struct locked_range; typedef struct objset objset_t; typedef struct dmu_tx dmu_tx_t; @@ -941,7 +942,7 @@ typedef struct zgd { struct lwb *zgd_lwb; struct blkptr *zgd_bp; dmu_buf_t *zgd_db; - struct rl *zgd_rl; + struct locked_range *zgd_lr; void *zgd_private; } zgd_t; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_rlock.h Tue Jun 4 00:01:37 2019 (r348595) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_rlock.h Tue Jun 4 00:42:51 2019 (r348596) @@ -22,6 +22,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2018 by Delphix. All rights reserved. + */ #ifndef _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H @@ -30,54 +33,44 @@ extern "C" { #endif -#ifdef _KERNEL - -#include - typedef enum { RL_READER, RL_WRITER, RL_APPEND -} rl_type_t; +} rangelock_type_t; -typedef struct rl { - znode_t *r_zp; /* znode this lock applies to */ - avl_node_t r_node; /* avl node link */ - uint64_t r_off; /* file range offset */ - uint64_t r_len; /* file range length */ - uint_t r_cnt; /* range reference count in tree */ - rl_type_t r_type; /* range type */ - kcondvar_t r_wr_cv; /* cv for waiting writers */ - kcondvar_t r_rd_cv; /* cv for waiting readers */ - uint8_t r_proxy; /* acting for original range */ - uint8_t r_write_wanted; /* writer wants to lock this range */ - uint8_t r_read_wanted; /* reader wants to lock this range */ -} rl_t; +struct locked_range; -/* - * Lock a range (offset, length) as either shared (RL_READER) - * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that - * is converted to RL_WRITER that specified to lock from the start of the - * end of file. Returns the range lock structure. - */ -rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); +typedef void (rangelock_cb_t)(struct locked_range *, void *); -/* Unlock range and destroy range lock structure. */ -void zfs_range_unlock(rl_t *rl); +typedef struct rangelock { + avl_tree_t rl_tree; /* contains locked_range_t */ + kmutex_t rl_lock; + rangelock_cb_t *rl_cb; + void *rl_arg; +} rangelock_t; -/* - * Reduce range locked as RW_WRITER from whole file to specified range. - * Asserts the whole file was previously locked. - */ -void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); +typedef struct locked_range { + rangelock_t *lr_rangelock; /* rangelock that this lock applies to */ + avl_node_t lr_node; /* avl node link */ + uint64_t lr_offset; /* file range offset */ + uint64_t lr_length; /* file range length */ + uint_t lr_count; /* range reference count in tree */ + rangelock_type_t lr_type; /* range type */ + kcondvar_t lr_write_cv; /* cv for waiting writers */ + kcondvar_t lr_read_cv; /* cv for waiting readers */ + uint8_t lr_proxy; /* acting for original range */ + uint8_t lr_write_wanted; /* writer wants to lock this range */ + uint8_t lr_read_wanted; /* reader wants to lock this range */ +} locked_range_t; -/* - * AVL comparison function used to order range locks - * Locks are ordered on the start offset of the range. - */ -int zfs_range_compare(const void *arg1, const void *arg2); +void rangelock_init(rangelock_t *, rangelock_cb_t *, void *); +void rangelock_fini(rangelock_t *); -#endif /* _KERNEL */ +locked_range_t *rangelock_enter(rangelock_t *, + uint64_t, uint64_t, rangelock_type_t); +void rangelock_exit(locked_range_t *); +void rangelock_reduce(locked_range_t *, uint64_t, uint64_t); #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Tue Jun 4 00:01:37 2019 (r348595) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Tue Jun 4 00:42:51 2019 (r348596) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ @@ -39,6 +39,7 @@ #include #include #include +#include #endif #include #include @@ -60,8 +61,8 @@ extern "C" { #define ZFS_APPENDONLY 0x0000004000000000 #define ZFS_NODUMP 0x0000008000000000 #define ZFS_OPAQUE 0x0000010000000000 -#define ZFS_AV_QUARANTINED 0x0000020000000000 -#define ZFS_AV_MODIFIED 0x0000040000000000 +#define ZFS_AV_QUARANTINED 0x0000020000000000 +#define ZFS_AV_MODIFIED 0x0000040000000000 #define ZFS_REPARSE 0x0000080000000000 #define ZFS_OFFLINE 0x0000100000000000 #define ZFS_SPARSE 0x0000200000000000 @@ -81,8 +82,8 @@ extern "C" { */ #define ZFS_XATTR 0x1 /* is an extended attribute */ #define ZFS_INHERIT_ACE 0x2 /* ace has inheritable ACEs */ -#define ZFS_ACL_TRIVIAL 0x4 /* files ACL is trivial */ -#define ZFS_ACL_OBJ_ACE 0x8 /* ACL has CMPLX Object ACE */ +#define ZFS_ACL_TRIVIAL 0x4 /* files ACL is trivial */ +#define ZFS_ACL_OBJ_ACE 0x8 /* ACL has CMPLX Object ACE */ #define ZFS_ACL_PROTECTED 0x10 /* ACL protected */ #define ZFS_ACL_DEFAULTED 0x20 /* ACL should be defaulted */ #define ZFS_ACL_AUTO_INHERIT 0x40 /* ACL should be inherited */ @@ -176,8 +177,7 @@ typedef struct znode { krwlock_t z_parent_lock; /* parent lock for directories */ krwlock_t z_name_lock; /* "master" lock for dirent locks */ zfs_dirlock_t *z_dirlocks; /* directory entry lock list */ - kmutex_t z_range_lock; /* protects changes to z_range_avl */ - avl_tree_t z_range_avl; /* avl tree of file range locks */ + rangelock_t z_rangelock; /* file range locks */ uint8_t z_unlinked; /* file has been unlinked */ uint8_t z_atime_dirty; /* atime needs to be synced */ uint8_t z_zn_prefetch; /* Prefetch znodes? */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_rlock.c Tue Jun 4 00:01:37 2019 (r348595) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_rlock.c Tue Jun 4 00:42:51 2019 (r348596) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. */ /* @@ -34,9 +34,9 @@ * Interface * --------- * Defined in zfs_rlock.h but essentially: - * rl = zfs_range_lock(zp, off, len, lock_type); - * zfs_range_unlock(rl); - * zfs_range_reduce(rl, off, len); + * lr = rangelock_enter(zp, off, len, lock_type); + * rangelock_reduce(lr, off, len); // optional + * rangelock_exit(lr); * * AVL tree * -------- @@ -46,9 +46,10 @@ * * Common case * ----------- - * The (hopefully) usual case is of no overlaps or contention for - * locks. On entry to zfs_lock_range() a rl_t is allocated; the tree - * searched that finds no overlap, and *this* rl_t is placed in the tree. + * The (hopefully) usual case is of no overlaps or contention for locks. On + * entry to rangelock_enter(), a locked_range_t is allocated; the tree + * searched that finds no overlap, and *this* locked_range_t is placed in the + * tree. * * Overlaps/Reference counting/Proxy locks * --------------------------------------- @@ -87,67 +88,89 @@ * * Grow block handling * ------------------- - * ZFS supports multiple block sizes currently upto 128K. The smallest + * ZFS supports multiple block sizes, up to 16MB. The smallest * block size is used for the file which is grown as needed. During this * growth all other writers and readers must be excluded. * So if the block size needs to be grown then the whole file is * exclusively locked, then later the caller will reduce the lock - * range to just the range to be written using zfs_reduce_range. + * range to just the range to be written using rangelock_reduce(). */ +#include #include /* + * AVL comparison function used to order range locks + * Locks are ordered on the start offset of the range. + */ +static int +rangelock_compare(const void *arg1, const void *arg2) +{ + const locked_range_t *rl1 = arg1; + const locked_range_t *rl2 = arg2; + + if (rl1->lr_offset > rl2->lr_offset) + return (1); + if (rl1->lr_offset < rl2->lr_offset) + return (-1); + return (0); +} + +/* + * The callback is invoked when acquiring a RL_WRITER or RL_APPEND lock. + * It must convert RL_APPEND to RL_WRITER (starting at the end of the file), + * and may increase the range that's locked for RL_WRITER. + */ +void +rangelock_init(rangelock_t *rl, rangelock_cb_t *cb, void *arg) +{ + mutex_init(&rl->rl_lock, NULL, MUTEX_DEFAULT, NULL); + avl_create(&rl->rl_tree, rangelock_compare, + sizeof (locked_range_t), offsetof(locked_range_t, lr_node)); + rl->rl_cb = cb; + rl->rl_arg = arg; +} + +void +rangelock_fini(rangelock_t *rl) +{ + mutex_destroy(&rl->rl_lock); + avl_destroy(&rl->rl_tree); +} + +/* * Check if a write lock can be grabbed, or wait and recheck until available. */ static void -zfs_range_lock_writer(znode_t *zp, rl_t *new) +rangelock_enter_writer(rangelock_t *rl, locked_range_t *new) { - avl_tree_t *tree = &zp->z_range_avl; - rl_t *rl; + avl_tree_t *tree = &rl->rl_tree; + locked_range_t *lr; avl_index_t where; - uint64_t end_size; - uint64_t off = new->r_off; - uint64_t len = new->r_len; + uint64_t orig_off = new->lr_offset; + uint64_t orig_len = new->lr_length; + rangelock_type_t orig_type = new->lr_type; for (;;) { /* - * Range locking is also used by zvol and uses a - * dummied up znode. However, for zvol, we don't need to - * append or grow blocksize, and besides we don't have - * a "sa" data or z_zfsvfs - so skip that processing. - * - * Yes, this is ugly, and would be solved by not handling - * grow or append in range lock code. If that was done then - * we could make the range locking code generically available - * to other non-zfs consumers. + * Call callback which can modify new->r_off,len,type. + * Note, the callback is used by the ZPL to handle appending + * and changing blocksizes. It isn't needed for zvols. */ - if (zp->z_vnode) { /* caller is ZPL */ - /* - * If in append mode pick up the current end of file. - * This is done under z_range_lock to avoid races. - */ - if (new->r_type == RL_APPEND) - new->r_off = zp->z_size; - - /* - * If we need to grow the block size then grab the whole - * file range. This is also done under z_range_lock to - * avoid races. - */ - end_size = MAX(zp->z_size, new->r_off + len); - if (end_size > zp->z_blksz && (!ISP2(zp->z_blksz) || - zp->z_blksz < zp->z_zfsvfs->z_max_blksz)) { - new->r_off = 0; - new->r_len = UINT64_MAX; - } + if (rl->rl_cb != NULL) { + rl->rl_cb(new, rl->rl_arg); } /* + * If the type was APPEND, the callback must convert it to + * WRITER. + */ + ASSERT3U(new->lr_type, ==, RL_WRITER); + + /* * First check for the usual case of no locks */ if (avl_numnodes(tree) == 0) { - new->r_type = RL_WRITER; /* convert to writer */ avl_add(tree, new); return; } @@ -155,31 +178,33 @@ zfs_range_lock_writer(znode_t *zp, rl_t *new) /* * Look for any locks in the range. */ - rl = avl_find(tree, new, &where); - if (rl) + lr = avl_find(tree, new, &where); + if (lr != NULL) goto wait; /* already locked at same offset */ - rl = (rl_t *)avl_nearest(tree, where, AVL_AFTER); - if (rl && (rl->r_off < new->r_off + new->r_len)) + lr = (locked_range_t *)avl_nearest(tree, where, AVL_AFTER); + if (lr != NULL && + lr->lr_offset < new->lr_offset + new->lr_length) goto wait; - rl = (rl_t *)avl_nearest(tree, where, AVL_BEFORE); - if (rl && rl->r_off + rl->r_len > new->r_off) + lr = (locked_range_t *)avl_nearest(tree, where, AVL_BEFORE); + if (lr != NULL && + lr->lr_offset + lr->lr_length > new->lr_offset) goto wait; - new->r_type = RL_WRITER; /* convert possible RL_APPEND */ avl_insert(tree, new, where); return; wait: - if (!rl->r_write_wanted) { - cv_init(&rl->r_wr_cv, NULL, CV_DEFAULT, NULL); - rl->r_write_wanted = B_TRUE; + if (!lr->lr_write_wanted) { + cv_init(&lr->lr_write_cv, NULL, CV_DEFAULT, NULL); + lr->lr_write_wanted = B_TRUE; } - cv_wait(&rl->r_wr_cv, &zp->z_range_lock); + cv_wait(&lr->lr_write_cv, &rl->rl_lock); /* reset to original */ - new->r_off = off; - new->r_len = len; + new->lr_offset = orig_off; + new->lr_length = orig_len; + new->lr_type = orig_type; } } @@ -187,29 +212,29 @@ wait: * If this is an original (non-proxy) lock then replace it by * a proxy and return the proxy. */ -static rl_t * -zfs_range_proxify(avl_tree_t *tree, rl_t *rl) +static locked_range_t * +rangelock_proxify(avl_tree_t *tree, locked_range_t *lr) { - rl_t *proxy; + locked_range_t *proxy; - if (rl->r_proxy) - return (rl); /* already a proxy */ + if (lr->lr_proxy) + return (lr); /* already a proxy */ - ASSERT3U(rl->r_cnt, ==, 1); - ASSERT(rl->r_write_wanted == B_FALSE); - ASSERT(rl->r_read_wanted == B_FALSE); - avl_remove(tree, rl); - rl->r_cnt = 0; + ASSERT3U(lr->lr_count, ==, 1); + ASSERT(lr->lr_write_wanted == B_FALSE); + ASSERT(lr->lr_read_wanted == B_FALSE); + avl_remove(tree, lr); + lr->lr_count = 0; /* create a proxy range lock */ - proxy = kmem_alloc(sizeof (rl_t), KM_SLEEP); - proxy->r_off = rl->r_off; - proxy->r_len = rl->r_len; - proxy->r_cnt = 1; - proxy->r_type = RL_READER; - proxy->r_proxy = B_TRUE; - proxy->r_write_wanted = B_FALSE; - proxy->r_read_wanted = B_FALSE; + proxy = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + proxy->lr_offset = lr->lr_offset; + proxy->lr_length = lr->lr_length; + proxy->lr_count = 1; + proxy->lr_type = RL_READER; + proxy->lr_proxy = B_TRUE; + proxy->lr_write_wanted = B_FALSE; + proxy->lr_read_wanted = B_FALSE; avl_add(tree, proxy); return (proxy); @@ -219,29 +244,27 @@ zfs_range_proxify(avl_tree_t *tree, rl_t *rl) * Split the range lock at the supplied offset * returning the *front* proxy. */ -static rl_t * -zfs_range_split(avl_tree_t *tree, rl_t *rl, uint64_t off) +static locked_range_t * +rangelock_split(avl_tree_t *tree, locked_range_t *lr, uint64_t off) { - rl_t *front, *rear; + ASSERT3U(lr->lr_length, >, 1); + ASSERT3U(off, >, lr->lr_offset); + ASSERT3U(off, <, lr->lr_offset + lr->lr_length); + ASSERT(lr->lr_write_wanted == B_FALSE); + ASSERT(lr->lr_read_wanted == B_FALSE); - ASSERT3U(rl->r_len, >, 1); - ASSERT3U(off, >, rl->r_off); - ASSERT3U(off, <, rl->r_off + rl->r_len); - ASSERT(rl->r_write_wanted == B_FALSE); - ASSERT(rl->r_read_wanted == B_FALSE); - /* create the rear proxy range lock */ - rear = kmem_alloc(sizeof (rl_t), KM_SLEEP); - rear->r_off = off; - rear->r_len = rl->r_off + rl->r_len - off; - rear->r_cnt = rl->r_cnt; - rear->r_type = RL_READER; - rear->r_proxy = B_TRUE; - rear->r_write_wanted = B_FALSE; - rear->r_read_wanted = B_FALSE; + locked_range_t *rear = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + rear->lr_offset = off; + rear->lr_length = lr->lr_offset + lr->lr_length - off; + rear->lr_count = lr->lr_count; + rear->lr_type = RL_READER; + rear->lr_proxy = B_TRUE; + rear->lr_write_wanted = B_FALSE; + rear->lr_read_wanted = B_FALSE; - front = zfs_range_proxify(tree, rl); - front->r_len = off - rl->r_off; + locked_range_t *front = rangelock_proxify(tree, lr); + front->lr_length = off - lr->lr_offset; avl_insert_here(tree, rear, front, AVL_AFTER); return (front); @@ -251,28 +274,27 @@ zfs_range_split(avl_tree_t *tree, rl_t *rl, uint64_t o * Create and add a new proxy range lock for the supplied range. */ static void -zfs_range_new_proxy(avl_tree_t *tree, uint64_t off, uint64_t len) +rangelock_new_proxy(avl_tree_t *tree, uint64_t off, uint64_t len) { - rl_t *rl; - - ASSERT(len); - rl = kmem_alloc(sizeof (rl_t), KM_SLEEP); - rl->r_off = off; - rl->r_len = len; - rl->r_cnt = 1; - rl->r_type = RL_READER; - rl->r_proxy = B_TRUE; - rl->r_write_wanted = B_FALSE; - rl->r_read_wanted = B_FALSE; - avl_add(tree, rl); + ASSERT(len != 0); + locked_range_t *lr = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + lr->lr_offset = off; + lr->lr_length = len; + lr->lr_count = 1; + lr->lr_type = RL_READER; + lr->lr_proxy = B_TRUE; + lr->lr_write_wanted = B_FALSE; + lr->lr_read_wanted = B_FALSE; + avl_add(tree, lr); } static void -zfs_range_add_reader(avl_tree_t *tree, rl_t *new, rl_t *prev, avl_index_t where) +rangelock_add_reader(avl_tree_t *tree, locked_range_t *new, + locked_range_t *prev, avl_index_t where) { - rl_t *next; - uint64_t off = new->r_off; - uint64_t len = new->r_len; + locked_range_t *next; + uint64_t off = new->lr_offset; + uint64_t len = new->lr_length; /* * prev arrives either: @@ -281,37 +303,37 @@ zfs_range_add_reader(avl_tree_t *tree, rl_t *new, rl_t * range may overlap with the new range * - null, if there were no ranges starting before the new one */ - if (prev) { - if (prev->r_off + prev->r_len <= off) { + if (prev != NULL) { + if (prev->lr_offset + prev->lr_length <= off) { prev = NULL; - } else if (prev->r_off != off) { + } else if (prev->lr_offset != off) { /* * convert to proxy if needed then * split this entry and bump ref count */ - prev = zfs_range_split(tree, prev, off); + prev = rangelock_split(tree, prev, off); prev = AVL_NEXT(tree, prev); /* move to rear range */ } } - ASSERT((prev == NULL) || (prev->r_off == off)); + ASSERT((prev == NULL) || (prev->lr_offset == off)); - if (prev) + if (prev != NULL) next = prev; else - next = (rl_t *)avl_nearest(tree, where, AVL_AFTER); + next = avl_nearest(tree, where, AVL_AFTER); - if (next == NULL || off + len <= next->r_off) { + if (next == NULL || off + len <= next->lr_offset) { /* no overlaps, use the original new rl_t in the tree */ avl_insert(tree, new, where); return; } - if (off < next->r_off) { + if (off < next->lr_offset) { /* Add a proxy for initial range before the overlap */ - zfs_range_new_proxy(tree, off, next->r_off - off); + rangelock_new_proxy(tree, off, next->lr_offset - off); } - new->r_cnt = 0; /* will use proxies in tree */ + new->lr_count = 0; /* will use proxies in tree */ /* * We now search forward through the ranges, until we go past the end * of the new range. For each entry we make it a proxy if it @@ -319,47 +341,51 @@ zfs_range_add_reader(avl_tree_t *tree, rl_t *new, rl_t * gaps between the ranges then we create a new proxy range. */ for (prev = NULL; next; prev = next, next = AVL_NEXT(tree, next)) { - if (off + len <= next->r_off) + if (off + len <= next->lr_offset) break; - if (prev && prev->r_off + prev->r_len < next->r_off) { + if (prev != NULL && prev->lr_offset + prev->lr_length < + next->lr_offset) { /* there's a gap */ - ASSERT3U(next->r_off, >, prev->r_off + prev->r_len); - zfs_range_new_proxy(tree, prev->r_off + prev->r_len, - next->r_off - (prev->r_off + prev->r_len)); + ASSERT3U(next->lr_offset, >, + prev->lr_offset + prev->lr_length); + rangelock_new_proxy(tree, + prev->lr_offset + prev->lr_length, + next->lr_offset - + (prev->lr_offset + prev->lr_length)); } - if (off + len == next->r_off + next->r_len) { + if (off + len == next->lr_offset + next->lr_length) { /* exact overlap with end */ - next = zfs_range_proxify(tree, next); - next->r_cnt++; + next = rangelock_proxify(tree, next); + next->lr_count++; return; } - if (off + len < next->r_off + next->r_len) { + if (off + len < next->lr_offset + next->lr_length) { /* new range ends in the middle of this block */ - next = zfs_range_split(tree, next, off + len); - next->r_cnt++; + next = rangelock_split(tree, next, off + len); + next->lr_count++; return; } - ASSERT3U(off + len, >, next->r_off + next->r_len); - next = zfs_range_proxify(tree, next); - next->r_cnt++; + ASSERT3U(off + len, >, next->lr_offset + next->lr_length); + next = rangelock_proxify(tree, next); + next->lr_count++; } /* Add the remaining end range. */ - zfs_range_new_proxy(tree, prev->r_off + prev->r_len, - (off + len) - (prev->r_off + prev->r_len)); + rangelock_new_proxy(tree, prev->lr_offset + prev->lr_length, + (off + len) - (prev->lr_offset + prev->lr_length)); } /* * Check if a reader lock can be grabbed, or wait and recheck until available. */ static void -zfs_range_lock_reader(znode_t *zp, rl_t *new) +rangelock_enter_reader(rangelock_t *rl, locked_range_t *new) { - avl_tree_t *tree = &zp->z_range_avl; - rl_t *prev, *next; + avl_tree_t *tree = &rl->rl_tree; + locked_range_t *prev, *next; avl_index_t where; - uint64_t off = new->r_off; - uint64_t len = new->r_len; + uint64_t off = new->lr_offset; + uint64_t len = new->lr_length; /* * Look for any writer locks in the range. @@ -367,21 +393,22 @@ zfs_range_lock_reader(znode_t *zp, rl_t *new) retry: prev = avl_find(tree, new, &where); if (prev == NULL) - prev = (rl_t *)avl_nearest(tree, where, AVL_BEFORE); + prev = (locked_range_t *)avl_nearest(tree, where, AVL_BEFORE); /* * Check the previous range for a writer lock overlap. */ - if (prev && (off < prev->r_off + prev->r_len)) { - if ((prev->r_type == RL_WRITER) || (prev->r_write_wanted)) { - if (!prev->r_read_wanted) { - cv_init(&prev->r_rd_cv, NULL, CV_DEFAULT, NULL); - prev->r_read_wanted = B_TRUE; + if (prev && (off < prev->lr_offset + prev->lr_length)) { + if ((prev->lr_type == RL_WRITER) || (prev->lr_write_wanted)) { + if (!prev->lr_read_wanted) { + cv_init(&prev->lr_read_cv, + NULL, CV_DEFAULT, NULL); + prev->lr_read_wanted = B_TRUE; } - cv_wait(&prev->r_rd_cv, &zp->z_range_lock); + cv_wait(&prev->lr_read_cv, &rl->rl_lock); goto retry; } - if (off + len < prev->r_off + prev->r_len) + if (off + len < prev->lr_offset + prev->lr_length) goto got_lock; } @@ -389,70 +416,71 @@ retry: * Search through the following ranges to see if there's * write lock any overlap. */ - if (prev) + if (prev != NULL) next = AVL_NEXT(tree, prev); else - next = (rl_t *)avl_nearest(tree, where, AVL_AFTER); - for (; next; next = AVL_NEXT(tree, next)) { - if (off + len <= next->r_off) + next = (locked_range_t *)avl_nearest(tree, where, AVL_AFTER); + for (; next != NULL; next = AVL_NEXT(tree, next)) { + if (off + len <= next->lr_offset) goto got_lock; - if ((next->r_type == RL_WRITER) || (next->r_write_wanted)) { - if (!next->r_read_wanted) { - cv_init(&next->r_rd_cv, NULL, CV_DEFAULT, NULL); - next->r_read_wanted = B_TRUE; + if ((next->lr_type == RL_WRITER) || (next->lr_write_wanted)) { + if (!next->lr_read_wanted) { + cv_init(&next->lr_read_cv, + NULL, CV_DEFAULT, NULL); + next->lr_read_wanted = B_TRUE; } - cv_wait(&next->r_rd_cv, &zp->z_range_lock); + cv_wait(&next->lr_read_cv, &rl->rl_lock); goto retry; } - if (off + len <= next->r_off + next->r_len) + if (off + len <= next->lr_offset + next->lr_length) goto got_lock; } got_lock: /* * Add the read lock, which may involve splitting existing - * locks and bumping ref counts (r_cnt). + * locks and bumping ref counts (r_count). */ - zfs_range_add_reader(tree, new, prev, where); + rangelock_add_reader(tree, new, prev, where); } /* - * Lock a range (offset, length) as either shared (RL_READER) - * or exclusive (RL_WRITER). Returns the range lock structure - * for later unlocking or reduce range (if entire file - * previously locked as RL_WRITER). + * Lock a range (offset, length) as either shared (RL_READER) or exclusive + * (RL_WRITER or RL_APPEND). If RL_APPEND is specified, rl_cb() will convert + * it to a RL_WRITER lock (with the offset at the end of the file). Returns + * the range lock structure for later unlocking (or reduce range if the + * entire file is locked as RL_WRITER). */ -rl_t * -zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type) +locked_range_t * +rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type) { - rl_t *new; - ASSERT(type == RL_READER || type == RL_WRITER || type == RL_APPEND); - new = kmem_alloc(sizeof (rl_t), KM_SLEEP); - new->r_zp = zp; - new->r_off = off; + locked_range_t *new = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + new->lr_rangelock = rl; + new->lr_offset = off; if (len + off < off) /* overflow */ len = UINT64_MAX - off; - new->r_len = len; - new->r_cnt = 1; /* assume it's going to be in the tree */ - new->r_type = type; - new->r_proxy = B_FALSE; - new->r_write_wanted = B_FALSE; - new->r_read_wanted = B_FALSE; + new->lr_length = len; + new->lr_count = 1; /* assume it's going to be in the tree */ + new->lr_type = type; + new->lr_proxy = B_FALSE; + new->lr_write_wanted = B_FALSE; + new->lr_read_wanted = B_FALSE; - mutex_enter(&zp->z_range_lock); + mutex_enter(&rl->rl_lock); if (type == RL_READER) { /* * First check for the usual case of no locks */ - if (avl_numnodes(&zp->z_range_avl) == 0) - avl_add(&zp->z_range_avl, new); + if (avl_numnodes(&rl->rl_tree) == 0) + avl_add(&rl->rl_tree, new); else - zfs_range_lock_reader(zp, new); + rangelock_enter_reader(rl, new); } else - zfs_range_lock_writer(zp, new); /* RL_WRITER or RL_APPEND */ - mutex_exit(&zp->z_range_lock); + rangelock_enter_writer(rl, new); /* RL_WRITER or RL_APPEND */ + mutex_exit(&rl->rl_lock); return (new); } @@ -460,10 +488,9 @@ zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len * Unlock a reader lock */ static void -zfs_range_unlock_reader(znode_t *zp, rl_t *remove) +rangelock_exit_reader(rangelock_t *rl, locked_range_t *remove) { - avl_tree_t *tree = &zp->z_range_avl; - rl_t *rl, *next = NULL; + avl_tree_t *tree = &rl->rl_tree; uint64_t len; /* @@ -473,133 +500,118 @@ zfs_range_unlock_reader(znode_t *zp, rl_t *remove) * removed from the tree and replaced by proxies (one or * more ranges mapping to the entire range). */ - if (remove->r_cnt == 1) { + if (remove->lr_count == 1) { avl_remove(tree, remove); - if (remove->r_write_wanted) { - cv_broadcast(&remove->r_wr_cv); - cv_destroy(&remove->r_wr_cv); + if (remove->lr_write_wanted) { + cv_broadcast(&remove->lr_write_cv); + cv_destroy(&remove->lr_write_cv); } - if (remove->r_read_wanted) { - cv_broadcast(&remove->r_rd_cv); - cv_destroy(&remove->r_rd_cv); + if (remove->lr_read_wanted) { + cv_broadcast(&remove->lr_read_cv); + cv_destroy(&remove->lr_read_cv); } } else { - ASSERT0(remove->r_cnt); - ASSERT0(remove->r_write_wanted); - ASSERT0(remove->r_read_wanted); + ASSERT0(remove->lr_count); + ASSERT0(remove->lr_write_wanted); + ASSERT0(remove->lr_read_wanted); /* * Find start proxy representing this reader lock, * then decrement ref count on all proxies * that make up this range, freeing them as needed. */ - rl = avl_find(tree, remove, NULL); - ASSERT(rl); - ASSERT(rl->r_cnt); - ASSERT(rl->r_type == RL_READER); - for (len = remove->r_len; len != 0; rl = next) { - len -= rl->r_len; - if (len) { - next = AVL_NEXT(tree, rl); - ASSERT(next); - ASSERT(rl->r_off + rl->r_len == next->r_off); - ASSERT(next->r_cnt); - ASSERT(next->r_type == RL_READER); + locked_range_t *lr = avl_find(tree, remove, NULL); + ASSERT3P(lr, !=, NULL); + ASSERT3U(lr->lr_count, !=, 0); + ASSERT3U(lr->lr_type, ==, RL_READER); + locked_range_t *next = NULL; + for (len = remove->lr_length; len != 0; lr = next) { + len -= lr->lr_length; + if (len != 0) { + next = AVL_NEXT(tree, lr); + ASSERT3P(next, !=, NULL); + ASSERT3U(lr->lr_offset + lr->lr_length, ==, + next->lr_offset); + ASSERT3U(next->lr_count, !=, 0); + ASSERT3U(next->lr_type, ==, RL_READER); } - rl->r_cnt--; - if (rl->r_cnt == 0) { - avl_remove(tree, rl); - if (rl->r_write_wanted) { - cv_broadcast(&rl->r_wr_cv); - cv_destroy(&rl->r_wr_cv); + lr->lr_count--; + if (lr->lr_count == 0) { + avl_remove(tree, lr); + if (lr->lr_write_wanted) { + cv_broadcast(&lr->lr_write_cv); + cv_destroy(&lr->lr_write_cv); } - if (rl->r_read_wanted) { - cv_broadcast(&rl->r_rd_cv); - cv_destroy(&rl->r_rd_cv); + if (lr->lr_read_wanted) { + cv_broadcast(&lr->lr_read_cv); + cv_destroy(&lr->lr_read_cv); } - kmem_free(rl, sizeof (rl_t)); + kmem_free(lr, sizeof (locked_range_t)); } } } - kmem_free(remove, sizeof (rl_t)); + kmem_free(remove, sizeof (locked_range_t)); } /* * Unlock range and destroy range lock structure. */ void -zfs_range_unlock(rl_t *rl) +rangelock_exit(locked_range_t *lr) { - znode_t *zp = rl->r_zp; + rangelock_t *rl = lr->lr_rangelock; - ASSERT(rl->r_type == RL_WRITER || rl->r_type == RL_READER); - ASSERT(rl->r_cnt == 1 || rl->r_cnt == 0); - ASSERT(!rl->r_proxy); + ASSERT(lr->lr_type == RL_WRITER || lr->lr_type == RL_READER); + ASSERT(lr->lr_count == 1 || lr->lr_count == 0); + ASSERT(!lr->lr_proxy); - mutex_enter(&zp->z_range_lock); - if (rl->r_type == RL_WRITER) { + mutex_enter(&rl->rl_lock); + if (lr->lr_type == RL_WRITER) { /* writer locks can't be shared or split */ - avl_remove(&zp->z_range_avl, rl); - mutex_exit(&zp->z_range_lock); - if (rl->r_write_wanted) { - cv_broadcast(&rl->r_wr_cv); - cv_destroy(&rl->r_wr_cv); + avl_remove(&rl->rl_tree, lr); + mutex_exit(&rl->rl_lock); + if (lr->lr_write_wanted) { + cv_broadcast(&lr->lr_write_cv); + cv_destroy(&lr->lr_write_cv); } - if (rl->r_read_wanted) { - cv_broadcast(&rl->r_rd_cv); - cv_destroy(&rl->r_rd_cv); + if (lr->lr_read_wanted) { + cv_broadcast(&lr->lr_read_cv); + cv_destroy(&lr->lr_read_cv); } - kmem_free(rl, sizeof (rl_t)); + kmem_free(lr, sizeof (locked_range_t)); } else { /* - * lock may be shared, let zfs_range_unlock_reader() + * lock may be shared, let rangelock_exit_reader() * release the lock and free the rl_t */ - zfs_range_unlock_reader(zp, rl); - mutex_exit(&zp->z_range_lock); + rangelock_exit_reader(rl, lr); + mutex_exit(&rl->rl_lock); } } /* * Reduce range locked as RL_WRITER from whole file to specified range. - * Asserts the whole file is exclusivly locked and so there's only one + * Asserts the whole file is exclusively locked and so there's only one * entry in the tree. */ void -zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len) +rangelock_reduce(locked_range_t *lr, uint64_t off, uint64_t len) { - znode_t *zp = rl->r_zp; + rangelock_t *rl = lr->lr_rangelock; /* Ensure there are no other locks */ - ASSERT(avl_numnodes(&zp->z_range_avl) == 1); - ASSERT(rl->r_off == 0); - ASSERT(rl->r_type == RL_WRITER); - ASSERT(!rl->r_proxy); - ASSERT3U(rl->r_len, ==, UINT64_MAX); - ASSERT3U(rl->r_cnt, ==, 1); + ASSERT3U(avl_numnodes(&rl->rl_tree), ==, 1); + ASSERT3U(lr->lr_offset, ==, 0); + ASSERT3U(lr->lr_type, ==, RL_WRITER); + ASSERT(!lr->lr_proxy); + ASSERT3U(lr->lr_length, ==, UINT64_MAX); + ASSERT3U(lr->lr_count, ==, 1); - mutex_enter(&zp->z_range_lock); - rl->r_off = off; - rl->r_len = len; - mutex_exit(&zp->z_range_lock); - if (rl->r_write_wanted) - cv_broadcast(&rl->r_wr_cv); - if (rl->r_read_wanted) - cv_broadcast(&rl->r_rd_cv); -} - -/* - * AVL comparison function used to order range locks - * Locks are ordered on the start offset of the range. - */ -int -zfs_range_compare(const void *arg1, const void *arg2) -{ - const rl_t *rl1 = arg1; - const rl_t *rl2 = arg2; - - if (rl1->r_off > rl2->r_off) - return (1); - if (rl1->r_off < rl2->r_off) - return (-1); - return (0); + mutex_enter(&rl->rl_lock); + lr->lr_offset = off; + lr->lr_length = len; + mutex_exit(&rl->rl_lock); + if (lr->lr_write_wanted) + cv_broadcast(&lr->lr_write_cv); + if (lr->lr_read_wanted) + cv_broadcast(&lr->lr_read_cv); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Tue Jun 4 00:01:37 2019 (r348595) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Tue Jun 4 00:42:51 2019 (r348596) @@ -513,7 +513,6 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * zfsvfs_t *zfsvfs = zp->z_zfsvfs; ssize_t n, nbytes; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 00:42:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7011815C2992; Tue, 4 Jun 2019 00:42: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 0E48E770E3; Tue, 4 Jun 2019 00:42:53 +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 DFA39E062; Tue, 4 Jun 2019 00:42: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 x540gq0c070947; Tue, 4 Jun 2019 00:42:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x540gq4v070946; Tue, 4 Jun 2019 00:42:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906040042.x540gq4v070946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Jun 2019 00:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348596 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor X-SVN-Commit-Author: mav X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Commit-Revision: 348596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E48E770E3 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 00:42:53 -0000 Author: mav Date: Tue Jun 4 00:42:51 2019 New Revision: 348596 URL: https://svnweb.freebsd.org/changeset/base/348596 Log: 9689 zfs range lock code should not be zpl-specific illumos/illumos-gate@7931524763ef94dc16989451dddd206563d03bb4 Reviewed by: Serapheim Dimitropoulos Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor/illumos/dist/cmd/ztest/ztest.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_rlock.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_rlock.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Tue Jun 4 00:01:37 2019 (r348595) +++ vendor/illumos/dist/cmd/ztest/ztest.c Tue Jun 4 00:42:51 2019 (r348596) @@ -237,7 +237,9 @@ typedef struct bufwad { } bufwad_t; /* - * XXX -- fix zfs range locks to be generic so we can use them here. + * It would be better to use a rangelock_t per object. Unfortunately + * the rangelock_t is not a drop-in replacement for rl_t, because we + * still need to map from object ID to rangelock_t. */ typedef enum { RL_READER, @@ -1845,12 +1847,12 @@ static void ztest_get_done(zgd_t *zgd, int error) { ztest_ds_t *zd = zgd->zgd_private; - uint64_t object = zgd->zgd_rl->rl_object; + uint64_t object = ((rl_t *)zgd->zgd_lr)->rl_object; if (zgd->zgd_db) dmu_buf_rele(zgd->zgd_db, zgd); - ztest_range_unlock(zgd->zgd_rl); + ztest_range_unlock((rl_t *)zgd->zgd_lr); ztest_object_unlock(zd, object); umem_free(zgd, sizeof (*zgd)); @@ -1900,8 +1902,8 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, s zgd->zgd_private = zd; if (buf != NULL) { /* immediate write */ - zgd->zgd_rl = ztest_range_lock(zd, object, offset, size, - RL_READER); + zgd->zgd_lr = (struct locked_range *)ztest_range_lock(zd, + object, offset, size, RL_READER); error = dmu_read(os, object, offset, size, buf, DMU_READ_NO_PREFETCH); @@ -1915,8 +1917,8 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, s offset = 0; } - zgd->zgd_rl = ztest_range_lock(zd, object, offset, size, - RL_READER); + zgd->zgd_lr = (struct locked_range *)ztest_range_lock(zd, + object, offset, size, RL_READER); error = dmu_buf_hold(os, object, offset, zgd, &db, DMU_READ_NO_PREFETCH); From owner-svn-src-all@freebsd.org Tue Jun 4 01:00:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37B4515C2CB3; Tue, 4 Jun 2019 01:00:31 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8737772C; Tue, 4 Jun 2019 01:00:30 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF985E21B; Tue, 4 Jun 2019 01:00:30 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5410U1p076482; Tue, 4 Jun 2019 01:00:30 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5410Ub5076481; Tue, 4 Jun 2019 01:00:30 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201906040100.x5410Ub5076481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 4 Jun 2019 01:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348597 - stable/12/sys/fs/pseudofs X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/fs/pseudofs X-SVN-Commit-Revision: 348597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA8737772C 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 01:00:31 -0000 Author: johalun Date: Tue Jun 4 01:00:30 2019 New Revision: 348597 URL: https://svnweb.freebsd.org/changeset/base/348597 Log: MFC r348338: pseudofs: Ignore unsupported commands in vop_setattr. Users of pseudofs (e.g. lindebugfs), should be able to receive input from command line via commands like "echo 1 > /path/to/file". Currently this fails because sh tries to truncate the file first and vop_setattr returns not supported error for this. This patch simply ignores the error and returns 0 instead. Reviewed by: imp (mentor), asomers Approved by: imp (mentor), asomers Differential Revision: D20451 Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs_vnops.c Tue Jun 4 00:42:51 2019 (r348596) +++ stable/12/sys/fs/pseudofs/pseudofs_vnops.c Tue Jun 4 01:00:30 2019 (r348597) @@ -967,7 +967,8 @@ pfs_setattr(struct vop_setattr_args *va) PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); - PFS_RETURN (EOPNOTSUPP); + /* Silently ignore unchangeable attributes. */ + PFS_RETURN (0); } /* From owner-svn-src-all@freebsd.org Tue Jun 4 02:35:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 02:37:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 03:04:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02ED715C5FC9; Tue, 4 Jun 2019 03:04:32 +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 9609E838C6; Tue, 4 Jun 2019 03:04:31 +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 576CEF900; Tue, 4 Jun 2019 03:04:31 +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 x5434VM4044482; Tue, 4 Jun 2019 03:04:31 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5434UU4044480; Tue, 4 Jun 2019 03:04:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906040304.x5434UU4044480@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 03:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348600 - stable/12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9609E838C6 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 03:04:32 -0000 Author: cy Date: Tue Jun 4 03:04:30 2019 New Revision: 348600 URL: https://svnweb.freebsd.org/changeset/base/348600 Log: MFC r348320: Contuation of r343701, removal of irrelevant #ifdefs. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_frag.c stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_frag.c Tue Jun 4 02:37:11 2019 (r348599) +++ stable/12/sys/contrib/ipfilter/netinet/ip_frag.c Tue Jun 4 03:04:30 2019 (r348600) @@ -34,11 +34,11 @@ #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if !defined(__SVR4) && !defined(__svr4__) +#if !defined(__SVR4) # if defined(_KERNEL) # include # endif Modified: stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Tue Jun 4 02:37:11 2019 (r348599) +++ stable/12/sys/contrib/ipfilter/netinet/ip_proxy.h Tue Jun 4 03:04:30 2019 (r348600) @@ -13,14 +13,14 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4)) # define SOLARIS 1 # else # define SOLARIS 0 # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) +#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) #else #define SIOCPROXY _IOWR(r, 64, struct ap_control) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Tue Jun 4 02:37:11 2019 (r348599) +++ stable/12/sys/contrib/ipfilter/netinet/ip_rules.c Tue Jun 4 03:04:30 2019 (r348600) @@ -12,22 +12,18 @@ #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 40000) +#if defined(__FreeBSD_version) # if defined(_KERNEL) # include # else # include # endif -#endif -#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 399000000) #else -# if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sgi) -# include -# endif +# include #endif #include #include -#if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) +#if !defined(__SVR4) # include #endif #if defined(__FreeBSD__) From owner-svn-src-all@freebsd.org Tue Jun 4 06:21:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 07:02:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 08:06:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 09:01:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 10:21:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8292B15AB054; Tue, 4 Jun 2019 10:21:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F86690C6D; Tue, 4 Jun 2019 10:21:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06BF41C1C1; Tue, 4 Jun 2019 10:21:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54AL1wa070398; Tue, 4 Jun 2019 10:21:01 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54AKuND070367; Tue, 4 Jun 2019 10:20:56 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906041020.x54AKuND070367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 4 Jun 2019 10:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348605 - in stable/12: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/te... X-SVN-Group: stable-12 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/12: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/tes... X-SVN-Commit-Revision: 348605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F86690C6D 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.959,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 10:21:02 -0000 Author: mm Date: Tue Jun 4 10:20:56 2019 New Revision: 348605 URL: https://svnweb.freebsd.org/changeset/base/348605 Log: MFC r347990: Sync libarchive with vendor. Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes Added: stable/12/contrib/libarchive/libarchive/archive_entry_misc.3 - copied unchanged from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3 stable/12/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c stable/12/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu stable/12/contrib/libarchive/tar/test/test_option_exclude_vcs.c - copied unchanged from r347990, head/contrib/libarchive/tar/test/test_option_exclude_vcs.c Modified: stable/12/contrib/libarchive/NEWS stable/12/contrib/libarchive/cpio/test/test_basic.c stable/12/contrib/libarchive/cpio/test/test_format_newc.c stable/12/contrib/libarchive/cpio/test/test_gcpio_compat.c stable/12/contrib/libarchive/cpio/test/test_option_L_upper.c stable/12/contrib/libarchive/cpio/test/test_option_a.c stable/12/contrib/libarchive/cpio/test/test_option_c.c stable/12/contrib/libarchive/libarchive/archive.h stable/12/contrib/libarchive/libarchive/archive_entry.c stable/12/contrib/libarchive/libarchive/archive_entry.h stable/12/contrib/libarchive/libarchive/archive_entry_private.h stable/12/contrib/libarchive/libarchive/archive_hmac.c stable/12/contrib/libarchive/libarchive/archive_match.c stable/12/contrib/libarchive/libarchive/archive_platform.h stable/12/contrib/libarchive/libarchive/archive_read.c stable/12/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/12/contrib/libarchive/libarchive/archive_read_private.h stable/12/contrib/libarchive/libarchive/archive_read_set_format.c stable/12/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_raw.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/12/contrib/libarchive/libarchive/archive_util.c stable/12/contrib/libarchive/libarchive/archive_write_add_filter_xz.c stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/12/contrib/libarchive/libarchive/test/test_entry.c stable/12/contrib/libarchive/libarchive/test/test_fuzz.c stable/12/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/12/contrib/libarchive/libarchive/test/test_read_extract.c stable/12/contrib/libarchive/libarchive/test/test_read_format_mtree.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_raw.c stable/12/contrib/libarchive/libarchive/test/test_read_format_zip.c stable/12/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/12/contrib/libarchive/libarchive/test/test_write_disk_symlink.c stable/12/contrib/libarchive/tar/bsdtar.1 stable/12/contrib/libarchive/tar/bsdtar.c stable/12/contrib/libarchive/tar/bsdtar.h stable/12/contrib/libarchive/tar/cmdline.c stable/12/contrib/libarchive/tar/test/test_basic.c stable/12/contrib/libarchive/tar/test/test_copy.c stable/12/contrib/libarchive/tar/test/test_option_C_mtree.c stable/12/contrib/libarchive/tar/test/test_option_H_upper.c stable/12/contrib/libarchive/tar/test/test_option_L_upper.c stable/12/contrib/libarchive/tar/test/test_option_U_upper.c stable/12/contrib/libarchive/tar/test/test_option_n.c stable/12/contrib/libarchive/tar/test/test_option_s.c stable/12/contrib/libarchive/tar/test/test_strip_components.c stable/12/contrib/libarchive/tar/test/test_symlink_dir.c stable/12/contrib/libarchive/test_utils/test_common.h stable/12/contrib/libarchive/test_utils/test_main.c stable/12/lib/libarchive/Makefile stable/12/lib/libarchive/tests/Makefile stable/12/usr.bin/tar/tests/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/libarchive/NEWS ============================================================================== --- stable/12/contrib/libarchive/NEWS Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/NEWS Tue Jun 4 10:20:56 2019 (r348605) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: stable/12/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 10:20:56 2019 (r348605) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: stable/12/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 10:20:56 2019 (r348605) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: stable/12/contrib/libarchive/cpio/test/test_gcpio_compat.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 10:20:56 2019 (r348605) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: stable/12/contrib/libarchive/cpio/test/test_option_L_upper.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 10:20:56 2019 (r348605) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); + r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog); + failure("Error invoking %s -i", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack.err"); assertChdir(".."); - assertIsSymlink("unpack/symlink", NULL); + assertIsSymlink("unpack/symlink", NULL, 0); r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); failure("Error invoking %s -oL", testprog); @@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack-L", 0755); assertChdir("unpack-L"); - r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + failure("Error invoking %s -i < archive-L.out", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack-L.err"); Modified: stable/12/contrib/libarchive/cpio/test/test_option_a.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 10:20:56 2019 (r348605) @@ -71,8 +71,13 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); +#if defined(_WIN32) && !defined(CYGWIN) + times.actime = 86400; + times.modtime = 86400; +#else times.actime = 1; times.modtime = 3; +#endif assertEqualInt(0, utime(files[i].name, ×)); /* Record whatever atime the file ended up with. */ Modified: stable/12/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- stable/12/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 10:20:56 2019 (r348605) @@ -85,7 +85,7 @@ DEFINE_TEST(test_option_c) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); } Modified: stable/12/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive.h Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive.h Tue Jun 4 10:20:56 2019 (r348605) @@ -338,9 +338,9 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 -#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 /* * Codes returned by archive_read_format_capabilities(). @@ -1095,6 +1095,8 @@ __LA_DECL int archive_match_excluded(struct archive *, */ __LA_DECL int archive_match_path_excluded(struct archive *, struct archive_entry *); +/* Control recursive inclusion of directory content when directory is included. Default on. */ +__LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int); /* Add exclusion pathname pattern. */ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); __LA_DECL int archive_match_exclude_pattern_w(struct archive *, Modified: stable/12/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 10:20:56 2019 (r348605) @@ -168,6 +168,7 @@ archive_entry_clear(struct archive_entry *entry) archive_entry_xattr_clear(entry); archive_entry_sparse_clear(entry); free(entry->stat); + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; memset(entry, 0, sizeof(*entry)); return entry; } @@ -202,6 +203,9 @@ archive_entry_clone(struct archive_entry *entry) entry2->ae_set = entry->ae_set; archive_mstring_copy(&entry2->ae_uname, &entry->ae_uname); + /* Copy symlink type */ + entry2->ae_symlink_type = entry->ae_symlink_type; + /* Copy encryption status */ entry2->encryption = entry->encryption; @@ -253,6 +257,7 @@ archive_entry_new2(struct archive *a) if (entry == NULL) return (NULL); entry->archive = a; + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; return (entry); } @@ -675,6 +680,12 @@ archive_entry_symlink(struct archive_entry *entry) return (NULL); } +int +archive_entry_symlink_type(struct archive_entry *entry) +{ + return (entry->ae_symlink_type); +} + const char * archive_entry_symlink_utf8(struct archive_entry *entry) { @@ -1246,6 +1257,12 @@ archive_entry_set_symlink(struct archive_entry *entry, } void +archive_entry_set_symlink_type(struct archive_entry *entry, int type) +{ + entry->ae_symlink_type = type; +} + +void archive_entry_set_symlink_utf8(struct archive_entry *entry, const char *linkname) { archive_mstring_copy_utf8(&entry->ae_symlink, linkname); @@ -1749,6 +1766,10 @@ static const struct flag { { "nohidden", L"nohidden", UF_HIDDEN, 0}, { "nouhidden", L"nouhidden", UF_HIDDEN, 0}, #endif +#ifdef FILE_ATTRIBUTE_HIDDEN + { "nohidden", L"nohidden", FILE_ATTRIBUTE_HIDDEN, 0}, + { "nouhidden", L"nouhidden", FILE_ATTRIBUTE_HIDDEN, 0}, +#endif #ifdef UF_OFFLINE { "nooffline", L"nooffline", UF_OFFLINE, 0}, { "nouoffline", L"nouoffline", UF_OFFLINE, 0}, @@ -1758,6 +1779,11 @@ static const struct flag { { "nourdonly", L"nourdonly", UF_READONLY, 0}, { "noreadonly", L"noreadonly", UF_READONLY, 0}, #endif +#ifdef FILE_ATTRIBUTE_READONLY + { "nordonly", L"nordonly", FILE_ATTRIBUTE_READONLY, 0}, + { "nourdonly", L"nourdonly", FILE_ATTRIBUTE_READONLY, 0}, + { "noreadonly", L"noreadonly", FILE_ATTRIBUTE_READONLY, 0}, +#endif #ifdef UF_SPARSE { "nosparse", L"nosparse", UF_SPARSE, 0}, { "nousparse", L"nousparse", UF_SPARSE, 0}, @@ -1769,6 +1795,10 @@ static const struct flag { #ifdef UF_SYSTEM { "nosystem", L"nosystem", UF_SYSTEM, 0}, { "nousystem", L"nousystem", UF_SYSTEM, 0}, +#endif +#ifdef FILE_ATTRIBUTE_SYSTEM + { "nosystem", L"nosystem", FILE_ATTRIBUTE_SYSTEM, 0}, + { "nousystem", L"nousystem", FILE_ATTRIBUTE_SYSTEM, 0}, #endif #if defined(FS_UNRM_FL) /* 'u' */ { "noundel", L"noundel", FS_UNRM_FL, 0}, Modified: stable/12/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 10:20:56 2019 (r348605) @@ -191,6 +191,13 @@ struct archive_entry; #define AE_IFIFO ((__LA_MODE_T)0010000) /* + * Symlink types + */ +#define AE_SYMLINK_TYPE_UNDEFINED 0 +#define AE_SYMLINK_TYPE_FILE 1 +#define AE_SYMLINK_TYPE_DIRECTORY 2 + +/* * Basic object manipulation */ @@ -275,6 +282,7 @@ __LA_DECL int archive_entry_size_is_set(struct archi __LA_DECL const char *archive_entry_strmode(struct archive_entry *); __LA_DECL const char *archive_entry_symlink(struct archive_entry *); __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); +__LA_DECL int archive_entry_symlink_type(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); __LA_DECL const char *archive_entry_uname(struct archive_entry *); @@ -350,6 +358,7 @@ __LA_DECL void archive_entry_unset_size(struct archive __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); @@ -692,7 +701,6 @@ __LA_DECL void archive_entry_linkify(struct archive_en struct archive_entry **, struct archive_entry **); __LA_DECL struct archive_entry *archive_entry_partial_links( struct archive_entry_linkresolver *res, unsigned int *links); - #ifdef __cplusplus } #endif Copied: stable/12/contrib/libarchive/libarchive/archive_entry_misc.3 (from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/archive_entry_misc.3 Tue Jun 4 10:20:56 2019 (r348605, copy of r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) @@ -0,0 +1,62 @@ +.\" Copyright (c) 2019 Martin Matuska +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 15, 2019 +.Dt ARCHIVE_ENTRY_MISC 3 +.Os +.Sh NAME +.Nm archive_entry_symlink_type , +.Nm archive_entry_set_symlink_type +.Nd miscellaneous functions for manipulating properties of archive_entry. +.Sh LIBRARY +Streaming Archive Library (libarchive, -larchive) +.Sh SYNOPSIS +.In archive_entry.h +.Ft int +.Fn archive_entry_symlink_type "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_symlink_type "struct archive_entry *a" "int" +.Sh DESCRIPTION +The function +.Fn archive_entry_symlink_type +returns and the function +.Fn archive_entry_set_symlink_type +sets the type of the symbolic link stored in an archive entry. These functions +have special meaning on operating systems that support multiple symbolic link +types (e.g. Microsoft Windows). +.Pp +Supported values are: +.Bl -tag -width "AE_SYMLINK_TYPE_DIRECTORY" -compact +.It AE_SYMLINK_TYPE_UNDEFINED +Symbolic link target type is not defined (default on unix systems) +.It AE_SYMLINK_TYPE_FILE +Symbolic link points to a file +.It AE_SYMLINK_TYPE_DIRECTORY +Symbolic link points to a directory +.El +.Sh SEE ALSO +.Xr archive_entry 3 , +.Xr archive_entry_paths 3 , +.Xr archive_entry_stat 3 , +.Xr libarchive 3 Modified: stable/12/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 10:20:56 2019 (r348605) @@ -176,6 +176,9 @@ struct archive_entry { /* Miscellaneous. */ char strmode[12]; + + /* Symlink type support */ + int ae_symlink_type; }; #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: stable/12/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 10:20:56 2019 (r348605) @@ -83,6 +83,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { +#pragma GCC diagnostic ignored "-Wcast-qual" BCRYPT_ALG_HANDLE hAlg; BCRYPT_HASH_HANDLE hHash; DWORD hash_len; Modified: stable/12/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 10:20:56 2019 (r348605) @@ -93,6 +93,9 @@ struct archive_match { /* exclusion/inclusion set flag. */ int setflag; + /* Recursively include directory content? */ + int recursive_include; + /* * Matching filename patterns. */ @@ -223,6 +226,7 @@ archive_match_new(void) return (NULL); a->archive.magic = ARCHIVE_MATCH_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; + a->recursive_include = 1; match_list_init(&(a->inclusions)); match_list_init(&(a->exclusions)); __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); @@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, } /* + * When recursive inclusion of directory content is enabled, + * an inclusion pattern that matches a directory will also + * include everything beneath that directory. Enabled by default. + * + * For compatibility with GNU tar, exclusion patterns always + * match if a subset of the full patch matches (i.e., they are + * are not rooted at the beginning of the path) and thus there + * is no corresponding non-recursive exclusion mode. + */ +int +archive_match_set_inclusion_recursion(struct archive *_a, int enabled) +{ + struct archive_match *a; + + archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, + ARCHIVE_STATE_NEW, "archive_match_set_inclusion_recursion"); + a = (struct archive_match *)_a; + a->recursive_include = enabled; + return (ARCHIVE_OK); +} + +/* * Utility functions to get statistic information for inclusion patterns. */ int @@ -781,7 +807,10 @@ static int match_path_inclusion(struct archive_match *a, struct match *m, int mbs, const void *pn) { - int flag = PATHMATCH_NO_ANCHOR_END; + /* Recursive operation requires only a prefix match. */ + int flag = a->recursive_include ? + PATHMATCH_NO_ANCHOR_END : + 0; int r; if (mbs) { @@ -1232,7 +1261,7 @@ set_timefilter_pathname_mbs(struct archive_match *a, i archive_set_error(&(a->archive), EINVAL, "pathname is empty"); return (ARCHIVE_FAILED); } - if (stat(path, &st) != 0) { + if (la_stat(path, &st) != 0) { archive_set_error(&(a->archive), errno, "Failed to stat()"); return (ARCHIVE_FAILED); } Modified: stable/12/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 10:20:56 2019 (r348605) @@ -69,6 +69,8 @@ * either Windows or Posix APIs. */ #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) #include "archive_windows.h" +#else +#define la_stat(path,stref) stat(path,stref) #endif /* Modified: stable/12/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 10:20:56 2019 (r348605) @@ -611,6 +611,15 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } +int +__archive_read_header(struct archive_read *a, struct archive_entry *entry) +{ + if (a->filter->read_header) + return a->filter->read_header(a->filter, entry); + else + return (ARCHIVE_OK); +} + /* * Read header of next entry. */ Modified: stable/12/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 10:20:56 2019 (r348605) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } } else #endif - if (stat(path, &s) != 0) { + if (la_stat(path, &s) != 0) { archive_set_error(&a->archive, errno, "Can't stat %s", path); return (ARCHIVE_FAILED); Modified: stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 10:20:56 2019 (r348605) @@ -909,7 +909,7 @@ next_entry(struct archive_read_disk *a, struct tree *t } } break; - } + } } while (lst == NULL); #ifdef __APPLE__ @@ -1295,10 +1295,23 @@ archive_read_disk_descend(struct archive *_a) if (t->visit_type != TREE_REGULAR || !t->descend) return (ARCHIVE_OK); + /* + * We must not treat the initial specified path as a physical dir, + * because if we do then we will try and ascend out of it by opening + * ".." which is (a) wrong and (b) causes spurious permissions errors + * if ".." is not readable by us. Instead, treat it as if it were a + * symlink. (This uses an extra fd, but it can only happen once at the + * top level of a traverse.) But we can't necessarily assume t->st is + * valid here (though t->lst is), which complicates the logic a + * little. + */ if (tree_current_is_physical_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->lst.st_dev, t->lst.st_ino, &t->restore_time); - t->stack->flags |= isDir; + if (t->stack->parent->parent != NULL) + t->stack->flags |= isDir; + else + t->stack->flags |= isDirLink; } else if (tree_current_is_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->st.st_dev, t->st.st_ino, &t->restore_time); @@ -2151,6 +2164,17 @@ tree_open(const char *path, int symlink_mode, int rest static struct tree * tree_reopen(struct tree *t, const char *path, int restore_time) { +#if defined(O_PATH) + /* Linux */ + const int o_flag = O_PATH; +#elif defined(O_SEARCH) + /* SunOS */ + const int o_flag = O_SEARCH; +#elif defined(O_EXEC) + /* FreeBSD */ + const int o_flag = O_EXEC; +#endif + t->flags = (restore_time != 0)?needsRestoreTimes:0; t->flags |= onInitialDir; t->visit_type = 0; @@ -2172,6 +2196,15 @@ tree_reopen(struct tree *t, const char *path, int rest t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); +#if defined(O_PATH) || defined(O_SEARCH) || defined(O_EXEC) + /* + * Most likely reason to fail opening "." is that it's not readable, + * so try again for execute. The consequences of not opening this are + * unhelpful and unnecessary errors later. + */ + if (t->initial_dir_fd < 0) + t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); +#endif __archive_ensure_cloexec_flag(t->initial_dir_fd); t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); @@ -2479,7 +2512,7 @@ tree_current_stat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; - if (stat(tree_current_access_path(t), &t->st) != 0) + if (la_stat(tree_current_access_path(t), &t->st) != 0) #endif return NULL; t->flags |= hasStat; Modified: stable/12/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 10:20:56 2019 (r348605) @@ -98,6 +98,8 @@ struct archive_read_filter { int (*close)(struct archive_read_filter *self); /* Function that handles switching from reading one block to the next/prev */ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); + /* Read any header metadata if available. */ + int (*read_header)(struct archive_read_filter *self, struct archive_entry *entry); /* My private data. */ void *data; @@ -250,6 +252,7 @@ int64_t __archive_read_seek(struct archive_read*, int6 int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); +int __archive_read_header(struct archive_read *, struct archive_entry *); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: stable/12/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 10:20:56 2019 (r348605) @@ -73,6 +73,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR: strcpy(str, "rar"); break; + case ARCHIVE_FORMAT_RAR_V5: + strcpy(str, "rar5"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); break; Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 10:20:56 2019 (r348605) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -56,6 +61,8 @@ struct private_data { size_t out_block_size; int64_t total_out; unsigned long crc; + uint32_t mtime; + char *name; char eof; /* True = found end of compressed data. */ }; @@ -123,7 +130,8 @@ archive_read_support_filter_gzip(struct archive *_a) * count of bits verified, suitable for use by bidder. */ static ssize_t -peek_at_header(struct archive_read_filter *filter, int *pbits) +peek_at_header(struct archive_read_filter *filter, int *pbits, + struct private_data *state) { const unsigned char *p; ssize_t avail, len; @@ -144,7 +152,9 @@ peek_at_header(struct archive_read_filter *filter, int return (0); bits += 3; header_flags = p[3]; - /* Bytes 4-7 are mod time. */ + /* Bytes 4-7 are mod time in little endian. */ + if (state) + state->mtime = archive_le32dec(p + 4); /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -161,6 +171,7 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { + ssize_t file_start = len; do { ++len; if (avail < len) @@ -169,6 +180,12 @@ peek_at_header(struct archive_read_filter *filter, int if (p == NULL) return (0); } while (p[len - 1] != 0); + + if (state) { + /* Reset the name in case of repeat header reads. */ + free(state->name); + state->name = strdup((const char *)&p[file_start]); + } } /* Null-terminated optional comment. */ @@ -214,12 +231,29 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel (void)self; /* UNUSED */ - if (peek_at_header(filter, &bits_checked)) + if (peek_at_header(filter, &bits_checked, NULL)) return (bits_checked); return (0); } +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + #ifndef HAVE_ZLIB_H /* @@ -272,6 +306,7 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; + self->read_header = gzip_read_header; state->in_stream = 0; /* We're not actually within a stream yet. */ @@ -289,7 +324,7 @@ consume_header(struct archive_read_filter *self) state = (struct private_data *)self->data; /* If this is a real header, consume it. */ - len = peek_at_header(self->upstream, NULL); + len = peek_at_header(self->upstream, NULL, state); if (len == 0) return (ARCHIVE_EOF); __archive_read_filter_consume(self->upstream, len); @@ -374,7 +409,7 @@ gzip_filter_read(struct archive_read_filter *self, con { struct private_data *state; size_t decompressed; - ssize_t avail_in; + ssize_t avail_in, max_in; int ret; state = (struct private_data *)self->data; @@ -408,6 +443,12 @@ gzip_filter_read(struct archive_read_filter *self, con "truncated gzip input"); return (ARCHIVE_FATAL); } + if (UINT_MAX >= SSIZE_MAX) + max_in = SSIZE_MAX; + else + max_in = UINT_MAX; + if (avail_in > max_in) + avail_in = max_in; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ @@ -469,6 +510,7 @@ gzip_filter_close(struct archive_read_filter *self) } } + free(state->name); free(state->out_block); free(state); return (ret); Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 10:20:56 2019 (r348605) @@ -1509,8 +1509,8 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) goto nomszip; - else if (cab->stream.next_in[0] != 0x43 || - cab->stream.next_in[1] != 0x4b) + else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 || + cab->stream.next_in[1] != 0x4b)) goto nomszip; cab->stream.next_in += mszip; cab->stream.avail_in -= mszip; Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 10:20:56 2019 (r348605) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_CTYPE_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -1011,7 +1014,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree { ssize_t len; uintmax_t counter; - char *p; + char *p, *s; struct mtree_option *global; struct mtree_entry *last_entry; int r, is_form_d; @@ -1025,6 +1028,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree (void)detect_form(a, &is_form_d); for (counter = 1; ; ++counter) { + r = ARCHIVE_OK; len = readline(a, mtree, &p, 65536); if (len == 0) { mtree->this_entry = mtree->entries; @@ -1045,6 +1049,15 @@ read_mtree(struct archive_read *a, struct mtree *mtree continue; if (*p == '\r' || *p == '\n' || *p == '\0') continue; + /* Non-printable characters are not allowed */ + for (s = p;s < p + len - 1; s++) { + if (!isprint(*s)) { + r = ARCHIVE_FATAL; + break; + } + } + if (r != ARCHIVE_OK) + break; if (*p != '/') { r = process_add_entry(a, mtree, &global, p, len, &last_entry, is_form_d); Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 10:20:56 2019 (r348605) @@ -1024,8 +1024,10 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); - if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) + if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); + rar->start_new_table = 1; + } break; default: Modified: stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 09:01:02 2019 (r348604) +++ stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 10:20:56 2019 (r348605) @@ -33,6 +33,9 @@ #ifdef HAVE_ZLIB_H #include /* crc32 */ #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #ifndef HAVE_ZLIB_H @@ -78,230 +81,275 @@ static unsigned char rar5_signature[] = { 243, 192, 211, 128, 187, 166, 160, 161 }; static const ssize_t rar5_signature_size = sizeof(rar5_signature); -/* static const size_t g_unpack_buf_chunk_size = 1024; */ static const size_t g_unpack_window_size = 0x20000; +/* These could have been static const's, but they aren't, because of + * Visual Studio. */ +#define MAX_NAME_IN_CHARS 2048 +#define MAX_NAME_IN_BYTES (4 * MAX_NAME_IN_CHARS) + struct file_header { - ssize_t bytes_remaining; - ssize_t unpacked_size; - int64_t last_offset; /* Used in sanity checks. */ - int64_t last_size; /* Used in sanity checks. */ + ssize_t bytes_remaining; + ssize_t unpacked_size; + int64_t last_offset; /* Used in sanity checks. */ + int64_t last_size; /* Used in sanity checks. */ - uint8_t solid : 1; /* Is this a solid stream? */ - uint8_t service : 1; /* Is this file a service data? */ - uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t solid : 1; /* Is this a solid stream? */ + uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t dir : 1; /* Is this file entry a directory? */ - /* Optional time fields. */ - uint64_t e_mtime; - uint64_t e_ctime; - uint64_t e_atime; - uint32_t e_unix_ns; + /* Optional time fields. */ + uint64_t e_mtime; + uint64_t e_ctime; + uint64_t e_atime; + uint32_t e_unix_ns; - /* Optional hash fields. */ - uint32_t stored_crc32; - uint32_t calculated_crc32; - uint8_t blake2sp[32]; - blake2sp_state b2state; - char has_blake2; + /* Optional hash fields. */ + uint32_t stored_crc32; + uint32_t calculated_crc32; + uint8_t blake2sp[32]; + blake2sp_state b2state; + char has_blake2; + + /* Optional redir fields */ + uint64_t redir_type; + uint64_t redir_flags; }; +enum EXTRA { + EX_CRYPT = 0x01, + EX_HASH = 0x02, + EX_HTIME = 0x03, + EX_VERSION = 0x04, + EX_REDIR = 0x05, + EX_UOWNER = 0x06, + EX_SUBDATA = 0x07 +}; + +#define REDIR_SYMLINK_IS_DIR 1 + +enum REDIR_TYPE { + REDIR_TYPE_NONE = 0, + REDIR_TYPE_UNIXSYMLINK = 1, + REDIR_TYPE_WINSYMLINK = 2, + REDIR_TYPE_JUNCTION = 3, + REDIR_TYPE_HARDLINK = 4, + REDIR_TYPE_FILECOPY = 5, +}; + +#define OWNER_USER_NAME 0x01 +#define OWNER_GROUP_NAME 0x02 +#define OWNER_USER_UID 0x04 +#define OWNER_GROUP_GID 0x08 +#define OWNER_MAXNAMELEN 256 + enum FILTER_TYPE { - FILTER_DELTA = 0, /* Generic pattern. */ - FILTER_E8 = 1, /* Intel x86 code. */ - FILTER_E8E9 = 2, /* Intel x86 code. */ - FILTER_ARM = 3, /* ARM code. */ - FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ - FILTER_RGB = 5, /* Color palette, not used in RARv5. */ - FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ - FILTER_PPM = 7, /* Predictive pattern matching, not used in RARv5. */ - FILTER_NONE = 8, + FILTER_DELTA = 0, /* Generic pattern. */ + FILTER_E8 = 1, /* Intel x86 code. */ + FILTER_E8E9 = 2, /* Intel x86 code. */ + FILTER_ARM = 3, /* ARM code. */ + FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ + FILTER_RGB = 5, /* Color palette, not used in RARv5. */ + FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ + FILTER_PPM = 7, /* Predictive pattern matching, not used in + RARv5. */ + FILTER_NONE = 8, }; struct filter_info { - int type; - int channels; - int pos_r; + int type; + int channels; + int pos_r; - int64_t block_start; - ssize_t block_length; - uint16_t width; + int64_t block_start; + ssize_t block_length; + uint16_t width; }; struct data_ready { - char used; - const uint8_t* buf; - size_t size; - int64_t offset; + char used; + const uint8_t* buf; + size_t size; + int64_t offset; }; struct cdeque { - uint16_t beg_pos; - uint16_t end_pos; - uint16_t cap_mask; - uint16_t size; - size_t* arr; + uint16_t beg_pos; + uint16_t end_pos; + uint16_t cap_mask; + uint16_t size; + size_t* arr; }; struct decode_table { - uint32_t size; - int32_t decode_len[16]; - uint32_t decode_pos[16]; - uint32_t quick_bits; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 10:28:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2295515AB217; Tue, 4 Jun 2019 10:28:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC33491198; Tue, 4 Jun 2019 10:28:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9783F1C33F; Tue, 4 Jun 2019 10:28:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54ASoxe075647; Tue, 4 Jun 2019 10:28:50 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54ASocQ075646; Tue, 4 Jun 2019 10:28:50 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906041028.x54ASocQ075646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 4 Jun 2019 10:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348606 - stable/12/lib/libarchive/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/12/lib/libarchive/tests X-SVN-Commit-Revision: 348606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC33491198 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.958,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 10:28:51 -0000 Author: mm Date: Tue Jun 4 10:28:50 2019 New Revision: 348606 URL: https://svnweb.freebsd.org/changeset/base/348606 Log: MFC r347999: Install missing data file for lib.libarchive.functional_test.test_read_format_zip_utf8_paths Modified: stable/12/lib/libarchive/tests/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libarchive/tests/Makefile ============================================================================== --- stable/12/lib/libarchive/tests/Makefile Tue Jun 4 10:20:56 2019 (r348605) +++ stable/12/lib/libarchive/tests/Makefile Tue Jun 4 10:28:50 2019 (r348606) @@ -557,6 +557,7 @@ ${PACKAGE}FILES+= test_read_format_ustar_filename_eucj ${PACKAGE}FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu ${PACKAGE}FILES+= test_read_format_warc.warc.uu ${PACKAGE}FILES+= test_read_format_zip.zip.uu +${PACKAGE}FILES+= test_read_format_zip_7075_utf8_paths.zip.uu ${PACKAGE}FILES+= test_read_format_zip_bz2_hang.zip.uu ${PACKAGE}FILES+= test_read_format_zip_bzip2.zipx.uu ${PACKAGE}FILES+= test_read_format_zip_bzip2_multi.zipx.uu From owner-svn-src-all@freebsd.org Tue Jun 4 10:36:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0BD915AB618; Tue, 4 Jun 2019 10:36:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69FAA91A5D; Tue, 4 Jun 2019 10:36:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4443A1C4DF; Tue, 4 Jun 2019 10:36:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54Aa0t8080654; Tue, 4 Jun 2019 10:36:00 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54AZte3080625; Tue, 4 Jun 2019 10:35:55 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906041035.x54AZte3080625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 4 Jun 2019 10:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348607 - in stable/11: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/te... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/tes... X-SVN-Commit-Revision: 348607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69FAA91A5D 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.972,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 10:36:01 -0000 Author: mm Date: Tue Jun 4 10:35:54 2019 New Revision: 348607 URL: https://svnweb.freebsd.org/changeset/base/348607 Log: MFC r347990: Sync libarchive with vendor. Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes MFC r347999: Install missing data file for lib.libarchive.functional_test.test_read_format_zip_utf8_paths Approved by: re (gjb blanket) Added: stable/11/contrib/libarchive/libarchive/archive_entry_misc.3 - copied unchanged from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3 stable/11/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c stable/11/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu stable/11/contrib/libarchive/tar/test/test_option_exclude_vcs.c - copied unchanged from r347990, head/contrib/libarchive/tar/test/test_option_exclude_vcs.c Modified: stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/cpio/test/test_basic.c stable/11/contrib/libarchive/cpio/test/test_format_newc.c stable/11/contrib/libarchive/cpio/test/test_gcpio_compat.c stable/11/contrib/libarchive/cpio/test/test_option_L_upper.c stable/11/contrib/libarchive/cpio/test/test_option_a.c stable/11/contrib/libarchive/cpio/test/test_option_c.c stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_entry.c stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/archive_entry_private.h stable/11/contrib/libarchive/libarchive/archive_hmac.c stable/11/contrib/libarchive/libarchive/archive_match.c stable/11/contrib/libarchive/libarchive/archive_platform.h stable/11/contrib/libarchive/libarchive/archive_read.c stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_read_private.h stable/11/contrib/libarchive/libarchive/archive_read_set_format.c stable/11/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_raw.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/11/contrib/libarchive/libarchive/archive_util.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_xz.c stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/11/contrib/libarchive/libarchive/test/test_entry.c stable/11/contrib/libarchive/libarchive/test/test_fuzz.c stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/11/contrib/libarchive/libarchive/test/test_read_extract.c stable/11/contrib/libarchive/libarchive/test/test_read_format_mtree.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_raw.c stable/11/contrib/libarchive/libarchive/test/test_read_format_zip.c stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/11/contrib/libarchive/libarchive/test/test_write_disk_symlink.c stable/11/contrib/libarchive/tar/bsdtar.1 stable/11/contrib/libarchive/tar/bsdtar.c stable/11/contrib/libarchive/tar/bsdtar.h stable/11/contrib/libarchive/tar/cmdline.c stable/11/contrib/libarchive/tar/test/test_basic.c stable/11/contrib/libarchive/tar/test/test_copy.c stable/11/contrib/libarchive/tar/test/test_option_C_mtree.c stable/11/contrib/libarchive/tar/test/test_option_H_upper.c stable/11/contrib/libarchive/tar/test/test_option_L_upper.c stable/11/contrib/libarchive/tar/test/test_option_U_upper.c stable/11/contrib/libarchive/tar/test/test_option_n.c stable/11/contrib/libarchive/tar/test/test_option_s.c stable/11/contrib/libarchive/tar/test/test_strip_components.c stable/11/contrib/libarchive/tar/test/test_symlink_dir.c stable/11/contrib/libarchive/test_utils/test_common.h stable/11/contrib/libarchive/test_utils/test_main.c stable/11/lib/libarchive/Makefile stable/11/lib/libarchive/tests/Makefile stable/11/usr.bin/tar/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/NEWS Tue Jun 4 10:35:54 2019 (r348607) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: stable/11/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 10:35:54 2019 (r348607) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: stable/11/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 10:35:54 2019 (r348607) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: stable/11/contrib/libarchive/cpio/test/test_gcpio_compat.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 10:35:54 2019 (r348607) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: stable/11/contrib/libarchive/cpio/test/test_option_L_upper.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 10:35:54 2019 (r348607) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); + r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog); + failure("Error invoking %s -i", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack.err"); assertChdir(".."); - assertIsSymlink("unpack/symlink", NULL); + assertIsSymlink("unpack/symlink", NULL, 0); r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); failure("Error invoking %s -oL", testprog); @@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack-L", 0755); assertChdir("unpack-L"); - r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + failure("Error invoking %s -i < archive-L.out", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack-L.err"); Modified: stable/11/contrib/libarchive/cpio/test/test_option_a.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 10:35:54 2019 (r348607) @@ -71,8 +71,13 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); +#if defined(_WIN32) && !defined(CYGWIN) + times.actime = 86400; + times.modtime = 86400; +#else times.actime = 1; times.modtime = 3; +#endif assertEqualInt(0, utime(files[i].name, ×)); /* Record whatever atime the file ended up with. */ Modified: stable/11/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 10:35:54 2019 (r348607) @@ -85,7 +85,7 @@ DEFINE_TEST(test_option_c) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); } Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive.h Tue Jun 4 10:35:54 2019 (r348607) @@ -338,9 +338,9 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 -#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 /* * Codes returned by archive_read_format_capabilities(). @@ -1095,6 +1095,8 @@ __LA_DECL int archive_match_excluded(struct archive *, */ __LA_DECL int archive_match_path_excluded(struct archive *, struct archive_entry *); +/* Control recursive inclusion of directory content when directory is included. Default on. */ +__LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int); /* Add exclusion pathname pattern. */ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); __LA_DECL int archive_match_exclude_pattern_w(struct archive *, Modified: stable/11/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 10:35:54 2019 (r348607) @@ -168,6 +168,7 @@ archive_entry_clear(struct archive_entry *entry) archive_entry_xattr_clear(entry); archive_entry_sparse_clear(entry); free(entry->stat); + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; memset(entry, 0, sizeof(*entry)); return entry; } @@ -202,6 +203,9 @@ archive_entry_clone(struct archive_entry *entry) entry2->ae_set = entry->ae_set; archive_mstring_copy(&entry2->ae_uname, &entry->ae_uname); + /* Copy symlink type */ + entry2->ae_symlink_type = entry->ae_symlink_type; + /* Copy encryption status */ entry2->encryption = entry->encryption; @@ -253,6 +257,7 @@ archive_entry_new2(struct archive *a) if (entry == NULL) return (NULL); entry->archive = a; + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; return (entry); } @@ -675,6 +680,12 @@ archive_entry_symlink(struct archive_entry *entry) return (NULL); } +int +archive_entry_symlink_type(struct archive_entry *entry) +{ + return (entry->ae_symlink_type); +} + const char * archive_entry_symlink_utf8(struct archive_entry *entry) { @@ -1246,6 +1257,12 @@ archive_entry_set_symlink(struct archive_entry *entry, } void +archive_entry_set_symlink_type(struct archive_entry *entry, int type) +{ + entry->ae_symlink_type = type; +} + +void archive_entry_set_symlink_utf8(struct archive_entry *entry, const char *linkname) { archive_mstring_copy_utf8(&entry->ae_symlink, linkname); @@ -1749,6 +1766,10 @@ static const struct flag { { "nohidden", L"nohidden", UF_HIDDEN, 0}, { "nouhidden", L"nouhidden", UF_HIDDEN, 0}, #endif +#ifdef FILE_ATTRIBUTE_HIDDEN + { "nohidden", L"nohidden", FILE_ATTRIBUTE_HIDDEN, 0}, + { "nouhidden", L"nouhidden", FILE_ATTRIBUTE_HIDDEN, 0}, +#endif #ifdef UF_OFFLINE { "nooffline", L"nooffline", UF_OFFLINE, 0}, { "nouoffline", L"nouoffline", UF_OFFLINE, 0}, @@ -1758,6 +1779,11 @@ static const struct flag { { "nourdonly", L"nourdonly", UF_READONLY, 0}, { "noreadonly", L"noreadonly", UF_READONLY, 0}, #endif +#ifdef FILE_ATTRIBUTE_READONLY + { "nordonly", L"nordonly", FILE_ATTRIBUTE_READONLY, 0}, + { "nourdonly", L"nourdonly", FILE_ATTRIBUTE_READONLY, 0}, + { "noreadonly", L"noreadonly", FILE_ATTRIBUTE_READONLY, 0}, +#endif #ifdef UF_SPARSE { "nosparse", L"nosparse", UF_SPARSE, 0}, { "nousparse", L"nousparse", UF_SPARSE, 0}, @@ -1769,6 +1795,10 @@ static const struct flag { #ifdef UF_SYSTEM { "nosystem", L"nosystem", UF_SYSTEM, 0}, { "nousystem", L"nousystem", UF_SYSTEM, 0}, +#endif +#ifdef FILE_ATTRIBUTE_SYSTEM + { "nosystem", L"nosystem", FILE_ATTRIBUTE_SYSTEM, 0}, + { "nousystem", L"nousystem", FILE_ATTRIBUTE_SYSTEM, 0}, #endif #if defined(FS_UNRM_FL) /* 'u' */ { "noundel", L"noundel", FS_UNRM_FL, 0}, Modified: stable/11/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 10:35:54 2019 (r348607) @@ -191,6 +191,13 @@ struct archive_entry; #define AE_IFIFO ((__LA_MODE_T)0010000) /* + * Symlink types + */ +#define AE_SYMLINK_TYPE_UNDEFINED 0 +#define AE_SYMLINK_TYPE_FILE 1 +#define AE_SYMLINK_TYPE_DIRECTORY 2 + +/* * Basic object manipulation */ @@ -275,6 +282,7 @@ __LA_DECL int archive_entry_size_is_set(struct archi __LA_DECL const char *archive_entry_strmode(struct archive_entry *); __LA_DECL const char *archive_entry_symlink(struct archive_entry *); __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); +__LA_DECL int archive_entry_symlink_type(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); __LA_DECL const char *archive_entry_uname(struct archive_entry *); @@ -350,6 +358,7 @@ __LA_DECL void archive_entry_unset_size(struct archive __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); @@ -692,7 +701,6 @@ __LA_DECL void archive_entry_linkify(struct archive_en struct archive_entry **, struct archive_entry **); __LA_DECL struct archive_entry *archive_entry_partial_links( struct archive_entry_linkresolver *res, unsigned int *links); - #ifdef __cplusplus } #endif Copied: stable/11/contrib/libarchive/libarchive/archive_entry_misc.3 (from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_entry_misc.3 Tue Jun 4 10:35:54 2019 (r348607, copy of r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) @@ -0,0 +1,62 @@ +.\" Copyright (c) 2019 Martin Matuska +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 15, 2019 +.Dt ARCHIVE_ENTRY_MISC 3 +.Os +.Sh NAME +.Nm archive_entry_symlink_type , +.Nm archive_entry_set_symlink_type +.Nd miscellaneous functions for manipulating properties of archive_entry. +.Sh LIBRARY +Streaming Archive Library (libarchive, -larchive) +.Sh SYNOPSIS +.In archive_entry.h +.Ft int +.Fn archive_entry_symlink_type "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_symlink_type "struct archive_entry *a" "int" +.Sh DESCRIPTION +The function +.Fn archive_entry_symlink_type +returns and the function +.Fn archive_entry_set_symlink_type +sets the type of the symbolic link stored in an archive entry. These functions +have special meaning on operating systems that support multiple symbolic link +types (e.g. Microsoft Windows). +.Pp +Supported values are: +.Bl -tag -width "AE_SYMLINK_TYPE_DIRECTORY" -compact +.It AE_SYMLINK_TYPE_UNDEFINED +Symbolic link target type is not defined (default on unix systems) +.It AE_SYMLINK_TYPE_FILE +Symbolic link points to a file +.It AE_SYMLINK_TYPE_DIRECTORY +Symbolic link points to a directory +.El +.Sh SEE ALSO +.Xr archive_entry 3 , +.Xr archive_entry_paths 3 , +.Xr archive_entry_stat 3 , +.Xr libarchive 3 Modified: stable/11/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 10:35:54 2019 (r348607) @@ -176,6 +176,9 @@ struct archive_entry { /* Miscellaneous. */ char strmode[12]; + + /* Symlink type support */ + int ae_symlink_type; }; #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: stable/11/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 10:35:54 2019 (r348607) @@ -83,6 +83,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { +#pragma GCC diagnostic ignored "-Wcast-qual" BCRYPT_ALG_HANDLE hAlg; BCRYPT_HASH_HANDLE hHash; DWORD hash_len; Modified: stable/11/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 10:35:54 2019 (r348607) @@ -93,6 +93,9 @@ struct archive_match { /* exclusion/inclusion set flag. */ int setflag; + /* Recursively include directory content? */ + int recursive_include; + /* * Matching filename patterns. */ @@ -223,6 +226,7 @@ archive_match_new(void) return (NULL); a->archive.magic = ARCHIVE_MATCH_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; + a->recursive_include = 1; match_list_init(&(a->inclusions)); match_list_init(&(a->exclusions)); __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); @@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, } /* + * When recursive inclusion of directory content is enabled, + * an inclusion pattern that matches a directory will also + * include everything beneath that directory. Enabled by default. + * + * For compatibility with GNU tar, exclusion patterns always + * match if a subset of the full patch matches (i.e., they are + * are not rooted at the beginning of the path) and thus there + * is no corresponding non-recursive exclusion mode. + */ +int +archive_match_set_inclusion_recursion(struct archive *_a, int enabled) +{ + struct archive_match *a; + + archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, + ARCHIVE_STATE_NEW, "archive_match_set_inclusion_recursion"); + a = (struct archive_match *)_a; + a->recursive_include = enabled; + return (ARCHIVE_OK); +} + +/* * Utility functions to get statistic information for inclusion patterns. */ int @@ -781,7 +807,10 @@ static int match_path_inclusion(struct archive_match *a, struct match *m, int mbs, const void *pn) { - int flag = PATHMATCH_NO_ANCHOR_END; + /* Recursive operation requires only a prefix match. */ + int flag = a->recursive_include ? + PATHMATCH_NO_ANCHOR_END : + 0; int r; if (mbs) { @@ -1232,7 +1261,7 @@ set_timefilter_pathname_mbs(struct archive_match *a, i archive_set_error(&(a->archive), EINVAL, "pathname is empty"); return (ARCHIVE_FAILED); } - if (stat(path, &st) != 0) { + if (la_stat(path, &st) != 0) { archive_set_error(&(a->archive), errno, "Failed to stat()"); return (ARCHIVE_FAILED); } Modified: stable/11/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 10:35:54 2019 (r348607) @@ -69,6 +69,8 @@ * either Windows or Posix APIs. */ #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) #include "archive_windows.h" +#else +#define la_stat(path,stref) stat(path,stref) #endif /* Modified: stable/11/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 10:35:54 2019 (r348607) @@ -611,6 +611,15 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } +int +__archive_read_header(struct archive_read *a, struct archive_entry *entry) +{ + if (a->filter->read_header) + return a->filter->read_header(a->filter, entry); + else + return (ARCHIVE_OK); +} + /* * Read header of next entry. */ Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 10:35:54 2019 (r348607) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } } else #endif - if (stat(path, &s) != 0) { + if (la_stat(path, &s) != 0) { archive_set_error(&a->archive, errno, "Can't stat %s", path); return (ARCHIVE_FAILED); Modified: stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 10:35:54 2019 (r348607) @@ -909,7 +909,7 @@ next_entry(struct archive_read_disk *a, struct tree *t } } break; - } + } } while (lst == NULL); #ifdef __APPLE__ @@ -1295,10 +1295,23 @@ archive_read_disk_descend(struct archive *_a) if (t->visit_type != TREE_REGULAR || !t->descend) return (ARCHIVE_OK); + /* + * We must not treat the initial specified path as a physical dir, + * because if we do then we will try and ascend out of it by opening + * ".." which is (a) wrong and (b) causes spurious permissions errors + * if ".." is not readable by us. Instead, treat it as if it were a + * symlink. (This uses an extra fd, but it can only happen once at the + * top level of a traverse.) But we can't necessarily assume t->st is + * valid here (though t->lst is), which complicates the logic a + * little. + */ if (tree_current_is_physical_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->lst.st_dev, t->lst.st_ino, &t->restore_time); - t->stack->flags |= isDir; + if (t->stack->parent->parent != NULL) + t->stack->flags |= isDir; + else + t->stack->flags |= isDirLink; } else if (tree_current_is_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->st.st_dev, t->st.st_ino, &t->restore_time); @@ -2151,6 +2164,17 @@ tree_open(const char *path, int symlink_mode, int rest static struct tree * tree_reopen(struct tree *t, const char *path, int restore_time) { +#if defined(O_PATH) + /* Linux */ + const int o_flag = O_PATH; +#elif defined(O_SEARCH) + /* SunOS */ + const int o_flag = O_SEARCH; +#elif defined(O_EXEC) + /* FreeBSD */ + const int o_flag = O_EXEC; +#endif + t->flags = (restore_time != 0)?needsRestoreTimes:0; t->flags |= onInitialDir; t->visit_type = 0; @@ -2172,6 +2196,15 @@ tree_reopen(struct tree *t, const char *path, int rest t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); +#if defined(O_PATH) || defined(O_SEARCH) || defined(O_EXEC) + /* + * Most likely reason to fail opening "." is that it's not readable, + * so try again for execute. The consequences of not opening this are + * unhelpful and unnecessary errors later. + */ + if (t->initial_dir_fd < 0) + t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); +#endif __archive_ensure_cloexec_flag(t->initial_dir_fd); t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); @@ -2479,7 +2512,7 @@ tree_current_stat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; - if (stat(tree_current_access_path(t), &t->st) != 0) + if (la_stat(tree_current_access_path(t), &t->st) != 0) #endif return NULL; t->flags |= hasStat; Modified: stable/11/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 10:35:54 2019 (r348607) @@ -98,6 +98,8 @@ struct archive_read_filter { int (*close)(struct archive_read_filter *self); /* Function that handles switching from reading one block to the next/prev */ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); + /* Read any header metadata if available. */ + int (*read_header)(struct archive_read_filter *self, struct archive_entry *entry); /* My private data. */ void *data; @@ -250,6 +252,7 @@ int64_t __archive_read_seek(struct archive_read*, int6 int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); +int __archive_read_header(struct archive_read *, struct archive_entry *); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: stable/11/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 10:35:54 2019 (r348607) @@ -73,6 +73,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR: strcpy(str, "rar"); break; + case ARCHIVE_FORMAT_RAR_V5: + strcpy(str, "rar5"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); break; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 10:35:54 2019 (r348607) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -56,6 +61,8 @@ struct private_data { size_t out_block_size; int64_t total_out; unsigned long crc; + uint32_t mtime; + char *name; char eof; /* True = found end of compressed data. */ }; @@ -123,7 +130,8 @@ archive_read_support_filter_gzip(struct archive *_a) * count of bits verified, suitable for use by bidder. */ static ssize_t -peek_at_header(struct archive_read_filter *filter, int *pbits) +peek_at_header(struct archive_read_filter *filter, int *pbits, + struct private_data *state) { const unsigned char *p; ssize_t avail, len; @@ -144,7 +152,9 @@ peek_at_header(struct archive_read_filter *filter, int return (0); bits += 3; header_flags = p[3]; - /* Bytes 4-7 are mod time. */ + /* Bytes 4-7 are mod time in little endian. */ + if (state) + state->mtime = archive_le32dec(p + 4); /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -161,6 +171,7 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { + ssize_t file_start = len; do { ++len; if (avail < len) @@ -169,6 +180,12 @@ peek_at_header(struct archive_read_filter *filter, int if (p == NULL) return (0); } while (p[len - 1] != 0); + + if (state) { + /* Reset the name in case of repeat header reads. */ + free(state->name); + state->name = strdup((const char *)&p[file_start]); + } } /* Null-terminated optional comment. */ @@ -214,12 +231,29 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel (void)self; /* UNUSED */ - if (peek_at_header(filter, &bits_checked)) + if (peek_at_header(filter, &bits_checked, NULL)) return (bits_checked); return (0); } +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + #ifndef HAVE_ZLIB_H /* @@ -272,6 +306,7 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; + self->read_header = gzip_read_header; state->in_stream = 0; /* We're not actually within a stream yet. */ @@ -289,7 +324,7 @@ consume_header(struct archive_read_filter *self) state = (struct private_data *)self->data; /* If this is a real header, consume it. */ - len = peek_at_header(self->upstream, NULL); + len = peek_at_header(self->upstream, NULL, state); if (len == 0) return (ARCHIVE_EOF); __archive_read_filter_consume(self->upstream, len); @@ -374,7 +409,7 @@ gzip_filter_read(struct archive_read_filter *self, con { struct private_data *state; size_t decompressed; - ssize_t avail_in; + ssize_t avail_in, max_in; int ret; state = (struct private_data *)self->data; @@ -408,6 +443,12 @@ gzip_filter_read(struct archive_read_filter *self, con "truncated gzip input"); return (ARCHIVE_FATAL); } + if (UINT_MAX >= SSIZE_MAX) + max_in = SSIZE_MAX; + else + max_in = UINT_MAX; + if (avail_in > max_in) + avail_in = max_in; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ @@ -469,6 +510,7 @@ gzip_filter_close(struct archive_read_filter *self) } } + free(state->name); free(state->out_block); free(state); return (ret); Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 10:35:54 2019 (r348607) @@ -1509,8 +1509,8 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) goto nomszip; - else if (cab->stream.next_in[0] != 0x43 || - cab->stream.next_in[1] != 0x4b) + else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 || + cab->stream.next_in[1] != 0x4b)) goto nomszip; cab->stream.next_in += mszip; cab->stream.avail_in -= mszip; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 10:35:54 2019 (r348607) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_CTYPE_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -1011,7 +1014,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree { ssize_t len; uintmax_t counter; - char *p; + char *p, *s; struct mtree_option *global; struct mtree_entry *last_entry; int r, is_form_d; @@ -1025,6 +1028,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree (void)detect_form(a, &is_form_d); for (counter = 1; ; ++counter) { + r = ARCHIVE_OK; len = readline(a, mtree, &p, 65536); if (len == 0) { mtree->this_entry = mtree->entries; @@ -1045,6 +1049,15 @@ read_mtree(struct archive_read *a, struct mtree *mtree continue; if (*p == '\r' || *p == '\n' || *p == '\0') continue; + /* Non-printable characters are not allowed */ + for (s = p;s < p + len - 1; s++) { + if (!isprint(*s)) { + r = ARCHIVE_FATAL; + break; + } + } + if (r != ARCHIVE_OK) + break; if (*p != '/') { r = process_add_entry(a, mtree, &global, p, len, &last_entry, is_form_d); Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 10:35:54 2019 (r348607) @@ -1024,8 +1024,10 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); - if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) + if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); + rar->start_new_table = 1; + } break; default: Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 10:28:50 2019 (r348606) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 10:35:54 2019 (r348607) @@ -33,6 +33,9 @@ #ifdef HAVE_ZLIB_H #include /* crc32 */ #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #ifndef HAVE_ZLIB_H @@ -78,230 +81,275 @@ static unsigned char rar5_signature[] = { 243, 192, 211, 128, 187, 166, 160, 161 }; static const ssize_t rar5_signature_size = sizeof(rar5_signature); -/* static const size_t g_unpack_buf_chunk_size = 1024; */ static const size_t g_unpack_window_size = 0x20000; +/* These could have been static const's, but they aren't, because of + * Visual Studio. */ +#define MAX_NAME_IN_CHARS 2048 +#define MAX_NAME_IN_BYTES (4 * MAX_NAME_IN_CHARS) + struct file_header { - ssize_t bytes_remaining; - ssize_t unpacked_size; - int64_t last_offset; /* Used in sanity checks. */ - int64_t last_size; /* Used in sanity checks. */ + ssize_t bytes_remaining; + ssize_t unpacked_size; + int64_t last_offset; /* Used in sanity checks. */ + int64_t last_size; /* Used in sanity checks. */ - uint8_t solid : 1; /* Is this a solid stream? */ - uint8_t service : 1; /* Is this file a service data? */ - uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t solid : 1; /* Is this a solid stream? */ + uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t dir : 1; /* Is this file entry a directory? */ - /* Optional time fields. */ - uint64_t e_mtime; - uint64_t e_ctime; - uint64_t e_atime; - uint32_t e_unix_ns; + /* Optional time fields. */ + uint64_t e_mtime; + uint64_t e_ctime; + uint64_t e_atime; + uint32_t e_unix_ns; - /* Optional hash fields. */ - uint32_t stored_crc32; - uint32_t calculated_crc32; - uint8_t blake2sp[32]; - blake2sp_state b2state; - char has_blake2; + /* Optional hash fields. */ + uint32_t stored_crc32; + uint32_t calculated_crc32; + uint8_t blake2sp[32]; + blake2sp_state b2state; + char has_blake2; + + /* Optional redir fields */ + uint64_t redir_type; + uint64_t redir_flags; }; +enum EXTRA { + EX_CRYPT = 0x01, + EX_HASH = 0x02, + EX_HTIME = 0x03, + EX_VERSION = 0x04, + EX_REDIR = 0x05, + EX_UOWNER = 0x06, + EX_SUBDATA = 0x07 +}; + +#define REDIR_SYMLINK_IS_DIR 1 + +enum REDIR_TYPE { + REDIR_TYPE_NONE = 0, + REDIR_TYPE_UNIXSYMLINK = 1, + REDIR_TYPE_WINSYMLINK = 2, + REDIR_TYPE_JUNCTION = 3, + REDIR_TYPE_HARDLINK = 4, + REDIR_TYPE_FILECOPY = 5, +}; + +#define OWNER_USER_NAME 0x01 +#define OWNER_GROUP_NAME 0x02 +#define OWNER_USER_UID 0x04 +#define OWNER_GROUP_GID 0x08 +#define OWNER_MAXNAMELEN 256 + enum FILTER_TYPE { - FILTER_DELTA = 0, /* Generic pattern. */ - FILTER_E8 = 1, /* Intel x86 code. */ - FILTER_E8E9 = 2, /* Intel x86 code. */ - FILTER_ARM = 3, /* ARM code. */ - FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ - FILTER_RGB = 5, /* Color palette, not used in RARv5. */ - FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ - FILTER_PPM = 7, /* Predictive pattern matching, not used in RARv5. */ - FILTER_NONE = 8, + FILTER_DELTA = 0, /* Generic pattern. */ + FILTER_E8 = 1, /* Intel x86 code. */ + FILTER_E8E9 = 2, /* Intel x86 code. */ + FILTER_ARM = 3, /* ARM code. */ + FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ + FILTER_RGB = 5, /* Color palette, not used in RARv5. */ + FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ + FILTER_PPM = 7, /* Predictive pattern matching, not used in + RARv5. */ + FILTER_NONE = 8, }; struct filter_info { - int type; - int channels; - int pos_r; + int type; + int channels; + int pos_r; - int64_t block_start; - ssize_t block_length; - uint16_t width; + int64_t block_start; + ssize_t block_length; + uint16_t width; }; struct data_ready { - char used; - const uint8_t* buf; - size_t size; - int64_t offset; + char used; + const uint8_t* buf; + size_t size; + int64_t offset; }; struct cdeque { - uint16_t beg_pos; - uint16_t end_pos; - uint16_t cap_mask; - uint16_t size; - size_t* arr; + uint16_t beg_pos; + uint16_t end_pos; + uint16_t cap_mask; + uint16_t size; + size_t* arr; }; struct decode_table { - uint32_t size; - int32_t decode_len[16]; - uint32_t decode_pos[16]; - uint32_t quick_bits; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 10:36:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA92415AB68F; Tue, 4 Jun 2019 10:36:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA0F91B91; Tue, 4 Jun 2019 10:36:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4391F1C4E0; Tue, 4 Jun 2019 10:36:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54AaWMk080745; Tue, 4 Jun 2019 10:36:32 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54AaQGf080718; Tue, 4 Jun 2019 10:36:26 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906041036.x54AaQGf080718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 4 Jun 2019 10:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r348608 - in stable/10: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/te... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/tes... X-SVN-Commit-Revision: 348608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AA0F91B91 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 10:36:33 -0000 Author: mm Date: Tue Jun 4 10:36:26 2019 New Revision: 348608 URL: https://svnweb.freebsd.org/changeset/base/348608 Log: MFC r347990: Sync libarchive with vendor. Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes MFC r347999: Install missing data file for lib.libarchive.functional_test.test_read_format_zip_utf8_paths Added: stable/10/contrib/libarchive/libarchive/archive_entry_misc.3 - copied unchanged from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3 stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu - copied unchanged from r347990, head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu stable/10/contrib/libarchive/tar/test/test_option_exclude_vcs.c - copied unchanged from r347990, head/contrib/libarchive/tar/test/test_option_exclude_vcs.c Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/cpio/test/test_basic.c stable/10/contrib/libarchive/cpio/test/test_format_newc.c stable/10/contrib/libarchive/cpio/test/test_gcpio_compat.c stable/10/contrib/libarchive/cpio/test/test_option_L_upper.c stable/10/contrib/libarchive/cpio/test/test_option_a.c stable/10/contrib/libarchive/cpio/test/test_option_c.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_entry_private.h stable/10/contrib/libarchive/libarchive/archive_hmac.c stable/10/contrib/libarchive/libarchive/archive_match.c stable/10/contrib/libarchive/libarchive/archive_platform.h stable/10/contrib/libarchive/libarchive/archive_read.c stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_read_private.h stable/10/contrib/libarchive/libarchive/archive_read_set_format.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_raw.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_util.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_xz.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/10/contrib/libarchive/libarchive/test/test_entry.c stable/10/contrib/libarchive/libarchive/test/test_fuzz.c stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/10/contrib/libarchive/libarchive/test/test_read_extract.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_raw.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_symlink.c stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/contrib/libarchive/tar/bsdtar.c stable/10/contrib/libarchive/tar/bsdtar.h stable/10/contrib/libarchive/tar/cmdline.c stable/10/contrib/libarchive/tar/test/test_basic.c stable/10/contrib/libarchive/tar/test/test_copy.c stable/10/contrib/libarchive/tar/test/test_option_C_mtree.c stable/10/contrib/libarchive/tar/test/test_option_H_upper.c stable/10/contrib/libarchive/tar/test/test_option_L_upper.c stable/10/contrib/libarchive/tar/test/test_option_U_upper.c stable/10/contrib/libarchive/tar/test/test_option_n.c stable/10/contrib/libarchive/tar/test/test_option_s.c stable/10/contrib/libarchive/tar/test/test_strip_components.c stable/10/contrib/libarchive/tar/test/test_symlink_dir.c stable/10/contrib/libarchive/test_utils/test_common.h stable/10/contrib/libarchive/test_utils/test_main.c stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/tar/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/NEWS Tue Jun 4 10:36:26 2019 (r348608) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: stable/10/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_basic.c Tue Jun 4 10:36:26 2019 (r348608) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: stable/10/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_format_newc.c Tue Jun 4 10:36:26 2019 (r348608) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: stable/10/contrib/libarchive/cpio/test/test_gcpio_compat.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_gcpio_compat.c Tue Jun 4 10:36:26 2019 (r348608) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: stable/10/contrib/libarchive/cpio/test/test_option_L_upper.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_option_L_upper.c Tue Jun 4 10:36:26 2019 (r348608) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); + r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog); + failure("Error invoking %s -i", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack.err"); assertChdir(".."); - assertIsSymlink("unpack/symlink", NULL); + assertIsSymlink("unpack/symlink", NULL, 0); r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); failure("Error invoking %s -oL", testprog); @@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack-L", 0755); assertChdir("unpack-L"); - r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + failure("Error invoking %s -i < archive-L.out", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack-L.err"); Modified: stable/10/contrib/libarchive/cpio/test/test_option_a.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_option_a.c Tue Jun 4 10:36:26 2019 (r348608) @@ -71,8 +71,13 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); +#if defined(_WIN32) && !defined(CYGWIN) + times.actime = 86400; + times.modtime = 86400; +#else times.actime = 1; times.modtime = 3; +#endif assertEqualInt(0, utime(files[i].name, ×)); /* Record whatever atime the file ended up with. */ Modified: stable/10/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/cpio/test/test_option_c.c Tue Jun 4 10:36:26 2019 (r348608) @@ -85,7 +85,7 @@ DEFINE_TEST(test_option_c) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); } Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive.h Tue Jun 4 10:36:26 2019 (r348608) @@ -338,9 +338,9 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 -#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 /* * Codes returned by archive_read_format_capabilities(). @@ -1095,6 +1095,8 @@ __LA_DECL int archive_match_excluded(struct archive *, */ __LA_DECL int archive_match_path_excluded(struct archive *, struct archive_entry *); +/* Control recursive inclusion of directory content when directory is included. Default on. */ +__LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int); /* Add exclusion pathname pattern. */ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); __LA_DECL int archive_match_exclude_pattern_w(struct archive *, Modified: stable/10/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_entry.c Tue Jun 4 10:36:26 2019 (r348608) @@ -168,6 +168,7 @@ archive_entry_clear(struct archive_entry *entry) archive_entry_xattr_clear(entry); archive_entry_sparse_clear(entry); free(entry->stat); + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; memset(entry, 0, sizeof(*entry)); return entry; } @@ -202,6 +203,9 @@ archive_entry_clone(struct archive_entry *entry) entry2->ae_set = entry->ae_set; archive_mstring_copy(&entry2->ae_uname, &entry->ae_uname); + /* Copy symlink type */ + entry2->ae_symlink_type = entry->ae_symlink_type; + /* Copy encryption status */ entry2->encryption = entry->encryption; @@ -253,6 +257,7 @@ archive_entry_new2(struct archive *a) if (entry == NULL) return (NULL); entry->archive = a; + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; return (entry); } @@ -675,6 +680,12 @@ archive_entry_symlink(struct archive_entry *entry) return (NULL); } +int +archive_entry_symlink_type(struct archive_entry *entry) +{ + return (entry->ae_symlink_type); +} + const char * archive_entry_symlink_utf8(struct archive_entry *entry) { @@ -1246,6 +1257,12 @@ archive_entry_set_symlink(struct archive_entry *entry, } void +archive_entry_set_symlink_type(struct archive_entry *entry, int type) +{ + entry->ae_symlink_type = type; +} + +void archive_entry_set_symlink_utf8(struct archive_entry *entry, const char *linkname) { archive_mstring_copy_utf8(&entry->ae_symlink, linkname); @@ -1749,6 +1766,10 @@ static const struct flag { { "nohidden", L"nohidden", UF_HIDDEN, 0}, { "nouhidden", L"nouhidden", UF_HIDDEN, 0}, #endif +#ifdef FILE_ATTRIBUTE_HIDDEN + { "nohidden", L"nohidden", FILE_ATTRIBUTE_HIDDEN, 0}, + { "nouhidden", L"nouhidden", FILE_ATTRIBUTE_HIDDEN, 0}, +#endif #ifdef UF_OFFLINE { "nooffline", L"nooffline", UF_OFFLINE, 0}, { "nouoffline", L"nouoffline", UF_OFFLINE, 0}, @@ -1758,6 +1779,11 @@ static const struct flag { { "nourdonly", L"nourdonly", UF_READONLY, 0}, { "noreadonly", L"noreadonly", UF_READONLY, 0}, #endif +#ifdef FILE_ATTRIBUTE_READONLY + { "nordonly", L"nordonly", FILE_ATTRIBUTE_READONLY, 0}, + { "nourdonly", L"nourdonly", FILE_ATTRIBUTE_READONLY, 0}, + { "noreadonly", L"noreadonly", FILE_ATTRIBUTE_READONLY, 0}, +#endif #ifdef UF_SPARSE { "nosparse", L"nosparse", UF_SPARSE, 0}, { "nousparse", L"nousparse", UF_SPARSE, 0}, @@ -1769,6 +1795,10 @@ static const struct flag { #ifdef UF_SYSTEM { "nosystem", L"nosystem", UF_SYSTEM, 0}, { "nousystem", L"nousystem", UF_SYSTEM, 0}, +#endif +#ifdef FILE_ATTRIBUTE_SYSTEM + { "nosystem", L"nosystem", FILE_ATTRIBUTE_SYSTEM, 0}, + { "nousystem", L"nousystem", FILE_ATTRIBUTE_SYSTEM, 0}, #endif #if defined(FS_UNRM_FL) /* 'u' */ { "noundel", L"noundel", FS_UNRM_FL, 0}, Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Tue Jun 4 10:36:26 2019 (r348608) @@ -191,6 +191,13 @@ struct archive_entry; #define AE_IFIFO ((__LA_MODE_T)0010000) /* + * Symlink types + */ +#define AE_SYMLINK_TYPE_UNDEFINED 0 +#define AE_SYMLINK_TYPE_FILE 1 +#define AE_SYMLINK_TYPE_DIRECTORY 2 + +/* * Basic object manipulation */ @@ -275,6 +282,7 @@ __LA_DECL int archive_entry_size_is_set(struct archi __LA_DECL const char *archive_entry_strmode(struct archive_entry *); __LA_DECL const char *archive_entry_symlink(struct archive_entry *); __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); +__LA_DECL int archive_entry_symlink_type(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); __LA_DECL const char *archive_entry_uname(struct archive_entry *); @@ -350,6 +358,7 @@ __LA_DECL void archive_entry_unset_size(struct archive __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); @@ -692,7 +701,6 @@ __LA_DECL void archive_entry_linkify(struct archive_en struct archive_entry **, struct archive_entry **); __LA_DECL struct archive_entry *archive_entry_partial_links( struct archive_entry_linkresolver *res, unsigned int *links); - #ifdef __cplusplus } #endif Copied: stable/10/contrib/libarchive/libarchive/archive_entry_misc.3 (from r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_entry_misc.3 Tue Jun 4 10:36:26 2019 (r348608, copy of r347990, head/contrib/libarchive/libarchive/archive_entry_misc.3) @@ -0,0 +1,62 @@ +.\" Copyright (c) 2019 Martin Matuska +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 15, 2019 +.Dt ARCHIVE_ENTRY_MISC 3 +.Os +.Sh NAME +.Nm archive_entry_symlink_type , +.Nm archive_entry_set_symlink_type +.Nd miscellaneous functions for manipulating properties of archive_entry. +.Sh LIBRARY +Streaming Archive Library (libarchive, -larchive) +.Sh SYNOPSIS +.In archive_entry.h +.Ft int +.Fn archive_entry_symlink_type "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_symlink_type "struct archive_entry *a" "int" +.Sh DESCRIPTION +The function +.Fn archive_entry_symlink_type +returns and the function +.Fn archive_entry_set_symlink_type +sets the type of the symbolic link stored in an archive entry. These functions +have special meaning on operating systems that support multiple symbolic link +types (e.g. Microsoft Windows). +.Pp +Supported values are: +.Bl -tag -width "AE_SYMLINK_TYPE_DIRECTORY" -compact +.It AE_SYMLINK_TYPE_UNDEFINED +Symbolic link target type is not defined (default on unix systems) +.It AE_SYMLINK_TYPE_FILE +Symbolic link points to a file +.It AE_SYMLINK_TYPE_DIRECTORY +Symbolic link points to a directory +.El +.Sh SEE ALSO +.Xr archive_entry 3 , +.Xr archive_entry_paths 3 , +.Xr archive_entry_stat 3 , +.Xr libarchive 3 Modified: stable/10/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_entry_private.h Tue Jun 4 10:36:26 2019 (r348608) @@ -176,6 +176,9 @@ struct archive_entry { /* Miscellaneous. */ char strmode[12]; + + /* Symlink type support */ + int ae_symlink_type; }; #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: stable/10/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_hmac.c Tue Jun 4 10:36:26 2019 (r348608) @@ -83,6 +83,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { +#pragma GCC diagnostic ignored "-Wcast-qual" BCRYPT_ALG_HANDLE hAlg; BCRYPT_HASH_HANDLE hHash; DWORD hash_len; Modified: stable/10/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_match.c Tue Jun 4 10:36:26 2019 (r348608) @@ -93,6 +93,9 @@ struct archive_match { /* exclusion/inclusion set flag. */ int setflag; + /* Recursively include directory content? */ + int recursive_include; + /* * Matching filename patterns. */ @@ -223,6 +226,7 @@ archive_match_new(void) return (NULL); a->archive.magic = ARCHIVE_MATCH_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; + a->recursive_include = 1; match_list_init(&(a->inclusions)); match_list_init(&(a->exclusions)); __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); @@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, } /* + * When recursive inclusion of directory content is enabled, + * an inclusion pattern that matches a directory will also + * include everything beneath that directory. Enabled by default. + * + * For compatibility with GNU tar, exclusion patterns always + * match if a subset of the full patch matches (i.e., they are + * are not rooted at the beginning of the path) and thus there + * is no corresponding non-recursive exclusion mode. + */ +int +archive_match_set_inclusion_recursion(struct archive *_a, int enabled) +{ + struct archive_match *a; + + archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, + ARCHIVE_STATE_NEW, "archive_match_set_inclusion_recursion"); + a = (struct archive_match *)_a; + a->recursive_include = enabled; + return (ARCHIVE_OK); +} + +/* * Utility functions to get statistic information for inclusion patterns. */ int @@ -781,7 +807,10 @@ static int match_path_inclusion(struct archive_match *a, struct match *m, int mbs, const void *pn) { - int flag = PATHMATCH_NO_ANCHOR_END; + /* Recursive operation requires only a prefix match. */ + int flag = a->recursive_include ? + PATHMATCH_NO_ANCHOR_END : + 0; int r; if (mbs) { @@ -1232,7 +1261,7 @@ set_timefilter_pathname_mbs(struct archive_match *a, i archive_set_error(&(a->archive), EINVAL, "pathname is empty"); return (ARCHIVE_FAILED); } - if (stat(path, &st) != 0) { + if (la_stat(path, &st) != 0) { archive_set_error(&(a->archive), errno, "Failed to stat()"); return (ARCHIVE_FAILED); } Modified: stable/10/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_platform.h Tue Jun 4 10:36:26 2019 (r348608) @@ -69,6 +69,8 @@ * either Windows or Posix APIs. */ #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) #include "archive_windows.h" +#else +#define la_stat(path,stref) stat(path,stref) #endif /* Modified: stable/10/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read.c Tue Jun 4 10:36:26 2019 (r348608) @@ -611,6 +611,15 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } +int +__archive_read_header(struct archive_read *a, struct archive_entry *entry) +{ + if (a->filter->read_header) + return a->filter->read_header(a->filter, entry); + else + return (ARCHIVE_OK); +} + /* * Read header of next entry. */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Jun 4 10:36:26 2019 (r348608) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } } else #endif - if (stat(path, &s) != 0) { + if (la_stat(path, &s) != 0) { archive_set_error(&a->archive, errno, "Can't stat %s", path); return (ARCHIVE_FAILED); Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Jun 4 10:36:26 2019 (r348608) @@ -909,7 +909,7 @@ next_entry(struct archive_read_disk *a, struct tree *t } } break; - } + } } while (lst == NULL); #ifdef __APPLE__ @@ -1295,10 +1295,23 @@ archive_read_disk_descend(struct archive *_a) if (t->visit_type != TREE_REGULAR || !t->descend) return (ARCHIVE_OK); + /* + * We must not treat the initial specified path as a physical dir, + * because if we do then we will try and ascend out of it by opening + * ".." which is (a) wrong and (b) causes spurious permissions errors + * if ".." is not readable by us. Instead, treat it as if it were a + * symlink. (This uses an extra fd, but it can only happen once at the + * top level of a traverse.) But we can't necessarily assume t->st is + * valid here (though t->lst is), which complicates the logic a + * little. + */ if (tree_current_is_physical_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->lst.st_dev, t->lst.st_ino, &t->restore_time); - t->stack->flags |= isDir; + if (t->stack->parent->parent != NULL) + t->stack->flags |= isDir; + else + t->stack->flags |= isDirLink; } else if (tree_current_is_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->st.st_dev, t->st.st_ino, &t->restore_time); @@ -2151,6 +2164,17 @@ tree_open(const char *path, int symlink_mode, int rest static struct tree * tree_reopen(struct tree *t, const char *path, int restore_time) { +#if defined(O_PATH) + /* Linux */ + const int o_flag = O_PATH; +#elif defined(O_SEARCH) + /* SunOS */ + const int o_flag = O_SEARCH; +#elif defined(O_EXEC) + /* FreeBSD */ + const int o_flag = O_EXEC; +#endif + t->flags = (restore_time != 0)?needsRestoreTimes:0; t->flags |= onInitialDir; t->visit_type = 0; @@ -2172,6 +2196,15 @@ tree_reopen(struct tree *t, const char *path, int rest t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); +#if defined(O_PATH) || defined(O_SEARCH) || defined(O_EXEC) + /* + * Most likely reason to fail opening "." is that it's not readable, + * so try again for execute. The consequences of not opening this are + * unhelpful and unnecessary errors later. + */ + if (t->initial_dir_fd < 0) + t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); +#endif __archive_ensure_cloexec_flag(t->initial_dir_fd); t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); @@ -2479,7 +2512,7 @@ tree_current_stat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; - if (stat(tree_current_access_path(t), &t->st) != 0) + if (la_stat(tree_current_access_path(t), &t->st) != 0) #endif return NULL; t->flags |= hasStat; Modified: stable/10/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_private.h Tue Jun 4 10:36:26 2019 (r348608) @@ -98,6 +98,8 @@ struct archive_read_filter { int (*close)(struct archive_read_filter *self); /* Function that handles switching from reading one block to the next/prev */ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); + /* Read any header metadata if available. */ + int (*read_header)(struct archive_read_filter *self, struct archive_entry *entry); /* My private data. */ void *data; @@ -250,6 +252,7 @@ int64_t __archive_read_seek(struct archive_read*, int6 int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); +int __archive_read_header(struct archive_read *, struct archive_entry *); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: stable/10/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_set_format.c Tue Jun 4 10:36:26 2019 (r348608) @@ -73,6 +73,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR: strcpy(str, "rar"); break; + case ARCHIVE_FORMAT_RAR_V5: + strcpy(str, "rar5"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); break; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Tue Jun 4 10:36:26 2019 (r348608) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -56,6 +61,8 @@ struct private_data { size_t out_block_size; int64_t total_out; unsigned long crc; + uint32_t mtime; + char *name; char eof; /* True = found end of compressed data. */ }; @@ -123,7 +130,8 @@ archive_read_support_filter_gzip(struct archive *_a) * count of bits verified, suitable for use by bidder. */ static ssize_t -peek_at_header(struct archive_read_filter *filter, int *pbits) +peek_at_header(struct archive_read_filter *filter, int *pbits, + struct private_data *state) { const unsigned char *p; ssize_t avail, len; @@ -144,7 +152,9 @@ peek_at_header(struct archive_read_filter *filter, int return (0); bits += 3; header_flags = p[3]; - /* Bytes 4-7 are mod time. */ + /* Bytes 4-7 are mod time in little endian. */ + if (state) + state->mtime = archive_le32dec(p + 4); /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -161,6 +171,7 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { + ssize_t file_start = len; do { ++len; if (avail < len) @@ -169,6 +180,12 @@ peek_at_header(struct archive_read_filter *filter, int if (p == NULL) return (0); } while (p[len - 1] != 0); + + if (state) { + /* Reset the name in case of repeat header reads. */ + free(state->name); + state->name = strdup((const char *)&p[file_start]); + } } /* Null-terminated optional comment. */ @@ -214,12 +231,29 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel (void)self; /* UNUSED */ - if (peek_at_header(filter, &bits_checked)) + if (peek_at_header(filter, &bits_checked, NULL)) return (bits_checked); return (0); } +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + #ifndef HAVE_ZLIB_H /* @@ -272,6 +306,7 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; + self->read_header = gzip_read_header; state->in_stream = 0; /* We're not actually within a stream yet. */ @@ -289,7 +324,7 @@ consume_header(struct archive_read_filter *self) state = (struct private_data *)self->data; /* If this is a real header, consume it. */ - len = peek_at_header(self->upstream, NULL); + len = peek_at_header(self->upstream, NULL, state); if (len == 0) return (ARCHIVE_EOF); __archive_read_filter_consume(self->upstream, len); @@ -374,7 +409,7 @@ gzip_filter_read(struct archive_read_filter *self, con { struct private_data *state; size_t decompressed; - ssize_t avail_in; + ssize_t avail_in, max_in; int ret; state = (struct private_data *)self->data; @@ -408,6 +443,12 @@ gzip_filter_read(struct archive_read_filter *self, con "truncated gzip input"); return (ARCHIVE_FATAL); } + if (UINT_MAX >= SSIZE_MAX) + max_in = SSIZE_MAX; + else + max_in = UINT_MAX; + if (avail_in > max_in) + avail_in = max_in; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ @@ -469,6 +510,7 @@ gzip_filter_close(struct archive_read_filter *self) } } + free(state->name); free(state->out_block); free(state); return (ret); Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Jun 4 10:36:26 2019 (r348608) @@ -1509,8 +1509,8 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) goto nomszip; - else if (cab->stream.next_in[0] != 0x43 || - cab->stream.next_in[1] != 0x4b) + else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 || + cab->stream.next_in[1] != 0x4b)) goto nomszip; cab->stream.next_in += mszip; cab->stream.avail_in -= mszip; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 4 10:36:26 2019 (r348608) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_CTYPE_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -1011,7 +1014,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree { ssize_t len; uintmax_t counter; - char *p; + char *p, *s; struct mtree_option *global; struct mtree_entry *last_entry; int r, is_form_d; @@ -1025,6 +1028,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree (void)detect_form(a, &is_form_d); for (counter = 1; ; ++counter) { + r = ARCHIVE_OK; len = readline(a, mtree, &p, 65536); if (len == 0) { mtree->this_entry = mtree->entries; @@ -1045,6 +1049,15 @@ read_mtree(struct archive_read *a, struct mtree *mtree continue; if (*p == '\r' || *p == '\n' || *p == '\0') continue; + /* Non-printable characters are not allowed */ + for (s = p;s < p + len - 1; s++) { + if (!isprint(*s)) { + r = ARCHIVE_FATAL; + break; + } + } + if (r != ARCHIVE_OK) + break; if (*p != '/') { r = process_add_entry(a, mtree, &global, p, len, &last_entry, is_form_d); Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 4 10:36:26 2019 (r348608) @@ -1023,8 +1023,10 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); - if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) + if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); + rar->start_new_table = 1; + } break; default: Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 10:35:54 2019 (r348607) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Tue Jun 4 10:36:26 2019 (r348608) @@ -24,6 +24,7 @@ */ #include "archive_platform.h" +#include "archive_endian.h" #ifdef HAVE_ERRNO_H #include @@ -32,6 +33,9 @@ #ifdef HAVE_ZLIB_H #include /* crc32 */ #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #ifndef HAVE_ZLIB_H @@ -77,230 +81,275 @@ static unsigned char rar5_signature[] = { 243, 192, 211, 128, 187, 166, 160, 161 }; static const ssize_t rar5_signature_size = sizeof(rar5_signature); -/* static const size_t g_unpack_buf_chunk_size = 1024; */ static const size_t g_unpack_window_size = 0x20000; +/* These could have been static const's, but they aren't, because of + * Visual Studio. */ +#define MAX_NAME_IN_CHARS 2048 +#define MAX_NAME_IN_BYTES (4 * MAX_NAME_IN_CHARS) + struct file_header { - ssize_t bytes_remaining; - ssize_t unpacked_size; - int64_t last_offset; /* Used in sanity checks. */ - int64_t last_size; /* Used in sanity checks. */ + ssize_t bytes_remaining; + ssize_t unpacked_size; + int64_t last_offset; /* Used in sanity checks. */ + int64_t last_size; /* Used in sanity checks. */ - uint8_t solid : 1; /* Is this a solid stream? */ - uint8_t service : 1; /* Is this file a service data? */ + uint8_t solid : 1; /* Is this a solid stream? */ + uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t dir : 1; /* Is this file entry a directory? */ - /* Optional time fields. */ - uint64_t e_mtime; - uint64_t e_ctime; - uint64_t e_atime; - uint32_t e_unix_ns; + /* Optional time fields. */ + uint64_t e_mtime; + uint64_t e_ctime; + uint64_t e_atime; + uint32_t e_unix_ns; - /* Optional hash fields. */ - uint32_t stored_crc32; - uint32_t calculated_crc32; - uint8_t blake2sp[32]; - blake2sp_state b2state; - char has_blake2; + /* Optional hash fields. */ + uint32_t stored_crc32; + uint32_t calculated_crc32; + uint8_t blake2sp[32]; + blake2sp_state b2state; + char has_blake2; + + /* Optional redir fields */ + uint64_t redir_type; + uint64_t redir_flags; }; +enum EXTRA { + EX_CRYPT = 0x01, + EX_HASH = 0x02, + EX_HTIME = 0x03, + EX_VERSION = 0x04, + EX_REDIR = 0x05, + EX_UOWNER = 0x06, + EX_SUBDATA = 0x07 +}; + +#define REDIR_SYMLINK_IS_DIR 1 + +enum REDIR_TYPE { + REDIR_TYPE_NONE = 0, + REDIR_TYPE_UNIXSYMLINK = 1, + REDIR_TYPE_WINSYMLINK = 2, + REDIR_TYPE_JUNCTION = 3, + REDIR_TYPE_HARDLINK = 4, + REDIR_TYPE_FILECOPY = 5, +}; + +#define OWNER_USER_NAME 0x01 +#define OWNER_GROUP_NAME 0x02 +#define OWNER_USER_UID 0x04 +#define OWNER_GROUP_GID 0x08 +#define OWNER_MAXNAMELEN 256 + enum FILTER_TYPE { - FILTER_DELTA = 0, /* Generic pattern. */ - FILTER_E8 = 1, /* Intel x86 code. */ - FILTER_E8E9 = 2, /* Intel x86 code. */ - FILTER_ARM = 3, /* ARM code. */ - FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ - FILTER_RGB = 5, /* Color palette, not used in RARv5. */ - FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ - FILTER_PPM = 7, /* Predictive pattern matching, not used in RARv5. */ - FILTER_NONE = 8, + FILTER_DELTA = 0, /* Generic pattern. */ + FILTER_E8 = 1, /* Intel x86 code. */ + FILTER_E8E9 = 2, /* Intel x86 code. */ + FILTER_ARM = 3, /* ARM code. */ + FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ + FILTER_RGB = 5, /* Color palette, not used in RARv5. */ + FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ + FILTER_PPM = 7, /* Predictive pattern matching, not used in + RARv5. */ + FILTER_NONE = 8, }; struct filter_info { - int type; - int channels; - int pos_r; + int type; + int channels; + int pos_r; - int64_t block_start; - ssize_t block_length; - uint16_t width; + int64_t block_start; + ssize_t block_length; + uint16_t width; }; struct data_ready { - char used; - const uint8_t* buf; - size_t size; - int64_t offset; + char used; + const uint8_t* buf; + size_t size; + int64_t offset; }; struct cdeque { - uint16_t beg_pos; - uint16_t end_pos; - uint16_t cap_mask; - uint16_t size; - size_t* arr; + uint16_t beg_pos; + uint16_t end_pos; + uint16_t cap_mask; + uint16_t size; + size_t* arr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 12:56:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 13:00:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 13:07:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 13:45:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 14:15:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DF9C15B22BE for ; Tue, 4 Jun 2019 14:15:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 A62FB6ADB3 for ; Tue, 4 Jun 2019 14:15:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x832.google.com with SMTP id m29so8662531qtu.1 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=ko/0SHvdZuiY/CF/w2Z2Ggv6wND1vhLzQPHIaKxvglKWoxA9eSrP2ZaC9/1U6QFcHd Ph/EjVDZAHMYrQjhTpdAZmvoBdRD/th7OFza2qAiARTEsQlBaKOt8W/Lk+3N8WNRuV8y 9rhDkdZAWvEIqyS6zjUfJub1qEF5Kiuhp287EUMYM751o2yeH20wUCh31BneliwRujo8 +0FBdNJFhHKHYJIwzp9/+yCO5dYdqNe4TgpeSO+D19bf0Dmz/xTux6GAKFJpXFBYFEgo cuVteGB9WSP3JMW2S8GryrRBNIg1x9xpA2BW4Ihmexpu9VTO38DVziLOafnY06SVLZXJ 7V7Q== X-Gm-Message-State: APjAAAXPH/qfkM4fQ4uNVwlmYsj2ow3Tv3Q5ULF8TuyEhGDG9Z0rtv8Q l4EbIrlVAbzQyC1U8vVr1bnpAA== 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: A62FB6ADB3 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 14:58:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC7BA15B3344 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 1E2EE6C748 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: 1E2EE6C748 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 15:11:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CDD015B386B; Tue, 4 Jun 2019 15:11:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41BAE6CF8D; Tue, 4 Jun 2019 15:11:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DA731F2AE; Tue, 4 Jun 2019 15:11:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FBEoS024907; Tue, 4 Jun 2019 15:11:15 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FBExp024906; Tue, 4 Jun 2019 15:11:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041511.x54FBExp024906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348613 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41BAE6CF8D 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.938,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:11:16 -0000 Author: br Date: Tue Jun 4 15:11:14 2019 New Revision: 348613 URL: https://svnweb.freebsd.org/changeset/base/348613 Log: MFC 339774: o Add pmap lock around pmap_fault_fixup() to ensure other thread will not modify l3 pte after we loaded old value and before we stored new value. o Preset A(accessed), D(dirty) bits for kernel mappings. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/pmap.c Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 13:45:30 2019 (r348612) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 15:11:14 2019 (r348613) @@ -1923,16 +1923,21 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ pt_entry_t orig_l3; pt_entry_t new_l3; pt_entry_t *l3; + int rv; + rv = 0; + + PMAP_LOCK(pmap); + l3 = pmap_l3(pmap, va); if (l3 == NULL) - return (0); + goto done; orig_l3 = pmap_load(l3); if ((orig_l3 & PTE_V) == 0 || ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) - return (0); + goto done; new_l3 = orig_l3 | PTE_A; if ((prot & VM_PROT_WRITE) != 0) @@ -1941,7 +1946,8 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ if (orig_l3 != new_l3) { pmap_load_store(l3, new_l3); pmap_invalidate_page(pmap, va); - return (1); + rv = 1; + goto done; } /* @@ -1949,7 +1955,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ * the PTE shouldn't have resulted in a fault. */ - return (0); +done: + PMAP_UNLOCK(pmap); + + return (rv); } /* @@ -1992,6 +2001,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= PTE_W; if ((va >> 63) == 0) new_l3 |= PTE_U; + else + new_l3 |= PTE_A | PTE_D; new_l3 |= (pn << PTE_PPN0_S); if ((flags & PMAP_ENTER_WIRED) != 0) From owner-svn-src-all@freebsd.org Tue Jun 4 15:13:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A85DF15B3B85; Tue, 4 Jun 2019 15:13:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB036D401; Tue, 4 Jun 2019 15:13:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2947F1F426; Tue, 4 Jun 2019 15:13:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FDntt027552; Tue, 4 Jun 2019 15:13:49 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FDnaA027551; Tue, 4 Jun 2019 15:13:49 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041513.x54FDnaA027551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348614 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 348614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EB036D401 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.938,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:13:49 -0000 Author: br Date: Tue Jun 4 15:13:48 2019 New Revision: 348614 URL: https://svnweb.freebsd.org/changeset/base/348614 Log: MFC r344252: Avoid orphan sections between __bss_start and .(s)bss. Ensure __bss_start is associated with the next section in case orphan sections are placed directly after .sdata, as has been seen to happen with LLD. Sponsored by: DARPA, AFRL Modified: stable/12/sys/conf/ldscript.riscv Modified: stable/12/sys/conf/ldscript.riscv ============================================================================== --- stable/12/sys/conf/ldscript.riscv Tue Jun 4 15:11:14 2019 (r348613) +++ stable/12/sys/conf/ldscript.riscv Tue Jun 4 15:13:48 2019 (r348614) @@ -87,6 +87,10 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); + /* Ensure __bss_start is associated with the next section in case orphan + sections are placed directly after .sdata, as has been seen to happen with + LLD. */ + . = .; __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : From owner-svn-src-all@freebsd.org Tue Jun 4 15:15:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4AF715B3CD4; Tue, 4 Jun 2019 15:15:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AE866D5D4; Tue, 4 Jun 2019 15:15:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 632281F428; Tue, 4 Jun 2019 15:15:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FFcqV027702; Tue, 4 Jun 2019 15:15:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FFcjm027701; Tue, 4 Jun 2019 15:15:38 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041515.x54FFcjm027701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348615 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AE866D5D4 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.938,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:15:39 -0000 Author: br Date: Tue Jun 4 15:15:37 2019 New Revision: 348615 URL: https://svnweb.freebsd.org/changeset/base/348615 Log: MFC r345581: Grab timer frequency from FDT. RISC-V timer has no dedicated DTS node and we have to get timer frequency from cpus node. Tested on Government Furnished Equipment (GFE) cores synthesized on Xilinx VCU118. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/timer.c Modified: stable/12/sys/riscv/riscv/timer.c ============================================================================== --- stable/12/sys/riscv/riscv/timer.c Tue Jun 4 15:13:48 2019 (r348614) +++ stable/12/sys/riscv/riscv/timer.c Tue Jun 4 15:15:37 2019 (r348615) @@ -61,7 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEFAULT_FREQ 10000000 +#include +#include +#include +#include #define TIMER_COUNTS 0x00 #define TIMER_MTIMECMP(cpu) (cpu * 8) @@ -157,6 +160,32 @@ riscv_timer_intr(void *arg) } static int +riscv_timer_get_timebase(device_t dev, uint32_t *freq) +{ + phandle_t node; + int len; + + node = OF_finddevice("/cpus"); + if (node == -1) { + if (bootverbose) + device_printf(dev, "Can't find cpus node.\n"); + return (ENXIO); + } + + len = OF_getproplen(node, "timebase-frequency"); + if (len != 4) { + if (bootverbose) + device_printf(dev, + "Can't find timebase-frequency property.\n"); + return (ENXIO); + } + + OF_getencprop(node, "timebase-frequency", freq, len); + + return (0); +} + +static int riscv_timer_probe(device_t dev) { @@ -176,10 +205,9 @@ riscv_timer_attach(device_t dev) return (ENXIO); if (device_get_unit(dev) != 0) - return ENXIO; + return (ENXIO); - sc->clkfreq = DEFAULT_FREQ; - if (sc->clkfreq == 0) { + if (riscv_timer_get_timebase(dev, &sc->clkfreq) != 0) { device_printf(dev, "No clock frequency specified\n"); return (ENXIO); } From owner-svn-src-all@freebsd.org Tue Jun 4 15:18:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C95115B3F96; Tue, 4 Jun 2019 15:18:42 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4076D851; Tue, 4 Jun 2019 15:18:42 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 029D51F42B; Tue, 4 Jun 2019 15:18:42 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FIfK2027877; Tue, 4 Jun 2019 15:18:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FIfLK027876; Tue, 4 Jun 2019 15:18:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041518.x54FIfLK027876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348616 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F4076D851 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.939,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:18:42 -0000 Author: br Date: Tue Jun 4 15:18:41 2019 New Revision: 348616 URL: https://svnweb.freebsd.org/changeset/base/348616 Log: MFC r345796: o Grab the number of devices supported by PLIC from FDT. o Fix bug in PLIC_ENABLE macro when irq >= 32. Tested on the real hardware, which is HiFive Unleashed board. Thanks to SiFive, Inc. for the board provided. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/plic.c Modified: stable/12/sys/riscv/riscv/plic.c ============================================================================== --- stable/12/sys/riscv/riscv/plic.c Tue Jun 4 15:15:37 2019 (r348615) +++ stable/12/sys/riscv/riscv/plic.c Tue Jun 4 15:18:41 2019 (r348616) @@ -52,9 +52,9 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" -#define PLIC_NIRQS 32 +#define PLIC_MAX_IRQS 2048 #define PLIC_PRIORITY(n) (0x000000 + (n) * 0x4) -#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + (n) / 32) +#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + 4 * ((n) / 32)) #define PLIC_THRESHOLD(h) (0x200000 + (h) * 0x1000 + 0x0) #define PLIC_CLAIM(h) (0x200000 + (h) * 0x1000 + 0x4) @@ -66,7 +66,8 @@ struct plic_irqsrc { struct plic_softc { device_t dev; struct resource * intc_res; - struct plic_irqsrc isrcs[PLIC_NIRQS]; + struct plic_irqsrc isrcs[PLIC_MAX_IRQS]; + int ndev; }; #define RD4(sc, reg) \ @@ -158,7 +159,7 @@ plic_map_intr(device_t dev, struct intr_map_data *data return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - if (daf->ncells != 1 || daf->cells[0] >= PLIC_NIRQS) + if (daf->ncells != 1 || daf->cells[0] > sc->ndev) return (EINVAL); *isrcp = &sc->isrcs[daf->cells[0]].isrc; @@ -189,6 +190,7 @@ plic_attach(device_t dev) struct intr_pic *pic; uint32_t irq; const char *name; + phandle_t node; phandle_t xref; uint32_t cpu; int error; @@ -198,6 +200,20 @@ plic_attach(device_t dev) sc->dev = dev; + node = ofw_bus_get_node(dev); + if ((OF_getencprop(node, "riscv,ndev", &sc->ndev, + sizeof(sc->ndev))) < 0) { + device_printf(dev, + "Error: could not get number of devices\n"); + return (ENXIO); + } + + if (sc->ndev >= PLIC_MAX_IRQS) { + device_printf(dev, + "Error: invalid ndev (%d)\n", sc->ndev); + return (ENXIO); + } + /* Request memory resources */ rid = 0; sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -211,7 +227,7 @@ plic_attach(device_t dev) isrcs = sc->isrcs; name = device_get_nameunit(sc->dev); cpu = PCPU_GET(cpuid); - for (irq = 0; irq < PLIC_NIRQS; irq++) { + for (irq = 1; irq <= sc->ndev; irq++) { isrcs[irq].irq = irq; error = intr_isrc_register(&isrcs[irq].isrc, sc->dev, 0, "%s,%u", name, irq); @@ -223,7 +239,7 @@ plic_attach(device_t dev) } WR4(sc, PLIC_THRESHOLD(cpu), 0); - xref = OF_xref_from_node(ofw_bus_get_node(sc->dev)); + xref = OF_xref_from_node(node); pic = intr_pic_register(sc->dev, xref); if (pic == NULL) return (ENXIO); From owner-svn-src-all@freebsd.org Tue Jun 4 15:25:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C506815B4541; Tue, 4 Jun 2019 15:25:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69E206DF57; Tue, 4 Jun 2019 15:25:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 458241F5EE; Tue, 4 Jun 2019 15:25:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FP4jI032910; Tue, 4 Jun 2019 15:25:04 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FP4en032909; Tue, 4 Jun 2019 15:25:04 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041525.x54FP4en032909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348617 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69E206DF57 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.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:25:04 -0000 Author: br Date: Tue Jun 4 15:25:03 2019 New Revision: 348617 URL: https://svnweb.freebsd.org/changeset/base/348617 Log: MFC r346633: Implement pic_pre_ithread(), pic_post_ithread(). Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/plic.c Modified: stable/12/sys/riscv/riscv/plic.c ============================================================================== --- stable/12/sys/riscv/riscv/plic.c Tue Jun 4 15:18:41 2019 (r348616) +++ stable/12/sys/riscv/riscv/plic.c Tue Jun 4 15:25:03 2019 (r348617) @@ -249,6 +249,30 @@ plic_attach(device_t dev) return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc, 0)); } +static void +plic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + WR4(sc, PLIC_PRIORITY(src->irq), 0); +} + +static void +plic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + WR4(sc, PLIC_PRIORITY(src->irq), 1); +} + static device_method_t plic_methods[] = { DEVMETHOD(device_probe, plic_probe), DEVMETHOD(device_attach, plic_attach), @@ -256,6 +280,8 @@ static device_method_t plic_methods[] = { DEVMETHOD(pic_disable_intr, plic_disable_intr), DEVMETHOD(pic_enable_intr, plic_enable_intr), DEVMETHOD(pic_map_intr, plic_map_intr), + DEVMETHOD(pic_pre_ithread, plic_pre_ithread), + DEVMETHOD(pic_post_ithread, plic_post_ithread), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Tue Jun 4 15:26:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2306E15B460F; Tue, 4 Jun 2019 15:26:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC7E26E0BE; Tue, 4 Jun 2019 15:26:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 944B71F5F1; Tue, 4 Jun 2019 15:26:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FQ22M032991; Tue, 4 Jun 2019 15:26:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FQ23C032990; Tue, 4 Jun 2019 15:26:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041526.x54FQ23C032990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348618 - stable/12/sys/dev/cadence X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/dev/cadence X-SVN-Commit-Revision: 348618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC7E26E0BE 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.938,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:26:03 -0000 Author: br Date: Tue Jun 4 15:26:02 2019 New Revision: 348618 URL: https://svnweb.freebsd.org/changeset/base/348618 Log: MFC r346634: Add support for Cadence network controller found in HiFive Unleashed board. Sponsored by: DARPA, AFRL Modified: stable/12/sys/dev/cadence/if_cgem.c Modified: stable/12/sys/dev/cadence/if_cgem.c ============================================================================== --- stable/12/sys/dev/cadence/if_cgem.c Tue Jun 4 15:25:03 2019 (r348617) +++ stable/12/sys/dev/cadence/if_cgem.c Tue Jun 4 15:26:02 2019 (r348618) @@ -98,6 +98,12 @@ __FBSDID("$FreeBSD$"); #define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ CSUM_TCP_IPV6 | CSUM_UDP_IPV6) +static struct ofw_compat_data compat_data[] = { + { "cadence,gem", 1 }, + { "cdns,macb", 1 }, + { NULL, 0 }, +}; + struct cgem_softc { if_t ifp; struct mtx sc_mtx; @@ -1635,7 +1641,7 @@ cgem_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "cadence,gem")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Cadence CGEM Gigabit Ethernet Interface"); From owner-svn-src-all@freebsd.org Tue Jun 4 15:28:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC7615B484A; Tue, 4 Jun 2019 15:28:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC8966E32D; Tue, 4 Jun 2019 15:28:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D511F5F9; Tue, 4 Jun 2019 15:28:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FSYQf033146; Tue, 4 Jun 2019 15:28:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FSXPh033141; Tue, 4 Jun 2019 15:28:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041528.x54FSXPh033141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348619 - in stable/12/sys/dev: altera/atse altera/softdma xdma X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: in stable/12/sys/dev: altera/atse altera/softdma xdma X-SVN-Commit-Revision: 348619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC8966E32D 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.940,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:28:35 -0000 Author: br Date: Tue Jun 4 15:28:32 2019 New Revision: 348619 URL: https://svnweb.freebsd.org/changeset/base/348619 Log: MFC r346896: o Rewrite softdma_process_tx() of Altera SoftDMA engine driver so it does not require a bounce buffer. The only need for this was to align the buffer address. Implement unaligned access and we don't need to copy data twice. o Remove contigmalloc-based bounce buffer from xDMA code since it is not suitable for arbitrary memory provided by platform, which is sometimes a dedicated piece of memory that is not managed by OS at all. Sponsored by: DARPA, AFRL Modified: stable/12/sys/dev/altera/atse/if_atse.c stable/12/sys/dev/altera/softdma/softdma.c stable/12/sys/dev/xdma/xdma.h stable/12/sys/dev/xdma/xdma_mbuf.c stable/12/sys/dev/xdma/xdma_sg.c Modified: stable/12/sys/dev/altera/atse/if_atse.c ============================================================================== --- stable/12/sys/dev/altera/atse/if_atse.c Tue Jun 4 15:26:02 2019 (r348618) +++ stable/12/sys/dev/altera/atse/if_atse.c Tue Jun 4 15:28:32 2019 (r348619) @@ -1290,7 +1290,7 @@ atse_attach(device_t dev) * Chapter 15. On-Chip FIFO Memory Core. * Embedded Peripherals IP User Guide. */ - caps = XCHAN_CAP_BUSDMA_NOSEG; + caps = XCHAN_CAP_NOSEG; /* Alloc xDMA virtual channel. */ sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); @@ -1456,6 +1456,11 @@ atse_detach(device_t dev) } mtx_destroy(&sc->atse_mtx); + + xdma_channel_free(sc->xchan_tx); + xdma_channel_free(sc->xchan_rx); + xdma_put(sc->xdma_tx); + xdma_put(sc->xdma_rx); return (0); } Modified: stable/12/sys/dev/altera/softdma/softdma.c ============================================================================== --- stable/12/sys/dev/altera/softdma/softdma.c Tue Jun 4 15:26:02 2019 (r348618) +++ stable/12/sys/dev/altera/softdma/softdma.c Tue Jun 4 15:28:32 2019 (r348619) @@ -190,6 +190,18 @@ softdma_fill_level(struct softdma_softc *sc) return (val); } +static uint32_t +fifo_fill_level_wait(struct softdma_softc *sc) +{ + uint32_t val; + + do + val = softdma_fill_level(sc); + while (val == AVALON_FIFO_TX_BASIC_OPTS_DEPTH); + + return (val); +} + static void softdma_intr(void *arg) { @@ -287,86 +299,96 @@ static int softdma_process_tx(struct softdma_channel *chan, struct softdma_desc *desc) { struct softdma_softc *sc; - uint32_t src_offs, dst_offs; + uint64_t addr; + uint64_t buf; + uint32_t word; + uint32_t missing; uint32_t reg; - uint32_t fill_level; - uint32_t leftm; - uint32_t tmp; - uint32_t val; - uint32_t c; + int got_bits; + int len; sc = chan->sc; - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + fifo_fill_level_wait(sc); /* Set start of packet. */ - if (desc->control & CONTROL_GEN_SOP) { - reg = 0; - reg |= A_ONCHIP_FIFO_MEM_CORE_SOP; - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); - } + if (desc->control & CONTROL_GEN_SOP) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_SOP); - src_offs = dst_offs = 0; - c = 0; - while ((desc->len - c) >= 4) { - val = *(uint32_t *)(desc->src_addr + src_offs); - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); - if (desc->src_incr) - src_offs += 4; - if (desc->dst_incr) - dst_offs += 4; - fill_level += 1; + got_bits = 0; + buf = 0; - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { - fill_level = softdma_fill_level(sc); - } - c += 4; + addr = desc->src_addr; + len = desc->len; + + if (addr & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; } - val = 0; - leftm = (desc->len - c); + if (len >= 2 && addr & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - switch (leftm) { - case 1: - val = *(uint8_t *)(desc->src_addr + src_offs); - val <<= 24; - src_offs += 1; - break; - case 2: - case 3: - val = *(uint16_t *)(desc->src_addr + src_offs); - val <<= 16; - src_offs += 2; + while (len >= 4) { + buf = (buf << 32) | (uint64_t)*(uint32_t *)addr; + addr += 4; + len -= 4; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - if (leftm == 3) { - tmp = *(uint8_t *)(desc->src_addr + src_offs); - val |= (tmp << 8); - src_offs += 1; - } - break; - case 0: - default: - break; + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); } - /* Set end of packet. */ - reg = 0; - if (desc->control & CONTROL_GEN_EOP) - reg |= A_ONCHIP_FIFO_MEM_CORE_EOP; - reg |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + if (len & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - /* Ensure there is a FIFO entry available. */ - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + if (len & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; + } - /* Final write */ - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); + if (got_bits >= 32) { + got_bits -= 32; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - return (dst_offs); + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + if (got_bits) { + missing = 32 - got_bits; + got_bits /= 8; + + fifo_fill_level_wait(sc); + reg = A_ONCHIP_FIFO_MEM_CORE_EOP | + ((4 - got_bits) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + word = (uint32_t)((buf << missing) & 0xffffffff); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + return (desc->len); } static int @@ -594,6 +616,8 @@ softdma_channel_alloc(device_t dev, struct xdma_channe if (chan->used == 0) { chan->xchan = xchan; xchan->chan = (void *)chan; + xchan->caps |= XCHAN_CAP_NOBUFS; + xchan->caps |= XCHAN_CAP_NOSEG; chan->index = i; chan->idx_head = 0; chan->idx_tail = 0; Modified: stable/12/sys/dev/xdma/xdma.h ============================================================================== --- stable/12/sys/dev/xdma/xdma.h Tue Jun 4 15:26:02 2019 (r348618) +++ stable/12/sys/dev/xdma/xdma.h Tue Jun 4 15:28:32 2019 (r348619) @@ -84,7 +84,6 @@ struct xchan_buf { bus_dmamap_t map; uint32_t nsegs; uint32_t nsegs_left; - void *cbuf; }; struct xdma_request { @@ -130,7 +129,8 @@ struct xdma_channel { uint32_t caps; #define XCHAN_CAP_BUSDMA (1 << 0) -#define XCHAN_CAP_BUSDMA_NOSEG (1 << 1) +#define XCHAN_CAP_NOSEG (1 << 1) +#define XCHAN_CAP_NOBUFS (1 << 2) /* A real hardware driver channel. */ void *chan; Modified: stable/12/sys/dev/xdma/xdma_mbuf.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_mbuf.c Tue Jun 4 15:26:02 2019 (r348618) +++ stable/12/sys/dev/xdma/xdma_mbuf.c Tue Jun 4 15:28:32 2019 (r348619) @@ -136,19 +136,15 @@ xdma_mbuf_defrag(xdma_channel_t *xchan, struct xdma_re if (c == 1) return (c); /* Nothing to do. */ - if (xchan->caps & XCHAN_CAP_BUSDMA) { - if ((xchan->caps & XCHAN_CAP_BUSDMA_NOSEG) || \ - (c > xchan->maxnsegs)) { - if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { - device_printf(xdma->dma_dev, - "%s: Can't defrag mbuf\n", - __func__); - return (c); - } - xr->m = m; - c = 1; - } + if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { + device_printf(xdma->dma_dev, + "%s: Can't defrag mbuf\n", + __func__); + return (c); } + + xr->m = m; + c = 1; return (c); } Modified: stable/12/sys/dev/xdma/xdma_sg.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 15:26:02 2019 (r348618) +++ stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 15:28:32 2019 (r348619) @@ -69,14 +69,7 @@ _xchan_bufs_alloc(xdma_channel_t *xchan) for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - xr->buf.cbuf = contigmalloc(xchan->maxsegsize, - M_XDMA, 0, 0, ~0, PAGE_SIZE, 0); - if (xr->buf.cbuf == NULL) { - device_printf(xdma->dev, - "%s: Can't allocate contiguous kernel" - " physical memory\n", __func__); - return (-1); - } + /* TODO: bounce buffer */ } return (0); @@ -179,7 +172,7 @@ xchan_bufs_free(xdma_channel_t *xchan) } else { for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - contigfree(xr->buf.cbuf, xchan->maxsegsize, M_XDMA); + /* TODO: bounce buffer */ } } @@ -245,17 +238,19 @@ xdma_prep_sg(xdma_channel_t *xchan, uint32_t xr_num, return (-1); } - /* Allocate bufs. */ - ret = xchan_bufs_alloc(xchan); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't allocate bufs.\n", __func__); + /* Allocate buffers if required. */ + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0) { + ret = xchan_bufs_alloc(xchan); + if (ret != 0) { + device_printf(xdma->dev, + "%s: Can't allocate bufs.\n", __func__); - /* Cleanup */ - xchan_sglist_free(xchan); - xchan_bank_free(xchan); + /* Cleanup */ + xchan_sglist_free(xchan); + xchan_bank_free(xchan); - return (-1); + return (-1); + } } xchan->flags |= (XCHAN_CONFIGURED | XCHAN_TYPE_SG); @@ -442,14 +437,8 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req switch (xr->req_type) { case XR_TYPE_MBUF: - if (xr->direction == XDMA_MEM_TO_DEV) { - m_copydata(m, 0, m->m_pkthdr.len, xr->buf.cbuf); - seg[0].ds_addr = (bus_addr_t)xr->buf.cbuf; - seg[0].ds_len = m->m_pkthdr.len; - } else { - seg[0].ds_addr = mtod(m, bus_addr_t); - seg[0].ds_len = m->m_pkthdr.len; - } + seg[0].ds_addr = mtod(m, bus_addr_t); + seg[0].ds_len = m->m_pkthdr.len; break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -516,7 +505,9 @@ xdma_process(xdma_channel_t *xchan, TAILQ_FOREACH_SAFE(xr, &xchan->queue_in, xr_next, xr_tmp) { switch (xr->req_type) { case XR_TYPE_MBUF: - c = xdma_mbuf_defrag(xchan, xr); + if ((xchan->caps & XCHAN_CAP_NOSEG) || + (c > xchan->maxnsegs)) + c = xdma_mbuf_defrag(xchan, xr); break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -571,7 +562,8 @@ xdma_queue_submit_sg(xdma_channel_t *xchan) sg = xchan->sg; - if ((xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 && + (xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { device_printf(xdma->dev, "%s: Can't submit a transfer: no bufs\n", __func__); From owner-svn-src-all@freebsd.org Tue Jun 4 15:30:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C801B15B4926; Tue, 4 Jun 2019 15:30:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 680F26E4DA; Tue, 4 Jun 2019 15:30:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FF8D1F60F; Tue, 4 Jun 2019 15:30:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FUlK5034117; Tue, 4 Jun 2019 15:30:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FUljl034116; Tue, 4 Jun 2019 15:30:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041530.x54FUljl034116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348620 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 680F26E4DA 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.938,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:30:48 -0000 Author: br Date: Tue Jun 4 15:30:46 2019 New Revision: 348620 URL: https://svnweb.freebsd.org/changeset/base/348620 Log: MFC r346994: Deactivate IRQ resource by calling to intr_deactivate_irq(). This is the part of INTRNG support that was missed. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/nexus.c Modified: stable/12/sys/riscv/riscv/nexus.c ============================================================================== --- stable/12/sys/riscv/riscv/nexus.c Tue Jun 4 15:28:32 2019 (r348619) +++ stable/12/sys/riscv/riscv/nexus.c Tue Jun 4 15:30:46 2019 (r348620) @@ -357,13 +357,17 @@ nexus_deactivate_resource(device_t bus, device_t child bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + if (vaddr != 0) { + bus_space_unmap(&memmap_bus, vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { + intr_deactivate_irq(child, r); } return (rman_deactivate_resource(r)); From owner-svn-src-all@freebsd.org Tue Jun 4 15:32:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DF315B4B2D; Tue, 4 Jun 2019 15:32:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8721A6E89A; Tue, 4 Jun 2019 15:32:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D8EC1F7A1; Tue, 4 Jun 2019 15:32:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FWvhF038199; Tue, 4 Jun 2019 15:32:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FWuGN038194; Tue, 4 Jun 2019 15:32:56 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041532.x54FWuGN038194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348621 - in stable/12/sys: conf riscv/include riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: in stable/12/sys: conf riscv/include riscv/riscv X-SVN-Commit-Revision: 348621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8721A6E89A 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.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:32:58 -0000 Author: br Date: Tue Jun 4 15:32:56 2019 New Revision: 348621 URL: https://svnweb.freebsd.org/changeset/base/348621 Log: MFC r347225: Provide a template for busdma code for RISC-V. RISC-V ISA specifies no cache management instructions so leave cache operations in cpufunc.h as no-op for now. Note some new hardware comes with their own memory-mapped cache management controller. Tested on HiFive Unleashed board with cgem(4). Sponsored by: DARPA, AFRL Added: stable/12/sys/riscv/include/bus_dma_impl.h (contents, props changed) stable/12/sys/riscv/riscv/busdma_bounce.c (contents, props changed) Modified: stable/12/sys/conf/files.riscv stable/12/sys/riscv/include/bus_dma.h stable/12/sys/riscv/include/cpufunc.h stable/12/sys/riscv/riscv/busdma_machdep.c stable/12/sys/riscv/riscv/machdep.c Modified: stable/12/sys/conf/files.riscv ============================================================================== --- stable/12/sys/conf/files.riscv Tue Jun 4 15:30:46 2019 (r348620) +++ stable/12/sys/conf/files.riscv Tue Jun 4 15:32:56 2019 (r348621) @@ -28,6 +28,7 @@ libkern/memset.c standard riscv/riscv/autoconf.c standard riscv/riscv/bus_machdep.c standard riscv/riscv/bus_space_asm.S standard +riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard Modified: stable/12/sys/riscv/include/bus_dma.h ============================================================================== --- stable/12/sys/riscv/include/bus_dma.h Tue Jun 4 15:30:46 2019 (r348620) +++ stable/12/sys/riscv/include/bus_dma.h Tue Jun 4 15:32:56 2019 (r348621) @@ -3,7 +3,139 @@ #ifndef _MACHINE_BUS_DMA_H_ #define _MACHINE_BUS_DMA_H_ +#define WANT_INLINE_DMAMAP #include -#include + +#include + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static inline int +bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_create(dmat, flags, mapp)); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static inline int +bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_destroy(dmat, map)); +} + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints listed in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static inline int +bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->mem_alloc(dmat, vaddr, flags, mapp)); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static inline void +bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->mem_free(dmat, vaddr, map); +} + +/* + * Release the mapping held by map. + */ +static inline void +bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_unload(dmat, map); +} + +static inline void +bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_sync(dmat, map, op); +} + +static inline int +_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_phys(dmat, map, buf, buflen, flags, segs, + segp)); +} + +static inline int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma, + bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_ma(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + +static inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_buffer(dmat, map, buf, buflen, pmap, flags, segs, + segp)); +} + +static inline void +_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_waitok(dmat, map, mem, callback, callback_arg); +} + +static inline bus_dma_segment_t * +_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); +} #endif /* !_MACHINE_BUS_DMA_H_ */ Added: stable/12/sys/riscv/include/bus_dma_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/riscv/include/bus_dma_impl.h Tue Jun 4 15:32:56 2019 (r348621) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * 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 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 _MACHINE_BUS_DMA_IMPL_H_ +#define _MACHINE_BUS_DMA_IMPL_H_ + +struct bus_dma_tag_common { + struct bus_dma_impl *impl; + struct bus_dma_tag_common *parent; + bus_size_t alignment; + bus_addr_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_dma_filter_t *filter; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; + int ref_count; +}; + +struct bus_dma_impl { + int (*tag_create)(bus_dma_tag_t parent, + bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat); + int (*tag_destroy)(bus_dma_tag_t dmat); + int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); + int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); + int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp); + void (*mem_free)(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map); + int (*load_ma)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_phys)(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_buffer)(bus_dma_tag_t dmat, bus_dmamap_t map, + void *buf, bus_size_t buflen, struct pmap *pmap, int flags, + bus_dma_segment_t *segs, int *segp); + void (*map_waitok)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, + void *callback_arg); + bus_dma_segment_t *(*map_complete)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error); + void (*map_unload)(bus_dma_tag_t dmat, bus_dmamap_t map); + void (*map_sync)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op); +}; + +void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); +int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); +int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, + bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, size_t sz, void **dmat); + +extern struct bus_dma_impl bus_dma_bounce_impl; + +#endif Modified: stable/12/sys/riscv/include/cpufunc.h ============================================================================== --- stable/12/sys/riscv/include/cpufunc.h Tue Jun 4 15:30:46 2019 (r348620) +++ stable/12/sys/riscv/include/cpufunc.h Tue Jun 4 15:32:56 2019 (r348621) @@ -109,6 +109,17 @@ sfence_vma_page(uintptr_t addr) #define rdinstret() csr_read64(instret) #define rdhpmcounter(n) csr_read64(hpmcounter##n) +extern int64_t dcache_line_size; +extern int64_t icache_line_size; + +#define cpu_dcache_wbinv_range(a, s) +#define cpu_dcache_inv_range(a, s) +#define cpu_dcache_wb_range(a, s) + +#define cpu_idcache_wbinv_range(a, s) +#define cpu_icache_sync_range(a, s) +#define cpu_icache_sync_range_checked(a, s) + static __inline void load_satp(uint64_t val) { Added: stable/12/sys/riscv/riscv/busdma_bounce.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/riscv/riscv/busdma_bounce.c Tue Jun 4 15:32:56 2019 (r348621) @@ -0,0 +1,1330 @@ +/*- + * Copyright (c) 1997, 1998 Justin T. Gibbs. + * Copyright (c) 2015-2016 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Andrew Turner + * under sponsorship of the FreeBSD Foundation. + * + * Portions of this software were developed by Semihalf + * under sponsorship of 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, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_BPAGES 4096 + +enum { + BF_COULD_BOUNCE = 0x01, + BF_MIN_ALLOC_COMP = 0x02, + BF_KMEM_ALLOC = 0x04, + BF_COHERENT = 0x10, +}; + +struct bounce_zone; + +struct bus_dma_tag { + struct bus_dma_tag_common common; + int map_count; + int bounce_flags; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + vm_page_t datapage; /* physical page of client data */ + vm_offset_t dataoffs; /* page offset of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + +struct sync_list { + vm_offset_t vaddr; /* kva of client data */ + bus_addr_t paddr; /* physical address */ + vm_page_t pages; /* starting page of client data */ + bus_size_t datacount; /* client data count */ +}; + +struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; + u_int flags; +#define DMAMAP_COULD_BOUNCE (1 << 0) +#define DMAMAP_FROM_DMAMEM (1 << 1) + int sync_count; + struct sync_list slist[]; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; + +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_addr_t addr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + pmap_t pmap, void *buf, bus_size_t buflen, int flags); +static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags); +static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int flags); + +/* + * Allocate a device specific dma_tag. + */ +static int +bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t newtag; + int error; + + *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? &parent->common : + NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg, + maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof (struct bus_dma_tag), (void **)&newtag); + if (error != 0) + return (error); + + newtag->common.impl = &bus_dma_bounce_impl; + newtag->map_count = 0; + newtag->segments = NULL; + + if ((flags & BUS_DMA_COHERENT) != 0) + newtag->bounce_flags |= BF_COHERENT; + + if (parent != NULL) { + if ((newtag->common.filter != NULL || + (parent->bounce_flags & BF_COULD_BOUNCE) != 0)) + newtag->bounce_flags |= BF_COULD_BOUNCE; + + /* Copy some flags from the parent */ + newtag->bounce_flags |= parent->bounce_flags & BF_COHERENT; + } + + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) + newtag->bounce_flags |= BF_COULD_BOUNCE; + + if (((newtag->bounce_flags & BF_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->bounce_flags |= BF_MIN_ALLOC_COMP; + } else + error = 0; + + if (error != 0) + free(newtag, M_DEVBUF); + else + *dmat = newtag; + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); + return (error); +} + +static int +bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) +{ + bus_dma_tag_t dmat_copy, parent; + int error; + + error = 0; + dmat_copy = dmat; + + if (dmat != NULL) { + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + while (dmat != NULL) { + parent = (bus_dma_tag_t)dmat->common.parent; + atomic_subtract_int(&dmat->common.ref_count, 1); + if (dmat->common.ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +static bus_dmamap_t +alloc_dmamap(bus_dma_tag_t dmat, int flags) +{ + u_long mapsize; + bus_dmamap_t map; + + mapsize = sizeof(*map); + mapsize += sizeof(struct sync_list) * dmat->common.nsegments; + map = malloc(mapsize, M_DEVBUF, flags | M_ZERO); + if (map == NULL) + return (NULL); + + /* Initialize the new map */ + STAILQ_INIT(&map->bpages); + + return (map); +} + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bounce_zone *bz; + int error, maxpages, pages; + + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + *mapp = alloc_dmamap(dmat, M_NOWAIT); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->bounce_flags & BF_COULD_BOUNCE) { + /* Must bounce */ + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) { + free(*mapp, M_DEVBUF); + return (error); + } + } + bz = dmat->bounce_zone; + + (*mapp)->flags = DMAMAP_COULD_BOUNCE; + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->common.alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem - + atop(dmat->common.lowaddr)); + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { + pages = MAX(atop(dmat->common.maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) + == 0) { + if (error == 0) { + dmat->bounce_flags |= + BF_MIN_ALLOC_COMP; + } + } else + error = 0; + } + bz->map_count++; + } + if (error == 0) + dmat->map_count++; + else + free(*mapp, M_DEVBUF); + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, error); + return (error); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + + /* Check we are destroying the correct map type */ + if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) + panic("bounce_bus_dmamap_destroy: Invalid map freed\n"); + + if (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) { + KASSERT((map->flags & DMAMAP_COULD_BOUNCE) != 0, + ("%s: Bounce zone when cannot bounce", __func__)); + dmat->bounce_zone->map_count--; + } + free(map, M_DEVBUF); + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); +} + + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints lited in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static int +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + /* + * XXX ARM64TODO: + * This bus_dma implementation requires IO-Coherent architecutre. + * If IO-Coherency is not guaranteed, the BUS_DMA_COHERENT flag has + * to be implented using non-cacheable memory. + */ + + vm_memattr_t attr; + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + } + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + if (flags & BUS_DMA_NOCACHE) + attr = VM_MEMATTR_UNCACHEABLE; + else if ((flags & BUS_DMA_COHERENT) != 0 && + (dmat->bounce_flags & BF_COHERENT) == 0) + /* + * If we have a non-coherent tag, and are trying to allocate + * a coherent block of memory it needs to be uncached. + */ + attr = VM_MEMATTR_UNCACHEABLE; + else + attr = VM_MEMATTR_DEFAULT; + + /* + * Create the map, but don't set the could bounce flag as + * this allocation should never bounce; + */ + *mapp = alloc_dmamap(dmat, mflags); + if (*mapp == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + (*mapp)->flags = DMAMAP_FROM_DMAMEM; + + /* + * Allocate the buffer from the malloc(9) allocator if... + * - It's small enough to fit into a single power of two sized bucket. + * - The alignment is less than or equal to the maximum size + * - The low address requirement is fulfilled. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. + * + * NOTE: The (dmat->common.alignment <= dmat->maxsize) check + * below is just a quick hack. The exact alignment guarantees + * of malloc(9) need to be nailed down, and the code below + * should be rewritten to take that into account. + * + * In the meantime warn the user if malloc gets it wrong. + */ + if ((dmat->common.maxsize <= PAGE_SIZE) && + (dmat->common.alignment <= dmat->common.maxsize) && + dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && + attr == VM_MEMATTR_DEFAULT) { + *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + } else if (dmat->common.nsegments >= + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && + dmat->common.alignment <= PAGE_SIZE && + (dmat->common.boundary % PAGE_SIZE) == 0) { + /* Page-based multi-segment allocations allowed */ + *vaddr = (void *)kmem_alloc_attr(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, attr); + dmat->bounce_flags |= BF_KMEM_ALLOC; + } else { + *vaddr = (void *)kmem_alloc_contig(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? + dmat->common.alignment : 1ul, dmat->common.boundary, attr); + dmat->bounce_flags |= BF_KMEM_ALLOC; + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + free(*mapp, M_DEVBUF); + return (ENOMEM); + } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, 0); + return (0); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static void +bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + + /* + * Check the map came from bounce_bus_dmamem_alloc, so the map + * should be NULL and the BF_KMEM_ALLOC flag cleared if malloc() + * was used and set if kmem_alloc_contig() was used. + */ + if ((map->flags & DMAMAP_FROM_DMAMEM) == 0) + panic("bus_dmamem_free: Invalid map freed\n"); + if ((dmat->bounce_flags & BF_KMEM_ALLOC) == 0) + free(vaddr, M_DEVBUF); + else + kmem_free((vm_offset_t)vaddr, dmat->common.maxsize); + free(map, M_DEVBUF); + dmat->map_count--; + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, + dmat->bounce_flags); +} + +static void +_bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); + map->pagesneeded++; + } + curaddr += sgsize; + buflen -= sgsize; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static void +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + bus_size_t sg_len; + + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", map, + map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap == kernel_pmap) + paddr = pmap_kextract(vaddr); + else + paddr = pmap_extract(pmap, vaddr); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static int +_bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) +{ + + /* Reserve Necessary Bounce Pages */ + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + + return (0); +} + +/* + * Add a single contiguous physical range to the segment list. + */ +static int +_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) +{ + bus_addr_t baddr, bmask; + int seg; + + /* + * Make sure we don't cross any boundaries. + */ + bmask = ~(dmat->common.boundary - 1); + if (dmat->common.boundary > 0) { + baddr = (curaddr + dmat->common.boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * previous segment if possible. + */ + seg = *segp; + if (seg == -1) { + seg = 0; + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } else { + if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && + (dmat->common.boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + segs[seg].ds_len += sgsize; + else { + if (++seg >= dmat->common.nsegments) + return (0); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + } + *segp = seg; + return (sgsize); +} + +/* + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct sync_list *sl; + bus_size_t sgsize; + bus_addr_t curaddr, sl_end; + int error; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) { + _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + sl = map->slist + map->sync_count - 1; + sl_end = 0; + + while (buflen > 0) { + curaddr = buf; + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + sgsize); + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { + if (map->sync_count > 0) + sl_end = sl->paddr + sl->datacount; + + if (map->sync_count == 0 || curaddr != sl_end) { + if (++map->sync_count > dmat->common.nsegments) + break; + sl++; + sl->vaddr = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 15:33:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9689D15B4BA9; Tue, 4 Jun 2019 15:33:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 354896E9E2; Tue, 4 Jun 2019 15:33:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D5F31F7A5; Tue, 4 Jun 2019 15:33:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FXqpu038328; Tue, 4 Jun 2019 15:33:52 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FXqxB038327; Tue, 4 Jun 2019 15:33:52 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041533.x54FXqxB038327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348622 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 354896E9E2 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:33:53 -0000 Author: br Date: Tue Jun 4 15:33:52 2019 New Revision: 348622 URL: https://svnweb.freebsd.org/changeset/base/348622 Log: MFC r347226: Disable interrupts first and then set spinlock_count to 1. Otherwise interrupt can be generated just after setting spinlock_count and before disabling interrupts. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/machdep.c Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 15:32:56 2019 (r348621) +++ stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 15:33:52 2019 (r348622) @@ -460,11 +460,13 @@ void spinlock_enter(void) { struct thread *td; + register_t reg; td = curthread; if (td->td_md.md_spinlock_count == 0) { + reg = intr_disable(); td->td_md.md_spinlock_count = 1; - td->td_md.md_saved_sstatus_ie = intr_disable(); + td->td_md.md_saved_sstatus_ie = reg; } else td->td_md.md_spinlock_count++; critical_enter(); From owner-svn-src-all@freebsd.org Tue Jun 4 15:35:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B26915B4C73; Tue, 4 Jun 2019 15:35:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B5F86EB54; Tue, 4 Jun 2019 15:35:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D263F1F7A6; Tue, 4 Jun 2019 15:35:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FZlBQ038487; Tue, 4 Jun 2019 15:35:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FZkRV038481; Tue, 4 Jun 2019 15:35:46 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041535.x54FZkRV038481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348623 - stable/12/sys/dev/xdma X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/dev/xdma X-SVN-Commit-Revision: 348623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B5F86EB54 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:35:48 -0000 Author: br Date: Tue Jun 4 15:35:46 2019 New Revision: 348623 URL: https://svnweb.freebsd.org/changeset/base/348623 Log: MFC r347337: o Implement a bounce buffer based on device reserved memory. Grab device reserved physical memory regions from FDT using standard "memory-region" property and use vmem(9) to allocate buffers from it. The same vmem could be used by DMA engine drivers to allocate memory for DMA descriptors. This is required for platforms that provide uncached memory region reserved exclusively for DMA operations. o Change sleepable sx(9) lock type to non-sleepable mutex(9) since network drivers usually hold mutex during DMA operations. So we don't take sleepable lock after non-sleepable. Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Modified: stable/12/sys/dev/xdma/xdma.c stable/12/sys/dev/xdma/xdma.h stable/12/sys/dev/xdma/xdma_bank.c stable/12/sys/dev/xdma/xdma_bio.c stable/12/sys/dev/xdma/xdma_mbuf.c stable/12/sys/dev/xdma/xdma_queue.c stable/12/sys/dev/xdma/xdma_sg.c Modified: stable/12/sys/dev/xdma/xdma.c ============================================================================== --- stable/12/sys/dev/xdma/xdma.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2016-2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2016-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -43,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -61,12 +61,14 @@ __FBSDID("$FreeBSD$"); * Multiple xDMA controllers may work with single DMA device, * so we have global lock for physical channel management. */ -static struct sx xdma_sx; +static struct mtx xdma_mtx; -#define XDMA_LOCK() sx_xlock(&xdma_sx) -#define XDMA_UNLOCK() sx_xunlock(&xdma_sx) -#define XDMA_ASSERT_LOCKED() sx_xassert(&xdma_sx, MA_OWNED) +#define XDMA_LOCK() mtx_lock(&xdma_mtx) +#define XDMA_UNLOCK() mtx_unlock(&xdma_mtx) +#define XDMA_ASSERT_LOCKED() mtx_assert(&xdma_mtx, MA_OWNED) +#define FDT_REG_CELLS 4 + /* * Allocate virtual xDMA channel. */ @@ -95,11 +97,11 @@ xdma_channel_alloc(xdma_controller_t *xdma, uint32_t c TAILQ_INIT(&xchan->ie_handlers); - sx_init(&xchan->sx_lock, "xDMA chan"); - sx_init(&xchan->sx_qin_lock, "xDMA qin"); - sx_init(&xchan->sx_qout_lock, "xDMA qout"); - sx_init(&xchan->sx_bank_lock, "xDMA bank"); - sx_init(&xchan->sx_proc_lock, "xDMA proc"); + mtx_init(&xchan->mtx_lock, "xDMA chan", NULL, MTX_DEF); + mtx_init(&xchan->mtx_qin_lock, "xDMA qin", NULL, MTX_DEF); + mtx_init(&xchan->mtx_qout_lock, "xDMA qout", NULL, MTX_DEF); + mtx_init(&xchan->mtx_bank_lock, "xDMA bank", NULL, MTX_DEF); + mtx_init(&xchan->mtx_proc_lock, "xDMA proc", NULL, MTX_DEF); TAILQ_INIT(&xchan->bank); TAILQ_INIT(&xchan->queue_in); @@ -138,11 +140,11 @@ xdma_channel_free(xdma_channel_t *xchan) xdma_teardown_all_intr(xchan); - sx_destroy(&xchan->sx_lock); - sx_destroy(&xchan->sx_qin_lock); - sx_destroy(&xchan->sx_qout_lock); - sx_destroy(&xchan->sx_bank_lock); - sx_destroy(&xchan->sx_proc_lock); + mtx_destroy(&xchan->mtx_lock); + mtx_destroy(&xchan->mtx_qin_lock); + mtx_destroy(&xchan->mtx_qout_lock); + mtx_destroy(&xchan->mtx_bank_lock); + mtx_destroy(&xchan->mtx_proc_lock); TAILQ_REMOVE(&xdma->channels, xchan, xchan_next); @@ -303,6 +305,95 @@ xdma_ofw_md_data(xdma_controller_t *xdma, pcell_t *cel return (ret); } +static int +xdma_handle_mem_node(vmem_t *vmem, phandle_t memory) +{ + pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS]; + pcell_t *regp; + int addr_cells, size_cells; + int i, reg_len, ret, tuple_size, tuples; + vmem_addr_t mem_start; + vmem_size_t mem_size; + + if ((ret = fdt_addrsize_cells(OF_parent(memory), &addr_cells, + &size_cells)) != 0) + return (ret); + + if (addr_cells > 2) + return (ERANGE); + + tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); + reg_len = OF_getproplen(memory, "reg"); + if (reg_len <= 0 || reg_len > sizeof(reg)) + return (ERANGE); + + if (OF_getprop(memory, "reg", reg, reg_len) <= 0) + return (ENXIO); + + tuples = reg_len / tuple_size; + regp = (pcell_t *)® + for (i = 0; i < tuples; i++) { + ret = fdt_data_to_res(regp, addr_cells, size_cells, + &mem_start, &mem_size); + if (ret != 0) + return (ret); + + vmem_add(vmem, mem_start, mem_size, 0); + regp += addr_cells + size_cells; + } + + return (0); +} + +vmem_t * +xdma_get_memory(device_t dev) +{ + phandle_t mem_node, node; + pcell_t mem_handle; + vmem_t *vmem; + + node = ofw_bus_get_node(dev); + if (node <= 0) { + device_printf(dev, + "%s called on not ofw based device.\n", __func__); + return (NULL); + } + + if (!OF_hasprop(node, "memory-region")) + return (NULL); + + if (OF_getencprop(node, "memory-region", (void *)&mem_handle, + sizeof(mem_handle)) <= 0) + return (NULL); + + vmem = vmem_create("xDMA vmem", 0, 0, PAGE_SIZE, + PAGE_SIZE, M_BESTFIT | M_WAITOK); + if (vmem == NULL) + return (NULL); + + mem_node = OF_node_from_xref(mem_handle); + if (xdma_handle_mem_node(vmem, mem_node) != 0) { + vmem_destroy(vmem); + return (NULL); + } + + return (vmem); +} + +void +xdma_put_memory(vmem_t *vmem) +{ + + vmem_destroy(vmem); +} + +void +xchan_set_memory(xdma_channel_t *xchan, vmem_t *vmem) +{ + + xchan->vmem = vmem; +} + /* * Allocate xdma controller. */ @@ -400,7 +491,7 @@ static void xdma_init(void) { - sx_init(&xdma_sx, "xDMA"); + mtx_init(&xdma_mtx, "xDMA", NULL, MTX_DEF); } SYSINIT(xdma, SI_SUB_DRIVERS, SI_ORDER_FIRST, xdma_init, NULL); Modified: stable/12/sys/dev/xdma/xdma.h ============================================================================== --- stable/12/sys/dev/xdma/xdma.h Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma.h Tue Jun 4 15:35:46 2019 (r348623) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2016-2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2016-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -34,6 +35,7 @@ #define _DEV_XDMA_XDMA_H_ #include +#include enum xdma_direction { XDMA_MEM_TO_MEM, @@ -73,6 +75,7 @@ struct xdma_controller { device_t dev; /* DMA consumer device_t. */ device_t dma_dev; /* A real DMA device_t. */ void *data; /* OFW MD part. */ + vmem_t *vmem; /* Bounce memory. */ /* List of virtual channels allocated. */ TAILQ_HEAD(xdma_channel_list, xdma_channel) channels; @@ -84,6 +87,9 @@ struct xchan_buf { bus_dmamap_t map; uint32_t nsegs; uint32_t nsegs_left; + vm_offset_t vaddr; + vm_offset_t paddr; + vm_size_t size; }; struct xdma_request { @@ -117,6 +123,7 @@ struct xdma_sglist { struct xdma_channel { xdma_controller_t *xdma; + vmem_t *vmem; uint32_t flags; #define XCHAN_BUFS_ALLOCATED (1 << 0) @@ -139,11 +146,11 @@ struct xdma_channel { TAILQ_HEAD(, xdma_intr_handler) ie_handlers; TAILQ_ENTRY(xdma_channel) xchan_next; - struct sx sx_lock; - struct sx sx_qin_lock; - struct sx sx_qout_lock; - struct sx sx_bank_lock; - struct sx sx_proc_lock; + struct mtx mtx_lock; + struct mtx mtx_qin_lock; + struct mtx mtx_qout_lock; + struct mtx mtx_bank_lock; + struct mtx mtx_proc_lock; /* Request queue. */ bus_dma_tag_t dma_tag_bufs; @@ -176,30 +183,30 @@ struct xdma_intr_handler { static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework"); -#define XCHAN_LOCK(xchan) sx_xlock(&(xchan)->sx_lock) -#define XCHAN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_lock) +#define XCHAN_LOCK(xchan) mtx_lock(&(xchan)->mtx_lock) +#define XCHAN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_lock) #define XCHAN_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_lock, MA_OWNED) -#define QUEUE_IN_LOCK(xchan) sx_xlock(&(xchan)->sx_qin_lock) -#define QUEUE_IN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qin_lock) +#define QUEUE_IN_LOCK(xchan) mtx_lock(&(xchan)->mtx_qin_lock) +#define QUEUE_IN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_qin_lock) #define QUEUE_IN_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_qin_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_qin_lock, MA_OWNED) -#define QUEUE_OUT_LOCK(xchan) sx_xlock(&(xchan)->sx_qout_lock) -#define QUEUE_OUT_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qout_lock) +#define QUEUE_OUT_LOCK(xchan) mtx_lock(&(xchan)->mtx_qout_lock) +#define QUEUE_OUT_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_qout_lock) #define QUEUE_OUT_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_qout_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_qout_lock, MA_OWNED) -#define QUEUE_BANK_LOCK(xchan) sx_xlock(&(xchan)->sx_bank_lock) -#define QUEUE_BANK_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_bank_lock) +#define QUEUE_BANK_LOCK(xchan) mtx_lock(&(xchan)->mtx_bank_lock) +#define QUEUE_BANK_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_bank_lock) #define QUEUE_BANK_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_bank_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_bank_lock, MA_OWNED) -#define QUEUE_PROC_LOCK(xchan) sx_xlock(&(xchan)->sx_proc_lock) -#define QUEUE_PROC_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_proc_lock) +#define QUEUE_PROC_LOCK(xchan) mtx_lock(&(xchan)->mtx_proc_lock) +#define QUEUE_PROC_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_proc_lock) #define QUEUE_PROC_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_proc_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_proc_lock, MA_OWNED) #define XDMA_SGLIST_MAXLEN 2048 #define XDMA_MAX_SEG 128 @@ -207,11 +214,14 @@ static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework") /* xDMA controller ops */ xdma_controller_t *xdma_ofw_get(device_t dev, const char *prop); int xdma_put(xdma_controller_t *xdma); +vmem_t * xdma_get_memory(device_t dev); +void xdma_put_memory(vmem_t *vmem); /* xDMA channel ops */ xdma_channel_t * xdma_channel_alloc(xdma_controller_t *, uint32_t caps); int xdma_channel_free(xdma_channel_t *); int xdma_request(xdma_channel_t *xchan, struct xdma_request *r); +void xchan_set_memory(xdma_channel_t *xchan, vmem_t *vmem); /* SG interface */ int xdma_prep_sg(xdma_channel_t *, uint32_t, Modified: stable/12/sys/dev/xdma/xdma_bank.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_bank.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma_bank.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: stable/12/sys/dev/xdma/xdma_bio.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_bio.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma_bio.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017-2018 Ruslan Bukin + * Copyright (c) 2017-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: stable/12/sys/dev/xdma/xdma_mbuf.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_mbuf.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma_mbuf.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017-2018 Ruslan Bukin + * Copyright (c) 2017-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/12/sys/dev/xdma/xdma_queue.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_queue.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma_queue.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: stable/12/sys/dev/xdma/xdma_sg.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 15:33:52 2019 (r348622) +++ stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 15:35:46 2019 (r348623) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2018-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -38,10 +39,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include +#include +#include + #ifdef FDT #include #include @@ -58,25 +63,71 @@ struct seg_load_request { uint32_t error; }; +static void +xchan_bufs_free_reserved(xdma_channel_t *xchan) +{ + struct xdma_request *xr; + vm_size_t size; + int i; + + for (i = 0; i < xchan->xr_num; i++) { + xr = &xchan->xr_mem[i]; + size = xr->buf.size; + if (xr->buf.vaddr) { + pmap_kremove_device(xr->buf.vaddr, size); + kva_free(xr->buf.vaddr, size); + xr->buf.vaddr = 0; + } + if (xr->buf.paddr) { + vmem_free(xchan->vmem, xr->buf.paddr, size); + xr->buf.paddr = 0; + } + xr->buf.size = 0; + } +} + static int -_xchan_bufs_alloc(xdma_channel_t *xchan) +xchan_bufs_alloc_reserved(xdma_channel_t *xchan) { xdma_controller_t *xdma; struct xdma_request *xr; + vmem_addr_t addr; + vm_size_t size; int i; xdma = xchan->xdma; + if (xchan->vmem == NULL) + return (ENOBUFS); + for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - /* TODO: bounce buffer */ + size = round_page(xchan->maxsegsize); + if (vmem_alloc(xchan->vmem, size, + M_BESTFIT | M_NOWAIT, &addr)) { + device_printf(xdma->dev, + "%s: Can't allocate memory\n", __func__); + xchan_bufs_free_reserved(xchan); + return (ENOMEM); + } + + xr->buf.size = size; + xr->buf.paddr = addr; + xr->buf.vaddr = kva_alloc(size); + if (xr->buf.vaddr == 0) { + device_printf(xdma->dev, + "%s: Can't allocate KVA\n", __func__); + xchan_bufs_free_reserved(xchan); + return (ENOMEM); + } + pmap_kenter_device(xr->buf.vaddr, size, addr); } return (0); } static int -_xchan_bufs_alloc_busdma(xdma_channel_t *xchan) +xchan_bufs_alloc_busdma(xdma_channel_t *xchan) { xdma_controller_t *xdma; struct xdma_request *xr; @@ -138,9 +189,10 @@ xchan_bufs_alloc(xdma_channel_t *xchan) } if (xchan->caps & XCHAN_CAP_BUSDMA) - ret = _xchan_bufs_alloc_busdma(xchan); - else - ret = _xchan_bufs_alloc(xchan); + ret = xchan_bufs_alloc_busdma(xchan); + else { + ret = xchan_bufs_alloc_reserved(xchan); + } if (ret != 0) { device_printf(xdma->dev, "%s: Can't allocate bufs.\n", __func__); @@ -169,12 +221,8 @@ xchan_bufs_free(xdma_channel_t *xchan) bus_dmamap_destroy(xchan->dma_tag_bufs, b->map); } bus_dma_tag_destroy(xchan->dma_tag_bufs); - } else { - for (i = 0; i < xchan->xr_num; i++) { - xr = &xchan->xr_mem[i]; - /* TODO: bounce buffer */ - } - } + } else + xchan_bufs_free_reserved(xchan); xchan->flags &= ~XCHAN_BUFS_ALLOCATED; @@ -296,6 +344,11 @@ xchan_seg_done(xdma_channel_t *xchan, bus_dmamap_sync(xchan->dma_tag_bufs, b->map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(xchan->dma_tag_bufs, b->map); + } else { + if (xr->req_type == XR_TYPE_MBUF && + xr->direction == XDMA_DEV_TO_MEM) + m_copyback(xr->m, 0, st->transferred, + (void *)xr->buf.vaddr); } xr->status.error = st->error; xr->status.transferred = st->transferred; @@ -437,7 +490,13 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req switch (xr->req_type) { case XR_TYPE_MBUF: - seg[0].ds_addr = mtod(m, bus_addr_t); + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0) { + if (xr->direction == XDMA_MEM_TO_DEV) + m_copydata(m, 0, m->m_pkthdr.len, + (void *)xr->buf.vaddr); + seg[0].ds_addr = (bus_addr_t)xr->buf.paddr; + } else + seg[0].ds_addr = mtod(m, bus_addr_t); seg[0].ds_len = m->m_pkthdr.len; break; case XR_TYPE_BIO: @@ -494,6 +553,7 @@ xdma_process(xdma_channel_t *xchan, xdma = xchan->xdma; n = 0; + c = 0; ret = XDMA_CHANNEL_CAPACITY(xdma->dma_dev, xchan, &capacity); if (ret != 0) { From owner-svn-src-all@freebsd.org Tue Jun 4 15:37:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96ABA15B4D9A; Tue, 4 Jun 2019 15:37:37 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42D566ECF7; Tue, 4 Jun 2019 15:37:37 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 315E01F7A9; Tue, 4 Jun 2019 15:37:37 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FbbxU038613; Tue, 4 Jun 2019 15:37:37 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Fbae8038610; Tue, 4 Jun 2019 15:37:36 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041537.x54Fbae8038610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348624 - in stable/12/sys/dev: mii xilinx X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: in stable/12/sys/dev: mii xilinx X-SVN-Commit-Revision: 348624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42D566ECF7 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:37:37 -0000 Author: br Date: Tue Jun 4 15:37:36 2019 New Revision: 348624 URL: https://svnweb.freebsd.org/changeset/base/348624 Log: MFC r347342: Add driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Added: stable/12/sys/dev/mii/tiphy.h (contents, props changed) stable/12/sys/dev/xilinx/if_xae.c (contents, props changed) stable/12/sys/dev/xilinx/if_xaereg.h (contents, props changed) stable/12/sys/dev/xilinx/if_xaevar.h (contents, props changed) Added: stable/12/sys/dev/mii/tiphy.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/mii/tiphy.h Tue Jun 4 15:37:36 2019 (r348624) @@ -0,0 +1,57 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Texas Instruments DP83867IR/CR Robust, High Immunity + * 10/100/1000 Ethernet Physical Layer Transceiver. + */ + +#ifndef _DEV_MII_TIPHY_H_ +#define _DEV_MII_TIPHY_H_ + +#define DP83867_PHYCR 0x10 /* PHY Control Register */ +#define PHYCR_SGMII_EN (1 << 11) +#define DP83867_CFG2 0x14 /* Configuration Register 2 */ +#define CFG2_SPEED_OPT_10M_EN (1 << 6) /* Speed Optimization */ +#define CFG2_SPEED_OPT_ENHANCED_EN (1 << 8) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_S 10 +#define CFG2_SPEED_OPT_ATTEMPT_CNT_M (0x3 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_1 (0 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_2 (1 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_4 (2 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_8 (3 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_INTERRUPT_POLARITY (1 << 13) /* Int pin is active low. */ +#define DP83867_CFG4 0x31 /* Configuration Register 4 */ + +#endif /* !_DEV_MII_TIPHY_H_ */ Added: stable/12/sys/dev/xilinx/if_xae.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/xilinx/if_xae.c Tue Jun 4 15:37:36 2019 (r348624) @@ -0,0 +1,1097 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "miibus_if.h" + +#define READ4(_sc, _reg) \ + bus_read_4((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_write_4((_sc)->res[0], _reg, _val) + +#define READ8(_sc, _reg) \ + bus_read_8((_sc)->res[0], _reg) +#define WRITE8(_sc, _reg, _val) \ + bus_write_8((_sc)->res[0], _reg, _val) + +#define XAE_LOCK(sc) mtx_lock(&(sc)->mtx) +#define XAE_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define XAE_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) +#define XAE_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) + +#define XAE_DEBUG +#undef XAE_DEBUG + +#ifdef XAE_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define RX_QUEUE_SIZE 64 +#define TX_QUEUE_SIZE 64 +#define NUM_RX_MBUF 16 +#define BUFRING_SIZE 8192 +#define MDIO_CLK_DIV_DEFAULT 29 + +#define PHY1_RD(sc, _r) \ + xae_miibus_read_reg(sc->dev, 1, _r) +#define PHY1_WR(sc, _r, _v) \ + xae_miibus_write_reg(sc->dev, 1, _r, _v) + +#define PHY_RD(sc, _r) \ + xae_miibus_read_reg(sc->dev, sc->phy_addr, _r) +#define PHY_WR(sc, _r, _v) \ + xae_miibus_write_reg(sc->dev, sc->phy_addr, _r, _v) + +/* Use this macro to access regs > 0x1f */ +#define WRITE_TI_EREG(sc, reg, data) { \ + PHY_WR(sc, MII_MMDACR, MMDACR_DADDRMASK); \ + PHY_WR(sc, MII_MMDAADR, reg); \ + PHY_WR(sc, MII_MMDACR, MMDACR_DADDRMASK | MMDACR_FN_DATANPI); \ + PHY_WR(sc, MII_MMDAADR, data); \ +} + +/* Not documented, Xilinx VCU118 workaround */ +#define CFG4_SGMII_TMR 0x160 /* bits 8:7 MUST be '10' */ +#define DP83867_SGMIICTL1 0xD3 /* not documented register */ +#define SGMIICTL1_SGMII_6W (1 << 14) /* no idea what it is */ + +static struct resource_spec xae_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void xae_stop_locked(struct xae_softc *sc); +static void xae_setup_rxfilter(struct xae_softc *sc); + +static int +xae_rx_enqueue(struct xae_softc *sc, uint32_t n) +{ + struct mbuf *m; + int i; + + for (i = 0; i < n; i++) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) { + device_printf(sc->dev, + "%s: Can't alloc rx mbuf\n", __func__); + return (-1); + } + + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + xdma_enqueue_mbuf(sc->xchan_rx, &m, 0, 4, 4, XDMA_DEV_TO_MEM); + } + + return (0); +} + +static int +xae_get_phyaddr(phandle_t node, int *phy_addr) +{ + phandle_t phy_node; + pcell_t phy_handle, phy_reg; + + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) <= 0) + return (ENXIO); + + phy_node = OF_node_from_xref(phy_handle); + + if (OF_getencprop(phy_node, "reg", (void *)&phy_reg, + sizeof(phy_reg)) <= 0) + return (ENXIO); + + *phy_addr = phy_reg; + + return (0); +} + +static int +xae_xdma_tx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct xae_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + + sc = arg; + + XAE_LOCK(sc); + + ifp = sc->ifp; + + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_tx, &m, &st); + if (err != 0) { + break; + } + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + } + + m_freem(m); + } + + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + XAE_UNLOCK(sc); + + return (0); +} + +static int +xae_xdma_rx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct xae_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + uint32_t cnt_processed; + + sc = arg; + + dprintf("%s\n", __func__); + + XAE_LOCK(sc); + + ifp = sc->ifp; + + cnt_processed = 0; + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_rx, &m, &st); + if (err != 0) { + break; + } + cnt_processed++; + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + continue; + } + + m->m_pkthdr.len = m->m_len = st.transferred; + m->m_pkthdr.rcvif = ifp; + XAE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + XAE_LOCK(sc); + } + + xae_rx_enqueue(sc, cnt_processed); + + XAE_UNLOCK(sc); + + return (0); +} + +static void +xae_qflush(struct ifnet *ifp) +{ + struct xae_softc *sc; + + sc = ifp->if_softc; +} + +static int +xae_transmit_locked(struct ifnet *ifp) +{ + struct xae_softc *sc; + struct mbuf *m; + struct buf_ring *br; + int error; + int enq; + + dprintf("%s\n", __func__); + + sc = ifp->if_softc; + br = sc->br; + + enq = 0; + + while ((m = drbr_peek(ifp, br)) != NULL) { + error = xdma_enqueue_mbuf(sc->xchan_tx, + &m, 0, 4, 4, XDMA_MEM_TO_DEV); + if (error != 0) { + /* No space in request queue available yet. */ + drbr_putback(ifp, br, m); + break; + } + + drbr_advance(ifp, br); + + enq++; + + /* If anyone is interested give them a copy. */ + ETHER_BPF_MTAP(ifp, m); + } + + if (enq > 0) + xdma_queue_submit(sc->xchan_tx); + + return (0); +} + +static int +xae_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct xae_softc *sc; + int error; + + dprintf("%s\n", __func__); + + sc = ifp->if_softc; + + XAE_LOCK(sc); + + error = drbr_enqueue(ifp, sc->br, m); + if (error) { + XAE_UNLOCK(sc); + return (error); + } + + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) { + XAE_UNLOCK(sc); + return (0); + } + + if (!sc->link_is_up) { + XAE_UNLOCK(sc); + return (0); + } + + error = xae_transmit_locked(ifp); + + XAE_UNLOCK(sc); + + return (error); +} + +static void +xae_stop_locked(struct xae_softc *sc) +{ + struct ifnet *ifp; + uint32_t reg; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + callout_stop(&sc->xae_callout); + + /* Stop the transmitter */ + reg = READ4(sc, XAE_TC); + reg &= ~TC_TX; + WRITE4(sc, XAE_TC, reg); + + /* Stop the receiver. */ + reg = READ4(sc, XAE_RCW1); + reg &= ~RCW1_RX; + WRITE4(sc, XAE_RCW1, reg); +} + +static uint64_t +xae_stat(struct xae_softc *sc, int counter_id) +{ + uint64_t new, old; + uint64_t delta; + + KASSERT(counter_id < XAE_MAX_COUNTERS, + ("counter %d is out of range", counter_id)); + + new = READ8(sc, XAE_STATCNT(counter_id)); + old = sc->counters[counter_id]; + + if (new >= old) + delta = new - old; + else + delta = UINT64_MAX - old + new; + sc->counters[counter_id] = new; + + return (delta); +} + +static void +xae_harvest_stats(struct xae_softc *sc) +{ + struct ifnet *ifp; + + ifp = sc->ifp; + + if_inc_counter(ifp, IFCOUNTER_IPACKETS, xae_stat(sc, RX_GOOD_FRAMES)); + if_inc_counter(ifp, IFCOUNTER_IMCASTS, xae_stat(sc, RX_GOOD_MCASTS)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + xae_stat(sc, RX_FRAME_CHECK_SEQ_ERROR) + + xae_stat(sc, RX_LEN_OUT_OF_RANGE) + + xae_stat(sc, RX_ALIGNMENT_ERRORS)); + + if_inc_counter(ifp, IFCOUNTER_OBYTES, xae_stat(sc, TX_BYTES)); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, xae_stat(sc, TX_GOOD_FRAMES)); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, xae_stat(sc, TX_GOOD_MCASTS)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + xae_stat(sc, TX_GOOD_UNDERRUN_ERRORS)); + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + xae_stat(sc, TX_SINGLE_COLLISION_FRAMES) + + xae_stat(sc, TX_MULTI_COLLISION_FRAMES) + + xae_stat(sc, TX_LATE_COLLISIONS) + + xae_stat(sc, TX_EXCESS_COLLISIONS)); +} + +static void +xae_tick(void *arg) +{ + struct xae_softc *sc; + struct ifnet *ifp; + int link_was_up; + + sc = arg; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; + + /* Gather stats from hardware counters. */ + xae_harvest_stats(sc); + + /* Check the media status. */ + link_was_up = sc->link_is_up; + mii_tick(sc->mii_softc); + if (sc->link_is_up && !link_was_up) + xae_transmit_locked(sc->ifp); + + /* Schedule another check one second from now. */ + callout_reset(&sc->xae_callout, hz, xae_tick, sc); +} + +static void +xae_init_locked(struct xae_softc *sc) +{ + struct ifnet *ifp; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + xae_setup_rxfilter(sc); + + /* Enable the transmitter */ + WRITE4(sc, XAE_TC, TC_TX); + + /* Enable the receiver. */ + WRITE4(sc, XAE_RCW1, RCW1_RX); + + /* + * Call mii_mediachg() which will call back into xae_miibus_statchg() + * to set up the remaining config registers based on current media. + */ + mii_mediachg(sc->mii_softc); + callout_reset(&sc->xae_callout, hz, xae_tick, sc); +} + +static void +xae_init(void *arg) +{ + struct xae_softc *sc; + + sc = arg; + + XAE_LOCK(sc); + xae_init_locked(sc); + XAE_UNLOCK(sc); +} + +static void +xae_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) +{ + struct xae_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = sc->mii_softc; + + XAE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + XAE_UNLOCK(sc); +} + +static int +xae_media_change_locked(struct xae_softc *sc) +{ + + return (mii_mediachg(sc->mii_softc)); +} + +static int +xae_media_change(struct ifnet * ifp) +{ + struct xae_softc *sc; + int error; + + sc = ifp->if_softc; + + XAE_LOCK(sc); + error = xae_media_change_locked(sc); + XAE_UNLOCK(sc); + + return (error); +} + +static void +xae_setup_rxfilter(struct xae_softc *sc) +{ + struct ifmultiaddr *ifma; + struct ifnet *ifp; + uint32_t reg; + uint8_t *ma; + int i; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + /* + * Set the multicast (group) filter hash. + */ + if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) { + reg = READ4(sc, XAE_FFC); + reg |= FFC_PM; + WRITE4(sc, XAE_FFC, reg); + } else { + reg = READ4(sc, XAE_FFC); + reg &= ~FFC_PM; + WRITE4(sc, XAE_FFC, reg); + + if_maddr_rlock(ifp); + + i = 0; + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + + if (i >= XAE_MULTICAST_TABLE_SIZE) + break; + + ma = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + + reg = READ4(sc, XAE_FFC) & 0xffffff00; + reg |= i++; + WRITE4(sc, XAE_FFC, reg); + + reg = (ma[0]); + reg |= (ma[1] << 8); + reg |= (ma[2] << 16); + reg |= (ma[3] << 24); + WRITE4(sc, XAE_FFV(0), reg); + + reg = ma[4]; + reg |= ma[5] << 8; + WRITE4(sc, XAE_FFV(1), reg); + } + if_maddr_runlock(ifp); + } + + /* + * Set the primary address. + */ + reg = sc->macaddr[0]; + reg |= (sc->macaddr[1] << 8); + reg |= (sc->macaddr[2] << 16); + reg |= (sc->macaddr[3] << 24); + WRITE4(sc, XAE_UAW0, reg); + + reg = sc->macaddr[4]; + reg |= (sc->macaddr[5] << 8); + WRITE4(sc, XAE_UAW1, reg); +} + +static int +xae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct xae_softc *sc; + struct mii_data *mii; + struct ifreq *ifr; + int mask, error; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + + error = 0; + switch (cmd) { + case SIOCSIFFLAGS: + XAE_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if ((ifp->if_flags ^ sc->if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) + xae_setup_rxfilter(sc); + } else { + if (!sc->is_detaching) + xae_init_locked(sc); + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + xae_stop_locked(sc); + } + sc->if_flags = ifp->if_flags; + XAE_UNLOCK(sc); + break; + case SIOCADDMULTI: + case SIOCDELMULTI: + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + XAE_LOCK(sc); + xae_setup_rxfilter(sc); + XAE_UNLOCK(sc); + } + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + mii = sc->mii_softc; + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); + break; + case SIOCSIFCAP: + mask = ifp->if_capenable ^ ifr->ifr_reqcap; + if (mask & IFCAP_VLAN_MTU) { + /* No work to do except acknowledge the change took */ + ifp->if_capenable ^= IFCAP_VLAN_MTU; + } + break; + + default: + error = ether_ioctl(ifp, cmd, data); + break; + } + + return (error); +} + +static void +xae_intr(void *arg) +{ + +} + +static int +xae_get_hwaddr(struct xae_softc *sc, uint8_t *hwaddr) +{ + phandle_t node; + int len; + + node = ofw_bus_get_node(sc->dev); + + /* Check if there is property */ + if ((len = OF_getproplen(node, "local-mac-address")) <= 0) + return (EINVAL); + + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "local-mac-address", hwaddr, + ETHER_ADDR_LEN); + + return (0); +} + +static int +mdio_wait(struct xae_softc *sc) +{ + uint32_t reg; + int timeout; + + timeout = 200; + + do { + reg = READ4(sc, XAE_MDIO_CTRL); + if (reg & MDIO_CTRL_READY) + break; + DELAY(1); + } while (timeout--); + + if (timeout <= 0) { + printf("Failed to get MDIO ready\n"); + return (1); + } + + return (0); +} + +static int +xae_miibus_read_reg(device_t dev, int phy, int reg) +{ + struct xae_softc *sc; + uint32_t mii; + int rv; + + sc = device_get_softc(dev); + + if (mdio_wait(sc)) + return (0); + + mii = MDIO_CTRL_TX_OP_READ | MDIO_CTRL_INITIATE; + mii |= (reg << MDIO_TX_REGAD_S); + mii |= (phy << MDIO_TX_PHYAD_S); + + WRITE4(sc, XAE_MDIO_CTRL, mii); + + if (mdio_wait(sc)) + return (0); + + rv = READ4(sc, XAE_MDIO_READ); + + return (rv); +} + +static int +xae_miibus_write_reg(device_t dev, int phy, int reg, int val) +{ + struct xae_softc *sc; + uint32_t mii; + + sc = device_get_softc(dev); + + if (mdio_wait(sc)) + return (1); + + mii = MDIO_CTRL_TX_OP_WRITE | MDIO_CTRL_INITIATE; + mii |= (reg << MDIO_TX_REGAD_S); + mii |= (phy << MDIO_TX_PHYAD_S); + + WRITE4(sc, XAE_MDIO_WRITE, val); + WRITE4(sc, XAE_MDIO_CTRL, mii); + + if (mdio_wait(sc)) + return (1); + + return (0); +} + +static void +xae_phy_fixup(struct xae_softc *sc) +{ + uint32_t reg; + device_t dev; + + dev = sc->dev; + + do { + WRITE_TI_EREG(sc, DP83867_SGMIICTL1, SGMIICTL1_SGMII_6W); + PHY_WR(sc, DP83867_PHYCR, PHYCR_SGMII_EN); + + reg = PHY_RD(sc, DP83867_CFG2); + reg &= ~CFG2_SPEED_OPT_ATTEMPT_CNT_M; + reg |= (CFG2_SPEED_OPT_ATTEMPT_CNT_4); + reg |= CFG2_INTERRUPT_POLARITY; + reg |= CFG2_SPEED_OPT_ENHANCED_EN; + reg |= CFG2_SPEED_OPT_10M_EN; + PHY_WR(sc, DP83867_CFG2, reg); + + WRITE_TI_EREG(sc, DP83867_CFG4, CFG4_SGMII_TMR); + PHY_WR(sc, MII_BMCR, + BMCR_AUTOEN | BMCR_FDX | BMCR_SPEED1 | BMCR_RESET); + } while (PHY1_RD(sc, MII_BMCR) == 0x0ffff); + + do { + PHY1_WR(sc, MII_BMCR, + BMCR_AUTOEN | BMCR_FDX | BMCR_SPEED1 | BMCR_STARTNEG); + DELAY(40000); + } while ((PHY1_RD(sc, MII_BMSR) & BMSR_ACOMP) == 0); +} + +static int +setup_xdma(struct xae_softc *sc) +{ + device_t dev; + vmem_t *vmem; + int error; + + dev = sc->dev; + + /* Get xDMA controller */ + sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); + if (sc->xdma_tx == NULL) { + device_printf(dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + + sc->xdma_rx = xdma_ofw_get(sc->dev, "rx"); + if (sc->xdma_rx == NULL) { + device_printf(dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + + /* Alloc xDMA TX virtual channel. */ + sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, 0); + if (sc->xchan_tx == NULL) { + device_printf(dev, "Can't alloc virtual DMA TX channel.\n"); + return (ENXIO); + } + + /* Setup interrupt handler. */ + error = xdma_setup_intr(sc->xchan_tx, + xae_xdma_tx_intr, sc, &sc->ih_tx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA TX interrupt handler.\n"); + return (ENXIO); + } + + /* Alloc xDMA RX virtual channel. */ + sc->xchan_rx = xdma_channel_alloc(sc->xdma_rx, 0); + if (sc->xchan_rx == NULL) { + device_printf(dev, "Can't alloc virtual DMA RX channel.\n"); + return (ENXIO); + } + + /* Setup interrupt handler. */ + error = xdma_setup_intr(sc->xchan_rx, + xae_xdma_rx_intr, sc, &sc->ih_rx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA RX interrupt handler.\n"); + return (ENXIO); + } + + /* Setup bounce buffer */ + vmem = xdma_get_memory(dev); + if (vmem) { + xchan_set_memory(sc->xchan_tx, vmem); + xchan_set_memory(sc->xchan_rx, vmem); + } + + xdma_prep_sg(sc->xchan_tx, + TX_QUEUE_SIZE, /* xchan requests queue size */ + MCLBYTES, /* maxsegsize */ + 8, /* maxnsegs */ + 16, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR); + + xdma_prep_sg(sc->xchan_rx, + RX_QUEUE_SIZE, /* xchan requests queue size */ + MCLBYTES, /* maxsegsize */ + 1, /* maxnsegs */ + 16, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR); + + return (0); +} + +static int +xae_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "xlnx,axi-ethernet-1.00.a")) + return (ENXIO); + + device_set_desc(dev, "Xilinx AXI Ethernet"); + + return (BUS_PROBE_DEFAULT); +} + +static int +xae_attach(device_t dev) +{ + struct xae_softc *sc; + struct ifnet *ifp; + phandle_t node; + uint32_t reg; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + if (setup_xdma(sc) != 0) { + device_printf(dev, "Could not setup xDMA.\n"); + return (ENXIO); + } + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), + MTX_NETWORK_LOCK, MTX_DEF); + + sc->br = buf_ring_alloc(BUFRING_SIZE, M_DEVBUF, + M_NOWAIT, &sc->mtx); + if (sc->br == NULL) + return (ENOMEM); + + if (bus_alloc_resources(dev, xae_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + device_printf(sc->dev, "Identification: %x\n", + READ4(sc, XAE_IDENT)); + + /* Get MAC addr */ + if (xae_get_hwaddr(sc, sc->macaddr)) { + device_printf(sc->dev, "can't get mac\n"); + return (ENXIO); + } + + /* Enable MII clock */ + reg = (MDIO_CLK_DIV_DEFAULT << MDIO_SETUP_CLK_DIV_S); + reg |= MDIO_SETUP_ENABLE; + WRITE4(sc, XAE_MDIO_SETUP, reg); + if (mdio_wait(sc)) + return (ENXIO); + + callout_init_mtx(&sc->xae_callout, &sc->mtx, 0); + + /* Setup interrupt handler. */ + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, + NULL, xae_intr, sc, &sc->intr_cookie); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + + /* Set up the ethernet interface. */ + sc->ifp = ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 15:39:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7325215B4EC1; Tue, 4 Jun 2019 15:39:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22D156EEA5; Tue, 4 Jun 2019 15:39:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0E151F7B5; Tue, 4 Jun 2019 15:39:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FdSJL038752; Tue, 4 Jun 2019 15:39:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FdSwl038749; Tue, 4 Jun 2019 15:39:28 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041539.x54FdSwl038749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348625 - stable/12/sys/dev/xilinx X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/dev/xilinx X-SVN-Commit-Revision: 348625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22D156EEA5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:39:29 -0000 Author: br Date: Tue Jun 4 15:39:28 2019 New Revision: 348625 URL: https://svnweb.freebsd.org/changeset/base/348625 Log: MFC r347344: Add driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Added: stable/12/sys/dev/xilinx/axidma.c (contents, props changed) stable/12/sys/dev/xilinx/axidma.h (contents, props changed) Added: stable/12/sys/dev/xilinx/axidma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/xilinx/axidma.c Tue Jun 4 15:39:28 2019 (r348625) @@ -0,0 +1,648 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Xilinx AXI DMA controller driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#include "xdma_if.h" + +#define AXIDMA_DEBUG +#undef AXIDMA_DEBUG + +#ifdef AXIDMA_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define AXIDMA_NCHANNELS 2 +#define AXIDMA_DESCS_NUM 512 +#define AXIDMA_TX_CHAN 0 +#define AXIDMA_RX_CHAN 1 + +extern struct bus_space memmap_bus; + +struct axidma_fdt_data { + int id; +}; + +struct axidma_channel { + struct axidma_softc *sc; + xdma_channel_t *xchan; + bool used; + int idx_head; + int idx_tail; + + struct axidma_desc **descs; + vm_paddr_t *descs_phys; + uint32_t descs_num; + + vm_size_t mem_size; + vm_offset_t mem_paddr; + vm_offset_t mem_vaddr; + + uint32_t descs_used_count; +}; + +struct axidma_softc { + device_t dev; + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih[2]; + struct axidma_desc desc; + struct axidma_channel channels[AXIDMA_NCHANNELS]; +}; + +static struct resource_spec axidma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0 } +}; + +#define HWTYPE_NONE 0 +#define HWTYPE_STD 1 + +static struct ofw_compat_data compat_data[] = { + { "xlnx,eth-dma", HWTYPE_STD }, + { NULL, HWTYPE_NONE }, +}; + +static int axidma_probe(device_t dev); +static int axidma_attach(device_t dev); +static int axidma_detach(device_t dev); + +static inline uint32_t +axidma_next_desc(struct axidma_channel *chan, uint32_t curidx) +{ + + return ((curidx + 1) % chan->descs_num); +} + +static void +axidma_intr(struct axidma_softc *sc, + struct axidma_channel *chan) +{ + xdma_transfer_status_t status; + xdma_transfer_status_t st; + struct axidma_fdt_data *data; + xdma_controller_t *xdma; + struct axidma_desc *desc; + struct xdma_channel *xchan; + uint32_t tot_copied; + int pending; + int errors; + + xchan = chan->xchan; + xdma = xchan->xdma; + data = xdma->data; + + pending = READ4(sc, AXI_DMASR(data->id)); + WRITE4(sc, AXI_DMASR(data->id), pending); + + errors = (pending & (DMASR_DMAINTERR | DMASR_DMASLVERR + | DMASR_DMADECOREERR | DMASR_SGINTERR + | DMASR_SGSLVERR | DMASR_SGDECERR)); + + dprintf("%s: AXI_DMASR %x\n", __func__, + READ4(sc, AXI_DMASR(data->id))); + dprintf("%s: AXI_CURDESC %x\n", __func__, + READ4(sc, AXI_CURDESC(data->id))); + dprintf("%s: AXI_TAILDESC %x\n", __func__, + READ4(sc, AXI_TAILDESC(data->id))); + + tot_copied = 0; + + while (chan->idx_tail != chan->idx_head) { + desc = chan->descs[chan->idx_tail]; + if ((desc->status & BD_STATUS_CMPLT) == 0) + break; + + st.error = errors; + st.transferred = desc->status & BD_CONTROL_LEN_M; + tot_copied += st.transferred; + xchan_seg_done(xchan, &st); + + chan->idx_tail = axidma_next_desc(chan, chan->idx_tail); + atomic_subtract_int(&chan->descs_used_count, 1); + } + + /* Finish operation */ + status.error = errors; + status.transferred = tot_copied; + xdma_callback(chan->xchan, &status); +} + +static void +axidma_intr_rx(void *arg) +{ + struct axidma_softc *sc; + struct axidma_channel *chan; + + dprintf("%s\n", __func__); + + sc = arg; + chan = &sc->channels[AXIDMA_RX_CHAN]; + + axidma_intr(sc, chan); +} + +static void +axidma_intr_tx(void *arg) +{ + struct axidma_softc *sc; + struct axidma_channel *chan; + + dprintf("%s\n", __func__); + + sc = arg; + chan = &sc->channels[AXIDMA_TX_CHAN]; + + axidma_intr(sc, chan); +} + +static int +axidma_reset(struct axidma_softc *sc, int chan_id) +{ + int timeout; + + WRITE4(sc, AXI_DMACR(chan_id), DMACR_RESET); + + timeout = 100; + do { + if ((READ4(sc, AXI_DMACR(chan_id)) & DMACR_RESET) == 0) + break; + } while (timeout--); + + dprintf("timeout %d\n", timeout); + + if (timeout == 0) + return (-1); + + dprintf("%s: read control after reset: %x\n", + __func__, READ4(sc, AXI_DMACR(chan_id))); + + return (0); +} + +static int +axidma_probe(device_t dev) +{ + int hwtype; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (hwtype == HWTYPE_NONE) + return (ENXIO); + + device_set_desc(dev, "Xilinx AXI DMA"); + + return (BUS_PROBE_DEFAULT); +} + +static int +axidma_attach(device_t dev) +{ + struct axidma_softc *sc; + phandle_t xref, node; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, axidma_spec, sc->res)) { + device_printf(dev, "could not allocate resources.\n"); + return (ENXIO); + } + + /* CSR memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axidma_intr_tx, sc, &sc->ih[0]); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axidma_intr_rx, sc, &sc->ih[1]); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +axidma_detach(device_t dev) +{ + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->res[1], sc->ih[0]); + bus_teardown_intr(dev, sc->res[2], sc->ih[1]); + bus_release_resources(dev, axidma_spec, sc->res); + + return (0); +} + +static int +axidma_desc_free(struct axidma_softc *sc, struct axidma_channel *chan) +{ + struct xdma_channel *xchan; + int nsegments; + + nsegments = chan->descs_num; + xchan = chan->xchan; + + free(chan->descs, M_DEVBUF); + free(chan->descs_phys, M_DEVBUF); + + pmap_kremove_device(chan->mem_vaddr, chan->mem_size); + kva_free(chan->mem_vaddr, chan->mem_size); + vmem_free(xchan->vmem, chan->mem_paddr, chan->mem_size); + + return (0); +} + +static int +axidma_desc_alloc(struct axidma_softc *sc, struct xdma_channel *xchan, + uint32_t desc_size) +{ + struct axidma_channel *chan; + int nsegments; + int i; + + chan = (struct axidma_channel *)xchan->chan; + nsegments = chan->descs_num; + + chan->descs = malloc(nsegments * sizeof(struct axidma_desc *), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (chan->descs == NULL) { + device_printf(sc->dev, + "%s: Can't allocate memory.\n", __func__); + return (-1); + } + + chan->descs_phys = malloc(nsegments * sizeof(bus_dma_segment_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + chan->mem_size = desc_size * nsegments; + if (vmem_alloc(xchan->vmem, chan->mem_size, M_FIRSTFIT | M_NOWAIT, + &chan->mem_paddr)) { + device_printf(sc->dev, "Failed to allocate memory.\n"); + return (-1); + } + chan->mem_vaddr = kva_alloc(chan->mem_size); + pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr); + + device_printf(sc->dev, "Allocated chunk %lx %d\n", + chan->mem_paddr, chan->mem_size); + + for (i = 0; i < nsegments; i++) { + chan->descs[i] = (struct axidma_desc *) + ((uint64_t)chan->mem_vaddr + desc_size * i); + chan->descs_phys[i] = chan->mem_paddr + desc_size * i; + } + + return (0); +} + +static int +axidma_channel_alloc(device_t dev, struct xdma_channel *xchan) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + if (xchan->caps & XCHAN_CAP_BUSDMA) { + device_printf(sc->dev, + "Error: busdma operation is not implemented."); + return (-1); + } + + xdma = xchan->xdma; + data = xdma->data; + + chan = &sc->channels[data->id]; + if (chan->used == false) { + if (axidma_reset(sc, data->id) != 0) + return (-1); + chan->xchan = xchan; + xchan->chan = (void *)chan; + chan->sc = sc; + chan->used = true; + chan->idx_head = 0; + chan->idx_tail = 0; + chan->descs_used_count = 0; + chan->descs_num = AXIDMA_DESCS_NUM; + + return (0); + } + + return (-1); +} + +static int +axidma_channel_free(device_t dev, struct xdma_channel *xchan) +{ + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + + axidma_desc_free(sc, chan); + + chan->used = false; + + return (0); +} + +static int +axidma_channel_capacity(device_t dev, xdma_channel_t *xchan, + uint32_t *capacity) +{ + struct axidma_channel *chan; + uint32_t c; + + chan = (struct axidma_channel *)xchan->chan; + + /* At least one descriptor must be left empty. */ + c = (chan->descs_num - chan->descs_used_count - 1); + + *capacity = c; + + return (0); +} + +static int +axidma_channel_submit_sg(device_t dev, struct xdma_channel *xchan, + struct xdma_sglist *sg, uint32_t sg_n) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_desc *desc; + struct axidma_softc *sc; + uint32_t src_addr; + uint32_t dst_addr; + uint32_t addr; + uint32_t len; + uint32_t tmp; + int i; + int tail; + + dprintf("%s: sg_n %d\n", __func__, sg_n); + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + xdma = xchan->xdma; + data = xdma->data; + + if (sg_n == 0) + return (0); + + tail = chan->idx_head; + + tmp = 0; + + for (i = 0; i < sg_n; i++) { + src_addr = (uint32_t)sg[i].src_addr; + dst_addr = (uint32_t)sg[i].dst_addr; + len = (uint32_t)sg[i].len; + + dprintf("%s(%d): src %x dst %x len %d\n", __func__, + data->id, src_addr, dst_addr, len); + + desc = chan->descs[chan->idx_head]; + if (sg[i].direction == XDMA_MEM_TO_DEV) + desc->phys = src_addr; + else + desc->phys = dst_addr; + desc->status = 0; + desc->control = len; + if (sg[i].first == 1) + desc->control |= BD_CONTROL_TXSOF; + if (sg[i].last == 1) + desc->control |= BD_CONTROL_TXEOF; + + tmp = chan->idx_head; + + atomic_add_int(&chan->descs_used_count, 1); + chan->idx_head = axidma_next_desc(chan, chan->idx_head); + } + + dprintf("%s(%d): _curdesc %x\n", __func__, data->id, + READ8(sc, AXI_CURDESC(data->id))); + dprintf("%s(%d): _curdesc %x\n", __func__, data->id, + READ8(sc, AXI_CURDESC(data->id))); + dprintf("%s(%d): status %x\n", __func__, data->id, + READ4(sc, AXI_DMASR(data->id))); + + addr = chan->descs_phys[tmp]; + WRITE8(sc, AXI_TAILDESC(data->id), addr); + + return (0); +} + +static int +axidma_channel_prep_sg(device_t dev, struct xdma_channel *xchan) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_desc *desc; + struct axidma_softc *sc; + uint32_t addr; + uint32_t reg; + int ret; + int i; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + xdma = xchan->xdma; + data = xdma->data; + + dprintf("%s(%d)\n", __func__, data->id); + + ret = axidma_desc_alloc(sc, xchan, sizeof(struct axidma_desc)); + if (ret != 0) { + device_printf(sc->dev, + "%s: Can't allocate descriptors.\n", __func__); + return (-1); + } + + for (i = 0; i < chan->descs_num; i++) { + desc = chan->descs[i]; + bzero(desc, sizeof(struct axidma_desc)); + + if (i == (chan->descs_num - 1)) + desc->next = chan->descs_phys[0]; + else + desc->next = chan->descs_phys[i + 1]; + desc->status = 0; + desc->control = 0; + + dprintf("%s(%d): desc %d vaddr %lx next paddr %x\n", __func__, + data->id, i, (uint64_t)desc, le32toh(desc->next)); + } + + addr = chan->descs_phys[0]; + WRITE8(sc, AXI_CURDESC(data->id), addr); + + reg = READ4(sc, AXI_DMACR(data->id)); + reg |= DMACR_IOC_IRQEN | DMACR_DLY_IRQEN | DMACR_ERR_IRQEN; + WRITE4(sc, AXI_DMACR(data->id), reg); + reg |= DMACR_RS; + WRITE4(sc, AXI_DMACR(data->id), reg); + + return (0); +} + +static int +axidma_channel_control(device_t dev, xdma_channel_t *xchan, int cmd) +{ + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + + switch (cmd) { + case XDMA_CMD_BEGIN: + case XDMA_CMD_TERMINATE: + case XDMA_CMD_PAUSE: + /* TODO: implement me */ + return (-1); + } + + return (0); +} + +#ifdef FDT +static int +axidma_ofw_md_data(device_t dev, pcell_t *cells, int ncells, void **ptr) +{ + struct axidma_fdt_data *data; + + if (ncells != 1) + return (-1); + + data = malloc(sizeof(struct axidma_fdt_data), + M_DEVBUF, (M_WAITOK | M_ZERO)); + data->id = cells[0]; + + *ptr = data; + + return (0); +} +#endif + +static device_method_t axidma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, axidma_probe), + DEVMETHOD(device_attach, axidma_attach), + DEVMETHOD(device_detach, axidma_detach), + + /* xDMA Interface */ + DEVMETHOD(xdma_channel_alloc, axidma_channel_alloc), + DEVMETHOD(xdma_channel_free, axidma_channel_free), + DEVMETHOD(xdma_channel_control, axidma_channel_control), + + /* xDMA SG Interface */ + DEVMETHOD(xdma_channel_capacity, axidma_channel_capacity), + DEVMETHOD(xdma_channel_prep_sg, axidma_channel_prep_sg), + DEVMETHOD(xdma_channel_submit_sg, axidma_channel_submit_sg), + +#ifdef FDT + DEVMETHOD(xdma_ofw_md_data, axidma_ofw_md_data), +#endif + + DEVMETHOD_END +}; + +static driver_t axidma_driver = { + "axidma", + axidma_methods, + sizeof(struct axidma_softc), +}; + +static devclass_t axidma_devclass; + +EARLY_DRIVER_MODULE(axidma, simplebus, axidma_driver, axidma_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Added: stable/12/sys/dev/xilinx/axidma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/xilinx/axidma.h Tue Jun 4 15:39:28 2019 (r348625) @@ -0,0 +1,96 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_XILINX_AXIDMA_H_ +#define _DEV_XILINX_AXIDMA_H_ + +#define AXI_DMACR(n) (0x00 + 0x30 * (n)) /* DMA Control register */ +#define DMACR_RS (1 << 0) /* Run / Stop. */ +#define DMACR_RESET (1 << 2) /* Soft reset the AXI DMA core. */ +#define DMACR_IOC_IRQEN (1 << 12) /* Interrupt on Complete (IOC) Interrupt Enable. */ +#define DMACR_DLY_IRQEN (1 << 13) /* Interrupt on Delay Timer Interrupt Enable. */ +#define DMACR_ERR_IRQEN (1 << 14) /* Interrupt on Error Interrupt Enable. */ +#define AXI_DMASR(n) (0x04 + 0x30 * (n)) /* DMA Status register */ +#define DMASR_HALTED (1 << 0) +#define DMASR_IDLE (1 << 1) +#define DMASR_SGINCLD (1 << 3) /* Scatter Gather Enabled */ +#define DMASR_DMAINTERR (1 << 4) /* DMA Internal Error. */ +#define DMASR_DMASLVERR (1 << 5) /* DMA Slave Error. */ +#define DMASR_DMADECOREERR (1 << 6) /* Decode Error. */ +#define DMASR_SGINTERR (1 << 8) /* Scatter Gather Internal Error. */ +#define DMASR_SGSLVERR (1 << 9) /* Scatter Gather Slave Error. */ +#define DMASR_SGDECERR (1 << 10) /* Scatter Gather Decode Error. */ +#define DMASR_IOC_IRQ (1 << 12) /* Interrupt on Complete. */ +#define DMASR_DLY_IRQ (1 << 13) /* Interrupt on Delay. */ +#define DMASR_ERR_IRQ (1 << 14) /* Interrupt on Error. */ +#define AXI_CURDESC(n) (0x08 + 0x30 * (n)) /* Current Descriptor Pointer. Lower 32 bits of the address. */ +#define AXI_CURDESC_MSB(n) (0x0C + 0x30 * (n)) /* Current Descriptor Pointer. Upper 32 bits of address. */ +#define AXI_TAILDESC(n) (0x10 + 0x30 * (n)) /* Tail Descriptor Pointer. Lower 32 bits. */ +#define AXI_TAILDESC_MSB(n) (0x14 + 0x30 * (n)) /* Tail Descriptor Pointer. Upper 32 bits of address. */ +#define AXI_SG_CTL 0x2C /* Scatter/Gather User and Cache */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ8(_sc, _reg) \ + bus_space_read_8(_sc->bst, _sc->bsh, _reg) +#define WRITE8(_sc, _reg, _val) \ + bus_space_write_8(_sc->bst, _sc->bsh, _reg, _val) + +struct axidma_desc { + uint32_t next; + uint32_t reserved1; + uint32_t phys; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + uint32_t control; +#define BD_CONTROL_TXSOF (1 << 27) /* Start of Frame. */ +#define BD_CONTROL_TXEOF (1 << 26) /* End of Frame. */ +#define BD_CONTROL_LEN_S 0 /* Buffer Length. */ +#define BD_CONTROL_LEN_M (0x3ffffff << BD_CONTROL_LEN_S) + uint32_t status; +#define BD_STATUS_CMPLT (1 << 31) +#define BD_STATUS_TRANSFERRED_S 0 +#define BD_STATUS_TRANSFERRED_M (0x7fffff << BD_STATUS_TRANSFERRED_S) + uint32_t app0; + uint32_t app1; + uint32_t app2; + uint32_t app3; + uint32_t app4; + uint32_t reserved[3]; +}; + +#endif /* !_DEV_XILINX_AXIDMA_H_ */ From owner-svn-src-all@freebsd.org Tue Jun 4 15:40:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E0F15B4F87; Tue, 4 Jun 2019 15:40:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B7EA6EFF0; Tue, 4 Jun 2019 15:40:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 315F31F7BB; Tue, 4 Jun 2019 15:40:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FeVo4038929; Tue, 4 Jun 2019 15:40:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FeUkQ038928; Tue, 4 Jun 2019 15:40:30 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041540.x54FeUkQ038928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348626 - in stable/12/sys: conf riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: in stable/12/sys: conf riscv/conf X-SVN-Commit-Revision: 348626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B7EA6EFF0 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:40:32 -0000 Author: br Date: Tue Jun 4 15:40:30 2019 New Revision: 348626 URL: https://svnweb.freebsd.org/changeset/base/348626 Log: MFC r347351: Connect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build. Sponsored by: DARPA, AFRL Modified: stable/12/sys/conf/files.riscv stable/12/sys/riscv/conf/GENERIC Modified: stable/12/sys/conf/files.riscv ============================================================================== --- stable/12/sys/conf/files.riscv Tue Jun 4 15:39:28 2019 (r348625) +++ stable/12/sys/conf/files.riscv Tue Jun 4 15:40:30 2019 (r348626) @@ -5,10 +5,13 @@ cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +dev/cadence/if_cgem.c optional cgem dev/ofw/ofw_cpu.c optional fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_lowrisc.c optional uart_lowrisc dev/xilinx/axi_quad_spi.c optional xilinx_spi +dev/xilinx/axidma.c optional axidma xdma +dev/xilinx/if_xae.c optional xae kern/kern_clocksource.c standard kern/msi_if.m standard kern/pic_if.m standard Modified: stable/12/sys/riscv/conf/GENERIC ============================================================================== --- stable/12/sys/riscv/conf/GENERIC Tue Jun 4 15:39:28 2019 (r348625) +++ stable/12/sys/riscv/conf/GENERIC Tue Jun 4 15:40:30 2019 (r348626) @@ -102,6 +102,16 @@ device uart # Generic UART driver device uart_lowrisc # lowRISC UART driver device uart_ns8250 # ns8250-type UART driver + +# Ethernet drivers +device miibus # MII bus support +device cgem # Cadence Gigabit Ethernet MAC +device xae # Xilinx AXI Ethernet MAC + +# DMA support +device xdma # DMA interface +device axidma # Xilinx AXI DMA Controller + # Uncomment for memory disk # options MD_ROOT # options MD_ROOT_SIZE=32768 # 32MB ram disk From owner-svn-src-all@freebsd.org Tue Jun 4 15:42:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9F1115B5283; Tue, 4 Jun 2019 15:42:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F826F487; Tue, 4 Jun 2019 15:42:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 240111F957; Tue, 4 Jun 2019 15:42:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54FgVAG043826; Tue, 4 Jun 2019 15:42:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54FgVSS043811; Tue, 4 Jun 2019 15:42:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041542.x54FgVSS043811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 15:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348627 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48F826F487 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 15:42:31 -0000 Author: br Date: Tue Jun 4 15:42:30 2019 New Revision: 348627 URL: https://svnweb.freebsd.org/changeset/base/348627 Log: MFC r347427: RISC-V ISA does not specify how to manage physical memory attributes (PMA). So do nothing in pmap_page_set_memattr() and don't panic. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/riscv/pmap.c Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 15:40:30 2019 (r348626) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 15:42:30 2019 (r348627) @@ -3122,16 +3122,6 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { m->md.pv_memattr = ma; - - /* - * RISCVTODO: Implement the below (from the amd64 pmap) - * If "m" is a normal page, update its direct mapping. This update - * can be relied upon to perform any cache operations that are - * required for data coherence. - */ - if ((m->flags & PG_FICTITIOUS) == 0 && - PHYS_IN_DMAP(VM_PAGE_TO_PHYS(m))) - panic("RISCVTODO: pmap_page_set_memattr"); } /* From owner-svn-src-all@freebsd.org Tue Jun 4 15:44:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 16:07:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 16:21:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 16:21:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 16:40:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 16:57:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 17:19:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6412F15B7CFB; Tue, 4 Jun 2019 17:19:17 +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 05BB77359E; Tue, 4 Jun 2019 17:19:17 +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 CECCC20928; Tue, 4 Jun 2019 17:19:16 +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 x54HJGO7092076; Tue, 4 Jun 2019 17:19:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HJGG4092075; Tue, 4 Jun 2019 17:19:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041719.x54HJGG4092075@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 17:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348632 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05BB77359E 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:19:17 -0000 Author: markj Date: Tue Jun 4 17:19:16 2019 New Revision: 348632 URL: https://svnweb.freebsd.org/changeset/base/348632 Log: MFC r342766: Don't enable interrupts in init_secondary(). Modified: stable/12/sys/riscv/riscv/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 16:40:18 2019 (r348631) +++ stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:19:16 2019 (r348632) @@ -227,7 +227,6 @@ init_secondary(uint64_t cpu) __asm __volatile("mv gp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ - intr_disable(); csr_set(sie, SIE_SSIE); csr_set(sip, SIE_SSIE); @@ -252,9 +251,6 @@ init_secondary(uint64_t cpu) /* Start per-CPU event timers. */ cpu_initclocks_ap(); - - /* Enable interrupts */ - intr_enable(); /* Enable external (PLIC) interrupts */ csr_set(sie, SIE_SEIE); From owner-svn-src-all@freebsd.org Tue Jun 4 17:20:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9220515B7DAC; Tue, 4 Jun 2019 17:20:35 +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 31951736ED; Tue, 4 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 0B8AD2092D; Tue, 4 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 x54HKY8N092197; Tue, 4 Jun 2019 17:20:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HKYEs092196; Tue, 4 Jun 2019 17:20:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041720.x54HKYEs092196@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 17:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348633 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31951736ED 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:20:35 -0000 Author: markj Date: Tue Jun 4 17:20:34 2019 New Revision: 348633 URL: https://svnweb.freebsd.org/changeset/base/348633 Log: MFC r342732: Use regular stores to update PTEs in the riscv pmap layer. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:19:16 2019 (r348632) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:20:34 2019 (r348633) @@ -257,15 +257,13 @@ static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t v struct spglist *free); static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); -/* - * These load the old table data and store the new value. - * They need to be atomic as the System MMU may write to the table at - * the same time as the CPU. - */ -#define pmap_load_store(table, entry) atomic_swap_64(table, entry) -#define pmap_set(table, mask) atomic_set_64(table, mask) -#define pmap_load_clear(table) atomic_swap_64(table, 0) -#define pmap_load(table) (*table) +#define pmap_clear(pte) pmap_store(pte, 0) +#define pmap_clear_bits(pte, bits) atomic_clear_64(pte, bits) +#define pmap_load_store(pte, entry) atomic_swap_64(pte, entry) +#define pmap_load_clear(pte) pmap_load_store(pte, 0) +#define pmap_load(pte) atomic_load_64(pte) +#define pmap_store(pte, entry) atomic_store_64(pte, entry) +#define pmap_store_bits(pte, bits) atomic_set_64(pte, bits) /********************/ /* Inline functions */ @@ -384,10 +382,7 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; - if (entry) - pmap_load_store(l1, entry); - else - pmap_load_clear(l1); + pmap_store(l1, entry); } } @@ -455,7 +450,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l1[l1_slot], entry); + pmap_store(&l1[l1_slot], entry); } /* Set the upper limit of the DMAP region */ @@ -489,7 +484,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm pn = (pa / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l2[l2_slot], entry); + pmap_store(&l2[l2_slot], entry); l3pt += PAGE_SIZE; } @@ -875,7 +870,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -896,8 +891,7 @@ pmap_kremove(vm_offset_t va) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - pmap_load_clear(l3); - + pmap_clear(l3); sfence_vma(); } @@ -916,7 +910,7 @@ pmap_kremove_device(vm_offset_t sva, vm_size_t size) while (size != 0) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - pmap_load_clear(l3); + pmap_clear(l3); va += PAGE_SIZE; size -= PAGE_SIZE; @@ -973,7 +967,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += L3_SIZE; } @@ -993,14 +987,10 @@ pmap_qremove(vm_offset_t sva, int count) KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva)); - va = sva; - while (count-- > 0) { + for (va = sva; count-- > 0; va += PAGE_SIZE) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - - pmap_load_clear(l3); - - va += PAGE_SIZE; + pmap_clear(l3); } pmap_invalidate_range(kernel_pmap, sva, va); } @@ -1057,13 +1047,13 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t /* PD page */ pd_entry_t *l1; l1 = pmap_l1(pmap, va); - pmap_load_clear(l1); + pmap_clear(l1); pmap_distribute_l1(pmap, pmap_l1_index(va), 0); } else { /* PTE page */ pd_entry_t *l2; l2 = pmap_l2(pmap, va); - pmap_load_clear(l2); + pmap_clear(l2); } pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { @@ -1207,7 +1197,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, l1index, entry); } else { vm_pindex_t l1index; @@ -1236,7 +1226,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); } pmap_resident_count_inc(pmap, 1); @@ -1367,7 +1357,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(kernel_pmap, pmap_l1_index(kernel_vm_end), entry); continue; /* try again */ @@ -1396,7 +1386,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); pmap_invalidate_page(kernel_pmap, kernel_vm_end); @@ -1908,7 +1898,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if ((l3 & PTE_V) != 0) { entry = pmap_load(l3p); entry &= ~PTE_W; - pmap_load_store(l3p, entry); + pmap_store(l3p, entry); /* XXX: Use pmap_invalidate_range */ pmap_invalidate_page(pmap, sva); } @@ -1944,7 +1934,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ new_l3 |= PTE_D; if (orig_l3 != new_l3) { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); pmap_invalidate_page(pmap, va); rv = 1; goto done; @@ -2050,7 +2040,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l1 = pmap_l1(pmap, va); entry = (PTE_V); entry |= (l2_pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, pmap_l1_index(va), entry); l2 = pmap_l1_to_l2(l1, va); } @@ -2069,7 +2059,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l3_pn = (l3_pa / PAGE_SIZE); entry = (PTE_V); entry |= (l3_pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); l3 = pmap_l2_to_l3(l2, va); } pmap_invalidate_page(pmap, va); @@ -2197,7 +2187,7 @@ validate: (PTE_D | PTE_SW_MANAGED)) vm_page_dirty(m); } else { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); } if (lock != NULL) @@ -2278,10 +2268,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v struct spglist free; vm_paddr_t phys; pd_entry_t *l2; - pt_entry_t *l3; - vm_paddr_t pa; - pt_entry_t entry; - pn_t pn; + pt_entry_t *l3, newl3; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -2385,7 +2372,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_load_store(l3, entry); + pmap_store(l3, entry); pmap_invalidate_page(pmap, va); return (mpte); @@ -2728,7 +2715,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad l3 %#jx", (uintmax_t)tl3)); - pmap_load_clear(l3); + pmap_clear(l3); /* * Update the vm_page_t clean/reference bits. From owner-svn-src-all@freebsd.org Tue Jun 4 17:23:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4528F15B7FDD; Tue, 4 Jun 2019 17:23:25 +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 DB4DA73AF6; Tue, 4 Jun 2019 17:23:24 +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 B5E3720AC7; Tue, 4 Jun 2019 17:23:24 +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 x54HNOTL097444; Tue, 4 Jun 2019 17:23:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HNOoL097443; Tue, 4 Jun 2019 17:23:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041723.x54HNOoL097443@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 17:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348634 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB4DA73AF6 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:23:25 -0000 Author: markj Date: Tue Jun 4 17:23:24 2019 New Revision: 348634 URL: https://svnweb.freebsd.org/changeset/base/348634 Log: MFC r343529: Remove a redundant test. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:20:34 2019 (r348633) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:23:24 2019 (r348634) @@ -2632,7 +2632,7 @@ restart: } } l3 = pmap_l3(pmap, pv->pv_va); - if (l3 != NULL && (pmap_load(l3) & PTE_SW_WIRED) != 0) + if ((pmap_load(l3) & PTE_SW_WIRED) != 0) count++; PMAP_UNLOCK(pmap); } From owner-svn-src-all@freebsd.org Tue Jun 4 17:23:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90C3D15B8031; Tue, 4 Jun 2019 17:23:59 +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 33CDD73C21; Tue, 4 Jun 2019 17:23:59 +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 0D14520ACE; Tue, 4 Jun 2019 17:23:59 +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 x54HNwiJ097517; Tue, 4 Jun 2019 17:23:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HNwae097516; Tue, 4 Jun 2019 17:23:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041723.x54HNwae097516@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 17:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348635 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33CDD73C21 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:23:59 -0000 Author: markj Date: Tue Jun 4 17:23:58 2019 New Revision: 348635 URL: https://svnweb.freebsd.org/changeset/base/348635 Log: MFC r342734: Fix some issues with the riscv pmap_protect() implementation. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:23:24 2019 (r348634) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:23:58 2019 (r348635) @@ -1853,22 +1853,28 @@ pmap_remove_all(vm_page_t m) void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - vm_offset_t va_next; pd_entry_t *l1, *l2; - pt_entry_t *l3p, l3; - pt_entry_t entry; + pt_entry_t *l3, l3e, mask; + vm_page_t m; + vm_offset_t va_next; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } - if ((prot & VM_PROT_WRITE) == VM_PROT_WRITE) + if ((prot & (VM_PROT_WRITE | VM_PROT_EXECUTE)) == + (VM_PROT_WRITE | VM_PROT_EXECUTE)) return; + mask = 0; + if ((prot & VM_PROT_WRITE) == 0) + mask |= PTE_W | PTE_D; + if ((prot & VM_PROT_EXECUTE) == 0) + mask |= PTE_X; + PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { - l1 = pmap_l1(pmap, sva); if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; @@ -1882,26 +1888,30 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL) + if (l2 == NULL || pmap_load(l2) == 0) continue; - if (pmap_load(l2) == 0) - continue; if ((pmap_load(l2) & PTE_RX) != 0) continue; if (va_next > eva) va_next = eva; - for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, + for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { - l3 = pmap_load(l3p); - if ((l3 & PTE_V) != 0) { - entry = pmap_load(l3p); - entry &= ~PTE_W; - pmap_store(l3p, entry); - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, sva); + l3e = pmap_load(l3); +retry: + if ((l3e & PTE_V) == 0) + continue; + if ((prot & VM_PROT_WRITE) == 0 && + (l3e & (PTE_SW_MANAGED | PTE_D)) == + (PTE_SW_MANAGED | PTE_D)) { + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(l3e)); + vm_page_dirty(m); } + if (!atomic_fcmpset_long(l3, &l3e, l3e & ~mask)) + goto retry; + /* XXX: Use pmap_invalidate_range */ + pmap_invalidate_page(pmap, sva); } } PMAP_UNLOCK(pmap); From owner-svn-src-all@freebsd.org Tue Jun 4 17:24:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52A8815B8087; Tue, 4 Jun 2019 17:24: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 E7243741B7; Tue, 4 Jun 2019 17:24: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 C29E120ACF; Tue, 4 Jun 2019 17:24: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 x54HOQJ2097583; Tue, 4 Jun 2019 17:24:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HOQsH097582; Tue, 4 Jun 2019 17:24:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041724.x54HOQsH097582@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 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348636 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7243741B7 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:24:27 -0000 Author: markj Date: Tue Jun 4 17:24:26 2019 New Revision: 348636 URL: https://svnweb.freebsd.org/changeset/base/348636 Log: MFC r342735: Synchronize access to the allpmaps list. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:23:58 2019 (r348635) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:24:26 2019 (r348636) @@ -228,6 +228,7 @@ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); static struct rwlock_padalign pvh_global_lock; +static struct mtx_padalign allpmaps_lock; /* * Data for the pv entry allocation mechanism @@ -380,10 +381,12 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in if (pmap != kernel_pmap) return; + mtx_lock(&allpmaps_lock); LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; pmap_store(l1, entry); } + mtx_unlock(&allpmaps_lock); } static pt_entry_t * @@ -636,9 +639,10 @@ pmap_init(void) int i; /* - * Initialize the pv chunk list mutex. + * Initialize the pv chunk and pmap list mutexes. */ mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); + mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_DEF); /* * Initialize the pool of pv list locks. @@ -1132,7 +1136,9 @@ pmap_pinit(pmap_t pmap) memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); /* Add to the list of all user pmaps */ + mtx_lock(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); + mtx_unlock(&allpmaps_lock); return (1); } @@ -1296,7 +1302,9 @@ pmap_release(pmap_t pmap) vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ + mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); + mtx_unlock(&allpmaps_lock); /* Remove kernel pagetables */ bzero(pmap->pm_l1, PAGE_SIZE); From owner-svn-src-all@freebsd.org Tue Jun 4 17:24:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E39CC15B80E5; Tue, 4 Jun 2019 17:24:53 +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 884C7742E5; Tue, 4 Jun 2019 17:24:53 +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 34FF520AD0; Tue, 4 Jun 2019 17:24:53 +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 x54HOrYZ097648; Tue, 4 Jun 2019 17:24:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HOrOC097647; Tue, 4 Jun 2019 17:24:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041724.x54HOrOC097647@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 17:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348637 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 884C7742E5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:24:54 -0000 Author: markj Date: Tue Jun 4 17:24:52 2019 New Revision: 348637 URL: https://svnweb.freebsd.org/changeset/base/348637 Log: MFC r342736: Fix a use-after-free in the riscv pmap_release() implementation. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:24:26 2019 (r348636) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:24:52 2019 (r348637) @@ -1297,17 +1297,13 @@ pmap_release(pmap_t pmap) ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - vm_page_unwire_noq(m); - vm_page_free_zero(m); - - /* Remove pmap from the allpmaps list */ mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock(&allpmaps_lock); - /* Remove kernel pagetables */ - bzero(pmap->pm_l1, PAGE_SIZE); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); + vm_page_unwire_noq(m); + vm_page_free(m); } #if 0 From owner-svn-src-all@freebsd.org Tue Jun 4 17:25:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA29515B815B; Tue, 4 Jun 2019 17:25:23 +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 5DF2374418; Tue, 4 Jun 2019 17:25:23 +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 386EA20AD1; Tue, 4 Jun 2019 17:25:23 +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 x54HPNSA097722; Tue, 4 Jun 2019 17:25:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HPNh7097721; Tue, 4 Jun 2019 17:25:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041725.x54HPNh7097721@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 17:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348638 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DF2374418 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:25:23 -0000 Author: markj Date: Tue Jun 4 17:25:22 2019 New Revision: 348638 URL: https://svnweb.freebsd.org/changeset/base/348638 Log: MFC r342764: Clear PGA_WRITEABLE in pmap_remove_pages(). Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:24:52 2019 (r348637) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:25:22 2019 (r348638) @@ -2745,6 +2745,9 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->aflags & PGA_WRITEABLE) != 0) + vm_page_aflag_clear(m, PGA_WRITEABLE); pmap_unuse_l3(pmap, pv->pv_va, ptepde, &free); freed++; From owner-svn-src-all@freebsd.org Tue Jun 4 17:25:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E145715B81CA; Tue, 4 Jun 2019 17:25:46 +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 8123B74545; Tue, 4 Jun 2019 17:25:46 +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 5C61C20AD2; Tue, 4 Jun 2019 17:25:46 +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 x54HPkhq097781; Tue, 4 Jun 2019 17:25:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HPkp8097780; Tue, 4 Jun 2019 17:25:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041725.x54HPkp8097780@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 17:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348639 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8123B74545 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:25:47 -0000 Author: markj Date: Tue Jun 4 17:25:45 2019 New Revision: 348639 URL: https://svnweb.freebsd.org/changeset/base/348639 Log: MFC r342765: Fix dirty bit handling in pmap_remove_write(). Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:25:22 2019 (r348638) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:25:45 2019 (r348639) @@ -2938,15 +2938,13 @@ retry_pv_loop: } } l3 = pmap_l3(pmap, pv->pv_va); -retry: oldl3 = pmap_load(l3); - +retry: if ((oldl3 & PTE_W) != 0) { - newl3 = oldl3 & ~PTE_W; - if (!atomic_cmpset_long(l3, oldl3, newl3)) + newl3 = oldl3 & ~(PTE_D | PTE_W); + if (!atomic_fcmpset_long(l3, &oldl3, newl3)) goto retry; - /* TODO: check for PTE_D? */ - if ((oldl3 & PTE_A) != 0) + if ((oldl3 & PTE_D) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); } From owner-svn-src-all@freebsd.org Tue Jun 4 17:28:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A949E15B830E; Tue, 4 Jun 2019 17:28:50 +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 493B1746F5; Tue, 4 Jun 2019 17:28:50 +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 238BA20AD4; Tue, 4 Jun 2019 17:28:50 +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 x54HSocD097942; Tue, 4 Jun 2019 17:28:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HSnwD097941; Tue, 4 Jun 2019 17:28:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041728.x54HSnwD097941@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 17:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348640 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 493B1746F5 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:28:50 -0000 Author: markj Date: Tue Jun 4 17:28:49 2019 New Revision: 348640 URL: https://svnweb.freebsd.org/changeset/base/348640 Log: MFC r340029 (by jhb): Set PTE_A and PTE_D for user mappings in pmap_enter(). Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:25:45 2019 (r348639) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:28:49 2019 (r348640) @@ -2000,13 +2000,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - new_l3 = PTE_V | PTE_R | PTE_X; + new_l3 = PTE_V | PTE_R | PTE_X | PTE_A; + if (flags & VM_PROT_WRITE) + new_l3 |= PTE_D; if (prot & VM_PROT_WRITE) new_l3 |= PTE_W; if ((va >> 63) == 0) new_l3 |= PTE_U; - else - new_l3 |= PTE_A | PTE_D; + else if (prot & VM_PROT_WRITE) + new_l3 |= PTE_D; new_l3 |= (pn << PTE_PPN0_S); if ((flags & PMAP_ENTER_WIRED) != 0) From owner-svn-src-all@freebsd.org Tue Jun 4 17:29:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B91D15B8360; Tue, 4 Jun 2019 17:29:22 +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 2A64174825; Tue, 4 Jun 2019 17:29:22 +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 ED78120AD5; Tue, 4 Jun 2019 17:29:21 +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 x54HTLJx098013; Tue, 4 Jun 2019 17:29:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HTLOA098008; Tue, 4 Jun 2019 17:29:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041729.x54HTLOA098008@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 17:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348641 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 348641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A64174825 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:29:22 -0000 Author: markj Date: Tue Jun 4 17:29:20 2019 New Revision: 348641 URL: https://svnweb.freebsd.org/changeset/base/348641 Log: MFC r340030 (by jhb): Restrict setting PTE execute permissions on RISC-V. Modified: stable/12/sys/riscv/include/pte.h stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/pmap.c stable/12/sys/riscv/riscv/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/pte.h ============================================================================== --- stable/12/sys/riscv/include/pte.h Tue Jun 4 17:28:49 2019 (r348640) +++ stable/12/sys/riscv/include/pte.h Tue Jun 4 17:29:20 2019 (r348641) @@ -78,7 +78,7 @@ typedef uint64_t pn_t; /* page number */ #define PTE_V (1 << 0) /* Valid */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) -#define PTE_KERN (PTE_V | PTE_RWX | PTE_A | PTE_D) +#define PTE_KERN (PTE_V | PTE_R | PTE_W | PTE_A | PTE_D) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Tue Jun 4 17:28:49 2019 (r348640) +++ stable/12/sys/riscv/riscv/locore.S Tue Jun 4 17:29:20 2019 (r348641) @@ -94,7 +94,7 @@ _start: add t3, t4, t2 li t5, 0 2: - li t0, (PTE_KERN) + li t0, (PTE_KERN | PTE_X) slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */ Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:28:49 2019 (r348640) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:20 2019 (r348641) @@ -1922,7 +1922,7 @@ retry: } int -pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot) +pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype) { pt_entry_t orig_l3; pt_entry_t new_l3; @@ -1939,12 +1939,13 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ orig_l3 = pmap_load(l3); if ((orig_l3 & PTE_V) == 0 || - ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || - ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) + (ftype == VM_PROT_WRITE && (orig_l3 & PTE_W) == 0) || + (ftype == VM_PROT_EXECUTE && (orig_l3 & PTE_X) == 0) || + (ftype == VM_PROT_READ && (orig_l3 & PTE_R) == 0)) goto done; new_l3 = orig_l3 | PTE_A; - if ((prot & VM_PROT_WRITE) != 0) + if (ftype == VM_PROT_WRITE) new_l3 |= PTE_D; if (orig_l3 != new_l3) { @@ -2000,7 +2001,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - new_l3 = PTE_V | PTE_R | PTE_X | PTE_A; + new_l3 = PTE_V | PTE_R | PTE_A; + if (prot & VM_PROT_EXECUTE) + new_l3 |= PTE_X; if (flags & VM_PROT_WRITE) new_l3 |= PTE_D; if (prot & VM_PROT_WRITE) @@ -2372,7 +2375,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_R | PTE_X); + entry = PTE_V | PTE_R; + if (prot & VM_PROT_EXECUTE) + entry |= PTE_X; entry |= (pn << PTE_PPN0_S); /* Modified: stable/12/sys/riscv/riscv/trap.c ============================================================================== --- stable/12/sys/riscv/riscv/trap.c Tue Jun 4 17:28:49 2019 (r348640) +++ stable/12/sys/riscv/riscv/trap.c Tue Jun 4 17:29:20 2019 (r348641) @@ -209,9 +209,11 @@ data_abort(struct trapframe *frame, int usermode) if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { - ftype = (VM_PROT_READ | VM_PROT_WRITE); + ftype = VM_PROT_WRITE; + } else if (frame->tf_scause == EXCP_INST_PAGE_FAULT) { + ftype = VM_PROT_EXECUTE; } else { - ftype = (VM_PROT_READ); + ftype = VM_PROT_READ; } if (pmap_fault_fixup(map->pmap, va, ftype)) From owner-svn-src-all@freebsd.org Tue Jun 4 17:29:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7DC815B83B9; Tue, 4 Jun 2019 17:29:48 +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 67ECA7495C; Tue, 4 Jun 2019 17:29:48 +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 3C4BE20AD7; Tue, 4 Jun 2019 17:29:48 +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 x54HTmY2098082; Tue, 4 Jun 2019 17:29:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HTmFl098081; Tue, 4 Jun 2019 17:29:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041729.x54HTmFl098081@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 17:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348642 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67ECA7495C 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:29:49 -0000 Author: markj Date: Tue Jun 4 17:29:47 2019 New Revision: 348642 URL: https://svnweb.freebsd.org/changeset/base/348642 Log: MFC r340159 (by jhb): Rework setting PTE_D for kernel mappings. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:20 2019 (r348641) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:47 2019 (r348642) @@ -2010,13 +2010,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= PTE_W; if ((va >> 63) == 0) new_l3 |= PTE_U; - else if (prot & VM_PROT_WRITE) - new_l3 |= PTE_D; new_l3 |= (pn << PTE_PPN0_S); if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= PTE_SW_WIRED; - if ((m->oflags & VPO_UNMANAGED) == 0) + + /* + * Set modified bit gratuitously for writeable mappings if + * the page is unmanaged. We do not want to take a fault + * to do the dirty bit accounting for these mappings. + */ + if ((m->oflags & VPO_UNMANAGED) != 0) { + if (prot & VM_PROT_WRITE) + new_l3 |= PTE_D; + } else new_l3 |= PTE_SW_MANAGED; CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa); From owner-svn-src-all@freebsd.org Tue Jun 4 17:30:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 604BD15B8449; Tue, 4 Jun 2019 17:30:23 +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 F35E574AA1; Tue, 4 Jun 2019 17:30:22 +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 C4CCA20ADB; Tue, 4 Jun 2019 17:30:22 +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 x54HUMX2098188; Tue, 4 Jun 2019 17:30:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HUMkv098187; Tue, 4 Jun 2019 17:30:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041730.x54HUMkv098187@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 17:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348643 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F35E574AA1 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:30:23 -0000 Author: markj Date: Tue Jun 4 17:30:22 2019 New Revision: 348643 URL: https://svnweb.freebsd.org/changeset/base/348643 Log: MFC r342733: Set PTE_U on PTEs created by pmap_enter_quick(). Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:47 2019 (r348642) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:30:22 2019 (r348643) @@ -2379,19 +2379,14 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap_resident_count_inc(pmap, 1); - pa = VM_PAGE_TO_PHYS(m); - pn = (pa / PAGE_SIZE); - - entry = PTE_V | PTE_R; - if (prot & VM_PROT_EXECUTE) - entry |= PTE_X; - entry |= (pn << PTE_PPN0_S); - - /* - * Now validate mapping with RO protection - */ + newl3 = ((VM_PAGE_TO_PHYS(m) / PAGE_SIZE) << PTE_PPN0_S) | + PTE_V | PTE_R; + if ((prot & VM_PROT_EXECUTE) != 0) + newl3 |= PTE_X; if ((m->oflags & VPO_UNMANAGED) == 0) - entry |= PTE_SW_MANAGED; + newl3 |= PTE_SW_MANAGED; + if (va < VM_MAX_USER_ADDRESS) + newl3 |= PTE_U; /* * Sync the i-cache on all harts before updating the PTE @@ -2400,7 +2395,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_store(l3, entry); + pmap_store(l3, newl3); pmap_invalidate_page(pmap, va); return (mpte); From owner-svn-src-all@freebsd.org Tue Jun 4 17:31:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69E8315B84E9; Tue, 4 Jun 2019 17:31: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 1A11C74C5B; Tue, 4 Jun 2019 17:31: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 D0F6C20B07; Tue, 4 Jun 2019 17:31: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 x54HV65H099084; Tue, 4 Jun 2019 17:31:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HV5RM099075; Tue, 4 Jun 2019 17:31:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041731.x54HV5RM099075@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 17:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348644 - in stable/12/sys: riscv/include riscv/riscv vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: riscv/include riscv/riscv vm X-SVN-Commit-Revision: 348644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A11C74C5B 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:31:07 -0000 Author: markj Date: Tue Jun 4 17:31:05 2019 New Revision: 348644 URL: https://svnweb.freebsd.org/changeset/base/348644 Log: MFC r344106: Implement transparent 2MB superpage promotion for RISC-V. Modified: stable/12/sys/riscv/include/param.h stable/12/sys/riscv/include/pmap.h stable/12/sys/riscv/include/pte.h stable/12/sys/riscv/include/vmparam.h stable/12/sys/riscv/riscv/pmap.c stable/12/sys/vm/vm_fault.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/param.h ============================================================================== --- stable/12/sys/riscv/include/param.h Tue Jun 4 17:30:22 2019 (r348643) +++ stable/12/sys/riscv/include/param.h Tue Jun 4 17:31:05 2019 (r348644) @@ -82,7 +82,7 @@ #define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */ #define PAGE_MASK (PAGE_SIZE - 1) -#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ +#define MAXPAGESIZES 3 /* maximum number of supported page sizes */ #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ Modified: stable/12/sys/riscv/include/pmap.h ============================================================================== --- stable/12/sys/riscv/include/pmap.h Tue Jun 4 17:30:22 2019 (r348643) +++ stable/12/sys/riscv/include/pmap.h Tue Jun 4 17:31:05 2019 (r348644) @@ -44,6 +44,8 @@ #include #include +#include + #ifdef _KERNEL #define vtophys(va) pmap_kextract((vm_offset_t)(va)) @@ -80,6 +82,7 @@ struct pmap { pd_entry_t *pm_l1; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ + struct vm_radix pm_root; }; typedef struct pv_entry { @@ -139,6 +142,7 @@ void pmap_kenter_device(vm_offset_t, vm_size_t, vm_pad vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +bool pmap_ps_enabled(pmap_t); void *pmap_mapdev(vm_offset_t, vm_size_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); Modified: stable/12/sys/riscv/include/pte.h ============================================================================== --- stable/12/sys/riscv/include/pte.h Tue Jun 4 17:30:22 2019 (r348643) +++ stable/12/sys/riscv/include/pte.h Tue Jun 4 17:31:05 2019 (r348644) @@ -62,7 +62,8 @@ typedef uint64_t pn_t; /* page number */ #define L3_SIZE (1 << L3_SHIFT) #define L3_OFFSET (L3_SIZE - 1) -#define Ln_ENTRIES (1 << 9) +#define Ln_ENTRIES_SHIFT 9 +#define Ln_ENTRIES (1 << Ln_ENTRIES_SHIFT) #define Ln_ADDR_MASK (Ln_ENTRIES - 1) /* Bits 9:8 are reserved for software */ @@ -79,6 +80,8 @@ typedef uint64_t pn_t; /* page number */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) #define PTE_KERN (PTE_V | PTE_R | PTE_W | PTE_A | PTE_D) +#define PTE_PROMOTE (PTE_V | PTE_RWX | PTE_D | PTE_A | PTE_G | PTE_U | \ + PTE_SW_MANAGED | PTE_SW_WIRED) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: stable/12/sys/riscv/include/vmparam.h ============================================================================== --- stable/12/sys/riscv/include/vmparam.h Tue Jun 4 17:30:22 2019 (r348643) +++ stable/12/sys/riscv/include/vmparam.h Tue Jun 4 17:31:05 2019 (r348644) @@ -99,10 +99,10 @@ #define VM_NFREEORDER 12 /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 #endif /* Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:30:22 2019 (r348643) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:31:05 2019 (r348644) @@ -118,6 +118,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -145,6 +146,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -154,9 +156,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t))) -#define NUPDE (NPDEPG * NPDEPG) -#define NUSERPGTBLS (NUPDE + NPDEPG) +#define NUL1E (Ln_ENTRIES * Ln_ENTRIES) +#define NUL2E (Ln_ENTRIES * NUL1E) #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ @@ -175,11 +176,12 @@ __FBSDID("$FreeBSD$"); #endif #define pmap_l2_pindex(v) ((v) >> L2_SHIFT) +#define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) #define NPV_LIST_LOCKS MAXCPU #define PHYS_TO_PV_LIST_LOCK(pa) \ - (&pv_list_locks[pa_index(pa) % NPV_LIST_LOCKS]) + (&pv_list_locks[pmap_l2_pindex(pa) % NPV_LIST_LOCKS]) #define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ struct rwlock **_lockp = (lockp); \ @@ -230,13 +232,52 @@ CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ static struct rwlock_padalign pvh_global_lock; static struct mtx_padalign allpmaps_lock; +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, + "VM/pmap parameters"); + +static int superpages_enabled = 1; +SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, + CTLFLAG_RDTUN, &superpages_enabled, 0, + "Enable support for transparent superpages"); + +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, + "2MB page mapping counters"); + +static u_long pmap_l2_demotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_l2_demotions, 0, + "2MB page demotions"); + +static u_long pmap_l2_mappings; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, mappings, CTLFLAG_RD, + &pmap_l2_mappings, 0, + "2MB page mappings"); + +static u_long pmap_l2_p_failures; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, p_failures, CTLFLAG_RD, + &pmap_l2_p_failures, 0, + "2MB page promotion failures"); + +static u_long pmap_l2_promotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD, + &pmap_l2_promotions, 0, + "2MB page promotions"); + /* * Data for the pv entry allocation mechanism */ static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static struct mtx pv_chunks_mutex; static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; +static struct md_page *pv_table; +static struct md_page pv_dummy; +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); @@ -244,6 +285,11 @@ static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static bool pmap_demote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va); +static bool pmap_demote_l2_locked(pmap_t pmap, pd_entry_t *l2, + vm_offset_t va, struct rwlock **lockp); +static int pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, + u_int flags, vm_page_t m, struct rwlock **lockp); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, @@ -254,9 +300,9 @@ static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); -static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); -static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); +static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); #define pmap_clear(pte) pmap_store(pte, 0) #define pmap_clear_bits(pte, bits) atomic_clear_64(pte, bits) @@ -636,7 +682,8 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - int i; + vm_size_t s; + int i, pv_npg; /* * Initialize the pv chunk and pmap list mutexes. @@ -649,6 +696,24 @@ pmap_init(void) */ for (i = 0; i < NPV_LIST_LOCKS; i++) rw_init(&pv_list_locks[i], "pmap pv list"); + + /* + * Calculate the size of the pv head table for superpages. + */ + pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, L2_SIZE); + + /* + * Allocate memory for the pv head table for superpages. + */ + s = (vm_size_t)(pv_npg * sizeof(struct md_page)); + s = round_page(s); + pv_table = (struct md_page *)kmem_malloc(s, M_WAITOK | M_ZERO); + for (i = 0; i < pv_npg; i++) + TAILQ_INIT(&pv_table[i].pv_list); + TAILQ_INIT(&pv_dummy.pv_list); + + if (superpages_enabled) + pagesizes[1] = L2_SIZE; } #ifdef SMP @@ -999,6 +1064,13 @@ pmap_qremove(vm_offset_t sva, int count) pmap_invalidate_range(kernel_pmap, sva, va); } +bool +pmap_ps_enabled(pmap_t pmap __unused) +{ + + return (superpages_enabled); +} + /*************************************************** * Page table page management routines..... ***************************************************/ @@ -1018,6 +1090,34 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist m->flags &= ~PG_ZERO; SLIST_INSERT_HEAD(free, m, plinks.s.ss); } + +/* + * Inserts the specified page table page into the specified pmap's collection + * of idle page table pages. Each of a pmap's page table pages is responsible + * for mapping a distinct range of virtual addresses. The pmap's collection is + * ordered by this virtual address range. + */ +static __inline int +pmap_insert_pt_page(pmap_t pmap, vm_page_t ml3) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_insert(&pmap->pm_root, ml3)); +} + +/* + * Removes the page table page mapping the specified virtual address from the + * specified pmap's collection of idle page table pages, and returns it. + * Otherwise, returns NULL if there is no page table page corresponding to the + * specified virtual address. + */ +static __inline vm_page_t +pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_remove(&pmap->pm_root, pmap_l2_pindex(va))); +} /* * Decrements a page table page's wire count, which is used to record the @@ -1026,12 +1126,12 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist * page table page was unmapped and FALSE otherwise. */ static inline boolean_t -pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) { --m->wire_count; if (m->wire_count == 0) { - _pmap_unwire_l3(pmap, va, m, free); + _pmap_unwire_ptp(pmap, va, m, free); return (TRUE); } else { return (FALSE); @@ -1039,36 +1139,30 @@ pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } static void -_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +_pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) { vm_paddr_t phys; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - /* - * unmap the page table page - */ - if (m->pindex >= NUPDE) { - /* PD page */ + if (m->pindex >= NUL1E) { pd_entry_t *l1; l1 = pmap_l1(pmap, va); pmap_clear(l1); pmap_distribute_l1(pmap, pmap_l1_index(va), 0); } else { - /* PTE page */ pd_entry_t *l2; l2 = pmap_l2(pmap, va); pmap_clear(l2); } pmap_resident_count_dec(pmap, 1); - if (m->pindex < NUPDE) { + if (m->pindex < NUL1E) { pd_entry_t *l1; - /* We just released a PT, unhold the matching PD */ vm_page_t pdpg; l1 = pmap_l1(pmap, va); phys = PTE_TO_PHYS(pmap_load(l1)); pdpg = PHYS_TO_VM_PAGE(phys); - pmap_unwire_l3(pmap, va, pdpg, free); + pmap_unwire_ptp(pmap, va, pdpg, free); } pmap_invalidate_page(pmap, va); @@ -1082,24 +1176,20 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } /* - * After removing an l3 entry, this routine is used to + * After removing a page table entry, this routine is used to * conditionally free the page, and manage the hold/wire counts. */ static int -pmap_unuse_l3(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, +pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, struct spglist *free) { - vm_paddr_t phys; vm_page_t mpte; if (va >= VM_MAXUSER_ADDRESS) return (0); KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0")); - - phys = PTE_TO_PHYS(ptepde); - - mpte = PHYS_TO_VM_PAGE(phys); - return (pmap_unwire_l3(pmap, va, mpte, free)); + mpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(ptepde)); + return (pmap_unwire_ptp(pmap, va, mpte, free)); } void @@ -1140,6 +1230,8 @@ pmap_pinit(pmap_t pmap) LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); mtx_unlock(&allpmaps_lock); + vm_radix_init(&pmap->pm_root); + return (1); } @@ -1193,11 +1285,11 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str * it isn't already there. */ - if (ptepindex >= NUPDE) { + if (ptepindex >= NUL1E) { pd_entry_t *l1; vm_pindex_t l1index; - l1index = ptepindex - NUPDE; + l1index = ptepindex - NUL1E; l1 = &pmap->pm_l1[l1index]; pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); @@ -1213,7 +1305,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str l1 = &pmap->pm_l1[l1index]; if (pmap_load(l1) == 0) { /* recurse for allocating page dir */ - if (_pmap_alloc_l3(pmap, NUPDE + l1index, + if (_pmap_alloc_l3(pmap, NUL1E + l1index, lockp) == NULL) { vm_page_unwire_noq(m); vm_page_free_zero(m); @@ -1241,6 +1333,29 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str } static vm_page_t +pmap_alloc_l2(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) +{ + pd_entry_t *l1; + vm_page_t l2pg; + vm_pindex_t l2pindex; + +retry: + l1 = pmap_l1(pmap, va); + if (l1 != NULL && (pmap_load(l1) & PTE_RWX) == 0) { + /* Add a reference to the L2 page. */ + l2pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l1))); + l2pg->wire_count++; + } else { + /* Allocate a L2 page. */ + l2pindex = pmap_l2_pindex(va) >> Ln_ENTRIES_SHIFT; + l2pg = _pmap_alloc_l3(pmap, NUL2E + l2pindex, lockp); + if (l2pg == NULL && lockp != NULL) + goto retry; + } + return (l2pg); +} + +static vm_page_t pmap_alloc_l3(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t ptepindex; @@ -1599,6 +1714,79 @@ retry: } /* + * Ensure that the number of spare PV entries in the specified pmap meets or + * exceeds the given count, "needed". + * + * The given PV list lock may be released. + */ +static void +reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp) +{ + struct pch new_tail; + struct pv_chunk *pc; + vm_page_t m; + int avail, free; + bool reclaimed; + + rw_assert(&pvh_global_lock, RA_LOCKED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); + + /* + * Newly allocated PV chunks must be stored in a private list until + * the required number of PV chunks have been allocated. Otherwise, + * reclaim_pv_chunk() could recycle one of these chunks. In + * contrast, these chunks must be added to the pmap upon allocation. + */ + TAILQ_INIT(&new_tail); +retry: + avail = 0; + TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { + bit_count((bitstr_t *)pc->pc_map, 0, + sizeof(pc->pc_map) * NBBY, &free); + if (free == 0) + break; + avail += free; + if (avail >= needed) + break; + } + for (reclaimed = false; avail < needed; avail += _NPCPV) { + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED); + if (m == NULL) { + m = reclaim_pv_chunk(pmap, lockp); + if (m == NULL) + goto retry; + reclaimed = true; + } + /* XXX PV STATS */ +#if 0 + dump_add_page(m->phys_addr); +#endif + pc = (void *)PHYS_TO_DMAP(m->phys_addr); + pc->pc_pmap = pmap; + pc->pc_map[0] = PC_FREE0; + pc->pc_map[1] = PC_FREE1; + pc->pc_map[2] = PC_FREE2; + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + + /* + * The reclaim might have freed a chunk from the current pmap. + * If that chunk contained available entries, we need to + * re-count the number of available entries. + */ + if (reclaimed) + goto retry; + } + if (!TAILQ_EMPTY(&new_tail)) { + mtx_lock(&pv_chunks_mutex); + TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + mtx_unlock(&pv_chunks_mutex); + } +} + +/* * First find and then remove the pv entry for the specified pmap and virtual * address from the specified pv list. Returns the pv entry if found and NULL * otherwise. This operation can be performed on pv lists for either 4KB or @@ -1632,7 +1820,7 @@ pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_off pv = pmap_pvh_remove(pvh, pmap, va); - KASSERT(pv != NULL, ("pmap_pvh_free: pv not found")); + KASSERT(pv != NULL, ("pmap_pvh_free: pv not found for %#lx", va)); free_pv_entry(pmap, pv); } @@ -1660,6 +1848,222 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, } /* + * After demotion from a 2MB page mapping to 512 4KB page mappings, + * destroy the pv entry for the 2MB page mapping and reinstantiate the pv + * entries for each of the 4KB page mappings. + */ +static void __unused +pmap_pv_demote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + struct pv_chunk *pc; + pv_entry_t pv; + vm_page_t m; + vm_offset_t va_last; + int bit, field; + + rw_assert(&pvh_global_lock, RA_LOCKED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + /* + * Transfer the 2mpage's pv entry for this mapping to the first + * page's pv list. Once this transfer begins, the pv list lock + * must not be released until the last pv entry is reinstantiated. + */ + pvh = pa_to_pvh(pa); + va &= ~L2_OFFSET; + pv = pmap_pvh_remove(pvh, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_demote_l2: pv not found")); + m = PHYS_TO_VM_PAGE(pa); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + /* Instantiate the remaining 511 pv entries. */ + va_last = va + L2_SIZE - PAGE_SIZE; + for (;;) { + pc = TAILQ_FIRST(&pmap->pm_pvchunk); + KASSERT(pc->pc_map[0] != 0 || pc->pc_map[1] != 0 || + pc->pc_map[2] != 0, ("pmap_pv_demote_l2: missing spare")); + for (field = 0; field < _NPCM; field++) { + while (pc->pc_map[field] != 0) { + bit = ffsl(pc->pc_map[field]) - 1; + pc->pc_map[field] &= ~(1ul << bit); + pv = &pc->pc_pventry[field * 64 + bit]; + va += PAGE_SIZE; + pv->pv_va = va; + m++; + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("pmap_pv_demote_l2: page %p is not managed", m)); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + if (va == va_last) + goto out; + } + } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } +out: + if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } + /* XXX PV stats */ +} + +#if VM_NRESERVLEVEL > 0 +static void +pmap_pv_promote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + pv_entry_t pv; + vm_page_t m; + vm_offset_t va_last; + + rw_assert(&pvh_global_lock, RA_LOCKED); + KASSERT((va & L2_OFFSET) == 0, + ("pmap_pv_promote_l2: misaligned va %#lx", va)); + + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + m = PHYS_TO_VM_PAGE(pa); + pv = pmap_pvh_remove(&m->md, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_promote_l2: pv for %#lx not found", va)); + pvh = pa_to_pvh(pa); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + + va_last = va + L2_SIZE - PAGE_SIZE; + do { + m++; + va += PAGE_SIZE; + pmap_pvh_free(&m->md, pmap, va); + } while (va < va_last); +} +#endif /* VM_NRESERVLEVEL > 0 */ + +/* + * Create the PV entry for a 2MB page mapping. Always returns true unless the + * flag PMAP_ENTER_NORECLAIM is specified. If that flag is specified, returns + * false if the PV entry cannot be allocated without resorting to reclamation. + */ +static bool +pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2e, u_int flags, + struct rwlock **lockp) +{ + struct md_page *pvh; + pv_entry_t pv; + vm_paddr_t pa; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* Pass NULL instead of the lock pointer to disable reclamation. */ + if ((pv = get_pv_entry(pmap, (flags & PMAP_ENTER_NORECLAIM) != 0 ? + NULL : lockp)) == NULL) + return (false); + pv->pv_va = va; + pa = PTE_TO_PHYS(l2e); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + pvh = pa_to_pvh(pa); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + return (true); +} + +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | PTE_V; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + +/* + * pmap_remove_l2: Do the things to unmap a level 2 superpage. + */ +static int +pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, + pd_entry_t l1e, struct spglist *free, struct rwlock **lockp) +{ + struct md_page *pvh; + pt_entry_t oldl2; + vm_offset_t eva, va; + vm_page_t m, ml3; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((sva & L2_OFFSET) == 0, ("pmap_remove_l2: sva is not aligned")); + oldl2 = pmap_load_clear(l2); + KASSERT((oldl2 & PTE_RWX) != 0, + ("pmap_remove_l2: L2e %lx is not a superpage mapping", oldl2)); + + /* + * The sfence.vma documentation states that it is sufficient to specify + * a single address within a superpage mapping. However, since we do + * not perform any invalidation upon promotion, TLBs may still be + * caching 4KB mappings within the superpage, so we must invalidate the + * entire range. + */ + pmap_invalidate_range(pmap, sva, sva + L2_SIZE); + if ((oldl2 & PTE_SW_WIRED) != 0) + pmap->pm_stats.wired_count -= L2_SIZE / PAGE_SIZE; + pmap_resident_count_dec(pmap, L2_SIZE / PAGE_SIZE); + if ((oldl2 & PTE_SW_MANAGED) != 0) { + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, PTE_TO_PHYS(oldl2)); + pvh = pa_to_pvh(PTE_TO_PHYS(oldl2)); + pmap_pvh_free(pvh, pmap, sva); + eva = sva + L2_SIZE; + for (va = sva, m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(oldl2)); + va < eva; va += PAGE_SIZE, m++) { + if ((oldl2 & PTE_D) != 0) + vm_page_dirty(m); + if ((oldl2 & PTE_A) != 0) + vm_page_aflag_set(m, PGA_REFERENCED); + if (TAILQ_EMPTY(&m->md.pv_list) && + TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); + } + } + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == Ln_ENTRIES, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } + } + return (pmap_unuse_pt(pmap, sva, l1e, free)); +} + +/* * pmap_remove_l3: do the things to unmap a page in a process */ static int @@ -1687,7 +2091,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ pmap_pvh_free(&m->md, pmap, va); } - return (pmap_unuse_l3(pmap, va, l2e, free)); + return (pmap_unuse_pt(pmap, va, l2e, free)); } /* @@ -1699,11 +2103,11 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { + struct spglist free; struct rwlock *lock; vm_offset_t va, va_next; - pd_entry_t *l1, *l2; - pt_entry_t l3_pte, *l3; - struct spglist free; + pd_entry_t *l1, *l2, l2e; + pt_entry_t *l3; /* * Perform an unsynchronized read. This is, however, safe. @@ -1739,16 +2143,22 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t l2 = pmap_l1_to_l2(l1, sva); if (l2 == NULL) continue; - - l3_pte = pmap_load(l2); - - /* - * Weed out invalid mappings. - */ - if (l3_pte == 0) + if ((l2e = pmap_load(l2)) == 0) continue; - if ((pmap_load(l2) & PTE_RX) != 0) - continue; + if ((l2e & PTE_RWX) != 0) { + if (sva + L2_SIZE == va_next && eva >= va_next) { + (void)pmap_remove_l2(pmap, l2, sva, + pmap_load(l1), &free, &lock); + continue; + } else if (!pmap_demote_l2_locked(pmap, l2, sva, + &lock)) { + /* + * The large page mapping was destroyed. + */ + continue; + } + l2e = pmap_load(l2); + } /* * Limit our scan to either the end of the va represented @@ -1761,8 +2171,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t va = va_next; for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { - if (l3 == NULL) - panic("l3 == NULL"); if (pmap_load(l3) == 0) { if (va != va_next) { pmap_invalidate_range(pmap, va, sva); @@ -1772,8 +2180,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } if (va == va_next) va = sva; - if (pmap_remove_l3(pmap, l3, sva, l3_pte, &free, - &lock)) { + if (pmap_remove_l3(pmap, l3, sva, l2e, &free, &lock)) { sva += L3_SIZE; break; } @@ -1783,7 +2190,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, false); } @@ -1804,42 +2211,54 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t void pmap_remove_all(vm_page_t m) { - pv_entry_t pv; - pmap_t pmap; - pt_entry_t *l3, tl3; - pd_entry_t *l2, tl2; struct spglist free; + struct md_page *pvh; + pmap_t pmap; + pt_entry_t *l3, l3e; + pd_entry_t *l2, l2e; + pv_entry_t pv; + vm_offset_t va; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); + rw_wlock(&pvh_global_lock); + while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { + pmap = PV_PMAP(pv); + PMAP_LOCK(pmap); + va = pv->pv_va; + l2 = pmap_l2(pmap, va); + (void)pmap_demote_l2(pmap, l2, va); + PMAP_UNLOCK(pmap); + } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pmap_resident_count_dec(pmap, 1); l2 = pmap_l2(pmap, pv->pv_va); KASSERT(l2 != NULL, ("pmap_remove_all: no l2 table found")); - tl2 = pmap_load(l2); + l2e = pmap_load(l2); - KASSERT((tl2 & PTE_RX) == 0, - ("pmap_remove_all: found a table when expecting " - "a block in %p's pv list", m)); + KASSERT((l2e & PTE_RX) == 0, + ("pmap_remove_all: found a superpage in %p's pv list", m)); l3 = pmap_l2_to_l3(l2, pv->pv_va); - tl3 = pmap_load_clear(l3); + l3e = pmap_load_clear(l3); pmap_invalidate_page(pmap, pv->pv_va); - if (tl3 & PTE_SW_WIRED) + if (l3e & PTE_SW_WIRED) pmap->pm_stats.wired_count--; - if ((tl3 & PTE_A) != 0) + if ((l3e & PTE_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); /* * Update the vm_page_t clean and reference bits. */ - if ((tl3 & PTE_D) != 0) + if ((l3e & PTE_D) != 0) vm_page_dirty(m); - pmap_unuse_l3(pmap, pv->pv_va, pmap_load(l2), &free); + pmap_unuse_pt(pmap, pv->pv_va, pmap_load(l2), &free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; free_pv_entry(pmap, pv); @@ -1857,10 +2276,12 @@ pmap_remove_all(vm_page_t m) void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - pd_entry_t *l1, *l2; + pd_entry_t *l1, *l2, l2e; pt_entry_t *l3, l3e, mask; vm_page_t m; - vm_offset_t va_next; + vm_paddr_t pa; + vm_offset_t va, va_next; + bool anychanged, pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -1871,12 +2292,14 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t (VM_PROT_WRITE | VM_PROT_EXECUTE)) return; + anychanged = false; + pv_lists_locked = false; mask = 0; if ((prot & VM_PROT_WRITE) == 0) mask |= PTE_W | PTE_D; if ((prot & VM_PROT_EXECUTE) == 0) mask |= PTE_X; - +resume: PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1 = pmap_l1(pmap, sva); @@ -1892,10 +2315,41 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL || pmap_load(l2) == 0) + if (l2 == NULL || (l2e = pmap_load(l2)) == 0) continue; - if ((pmap_load(l2) & PTE_RX) != 0) - continue; + if ((l2e & PTE_RWX) != 0) { + if (sva + L2_SIZE == va_next && eva >= va_next) { +retryl2: + if ((l2e & (PTE_SW_MANAGED | PTE_D)) == + (PTE_SW_MANAGED | PTE_D)) { + pa = PTE_TO_PHYS(l2e); + for (va = sva, m = PHYS_TO_VM_PAGE(pa); + va < va_next; m++, va += PAGE_SIZE) + vm_page_dirty(m); + } + if (!atomic_fcmpset_long(l2, &l2e, l2e & ~mask)) + goto retryl2; + anychanged = true; + } else { + if (!pv_lists_locked) { + pv_lists_locked = true; + if (!rw_try_rlock(&pvh_global_lock)) { + if (anychanged) + pmap_invalidate_all( + pmap); + PMAP_UNLOCK(pmap); + rw_rlock(&pvh_global_lock); + goto resume; + } + } + if (!pmap_demote_l2(pmap, l2, sva)) { + /* + * The large page mapping was destroyed. + */ + continue; + } + } + } if (va_next > eva) va_next = eva; @@ -1903,7 +2357,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { l3e = pmap_load(l3); -retry: +retryl3: if ((l3e & PTE_V) == 0) continue; if ((prot & VM_PROT_WRITE) == 0 && @@ -1913,60 +2367,236 @@ retry: vm_page_dirty(m); } if (!atomic_fcmpset_long(l3, &l3e, l3e & ~mask)) - goto retry; - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, sva); + goto retryl3; + anychanged = true; } } + if (anychanged) + pmap_invalidate_all(pmap); + if (pv_lists_locked) + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } int pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype) { - pt_entry_t orig_l3; - pt_entry_t new_l3; - pt_entry_t *l3; + pd_entry_t *l2, l2e; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 4 17:31:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 851AD15B8575; Tue, 4 Jun 2019 17:31: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 29B2F74DD0; Tue, 4 Jun 2019 17:31:30 +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 F3E3420B26; Tue, 4 Jun 2019 17:31: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 x54HVT0r001509; Tue, 4 Jun 2019 17:31:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HVTfJ001508; Tue, 4 Jun 2019 17:31:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041731.x54HVTfJ001508@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 17:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348645 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29B2F74DD0 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:31:30 -0000 Author: markj Date: Tue Jun 4 17:31:29 2019 New Revision: 348645 URL: https://svnweb.freebsd.org/changeset/base/348645 Log: MFC r344107: Implement pmap_clear_modify() for RISC-V. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:31:05 2019 (r348644) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:31:29 2019 (r348645) @@ -4074,6 +4074,14 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t void pmap_clear_modify(vm_page_t m) { + struct md_page *pvh; + struct rwlock *lock; + pmap_t pmap; + pv_entry_t next_pv, pv; + pd_entry_t *l2, oldl2; + pt_entry_t *l3, oldl3; + vm_offset_t va; + int md_gen, pvh_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); @@ -4088,8 +4096,78 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - - /* RISCVTODO: We lack support for tracking if a page is modified */ + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(&pvh_global_lock); + rw_wlock(lock); +restart: + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + va = pv->pv_va; + l2 = pmap_l2(pmap, va); + oldl2 = pmap_load(l2); + if ((oldl2 & PTE_W) != 0) { + if (pmap_demote_l2_locked(pmap, l2, va, &lock)) { + if ((oldl2 & PTE_SW_WIRED) == 0) { + /* + * Write protect the mapping to a + * single page so that a subsequent + * write access may repromote. + */ + va += VM_PAGE_TO_PHYS(m) - + PTE_TO_PHYS(oldl2); + l3 = pmap_l2_to_l3(l2, va); + oldl3 = pmap_load(l3); + if ((oldl3 & PTE_V) != 0) { + while (!atomic_fcmpset_long(l3, + &oldl3, oldl3 & ~(PTE_D | + PTE_W))) + cpu_spinwait(); + vm_page_dirty(m); + pmap_invalidate_page(pmap, va); + } + } + } + } + PMAP_UNLOCK(pmap); + } + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + l2 = pmap_l2(pmap, pv->pv_va); + KASSERT((pmap_load(l2) & PTE_RWX) == 0, + ("pmap_clear_modify: found a 2mpage in page %p's pv list", + m)); + l3 = pmap_l2_to_l3(l2, pv->pv_va); + if ((pmap_load(l3) & (PTE_D | PTE_W)) == (PTE_D | PTE_W)) { + pmap_clear_bits(l3, PTE_D); + pmap_invalidate_page(pmap, pv->pv_va); + } + PMAP_UNLOCK(pmap); + } + rw_wunlock(lock); + rw_runlock(&pvh_global_lock); } void * From owner-svn-src-all@freebsd.org Tue Jun 4 17:32:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A14A15B85E3; Tue, 4 Jun 2019 17:32: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 1E4EA75087; Tue, 4 Jun 2019 17:32:02 +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 EFA4020C57; Tue, 4 Jun 2019 17:32: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 x54HW1tX002319; Tue, 4 Jun 2019 17:32:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HW0Ql002308; Tue, 4 Jun 2019 17:32:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041732.x54HW0Ql002308@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 17:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348646 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 348646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E4EA75087 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:32:02 -0000 Author: markj Date: Tue Jun 4 17:31:59 2019 New Revision: 348646 URL: https://svnweb.freebsd.org/changeset/base/348646 Log: MFC r344108: Implement per-CPU pmap activation tracking for RISC-V. Modified: stable/12/sys/riscv/include/pcb.h stable/12/sys/riscv/include/pcpu.h stable/12/sys/riscv/include/pmap.h stable/12/sys/riscv/riscv/genassym.c stable/12/sys/riscv/riscv/machdep.c stable/12/sys/riscv/riscv/mp_machdep.c stable/12/sys/riscv/riscv/pmap.c stable/12/sys/riscv/riscv/swtch.S stable/12/sys/riscv/riscv/vm_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/pcb.h ============================================================================== --- stable/12/sys/riscv/include/pcb.h Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/include/pcb.h Tue Jun 4 17:31:59 2019 (r348646) @@ -55,7 +55,6 @@ struct pcb { #define PCB_FP_STARTED 0x1 #define PCB_FP_USERMASK 0x1 uint64_t pcb_sepc; /* Supervisor exception pc */ - vm_offset_t pcb_l1addr; /* L1 page tables base address */ vm_offset_t pcb_onfault; /* Copyinout fault handler */ }; Modified: stable/12/sys/riscv/include/pcpu.h ============================================================================== --- stable/12/sys/riscv/include/pcpu.h Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/include/pcpu.h Tue Jun 4 17:31:59 2019 (r348646) @@ -45,6 +45,7 @@ #define ALT_STACK_SIZE 128 #define PCPU_MD_FIELDS \ + struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ char __pad[61] Modified: stable/12/sys/riscv/include/pmap.h ============================================================================== --- stable/12/sys/riscv/include/pmap.h Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/include/pmap.h Tue Jun 4 17:31:59 2019 (r348646) @@ -41,6 +41,7 @@ #ifndef LOCORE #include +#include #include #include @@ -80,6 +81,8 @@ struct pmap { struct mtx pm_mtx; struct pmap_statistics pm_stats; /* pmap statictics */ pd_entry_t *pm_l1; + u_long pm_satp; /* value for SATP register */ + cpuset_t pm_active; /* active on cpus */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ struct vm_radix pm_root; @@ -137,6 +140,10 @@ extern vm_offset_t virtual_end; #define L1_MAPPABLE_P(va, pa, size) \ ((((va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE) +struct thread; + +void pmap_activate_boot(pmap_t); +void pmap_activate_sw(struct thread *); void pmap_bootstrap(vm_offset_t, vm_paddr_t, vm_size_t); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); Modified: stable/12/sys/riscv/riscv/genassym.c ============================================================================== --- stable/12/sys/riscv/riscv/genassym.c Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/genassym.c Tue Jun 4 17:31:59 2019 (r348646) @@ -63,7 +63,6 @@ ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); -ASSYM(PCB_L1ADDR, offsetof(struct pcb, pcb_l1addr)); ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_RA, offsetof(struct pcb, pcb_ra)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:31:59 2019 (r348646) @@ -878,10 +878,6 @@ initriscv(struct riscv_bootparams *rvbp) init_proc0(rvbp->kern_stack); - /* set page table base register for thread0 */ - thread0.td_pcb->pcb_l1addr = \ - (rvbp->kern_l1pt - KERNBASE + rvbp->kern_phys); - msgbufinit(msgbufp, msgbufsize); mutex_init(); init_param2(physmem); Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:31:59 2019 (r348646) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -254,6 +255,9 @@ init_secondary(uint64_t cpu) /* Enable external (PLIC) interrupts */ csr_set(sie, SIE_SEIE); + + /* Activate process 0's pmap. */ + pmap_activate_boot(vmspace_pmap(proc0.p_vmspace)); mtx_lock_spin(&ap_boot_mtx); Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:31:59 2019 (r348646) @@ -118,9 +118,10 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include -#include +#include #include #include #include @@ -566,6 +567,8 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, rw_init(&pvh_global_lock, "pmap pv global"); + CPU_FILL(&kernel_pmap->pm_active); + /* Assume the address we were loaded to is a valid physical address. */ min_pa = max_pa = kernstart; @@ -723,9 +726,6 @@ pmap_init(void) * In general, the calling thread uses a plain fence to order the * writes to the page tables before invoking an SBI callback to invoke * sfence_vma() on remote CPUs. - * - * Since the riscv pmap does not yet have a pm_active field, IPIs are - * sent to all CPUs in the system. */ static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) @@ -733,10 +733,11 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) cpuset_t mask; sched_pin(); - mask = all_cpus; + mask = pmap->pm_active; CPU_CLR(PCPU_GET(cpuid), &mask); fence(); - sbi_remote_sfence_vma(mask.__bits, va, 1); + if (!CPU_EMPTY(&mask) && smp_started) + sbi_remote_sfence_vma(mask.__bits, va, 1); sfence_vma_page(va); sched_unpin(); } @@ -747,10 +748,11 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm cpuset_t mask; sched_pin(); - mask = all_cpus; + mask = pmap->pm_active; CPU_CLR(PCPU_GET(cpuid), &mask); fence(); - sbi_remote_sfence_vma(mask.__bits, sva, eva - sva + 1); + if (!CPU_EMPTY(&mask) && smp_started) + sbi_remote_sfence_vma(mask.__bits, sva, eva - sva + 1); /* * Might consider a loop of sfence_vma_page() for a small @@ -766,16 +768,17 @@ pmap_invalidate_all(pmap_t pmap) cpuset_t mask; sched_pin(); - mask = all_cpus; + mask = pmap->pm_active; CPU_CLR(PCPU_GET(cpuid), &mask); - fence(); /* * XXX: The SBI doc doesn't detail how to specify x0 as the * address to perform a global fence. BBL currently treats * all sfence_vma requests as global however. */ - sbi_remote_sfence_vma(mask.__bits, 0, 0); + fence(); + if (!CPU_EMPTY(&mask) && smp_started) + sbi_remote_sfence_vma(mask.__bits, 0, 0); sfence_vma(); sched_unpin(); } @@ -1199,6 +1202,9 @@ pmap_pinit0(pmap_t pmap) PMAP_LOCK_INIT(pmap); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l1 = kernel_pmap->pm_l1; + pmap->pm_satp = SATP_MODE_SV39 | (vtophys(pmap->pm_l1) >> PAGE_SHIFT); + CPU_ZERO(&pmap->pm_active); + pmap_activate_boot(pmap); } int @@ -1216,12 +1222,15 @@ pmap_pinit(pmap_t pmap) l1phys = VM_PAGE_TO_PHYS(l1pt); pmap->pm_l1 = (pd_entry_t *)PHYS_TO_DMAP(l1phys); + pmap->pm_satp = SATP_MODE_SV39 | (l1phys >> PAGE_SHIFT); if ((l1pt->flags & PG_ZERO) == 0) pagezero(pmap->pm_l1); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); + CPU_ZERO(&pmap->pm_active); + /* Install kernel pagetables */ memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); @@ -1411,6 +1420,8 @@ pmap_release(pmap_t pmap) KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); + KASSERT(CPU_EMPTY(&pmap->pm_active), + ("releasing active pmap %p", pmap)); mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); @@ -4242,26 +4253,56 @@ done: } void -pmap_activate(struct thread *td) +pmap_activate_sw(struct thread *td) { - pmap_t pmap; - uint64_t reg; + pmap_t oldpmap, pmap; + u_int cpu; - critical_enter(); + oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); - td->td_pcb->pcb_l1addr = vtophys(pmap->pm_l1); + if (pmap == oldpmap) + return; + load_satp(pmap->pm_satp); - reg = SATP_MODE_SV39; - reg |= (td->td_pcb->pcb_l1addr >> PAGE_SHIFT); - load_satp(reg); + cpu = PCPU_GET(cpuid); +#ifdef SMP + CPU_SET_ATOMIC(cpu, &pmap->pm_active); + CPU_CLR_ATOMIC(cpu, &oldpmap->pm_active); +#else + CPU_SET(cpu, &pmap->pm_active); + CPU_CLR(cpu, &oldpmap->pm_active); +#endif + PCPU_SET(curpmap, pmap); - pmap_invalidate_all(pmap); + sfence_vma(); +} + +void +pmap_activate(struct thread *td) +{ + + critical_enter(); + pmap_activate_sw(td); critical_exit(); } void -pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +pmap_activate_boot(pmap_t pmap) { + u_int cpu; + + cpu = PCPU_GET(cpuid); +#ifdef SMP + CPU_SET_ATOMIC(cpu, &pmap->pm_active); +#else + CPU_SET(cpu, &pmap->pm_active); +#endif + PCPU_SET(curpmap, pmap); +} + +void +pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz) +{ cpuset_t mask; /* @@ -4276,7 +4317,8 @@ pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &mask); fence(); - sbi_remote_fence_i(mask.__bits); + if (!CPU_EMPTY(&mask) && smp_started) + sbi_remote_fence_i(mask.__bits); sched_unpin(); } Modified: stable/12/sys/riscv/riscv/swtch.S ============================================================================== --- stable/12/sys/riscv/riscv/swtch.S Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/swtch.S Tue Jun 4 17:31:59 2019 (r348646) @@ -207,28 +207,21 @@ ENTRY(fpe_state_clear) END(fpe_state_clear) /* - * void cpu_throw(struct thread *old, struct thread *new) + * void cpu_throw(struct thread *old __unused, struct thread *new) */ ENTRY(cpu_throw) + /* Activate the new thread's pmap. */ + mv s0, a1 + mv a0, a1 + call _C_LABEL(pmap_activate_sw) + mv a0, s0 + /* Store the new curthread */ - sd a1, PC_CURTHREAD(gp) + sd a0, PC_CURTHREAD(gp) /* And the new pcb */ - ld x13, TD_PCB(a1) + ld x13, TD_PCB(a0) sd x13, PC_CURPCB(gp) - sfence.vma - - /* Switch to the new pmap */ - ld t0, PCB_L1ADDR(x13) - srli t0, t0, PAGE_SHIFT - li t1, SATP_MODE_SV39 - or t0, t0, t1 - csrw satp, t0 - - /* TODO: Invalidate the TLB */ - - sfence.vma - /* Load registers */ ld ra, (PCB_RA)(x13) ld sp, (PCB_SP)(x13) @@ -250,7 +243,7 @@ ENTRY(cpu_throw) #ifdef FPE /* Is FPE enabled for new thread? */ - ld t0, TD_FRAME(a1) + ld t0, TD_FRAME(a0) ld t1, (TF_SSTATUS)(t0) li t2, SSTATUS_FS_MASK and t3, t1, t2 @@ -324,38 +317,27 @@ ENTRY(cpu_switch) 1: #endif - /* - * Restore the saved context. - */ - ld x13, TD_PCB(a1) + /* Activate the new thread's pmap */ + mv s0, a0 + mv s1, a1 + mv s2, a2 + mv a0, a1 + call _C_LABEL(pmap_activate_sw) + mv a1, s1 - /* - * TODO: We may need to flush the cache here if switching - * to a user process. - */ - - sfence.vma - - /* Switch to the new pmap */ - ld t0, PCB_L1ADDR(x13) - srli t0, t0, PAGE_SHIFT - li t1, SATP_MODE_SV39 - or t0, t0, t1 - csrw satp, t0 - - /* TODO: Invalidate the TLB */ - - sfence.vma - /* Release the old thread */ - sd a2, TD_LOCK(a0) + sd s2, TD_LOCK(s0) #if defined(SCHED_ULE) && defined(SMP) /* Spin if TD_LOCK points to a blocked_lock */ - la a2, _C_LABEL(blocked_lock) + la s2, _C_LABEL(blocked_lock) 1: ld t0, TD_LOCK(a1) - beq t0, a2, 1b + beq t0, s2, 1b #endif + /* + * Restore the saved context. + */ + ld x13, TD_PCB(a1) /* Restore the registers */ ld tp, (PCB_TP)(x13) Modified: stable/12/sys/riscv/riscv/vm_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/vm_machdep.c Tue Jun 4 17:31:29 2019 (r348645) +++ stable/12/sys/riscv/riscv/vm_machdep.c Tue Jun 4 17:31:59 2019 (r348646) @@ -92,9 +92,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t td2->td_pcb = pcb2; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); - td2->td_pcb->pcb_l1addr = - vtophys(vmspace_pmap(td2->td_proc->p_vmspace)->pm_l1); - tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); bcopy(td1->td_frame, tf, sizeof(*tf)); From owner-svn-src-all@freebsd.org Tue Jun 4 17:37:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FBF915B8899; Tue, 4 Jun 2019 17:37:21 +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 124CC752B1; Tue, 4 Jun 2019 17:37:21 +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 D715320C7C; Tue, 4 Jun 2019 17:37: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 x54HbKxS003615; Tue, 4 Jun 2019 17:37:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HbKMh003614; Tue, 4 Jun 2019 17:37:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041737.x54HbKMh003614@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 17:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348647 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 124CC752B1 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.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:37:21 -0000 Author: markj Date: Tue Jun 4 17:37:20 2019 New Revision: 348647 URL: https://svnweb.freebsd.org/changeset/base/348647 Log: MFC r340027 (by jhb): Don't allow debuggers to modify SSTATUS, only to read it. Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:31:59 2019 (r348646) +++ stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:37:20 2019 (r348647) @@ -178,7 +178,6 @@ set_regs(struct thread *td, struct reg *regs) frame = td->td_frame; frame->tf_sepc = regs->sepc; - frame->tf_sstatus = regs->sstatus; frame->tf_ra = regs->ra; frame->tf_sp = regs->sp; frame->tf_gp = regs->gp; From owner-svn-src-all@freebsd.org Tue Jun 4 17:37:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE9915B88FB; Tue, 4 Jun 2019 17:37:51 +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 3DD51753C1; Tue, 4 Jun 2019 17:37:51 +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 1845C20C7E; Tue, 4 Jun 2019 17:37:51 +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 x54HboNo003682; Tue, 4 Jun 2019 17:37:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Hbo8a003680; Tue, 4 Jun 2019 17:37:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906041737.x54Hbo8a003680@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 17:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348648 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 348648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DD51753C1 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:37:51 -0000 Author: markj Date: Tue Jun 4 17:37:50 2019 New Revision: 348648 URL: https://svnweb.freebsd.org/changeset/base/348648 Log: MFC r340028 (by jhb): SBI calls expect a pointer to a u_long rather than a pointer. Modified: stable/12/sys/riscv/riscv/intr_machdep.c stable/12/sys/riscv/riscv/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/intr_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/intr_machdep.c Tue Jun 4 17:37:20 2019 (r348647) +++ stable/12/sys/riscv/riscv/intr_machdep.c Tue Jun 4 17:37:50 2019 (r348648) @@ -202,7 +202,7 @@ riscv_unmask_ipi(void) static void ipi_send(struct pcpu *pc, int ipi) { - uintptr_t mask; + u_long mask; CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); @@ -242,7 +242,7 @@ void ipi_selected(cpuset_t cpus, u_int ipi) { struct pcpu *pc; - uintptr_t mask; + u_long mask; CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi); Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:37:20 2019 (r348647) +++ stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:37:50 2019 (r348648) @@ -182,7 +182,7 @@ riscv64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - uintptr_t mask; + u_long mask; int cpu, i; if (mp_ncpus == 1) From owner-svn-src-all@freebsd.org Tue Jun 4 17:39:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6C7615B89D1; Tue, 4 Jun 2019 17:39:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 699BF7556A; Tue, 4 Jun 2019 17:39:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556F620C7F; Tue, 4 Jun 2019 17:39:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54Hdmhv003825; Tue, 4 Jun 2019 17:39:48 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HdlSC003820; Tue, 4 Jun 2019 17:39:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041739.x54HdlSC003820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 17:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348649 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 348649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 699BF7556A 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:39:49 -0000 Author: br Date: Tue Jun 4 17:39:46 2019 New Revision: 348649 URL: https://svnweb.freebsd.org/changeset/base/348649 Log: MFC r347514: Add support for HiFive Unleashed -- the board with a multi-core RISC-V SoC from SiFive, Inc. The first core on this SoC (hart 0) is a 64-bit microcontroller. o Pick a hart to run boot process using hart lottery. This allows to exclude hart 0 from running the boot process. (BBL releases hart 0 after the main harts, so it never wins the lottery). o Renumber CPUs early on boot. Exclude non-MMU cores. Store the original hart ID in struct pcpu. This allows to find out the correct destination for IPIs and remote sfence calls. Thanks to SiFive, Inc for the board provided. Sponsored by: DARPA, AFRL Modified: stable/12/sys/riscv/include/pcpu.h stable/12/sys/riscv/riscv/intr_machdep.c stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/machdep.c stable/12/sys/riscv/riscv/mp_machdep.c stable/12/sys/riscv/riscv/pmap.c Modified: stable/12/sys/riscv/include/pcpu.h ============================================================================== --- stable/12/sys/riscv/include/pcpu.h Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/include/pcpu.h Tue Jun 4 17:39:46 2019 (r348649) @@ -47,7 +47,8 @@ #define PCPU_MD_FIELDS \ struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ - char __pad[61] + uint32_t pc_hart; /* Hart ID */ \ + char __pad[57] #ifdef _KERNEL Modified: stable/12/sys/riscv/riscv/intr_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/intr_machdep.c Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/riscv/intr_machdep.c Tue Jun 4 17:39:46 2019 (r348649) @@ -207,7 +207,7 @@ ipi_send(struct pcpu *pc, int ipi) CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); - mask = (1 << (pc->pc_cpuid)); + mask = (1 << pc->pc_hart); sbi_send_ipi(&mask); @@ -252,7 +252,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) CTR3(KTR_SMP, "%s: pc: %p, ipi: %x\n", __func__, pc, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); - mask |= (1 << (pc->pc_cpuid)); + mask |= (1 << pc->pc_hart); } } sbi_send_ipi(&mask); Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/riscv/locore.S Tue Jun 4 17:39:46 2019 (r348649) @@ -59,12 +59,18 @@ _start: sub t1, t1, t0 li t2, KERNBASE sub s9, t2, t1 /* s9 = physmem base */ - mv s10, a0 /* s10 = hart id */ - mv s11, a1 /* s11 = dtbp */ - /* Direct secondary cores to mpentry */ - bnez s10, mpentry + /* + * a0 = hart id + * a1 = dtbp + */ + /* Pick a hart to run the boot process. */ + la t0, hart_lottery + li t1, 1 + amoadd.w t0, t1, 0(t0) + bnez t0, mpentry + /* * Page tables */ @@ -123,7 +129,7 @@ _start: /* Create an L2 page superpage for DTB */ la s1, pagetable_l2_devmap - mv s2, s11 + mv s2, a1 srli s2, s2, PAGE_SHIFT li t0, (PTE_KERN) @@ -171,13 +177,19 @@ va: addi sp, sp, -PCB_SIZE /* Clear BSS */ - la a0, _C_LABEL(__bss_start) + la s0, _C_LABEL(__bss_start) la s1, _C_LABEL(_end) 1: - sd zero, 0(a0) - addi a0, a0, 8 - bltu a0, s1, 1b + sd zero, 0(s0) + addi s0, s0, 8 + bltu s0, s1, 1b +#ifdef SMP + /* Store boot hart id. */ + la t0, boot_hart + sw a0, 0(t0) +#endif + /* Fill riscv_bootparams */ addi sp, sp, -40 @@ -190,7 +202,7 @@ va: li t0, (VM_MAX_KERNEL_ADDRESS - 2 * L2_SIZE) sd t0, 24(sp) /* dtbp_virt */ - sd s11, 32(sp) /* dtbp_phys */ + sd a1, 32(sp) /* dtbp_phys */ mv a0, sp call _C_LABEL(initriscv) /* Off we go */ @@ -233,9 +245,11 @@ pagetable_l2: pagetable_l2_devmap: .space PAGE_SIZE - .align 3 + .align 3 virt_map: - .quad virt_map + .quad virt_map +hart_lottery: + .space 4 /* Not in use, but required for linking. */ .align 3 @@ -278,7 +292,8 @@ ENTRY(mpentry) /* Setup stack pointer */ la t0, secondary_stacks li t1, (PAGE_SIZE * KSTACK_PAGES) - mulw t1, t1, s10 + mulw t2, t1, a0 + add t0, t0, t2 add t0, t0, t1 sub t0, t0, s9 li t1, KERNBASE Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 17:39:46 2019 (r348649) @@ -117,6 +117,9 @@ int64_t dcache_line_size; /* The minimum D cache line int64_t icache_line_size; /* The minimum I cache line size */ int64_t idcache_line_size; /* The minimum cache line size */ +uint32_t boot_hart; /* The hart we booted on. */ +cpuset_t all_harts; + extern int *end; extern int *initstack_end; @@ -858,6 +861,7 @@ initriscv(struct riscv_bootparams *rvbp) /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); + pcpup->pc_hart = boot_hart; /* Set the pcpu pointer */ __asm __volatile("mv gp, %0" :: "r"(pcpup)); Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/riscv/mp_machdep.c Tue Jun 4 17:39:46 2019 (r348649) @@ -91,6 +91,9 @@ static int ipi_handler(void *); struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; +extern uint32_t boot_hart; +extern cpuset_t all_harts; + #ifdef INVARIANTS static uint32_t cpu_reg[MAXCPU][2]; #endif @@ -99,7 +102,7 @@ static device_t cpu_list[MAXCPU]; void mpentry(unsigned long cpuid); void init_secondary(uint64_t); -uint8_t secondary_stacks[MAXCPU - 1][PAGE_SIZE * KSTACK_PAGES] __aligned(16); +uint8_t secondary_stacks[MAXCPU][PAGE_SIZE * KSTACK_PAGES] __aligned(16); /* Set to 1 once we're ready to let the APs out of the pen. */ volatile int aps_ready = 0; @@ -182,7 +185,7 @@ riscv64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - u_long mask; + cpuset_t mask; int cpu, i; if (mp_ncpus == 1) @@ -194,15 +197,13 @@ release_aps(void *dummy __unused) atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ - mask = 0; + mask = all_harts; + CPU_CLR(boot_hart, &mask); - for (i = 1; i < mp_ncpus; i++) - mask |= (1 << i); - - sbi_send_ipi(&mask); - printf("Release APs\n"); + sbi_send_ipi(mask.__bits); + for (i = 0; i < 2000; i++) { if (smp_started) { for (cpu = 0; cpu <= mp_maxid; cpu++) { @@ -219,12 +220,19 @@ release_aps(void *dummy __unused) SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, release_aps, NULL); void -init_secondary(uint64_t cpu) +init_secondary(uint64_t hart) { struct pcpu *pcpup; + u_int cpuid; + /* Renumber this cpu */ + cpuid = hart; + if (cpuid < boot_hart) + cpuid += mp_maxid + 1; + cpuid -= boot_hart; + /* Setup the pcpu pointer */ - pcpup = &__pcpu[cpu]; + pcpup = &__pcpu[cpuid]; __asm __volatile("mv gp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ @@ -366,11 +374,12 @@ cpu_mp_probe(void) static boolean_t cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) { - uint64_t target_cpu; struct pcpu *pcpup; + uint64_t hart; + u_int cpuid; - /* Check we are able to start this cpu */ - if (id > mp_maxid) + /* Check if this hart supports MMU. */ + if (OF_getproplen(node, "mmu-type") < 0) return (0); KASSERT(id < MAXCPU, ("Too many CPUs")); @@ -382,29 +391,44 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size cpu_reg[id][1] = reg[1]; #endif - target_cpu = reg[0]; + hart = reg[0]; if (addr_size == 2) { - target_cpu <<= 32; - target_cpu |= reg[1]; + hart <<= 32; + hart |= reg[1]; } - pcpup = &__pcpu[id]; + KASSERT(hart < MAXCPU, ("Too many harts.")); - /* We are already running on cpu 0 */ - if (id == 0) { + /* We are already running on this cpu */ + if (hart == boot_hart) return (1); - } - pcpu_init(pcpup, id, sizeof(struct pcpu)); + /* + * Rotate the CPU IDs to put the boot CPU as CPU 0. + * We keep the other CPUs ordered. + */ + cpuid = hart; + if (cpuid < boot_hart) + cpuid += mp_maxid + 1; + cpuid -= boot_hart; - dpcpu[id - 1] = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); - dpcpu_init(dpcpu[id - 1], id); + /* Check if we are able to start this cpu */ + if (cpuid > mp_maxid) + return (0); - printf("Starting CPU %u (%lx)\n", id, target_cpu); - __riscv_boot_ap[id] = 1; + pcpup = &__pcpu[cpuid]; + pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); + pcpup->pc_hart = hart; - CPU_SET(id, &all_cpus); + dpcpu[cpuid - 1] = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); + dpcpu_init(dpcpu[cpuid - 1], cpuid); + printf("Starting CPU %u (hart %lx)\n", cpuid, hart); + __riscv_boot_ap[hart] = 1; + + CPU_SET(cpuid, &all_cpus); + CPU_SET(hart, &all_harts); + return (1); } #endif @@ -417,6 +441,7 @@ cpu_mp_start(void) mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); CPU_SET(0, &all_cpus); + CPU_SET(boot_hart, &all_harts); switch(cpu_enum_method) { #ifdef FDT @@ -435,13 +460,24 @@ cpu_mp_announce(void) { } +static boolean_t +cpu_check_mmu(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) +{ + + /* Check if this hart supports MMU. */ + if (OF_getproplen(node, "mmu-type") < 0) + return (0); + + return (1); +} + void cpu_mp_setmaxid(void) { #ifdef FDT int cores; - cores = ofw_cpu_early_foreach(NULL, false); + cores = ofw_cpu_early_foreach(cpu_check_mmu, true); if (cores > 0) { cores = MIN(cores, MAXCPU); if (bootverbose) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:37:50 2019 (r348648) +++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:39:46 2019 (r348649) @@ -273,6 +273,8 @@ static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; static struct md_page *pv_table; static struct md_page pv_dummy; +extern cpuset_t all_harts; + /* * Internal flags for pmap_enter()'s helper functions. */ @@ -734,7 +736,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_sfence_vma(mask.__bits, va, 1); @@ -749,7 +751,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_sfence_vma(mask.__bits, sva, eva - sva + 1); @@ -769,7 +771,7 @@ pmap_invalidate_all(pmap_t pmap) sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); /* * XXX: The SBI doc doesn't detail how to specify x0 as the @@ -4256,7 +4258,7 @@ void pmap_activate_sw(struct thread *td) { pmap_t oldpmap, pmap; - u_int cpu; + u_int hart; oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); @@ -4264,13 +4266,13 @@ pmap_activate_sw(struct thread *td) return; load_satp(pmap->pm_satp); - cpu = PCPU_GET(cpuid); + hart = PCPU_GET(hart); #ifdef SMP - CPU_SET_ATOMIC(cpu, &pmap->pm_active); - CPU_CLR_ATOMIC(cpu, &oldpmap->pm_active); + CPU_SET_ATOMIC(hart, &pmap->pm_active); + CPU_CLR_ATOMIC(hart, &oldpmap->pm_active); #else - CPU_SET(cpu, &pmap->pm_active); - CPU_CLR(cpu, &oldpmap->pm_active); + CPU_SET(hart, &pmap->pm_active); + CPU_CLR(hart, &oldpmap->pm_active); #endif PCPU_SET(curpmap, pmap); @@ -4289,13 +4291,13 @@ pmap_activate(struct thread *td) void pmap_activate_boot(pmap_t pmap) { - u_int cpu; + u_int hart; - cpu = PCPU_GET(cpuid); + hart = PCPU_GET(hart); #ifdef SMP - CPU_SET_ATOMIC(cpu, &pmap->pm_active); + CPU_SET_ATOMIC(hart, &pmap->pm_active); #else - CPU_SET(cpu, &pmap->pm_active); + CPU_SET(hart, &pmap->pm_active); #endif PCPU_SET(curpmap, pmap); } @@ -4314,8 +4316,8 @@ pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_ * FENCE.I." */ sched_pin(); - mask = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &mask); + mask = all_harts; + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_fence_i(mask.__bits); From owner-svn-src-all@freebsd.org Tue Jun 4 17:42:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACB0D15B8C02; Tue, 4 Jun 2019 17:42:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50ED575B16; Tue, 4 Jun 2019 17:42:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24E9220E33; Tue, 4 Jun 2019 17:42:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x54Hgmgg008551; Tue, 4 Jun 2019 17:42:48 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54HgmZD008550; Tue, 4 Jun 2019 17:42:48 GMT (envelope-from br@FreeBSD.org) Message-Id: <201906041742.x54HgmZD008550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Jun 2019 17:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348650 - stable/12/sys/dev/xdma X-SVN-Group: stable-12 X-SVN-Commit-Author: br X-SVN-Commit-Paths: stable/12/sys/dev/xdma X-SVN-Commit-Revision: 348650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50ED575B16 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 17:42:48 -0000 Author: br Date: Tue Jun 4 17:42:47 2019 New Revision: 348650 URL: https://svnweb.freebsd.org/changeset/base/348650 Log: MFC r348364: Don't copy the data from bounce buffer back to the mbuf if channel does not use bounce buffering. Sponsored by: DARPA, AFRL Modified: stable/12/sys/dev/xdma/xdma_sg.c Modified: stable/12/sys/dev/xdma/xdma_sg.c ============================================================================== --- stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 17:39:46 2019 (r348649) +++ stable/12/sys/dev/xdma/xdma_sg.c Tue Jun 4 17:42:47 2019 (r348650) @@ -345,7 +345,8 @@ xchan_seg_done(xdma_channel_t *xchan, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(xchan->dma_tag_bufs, b->map); } else { - if (xr->req_type == XR_TYPE_MBUF && + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 && + xr->req_type == XR_TYPE_MBUF && xr->direction == XDMA_DEV_TO_MEM) m_copyback(xr->m, 0, st->transferred, (void *)xr->buf.vaddr); From owner-svn-src-all@freebsd.org Tue Jun 4 17:44:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 17:46:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:11:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C89715B9873; Tue, 4 Jun 2019 18:11:13 +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 B533B76BD8; Tue, 4 Jun 2019 18:11:12 +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 8EAB6212C7; Tue, 4 Jun 2019 18:11:12 +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 x54IBCQS022130; Tue, 4 Jun 2019 18:11:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54IBC2t022129; Tue, 4 Jun 2019 18:11:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906041811.x54IBC2t022129@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:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348651 - stable/12/sys/dev/vt/hw/efifb X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/dev/vt/hw/efifb X-SVN-Commit-Revision: 348651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B533B76BD8 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.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 18:11:13 -0000 Author: emaste Date: Tue Jun 4 18:11:12 2019 New Revision: 348651 URL: https://svnweb.freebsd.org/changeset/base/348651 Log: MFC r348059: vt efifb: add suspend/resume calls Using the latest NVIDIA driver, upon resuming from suspend with X running the display remained blank. Additionally OpenGL applications that were running triggered a number of error messages from the NVIDIA driver. This occurred because the vt efifb back-end did not signal the X server to release the display before suspending (or to re-acquire it after resuming). The NVIDIA driver includes code for smoothly shutting down and re-initializing the GPU, which was not getting called. Since the NVIDIA driver doesn't currently support framebuffer devices and vt is forced to fall back to the efifb back-end, add vd_suspend and vd_resume members to connect the suspend/resume path. This ensures the X server is properly able to re-initialize the display. PR: 237050 Submitted by: Erik Kurzinger Modified: stable/12/sys/dev/vt/hw/efifb/efifb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- stable/12/sys/dev/vt/hw/efifb/efifb.c Tue Jun 4 17:42:47 2019 (r348650) +++ stable/12/sys/dev/vt/hw/efifb/efifb.c Tue Jun 4 18:11:12 2019 (r348651) @@ -64,6 +64,8 @@ static struct vt_driver vt_efifb_driver = { .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, + .vd_suspend = vt_suspend, + .vd_resume = vt_resume, /* Better than VGA, but still generic driver. */ .vd_priority = VD_PRIORITY_GENERIC + 1, }; From owner-svn-src-all@freebsd.org Tue Jun 4 18:26:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:26:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:29:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:31:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:31:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:34:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:36:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:36:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:38:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:48:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:49:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 18:55:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:06:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:16:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:16:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:22:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 19:22:29 -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-all@freebsd.org Tue Jun 4 19:25:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:37:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:39:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 19:59:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 20:37:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CF3115BCCED; Tue, 4 Jun 2019 20:37:03 +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 A979E8536B; Tue, 4 Jun 2019 20:37:02 +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 84C0422B33; Tue, 4 Jun 2019 20:37:02 +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 x54Kb2YU099603; Tue, 4 Jun 2019 20:37:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54Kb17k099597; Tue, 4 Jun 2019 20:37:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906042037.x54Kb17k099597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Jun 2019 20:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348670 - in stable/12/sys/dev/cxgbe: cxgbei tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: cxgbei tom X-SVN-Commit-Revision: 348670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A979E8536B 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 20:37:03 -0000 Author: np Date: Tue Jun 4 20:37:00 2019 New Revision: 348670 URL: https://svnweb.freebsd.org/changeset/base/348670 Log: MFC r348491: cxgbe/t4_tom: adjust the hardware receive window to match changes to the receive sockbuf's high water mark. Calculate rx credits on the spot instead of tracking sbused/sb_cc and rx_credits in the toepcb. The previous method worked when the high water mark changed due to SB_AUTOSIZE but not when it was adjusted directly (for example, by the soreserve in nfsrvd_addsock). This fixes a connection hang while running iozone over an NFS mounted share where nfsd's TCP sockets are being handled by t4_tom. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c stable/12/sys/dev/cxgbe/tom/t4_connect.c stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c stable/12/sys/dev/cxgbe/tom/t4_ddp.c stable/12/sys/dev/cxgbe/tom/t4_listen.c stable/12/sys/dev/cxgbe/tom/t4_tls.c stable/12/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Jun 4 20:37:00 2019 (r348670) @@ -397,7 +397,6 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he tp->t_rcvtime = ticks; /* update rx credits */ - toep->rx_credits += pdu_len; t4_rcvd(&toep->td->tod, tp); /* XXX: sc->tom_softc.tod */ so = inp->inp_socket; Modified: stable/12/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_connect.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_connect.c Tue Jun 4 20:37:00 2019 (r348670) @@ -385,8 +385,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru toep->vnet = so->so_vnet; set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); SOCKBUF_LOCK(&so->so_rcv); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); + toep->opt0_rcv_bufsize = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); SOCKBUF_UNLOCK(&so->so_rcv); /* @@ -440,7 +439,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } else { struct cpl_act_open_req *cpl = wrtod(wr); @@ -469,7 +468,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Jun 4 20:37:00 2019 (r348670) @@ -399,20 +399,10 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = toep->rx_credits << 10; + tp->rcv_wnd = toep->opt0_rcv_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; - /* - * If we were unable to send all rx credits via opt0, save the remainder - * in rx_credits so that they can be handed over with the next credit - * update. - */ - SOCKBUF_LOCK(&so->so_rcv); - bufsize = select_rcv_wnd(so); - SOCKBUF_UNLOCK(&so->so_rcv); - toep->rx_credits = bufsize - tp->rcv_wnd; - tp->iss = iss; tcp_sendseqinit(tp); tp->snd_una = iss + 1; @@ -483,37 +473,29 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_rcv; struct toepcb *toep = tp->t_toe; - int credits; + int rx_credits; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK_ASSERT(sb); - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - credits = toep->sb_cc - sbused(sb); - toep->sb_cc = sbused(sb); + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; if (toep->ulp_mode == ULP_MODE_TLS) { - if (toep->tls.rcv_over >= credits) { - toep->tls.rcv_over -= credits; - credits = 0; + if (toep->tls.rcv_over >= rx_credits) { + toep->tls.rcv_over -= rx_credits; + rx_credits = 0; } else { - credits -= toep->tls.rcv_over; + rx_credits -= toep->tls.rcv_over; toep->tls.rcv_over = 0; } } - toep->rx_credits += credits; - if (toep->rx_credits > 0 && - (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || - (toep->rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || - toep->sb_cc + tp->rcv_wnd < sb->sb_lowat)) { - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && + (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || + (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || + sbused(sb) + tp->rcv_wnd < sb->sb_lowat)) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } else if (toep->flags & TPF_FORCE_CREDITS) send_rx_modulate(sc, toep); } @@ -1551,7 +1533,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header struct socket *so; struct sockbuf *sb; struct epoch_tracker et; - int len; + int len, rx_credits; uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { @@ -1636,8 +1618,6 @@ do_rx_data(struct sge_iq *iq, const struct rss_header if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } if (toep->ulp_mode == ULP_MODE_TCPDDP) { @@ -1675,19 +1655,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header } } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } if (toep->ulp_mode == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && Modified: stable/12/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_ddp.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_ddp.c Tue Jun 4 20:37:00 2019 (r348670) @@ -304,9 +304,6 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); tp->rcv_wnd -= n; #endif -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += n; -#endif CTR2(KTR_CXGBE, "%s: placed %u bytes before falling out of DDP", __func__, n); while (toep->ddp.active_count > 0) { @@ -555,16 +552,10 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } SOCKBUF_UNLOCK(sb); CURVNET_RESTORE(); -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif - job->msgrcv = 1; if (db->cancel_pending) { /* @@ -713,12 +704,9 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp INP_WLOCK_ASSERT(toep->inp); DDP_ASSERT_LOCKED(toep); - len = be32toh(rcv_nxt) - tp->rcv_nxt; + len = be32toh(rcv_nxt) - tp->rcv_nxt; tp->rcv_nxt += len; -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif while (toep->ddp.active_count > 0) { MPASS(toep->ddp.active_id != -1); Modified: stable/12/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_listen.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_listen.c Tue Jun 4 20:37:00 2019 (r348670) @@ -1400,7 +1400,6 @@ found: mtu_idx = find_best_mtu_idx(sc, &inc, &settings); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); wnd = min(wnd, MAX_RCV_WND); rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); @@ -1552,8 +1551,7 @@ reset: toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; toep->vnet = lctx->vnet; set_ulp_mode(toep, synqe->ulp_mode); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = synqe->rcv_bufsize; + toep->opt0_rcv_bufsize = synqe->rcv_bufsize; MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.c Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.c Tue Jun 4 20:37:00 2019 (r348670) @@ -1457,7 +1457,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head struct socket *so; struct sockbuf *sb; struct mbuf *tls_data; - int len, pdu_length, pdu_overhead, sb_length; + int len, pdu_length, rx_credits; KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); KASSERT(!(toep->flags & TPF_SYNQE), @@ -1561,24 +1561,10 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head } /* - * Not all of the bytes on the wire are included in the socket - * buffer (e.g. the MAC of the TLS record). However, those - * bytes are included in the TCP sequence space. To handle - * this, compute the delta for this TLS record in - * 'pdu_overhead' and treat those bytes as having already been - * "read" by the application for the purposes of expanding the - * window. The meat of the TLS record passed to the - * application ('sb_length') will still not be counted as - * "read" until userland actually reads the bytes. - * - * XXX: Some of the calculations below are probably still not - * really correct. + * Not all of the bytes on the wire are included in the socket buffer + * (e.g. the MAC of the TLS record). However, those bytes are included + * in the TCP sequence space. */ - sb_length = m->m_pkthdr.len; - pdu_overhead = pdu_length - sb_length; - toep->rx_credits += pdu_overhead; - tp->rcv_wnd += pdu_overhead; - tp->rcv_adv += pdu_overhead; /* receive buffer autosize */ MPASS(toep->vnet == so->so_vnet); @@ -1586,34 +1572,25 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && - sb_length > (sbspace(sb) / 8 * 7)) { + m->m_pkthdr.len > (sbspace(sb) / 8 * 7)) { unsigned int hiwat = sb->sb_hiwat; unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); + 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, toep->rx_credits, tp->rcv_wnd); + __func__, tid, pdu_overhead, rx_credits, tp->rcv_wnd); #endif - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } sorwakeup_locked(so); Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tom.h Tue Jun 4 19:59:43 2019 (r348669) +++ stable/12/sys/dev/cxgbe/tom/t4_tom.h Tue Jun 4 20:37:00 2019 (r348670) @@ -180,9 +180,7 @@ struct toepcb { u_int tx_nocompl; /* tx WR credits since last compl request */ u_int plen_nocompl; /* payload since last compl request */ - /* rx credit handling */ - u_int sb_cc; /* last noted value of so_rcv->sb_cc */ - int rx_credits; /* rx credits (in bytes) to be returned to hw */ + int opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ u_int ulp_mode; /* ULP mode */ void *ulpcb; From owner-svn-src-all@freebsd.org Tue Jun 4 20:53:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 21:06:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C9515BD5A4; Tue, 4 Jun 2019 21:06:35 +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 85CAB86273; Tue, 4 Jun 2019 21:06:35 +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 4694A23047; Tue, 4 Jun 2019 21:06:35 +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 x54L6ZPb015198; Tue, 4 Jun 2019 21:06:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x54L6YoD015195; Tue, 4 Jun 2019 21:06:34 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906042106.x54L6YoD015195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Jun 2019 21:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348672 - in stable/12/sys/dev/cxgbe: common tom X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: common tom X-SVN-Commit-Revision: 348672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85CAB86273 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 21:06:36 -0000 Author: np Date: Tue Jun 4 21:06:34 2019 New Revision: 348672 URL: https://svnweb.freebsd.org/changeset/base/348672 Log: MFC r346570, r348440 r346570: cxgbe/t4_tom: Add a "TCB history" feature that samples hardware state for a tid and maintains a running history of some interesting events. Service TCP_INFO queries from the history when the tid is being tracked there. r348440: cxgbe/t4_tom: Do not attempt to look up entries in the TCB history if it hasn't been initialized. This fixes a bug in r346570 that could cause a panic when servicing TCP_INFO for offloaded connections. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/t4_msg.h stable/12/sys/dev/cxgbe/tom/t4_tom.c stable/12/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_msg.h Tue Jun 4 20:53:35 2019 (r348671) +++ stable/12/sys/dev/cxgbe/common/t4_msg.h Tue Jun 4 21:06:34 2019 (r348672) @@ -923,7 +923,8 @@ struct cpl_get_tcb { WR_HDR; union opcode_tid ot; __be16 reply_ctrl; - __be16 cookie; + __u8 rsvd; + __u8 cookie; }; /* cpl_get_tcb.reply_ctrl fields */ Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tom.c Tue Jun 4 20:53:35 2019 (r348671) +++ stable/12/sys/dev/cxgbe/tom/t4_tom.c Tue Jun 4 21:06:34 2019 (r348672) @@ -386,55 +386,355 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int } } -static inline int -get_tcb_bit(u_char *tcb, int bit) +static inline uint64_t +get_tcb_tflags(const uint64_t *tcb) { - int ix, shift; - ix = 127 - (bit >> 3); - shift = bit & 0x7; - - return ((tcb[ix] >> shift) & 1); + return ((be64toh(tcb[14]) << 32) | (be64toh(tcb[15]) >> 32)); } -static inline uint64_t -get_tcb_bits(u_char *tcb, int hi, int lo) +static inline uint32_t +get_tcb_field(const uint64_t *tcb, u_int word, uint32_t mask, u_int shift) { - uint64_t rc = 0; +#define LAST_WORD ((TCB_SIZE / 4) - 1) + uint64_t t1, t2; + int flit_idx; - while (hi >= lo) { - rc = (rc << 1) | get_tcb_bit(tcb, hi); - --hi; + MPASS(mask != 0); + MPASS(word <= LAST_WORD); + MPASS(shift < 32); + + flit_idx = (LAST_WORD - word) / 2; + if (word & 0x1) + shift += 32; + t1 = be64toh(tcb[flit_idx]) >> shift; + t2 = 0; + if (fls(mask) > 64 - shift) { + /* + * Will spill over into the next logical flit, which is the flit + * before this one. The flit_idx before this one must be valid. + */ + MPASS(flit_idx > 0); + t2 = be64toh(tcb[flit_idx - 1]) << (64 - shift); } + return ((t2 | t1) & mask); +#undef LAST_WORD +} +#define GET_TCB_FIELD(tcb, F) \ + get_tcb_field(tcb, W_TCB_##F, M_TCB_##F, S_TCB_##F) +/* + * Issues a CPL_GET_TCB to read the entire TCB for the tid. + */ +static int +send_get_tcb(struct adapter *sc, u_int tid) +{ + struct cpl_get_tcb *cpl; + struct wrq_cookie cookie; + + MPASS(tid < sc->tids.ntids); + + cpl = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*cpl), 16), + &cookie); + if (__predict_false(cpl == NULL)) + return (ENOMEM); + bzero(cpl, sizeof(*cpl)); + INIT_TP_WR(cpl, tid); + OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_GET_TCB, tid)); + cpl->reply_ctrl = htobe16(V_REPLY_CHAN(0) | + V_QUEUENO(sc->sge.ofld_rxq[0].iq.cntxt_id)); + cpl->cookie = 0xff; + commit_wrq_wr(&sc->sge.ctrlq[0], cpl, &cookie); + + return (0); +} + +static struct tcb_histent * +alloc_tcb_histent(struct adapter *sc, u_int tid, int flags) +{ + struct tcb_histent *te; + + MPASS(flags == M_NOWAIT || flags == M_WAITOK); + + te = malloc(sizeof(*te), M_CXGBE, M_ZERO | flags); + if (te == NULL) + return (NULL); + mtx_init(&te->te_lock, "TCB entry", NULL, MTX_DEF); + callout_init_mtx(&te->te_callout, &te->te_lock, 0); + te->te_adapter = sc; + te->te_tid = tid; + + return (te); +} + +static void +free_tcb_histent(struct tcb_histent *te) +{ + + mtx_destroy(&te->te_lock); + free(te, M_CXGBE); +} + +/* + * Start tracking the tid in the TCB history. + */ +int +add_tid_to_history(struct adapter *sc, u_int tid) +{ + struct tcb_histent *te = NULL; + struct tom_data *td = sc->tom_softc; + int rc; + + MPASS(tid < sc->tids.ntids); + + if (td->tcb_history == NULL) + return (ENXIO); + + rw_wlock(&td->tcb_history_lock); + if (td->tcb_history[tid] != NULL) { + rc = EEXIST; + goto done; + } + te = alloc_tcb_histent(sc, tid, M_NOWAIT); + if (te == NULL) { + rc = ENOMEM; + goto done; + } + mtx_lock(&te->te_lock); + rc = send_get_tcb(sc, tid); + if (rc == 0) { + te->te_flags |= TE_RPL_PENDING; + td->tcb_history[tid] = te; + } else { + free(te, M_CXGBE); + } + mtx_unlock(&te->te_lock); +done: + rw_wunlock(&td->tcb_history_lock); return (rc); } +static void +remove_tcb_histent(struct tcb_histent *te) +{ + struct adapter *sc = te->te_adapter; + struct tom_data *td = sc->tom_softc; + + rw_assert(&td->tcb_history_lock, RA_WLOCKED); + mtx_assert(&te->te_lock, MA_OWNED); + MPASS(td->tcb_history[te->te_tid] == te); + + td->tcb_history[te->te_tid] = NULL; + free_tcb_histent(te); + rw_wunlock(&td->tcb_history_lock); +} + +static inline struct tcb_histent * +lookup_tcb_histent(struct adapter *sc, u_int tid, bool addrem) +{ + struct tcb_histent *te; + struct tom_data *td = sc->tom_softc; + + MPASS(tid < sc->tids.ntids); + + if (td->tcb_history == NULL) + return (NULL); + + if (addrem) + rw_wlock(&td->tcb_history_lock); + else + rw_rlock(&td->tcb_history_lock); + te = td->tcb_history[tid]; + if (te != NULL) { + mtx_lock(&te->te_lock); + return (te); /* with both locks held */ + } + if (addrem) + rw_wunlock(&td->tcb_history_lock); + else + rw_runlock(&td->tcb_history_lock); + + return (te); +} + +static inline void +release_tcb_histent(struct tcb_histent *te) +{ + struct adapter *sc = te->te_adapter; + struct tom_data *td = sc->tom_softc; + + mtx_assert(&te->te_lock, MA_OWNED); + mtx_unlock(&te->te_lock); + rw_assert(&td->tcb_history_lock, RA_RLOCKED); + rw_runlock(&td->tcb_history_lock); +} + +static void +request_tcb(void *arg) +{ + struct tcb_histent *te = arg; + + mtx_assert(&te->te_lock, MA_OWNED); + + /* Noone else is supposed to update the histent. */ + MPASS(!(te->te_flags & TE_RPL_PENDING)); + if (send_get_tcb(te->te_adapter, te->te_tid) == 0) + te->te_flags |= TE_RPL_PENDING; + else + callout_schedule(&te->te_callout, hz / 100); +} + +static void +update_tcb_histent(struct tcb_histent *te, const uint64_t *tcb) +{ + struct tom_data *td = te->te_adapter->tom_softc; + uint64_t tflags = get_tcb_tflags(tcb); + uint8_t sample = 0; + + if (GET_TCB_FIELD(tcb, SND_MAX_RAW) != GET_TCB_FIELD(tcb, SND_UNA_RAW)) { + if (GET_TCB_FIELD(tcb, T_RXTSHIFT) != 0) + sample |= TS_RTO; + if (GET_TCB_FIELD(tcb, T_DUPACKS) != 0) + sample |= TS_DUPACKS; + if (GET_TCB_FIELD(tcb, T_DUPACKS) >= td->dupack_threshold) + sample |= TS_FASTREXMT; + } + + if (GET_TCB_FIELD(tcb, SND_MAX_RAW) != 0) { + uint32_t snd_wnd; + + sample |= TS_SND_BACKLOGGED; /* for whatever reason. */ + + snd_wnd = GET_TCB_FIELD(tcb, RCV_ADV); + if (tflags & V_TF_RECV_SCALE(1)) + snd_wnd <<= GET_TCB_FIELD(tcb, RCV_SCALE); + if (GET_TCB_FIELD(tcb, SND_CWND) < snd_wnd) + sample |= TS_CWND_LIMITED; /* maybe due to CWND */ + } + + if (tflags & V_TF_CCTRL_ECN(1)) { + + /* + * CE marker on incoming IP hdr, echoing ECE back in the TCP + * hdr. Indicates congestion somewhere on the way from the peer + * to this node. + */ + if (tflags & V_TF_CCTRL_ECE(1)) + sample |= TS_ECN_ECE; + + /* + * ECE seen and CWR sent (or about to be sent). Might indicate + * congestion on the way to the peer. This node is reducing its + * congestion window in response. + */ + if (tflags & (V_TF_CCTRL_CWR(1) | V_TF_CCTRL_RFR(1))) + sample |= TS_ECN_CWR; + } + + te->te_sample[te->te_pidx] = sample; + if (++te->te_pidx == nitems(te->te_sample)) + te->te_pidx = 0; + memcpy(te->te_tcb, tcb, TCB_SIZE); + te->te_flags |= TE_ACTIVE; +} + +static int +do_get_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_get_tcb_rpl *cpl = mtod(m, const void *); + const uint64_t *tcb = (const uint64_t *)(const void *)(cpl + 1); + struct tcb_histent *te; + const u_int tid = GET_TID(cpl); + bool remove; + + remove = GET_TCB_FIELD(tcb, T_STATE) == TCPS_CLOSED; + te = lookup_tcb_histent(sc, tid, remove); + if (te == NULL) { + /* Not in the history. Who issued the GET_TCB for this? */ + device_printf(sc->dev, "tcb %u: flags 0x%016jx, state %u, " + "srtt %u, sscale %u, rscale %u, cookie 0x%x\n", tid, + (uintmax_t)get_tcb_tflags(tcb), GET_TCB_FIELD(tcb, T_STATE), + GET_TCB_FIELD(tcb, T_SRTT), GET_TCB_FIELD(tcb, SND_SCALE), + GET_TCB_FIELD(tcb, RCV_SCALE), cpl->cookie); + goto done; + } + + MPASS(te->te_flags & TE_RPL_PENDING); + te->te_flags &= ~TE_RPL_PENDING; + if (remove) { + remove_tcb_histent(te); + } else { + update_tcb_histent(te, tcb); + callout_reset(&te->te_callout, hz / 10, request_tcb, te); + release_tcb_histent(te); + } +done: + m_freem(m); + return (0); +} + +static void +fill_tcp_info_from_tcb(struct adapter *sc, uint64_t *tcb, struct tcp_info *ti) +{ + uint32_t v; + + ti->tcpi_state = GET_TCB_FIELD(tcb, T_STATE); + + v = GET_TCB_FIELD(tcb, T_SRTT); + ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + + v = GET_TCB_FIELD(tcb, T_RTTVAR); + ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); + + ti->tcpi_snd_ssthresh = GET_TCB_FIELD(tcb, SND_SSTHRESH); + ti->tcpi_snd_cwnd = GET_TCB_FIELD(tcb, SND_CWND); + ti->tcpi_rcv_nxt = GET_TCB_FIELD(tcb, RCV_NXT); + + v = GET_TCB_FIELD(tcb, TX_MAX); + ti->tcpi_snd_nxt = v - GET_TCB_FIELD(tcb, SND_NXT_RAW); + + /* Receive window being advertised by us. */ + ti->tcpi_rcv_wscale = GET_TCB_FIELD(tcb, SND_SCALE); /* Yes, SND. */ + ti->tcpi_rcv_space = GET_TCB_FIELD(tcb, RCV_WND); + + /* Send window */ + ti->tcpi_snd_wscale = GET_TCB_FIELD(tcb, RCV_SCALE); /* Yes, RCV. */ + ti->tcpi_snd_wnd = GET_TCB_FIELD(tcb, RCV_ADV); + if (get_tcb_tflags(tcb) & V_TF_RECV_SCALE(1)) + ti->tcpi_snd_wnd <<= ti->tcpi_snd_wscale; + else + ti->tcpi_snd_wscale = 0; + +} + +static void +fill_tcp_info_from_history(struct adapter *sc, struct tcb_histent *te, + struct tcp_info *ti) +{ + + fill_tcp_info_from_tcb(sc, te->te_tcb, ti); +} + /* - * Called by the kernel to allow the TOE driver to "refine" values filled up in - * the tcp_info for an offloaded connection. + * Reads the TCB for the given tid using a memory window and copies it to 'buf' + * in the same format as CPL_GET_TCB_RPL. */ static void -t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +read_tcb_using_memwin(struct adapter *sc, u_int tid, uint64_t *buf) { int i, j, k, rc; - struct adapter *sc = tod->tod_softc; - struct toepcb *toep = tp->t_toe; - uint32_t addr, v; - uint32_t buf[TCB_SIZE / sizeof(uint32_t)]; + uint32_t addr; u_char *tcb, tmp; - INP_WLOCK_ASSERT(tp->t_inpcb); - MPASS(ti != NULL); + MPASS(tid < sc->tids.ntids); - ti->tcpi_toe_tid = toep->tid; - - addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + toep->tid * TCB_SIZE; - rc = read_via_memwin(sc, 2, addr, &buf[0], TCB_SIZE); + addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + tid * TCB_SIZE; + rc = read_via_memwin(sc, 2, addr, (uint32_t *)buf, TCB_SIZE); if (rc != 0) return; - tcb = (u_char *)&buf[0]; + tcb = (u_char *)buf; for (i = 0, j = TCB_SIZE - 16; i < j; i += 16, j -= 16) { for (k = 0; k < 16; k++) { tmp = tcb[i + k]; @@ -442,28 +742,42 @@ t4_tcp_info(struct toedev *tod, struct tcpcb *tp, stru tcb[j + k] = tmp; } } +} - ti->tcpi_state = get_tcb_bits(tcb, 115, 112); +static void +fill_tcp_info(struct adapter *sc, u_int tid, struct tcp_info *ti) +{ + uint64_t tcb[TCB_SIZE / sizeof(uint64_t)]; + struct tcb_histent *te; - v = get_tcb_bits(tcb, 271, 256); - ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + ti->tcpi_toe_tid = tid; + te = lookup_tcb_histent(sc, tid, false); + if (te != NULL) { + fill_tcp_info_from_history(sc, te, ti); + release_tcb_histent(te); + } else { + if (!(sc->debug_flags & DF_DISABLE_TCB_CACHE)) { + /* XXX: tell firmware to flush TCB cache. */ + } + read_tcb_using_memwin(sc, tid, tcb); + fill_tcp_info_from_tcb(sc, tcb, ti); + } +} - v = get_tcb_bits(tcb, 287, 272); - ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); +/* + * Called by the kernel to allow the TOE driver to "refine" values filled up in + * the tcp_info for an offloaded connection. + */ +static void +t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +{ + struct adapter *sc = tod->tod_softc; + struct toepcb *toep = tp->t_toe; - ti->tcpi_snd_ssthresh = get_tcb_bits(tcb, 487, 460); - ti->tcpi_snd_cwnd = get_tcb_bits(tcb, 459, 432); - ti->tcpi_rcv_nxt = get_tcb_bits(tcb, 553, 522); + INP_WLOCK_ASSERT(tp->t_inpcb); + MPASS(ti != NULL); - ti->tcpi_snd_nxt = get_tcb_bits(tcb, 319, 288) - - get_tcb_bits(tcb, 375, 348); - - /* Receive window being advertised by us. */ - ti->tcpi_rcv_space = get_tcb_bits(tcb, 581, 554); - - /* Send window ceiling. */ - v = get_tcb_bits(tcb, 159, 144) << get_tcb_bits(tcb, 131, 128); - ti->tcpi_snd_wnd = min(v, ti->tcpi_snd_cwnd); + fill_tcp_info(sc, toep->tid, ti); } /* @@ -807,6 +1121,35 @@ failed: return (rc); } +static inline void +alloc_tcb_history(struct adapter *sc, struct tom_data *td) +{ + + if (sc->tids.ntids == 0 || sc->tids.ntids > 1024) + return; + rw_init(&td->tcb_history_lock, "TCB history"); + td->tcb_history = malloc(sc->tids.ntids * sizeof(*td->tcb_history), + M_CXGBE, M_ZERO | M_NOWAIT); + td->dupack_threshold = G_DUPACKTHRESH(t4_read_reg(sc, A_TP_PARA_REG0)); +} + +static inline void +free_tcb_history(struct adapter *sc, struct tom_data *td) +{ +#ifdef INVARIANTS + int i; + + if (td->tcb_history != NULL) { + for (i = 0; i < sc->tids.ntids; i++) { + MPASS(td->tcb_history[i] == NULL); + } + } +#endif + free(td->tcb_history, M_CXGBE); + if (rw_initialized(&td->tcb_history_lock)) + rw_destroy(&td->tcb_history_lock); +} + static void free_tom_data(struct adapter *sc, struct tom_data *td) { @@ -830,6 +1173,7 @@ free_tom_data(struct adapter *sc, struct tom_data *td) if (mtx_initialized(&td->toep_list_lock)) mtx_destroy(&td->toep_list_lock); + free_tcb_history(sc, td); free_tid_tabs(&sc->tids); free(td, M_CXGBE); } @@ -1097,6 +1441,8 @@ t4_tom_activate(struct adapter *sc) t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK, V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask); + alloc_tcb_history(sc, td); + /* toedev ops */ tod = &td->tod; init_toedev(tod); @@ -1214,6 +1560,7 @@ t4_tom_mod_load(void) struct protosw *tcp_protosw, *tcp6_protosw; /* CPL handlers */ + t4_register_cpl_handler(CPL_GET_TCB_RPL, do_get_tcb_rpl); t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl2, CPL_COOKIE_TOM); t4_init_connect_cpl_handlers(); Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tom.h Tue Jun 4 20:53:35 2019 (r348671) +++ stable/12/sys/dev/cxgbe/tom/t4_tom.h Tue Jun 4 21:06:34 2019 (r348672) @@ -33,6 +33,7 @@ #ifndef __T4_TOM_H__ #define __T4_TOM_H__ #include +#include "common/t4_hw.h" #include "tom/t4_tls.h" #define LISTEN_HASH_SIZE 32 @@ -252,6 +253,31 @@ struct listen_ctx { struct clip_entry *ce; }; +/* tcb_histent flags */ +#define TE_RPL_PENDING 1 +#define TE_ACTIVE 2 + +/* bits in one 8b tcb_histent sample. */ +#define TS_RTO (1 << 0) +#define TS_DUPACKS (1 << 1) +#define TS_FASTREXMT (1 << 2) +#define TS_SND_BACKLOGGED (1 << 3) +#define TS_CWND_LIMITED (1 << 4) +#define TS_ECN_ECE (1 << 5) +#define TS_ECN_CWR (1 << 6) +#define TS_RESERVED (1 << 7) /* Unused. */ + +struct tcb_histent { + struct mtx te_lock; + struct callout te_callout; + uint64_t te_tcb[TCB_SIZE / sizeof(uint64_t)]; + struct adapter *te_adapter; + u_int te_flags; + u_int te_tid; + uint8_t te_pidx; + uint8_t te_sample[100]; +}; + struct tom_data { struct toedev tod; @@ -266,6 +292,10 @@ struct tom_data { struct ppod_region pr; + struct rwlock tcb_history_lock __aligned(CACHE_LINE_SIZE); + struct tcb_histent **tcb_history; + int dupack_threshold; + /* WRs that will not be sent to the chip because L2 resolution failed */ struct mtx unsent_wr_lock; STAILQ_HEAD(, wrqe) unsent_wr_list; @@ -324,6 +354,7 @@ int select_ulp_mode(struct socket *, struct adapter *, struct offload_settings *); void set_ulp_mode(struct toepcb *, int); int negative_advice(int); +int add_tid_to_history(struct adapter *, u_int); /* t4_connect.c */ void t4_init_connect_cpl_handlers(void); From owner-svn-src-all@freebsd.org Tue Jun 4 21:54:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 21:57:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Tue Jun 4 22:51:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 00:04:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 00:07:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 00:08:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 00:51:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B5B315C12E4; Wed, 5 Jun 2019 00:51:52 +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 D49F68C32F; Wed, 5 Jun 2019 00:51:51 +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 B09C7256CD; Wed, 5 Jun 2019 00:51:51 +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 x550pppP033999; Wed, 5 Jun 2019 00:51:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x550pp8A033998; Wed, 5 Jun 2019 00:51:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906050051.x550pp8A033998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Jun 2019 00:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348676 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D49F68C32F 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 00:51:52 -0000 Author: mav Date: Wed Jun 5 00:51:51 2019 New Revision: 348676 URL: https://svnweb.freebsd.org/changeset/base/348676 Log: MFC r348117: Allocate buffers smaller then ABD chunk size as linear. This allows to reduce memory waste by letting UMA to put multiple small buffers into one memory page slab. The page sharing means that UMA may not be able to free memory page when some of buffers are freed, but alternatively memory used by that buffer would just be wasted from the beginning. This change follows alike change in ZoL, but unlike Linux (according to my understanding of it from comments) FreeBSD never shares slabs bigger then one memory page, so this should be even less invasive then there. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Jun 5 00:08:30 2019 (r348675) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Jun 5 00:51:51 2019 (r348676) @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) abd_t * abd_alloc(size_t size, boolean_t is_metadata) { - if (!zfs_abd_scatter_enabled) + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) return (abd_alloc_linear(size, is_metadata)); VERIFY3U(size, <=, SPA_MAXBLOCKSIZE); From owner-svn-src-all@freebsd.org Wed Jun 5 00:55:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 01:31:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 01:35:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 02:21:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 02:34:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 03:40:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 04:01:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 04:58:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 06:00:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A83715C6587 for ; Wed, 5 Jun 2019 06:00:41 +0000 (UTC) (envelope-from sobomax@sippysoft.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 EAB846D3D2 for ; Wed, 5 Jun 2019 06:00:39 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io1-f65.google.com with SMTP id k8so19352755iot.1 for ; Tue, 04 Jun 2019 23:00:39 -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=rUkglG4h2UYzzM1yTJ7YaIj56EqbP7ecTLILNAl9aZXMS+E7VP+Fs5HiQWWDvIkVyH oV2r94/qZKBk0tvEBon5J37Eh+Y50Am7EICi2+kNKmCjI6excAUSaJVGe/CErsxQkdsV Dm92QuQuVrjWcXIYR9zCaci2vPZOeiE0dbTooum3rviz753ILFRWT9mCrg22SaU1i2Ns kfQ+92FNIWdbWY9cji2fze37VHYidvnSTMXuKDF05IgOw4NLCZ8Zbmb0v/Q5uFUk/Hhs hJup255z8VTv6nVQdDB3KKvsgtletKvnVicFBlJ5ptJ56cqEXO3xALJ0v29M4Yzbcc6/ +6eA== X-Gm-Message-State: APjAAAXz73Mu47kx+klFjx/pIasQoj66wjlhVfvt0zvRSEWhCzi9IMR2 fbrAIz9K8Hl6d5oY9tAYyNYc2GC+b+0fIOWhXXBeiw== 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: EAB846D3D2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of sobomax@sippysoft.com designates 209.85.166.65 as permitted sender) smtp.mailfrom=sobomax@sippysoft.com X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,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-all@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)[alt1.aspmx.l.google.com,aspmx.l.google.com,alt3.aspmx.l.google.com,alt2.aspmx.l.google.com,alt4.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.76)[-0.758,0]; RCVD_IN_DNSWL_NONE(0.00)[65.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.25)[ip: (-0.49), 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 06:00:41 -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-all@freebsd.org Wed Jun 5 09:25:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 12:34:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8BB015AC896; Wed, 5 Jun 2019 12:34:31 +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 68428812C5; Wed, 5 Jun 2019 12:34:31 +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 3D9EC51B2; Wed, 5 Jun 2019 12:34:31 +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 x55CYU92098347; Wed, 5 Jun 2019 12:34:30 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55CYTcC098338; Wed, 5 Jun 2019 12:34:29 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051234.x55CYTcC098338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 12:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348683 - in stable/12: cddl/contrib/opensolaris/lib/libzfs/common stand/common stand/ofw/libofw stand/powerpc/boot1.chrp stand/powerpc/kboot stand/powerpc/ofw X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/lib/libzfs/common stand/common stand/ofw/libofw stand/powerpc/boot1.chrp stand/powerpc/kboot stand/powerpc/ofw X-SVN-Commit-Revision: 348683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68428812C5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 12:34:32 -0000 Author: luporl Date: Wed Jun 5 12:34:28 2019 New Revision: 348683 URL: https://svnweb.freebsd.org/changeset/base/348683 Log: MFC r348005: [PowerPC64] stand: fix build using clang 8 as compiler This change fixes "stand" build issues when using clang 8 as compiler. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20026 Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c stable/12/stand/common/load_elf.c stable/12/stand/ofw/libofw/ofw_net.c stable/12/stand/ofw/libofw/openfirm.c stable/12/stand/powerpc/boot1.chrp/boot1.c stable/12/stand/powerpc/kboot/Makefile stable/12/stand/powerpc/kboot/main.c stable/12/stand/powerpc/ofw/elf_freebsd.c stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Wed Jun 5 12:34:28 2019 (r348683) @@ -114,7 +114,7 @@ get_stats_for_obj(differ_info_t *di, const char *dsnam (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Unable to determine path or stats for " - "object %lld in %s"), obj, dsname); + "object %jd in %s"), (uintmax_t)obj, dsname); return (-1); } } @@ -406,8 +406,8 @@ write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff } else { (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, - "next allocated object (> %lld) find failure"), - zc.zc_obj); + "next allocated object (> %jd) find failure"), + (uintmax_t)zc.zc_obj); di->zerr = errno; break; } Modified: stable/12/stand/common/load_elf.c ============================================================================== --- stable/12/stand/common/load_elf.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/common/load_elf.c Wed Jun 5 12:34:28 2019 (r348683) @@ -483,7 +483,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off += 0x01000000; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("Converted entry 0x%08x\n", ehdr->e_entry); + printf("Converted entry 0x%jx\n", (uintmax_t)ehdr->e_entry); #endif } else off = 0; @@ -509,8 +509,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", - ehdr->e_entry, off); + printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n", + (uintmax_t)ehdr->e_entry, off); #endif #else off = 0; /* other archs use direct mapped kernels */ Modified: stable/12/stand/ofw/libofw/ofw_net.c ============================================================================== --- stable/12/stand/ofw/libofw/ofw_net.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/ofw/libofw/ofw_net.c Wed Jun 5 12:34:28 2019 (r348683) @@ -225,12 +225,12 @@ ofwn_init(struct iodesc *desc, void *machdep_hint) dmabuf = NULL; if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf) < 0) { - printf("Failed to allocate DMA buffer (got %08x).\n", dmabuf); + printf("Failed to allocate DMA buffer (got %p).\n", dmabuf); goto punt; } #if defined(NETIF_DEBUG) - printf("ofwn_init: allocated DMA buffer: %08x\n", dmabuf); + printf("ofwn_init: allocated DMA buffer: %p\n", dmabuf); #endif #endif Modified: stable/12/stand/ofw/libofw/openfirm.c ============================================================================== --- stable/12/stand/ofw/libofw/openfirm.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/ofw/libofw/openfirm.c Wed Jun 5 12:34:28 2019 (r348683) @@ -669,7 +669,6 @@ OF_block_size(ihandle_t instance) } /* -/* * Memory functions */ Modified: stable/12/stand/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/12/stand/powerpc/boot1.chrp/boot1.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/powerpc/boot1.chrp/boot1.c Wed Jun 5 12:34:28 2019 (r348683) @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "paths.h" Modified: stable/12/stand/powerpc/kboot/Makefile ============================================================================== --- stable/12/stand/powerpc/kboot/Makefile Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/powerpc/kboot/Makefile Wed Jun 5 12:34:28 2019 (r348683) @@ -36,9 +36,6 @@ CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -# 64-bit bridge extensions -CFLAGS+= -Wa,-mppc64bridge - DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} Modified: stable/12/stand/powerpc/kboot/main.c ============================================================================== --- stable/12/stand/powerpc/kboot/main.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/powerpc/kboot/main.c Wed Jun 5 12:34:28 2019 (r348683) @@ -484,8 +484,18 @@ kboot_kseg_get(int *nseg, void **ptr) void _start(int argc, const char **argv, char **env) { +// This makes error "variable 'sp' is uninitialized" be just a warning on clang. +// Initializing 'sp' is not desired here as it would overwrite "r1" original value +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wuninitialized" +#endif register volatile void **sp asm("r1"); main((int)sp[0], (const char **)&sp[1]); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } /* Modified: stable/12/stand/powerpc/ofw/elf_freebsd.c ============================================================================== --- stable/12/stand/powerpc/ofw/elf_freebsd.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/powerpc/ofw/elf_freebsd.c Wed Jun 5 12:34:28 2019 (r348683) @@ -84,7 +84,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp) if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) return (error); - printf("Kernel entry at 0x%lx ...\n", e->e_entry); + printf("Kernel entry at 0x%x ...\n", entry); dev_cleanup(); if (dtbp != 0) { Modified: stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c ============================================================================== --- stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c Wed Jun 5 09:25:40 2019 (r348682) +++ stable/12/stand/powerpc/ofw/ppc64_elf_freebsd.c Wed Jun 5 12:34:28 2019 (r348683) @@ -87,7 +87,7 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp) if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) return (error); - printf("Kernel entry at 0x%lx ...\n", entry); + printf("Kernel entry at 0x%x ...\n", entry); dev_cleanup(); From owner-svn-src-all@freebsd.org Wed Jun 5 12:38:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3DC915AC9B4; Wed, 5 Jun 2019 12:38:59 +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 483098143F; Wed, 5 Jun 2019 12:38:59 +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 1D27151B5; Wed, 5 Jun 2019 12:38:59 +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 x55CcwGE098575; Wed, 5 Jun 2019 12:38:58 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Ccwkg098574; Wed, 5 Jun 2019 12:38:58 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051238.x55Ccwkg098574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 12:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348684 - stable/12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/stand/common X-SVN-Commit-Revision: 348684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 483098143F 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 12:38:59 -0000 Author: luporl Date: Wed Jun 5 12:38:58 2019 New Revision: 348684 URL: https://svnweb.freebsd.org/changeset/base/348684 Log: MFC r348025: Unbreak the build when `ELF_VERBOSE` is defined after r348005 This change properly terminates the formatting string quote modification done in r348005, which is triggered when `ELF_VERBOSE` is defined. Reported by: ci (amd64, gcc) Modified: stable/12/stand/common/load_elf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/load_elf.c ============================================================================== --- stable/12/stand/common/load_elf.c Wed Jun 5 12:34:28 2019 (r348683) +++ stable/12/stand/common/load_elf.c Wed Jun 5 12:38:58 2019 (r348684) @@ -509,7 +509,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n", + printf("ehdr->e_entry 0x%jx, va<->pa off %llx\n", (uintmax_t)ehdr->e_entry, off); #endif #else From owner-svn-src-all@freebsd.org Wed Jun 5 12:43:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BFF515ACC57; Wed, 5 Jun 2019 12:43:47 +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 F12818186A; Wed, 5 Jun 2019 12:43:46 +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 DF5A7536F; Wed, 5 Jun 2019 12:43:46 +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 x55Chkck003462; Wed, 5 Jun 2019 12:43:46 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Chknp003460; Wed, 5 Jun 2019 12:43:46 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051243.x55Chknp003460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 12:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348685 - in stable/12/sys: conf powerpc/aim powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in stable/12/sys: conf powerpc/aim powerpc/powerpc X-SVN-Commit-Revision: 348685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F12818186A 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.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 12:43:47 -0000 Author: luporl Date: Wed Jun 5 12:43:45 2019 New Revision: 348685 URL: https://svnweb.freebsd.org/changeset/base/348685 Log: MFC r348112: Fix PPC64 kernel build with clang8 + lld8 This patch fixes the following lld link errors: - unsupported dynamic relocations on read-only sections - out-of-range TOC references Submitted by: git_bdragon.rtk0.net Reviewed by: jhibbits, luporl Differential Revision: https://reviews.freebsd.org/D19352 Modified: stable/12/sys/conf/ldscript.powerpc64 stable/12/sys/powerpc/aim/trap_subr64.S stable/12/sys/powerpc/powerpc/cpu_subr64.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/ldscript.powerpc64 ============================================================================== --- stable/12/sys/conf/ldscript.powerpc64 Wed Jun 5 12:38:58 2019 (r348684) +++ stable/12/sys/conf/ldscript.powerpc64 Wed Jun 5 12:43:45 2019 (r348685) @@ -93,7 +93,8 @@ SECTIONS .opd : ALIGN(8) { KEEP (*(.opd)) } .branch_lt : ALIGN(8) { *(.branch_lt) } . = ALIGN(4096); - .got : ALIGN(8) { __tocbase = .; *(.got .toc) } + .got : ALIGN(8) { __tocbase = .; *(.got) } + .toc : ALIGN(8) { *(.toc) } .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers Modified: stable/12/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 12:38:58 2019 (r348684) +++ stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 12:43:45 2019 (r348685) @@ -317,29 +317,33 @@ CNAME(rstcode): * processor is waking up from power saving mode * It is software reset when 46:47 = 0b00 */ + /* 0x00 */ + ld %r2,TRAP_GENTRAP(0) /* Real-mode &generictrap */ mfsrr1 %r9 /* Load SRR1 into r9 */ andis. %r9,%r9,0x3 /* Logic AND with 46:47 bits */ + beq 2f /* Branch if software reset */ - bl 1f - .llong cpu_wakeup_handler + /* 0x10 */ + /* Reset was wakeup */ + addi %r9,%r2,(cpu_wakeup_handler-generictrap) + b 1f /* Was power save, do the wakeup */ - /* It is software reset */ - + /* Reset was software reset */ /* Explicitly set MSR[SF] */ 2: mfmsr %r9 li %r8,1 + /* 0x20 */ insrdi %r9,%r8,1,0 mtmsrd %r9 isync - bl 1f - .llong cpu_reset_handler /* Make sure to maintain 8-byte alignment */ + addi %r9,%r2,(cpu_reset_handler-generictrap) -1: mflr %r9 - ld %r9,0(%r9) - mtlr %r9 - - blr + /* 0x30 */ +1: mtlr %r9 + blr /* Branch to either cpu_reset_handler + * or cpu_wakeup_handler. + */ CNAME(rstcodeend): cpu_reset_handler: @@ -457,52 +461,59 @@ CNAME(hypertrapcode): addi %r1,%r1,(generichypertrap-generictrap) mtlr %r1 li %r1, 0xe0 /* How to get the vector from LR */ - blrl /* Branch to generictrap */ + blrl /* Branch to generichypertrap */ CNAME(hypertrapcodeend): /* * For SLB misses: do special things for the kernel * - * Note: SPRG1 is always safe to overwrite any time the MMU is on, which is + * Note: SPRG1 is always safe to overwrite any time the MMU was on, which is * the only time this can be called. */ .globl CNAME(slbtrap),CNAME(slbtrapend) .p2align 3 CNAME(slbtrap): + /* 0x00 */ mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) - std %r2,(PC_SLBSAVE+16)(%r1) - mfcr %r2 /* save CR */ - std %r2,(PC_SLBSAVE+104)(%r1) + std %r2,(PC_SLBSAVE+16)(%r1) /* save r2 */ + mfcr %r2 + /* 0x10 */ + std %r2,(PC_SLBSAVE+104)(%r1) /* save CR */ mfsrr1 %r2 /* test kernel mode */ mtcr %r2 bf 17,2f /* branch if PSL_PR is false */ + /* 0x20 */ /* User mode */ - ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ - mtcr %r2 - ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2 */ - mflr %r1 /* Save the old LR in r1 */ - mtsprg2 %r1 /* And then in SPRG2 */ - /* 52 bytes so far */ - bl 1f - .llong generictrap -1: mflr %r1 - ld %r1,0(%r1) + ld %r2,(PC_SLBSAVE+104)(%r1) + mtcr %r2 /* restore CR */ + ld %r2,(PC_SLBSAVE+16)(%r1) /* restore r2 */ + mflr %r1 + /* 0x30 */ + mtsprg2 %r1 /* save LR in SPRG2 */ + ld %r1,TRAP_GENTRAP(0) /* real-mode &generictrap */ mtlr %r1 li %r1, 0x80 /* How to get the vector from LR */ + /* 0x40 */ blrl /* Branch to generictrap */ - /* 84 bytes */ 2: mflr %r2 /* Save the old LR in r2 */ - nop - bl 3f /* Begin dance to jump to kern_slbtrap*/ - .llong kern_slbtrap -3: mflr %r1 - ld %r1,0(%r1) + /* Kernel mode */ + ld %r1,TRAP_GENTRAP(0) /* Real-mode &generictrap */ + addi %r1,%r1,(kern_slbtrap-generictrap) + /* 0x50 */ mtlr %r1 GET_CPUINFO(%r1) - blrl /* 124 bytes -- 4 to spare */ + blrl /* Branch to kern_slbtrap */ +/* must fit in 128 bytes! */ CNAME(slbtrapend): +/* + * On entry: + * SPRG1: SP + * r1: pcpu + * r2: LR + * LR: branch address in trap region + */ kern_slbtrap: std %r2,(PC_SLBSAVE+136)(%r1) /* old LR */ std %r3,(PC_SLBSAVE+24)(%r1) /* save R3 */ @@ -510,7 +521,7 @@ kern_slbtrap: /* Check if this needs to be handled as a regular trap (userseg miss) */ mflr %r2 andi. %r2,%r2,0xff80 - cmpwi %r2,0x380 + cmpwi %r2,EXC_DSE bne 1f mfdar %r2 b 2f @@ -639,14 +650,8 @@ CNAME(alitrap): mflr %r28 /* save LR */ mfcr %r29 /* save CR */ - /* Begin dance to branch to s_trap in a bit */ - b 1f - .p2align 3 -1: nop - bl 1f - .llong s_trap -1: mflr %r31 - ld %r31,0(%r31) + ld %r31,TRAP_GENTRAP(0) + addi %r31,%r31,(s_trap - generictrap) mtlr %r31 /* Put our exception vector in SPRG3 */ @@ -656,7 +661,7 @@ CNAME(alitrap): /* Test whether we already had PR set */ mfsrr1 %r31 mtcr %r31 - blrl + blrl /* Branch to s_trap */ CNAME(aliend): /* @@ -679,12 +684,10 @@ CNAME(dsitrap): mfsrr1 %r31 /* test kernel mode */ mtcr %r31 mflr %r28 /* save LR (SP already saved) */ - bl 1f /* Begin branching to disitrap */ - .llong disitrap -1: mflr %r1 - ld %r1,0(%r1) + ld %r1,TRAP_GENTRAP(0) + addi %r1,%r1,(disitrap-generictrap) mtlr %r1 - blrl /* Branch to generictrap */ + blrl /* Branch to disitrap */ CNAME(dsiend): /* @@ -953,7 +956,7 @@ CNAME(dblow): mtlr %r1 li %r1, 0 /* How to get the vector from LR */ blrl /* Branch to generictrap */ - + /* No fallthrough */ 1: GET_CPUINFO(%r1) std %r27,(PC_DBSAVE+CPUSAVE_R27)(%r1) /* free r27 */ @@ -963,12 +966,9 @@ CNAME(dblow): std %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ std %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ - nop /* alignment */ - bl 9f /* Begin branch */ - .llong dbtrap -9: mflr %r1 - ld %r1,0(%r1) + ld %r1,TRAP_GENTRAP(0) + addi %r1,%r1,(dbtrap-generictrap) mtlr %r1 - blrl /* Branch to generictrap */ + blrl /* Branch to dbtrap */ CNAME(dbend): #endif /* KDB */ Modified: stable/12/sys/powerpc/powerpc/cpu_subr64.S ============================================================================== --- stable/12/sys/powerpc/powerpc/cpu_subr64.S Wed Jun 5 12:38:58 2019 (r348684) +++ stable/12/sys/powerpc/powerpc/cpu_subr64.S Wed Jun 5 12:43:45 2019 (r348685) @@ -31,7 +31,6 @@ #include - .globl CNAME(power_save_sequence) .p2align 3 ENTRY(enter_idle_powerx) mfsprg0 %r3 /* Get the pcpu pointer */ @@ -65,11 +64,9 @@ ENTRY(enter_idle_powerx) std %r1,PCB_SP(%r3) /* Save the stack pointer */ std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ - /* Set where we want to jump */ bl 1f - .llong power_save_sequence /* Remember about 8 byte alignment */ 1: mflr %r3 - ld %r3,0(%r3) + addi %r3,%r3,power_save_sequence-1b mtsrr0 %r3 /* Set MSR */ @@ -82,7 +79,7 @@ ENTRY(enter_idle_powerx) rfid .p2align 2 -CNAME(power_save_sequence): +power_save_sequence: bl 1f .llong 0x0 /* Playground for power-save sequence */ 1: mflr %r3 From owner-svn-src-all@freebsd.org Wed Jun 5 12:53:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6575815ACFB6; Wed, 5 Jun 2019 12:53:37 +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 09A2281EEE; Wed, 5 Jun 2019 12:53:37 +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 D48435515; Wed, 5 Jun 2019 12:53:36 +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 x55Crabg008914; Wed, 5 Jun 2019 12:53:36 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55CrafE008913; Wed, 5 Jun 2019 12:53:36 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051253.x55CrafE008913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 12:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348686 - stable/12/stand/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/stand/powerpc X-SVN-Commit-Revision: 348686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09A2281EEE 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 12:53:37 -0000 Author: luporl Date: Wed Jun 5 12:53:36 2019 New Revision: 348686 URL: https://svnweb.freebsd.org/changeset/base/348686 Log: MFC r348028: stand/powerpc: Only build loader.kboot for powerpc64 kboot is only made for powerpc64 systems, not 32-bit systems. This unbreaks the build for powerpcspe. Reported by: ngie Modified: stable/12/stand/powerpc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/powerpc/Makefile ============================================================================== --- stable/12/stand/powerpc/Makefile Wed Jun 5 12:43:45 2019 (r348685) +++ stable/12/stand/powerpc/Makefile Wed Jun 5 12:53:36 2019 (r348686) @@ -5,6 +5,9 @@ NO_OBJ=t .include SUBDIR.yes= boot1.chrp ofw uboot + +.if "${TARGET_ARCH}" == "powerpc64" SUBDIR.${MK_FDT}+= kboot +.endif .include From owner-svn-src-all@freebsd.org Wed Jun 5 13:08:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 13:18:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 14:08:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 14:09:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 14:19:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 512CC15AF37E; Wed, 5 Jun 2019 14:19:56 +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 EC5CD84E48; Wed, 5 Jun 2019 14:19:55 +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 C15746276; Wed, 5 Jun 2019 14:19:55 +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 x55EJtkK050663; Wed, 5 Jun 2019 14:19:55 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55EJsT5050659; Wed, 5 Jun 2019 14:19:54 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051419.x55EJsT5050659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 14:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348690 - stable/12/sys/powerpc/aim X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/sys/powerpc/aim X-SVN-Commit-Revision: 348690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC5CD84E48 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 14:19:56 -0000 Author: luporl Date: Wed Jun 5 14:19:54 2019 New Revision: 348690 URL: https://svnweb.freebsd.org/changeset/base/348690 Log: MFC r343744: powerpc64: Add a trap stack area Currently, the trap code switches to the the temporary stack in the dbtrap section. It works in most cases, but in the beginning of the execution, the temp stack is being used, as starting in the powerpc_init() code. In this current scenario, the stack is being overwritten, which causes the return of breakpoint() to take abnormal execution. This current patchset create a small stack to use by the dbtrap: codepath avoiding the corruption of the temporary stack. PR: 224872 Submitted by: breno.leitao_gmail.com Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D14484 Modified: stable/12/sys/powerpc/aim/locore32.S stable/12/sys/powerpc/aim/locore64.S stable/12/sys/powerpc/aim/trap_subr32.S stable/12/sys/powerpc/aim/trap_subr64.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/aim/locore32.S ============================================================================== --- stable/12/sys/powerpc/aim/locore32.S Wed Jun 5 14:08:39 2019 (r348689) +++ stable/12/sys/powerpc/aim/locore32.S Wed Jun 5 14:19:54 2019 (r348690) @@ -60,6 +60,12 @@ GLOBAL(__endkernel) GLOBAL(tmpstk) .space TMPSTKSZ +#ifdef KDB +#define TRAPSTKSZ 4096 /* 4k trap stack */ +GLOBAL(trapstk) + .space TRAPSTKSZ +#endif + .text .globl btext btext: Modified: stable/12/sys/powerpc/aim/locore64.S ============================================================================== --- stable/12/sys/powerpc/aim/locore64.S Wed Jun 5 14:08:39 2019 (r348689) +++ stable/12/sys/powerpc/aim/locore64.S Wed Jun 5 14:19:54 2019 (r348690) @@ -65,6 +65,14 @@ GLOBAL(tmpstk) TOC_ENTRY(tmpstk) TOC_ENTRY(can_wakeup) +#ifdef KDB +#define TRAPSTKSZ 4096 /* 4k trap stack */ +GLOBAL(trapstk) + .space TRAPSTKSZ +TOC_ENTRY(trapstk) +#endif + + /* * Entry point for bootloaders that do not fully implement ELF and start * at the beginning of the image (kexec, notably). In its own section so Modified: stable/12/sys/powerpc/aim/trap_subr32.S ============================================================================== --- stable/12/sys/powerpc/aim/trap_subr32.S Wed Jun 5 14:08:39 2019 (r348689) +++ stable/12/sys/powerpc/aim/trap_subr32.S Wed Jun 5 14:19:54 2019 (r348690) @@ -864,8 +864,8 @@ dbtrap: mtsprg3 %r1 lwz %r1,TRAP_TOCBASE(0) /* get new SP */ - lwz %r1,tmpstk@got(%r1) - addi %r1,%r1,TMPSTKSZ-16 + lwz %r1,trapstk@got(%r1) + addi %r1,%r1,TRAPSTKSZ-16 FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ Modified: stable/12/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 14:08:39 2019 (r348689) +++ stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 14:19:54 2019 (r348690) @@ -900,8 +900,8 @@ dbtrap: mtsprg3 %r1 GET_TOCBASE(%r1) /* get new SP */ - ld %r1,TOC_REF(tmpstk)(%r1) - addi %r1,%r1,(TMPSTKSZ-48) + ld %r1,TOC_REF(trapstk)(%r1) + addi %r1,%r1,(TRAPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ From owner-svn-src-all@freebsd.org Wed Jun 5 14:23:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D3315AF5E4; Wed, 5 Jun 2019 14:23:12 +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 E8B6685277; Wed, 5 Jun 2019 14:23:11 +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 BF8B1642E; Wed, 5 Jun 2019 14:23:11 +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 x55ENBWM055900; Wed, 5 Jun 2019 14:23:11 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55ENA2c055895; Wed, 5 Jun 2019 14:23:10 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906051423.x55ENA2c055895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 5 Jun 2019 14:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348691 - in stable/12/sys/powerpc: aim booke ofw powernv powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in stable/12/sys/powerpc: aim booke ofw powernv powerpc X-SVN-Commit-Revision: 348691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8B6685277 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.963,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 14:23:12 -0000 Author: luporl Date: Wed Jun 5 14:23:10 2019 New Revision: 348691 URL: https://svnweb.freebsd.org/changeset/base/348691 Log: MFC r345676: powerpc64: Use medium code model in asm files for TOC references Summary: With a sufficiently large TOC, it's possible to index out of range, as the immediate load instructions only permit 16-bit indices, allowing up to 64kB range (signed) from the base pointer. Allow +/- 2GB range, with the medium code model TOC accesses in asm. Patch originally by Brandon Bergren. The issue appears to impact ELFv2 more than ELFv1. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D19708 Modified: stable/12/sys/powerpc/aim/trap_subr64.S stable/12/sys/powerpc/booke/locore.S stable/12/sys/powerpc/ofw/ofwcall64.S stable/12/sys/powerpc/powernv/opalcall.S stable/12/sys/powerpc/powerpc/swtch64.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 14:19:54 2019 (r348690) +++ stable/12/sys/powerpc/aim/trap_subr64.S Wed Jun 5 14:23:10 2019 (r348691) @@ -349,7 +349,8 @@ CNAME(rstcodeend): cpu_reset_handler: GET_TOCBASE(%r2) - ld %r1,TOC_REF(tmpstk)(%r2) /* get new SP */ + addis %r1,%r2,TOC_REF(tmpstk)@ha + ld %r1,TOC_REF(tmpstk)@l(%r1) /* get new SP */ addi %r1,%r1,(TMPSTKSZ-48) bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ @@ -384,7 +385,8 @@ cpu_wakeup_handler: GET_TOCBASE(%r2) /* Check for false wake up due to badly SRR1 set (eg. by OPAL) */ - ld %r3,TOC_REF(can_wakeup)(%r2) + addis %r3,%r2,TOC_REF(can_wakeup)@ha + ld %r3,TOC_REF(can_wakeup)@l(%r3) ld %r3,0(%r3) cmpdi %r3,0 beq cpu_reset_handler @@ -900,7 +902,8 @@ dbtrap: mtsprg3 %r1 GET_TOCBASE(%r1) /* get new SP */ - ld %r1,TOC_REF(trapstk)(%r1) + addis %r1,%r1,TOC_REF(trapstk)@ha + ld %r1,TOC_REF(trapstk)@l(%r1) addi %r1,%r1,(TRAPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) Modified: stable/12/sys/powerpc/booke/locore.S ============================================================================== --- stable/12/sys/powerpc/booke/locore.S Wed Jun 5 14:19:54 2019 (r348690) +++ stable/12/sys/powerpc/booke/locore.S Wed Jun 5 14:23:10 2019 (r348691) @@ -302,7 +302,8 @@ done_mapping: subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ /* Set up the stack pointer */ - ld %r1,TOC_REF(tmpstack)(%r2) + addis %r1,%r2,TOC_REF(tmpstack)@ha + ld %r1,TOC_REF(tmpstack)@l(%r1) addi %r1,%r1,TMPSTACKSZ-96 add %r1,%r1,%r31 bl 1f @@ -550,7 +551,8 @@ bp_kernload: mtspr SPR_SPRG8, %r2 /* Set up the stack pointer */ - ld %r1,TOC_REF(tmpstack)(%r2) + addis %r1,%r2,TOC_REF(tmpstack)@ha + ld %r1,TOC_REF(tmpstack)@l(%r1) addi %r1,%r1,TMPSTACKSZ-96 #else /* Modified: stable/12/sys/powerpc/ofw/ofwcall64.S ============================================================================== --- stable/12/sys/powerpc/ofw/ofwcall64.S Wed Jun 5 14:19:54 2019 (r348690) +++ stable/12/sys/powerpc/ofw/ofwcall64.S Wed Jun 5 14:23:10 2019 (r348691) @@ -101,11 +101,13 @@ ASENTRY_NOPROF(ofwcall) mfmsr %r6 /* read client interface handler */ - ld %r4,TOC_REF(openfirmware_entry)(%r2) + addis %r4,%r2,TOC_REF(openfirmware_entry)@ha + ld %r4,TOC_REF(openfirmware_entry)@l(%r4) ld %r4,0(%r4) /* Get OF stack pointer */ - ld %r7,TOC_REF(ofwstk)(%r2) + addis %r7,%r2,TOC_REF(ofwstk)@ha + ld %r7,TOC_REF(ofwstk)@l(%r7) addi %r7,%r7,OFWSTKSZ-40 /* @@ -113,7 +115,8 @@ ASENTRY_NOPROF(ofwcall) * exceptions, which is important for the next few steps. */ - ld %r5,TOC_REF(ofmsr)(%r2) + addis %r5,%r2,TOC_REF(ofmsr)@ha + ld %r5,TOC_REF(ofmsr)@l(%r5) ld %r5,0(%r5) mtmsrd %r5 isync @@ -233,16 +236,19 @@ ASENTRY_NOPROF(rtascall) mfmsr %r6 /* Read RTAS entry and reg save area pointers */ - ld %r5,TOC_REF(rtas_entry)(%r2) + addis %r5,%r2,TOC_REF(rtas_entry)@ha + ld %r5,TOC_REF(rtas_entry)@l(%r5) ld %r5,0(%r5) - ld %r8,TOC_REF(rtas_regsave)(%r2) + addis %r8,%r2,TOC_REF(rtas_regsave)@ha + ld %r8,TOC_REF(rtas_regsave)@l(%r8) /* * Set the MSR to the RTAS value. This has the side effect of disabling * exceptions, which is important for the next few steps. */ - ld %r7,TOC_REF(rtasmsr)(%r2) + addis %r7,%r2,TOC_REF(rtasmsr)@ha + ld %r7,TOC_REF(rtasmsr)@l(%r7) ld %r7,0(%r7) mtmsrd %r7 isync Modified: stable/12/sys/powerpc/powernv/opalcall.S ============================================================================== --- stable/12/sys/powerpc/powernv/opalcall.S Wed Jun 5 14:19:54 2019 (r348690) +++ stable/12/sys/powerpc/powernv/opalcall.S Wed Jun 5 14:23:10 2019 (r348691) @@ -53,7 +53,8 @@ ASENTRY(opal_call) /* Load OPAL entry information */ mr %r0,%r3 - ld %r3,TOC_REF(opal_entrypoint)(%r2) + addis %r3,%r2,TOC_REF(opal_entrypoint)@ha + ld %r3,TOC_REF(opal_entrypoint)@l(%r3) ld %r3,0(%r3) mtctr %r3 @@ -62,9 +63,11 @@ ASENTRY(opal_call) mfmsr %r31 /* Load last bits from the TOC */ - ld %r3,TOC_REF(opal_msr)(%r2) + addis %r3,%r2,TOC_REF(opal_msr)@ha + ld %r3,TOC_REF(opal_msr)@l(%r3) ld %r3,0(%r3) - ld %r2,TOC_REF(opal_data)(%r2) + addis %r2,%r2,TOC_REF(opal_data)@ha + ld %r2,TOC_REF(opal_data)@l(%r2) ld %r2,0(%r2) mtmsrd %r3 Modified: stable/12/sys/powerpc/powerpc/swtch64.S ============================================================================== --- stable/12/sys/powerpc/powerpc/swtch64.S Wed Jun 5 14:19:54 2019 (r348690) +++ stable/12/sys/powerpc/powerpc/swtch64.S Wed Jun 5 14:23:10 2019 (r348691) @@ -159,7 +159,8 @@ ENTRY(cpu_switch) cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) /* Wait for the new thread to become unblocked */ - ld %r6,TOC_REF(blocked_lock)(%r2) + addis %r6,%r2,TOC_REF(blocked_lock)@ha + ld %r6,TOC_REF(blocked_lock)@l(%r6) blocked_loop: ld %r7,TD_LOCK(%r13) cmpd %r6,%r7 From owner-svn-src-all@freebsd.org Wed Jun 5 14:34:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 15:23:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 16:01:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 19:29:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 19:30:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 19:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B99E15B7744; Wed, 5 Jun 2019 19:46:36 +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 1A5F06A6ED; Wed, 5 Jun 2019 19:46:36 +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 0B3829B65; Wed, 5 Jun 2019 19:46:36 +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 x55JkZr0024492; Wed, 5 Jun 2019 19:46:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55JkZNc024491; Wed, 5 Jun 2019 19:46:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906051946.x55JkZNc024491@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 19:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348696 - stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 348696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A5F06A6ED 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 19:46:36 -0000 Author: allanjude Date: Wed Jun 5 19:46:35 2019 New Revision: 348696 URL: https://svnweb.freebsd.org/changeset/base/348696 Log: MFC r347953: MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee zfs_main: fix `zfs userspace` squashing unresolved entries The `zfs userspace` squashes all entries with unresolved numeric values into a single output entry due to the comparsion always made by the string name which is empty in case of unresolved IDs. Fix this by falling to a numerical comparison when either one of string values is not found. This then compares any numerical values after all with a name resolved. Signed-off-by: Pavel Boldin Signed-off-by: Brian Behlendorf Reported by: clusteradm Obtained from: ZFS-on-Linux Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jun 5 19:30:32 2019 (r348695) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jun 5 19:46:35 2019 (r348696) @@ -2361,6 +2361,7 @@ us_compare(const void *larg, const void *rarg, void *u case ZFS_PROP_NAME: propname = "name"; if (numname) { +compare_nums: (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u if (rv64 != lv64) rc = (rv64 < lv64) ? 1 : -1; } else { - (void) nvlist_lookup_string(lnvl, propname, - &lvstr); - (void) nvlist_lookup_string(rnvl, propname, - &rvstr); + if ((nvlist_lookup_string(lnvl, propname, + &lvstr) == ENOENT) || + (nvlist_lookup_string(rnvl, propname, + &rvstr) == ENOENT)) { + goto compare_nums; + } rc = strcmp(lvstr, rvstr); } break; From owner-svn-src-all@freebsd.org Wed Jun 5 19:55:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 20:16:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 20:18:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 20:21:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 20:27:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3CFE15B866B; Wed, 5 Jun 2019 20:27:27 +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 8B1866BEC7; Wed, 5 Jun 2019 20:27:27 +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 65E55A24D; Wed, 5 Jun 2019 20:27:27 +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 x55KRRtw045369; Wed, 5 Jun 2019 20:27:27 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KRR1j045368; Wed, 5 Jun 2019 20:27:27 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906052027.x55KRR1j045368@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:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348702 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B1866BEC7 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 20:27:28 -0000 Author: allanjude Date: Wed Jun 5 20:27:26 2019 New Revision: 348702 URL: https://svnweb.freebsd.org/changeset/base/348702 Log: MFC r348068, r348071 r348068: ZFS: Make deadman tunables no longer read-only This allows the user to enable, disable, and adjust the I/O deadman at runtime. This can be especially useful when a pool is backed by remote storage (such as iscsi, ggated, etc). PR: 221906 Submitted by: Fabian Keil Obtained from: ElectroBSD Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 r348071: Fix typo in r348068 Sponsored by: Klara Systems Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Jun 5 20:21:17 2019 (r348701) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Jun 5 20:27:26 2019 (r348702) @@ -363,13 +363,13 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RWTUN, &zfs_deadman_synctime_ms, 0, "Stalled ZFS I/O expiration time in milliseconds"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RWTUN, &zfs_deadman_checktime_ms, 0, "Period of checks for stalled ZFS I/O in milliseconds"); -SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN, &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); From owner-svn-src-all@freebsd.org Wed Jun 5 20:31:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A9A215B8943; Wed, 5 Jun 2019 20:31:11 +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 6FA106C1B4; Wed, 5 Jun 2019 20:31:10 +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 0CF68A38C; Wed, 5 Jun 2019 20:31:10 +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 x55KV9Gn045616; Wed, 5 Jun 2019 20:31:09 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55KV9uk045615; Wed, 5 Jun 2019 20:31:09 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906052031.x55KV9uk045615@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:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348703 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 348703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FA106C1B4 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.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 20:31:11 -0000 Author: allanjude Date: Wed Jun 5 20:31:09 2019 New Revision: 348703 URL: https://svnweb.freebsd.org/changeset/base/348703 Log: MFC r348065: Correct the way remaining battery life is calculated Previously, if a system had multiple batteries, the remaining life percentage was calculated as the average of each battery's percent remaining. This results in rather incorrect values when you consider the case of the Thinkpad X270 that has a small 3 cell internally battery, and a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%, but battery 1 is at 10%, you do not infact have 55% of your capacity remaining. The new method calculates the percentage based on remaining capacity out of total capacity, giving a much more accurate reading. PR: 229818 Submitted by: Keegan Drake H.P. Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Modified: stable/12/sys/dev/acpica/acpi_battery.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_battery.c Wed Jun 5 20:27:26 2019 (r348702) +++ stable/12/sys/dev/acpica/acpi_battery.c Wed Jun 5 20:31:09 2019 (r348703) @@ -119,7 +119,7 @@ int acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo) { int batt_stat, devcount, dev_idx, error, i; - int total_cap, total_min, valid_rate, valid_units; + int total_cap, total_lfcap, total_min, valid_rate, valid_units; devclass_t batt_dc; device_t batt_dev; struct acpi_bst *bst; @@ -152,6 +152,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ dev_idx = -1; batt_stat = valid_rate = valid_units = 0; + total_cap = total_lfcap = 0; for (i = 0; i < devcount; i++) { /* Default info for every battery is "not present". */ acpi_reset_battinfo(&bi[i]); @@ -213,17 +214,23 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba if (!acpi_battery_bif_valid(bif)) continue; - /* Calculate percent capacity remaining. */ - bi[i].cap = (100 * bst[i].cap) / bif->lfcap; - /* * Some laptops report the "design-capacity" instead of the * "real-capacity" when the battery is fully charged. That breaks * the above arithmetic as it needs to be 100% maximum. */ - if (bi[i].cap > 100) - bi[i].cap = 100; + if (bst[i].cap > bif->lfcap) + bst[i].cap = bif->lfcap; + /* Calculate percent capacity remaining. */ + bi[i].cap = (100 * bst[i].cap) / bif->lfcap; + + /* If this battery is not present, don't use its capacity. */ + if (bi[i].cap != -1) { + total_cap += bst[i].cap; + total_lfcap += bif->lfcap; + } + /* * On systems with more than one battery, they may get used * sequentially, thus bst.rate may only signify the one currently @@ -244,7 +251,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba } /* Pass 2: calculate capacity and remaining time for all batteries. */ - total_cap = total_min = 0; + total_min = 0; for (i = 0; i < devcount; i++) { /* * If any batteries are discharging, use the sum of the bst.rate @@ -256,10 +263,6 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba else bi[i].min = 0; total_min += bi[i].min; - - /* If this battery is not present, don't use its capacity. */ - if (bi[i].cap != -1) - total_cap += bi[i].cap; } /* @@ -268,7 +271,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ if (valid_units > 0) { if (dev == NULL) { - battinfo->cap = total_cap / valid_units; + battinfo->cap = (total_cap * 100) / total_lfcap; battinfo->min = total_min; battinfo->state = batt_stat; battinfo->rate = valid_rate; From owner-svn-src-all@freebsd.org Wed Jun 5 21:46:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1D915BA09E; Wed, 5 Jun 2019 21:46:58 +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 6C3AF6E499; Wed, 5 Jun 2019 21:46:58 +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 2C597AF98; Wed, 5 Jun 2019 21:46:58 +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 x55Lkwj9086845; Wed, 5 Jun 2019 21:46:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x55Lkurv086839; Wed, 5 Jun 2019 21:46:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906052146.x55Lkurv086839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 5 Jun 2019 21:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348704 - in stable/11/sys/dev/cxgbe: cxgbei tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: cxgbei tom X-SVN-Commit-Revision: 348704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C3AF6E499 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.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 21:46:59 -0000 Author: np Date: Wed Jun 5 21:46:56 2019 New Revision: 348704 URL: https://svnweb.freebsd.org/changeset/base/348704 Log: MFC r348491: cxgbe/t4_tom: adjust the hardware receive window to match changes to the receive sockbuf's high water mark. Calculate rx credits on the spot instead of tracking sbused/sb_cc and rx_credits in the toepcb. The previous method worked when the high water mark changed due to SB_AUTOSIZE but not when it was adjusted directly (for example, by the soreserve in nfsrvd_addsock). This fixes a connection hang while running iozone over an NFS mounted share where nfsd's TCP sockets are being handled by t4_tom. Sponsored by: Chelsio Communications Approved by: re@ (gjb@) Modified: stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_ddp.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tls.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Jun 5 21:46:56 2019 (r348704) @@ -651,7 +651,6 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he tp->t_rcvtime = ticks; /* update rx credits */ - toep->rx_credits += pdu_len; t4_rcvd(&toep->td->tod, tp); /* XXX: sc->tom_softc.tod */ so = inp->inp_socket; Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Wed Jun 5 21:46:56 2019 (r348704) @@ -380,8 +380,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru toep->vnet = so->so_vnet; set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); SOCKBUF_LOCK(&so->so_rcv); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); + toep->opt0_rcv_bufsize = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); SOCKBUF_UNLOCK(&so->so_rcv); /* @@ -435,7 +434,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } else { struct cpl_act_open_req *cpl = wrtod(wr); @@ -464,7 +463,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 5 21:46:56 2019 (r348704) @@ -409,20 +409,10 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = toep->rx_credits << 10; + tp->rcv_wnd = toep->opt0_rcv_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; - /* - * If we were unable to send all rx credits via opt0, save the remainder - * in rx_credits so that they can be handed over with the next credit - * update. - */ - SOCKBUF_LOCK(&so->so_rcv); - bufsize = select_rcv_wnd(so); - SOCKBUF_UNLOCK(&so->so_rcv); - toep->rx_credits = bufsize - tp->rcv_wnd; - tp->iss = iss; tcp_sendseqinit(tp); tp->snd_una = iss + 1; @@ -493,37 +483,29 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_rcv; struct toepcb *toep = tp->t_toe; - int credits; + int rx_credits; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK_ASSERT(sb); - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - credits = toep->sb_cc - sbused(sb); - toep->sb_cc = sbused(sb); + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; if (toep->ulp_mode == ULP_MODE_TLS) { - if (toep->tls.rcv_over >= credits) { - toep->tls.rcv_over -= credits; - credits = 0; + if (toep->tls.rcv_over >= rx_credits) { + toep->tls.rcv_over -= rx_credits; + rx_credits = 0; } else { - credits -= toep->tls.rcv_over; + rx_credits -= toep->tls.rcv_over; toep->tls.rcv_over = 0; } } - toep->rx_credits += credits; - if (toep->rx_credits > 0 && - (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || - (toep->rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || - toep->sb_cc + tp->rcv_wnd < sb->sb_lowat)) { - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && + (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || + (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || + sbused(sb) + tp->rcv_wnd < sb->sb_lowat)) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } else if (toep->flags & TPF_FORCE_CREDITS) send_rx_modulate(sc, toep); } @@ -1557,7 +1539,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header struct tcpcb *tp; struct socket *so; struct sockbuf *sb; - int len; + int len, rx_credits; uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { @@ -1642,8 +1624,6 @@ do_rx_data(struct sge_iq *iq, const struct rss_header if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } if (toep->ulp_mode == ULP_MODE_TCPDDP) { @@ -1681,19 +1661,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header } } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } if (toep->ulp_mode == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Wed Jun 5 21:46:56 2019 (r348704) @@ -309,9 +309,6 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); tp->rcv_wnd -= n; #endif -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += n; -#endif CTR2(KTR_CXGBE, "%s: placed %u bytes before falling out of DDP", __func__, n); while (toep->ddp.active_count > 0) { @@ -560,16 +557,10 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } SOCKBUF_UNLOCK(sb); CURVNET_RESTORE(); -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif - job->msgrcv = 1; if (db->cancel_pending) { /* @@ -718,12 +709,9 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp INP_WLOCK_ASSERT(toep->inp); DDP_ASSERT_LOCKED(toep); - len = be32toh(rcv_nxt) - tp->rcv_nxt; + len = be32toh(rcv_nxt) - tp->rcv_nxt; tp->rcv_nxt += len; -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif while (toep->ddp.active_count > 0) { MPASS(toep->ddp.active_id != -1); Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Wed Jun 5 21:46:56 2019 (r348704) @@ -1395,7 +1395,6 @@ found: mtu_idx = find_best_mtu_idx(sc, &inc, &settings); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); save_qids_in_synqe(synqe, vi, &settings); @@ -1544,8 +1543,7 @@ reset: toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; toep->vnet = lctx->vnet; set_ulp_mode(toep, synqe->ulp_mode); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = synqe->rcv_bufsize; + toep->opt0_rcv_bufsize = synqe->rcv_bufsize; MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); Modified: stable/11/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tls.c Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_tls.c Wed Jun 5 21:46:56 2019 (r348704) @@ -1469,7 +1469,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head struct socket *so; struct sockbuf *sb; struct mbuf *tls_data; - int len, pdu_length, pdu_overhead, sb_length; + int len, pdu_length, rx_credits; KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); KASSERT(!(toep->flags & TPF_SYNQE), @@ -1571,24 +1571,10 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head } /* - * Not all of the bytes on the wire are included in the socket - * buffer (e.g. the MAC of the TLS record). However, those - * bytes are included in the TCP sequence space. To handle - * this, compute the delta for this TLS record in - * 'pdu_overhead' and treat those bytes as having already been - * "read" by the application for the purposes of expanding the - * window. The meat of the TLS record passed to the - * application ('sb_length') will still not be counted as - * "read" until userland actually reads the bytes. - * - * XXX: Some of the calculations below are probably still not - * really correct. + * Not all of the bytes on the wire are included in the socket buffer + * (e.g. the MAC of the TLS record). However, those bytes are included + * in the TCP sequence space. */ - sb_length = m->m_pkthdr.len; - pdu_overhead = pdu_length - sb_length; - toep->rx_credits += pdu_overhead; - tp->rcv_wnd += pdu_overhead; - tp->rcv_adv += pdu_overhead; /* receive buffer autosize */ MPASS(toep->vnet == so->so_vnet); @@ -1596,34 +1582,25 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && - sb_length > (sbspace(sb) / 8 * 7)) { + m->m_pkthdr.len > (sbspace(sb) / 8 * 7)) { unsigned int hiwat = sb->sb_hiwat; unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); + 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, toep->rx_credits, tp->rcv_wnd); + __func__, tid, pdu_overhead, rx_credits, tp->rcv_wnd); #endif - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } sorwakeup_locked(so); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Wed Jun 5 20:31:09 2019 (r348703) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Wed Jun 5 21:46:56 2019 (r348704) @@ -178,9 +178,7 @@ struct toepcb { u_int tx_nocompl; /* tx WR credits since last compl request */ u_int plen_nocompl; /* payload since last compl request */ - /* rx credit handling */ - u_int sb_cc; /* last noted value of so_rcv->sb_cc */ - int rx_credits; /* rx credits (in bytes) to be returned to hw */ + int opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ u_int ulp_mode; /* ULP mode */ void *ulpcb; From owner-svn-src-all@freebsd.org Wed Jun 5 22:29:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:32:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:36:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:40:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:46:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:47:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 22:55:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Jun 5 23:37:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 01:16:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5699415BE2F0; Thu, 6 Jun 2019 01:16:05 +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 EC20A75EAF; Thu, 6 Jun 2019 01:16:04 +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 C5806D4AC; Thu, 6 Jun 2019 01:16:04 +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 x561G4Gi099186; Thu, 6 Jun 2019 01:16:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x561G49b099185; Thu, 6 Jun 2019 01:16:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906060116.x561G49b099185@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 01:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348713 - in stable/12/sys/dev: mpr mps X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/dev: mpr mps X-SVN-Commit-Revision: 348713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC20A75EAF 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 01:16:05 -0000 Author: mav Date: Thu Jun 6 01:16:04 2019 New Revision: 348713 URL: https://svnweb.freebsd.org/changeset/base/348713 Log: MFC r348417: Fix busy status leak in case of incorrect passthrough args. Modified: stable/12/sys/dev/mpr/mpr_user.c stable/12/sys/dev/mps/mps_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mpr/mpr_user.c ============================================================================== --- stable/12/sys/dev/mpr/mpr_user.c Wed Jun 5 23:37:50 2019 (r348712) +++ stable/12/sys/dev/mpr/mpr_user.c Thu Jun 6 01:16:04 2019 (r348713) @@ -790,8 +790,10 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru data->DataDirection = MPR_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mpr_dprint(sc, MPR_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__, Modified: stable/12/sys/dev/mps/mps_user.c ============================================================================== --- stable/12/sys/dev/mps/mps_user.c Wed Jun 5 23:37:50 2019 (r348712) +++ stable/12/sys/dev/mps/mps_user.c Thu Jun 6 01:16:04 2019 (r348713) @@ -802,8 +802,10 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru data->DataDirection = MPS_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mps_dprint(sc, MPS_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__, From owner-svn-src-all@freebsd.org Thu Jun 6 01:32:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 02:58:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D5715C025B; Thu, 6 Jun 2019 02:58:12 +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 F26708086B; Thu, 6 Jun 2019 02:58:11 +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 C7B25E562; Thu, 6 Jun 2019 02:58:11 +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 x562wB3n051646; Thu, 6 Jun 2019 02:58:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x562wBPC051645; Thu, 6 Jun 2019 02:58:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060258.x562wBPC051645@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 02:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348715 - stable/12/lib/libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libelftc X-SVN-Commit-Revision: 348715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F26708086B 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.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 02:58:12 -0000 Author: markj Date: Thu Jun 6 02:58:11 2019 New Revision: 348715 URL: https://svnweb.freebsd.org/changeset/base/348715 Log: MFC r348444: libelftc: Add MLINKS. Modified: stable/12/lib/libelftc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libelftc/Makefile ============================================================================== --- stable/12/lib/libelftc/Makefile Thu Jun 6 01:32:00 2019 (r348714) +++ stable/12/lib/libelftc/Makefile Thu Jun 6 02:58:11 2019 (r348715) @@ -38,6 +38,19 @@ MAN+= elftc.3 \ elftc_string_table_create.3 \ elftc_version.3 +MLINKS+= \ + elftc_bfd_find_target.3 elftc_bfd_target_class.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_byteorder.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_flavor.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_machine.3 \ + elftc_string_table_create.3 elftc_string_table_destroy.3 \ + elftc_string_table_create.3 elftc_string_table_from_section.3 \ + elftc_string_table_create.3 elftc_string_table_image.3 \ + elftc_string_table_create.3 elftc_string_table_insert.3 \ + elftc_string_table_create.3 elftc_string_table_lookup.3 \ + elftc_string_table_create.3 elftc_string_table_remove.3 \ + elftc_string_table_create.3 elftc_string_table_to_string.3 + # This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile # We need to link against the correct version of these files. One # solution is to include ../../sys in the include path. This causes From owner-svn-src-all@freebsd.org Thu Jun 6 03:01:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47CD15C03B7; Thu, 6 Jun 2019 03:01: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 6248380BF3; Thu, 6 Jun 2019 03:01: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 248BEE5D1; Thu, 6 Jun 2019 03:01: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 x56316fm056536; Thu, 6 Jun 2019 03:01:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56316Y8056535; Thu, 6 Jun 2019 03:01:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060301.x56316Y8056535@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 03:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348716 - stable/12/usr.sbin/rpc.yppasswdd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/rpc.yppasswdd X-SVN-Commit-Revision: 348716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6248380BF3 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.959,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:01:08 -0000 Author: markj Date: Thu Jun 6 03:01:05 2019 New Revision: 348716 URL: https://svnweb.freebsd.org/changeset/base/348716 Log: MFC r348547: rpc.yppasswdd: Fix dirname(3) usage after r305952. PR: 234972 Modified: stable/12/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- stable/12/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Thu Jun 6 02:58:11 2019 (r348715) +++ stable/12/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Thu Jun 6 03:01:05 2019 (r348716) @@ -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-all@freebsd.org Thu Jun 6 03:01:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED64415C048B; Thu, 6 Jun 2019 03:01:54 +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 8581280F6B; Thu, 6 Jun 2019 03:01:54 +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 219A8E733; Thu, 6 Jun 2019 03:01:53 +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 x5631rwq056621; Thu, 6 Jun 2019 03:01:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5631qnn056620; Thu, 6 Jun 2019 03:01:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060301.x5631qnn056620@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 03:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348717 - stable/12/contrib/elftoolchain/readelf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 348717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8581280F6B 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.959,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:01:55 -0000 Author: markj Date: Thu Jun 6 03:01:52 2019 New Revision: 348717 URL: https://svnweb.freebsd.org/changeset/base/348717 Log: MFC r348443: readelf: Make -t imply -S, for compatibility with GNU binutils. Modified: stable/12/contrib/elftoolchain/readelf/readelf.1 stable/12/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/readelf/readelf.1 ============================================================================== --- stable/12/contrib/elftoolchain/readelf/readelf.1 Thu Jun 6 03:01:05 2019 (r348716) +++ stable/12/contrib/elftoolchain/readelf/readelf.1 Thu Jun 6 03:01:52 2019 (r348717) @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" -.Dd September 13, 2012 +.Dd May 30, 2019 .Dt READELF 1 .Os .Sh NAME @@ -113,6 +113,8 @@ Print symbol tables. .It Fl t | Fl -section-details Print additional information about sections, such as the flags fields in section headers. +Implies +.Fl S . .It Fl v | Fl -version Prints a version identifier for .Nm Modified: stable/12/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jun 6 03:01:05 2019 (r348716) +++ stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jun 6 03:01:52 2019 (r348717) @@ -7471,7 +7471,7 @@ main(int argc, char **argv) re->options |= RE_S; break; case 't': - re->options |= RE_T; + re->options |= RE_SS | RE_T; break; case 'u': re->options |= RE_U; From owner-svn-src-all@freebsd.org Thu Jun 6 03:02:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 03:02:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE64015C06A6; Thu, 6 Jun 2019 03:02:46 +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 3538481213; Thu, 6 Jun 2019 03:02:44 +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 0D85FE766; Thu, 6 Jun 2019 03:02:44 +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 x5632h7D057552; Thu, 6 Jun 2019 03:02:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5632hVx057551; Thu, 6 Jun 2019 03:02:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060302.x5632hVx057551@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 03:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348719 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3538481213 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.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:02:46 -0000 Author: markj Date: Thu Jun 6 03:02:43 2019 New Revision: 348719 URL: https://svnweb.freebsd.org/changeset/base/348719 Log: MFC r348430: elfcopy: Remove an unneeded memset. Modified: stable/12/contrib/elftoolchain/elfcopy/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/main.c Thu Jun 6 03:02:25 2019 (r348718) +++ stable/12/contrib/elftoolchain/elfcopy/main.c Thu Jun 6 03:02:43 2019 (r348719) @@ -1565,7 +1565,6 @@ main(int argc, char **argv) ecp = calloc(1, sizeof(*ecp)); if (ecp == NULL) err(EXIT_FAILURE, "calloc failed"); - memset(ecp, 0, sizeof(*ecp)); ecp->itf = ecp->otf = ETF_ELF; ecp->iec = ecp->oec = ELFCLASSNONE; From owner-svn-src-all@freebsd.org Thu Jun 6 03:03:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E8F15C0906; Thu, 6 Jun 2019 03:03:56 +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 B4A2B81549; Thu, 6 Jun 2019 03:03:55 +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 8D3BAE76D; Thu, 6 Jun 2019 03:03:55 +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 x5633tp4057641; Thu, 6 Jun 2019 03:03:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5633t7r057640; Thu, 6 Jun 2019 03:03:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060303.x5633t7r057640@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 03:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348720 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4A2B81549 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.959,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:03:56 -0000 Author: markj Date: Thu Jun 6 03:03:54 2019 New Revision: 348720 URL: https://svnweb.freebsd.org/changeset/base/348720 Log: MFC r348431: elfcopy: Optimize for insertions at the end of the section list. PR: 234949 Modified: stable/12/contrib/elftoolchain/elfcopy/elfcopy.h stable/12/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/elfcopy.h Thu Jun 6 03:02:43 2019 (r348719) +++ stable/12/contrib/elftoolchain/elfcopy/elfcopy.h Thu Jun 6 03:03:54 2019 (r348720) @@ -138,6 +138,8 @@ struct section { TAILQ_ENTRY(section) sec_list; /* next section */ }; +TAILQ_HEAD(sectionlist, section); + /* Internal data structure for segments. */ struct segment { uint64_t vaddr; /* virtual addr (VMA) */ Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/sections.c Thu Jun 6 03:02:43 2019 (r348719) +++ stable/12/contrib/elftoolchain/elfcopy/sections.c Thu Jun 6 03:03:54 2019 (r348720) @@ -314,18 +314,18 @@ insert_to_sec_list(struct elfcopy *ecp, struct section { struct section *s; - if (!tail) { + if (tail || TAILQ_EMPTY(&ecp->v_sec) || + TAILQ_LAST(&ecp->v_sec, sectionlist)->off <= sec->off) { + TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); + } else { TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (sec->off < s->off) { TAILQ_INSERT_BEFORE(s, sec, sec_list); - goto inc_nos; + break; } } } - TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); - -inc_nos: if (sec->pseudo == 0) ecp->nos++; } From owner-svn-src-all@freebsd.org Thu Jun 6 03:04:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54CA115C098D; Thu, 6 Jun 2019 03:04:34 +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 E94FC81683; Thu, 6 Jun 2019 03:04: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 C3BD5E76F; Thu, 6 Jun 2019 03:04:33 +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 x5634XbC057730; Thu, 6 Jun 2019 03:04:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5634XTI057729; Thu, 6 Jun 2019 03:04:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906060304.x5634XTI057729@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 03:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348721 - stable/12/lib/libutil X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libutil X-SVN-Commit-Revision: 348721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E94FC81683 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.959,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:04:34 -0000 Author: markj Date: Thu Jun 6 03:04:33 2019 New Revision: 348721 URL: https://svnweb.freebsd.org/changeset/base/348721 Log: MFC r348545: Typo. Modified: stable/12/lib/libutil/pw_util.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libutil/pw_util.3 ============================================================================== --- stable/12/lib/libutil/pw_util.3 Thu Jun 6 03:03:54 2019 (r348720) +++ stable/12/lib/libutil/pw_util.3 Thu Jun 6 03:04:33 2019 (r348721) @@ -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-all@freebsd.org Thu Jun 6 03:07:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 03:30:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5533115C118D; Thu, 6 Jun 2019 03:30:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7B9382548; Thu, 6 Jun 2019 03:30:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A52E5EB30; Thu, 6 Jun 2019 03:30:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x563ULsg069005; Thu, 6 Jun 2019 03:30:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x563ULhN069004; Thu, 6 Jun 2019 03:30:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906060330.x563ULhN069004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Jun 2019 03:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348723 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 348723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7B9382548 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.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:30:22 -0000 Author: gjb Date: Thu Jun 6 03:30:21 2019 New Revision: 348723 URL: https://svnweb.freebsd.org/changeset/base/348723 Log: MFC r348438, r348474: r348438: Fix GCE virtual machine startup. r348474: Revert previous commit. Note: no-op to appease the merge tracker Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Thu Jun 6 03:31:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4ED15C1327; Thu, 6 Jun 2019 03:31:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 321C08288D; Thu, 6 Jun 2019 03:31:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BC33ECC0; Thu, 6 Jun 2019 03:31:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x563VtIp073638; Thu, 6 Jun 2019 03:31:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x563Vtro073637; Thu, 6 Jun 2019 03:31:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906060331.x563Vtro073637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Jun 2019 03:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348724 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 348724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 321C08288D 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 03:31:56 -0000 Author: gjb Date: Thu Jun 6 03:31:55 2019 New Revision: 348724 URL: https://svnweb.freebsd.org/changeset/base/348724 Log: MFC r348439: Increase the size of the Vagrant default image size, as the 3GB size is too small to bootstrap the firstboot_pkgs list. While here, add the growfs(8) startup script to /etc/rc.conf, as Vagrant images can be resized by modifying the Vagrantfile. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/tools/vagrant.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/release/tools/vagrant.conf ============================================================================== --- stable/12/release/tools/vagrant.conf Thu Jun 6 03:30:21 2019 (r348723) +++ stable/12/release/tools/vagrant.conf Thu Jun 6 03:31:55 2019 (r348724) @@ -3,12 +3,15 @@ # $FreeBSD$ # +# The default of 3GB is too small for Vagrant, so override the size here. +export VMSIZE=8G + # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs" +export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs growfs" vagrant_common () { # The firstboot_pkgs rc.d script will download the repository From owner-svn-src-all@freebsd.org Thu Jun 6 05:09:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6B715C2B75; Thu, 6 Jun 2019 05:09:45 +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 A5CA084CA4; Thu, 6 Jun 2019 05:09:44 +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 68F6AFC3A; Thu, 6 Jun 2019 05:09:44 +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 x5659iFh020958; Thu, 6 Jun 2019 05:09:44 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5659iSe020957; Thu, 6 Jun 2019 05:09:44 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906060509.x5659iSe020957@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 05:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348725 - stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 348725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5CA084CA4 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.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 05:09:45 -0000 Author: allanjude Date: Thu Jun 6 05:09:43 2019 New Revision: 348725 URL: https://svnweb.freebsd.org/changeset/base/348725 Log: MFC r347953: MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee zfs_main: fix `zfs userspace` squashing unresolved entries The `zfs userspace` squashes all entries with unresolved numeric values into a single output entry due to the comparsion always made by the string name which is empty in case of unresolved IDs. Fix this by falling to a numerical comparison when either one of string values is not found. This then compares any numerical values after all with a name resolved. Signed-off-by: Pavel Boldin Signed-off-by: Brian Behlendorf Reported by: clusteradm Obtained from: ZFS-on-Linux Approved by: re (gjb) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Jun 6 03:31:55 2019 (r348724) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Jun 6 05:09:43 2019 (r348725) @@ -2361,6 +2361,7 @@ us_compare(const void *larg, const void *rarg, void *u case ZFS_PROP_NAME: propname = "name"; if (numname) { +compare_nums: (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u if (rv64 != lv64) rc = (rv64 < lv64) ? 1 : -1; } else { - (void) nvlist_lookup_string(lnvl, propname, - &lvstr); - (void) nvlist_lookup_string(rnvl, propname, - &rvstr); + if ((nvlist_lookup_string(lnvl, propname, + &lvstr) == ENOENT) || + (nvlist_lookup_string(rnvl, propname, + &rvstr) == ENOENT)) { + goto compare_nums; + } rc = strcmp(lvstr, rvstr); } break; From owner-svn-src-all@freebsd.org Thu Jun 6 05:10:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 089AA15C2C17; Thu, 6 Jun 2019 05:10:34 +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 8AAF684EAC; Thu, 6 Jun 2019 05:10:33 +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 5D81DFC41; Thu, 6 Jun 2019 05:10:33 +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 x565AXXb021912; Thu, 6 Jun 2019 05:10:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x565AXsK021911; Thu, 6 Jun 2019 05:10:33 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906060510.x565AXsK021911@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 05:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348726 - stable/11/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/11/sys/dev/acpica X-SVN-Commit-Revision: 348726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AAF684EAC 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.942,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 05:10:34 -0000 Author: allanjude Date: Thu Jun 6 05:10:32 2019 New Revision: 348726 URL: https://svnweb.freebsd.org/changeset/base/348726 Log: MFC r348065: Correct the way remaining battery life is calculated Previously, if a system had multiple batteries, the remaining life percentage was calculated as the average of each battery's percent remaining. This results in rather incorrect values when you consider the case of the Thinkpad X270 that has a small 3 cell internally battery, and a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%, but battery 1 is at 10%, you do not infact have 55% of your capacity remaining. The new method calculates the percentage based on remaining capacity out of total capacity, giving a much more accurate reading. PR: 229818 Submitted by: Keegan Drake H.P. Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Approved by: re (gjb) Modified: stable/11/sys/dev/acpica/acpi_battery.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_battery.c Thu Jun 6 05:09:43 2019 (r348725) +++ stable/11/sys/dev/acpica/acpi_battery.c Thu Jun 6 05:10:32 2019 (r348726) @@ -119,7 +119,7 @@ int acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo) { int batt_stat, devcount, dev_idx, error, i; - int total_cap, total_min, valid_rate, valid_units; + int total_cap, total_lfcap, total_min, valid_rate, valid_units; devclass_t batt_dc; device_t batt_dev; struct acpi_bst *bst; @@ -152,6 +152,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ dev_idx = -1; batt_stat = valid_rate = valid_units = 0; + total_cap = total_lfcap = 0; for (i = 0; i < devcount; i++) { /* Default info for every battery is "not present". */ acpi_reset_battinfo(&bi[i]); @@ -213,17 +214,23 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba if (!acpi_battery_bif_valid(bif)) continue; - /* Calculate percent capacity remaining. */ - bi[i].cap = (100 * bst[i].cap) / bif->lfcap; - /* * Some laptops report the "design-capacity" instead of the * "real-capacity" when the battery is fully charged. That breaks * the above arithmetic as it needs to be 100% maximum. */ - if (bi[i].cap > 100) - bi[i].cap = 100; + if (bst[i].cap > bif->lfcap) + bst[i].cap = bif->lfcap; + /* Calculate percent capacity remaining. */ + bi[i].cap = (100 * bst[i].cap) / bif->lfcap; + + /* If this battery is not present, don't use its capacity. */ + if (bi[i].cap != -1) { + total_cap += bst[i].cap; + total_lfcap += bif->lfcap; + } + /* * On systems with more than one battery, they may get used * sequentially, thus bst.rate may only signify the one currently @@ -244,7 +251,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba } /* Pass 2: calculate capacity and remaining time for all batteries. */ - total_cap = total_min = 0; + total_min = 0; for (i = 0; i < devcount; i++) { /* * If any batteries are discharging, use the sum of the bst.rate @@ -256,10 +263,6 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba else bi[i].min = 0; total_min += bi[i].min; - - /* If this battery is not present, don't use its capacity. */ - if (bi[i].cap != -1) - total_cap += bi[i].cap; } /* @@ -268,7 +271,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ if (valid_units > 0) { if (dev == NULL) { - battinfo->cap = total_cap / valid_units; + battinfo->cap = (total_cap * 100) / total_lfcap; battinfo->min = total_min; battinfo->state = batt_stat; battinfo->rate = valid_rate; From owner-svn-src-all@freebsd.org Thu Jun 6 07:49:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 08:12:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 08:43:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 11:32:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 177A615AFBCF; Thu, 6 Jun 2019 11:32:40 +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 ACC7A681BC; Thu, 6 Jun 2019 11:32:39 +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 8042B1BE0C; Thu, 6 Jun 2019 11:32:39 +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 x56BWdiY024309; Thu, 6 Jun 2019 11:32:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BWd7w024308; Thu, 6 Jun 2019 11:32:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061132.x56BWd7w024308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348731 - stable/12/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 348731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACC7A681BC 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:32:40 -0000 Author: avg Date: Thu Jun 6 11:32:39 2019 New Revision: 348731 URL: https://svnweb.freebsd.org/changeset/base/348731 Log: MFC r344359: fix userland illumos taskq code to pass relative timeout to cv_timedwait Unlike illumos, FreeBSD cv_timedwait requires a relative timeout. That applies both to the kernel illumos compatibility code and to the userland "fake kernel" code. Sponsored by: Panzura Modified: stable/12/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Jun 6 08:43:23 2019 (r348730) +++ stable/12/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Jun 6 11:32:39 2019 (r348731) @@ -79,8 +79,13 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nal * immediately retry the allocation. */ tq->tq_maxalloc_wait++; +#ifdef __FreeBSD__ rv = cv_timedwait(&tq->tq_maxalloc_cv, + &tq->tq_lock, hz); +#else + rv = cv_timedwait(&tq->tq_maxalloc_cv, &tq->tq_lock, ddi_get_lbolt() + hz); +#endif tq->tq_maxalloc_wait--; if (rv > 0) goto again; /* signaled */ From owner-svn-src-all@freebsd.org Thu Jun 6 11:35:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D149215AFCBB; Thu, 6 Jun 2019 11:35:24 +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 453F368361; Thu, 6 Jun 2019 11:35:24 +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 1E0C61BE12; Thu, 6 Jun 2019 11:35:24 +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 x56BZOkI024556; Thu, 6 Jun 2019 11:35:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BZN9o024555; Thu, 6 Jun 2019 11:35:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061135.x56BZN9o024555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348732 - stable/12/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 348732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 453F368361 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:35:25 -0000 Author: avg Date: Thu Jun 6 11:35:23 2019 New Revision: 348732 URL: https://svnweb.freebsd.org/changeset/base/348732 Log: MFC r344360: zpool.8: document -D flag for zpool status Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 11:32:39 2019 (r348731) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 11:35:23 2019 (r348732) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2018 +.Dd February 20, 2019 .Dt ZPOOL 8 .Os .Sh NAME @@ -187,7 +187,7 @@ .Op Ar device ... .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1862,7 +1862,7 @@ section, above, for more information on the available .It Xo .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1891,6 +1891,12 @@ done and the estimated time to completion. Both of the because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent +.It Fl D +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. From owner-svn-src-all@freebsd.org Thu Jun 6 11:37:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E86E215AFD66; Thu, 6 Jun 2019 11:36:59 +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 8CD59684B5; Thu, 6 Jun 2019 11:36:59 +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 64B961BE14; Thu, 6 Jun 2019 11:36:59 +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 x56Baxl6024682; Thu, 6 Jun 2019 11:36:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BaxQO024681; Thu, 6 Jun 2019 11:36:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061136.x56BaxQO024681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348733 - stable/12/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 348733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CD59684B5 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:37:00 -0000 Author: avg Date: Thu Jun 6 11:36:58 2019 New Revision: 348733 URL: https://svnweb.freebsd.org/changeset/base/348733 Log: MFC r344361: zpool.8: sort zpool status flags in the same order as in illumos manual Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 11:35:23 2019 (r348732) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun 6 11:36:58 2019 (r348733) @@ -1897,14 +1897,6 @@ Display a histogram of deduplication statistics, showi and referenced .Pq logically referenced in the pool block counts and sizes by reference count. -.It Fl x -Only display status for pools that are exhibiting errors or are otherwise -unavailable. -Warnings about pools not using the latest on-disk format, having non-native -block size or disabled features will not be included. -.It Fl v -Displays verbose data error information, printing out a complete list of all -data errors since the last complete pool scrub. .It Fl T Cm d Ns | Ns Cm u Print a timestamp. .Pp @@ -1916,6 +1908,14 @@ Use modifier .Cm u for unixtime .Pq equals Qq Ic date +%s . +.It Fl v +Displays verbose data error information, printing out a complete list of all +data errors since the last complete pool scrub. +.It Fl x +Only display status for pools that are exhibiting errors or are otherwise +unavailable. +Warnings about pools not using the latest on-disk format, having non-native +block size or disabled features will not be included. .El .It Xo .Nm From owner-svn-src-all@freebsd.org Thu Jun 6 11:38:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A6815AFE8B; Thu, 6 Jun 2019 11:38:54 +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 B4607699B6; Thu, 6 Jun 2019 11:38:53 +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 86A521BE16; Thu, 6 Jun 2019 11:38:53 +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 x56BcrVW024825; Thu, 6 Jun 2019 11:38:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BcrtM024824; Thu, 6 Jun 2019 11:38:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061138.x56BcrtM024824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348734 - stable/12/sys/dev/intpm X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/intpm X-SVN-Commit-Revision: 348734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4607699B6 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:38:54 -0000 Author: avg Date: Thu Jun 6 11:38:53 2019 New Revision: 348734 URL: https://svnweb.freebsd.org/changeset/base/348734 Log: MFC r345411: intpm: change translation of HBA error status to smbus(4) errors PIIX4_SMBHSTSTAT_ERR can be set for several reasons that, unfortunately, cannot be distinguished, but the most typical case is a missing or hung slave (SMB_ENOACK). PIIX4_SMBHSTSTAT_FAIL means failed or killed / aborted transaction, so it's previous mapping to SMB_ENOACK was not ideal. After this change an smb(4) access to a missing slave results in ENXIO rather than EIO. To me, that seems to be more appropriate. Modified: stable/12/sys/dev/intpm/intpm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/intpm/intpm.c ============================================================================== --- stable/12/sys/dev/intpm/intpm.c Thu Jun 6 11:36:58 2019 (r348733) +++ stable/12/sys/dev/intpm/intpm.c Thu Jun 6 11:38:53 2019 (r348734) @@ -525,12 +525,19 @@ intsmb_error(device_t dev, int status) { int error = 0; + /* + * PIIX4_SMBHSTSTAT_ERR can mean either of + * - SMB_ENOACK ("Unclaimed cycle"), + * - SMB_ETIMEOUT ("Host device time-out"), + * - SMB_EINVAL ("Illegal command field"). + * SMB_ENOACK seems to be most typical. + */ if (status & PIIX4_SMBHSTSTAT_ERR) - error |= SMB_EBUSERR; + error |= SMB_ENOACK; if (status & PIIX4_SMBHSTSTAT_BUSC) error |= SMB_ECOLLI; if (status & PIIX4_SMBHSTSTAT_FAIL) - error |= SMB_ENOACK; + error |= SMB_EABORT; if (error != 0 && bootverbose) device_printf(dev, "error = %d, status = %#x\n", error, status); From owner-svn-src-all@freebsd.org Thu Jun 6 11:42:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8F715B00FC; Thu, 6 Jun 2019 11:42:27 +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 3BCD869E04; Thu, 6 Jun 2019 11:42:27 +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 167771BFC4; Thu, 6 Jun 2019 11:42:27 +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 x56BgQOh029593; Thu, 6 Jun 2019 11:42:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BgQ5n029592; Thu, 6 Jun 2019 11:42:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061142.x56BgQ5n029592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348735 - in stable/12: share/man/man4 sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/gpio X-SVN-Commit-Revision: 348735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3BCD869E04 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:42:28 -0000 Author: avg Date: Thu Jun 6 11:42:26 2019 New Revision: 348735 URL: https://svnweb.freebsd.org/changeset/base/348735 Log: MFC r348153-r348155: gpioled: add a new hint for initial state hint.gpioled.%d.state determines the initial state of the LED when the driver takes control over it: 0 - the LED is off 1 - the LED is on -1 - the LED is kept as it was While here, add a module version declaration. Modified: stable/12/share/man/man4/gpioled.4 stable/12/sys/dev/gpio/gpioled.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/gpioled.4 ============================================================================== --- stable/12/share/man/man4/gpioled.4 Thu Jun 6 11:38:53 2019 (r348734) +++ stable/12/share/man/man4/gpioled.4 Thu Jun 6 11:42:26 2019 (r348735) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2016 +.Dd May 23, 2019 .Dt GPIOLED 4 .Os .Sh NAME @@ -73,6 +73,10 @@ Please note that this mask should only ever have one b (any other bits - i.e., pins - will be ignored). .It Va hint.gpioled.%d.invert If set to 1, the pin will be set to 0 to light the LED, and 1 to clear it. +.It Va hint.gpioled.%d.state +The initial state of the LED when the driver takes control over it. +If set to 1 or 0, the LED will be on or off correspondingly. +If set to -1, the LED will be kept in its original state. .El .Pp On a Modified: stable/12/sys/dev/gpio/gpioled.c ============================================================================== --- stable/12/sys/dev/gpio/gpioled.c Thu Jun 6 11:38:53 2019 (r348734) +++ stable/12/sys/dev/gpio/gpioled.c Thu Jun 6 11:42:26 2019 (r348735) @@ -115,6 +115,8 @@ gpioled_attach(device_t dev) name = NULL; resource_int_value(device_get_name(dev), device_get_unit(dev), "invert", &sc->sc_invert); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "state", &state); sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name : device_get_nameunit(dev), state); @@ -155,3 +157,4 @@ static driver_t gpioled_driver = { DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0); MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); +MODULE_VERSION(gpioled, 1); From owner-svn-src-all@freebsd.org Thu Jun 6 12:44:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD7E15B282E; Thu, 6 Jun 2019 12:44:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9206C0C1; Thu, 6 Jun 2019 12:44:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F28F91C9E2; Thu, 6 Jun 2019 12:44:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56CihFg061489; Thu, 6 Jun 2019 12:44:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56Cih3N061488; Thu, 6 Jun 2019 12:44:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906061244.x56Cih3N061488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Jun 2019 12:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348736 - stable/11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/tools X-SVN-Commit-Revision: 348736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A9206C0C1 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 12:44:44 -0000 Author: gjb Date: Thu Jun 6 12:44:43 2019 New Revision: 348736 URL: https://svnweb.freebsd.org/changeset/base/348736 Log: MFC r348439: Increase the size of the Vagrant default image size, as the 3GB size is too small to bootstrap the firstboot_pkgs list. While here, add the growfs(8) startup script to /etc/rc.conf, as Vagrant images can be resized by modifying the Vagrantfile. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/vagrant.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/vagrant.conf ============================================================================== --- stable/11/release/tools/vagrant.conf Thu Jun 6 11:42:26 2019 (r348735) +++ stable/11/release/tools/vagrant.conf Thu Jun 6 12:44:43 2019 (r348736) @@ -3,12 +3,15 @@ # $FreeBSD$ # +# The default of 3GB is too small for Vagrant, so override the size here. +export VMSIZE=8G + # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs" +export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs growfs" vagrant_common () { # The firstboot_pkgs rc.d script will download the repository From owner-svn-src-all@freebsd.org Thu Jun 6 15:04:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 15:18:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 15:21:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:03:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:09:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:22:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:23:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:27:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:27:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 16:28:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:13:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:20:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:35:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:43:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:48:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 17:57:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:00:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:01:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:05:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:21:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9892815BC130 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 F128A814B7 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: F128A814B7 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:28:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:29:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 18:35:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 19:40:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4058315BE16A; Thu, 6 Jun 2019 19:40: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 DAE7184A8F; Thu, 6 Jun 2019 19:40:12 +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 B0E57210E8; Thu, 6 Jun 2019 19:40:12 +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 x56JeC1t077394; Thu, 6 Jun 2019 19:40:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56JeCNl077393; Thu, 6 Jun 2019 19:40:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906061940.x56JeCNl077393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Jun 2019 19:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348752 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 348752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAE7184A8F 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.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:40:13 -0000 Author: jhb Date: Thu Jun 6 19:40:12 2019 New Revision: 348752 URL: https://svnweb.freebsd.org/changeset/base/348752 Log: MFC 348543: Warn about deprecated features on all major OS versions. Modified: stable/12/sys/kern/subr_bus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_bus.c ============================================================================== --- stable/12/sys/kern/subr_bus.c Thu Jun 6 17:20:35 2019 (r348751) +++ stable/12/sys/kern/subr_bus.c Thu Jun 6 19:40:12 2019 (r348752) @@ -5920,7 +5920,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); } @@ -5933,7 +5933,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-all@freebsd.org Thu Jun 6 19:40:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD1CA15BE18F for ; Thu, 6 Jun 2019 19:40:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (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 227A084A94 for ; Thu, 6 Jun 2019 19:40:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-lj1-x229.google.com with SMTP id j24so3191075ljg.1 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=XfBZucZCZLvMghaXeHyXqlSJKN/oXlBT6Ul2cn2DWGvVTIhdQbWGuZb4oo+K/E+sJ4 aUeu6SX3BFqgrrw1e/H/9tkmE5YQIXFmpbjAy16qGaw7MNkzAYup0gwB7KTt3lT1B2xM iU225fTvwtao5CN0m4kkHyNNWv/K+qGhKc+fauzrNI8GwOowCxjmVuSRuZ6xnULKnnMs KgTj5TnitEB5CuEzizqjAbjiwTqVaC6WeXUtxq9WHtJm47I8m1ImKgiE0DqzOWdOYri2 3e3k3i6UQwVDadQFiGhieQNW5OMmHa/6un89rKjOopEWDh7OBcOrYsDwpmOjyap5NuUU f1bQ== X-Gm-Message-State: APjAAAVm9zd28dTewd+iD3BtEMOSU29DaG6ev7qLVyQkKiM0OJ+POjDR oeXuI1JRcOetPcsEhpf30FggmIfcbS/xNFIOqfUFsQ== 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: 227A084A94 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 19:41:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB5B15BE21B; Thu, 6 Jun 2019 19:41:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7027384D3B; Thu, 6 Jun 2019 19:41:06 +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 0F3E221218; Thu, 6 Jun 2019 19:41:06 +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 x56Jf5oq077475; Thu, 6 Jun 2019 19:41:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56Jf5Te077474; Thu, 6 Jun 2019 19:41:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906061941.x56Jf5Te077474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Jun 2019 19:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348753 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 348753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7027384D3B 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.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:41:07 -0000 Author: jhb Date: Thu Jun 6 19:41:05 2019 New Revision: 348753 URL: https://svnweb.freebsd.org/changeset/base/348753 Log: MFC 348543: Warn about deprecated features on all major OS versions. Approved by: re (gjb) Modified: stable/11/sys/kern/subr_bus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_bus.c ============================================================================== --- stable/11/sys/kern/subr_bus.c Thu Jun 6 19:40:12 2019 (r348752) +++ stable/11/sys/kern/subr_bus.c Thu Jun 6 19:41:05 2019 (r348753) @@ -5742,7 +5742,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); } @@ -5755,7 +5755,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-all@freebsd.org Thu Jun 6 19:48:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E8E15BE52D; Thu, 6 Jun 2019 19:48: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 A1E5B85189; Thu, 6 Jun 2019 19:48:27 +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 70A322128A; Thu, 6 Jun 2019 19:48: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 x56JmRDr082797; Thu, 6 Jun 2019 19:48:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56JmRt9082796; Thu, 6 Jun 2019 19:48:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906061948.x56JmRt9082796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Jun 2019 19:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348754 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 348754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1E5B85189 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.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:48:28 -0000 Author: jhb Date: Thu Jun 6 19:48:27 2019 New Revision: 348754 URL: https://svnweb.freebsd.org/changeset/base/348754 Log: MFC 346931,346933: Note that ccr(4) now supports AES-CCM. 346931: Note that ccr(4) now supports AES-CCM. 346933: Rewrap some long lines. Whitespace only change. Modified: stable/12/share/man/man4/ccr.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ccr.4 ============================================================================== --- stable/12/share/man/man4/ccr.4 Thu Jun 6 19:41:05 2019 (r348753) +++ stable/12/share/man/man4/ccr.4 Thu Jun 6 19:48:27 2019 (r348754) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2019 +.Dd April 29, 2019 .Dt CCR 4 .Os .Sh NAME @@ -34,7 +34,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indeunt +.Bd -ragged -offset indent .Cd "device ccr" .Ed .Pp @@ -49,9 +49,10 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, -SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, -SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, +SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC +operations for .Xr crypto 4 and .Xr ipsec 4 . From owner-svn-src-all@freebsd.org Thu Jun 6 19:53:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4571E15BE745; Thu, 6 Jun 2019 19:53:37 +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 8F2B685571; Thu, 6 Jun 2019 19:53:36 +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 x56JrXBK059552; Thu, 6 Jun 2019 12:53:33 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x56JrXMs059551; Thu, 6 Jun 2019 12:53:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906061953.x56JrXMs059551@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348753 - stable/11/sys/kern In-Reply-To: <201906061941.x56Jf5Te077474@repo.freebsd.org> To: John Baldwin Date: Thu, 6 Jun 2019 12:53:33 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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: 8F2B685571 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.984,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:53:37 -0000 > Author: jhb > Date: Thu Jun 6 19:41:05 2019 > New Revision: 348753 > URL: https://svnweb.freebsd.org/changeset/base/348753 > > Log: > MFC 348543: Warn about deprecated features on all major OS versions. > > Approved by: re (gjb) > > Modified: > stable/11/sys/kern/subr_bus.c > Directory Properties: > stable/11/ (props changed) Relnotes: Yes This should probably be mentioned in the release notes so that users know what these new messages they are getting are about. Thanks, Rod > Modified: stable/11/sys/kern/subr_bus.c > ============================================================================== > --- stable/11/sys/kern/subr_bus.c Thu Jun 6 19:40:12 2019 (r348752) > +++ stable/11/sys/kern/subr_bus.c Thu Jun 6 19:41:05 2019 (r348753) > @@ -5742,7 +5742,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); > } > @@ -5755,7 +5755,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); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 6 19:56:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AD115BE7F8; Thu, 6 Jun 2019 19:56:25 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_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 5D609856FC; Thu, 6 Jun 2019 19:56:25 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id E3B891C7E8; Thu, 6 Jun 2019 19:56:24 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Thu, 6 Jun 2019 19:56:22 +0000 From: Glen Barber To: rgrimes@freebsd.org Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r348753 - stable/11/sys/kern Message-ID: <20190606195622.GU55311@FreeBSD.org> References: <201906061941.x56Jf5Te077474@repo.freebsd.org> <201906061953.x56JrXMs059551@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4NNqsQ/a67jpuySk" Content-Disposition: inline In-Reply-To: <201906061953.x56JrXMs059551@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 5D609856FC 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.980,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:56:25 -0000 --4NNqsQ/a67jpuySk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 06, 2019 at 12:53:33PM -0700, Rodney W. Grimes wrote: > > Author: jhb > > Date: Thu Jun 6 19:41:05 2019 > > New Revision: 348753 > > URL: https://svnweb.freebsd.org/changeset/base/348753 > >=20 > > Log: > > MFC 348543: Warn about deprecated features on all major OS versions. > > =20 > > Approved by: re (gjb) > >=20 > > Modified: > > stable/11/sys/kern/subr_bus.c > > Directory Properties: > > stable/11/ (props changed) >=20 > Relnotes: Yes >=20 > This should probably be mentioned in the release notes so > that users know what these new messages they are getting > are about. >=20 I'll make sure it is included. Glen --4NNqsQ/a67jpuySk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlz5b+YACgkQAxRYpUeP 4pOxoA//b0dTBc/nTz/Tb4jsuaKGW6jEqqv8GGitLfu/9Vn/7J83624rOjgyun3v Qg2VedxLW7iCygR2INszN87bi4y7yi44A5BlCBqI+BuXxupcXEx4b6hL1VFXfcay L2el2mNzl1jzDRmBByebYfB6x8sc4qdXHZ0aDhQdkpSYRrtYR0Oy/XbQ99j19X6b wEDJviniTX6R0WjiJGDCr6VP0FmOw84IioT3ZDmgdCSD9FDtEQtvWF4j/JrQwHBv QGURTiC2jIbHoZg7ux7aS0DlELGg/wKbqD3UURvHhFJQG+zGzkws9/JxtPytPtL9 tptElAlkAQ7aaFfOGW6/YV/YLO1R42dKkm7nR0ewlIc3hAPwV0oiM6jPiMjdfudS Hx8bRxNs4ujvcd1b+w5qVDb8OnDFdFElTFTmpS8A30pSYNMdwcSBRh/yhdjctYhM hUxfxO6zdmg5yTuPn82UG+wbw3wIN060WvEfbi5MMFz9cLMSnP4LG9oafxv0dX4W jWNnPtsE0lhKA/5REAVRmEkMMxzh9xjkyyunuyPsHoryYlwbIYY8lu+B06/BIWf8 lGtrRSSBCdG44J58uJGkEX6DlGiE47mdn6kqJavER5eE2bV17N+QSIRoM58T+crH vGgQlf7SfvUzmbFkpk4SPr+DVBSo2sypafSuW61kUa+5XWHe0QU= =J9n/ -----END PGP SIGNATURE----- --4NNqsQ/a67jpuySk-- From owner-svn-src-all@freebsd.org Thu Jun 6 19:56:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5A515BE844; Thu, 6 Jun 2019 19:56:38 +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 0552F857E8; Thu, 6 Jun 2019 19:56:38 +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 23D03EE9E; Thu, 6 Jun 2019 19:56:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348753 - stable/11/sys/kern To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201906061953.x56JrXMs059551@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: <71c1b128-3365-7e9a-89bb-6d4dc96a81d2@FreeBSD.org> Date: Thu, 6 Jun 2019 12:56:35 -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: <201906061953.x56JrXMs059551@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0552F857E8 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 19:56:39 -0000 On 6/6/19 12:53 PM, Rodney W. Grimes wrote: >> Author: jhb >> Date: Thu Jun 6 19:41:05 2019 >> New Revision: 348753 >> URL: https://svnweb.freebsd.org/changeset/base/348753 >> >> Log: >> MFC 348543: Warn about deprecated features on all major OS versions. >> >> Approved by: re (gjb) >> >> Modified: >> stable/11/sys/kern/subr_bus.c >> Directory Properties: >> stable/11/ (props changed) > > Relnotes: Yes > > This should probably be mentioned in the release notes so > that users know what these new messages they are getting > are about. I'm not sure if we need that? We've had deprecation warnings before (FCP-101, etc.) This was just an edge case where some recently-added warnings weren't triggering on 11. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Jun 6 20:02:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 20:02:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32DE15BEBAB; Thu, 6 Jun 2019 20:02:57 +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 5DAE185E7F; Thu, 6 Jun 2019 20:02:51 +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 x56K2nRD059618; Thu, 6 Jun 2019 13:02:49 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x56K2nVF059617; Thu, 6 Jun 2019 13:02:49 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906062002.x56K2nVF059617@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348753 - stable/11/sys/kern In-Reply-To: <71c1b128-3365-7e9a-89bb-6d4dc96a81d2@FreeBSD.org> To: John Baldwin Date: Thu, 6 Jun 2019 13:02:49 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-11@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: 5DAE185E7F 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.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 20:02:58 -0000 > On 6/6/19 12:53 PM, Rodney W. Grimes wrote: > >> Author: jhb > >> Date: Thu Jun 6 19:41:05 2019 > >> New Revision: 348753 > >> URL: https://svnweb.freebsd.org/changeset/base/348753 > >> > >> Log: > >> MFC 348543: Warn about deprecated features on all major OS versions. > >> > >> Approved by: re (gjb) > >> > >> Modified: > >> stable/11/sys/kern/subr_bus.c > >> Directory Properties: > >> stable/11/ (props changed) > > > > Relnotes: Yes > > > > This should probably be mentioned in the release notes so > > that users know what these new messages they are getting > > are about. > > I'm not sure if we need that? We've had deprecation warnings > before (FCP-101, etc.) This was just an edge case where some > recently-added warnings weren't triggering on 11. My larger concern here was that there running 11 and are now going to start getting warnings that are "Gone in 13" type of stuff and that may be confusing. Easy to document, and I think this is probably some of the first chunk that well start spitting out in the stable/11 branch so it may be the first time for many to see them. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 6 20:03:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F20515BEC13; Thu, 6 Jun 2019 20:03:24 +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 C30C885FAE; Thu, 6 Jun 2019 20:03:23 +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 A033D215D2; Thu, 6 Jun 2019 20:03:23 +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 x56K3NLl093049; Thu, 6 Jun 2019 20:03:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56K3Nl5093048; Thu, 6 Jun 2019 20:03:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906062003.x56K3Nl5093048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Jun 2019 20:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348755 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 348755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C30C885FAE 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.995,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 20:03:24 -0000 Author: jhb Date: Thu Jun 6 20:03:23 2019 New Revision: 348755 URL: https://svnweb.freebsd.org/changeset/base/348755 Log: MFC 348542: 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 Modified: stable/12/share/man/man4/ccr.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ccr.4 ============================================================================== --- stable/12/share/man/man4/ccr.4 Thu Jun 6 19:48:27 2019 (r348754) +++ stable/12/share/man/man4/ccr.4 Thu Jun 6 20:03:23 2019 (r348755) @@ -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-all@freebsd.org Thu Jun 6 20:03:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 160D415BEC86; Thu, 6 Jun 2019 20:03:56 +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 B0CA8860E7; Thu, 6 Jun 2019 20:03:55 +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 8D667215D5; Thu, 6 Jun 2019 20:03: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 x56K3tft093124; Thu, 6 Jun 2019 20:03:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56K3tYj093123; Thu, 6 Jun 2019 20:03:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201906062003.x56K3tYj093123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Jun 2019 20:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348756 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 348756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0CA8860E7 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.995,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 20:03:56 -0000 Author: jhb Date: Thu Jun 6 20:03:55 2019 New Revision: 348756 URL: https://svnweb.freebsd.org/changeset/base/348756 Log: MFC 348542: 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 Approved by: re (gjb) Modified: stable/11/share/man/man4/ccr.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ccr.4 ============================================================================== --- stable/11/share/man/man4/ccr.4 Thu Jun 6 20:03:23 2019 (r348755) +++ stable/11/share/man/man4/ccr.4 Thu Jun 6 20:03:55 2019 (r348756) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd June 3, 2019 .Dt CCR 4 .Os .Sh NAME @@ -34,8 +34,9 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indeunt +.Bd -ragged -offset indent .Cd "device ccr" +.Cd "device cxgbe" .Ed .Pp To load the driver as a From owner-svn-src-all@freebsd.org Thu Jun 6 20:12:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 20:54:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 21:04:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 21:24:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 21:25:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 22:56:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Jun 6 23:57:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 00:00:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9797C15C38A8; Fri, 7 Jun 2019 00:00:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37C648CFAB; Fri, 7 Jun 2019 00:00:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F41C23CE0; Fri, 7 Jun 2019 00:00:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5700Cbj013950; Fri, 7 Jun 2019 00:00:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5700Cas013948; Fri, 7 Jun 2019 00:00:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906070000.x5700Cas013948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 7 Jun 2019 00:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348765 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 348765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37C648CFAB 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.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 00:00:13 -0000 Author: gjb Date: Fri Jun 7 00:00:12 2019 New Revision: 348765 URL: https://svnweb.freebsd.org/changeset/base/348765 Log: Update stable/11 to BETA3 as part of the 11.3-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jun 6 23:57:28 2019 (r348764) +++ stable/11/sys/conf/newvers.sh Fri Jun 7 00:00:12 2019 (r348765) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 7 00:02:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 01:38:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 02:05:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 02:36:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034B415C62D9; Fri, 7 Jun 2019 02:36:28 +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 9AD7690B91; Fri, 7 Jun 2019 02:36:27 +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 727FD25810; Fri, 7 Jun 2019 02:36:27 +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 x572aR4a096833; Fri, 7 Jun 2019 02:36:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x572aRIV096832; Fri, 7 Jun 2019 02:36:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906070236.x572aRIV096832@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 02:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348769 - stable/11/lib/libcrypt X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/lib/libcrypt X-SVN-Commit-Revision: 348769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AD7690B91 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.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 02:36:28 -0000 Author: delphij Date: Fri Jun 7 02:36:26 2019 New Revision: 348769 URL: https://svnweb.freebsd.org/changeset/base/348769 Log: MFC r348302: Chase r261913: hardcoded default crypt(3) algorithm is SHA-512 when DES is not available. Submitted by: Ali Mashtizadeh Approved by: re (gjb) Modified: stable/11/lib/libcrypt/crypt.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcrypt/crypt.3 ============================================================================== --- stable/11/lib/libcrypt/crypt.3 Fri Jun 7 02:05:22 2019 (r348768) +++ stable/11/lib/libcrypt/crypt.3 Fri Jun 7 02:36:26 2019 (r348769) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2014 +.Dd May 26, 2019 .Dt CRYPT 3 .Os .Sh NAME @@ -220,7 +220,7 @@ This is currently .\" NOTICE: Also make sure to update this .\" DES -if it is available, or MD5 if not. +if it is available, or SHA-512 if not. .Pp How the salt is used will depend upon the algorithm for the hash. For From owner-svn-src-all@freebsd.org Fri Jun 7 04:09:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 05:03:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 06:35:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 08:21:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356EA15CBD77; Fri, 7 Jun 2019 08:21:03 +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 CF2086A9C2; Fri, 7 Jun 2019 08:21:02 +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 A909E13A8; Fri, 7 Jun 2019 08:21:02 +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 x578L2ke081808; Fri, 7 Jun 2019 08:21:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x578L2KU081806; Fri, 7 Jun 2019 08:21:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906070821.x578L2KU081806@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:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348773 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 348773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF2086A9C2 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.995,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 08:21:03 -0000 Author: ae Date: Fri Jun 7 08:21:01 2019 New Revision: 348773 URL: https://svnweb.freebsd.org/changeset/base/348773 Log: MFC r348235: Add `missing` and `or-flush` options to "ipfw table create" command to simplify firewall reloading. The `missing` option suppresses EEXIST error code, but does check that existing table has the same parameters as new one. The `or-flush` option implies `missing` option and additionally does flush for table if it is already exist. Submitted by: lev Differential Revision: https://reviews.freebsd.org/D18339 MFC r348301 Remove unused token that was added in r348235. Modified: stable/12/sbin/ipfw/ipfw.8 stable/12/sbin/ipfw/ipfw2.h stable/12/sbin/ipfw/tables.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Fri Jun 7 06:35:42 2019 (r348772) +++ stable/12/sbin/ipfw/ipfw.8 Fri Jun 7 08:21:01 2019 (r348773) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2019 +.Dd May 24, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -2138,7 +2138,7 @@ The following creation options are supported: .Bl -tag -width indent .It Ar create-options : Ar create-option | create-options .It Ar create-option : Cm type Ar table-type | Cm valtype Ar value-mask | Cm algo Ar algo-desc | -.Cm limit Ar number | Cm locked +.Cm limit Ar number | Cm locked | Cm missing | Cm or-flush .It Cm type Table key type. .It Cm valtype @@ -2149,6 +2149,13 @@ Table algorithm to use (see below). Maximum number of items that may be inserted into table. .It Cm locked Restrict any table modifications. +.It Cm missing +Do not fail if table already exists and has exactly same options as new one. +.It Cm or-flush +Flush existing table with same name instead of returning error. +Implies +.Cm missing +so existing table must be compatible with new one. .El .Pp Some of these options may be modified later via Modified: stable/12/sbin/ipfw/ipfw2.h ============================================================================== --- stable/12/sbin/ipfw/ipfw2.h Fri Jun 7 06:35:42 2019 (r348772) +++ stable/12/sbin/ipfw/ipfw2.h Fri Jun 7 08:21:01 2019 (r348773) @@ -264,6 +264,8 @@ enum tokens { TOK_UNLOCK, TOK_VLIST, TOK_OLIST, + TOK_MISSING, + TOK_ORFLUSH, /* NAT64 tokens */ TOK_NAT64STL, Modified: stable/12/sbin/ipfw/tables.c ============================================================================== --- stable/12/sbin/ipfw/tables.c Fri Jun 7 06:35:42 2019 (r348772) +++ stable/12/sbin/ipfw/tables.c Fri Jun 7 08:21:01 2019 (r348773) @@ -327,6 +327,8 @@ static struct _s_x tablenewcmds[] = { { "algo", TOK_ALGO }, { "limit", TOK_LIMIT }, { "locked", TOK_LOCK }, + { "missing", TOK_MISSING }, + { "or-flush", TOK_ORFLUSH }, { NULL, 0 } }; @@ -389,19 +391,19 @@ table_print_type(char *tbuf, size_t size, uint8_t type * Creates new table * * ipfw table NAME create [ type { addr | iface | number | flow } ] - * [ algo algoname ] + * [ algo algoname ] [missing] [or-flush] */ static void table_create(ipfw_obj_header *oh, int ac, char *av[]) { - ipfw_xtable_info xi; - int error, tcmd, val; + ipfw_xtable_info xi, xie; + int error, missing, orflush, tcmd, val; uint32_t fset, fclear; char *e, *p; char tbuf[128]; + missing = orflush = 0; memset(&xi, 0, sizeof(xi)); - while (ac > 0) { tcmd = get_token(tablenewcmds, *av, "option"); ac--; av++; @@ -457,6 +459,12 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) case TOK_LOCK: xi.flags |= IPFW_TGFLAGS_LOCKED; break; + case TOK_ORFLUSH: + orflush = 1; + /* FALLTHROUGH */ + case TOK_MISSING: + missing = 1; + break; } } @@ -466,8 +474,28 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; - if ((error = table_do_create(oh, &xi)) != 0) + error = table_do_create(oh, &xi); + + if (error == 0) + return; + + if (errno != EEXIST || missing == 0) err(EX_OSERR, "Table creation failed"); + + /* Check that existing table is the same we are trying to create */ + if (table_get_info(oh, &xie) != 0) + err(EX_OSERR, "Existing table check failed"); + + if (xi.limit != xie.limit || xi.type != xie.type || + xi.tflags != xie.tflags || xi.vmask != xie.vmask || ( + xi.algoname[0] != '\0' && strcmp(xi.algoname, + xie.algoname) != 0) || xi.flags != xie.flags) + errx(EX_DATAERR, "The existing table is not compatible " + "with one you are creating."); + + /* Flush existing table if instructed to do so */ + if (orflush != 0 && table_flush(oh) != 0) + err(EX_OSERR, "Table flush on creation failed"); } /* From owner-svn-src-all@freebsd.org Fri Jun 7 08:30:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 08:30:36 -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-all@freebsd.org Fri Jun 7 10:09:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4870B15A813C; Fri, 7 Jun 2019 10:09:44 +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 DA93E6D7F9; Fri, 7 Jun 2019 10:09: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 B76482504; Fri, 7 Jun 2019 10:09: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 x57A9hwS037311; Fri, 7 Jun 2019 10:09:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57A9hVG037310; Fri, 7 Jun 2019 10:09:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201906071009.x57A9hVG037310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Jun 2019 10:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348775 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 348775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA93E6D7F9 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.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 10:09:44 -0000 Author: kib Date: Fri Jun 7 10:09:43 2019 New Revision: 348775 URL: https://svnweb.freebsd.org/changeset/base/348775 Log: MFC r348476, r348630 (by alc): Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Fri Jun 7 08:30:35 2019 (r348774) +++ stable/12/sys/amd64/amd64/pmap.c Fri Jun 7 10:09:43 2019 (r348775) @@ -4114,6 +4114,50 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse return (rv); } +static void +pmap_demote_pde_check(pt_entry_t *firstpte __unused, pt_entry_t newpte __unused) +{ +#ifdef INVARIANTS +#ifdef DIAGNOSTIC + pt_entry_t *xpte, *ypte; + + for (xpte = firstpte; xpte < firstpte + NPTEPG; + xpte++, newpte += PAGE_SIZE) { + if ((*xpte & PG_FRAME) != (newpte & PG_FRAME)) { + printf("pmap_demote_pde: xpte %zd and newpte map " + "different pages: found %#lx, expected %#lx\n", + xpte - firstpte, *xpte, newpte); + printf("page table dump\n"); + for (ypte = firstpte; ypte < firstpte + NPTEPG; ypte++) + printf("%zd %#lx\n", ypte - firstpte, *ypte); + panic("firstpte"); + } + } +#else + KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), + ("pmap_demote_pde: firstpte and newpte map different physical" + " addresses")); +#endif +#endif +} + +static void +pmap_demote_pde_abort(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, + pd_entry_t oldpde, struct rwlock **lockp) +{ + struct spglist free; + vm_offset_t sva; + + SLIST_INIT(&free); + sva = trunc_2mpage(va); + pmap_remove_pde(pmap, pde, sva, &free, lockp); + if ((oldpde & pmap_global_bit(pmap)) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); + vm_page_free_pages_toq(&free, true); + CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx in pmap %p", + va, pmap); +} + static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp) @@ -4123,12 +4167,11 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v pt_entry_t PG_A, PG_G, PG_M, PG_PKU_MASK, PG_RW, PG_V; vm_paddr_t mptepa; vm_page_t mpte; - struct spglist free; - vm_offset_t sva; int PG_PTE_CACHE; + bool in_kernel; - PG_G = pmap_global_bit(pmap); PG_A = pmap_accessed_bit(pmap); + PG_G = pmap_global_bit(pmap); PG_M = pmap_modified_bit(pmap); PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); @@ -4136,42 +4179,61 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v PG_PKU_MASK = pmap_pku_mask_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + in_kernel = va >= VM_MAXUSER_ADDRESS; oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); - if ((oldpde & PG_A) == 0 || (mpte = pmap_remove_pt_page(pmap, va)) == - NULL) { + + /* + * Invalidate the 2MB page mapping and return "failure" if the + * 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); + } + + mpte = pmap_remove_pt_page(pmap, va); + if (mpte == NULL) { + KASSERT((oldpde & PG_W) == 0, ("pmap_demote_pde: page table page for a wired mapping" " is missing")); /* - * Invalidate the 2MB page mapping and return "failure" if the - * mapping was never accessed or the allocation of the new - * page table page fails. If the 2MB page mapping belongs to - * the direct map region of the kernel's address space, then - * the page allocation request specifies the highest possible - * priority (VM_ALLOC_INTERRUPT). Otherwise, the priority is - * normal. Page table pages are preallocated for every other - * part of the kernel address space, so the direct map region - * is the only part of the kernel address space that must be - * handled here. + * If the page table page is missing and the mapping + * is for a kernel address, the mapping must belong to + * the direct map. Page table pages are preallocated + * for every other part of the kernel address space, + * so the direct map region is the only part of the + * kernel address space that must be handled here. */ - if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL, - pmap_pde_pindex(va), (va >= DMAP_MIN_ADDRESS && va < - DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { - SLIST_INIT(&free); - sva = trunc_2mpage(va); - pmap_remove_pde(pmap, pde, sva, &free, lockp); - if ((oldpde & PG_G) == 0) - pmap_invalidate_pde_page(pmap, sva, oldpde); - vm_page_free_pages_toq(&free, true); - CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" - " in pmap %p", va, pmap); + KASSERT(!in_kernel || (va >= DMAP_MIN_ADDRESS && + va < DMAP_MAX_ADDRESS), + ("pmap_demote_pde: No saved mpte for va %#lx", va)); + + /* + * If the 2MB page mapping belongs to the direct map + * region of the kernel's address space, then the page + * allocation request specifies the highest possible + * priority (VM_ALLOC_INTERRUPT). Otherwise, the + * priority is normal. + */ + mpte = vm_page_alloc(NULL, pmap_pde_pindex(va), + (in_kernel ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + + /* + * If the allocation of the new page table page fails, + * invalidate the 2MB page mapping and return "failure". + */ + if (mpte == NULL) { + pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); return (FALSE); } - if (va < VM_MAXUSER_ADDRESS) { + + if (!in_kernel) { mpte->wire_count = NPTEPG; pmap_resident_count_inc(pmap, 1); } @@ -4179,8 +4241,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; @@ -4193,9 +4253,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v if ((oldpde & PG_PROMOTED) == 0) pmap_fill_ptp(firstpte, newpte); - KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), - ("pmap_demote_pde: firstpte and newpte map different physical" - " addresses")); + pmap_demote_pde_check(firstpte, newpte); /* * If the mapping has changed attributes, update the page table @@ -4230,7 +4288,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v /* * Invalidate a stale recursive mapping of the page table page. */ - if (va >= VM_MAXUSER_ADDRESS) + if (in_kernel) pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va)); /* @@ -4240,8 +4298,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, lockp); atomic_add_long(&pmap_pde_demotions, 1); - CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx" - " in pmap %p", va, pmap); + CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx in pmap %p", + va, pmap); return (TRUE); } From owner-svn-src-all@freebsd.org Fri Jun 7 13:04:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 14:51:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 14:57:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 15:23:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 15:48:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 15:53:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 17:05:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C7BF15B208E; Fri, 7 Jun 2019 17:05:59 +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 AF5248238E; Fri, 7 Jun 2019 17:05:58 +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 9D07B6F11; Fri, 7 Jun 2019 17:05: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 x57H5wbk056536; Fri, 7 Jun 2019 17:05:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57H5wZ7056535; Fri, 7 Jun 2019 17:05:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906071705.x57H5wZ7056535@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:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348780 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 348780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF5248238E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 17:05:59 -0000 Author: markj Date: Fri Jun 7 17:05:58 2019 New Revision: 348780 URL: https://svnweb.freebsd.org/changeset/base/348780 Log: MFC r348457: Remove a redundant vm_page_remove() call. Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Fri Jun 7 15:53:27 2019 (r348779) +++ stable/12/sys/vm/vm_page.c Fri Jun 7 17:05:58 2019 (r348780) @@ -2639,7 +2639,6 @@ retry: } else { m->flags &= ~PG_ZERO; vm_page_dequeue(m); - vm_page_remove(m); if (vm_page_free_prep(m)) SLIST_INSERT_HEAD(&free, m, plinks.s.ss); From owner-svn-src-all@freebsd.org Fri Jun 7 17:09:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 17:54:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 17:59:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 18:01:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5431815B3419; Fri, 7 Jun 2019 18:01:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBD6C8438B; Fri, 7 Jun 2019 18:01:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C58CF7907; Fri, 7 Jun 2019 18:01:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57I1TNf087374; Fri, 7 Jun 2019 18:01:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57I1TVM087373; Fri, 7 Jun 2019 18:01:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201906071801.x57I1TVM087373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 7 Jun 2019 18:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348784 - stable/12/lib/msun/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/lib/msun/tests X-SVN-Commit-Revision: 348784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBD6C8438B 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.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 18:01:30 -0000 Author: dim Date: Fri Jun 7 18:01:29 2019 New Revision: 348784 URL: https://svnweb.freebsd.org/changeset/base/348784 Log: MFC r348500: Partially revert r271349, which disabled the msun cexp test #4 on i386. Ensure the expected result is stored first in a volatile variable with the desired type. This makes all the tests succeed. Slightly changed from the original pull request, but functionally the same. Obtained from: https://github.com/freebsd/freebsd/pull/401 Submitted by: Moritz Buhl PR: 191676 Modified: stable/12/lib/msun/tests/cexp_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/msun/tests/cexp_test.c ============================================================================== --- stable/12/lib/msun/tests/cexp_test.c Fri Jun 7 17:58:59 2019 (r348783) +++ stable/12/lib/msun/tests/cexp_test.c Fri Jun 7 18:01:29 2019 (r348784) @@ -59,13 +59,21 @@ __FBSDID("$FreeBSD$"); * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. */ -#define test(func, z, result, exceptmask, excepts, checksign) do { \ +#define test_t(type, func, z, result, exceptmask, excepts, checksign) \ +do { \ volatile long double complex _d = z; \ + volatile type complex _r = result; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(cfpequal_cs((func)(_d), (_r), (checksign))); \ assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ } while (0) +#define test(func, z, result, exceptmask, excepts, checksign) \ + test_t(double, func, z, result, exceptmask, excepts, checksign) + +#define test_f(func, z, result, exceptmask, excepts, checksign) \ + test_t(float, func, z, result, exceptmask, excepts, checksign) + /* Test within a given tolerance. */ #define test_tol(func, z, result, tol) do { \ volatile long double complex _d = z; \ @@ -76,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* Test all the functions that compute cexp(x). */ #define testall(x, result, exceptmask, excepts, checksign) do { \ test(cexp, x, result, exceptmask, excepts, checksign); \ - test(cexpf, x, result, exceptmask, excepts, checksign); \ + test_f(cexpf, x, result, exceptmask, excepts, checksign); \ } while (0) /* @@ -198,10 +206,10 @@ test_reals(void) test(cexp, CMPLXL(finites[i], -0.0), CMPLXL(exp(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], 0.0), + test_f(cexpf, CMPLXL(finites[i], 0.0), CMPLXL(expf(finites[i]), 0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], -0.0), + test_f(cexpf, CMPLXL(finites[i], -0.0), CMPLXL(expf(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); } @@ -220,10 +228,10 @@ test_imaginaries(void) test(cexp, CMPLXL(-0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(0.0, finites[i]), + test_f(cexpf, CMPLXL(0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(-0.0, finites[i]), + test_f(cexpf, CMPLXL(-0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } @@ -302,12 +310,8 @@ main(void) test_inf(); printf("ok 3 - cexp inf\n"); -#if defined(__i386__) - printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n"); -#else test_reals(); printf("ok 4 - cexp reals\n"); -#endif test_imaginaries(); printf("ok 5 - cexp imaginaries\n"); From owner-svn-src-all@freebsd.org Fri Jun 7 18:23:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 18:34:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 18:52:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A82E615B431B; Fri, 7 Jun 2019 18:52:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4D385C18; Fri, 7 Jun 2019 18:52:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB7281C2; Fri, 7 Jun 2019 18:52:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57IqaHZ014355; Fri, 7 Jun 2019 18:52:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57IqavD014354; Fri, 7 Jun 2019 18:52:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201906071852.x57IqavD014354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 7 Jun 2019 18:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348787 - stable/11/lib/msun/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/lib/msun/tests X-SVN-Commit-Revision: 348787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E4D385C18 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 18:52:38 -0000 Author: dim Date: Fri Jun 7 18:52:36 2019 New Revision: 348787 URL: https://svnweb.freebsd.org/changeset/base/348787 Log: MFC r348500: Partially revert r271349, which disabled the msun cexp test #4 on i386. Ensure the expected result is stored first in a volatile variable with the desired type. This makes all the tests succeed. Slightly changed from the original pull request, but functionally the same. Approved by: re (gjb) Obtained from: https://github.com/freebsd/freebsd/pull/401 Submitted by: Moritz Buhl PR: 191676 Modified: stable/11/lib/msun/tests/cexp_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/tests/cexp_test.c ============================================================================== --- stable/11/lib/msun/tests/cexp_test.c Fri Jun 7 18:34:48 2019 (r348786) +++ stable/11/lib/msun/tests/cexp_test.c Fri Jun 7 18:52:36 2019 (r348787) @@ -59,13 +59,21 @@ __FBSDID("$FreeBSD$"); * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. */ -#define test(func, z, result, exceptmask, excepts, checksign) do { \ +#define test_t(type, func, z, result, exceptmask, excepts, checksign) \ +do { \ volatile long double complex _d = z; \ + volatile type complex _r = result; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(cfpequal_cs((func)(_d), (_r), (checksign))); \ assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ } while (0) +#define test(func, z, result, exceptmask, excepts, checksign) \ + test_t(double, func, z, result, exceptmask, excepts, checksign) + +#define test_f(func, z, result, exceptmask, excepts, checksign) \ + test_t(float, func, z, result, exceptmask, excepts, checksign) + /* Test within a given tolerance. */ #define test_tol(func, z, result, tol) do { \ volatile long double complex _d = z; \ @@ -76,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* Test all the functions that compute cexp(x). */ #define testall(x, result, exceptmask, excepts, checksign) do { \ test(cexp, x, result, exceptmask, excepts, checksign); \ - test(cexpf, x, result, exceptmask, excepts, checksign); \ + test_f(cexpf, x, result, exceptmask, excepts, checksign); \ } while (0) /* @@ -198,10 +206,10 @@ test_reals(void) test(cexp, CMPLXL(finites[i], -0.0), CMPLXL(exp(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], 0.0), + test_f(cexpf, CMPLXL(finites[i], 0.0), CMPLXL(expf(finites[i]), 0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], -0.0), + test_f(cexpf, CMPLXL(finites[i], -0.0), CMPLXL(expf(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); } @@ -220,10 +228,10 @@ test_imaginaries(void) test(cexp, CMPLXL(-0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(0.0, finites[i]), + test_f(cexpf, CMPLXL(0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(-0.0, finites[i]), + test_f(cexpf, CMPLXL(-0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } @@ -302,12 +310,8 @@ main(void) test_inf(); printf("ok 3 - cexp inf\n"); -#if defined(__i386__) - printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n"); -#else test_reals(); printf("ok 4 - cexp reals\n"); -#endif test_imaginaries(); printf("ok 5 - cexp imaginaries\n"); From owner-svn-src-all@freebsd.org Fri Jun 7 19:03:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 20:59:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 21:30:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Jun 7 22:24:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477FD15B8778; Fri, 7 Jun 2019 22:24:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3EF48C280; Fri, 7 Jun 2019 22:24:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FC74A64E; Fri, 7 Jun 2019 22:24:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x57MOw2f024644; Fri, 7 Jun 2019 22:24:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x57MOwlb024643; Fri, 7 Jun 2019 22:24:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201906072224.x57MOwlb024643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 7 Jun 2019 22:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348792 - stable/12/sys/geom/nop X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/geom/nop X-SVN-Commit-Revision: 348792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3EF48C280 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.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 22:24:59 -0000 Author: mckusick Date: Fri Jun 7 22:24:57 2019 New Revision: 348792 URL: https://svnweb.freebsd.org/changeset/base/348792 Log: MFC of 348259 Proper draining of GEOM nop forced shutdown. Modified: stable/12/sys/geom/nop/g_nop.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/nop/g_nop.c ============================================================================== --- stable/12/sys/geom/nop/g_nop.c Fri Jun 7 21:30:11 2019 (r348791) +++ stable/12/sys/geom/nop/g_nop.c Fri Jun 7 22:24:57 2019 (r348792) @@ -54,17 +54,26 @@ static int g_nop_destroy_geom(struct gctl_req *req, st struct g_geom *gp); static void g_nop_config(struct gctl_req *req, struct g_class *mp, const char *verb); -static void g_nop_dumpconf(struct sbuf *sb, const char *indent, - struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static g_access_t g_nop_access; +static g_dumpconf_t g_nop_dumpconf; +static g_orphan_t g_nop_orphan; +static g_provgone_t g_nop_providergone; +static g_resize_t g_nop_resize; +static g_start_t g_nop_start; struct g_class g_nop_class = { .name = G_NOP_CLASS_NAME, .version = G_VERSION, .ctlreq = g_nop_config, - .destroy_geom = g_nop_destroy_geom + .destroy_geom = g_nop_destroy_geom, + .access = g_nop_access, + .dumpconf = g_nop_dumpconf, + .orphan = g_nop_orphan, + .providergone = g_nop_providergone, + .resize = g_nop_resize, + .start = g_nop_start, }; - static void g_nop_orphan(struct g_consumer *cp) { @@ -277,11 +286,6 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, sc->sc_wrotebytes = 0; mtx_init(&sc->sc_lock, "gnop lock", NULL, MTX_DEF); gp->softc = sc; - gp->start = g_nop_start; - gp->orphan = g_nop_orphan; - gp->resize = g_nop_resize; - gp->access = g_nop_access; - gp->dumpconf = g_nop_dumpconf; newpp = g_new_providerf(gp, "%s", gp->name); newpp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; @@ -314,6 +318,18 @@ fail: return (error); } +static void +g_nop_providergone(struct g_provider *pp) +{ + struct g_geom *gp = pp->geom; + struct g_nop_softc *sc = gp->softc; + + gp->softc = NULL; + free(sc->sc_physpath, M_GEOM); + mtx_destroy(&sc->sc_lock); + g_free(sc); +} + static int g_nop_destroy(struct g_geom *gp, boolean_t force) { @@ -324,7 +340,6 @@ g_nop_destroy(struct g_geom *gp, boolean_t force) sc = gp->softc; if (sc == NULL) return (ENXIO); - free(sc->sc_physpath, M_GEOM); pp = LIST_FIRST(&gp->provider); if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { if (force) { @@ -338,9 +353,6 @@ g_nop_destroy(struct g_geom *gp, boolean_t force) } else { G_NOP_DEBUG(0, "Device %s removed.", gp->name); } - gp->softc = NULL; - mtx_destroy(&sc->sc_lock); - g_free(sc); g_wither_geom(gp, ENXIO); return (0); From owner-svn-src-all@freebsd.org Sat Jun 8 02:30:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C187215BEBE0; Sat, 8 Jun 2019 02:30:17 +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 576F26DF03; Sat, 8 Jun 2019 02:30:17 +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 2B88FD0A3; Sat, 8 Jun 2019 02:30:17 +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 x582UGG7055136; Sat, 8 Jun 2019 02:30:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x582UGoY055134; Sat, 8 Jun 2019 02:30:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906080230.x582UGoY055134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Jun 2019 02:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348793 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 348793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 576F26DF03 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.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 02:30:17 -0000 Author: mav Date: Sat Jun 8 02:30:16 2019 New Revision: 348793 URL: https://svnweb.freebsd.org/changeset/base/348793 Log: MFC r348496: Document max_chains bump to 16384 at r330049. Modified: stable/12/share/man/man4/mpr.4 stable/12/share/man/man4/mps.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/mpr.4 ============================================================================== --- stable/12/share/man/man4/mpr.4 Fri Jun 7 22:24:57 2019 (r348792) +++ stable/12/share/man/man4/mpr.4 Sat Jun 8 02:30:16 2019 (r348793) @@ -38,7 +38,7 @@ .\" $Id$ .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd June 1, 2019 .Dt MPR 4 .Os .Sh NAME @@ -149,7 +149,7 @@ set this tunable in dev.mpr.X.max_chains=NNNN .Ed .Pp -The default max_chains value is 2048. +The default max_chains value is 16384. .Pp The current number of free chain frames is stored in the dev.mpr.X.chain_free Modified: stable/12/share/man/man4/mps.4 ============================================================================== --- stable/12/share/man/man4/mps.4 Fri Jun 7 22:24:57 2019 (r348792) +++ stable/12/share/man/man4/mps.4 Sat Jun 8 02:30:16 2019 (r348793) @@ -38,7 +38,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd June 1, 2019 .Dt MPS 4 .Os .Sh NAME @@ -143,7 +143,7 @@ set this tunable in dev.mps.X.max_chains=NNNN .Ed .Pp -The default max_chains value is 2048. +The default max_chains value is 16384. .Pp The current number of free chain frames is stored in the dev.mps.X.chain_free From owner-svn-src-all@freebsd.org Sat Jun 8 02:36:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 03:07:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 08:25:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 09:34:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 13:40:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 13:41:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 15:19:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 15:24:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 16:03:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 16:05:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 16:15:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 16:26:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 17:10:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB6F15ADE2E for ; Sat, 8 Jun 2019 17:10:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 BC2676AE07 for ; Sat, 8 Jun 2019 17:10:46 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x833.google.com with SMTP id u12so6045137qth.3 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=AkSFxXTCrIZXXDdiMtE+EF+Lze7HZ/Uui3l6rrRAFV2Yf07ydqW2dPVDnS6tajRX7m gEaZ9jmraIMR7nh11KnFe3Qe2/YSBqHMn8Ng7+q3YB+Wrqbj4N7OOvIHfuR0JeQhnTJc 8hW3rM8yuruswuvDSjX1yqbRFBOoenqAJ2ui6qblurUZkvIiMDPUTiRrQxXA8Batsf7Y yTT+YiGH4+Mqu6gZyZLfkXv5ouBX0HUOrq2TKvh9FPD2C2CCxUn5hlPonVyBIasG1q8B bJEUgKtqfeXDeodIg747Ls6Wfc74nmRBCEh2MRDBSU8SlzrD5xN6vxAxJNVWuOpcNX6b oqiA== X-Gm-Message-State: APjAAAV1aQ63fFncAeOtPusc3fmWOxZ7XaZzuqrk7DZwMMjzQw0qWoCR q7sBRmu4dLqJ/ZbwYzKgp8v76Q== 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: BC2676AE07 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 17:17:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 17:38:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 17:44:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 17:49:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 18:26:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 18:59:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 19:02:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 19:16:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 19:50:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 19:58:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 19:58:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 20:26:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 20:28:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 21:33:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 21:36:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Sat Jun 8 22:25:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABB1115B5535; Sat, 8 Jun 2019 22:25:48 +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 4EDF875D0B; Sat, 8 Jun 2019 22:25:48 +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 2525321DB8; Sat, 8 Jun 2019 22:25:48 +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 x58MPlHn093408; Sat, 8 Jun 2019 22:25:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58MPlf4093407; Sat, 8 Jun 2019 22:25:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906082225.x58MPlf4093407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 8 Jun 2019 22:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348819 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDF875D0B 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.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.887,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:25:48 -0000 Author: cy Date: Sat Jun 8 22:25:47 2019 New Revision: 348819 URL: https://svnweb.freebsd.org/changeset/base/348819 Log: MFC r348310: Remove compile-time tests for unsupported versions of FreeBSD. Approved by: re (gjb@) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 8 21:36:22 2019 (r348818) +++ stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 8 22:25:47 2019 (r348819) @@ -30,9 +30,9 @@ #if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) # include #endif -#if defined(__FreeBSD__) && (__FreeBSD_version > 220000) +#if defined(__FreeBSD__) # include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#if defined(_KERNEL) #include #else #define CURVNET_SET(arg) From owner-svn-src-all@freebsd.org Sat Jun 8 22:27:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1543C15B55D7; Sat, 8 Jun 2019 22:27:10 +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 A9B0475EAB; Sat, 8 Jun 2019 22:27:09 +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 83D8321DBA; Sat, 8 Jun 2019 22:27:09 +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 x58MR9li093502; Sat, 8 Jun 2019 22:27:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58MR9Dp093501; Sat, 8 Jun 2019 22:27:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906082227.x58MR9Dp093501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 8 Jun 2019 22:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348820 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9B0475EAB 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.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.887,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:27:10 -0000 Author: cy Date: Sat Jun 8 22:27:09 2019 New Revision: 348820 URL: https://svnweb.freebsd.org/changeset/base/348820 Log: MFC r348311: Fix indentation and while at it simplfy the code. Reported by: lwhsu@ Approved by: re (gjb@) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jun 8 22:25:47 2019 (r348819) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jun 8 22:27:09 2019 (r348820) @@ -4982,16 +4982,16 @@ frrequest(softc, unit, req, data, set, makecopy) error = ipf_outobj(softc, data, fp, IPFOBJ_FRENTRY); if (error == 0) { - if ((f->fr_dsize != 0) && (uptr != NULL)) + if ((f->fr_dsize != 0) && (uptr != NULL)) { error = COPYOUT(f->fr_data, uptr, f->fr_dsize); - if (error != 0) { + if (error == 0) { + f->fr_hits = 0; + f->fr_bytes = 0; + } else { IPFERROR(28); error = EFAULT; } - if (error == 0) { - f->fr_hits = 0; - f->fr_bytes = 0; } } } From owner-svn-src-all@freebsd.org Sat Jun 8 22:28:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1E4A15B5678; Sat, 8 Jun 2019 22:28:29 +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 5787B76021; Sat, 8 Jun 2019 22:28:29 +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 2E45B21DBC; Sat, 8 Jun 2019 22:28:29 +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 x58MSTOv093594; Sat, 8 Jun 2019 22:28:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58MSTWC093593; Sat, 8 Jun 2019 22:28:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906082228.x58MSTWC093593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 8 Jun 2019 22:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348821 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5787B76021 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.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:28:29 -0000 Author: cy Date: Sat Jun 8 22:28:28 2019 New Revision: 348821 URL: https://svnweb.freebsd.org/changeset/base/348821 Log: MFC r348312: style(9) Approved by: re (gjb@) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jun 8 22:27:09 2019 (r348820) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jun 8 22:28:28 2019 (r348821) @@ -3913,7 +3913,7 @@ ipf_fixskip(listp, rp, addremove) for (fp = *listp; (fp != NULL) && (fp != rp); fp = fp->fr_next) rules++; - if (!fp) + if (fp == NULL) return; for (rn = 0, fp = *listp; fp && (fp != rp); fp = fp->fr_next, rn++) @@ -5006,7 +5006,7 @@ frrequest(softc, unit, req, data, set, makecopy) return error; } - if (!f) { + if (f == NULL) { /* * At the end of this, ftail must point to the place where the * new rule is to be saved/inserted/added. @@ -5052,7 +5052,7 @@ frrequest(softc, unit, req, data, set, makecopy) * Request to remove a rule. */ if (addrem == 1) { - if (!f) { + if (f == NULL) { IPFERROR(29); error = ESRCH; } else { From owner-svn-src-all@freebsd.org Sat Jun 8 22:29:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D0715B5721; Sat, 8 Jun 2019 22:29:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 777A5761B0; Sat, 8 Jun 2019 22:29: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 37B0221DBE; Sat, 8 Jun 2019 22:29: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 x58MTqpO093687; Sat, 8 Jun 2019 22:29:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x58MTpHI093685; Sat, 8 Jun 2019 22:29:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906082229.x58MTpHI093685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 8 Jun 2019 22:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348822 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 777A5761B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:29:53 -0000 Author: cy Date: Sat Jun 8 22:29:51 2019 New Revision: 348822 URL: https://svnweb.freebsd.org/changeset/base/348822 Log: MFC r348320: Contuation of r343701, removal of irrelevant #ifdefs. Approved by: re (gjb@) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_frag.c stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sat Jun 8 22:28:28 2019 (r348821) +++ stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sat Jun 8 22:29:51 2019 (r348822) @@ -34,11 +34,11 @@ #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if !defined(__SVR4) && !defined(__svr4__) +#if !defined(__SVR4) # if defined(_KERNEL) # include # endif Modified: stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Sat Jun 8 22:28:28 2019 (r348821) +++ stable/11/sys/contrib/ipfilter/netinet/ip_proxy.h Sat Jun 8 22:29:51 2019 (r348822) @@ -13,14 +13,14 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4)) # define SOLARIS 1 # else # define SOLARIS 0 # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) +#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) #else #define SIOCPROXY _IOWR(r, 64, struct ap_control) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 8 22:28:28 2019 (r348821) +++ stable/11/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 8 22:29:51 2019 (r348822) @@ -12,22 +12,18 @@ #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 40000) +#if defined(__FreeBSD_version) # if defined(_KERNEL) # include # else # include # endif -#endif -#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 399000000) #else -# if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sgi) -# include -# endif +# include #endif #include #include -#if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) +#if !defined(__SVR4) # include #endif #if defined(__FreeBSD__) From owner-svn-src-all@freebsd.org Sat Jun 8 23:35:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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