svn commit: r349183 - head/sys/arm64/arm64
Author: alc Date: Wed Jun 19 03:33:00 2019 New Revision: 349183 URL: https://svnweb.freebsd.org/changeset/base/349183 Log: Correct an error in r349122. pmap_unwire() should update the pmap's wired count, not its resident count. X-MFC with: r349122 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c == --- head/sys/arm64/arm64/pmap.c Wed Jun 19 01:28:13 2019(r349182) +++ head/sys/arm64/arm64/pmap.c Wed Jun 19 03:33:00 2019(r349183) @@ -3777,8 +3777,8 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t */ if (sva + L2_SIZE == va_next && eva >= va_next) { atomic_clear_64(l2, ATTR_SW_WIRED); - pmap_resident_count_dec(pmap, L2_SIZE / - PAGE_SIZE); + pmap->pm_stats.wired_count -= L2_SIZE / + PAGE_SIZE; continue; } else if (pmap_demote_l2(pmap, l2, sva) == NULL) panic("pmap_unwire: demotion failed"); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349179 - head/share/mk
Author: bdrewery Date: Tue Jun 18 22:00:38 2019 New Revision: 349179 URL: https://svnweb.freebsd.org/changeset/base/349179 Log: Rework r349061: Don't apply guessed dependencies if there is a custom target. This is still targeting bin/sh cyclic dependency issues. Only apply guessed dependencies that are explicitly set for an object (which gnu/lib/cc/cc_tools needs) and if no custom target exists with its own dependencies. This was manifesting as a missing yacc.h in usr.bin/mkesdb_static when built without -j (or -B). No actual yacc.h dependency ordering was defined but with -j it got lucky and built fine. Before r349061 the behavior was different for META_MODE but that logic difference isn't needed. X-MFC-With: r349061 Sponsored by: DellEMC Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkTue Jun 18 21:05:10 2019(r349178) +++ head/share/mk/bsd.dep.mkTue Jun 18 22:00:38 2019(r349179) @@ -264,7 +264,9 @@ _depfile= ${.OBJDIR}/${_dep_obj} # - For meta mode we still need to know which file to depend on to avoid # ambiguous suffix transformation rules from .PATH. Meta mode does not # use .depend files when filemon is in use. -${__obj}: ${OBJS_DEPEND_GUESS:N*.h} +.if !target(${__obj}) +${__obj}: ${OBJS_DEPEND_GUESS} +.endif ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif # !exists(${_depfile}) || defined(_meta_filemon) .endfor ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349178 - in head/sys: geom kern sys
Author: mav Date: Tue Jun 18 21:05:10 2019 New Revision: 349178 URL: https://svnweb.freebsd.org/changeset/base/349178 Log: Optimize kern.geom.conf* sysctls. On large systems those sysctls may generate megabytes of output. Before this change sbuf(9) code was resizing buffer by 4KB each time many times, generating tons of TLB shootdowns. Unfortunately in this case existing sbuf_new_for_sysctl() mechanism, supposed to help with this issue, is not applicable, since all the sbuf writes are done in different kernel thread. This change improves situation in two ways: - on first sysctl call, not providing any output buffer, it sets special sbuf drain function, just counting the data and so not needing big buffer; - on second sysctl call it uses as initial buffer size value saved on previous call, so that in most cases there will be no reallocation, unless GEOM topology changed significantly. MFC after:1 week Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_kern.c head/sys/kern/imgact_elf.c head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/sys/geom/geom_kern.c == --- head/sys/geom/geom_kern.c Tue Jun 18 21:02:40 2019(r349177) +++ head/sys/geom/geom_kern.c Tue Jun 18 21:05:10 2019(r349178) @@ -157,42 +157,51 @@ g_init(void) } static int -sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) +sysctl_kern_geom_confany(struct sysctl_req *req, g_event_t *func, size_t *hint) { - int error; + size_t len = 0; + int error = 0; struct sbuf *sb; - sb = sbuf_new_auto(); - g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + if (req->oldptr == NULL) { + sb = sbuf_new(NULL, NULL, PAGE_SIZE, SBUF_FIXEDLEN | + SBUF_INCLUDENUL); + sbuf_set_drain(sb, sbuf_count_drain, ); + g_waitfor_event(func, sb, M_WAITOK, NULL); + req->oldidx = *hint = len; + } else { + sb = sbuf_new(NULL, NULL, *hint, SBUF_AUTOEXTEND | + SBUF_INCLUDENUL); + g_waitfor_event(func, sb, M_WAITOK, NULL); + *hint = sbuf_len(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb)); + } sbuf_delete(sb); return error; } + +static int +sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) +{ + static size_t hint = PAGE_SIZE; + + return (sysctl_kern_geom_confany(req, g_conftxt, )); +} static int sysctl_kern_geom_confdot(SYSCTL_HANDLER_ARGS) { - int error; - struct sbuf *sb; + static size_t hint = PAGE_SIZE; - sb = sbuf_new_auto(); - g_waitfor_event(g_confdot, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - return error; + return (sysctl_kern_geom_confany(req, g_confdot, )); } - + static int sysctl_kern_geom_confxml(SYSCTL_HANDLER_ARGS) { - int error; - struct sbuf *sb; + static size_t hint = PAGE_SIZE; - sb = sbuf_new_auto(); - g_waitfor_event(g_confxml, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - return error; + return (sysctl_kern_geom_confany(req, g_confxml, )); } SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW, 0, "GEOMetry management"); Modified: head/sys/kern/imgact_elf.c == --- head/sys/kern/imgact_elf.c Tue Jun 18 21:02:40 2019(r349177) +++ head/sys/kern/imgact_elf.c Tue Jun 18 21:05:10 2019(r349178) @@ -1422,7 +1422,6 @@ static void __elfN(puthdr)(struct thread *, void *, si static void __elfN(putnote)(struct note_info *, struct sbuf *); static size_t register_note(struct note_info_list *, int, outfunc_t, void *); static int sbuf_drain_core_output(void *, const char *, int); -static int sbuf_drain_count(void *arg, const char *data, int len); static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); @@ -1552,19 +1551,6 @@ sbuf_drain_core_output(void *arg, const char *data, in return (len); } -/* - * Drain into a counter. - */ -static int -sbuf_drain_count(void *arg, const char *data __unused, int len) -{ - size_t *sizep; - - sizep = (size_t *)arg; - *sizep += len; - return (len); -} - int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { @@ -2341,7 +2327,7 @@ note_procstat_files(void *arg, struct sbuf *sb, size_t if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); - sbuf_set_drain(sb, sbuf_drain_count, ); + sbuf_set_drain(sb, sbuf_count_drain,
svn commit: r349177 - head/share/misc
Author: sevan (doc committer) Date: Tue Jun 18 21:02:40 2019 New Revision: 349177 URL: https://svnweb.freebsd.org/changeset/base/349177 Log: Mark NetBSD branch points NetBSD 7.0 was a separate branch, subsequent 8.x releases did not emerge from this branch. Clean up minor visual nits, centre OpenBSD listing on the B, DragonFly listings on the y. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree == --- head/share/misc/bsd-family-tree Tue Jun 18 18:50:58 2019 (r349176) +++ head/share/misc/bsd-family-tree Tue Jun 18 21:02:40 2019 (r349177) @@ -64,14 +64,14 @@ Tenth Edition | | || 4.4BSD-Encumbered | | |-NetBSD 0.8| BSD/386 1.0 | /| | | -FreeBSD 1.0 <-' NetBSD 0.9| BSD/386 1.1 +FreeBSD 1.0 <-' *--NetBSD 0.9 | BSD/386 1.1 || .- 4.4BSD Lite | -FreeBSD 1.1 | / / | \ | - || / /| \ | -FreeBSD 1.1.5 .---|' / | \ | - | /| / |\| -FreeBSD 1.1.5.1 / | / | \ | - | / NetBSD 1.0 <-'| \ | +FreeBSD 1.1 | / / | \ | + || / | | \ | +FreeBSD 1.1.5 .---|' | | \ | + | /| | |\| +FreeBSD 1.1.5.1 / | | | \ | + | / *--NetBSD 1.0 <-' | \ | |/ | | \ | FreeBSD 2.0 <--'| | BSD/OS 2.0 | \ | | @@ -83,9 +83,9 @@ FreeBSD 2.0.5 \| | | | | OpenBSD 2.3 | | | | | |BSD/OS 3.0 | FreeBSD 2.1 | | | | - | | | | NetBSD 1.1 --. BSD/OS 2.1 - | FreeBSD 2.1.5 | | | \| - | | | | NetBSD 1.2 \ BSD/OS 3.0 + | | | | *--NetBSD 1.1 -. BSD/OS 2.1 + | FreeBSD 2.1.5 | | | \ | + | | | | *--NetBSD 1.2\BSD/OS 3.0 | FreeBSD 2.1.6 | | | \ OpenBSD 2.0 | | | | | | \ | | | FreeBSD 2.1.6.1 | | |\| | @@ -103,7 +103,7 @@ FreeBSD 2.1 | | | | | | | | | | | FreeBSD 2.2.5 | | | | | | | | | | OpenBSD 2.2 | - | | | | NetBSD 1.3 | | + | | | | *--NetBSD 1.3 | | | FreeBSD 2.2.6 | | ||| | | | | | | NetBSD 1.3.1| BSD/OS 3.1 | | | | ||OpenBSD 2.3 | @@ -119,7 +119,7 @@ FreeBSD 3.0 <* | |v| | | | NetBSD 1.3.3| | *---FreeBSD 3.1 | | | | | | | | | BSD/OS 4.0.1 - | FreeBSD 3.2* | NetBSD 1.4 OpenBSD 2.5 | + | FreeBSD 3.2* | .--*--NetBSD 1.4 OpenBSD 2.5 | | | | | | ||| | | | | | | ||| | | | | | | ||| | @@ -142,7 +142,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2| | | Mac OS X | OpenBSD 2.8 BSD/OS 4.2 | | | | | | | | | | | | - | | 10.0 NetBSD 1.5 | | + | | 10.0 *--NetBSD 1.5 | | | FreeBSD 4.3 | ||| | | | | ||OpenBSD 2.9 | | | | | NetBSD 1.5.1| | @@ -157,7 +157,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2| | FreeBSD 4.6.2 Mac OS X | | | | |10.2| | | |
Re: svn commit: r349176 - head/sys/dev/random
On Tue, Jun 18, 2019 at 12:46:44PM -0700, Cy Schubert wrote: > In message <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd>, Shawn Webb > writes: > > > > --mmc352mzirnzscxj > > Content-Type: text/plain; charset=us-ascii > > Content-Disposition: inline > > Content-Transfer-Encoding: quoted-printable > > > > On Tue, Jun 18, 2019 at 06:50:58PM +, Conrad Meyer wrote: > > > Author: cem > > > Date: Tue Jun 18 18:50:58 2019 > > > New Revision: 349176 > > > URL: https://svnweb.freebsd.org/changeset/base/349176 > > >=20 > > > Log: > > > random(4): Fix a regression in short AES mode reads > > > =20 > > > In r349154, random device reads of size < 16 bytes (AES block size) were > > > accidentally broken to loop forever. Correct the loop condition for sm= > > all > > > reads. > > > =20 > > > Reported by:pho > > > Reviewed by:delphij > > > Approved by:secteam(delphij) > > > Differential Revision: https://reviews.freebsd.org/D20686 > > > > Hey Conrad, > > > > Thanks for fixing this issue! Any plans to MFC? > > Why? Whoops. I didn't catch the condition on the revision number. Sorry for the line noise! -- Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal:+1 443-546-8752 Tor+XMPP+OTR:latt...@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 signature.asc Description: PGP signature
Re: svn commit: r349176 - head/sys/dev/random
In message <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd>, Shawn Webb writes: > > --mmc352mzirnzscxj > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Tue, Jun 18, 2019 at 06:50:58PM +, Conrad Meyer wrote: > > Author: cem > > Date: Tue Jun 18 18:50:58 2019 > > New Revision: 349176 > > URL: https://svnweb.freebsd.org/changeset/base/349176 > >=20 > > Log: > > random(4): Fix a regression in short AES mode reads > > =20 > > In r349154, random device reads of size < 16 bytes (AES block size) were > > accidentally broken to loop forever. Correct the loop condition for sm= > all > > reads. > > =20 > > Reported by: pho > > Reviewed by: delphij > > Approved by: secteam(delphij) > > Differential Revision:https://reviews.freebsd.org/D20686 > > Hey Conrad, > > Thanks for fixing this issue! Any plans to MFC? Why? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r349176 - head/sys/dev/random
On Tue, Jun 18, 2019 at 06:50:58PM +, Conrad Meyer wrote: > Author: cem > Date: Tue Jun 18 18:50:58 2019 > New Revision: 349176 > URL: https://svnweb.freebsd.org/changeset/base/349176 > > Log: > random(4): Fix a regression in short AES mode reads > > In r349154, random device reads of size < 16 bytes (AES block size) were > accidentally broken to loop forever. Correct the loop condition for small > reads. > > Reported by:pho > Reviewed by:delphij > Approved by:secteam(delphij) > Differential Revision: https://reviews.freebsd.org/D20686 Hey Conrad, Thanks for fixing this issue! Any plans to MFC? Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal:+1 443-546-8752 Tor+XMPP+OTR:latt...@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 signature.asc Description: PGP signature
svn commit: r349176 - head/sys/dev/random
Author: cem Date: Tue Jun 18 18:50:58 2019 New Revision: 349176 URL: https://svnweb.freebsd.org/changeset/base/349176 Log: random(4): Fix a regression in short AES mode reads In r349154, random device reads of size < 16 bytes (AES block size) were accidentally broken to loop forever. Correct the loop condition for small reads. Reported by: pho Reviewed by: delphij Approved by: secteam(delphij) Differential Revision:https://reviews.freebsd.org/D20686 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c == --- head/sys/dev/random/fortuna.c Tue Jun 18 17:51:30 2019 (r349175) +++ head/sys/dev/random/fortuna.c Tue Jun 18 18:50:58 2019 (r349176) @@ -489,7 +489,7 @@ random_fortuna_genbytes(uint8_t *buf, size_t bytecount if (!random_chachamode) chunk_size = rounddown(chunk_size, RANDOM_BLOCKSIZE); - while (bytecount >= chunk_size) { + while (bytecount >= chunk_size && chunk_size > 0) { randomdev_keystream(p_key, p_counter, buf, chunk_size); buf += chunk_size; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349175 - head/usr.sbin/bhyve
Author: vmaffione Date: Tue Jun 18 17:51:30 2019 New Revision: 349175 URL: https://svnweb.freebsd.org/changeset/base/349175 Log: bhyve: vtnet: fix locking on receive The vsc_rx_ready and the RX virtqueue is protected by the rx_mtx lock. However, pci_vtnet_ping_rxq() (currently called only once after each device reset) accesses those without acquiring the lock. Reviewed by: markj MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D20609 Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cTue Jun 18 17:05:05 2019 (r349174) +++ head/usr.sbin/bhyve/pci_virtio_net.cTue Jun 18 17:51:30 2019 (r349175) @@ -583,10 +583,12 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) /* * A qnotify means that the rx process can now begin */ + pthread_mutex_lock(>rx_mtx); if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; vq_kick_disable(vq); } + pthread_mutex_unlock(>rx_mtx); } static void ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349174 - head/sys/dev/pwm
Author: ian Date: Tue Jun 18 17:05:05 2019 New Revision: 349174 URL: https://svnweb.freebsd.org/changeset/base/349174 Log: Handle labels specified with hints even on FDT systems. Hints are the easiest thing for a user to control (via loader.conf or kenv+kldload), so handle them in addition to any label specified via the FDT data. Modified: head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmc.c == --- head/sys/dev/pwm/pwmc.c Tue Jun 18 16:31:05 2019(r349173) +++ head/sys/dev/pwm/pwmc.c Tue Jun 18 17:05:05 2019(r349174) @@ -108,33 +108,24 @@ static struct cdevsw pwm_cdevsw = { .d_ioctl= pwm_ioctl }; -#ifdef FDT - static void pwmc_setup_label(struct pwmc_softc *sc) { + const char *hintlabel; +#ifdef FDT void *label; if (OF_getprop_alloc(ofw_bus_get_node(sc->dev), "label", ) > 0) { make_dev_alias(sc->cdev, "pwm/%s", (char *)label); OF_prop_free(label); } -} +#endif -#else /* FDT */ - -static void -pwmc_setup_label(struct pwmc_softc *sc) -{ - const char *label; - if (resource_string_value(device_get_name(sc->dev), - device_get_unit(sc->dev), "label", ) == 0) { - make_dev_alias(sc->cdev, "pwm/%s", label); + device_get_unit(sc->dev), "label", ) == 0) { + make_dev_alias(sc->cdev, "pwm/%s", hintlabel); } } - -#endif /* FDT */ static int pwmc_probe(device_t dev) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349170 - in head: . sys/sys
Author: emaste Date: Tue Jun 18 14:13:52 2019 New Revision: 349170 URL: https://svnweb.freebsd.org/changeset/base/349170 Log: Remove sys/capability.h for the third time In all supported (and most unsupported) FreeBSD versions the appropriate header for Capsicum is sys/capsicum.h. Software including sys/capability.h is most likely looking for Linux capabilities based on the withdrawn POSIX.1e draft. This header was previously removed in r334929 and r340156, but reverted each time due to ports failures. These issues have now (broadly) been addressed. PR: 228878 [exp-run] Submitted by: eadler (r334929) Relnotes: Yes Sponsored by: The FreeBSD Foundation Deleted: head/sys/sys/capability.h Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Tue Jun 18 05:59:24 2019(r349169) +++ head/ObsoleteFiles.inc Tue Jun 18 14:13:52 2019(r349170) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190618: sys/capability.h removed (sys/capsicum.h is the one to use) +OLD_FILES+=usr/include/sys/capability.h # 20190615: sys/pwm.h renamed to dev/pwmc.h OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"