svn commit: r361324 - head/sys/sys
Author: dougm Date: Thu May 21 05:34:02 2020 New Revision: 361324 URL: https://svnweb.freebsd.org/changeset/base/361324 Log: For the case when RB_REMOVE requires a nontrivial search to find the node to replace the one being removed, restructure to first remove the replacement node and correct the parent pointers around it, and then let the all-cases code at the end deal with the parent of the deleted node, making it point to the replacement node. This removes one or two conditional branches. Reviewed by: markj Tested by:pho Differential Revision:https://reviews.freebsd.org/D24845 Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h == --- head/sys/sys/tree.h Thu May 21 05:02:58 2020(r361323) +++ head/sys/sys/tree.h Thu May 21 05:34:02 2020(r361324) @@ -562,48 +562,44 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ - struct type *child, *parent, *old = elm;\ + struct type *child, *parent, *parent_old, *old = elm; \ int color; \ - if (RB_LEFT(elm, field) == NULL)\ - child = RB_RIGHT(elm, field); \ - else if (RB_RIGHT(elm, field) == NULL) \ - child = RB_LEFT(elm, field);\ - else { \ + parent_old = parent = RB_PARENT(elm, field);\ + color = RB_COLOR(elm, field); \ + if (RB_LEFT(elm, field) == NULL) { \ + elm = child = RB_RIGHT(elm, field); \ + if (elm != NULL)\ + RB_PARENT(elm, field) = parent; \ + } else if (RB_RIGHT(elm, field) == NULL) { \ + elm = child = RB_LEFT(elm, field); \ + RB_PARENT(elm, field) = parent; \ + } else {\ elm = RB_RIGHT(old, field); \ if ((child = RB_LEFT(elm, field)) == NULL) {\ child = RB_RIGHT(elm, field); \ RB_RIGHT(old, field) = child; \ - RB_PARENT(elm, field) = elm;\ + parent = elm; \ } else {\ do \ elm = child;\ while ((child = RB_LEFT(elm, field)) != NULL); \ child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + RB_LEFT(parent, field) = child; \ + if (child != NULL) \ + RB_PARENT(child, field) = parent; \ RB_PARENT(RB_RIGHT(old, field), field) = elm; \ } \ RB_PARENT(RB_LEFT(old, field), field) = elm;\ - parent = RB_PARENT(old, field); \ - if (parent != NULL) { \ - if (RB_LEFT(parent, field) == old) \ - RB_LEFT(parent, field) = elm; \ - else\ - RB_RIGHT(parent, field) = elm; \ - } else \ - RB_ROOT(head) = elm;\ + color = RB_COLOR(elm, field); \ + elm->field = old->field;\ } \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child != NULL) \ - RB_PARENT(child, field) = parent; \ - if (parent != NULL)
svn commit: r361323 - vendor/unbound/1.10.1
Author: cy Date: Thu May 21 05:02:58 2020 New Revision: 361323 URL: https://svnweb.freebsd.org/changeset/base/361323 Log: Tag unbound 1.10.1. Added: vendor/unbound/1.10.1/ - copied from r361322, vendor/unbound/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361322 - in vendor/unbound/dist: . .github cachedb compat contrib daemon doc edns-subnet iterator libunbound respip services services/cache sldns smallapp testcode testdata testdata/dn...
Author: cy Date: Thu May 21 05:01:52 2020 New Revision: 361322 URL: https://svnweb.freebsd.org/changeset/base/361322 Log: Vendor import of Unbound 1.10.1. Security: CVE-2020-12662, CVE-2020-12663 Added: vendor/unbound/dist/.github/ vendor/unbound/dist/.github/FUNDING.yml vendor/unbound/dist/contrib/drop2rpz vendor/unbound/dist/contrib/unbound_portable.service.in (contents, props changed) vendor/unbound/dist/contrib/unbound_smf23.tar.gz (contents, props changed) vendor/unbound/dist/services/rpz.c (contents, props changed) vendor/unbound/dist/services/rpz.h (contents, props changed) vendor/unbound/dist/testdata/rpz_axfr.rpl vendor/unbound/dist/testdata/rpz_ixfr.rpl vendor/unbound/dist/testdata/rpz_qname.rpl vendor/unbound/dist/testdata/rpz_qname_override.rpl vendor/unbound/dist/testdata/rpz_respip.rpl vendor/unbound/dist/testdata/rpz_respip_override.rpl vendor/unbound/dist/testdata/serve_expired.rpl vendor/unbound/dist/testdata/serve_expired_client_timeout.rpl vendor/unbound/dist/testdata/serve_expired_reply_ttl.rpl vendor/unbound/dist/testdata/serve_expired_servfail.rpl vendor/unbound/dist/testdata/serve_expired_ttl.rpl vendor/unbound/dist/testdata/serve_expired_ttl_client_timeout.rpl vendor/unbound/dist/testdata/serve_expired_zerottl.rpl Deleted: vendor/unbound/dist/contrib/unbound_smf22.tar.gz vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1.key vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2.key vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.conf vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.dsc vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.post vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.pre vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.test vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.testns vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1.key vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2.key vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.conf vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.dsc vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.post vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.pre vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.test vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.testns vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/precheck.sh Modified: vendor/unbound/dist/.gitignore vendor/unbound/dist/Makefile.in vendor/unbound/dist/README.md vendor/unbound/dist/aclocal.m4 vendor/unbound/dist/cachedb/cachedb.c vendor/unbound/dist/compat/getentropy_solaris.c vendor/unbound/dist/config.guess vendor/unbound/dist/config.h.in vendor/unbound/dist/config.sub vendor/unbound/dist/configure vendor/unbound/dist/configure.ac vendor/unbound/dist/contrib/README vendor/unbound/dist/contrib/fastrpz.patch vendor/unbound/dist/contrib/libunbound.pc.in vendor/unbound/dist/contrib/unbound.service.in vendor/unbound/dist/contrib/unbound_munin_ vendor/unbound/dist/daemon/daemon.c vendor/unbound/dist/daemon/daemon.h vendor/unbound/dist/daemon/remote.c vendor/unbound/dist/daemon/stats.c vendor/unbound/dist/daemon/unbound.c vendor/unbound/dist/daemon/worker.c vendor/unbound/dist/doc/Changelog vendor/unbound/dist/doc/README vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/libunbound.3.in vendor/unbound/dist/doc/unbound-anchor.8.in vendor/unbound/dist/doc/unbound-checkconf.8.in vendor/unbound/dist/doc/unbound-control.8.in vendor/unbound/dist/doc/unbound-host.1.in vendor/unbound/dist/doc/unbound.8.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/edns-subnet/subnetmod.c vendor/unbound/dist/install-sh vendor/unbound/dist/iterator/iter_delegpt.c vendor/unbound/dist/iterator/iter_delegpt.h vendor/unbound/dist/iterator/iter_scrub.c vendor/unbound/dist/iterator/iter_utils.c vendor/unbound/dist/iterator/iterator.c vendor/unbound/dist/iterator/iterator.h
svn commit: r361321 - head/sys/dev/ath
Author: adrian Date: Thu May 21 04:35:12 2020 New Revision: 361321 URL: https://svnweb.freebsd.org/changeset/base/361321 Log: [ath] Hopefully recover better-er upon RX restart on AR9380. This is all very long-standing bug stuff that is touchy and still poorly documented. Ok, here goes. The basic bug: * deleting a VAP causes the RX path (and TX path too) to be restarted without a full chip reset, which causes RX hangs on the AR9380 and later. (ie, the ones with the newer DMA engine.) The basic fix: * do an RX flush when stopping RX in ath_vap_delete() to match what happens when RX is stopped elsewhere. This ensures any pending frames are completed and we restart at the right spot; it also ensures we don't push new RX buffers into the hardware if we're stopping receive. The other issues I found: * Don't bother checking the RX packet ring in the deferred read taskqueue; that's specifically supposed to be for completing frames rather than just yanking them off the receive ring. * Cancel/drain any pending deferred read taskqueue. This isn't done inside any locks so we should be super careful here. This stops the hardware being reprogrammed at the same time in another thread/CPU whilst we're stopping RX. * .. (yes, this should be better serialised, but that's for another day. maybe.) * Add more debugging to trace what's going on here. And the fun bit: * Reinitialise the RX FIFO ONLY if we've been reset or stopped, rather than just reset. I noticed that after all the above was done I was STILL seeing RXEOL. RXEOL isn't enabled on the AR9380 so I'd only see it if I was sending TX frames (ie a ping where it'd be transmitted but never received) so I was not being spammed by RXEOL. So, as long as stuff is stopped, restart it. This seems to be doing the right thing in both AP and STA modes. What I should do next, if I ever get time: * as I said above, serialise the receive stop/start to include taskqueues * monitor RXEOL on the AR9380 and I keep seeing it spammed / lockups, just go do a full chip reset to get things back on track. It sucks, but it is better than nothing. Tested: * AR9380 AP/STA mode, adding/deleting a hostap VAP to trigger the TX/RX queue stop/start; whilst also running an iperf through it. Lots of times. Lots. Of.. Times. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Thu May 21 04:26:20 2020(r361320) +++ head/sys/dev/ath/if_ath.c Thu May 21 04:35:12 2020(r361321) @@ -1801,6 +1801,7 @@ ath_vap_delete(struct ieee80211vap *vap) ath_hal_intrset(ah, 0); /* disable interrupts */ /* XXX Do all frames from all vaps/nodes need draining here? */ ath_stoprecv(sc, 1);/* stop recv side */ + ath_rx_flush(sc); ath_draintxq(sc, ATH_RESET_DEFAULT);/* stop hw xmit side */ } Modified: head/sys/dev/ath/if_ath_rx_edma.c == --- head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:26:20 2020 (r361320) +++ head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:35:12 2020 (r361321) @@ -162,6 +162,9 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called, dodelay=%d\n", + __func__, dodelay); + ATH_RX_LOCK(sc); ath_hal_stoppcurecv(ah); @@ -191,6 +194,8 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; } ATH_RX_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -205,6 +210,8 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU struct ath_buf *bf; int i, j; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called\n", __func__); + ATH_RX_LOCK_ASSERT(sc); i = re->m_fifo_head; @@ -227,6 +234,7 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU i, re->m_fifo_tail); } + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -237,6 +245,10 @@ ath_edma_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: called; resetted=%d, stopped=%d\n", __func__, + sc->sc_rx_resetted, sc->sc_rx_stopped); + ATH_RX_LOCK(sc); /* @@ -252,7 +264,7 @@ ath_edma_startrecv(struct ath_softc *sc) /* * In theory the hardware has been initialised, right? */ - if (sc->sc_rx_resetted == 1) { + if
svn commit: r361320 - head/sys/dev/ath
Author: adrian Date: Thu May 21 04:26:20 2020 New Revision: 361320 URL: https://svnweb.freebsd.org/changeset/base/361320 Log: [ath] reset hardware if this particular mac bug is seen. I have to dig into why I'm seeing it on chips as late as the AR9380 era stuff (as it's marked as an AR5416 bug, but who knows!) but i'm seeing aggregate TX frames complete with no blockack bit set. So, everything should be treated as a failure and do a hardware reset for good measure. Tested: * AR9380, STA mode * AR9580 (5GHz), AP mode Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c == --- head/sys/dev/ath/if_ath_tx.cThu May 21 03:53:45 2020 (r361319) +++ head/sys/dev/ath/if_ath_tx.cThu May 21 04:26:20 2020 (r361320) @@ -5011,7 +5011,11 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); - /* XXX TODO: schedule an interface reset */ + taskqueue_enqueue(sc->sc_tq, >sc_fataltask); + /* And as we can't really trust the BA here .. */ + ba[0] = 0; + ba[1] = 0; + seq_st = 0; #ifdef ATH_DEBUG ath_printtxbuf(sc, bf_first, sc->sc_ac2q[atid->ac]->axq_qnum, 0, 0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361319 - head/sys/dev/ath/ath_rate/sample
Author: adrian Date: Thu May 21 03:53:45 2020 New Revision: 361319 URL: https://svnweb.freebsd.org/changeset/base/361319 Log: [ath_rate_sample] Obey the maximum frame length even when using static rates. I wasn't enforcing the maximum packet length when using static rates so although the driver was enforcing it itself OK, the statistics were sometimes going into the wrong bin. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c == --- head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:50:56 2020 (r361318) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:53:45 2020 (r361319) @@ -165,6 +165,11 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = { * MCS rate in the transmit schedule. * * Returns -1 if it's a legacy rate or no MRR. + * + * XXX TODO: this needs to be limited by the RTS/CTS AR5416 8KB bug limit! + * (by checking rts/cts flags and applying sc_rts_aggr_limit) + * + * XXX TODO: apply per-node max-ampdu size and driver ampdu size limits too. */ static int ath_rate_sample_find_min_pktlength(struct ath_softc *sc, @@ -693,6 +698,17 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod if (sn->static_rix != -1) { rix = sn->static_rix; *try0 = ATH_TXMAXTRY; + + /* +* Ensure we limit max packet length here too! +*/ + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, + sn->static_rix, + is_aggr); + if (max_pkt_len > 0) { + *maxpktlen = frameLen = MIN(frameLen, max_pkt_len); + size_bin = size_to_bin(frameLen); + } goto done; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361318 - head/bin/ls
Author: kevans Date: Thu May 21 03:50:56 2020 New Revision: 361318 URL: https://svnweb.freebsd.org/changeset/base/361318 Log: ls: fix a --color regression from r337956 The regression is in-fact that I flipped the default from never to auto. The incorrect impression was based on an alias that I failed to notice, installed by the Linux distribution that I used for testing compatibility here. Users that want the old default should be doing so with a shell alias as is done elsewhere, rather than making this decision in ls(1). Many thanks to rgrimes for pointing out the alias that I clearly overlooked that resulted in this; if you despised colors in your terminal from this, consider buying him a beer at the next venue that you see him at. MFC after:1 week Relnotes: yes Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 == --- head/bin/ls/ls.1Thu May 21 03:33:20 2020(r361317) +++ head/bin/ls/ls.1Thu May 21 03:50:56 2020(r361318) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 18, 2018 +.Dd May 20, 2020 .Dt LS 1 .Os .Sh NAME @@ -216,8 +216,8 @@ Output colored escape sequences based on .Ar when , which may be set to either .Cm always , -.Cm auto -(default), or +.Cm auto , +or .Cm never . .Pp .Cm always @@ -252,6 +252,12 @@ environment variable is set and not empty. .Pp .Cm never will disable color regardless of environment variables. +.Cm never +is the default when neither +.Fl -color +nor +.Fl G +is specified. .Pp For compatibility with GNU coreutils, .Nm Modified: head/bin/ls/ls.c == --- head/bin/ls/ls.cThu May 21 03:33:20 2020(r361317) +++ head/bin/ls/ls.cThu May 21 03:50:56 2020(r361318) @@ -152,7 +152,7 @@ static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ #ifdef COLORLS - int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ + int colorflag = COLORFLAG_NEVER;/* passed in colorflag */ int f_color;/* add type in color for non-regular files */ bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ char *ansi_bgcol; /* ANSI sequence to set background colour */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361317 - in head/sys/powerpc: aim include powerpc
Author: jhibbits Date: Thu May 21 03:33:20 2020 New Revision: 361317 URL: https://svnweb.freebsd.org/changeset/base/361317 Log: powerpc: Handle machine checks caused by D-ERAT multihit Instead of crashing the user process when a D-ERAT multihit is detected, try to flush the ERAT, and continue. This machine check indicates a likely PMAP invalidation shortcoming that will need to be addressed, but it's recoverable, so just recover. The recovery is pmap-specific to flush the ERAT, so add a pmap function to do so, currently only implemented by the POWER9 radix pmap. Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/aim_machdep.c == --- head/sys/powerpc/aim/aim_machdep.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/aim_machdep.c Thu May 21 03:33:20 2020 (r361317) @@ -539,6 +539,10 @@ cpu_machine_check(struct thread *td, struct trapframe /* SLB multi-hit is recoverable. */ if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) return (0); + if ((frame->cpu.aim.dsisr & DSISR_MC_DERAT_MULTIHIT) != 0) { + pmap_tlbie_all(); + return (0); + } /* TODO: Add other machine check recovery procedures. */ } else { if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) Modified: head/sys/powerpc/aim/mmu_radix.c == --- head/sys/powerpc/aim/mmu_radix.cThu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/mmu_radix.cThu May 21 03:33:20 2020 (r361317) @@ -482,6 +482,7 @@ static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_ void **va); static void mmu_radix_scan_init(mmu_t mmu); static voidmmu_radix_cpu_bootstrap(mmu_t, int ap); +static voidmmu_radix_tlbie_all(mmu_t); static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_bootstrap,mmu_radix_bootstrap), @@ -543,6 +544,8 @@ static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), + + MMUMETHOD(mmu_tlbie_all,mmu_radix_tlbie_all), { 0, 0 } }; @@ -772,6 +775,13 @@ mmu_radix_tlbiel_flush(int scope) tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); +} + +static void +mmu_radix_tlbie_all(mmu_t __unused mmu) +{ + /* TODO: LPID invalidate */ + mmu_radix_tlbiel_flush(TLB_INVAL_SCOPE_GLOBAL); } static void Modified: head/sys/powerpc/include/pmap.h == --- head/sys/powerpc/include/pmap.h Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/include/pmap.h Thu May 21 03:33:20 2020 (r361317) @@ -341,6 +341,7 @@ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); void pmap_page_print_mappings(vm_page_t m); +void pmap_tlbie_all(void); static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: head/sys/powerpc/powerpc/mmu_if.m == --- head/sys/powerpc/powerpc/mmu_if.m Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/mmu_if.m Thu May 21 03:33:20 2020 (r361317) @@ -1100,3 +1100,11 @@ METHOD boolean_t ps_enabled { mmu_t _mmu; pmap_t _pmap; } DEFAULT mmu_null_ps_enabled; + + +/** + * @brief Flush the TLB (used by machine check handler). + */ +METHOD void tlbie_all { + mmu_t _mmu; +}; Modified: head/sys/powerpc/powerpc/pmap_dispatch.c == --- head/sys/powerpc/powerpc/pmap_dispatch.cThu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/pmap_dispatch.cThu May 21 03:33:20 2020 (r361317) @@ -631,6 +631,13 @@ pmap_ps_enabled(pmap_t pmap) return (MMU_PS_ENABLED(mmu_obj, pmap)); } +void +pmap_tlbie_all(void) +{ + CTR1(KTR_PMAP, "%s()", __func__); + return (MMU_TLBIE_ALL(mmu_obj)); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To
Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
On Thu, 2020-05-21 at 01:53 +, Wei Hu wrote: > > -Original Message- > > From: Enji Cooper > > Sent: Wednesday, May 20, 2020 11:58 PM > > To: Shawn Webb > > Cc: Wei Hu ; src-committ...@freebsd.org; svn-src- > > a...@freebsd.org; svn-src-h...@freebsd.org > > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > > modules/hyperv/hvsock sys > > > > > > > On May 20, 2020, at 08:54, Enji Cooper wrote: > > > > > > > > On May 20, 2020, at 08:11, Shawn Webb > > > > wrote: > > > > > > > > > > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > > > > > Author: whu > > > > > Date: Wed May 20 11:03:59 2020 > > > > > New Revision: 361275 > > > > > URL: > > > > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > > > > > > > > > nweb.freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7C > > weh% > > > > > > > > > 40microsoft.com%7Cd6ff3617bffa43d10a7708d7fcd68470%7C72f988bf86f141 > > a > > > > > > > > > f91ab2d7cd011db47%7C1%7C0%7C637255870581110888sdata=mzz6R > > ILCVBk > > > > > q06RI1PAfVNKWZO2y7jBO0C1E%2F%2FEJwUY%3Dreserved=0 > > > > > > > > > > Log: > > > > > HyperV socket implementation for FreeBSD > > > > > > > > > > This change adds Hyper-V socket feature in FreeBSD. New socket > > > > > address family AF_HYPERV and its kernel support are added. > > > > > > Hi Wei, > > >Could you please further describe what this feature is/does? > > > > I realize after looking at the review that it contains the content I > > was hoping > > for. It would have been helpful to folks if this context had been included > > in the > > commit message. > > Hi Enji, > > I thought I just keep it simple for the commit log message while people can > refer to the review site for details. Sorry about that. Let me know if there > is > anyway to make up for it. > > Wei > Ten years from now, phabricator may just be a fading memory, but the source code repo lives forever. Usually when I put something in phab for review, the description I enter in phab is exactly the text I intend to use when committing the change. That helps the people doing the review... the description is an overview of what is being changed, and most importantly, why it is being changed (fixes a bug, adds a new feature, better performance, etc). Everything you say there to help reviewers will be equally helpful in the repo history when someone needs to research some day why a change got made. -- Ian ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361316 - head/usr.bin/truss
Author: csjp Date: Thu May 21 02:10:45 2020 New Revision: 361316 URL: https://svnweb.freebsd.org/changeset/base/361316 Log: Decode the file descriptor argument to closefrom(2) as an Integer. This is consistent with what we are doing for close(2) and it makes it a bit easier to follow when debugging file descriptor operations. i.e. many other syscalls are decoding fds as integers rather than base 16 numbers. MFC after:1 week Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c == --- head/usr.bin/truss/syscalls.c Thu May 21 02:08:34 2020 (r361315) +++ head/usr.bin/truss/syscalls.c Thu May 21 02:10:45 2020 (r361316) @@ -157,6 +157,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, { .name = "close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, + { .name = "closefrom", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, { .name = "compat11.fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
On Thu, May 21, 2020 at 9:50 AM Wei Hu wrote: > I was not familiar to the mechanism of __FreeBSD_version. But it looks > like a good idea. However I am not sure if I have the right to update the > chapter.xml file. Can you help on what I need to do the update this > version number? It's no problem (actually it's required) to update doc/head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml after you bump __FreeBSD_version in src/sys/sys/param.h Best, Li-Wen ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361315 - in stable/12/sys: ddb dev/nvdimm dev/ow net sys
Author: kevans Date: Thu May 21 02:08:34 2020 New Revision: 361315 URL: https://svnweb.freebsd.org/changeset/base/361315 Log: MFC r361011: kernel: provide panicky version of __unreachable __builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Modified: stable/12/sys/ddb/db_expr.c stable/12/sys/dev/nvdimm/nvdimm.c stable/12/sys/dev/ow/ow.c stable/12/sys/net/mppcc.c stable/12/sys/sys/systm.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ddb/db_expr.c == --- stable/12/sys/ddb/db_expr.c Thu May 21 02:04:10 2020(r361314) +++ stable/12/sys/ddb/db_expr.c Thu May 21 02:08:34 2020(r361315) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -229,7 +230,7 @@ db_add_expr(db_expr_t *valuep) lhs |= rhs; break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } @@ -313,7 +314,7 @@ db_logical_relation_expr( lhs = (lhs <= rhs); break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } Modified: stable/12/sys/dev/nvdimm/nvdimm.c == --- stable/12/sys/dev/nvdimm/nvdimm.c Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/dev/nvdimm/nvdimm.c Thu May 21 02:08:34 2020 (r361315) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include @@ -235,7 +236,7 @@ read_label(struct nvdimm_dev *nv, int num) return (0); } } - __unreachable(); + __assert_unreachable(); } static int Modified: stable/12/sys/dev/ow/ow.c == --- stable/12/sys/dev/ow/ow.c Thu May 21 02:04:10 2020(r361314) +++ stable/12/sys/dev/ow/ow.c Thu May 21 02:08:34 2020(r361315) @@ -505,7 +505,7 @@ again: return (EIO); goto again; default: /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, _regular); Modified: stable/12/sys/net/mppcc.c == --- stable/12/sys/net/mppcc.c Thu May 21 02:04:10 2020(r361314) +++ stable/12/sys/net/mppcc.c Thu May 21 02:08:34 2020(r361315) @@ -232,7 +232,7 @@ int MPPC_Compress(u_char **src, u_char **dst, u_long * } else if (off < 8192) {/* 16-bit offset; 320 <= offset < 8192 */ putbits16(*dst, 0xc000|(off-320), 16, , ); } else {/* NOTREACHED */ - __unreachable(); + __assert_unreachable(); rtn &= ~MPPC_OK; return (rtn); } Modified: stable/12/sys/sys/systm.h == --- stable/12/sys/sys/systm.h Thu May 21 02:04:10 2020(r361314) +++ stable/12/sys/sys/systm.h Thu May 21 02:08:34 2020(r361315) @@ -108,12 +108,16 @@ void kassert_panic(const char *fmt, ...) __printflike kassert_panic msg; \ } \ } while (0) +#define__assert_unreachable() \ + panic("executing segment marked as unreachable at %s:%d (%s)\n", \ + __FILE__, __LINE__, __func__) #else #defineKASSERT(exp,msg) do { \ } while (0) #defineVNASSERT(exp, vp, msg) do { \ } while (0) +#define__assert_unreachable() __unreachable() #endif #ifndef CTASSERT /* Allow lint to override */ ___ svn-src-all@freebsd.org mailing list
svn commit: r361314 - stable/12/usr.sbin/jail
Author: freqlabs Date: Thu May 21 02:04:10 2020 New Revision: 361314 URL: https://svnweb.freebsd.org/changeset/base/361314 Log: MFC r361066: jail: Add exec.prepare and exec.release command hooks This change introduces new jail command hooks that run before and after any other actions. The exec.prepare hook can be used for example to invoke a script that checks if the jail's root exists, creating it if it does not. Since arbitrary variables in jail.conf can be passed to the command, it can be pretty useful for templating jails. An example use case for exec.release would be to remove the filesystem of an ephemeral jail. The names "prepare" and "release" are borrowed from the names of similar hooks in libvirt. Reviewed by:jamie, manpages, mmacy Approved by:mmacy (mentor) Differential Revision: https://reviews.freebsd.org/D24829 Modified: stable/12/usr.sbin/jail/command.c stable/12/usr.sbin/jail/config.c stable/12/usr.sbin/jail/jail.8 stable/12/usr.sbin/jail/jail.c stable/12/usr.sbin/jail/jailp.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/jail/command.c == --- stable/12/usr.sbin/jail/command.c Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/command.c Thu May 21 02:04:10 2020 (r361314) @@ -148,7 +148,8 @@ next_command(struct cfjail *j) if (j->comstring == NULL || j->comstring->len == 0 || (create_failed && (comparam == IP_EXEC_PRESTART || comparam == IP_EXEC_CREATED || comparam == IP_EXEC_START || - comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART))) + comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART || + comparam == IP_EXEC_PREPARE))) continue; switch (run_command(j)) { case -1: Modified: stable/12/usr.sbin/jail/config.c == --- stable/12/usr.sbin/jail/config.cThu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/config.cThu May 21 02:04:10 2020 (r361314) @@ -71,8 +71,10 @@ static const struct ipspec intparams[] = { [IP_EXEC_JAIL_USER] = {"exec.jail_user", PF_INTERNAL}, [IP_EXEC_POSTSTART] = {"exec.poststart", PF_INTERNAL}, [IP_EXEC_POSTSTOP] = {"exec.poststop", PF_INTERNAL}, +[IP_EXEC_PREPARE] ={"exec.prepare",PF_INTERNAL}, [IP_EXEC_PRESTART] = {"exec.prestart", PF_INTERNAL}, [IP_EXEC_PRESTOP] ={"exec.prestop",PF_INTERNAL}, +[IP_EXEC_RELEASE] ={"exec.release",PF_INTERNAL}, [IP_EXEC_CREATED] ={"exec.created",PF_INTERNAL}, [IP_EXEC_START] = {"exec.start", PF_INTERNAL}, [IP_EXEC_STOP] = {"exec.stop", PF_INTERNAL}, Modified: stable/12/usr.sbin/jail/jail.8 == --- stable/12/usr.sbin/jail/jail.8 Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/jail.8 Thu May 21 02:04:10 2020 (r361314) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2020 +.Dd May 14, 2020 .Dt JAIL 8 .Os .Sh NAME @@ -724,6 +724,11 @@ not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent +.It Va exec.prepare +Command(s) to run in the system environment to prepare a jail for creation. +These commands are executed before assigning IP addresses and mounting +filesystems, so they may be used to create a new jail filesystem if it does +not already exist. .It Va exec.prestart Command(s) to run in the system environment before a jail is created. .It Va exec.created @@ -758,6 +763,11 @@ A typical command to run is .Dq sh /etc/rc.shutdown jail . .It Va exec.poststop Command(s) to run in the system environment after a jail is removed. +.It Va exec.release +Command(s) to run in the system environment after all other actions are done. +These commands are executed after unmounting filesystems and removing IP +addresses, so they may be used to remove a jail filesystem if it is no longer +needed. .It Va exec.clean Run commands in a clean environment. The environment is discarded except for Modified: stable/12/usr.sbin/jail/jail.c == --- stable/12/usr.sbin/jail/jail.c Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/jail.c Thu May 21 02:04:10 2020 (r361314) @@ -87,6 +87,7 @@ static struct permspec perm_sysctl[] = { static const enum intparam startcommands[] = { IP__NULL, +IP_EXEC_PREPARE, #ifdef INET IP__IP4_IFADDR, #endif @@
svn commit: r361313 - in head: lib/libugidfw sbin/mksnap_ffs sbin/umount sys/fs/nfs sys/fs/nfsserver sys/kern sys/security/mac_bsdextended sys/sys usr.sbin/autofs usr.sbin/mountd
Author: freqlabs Date: Thu May 21 01:55:35 2020 New Revision: 361313 URL: https://svnweb.freebsd.org/changeset/base/361313 Log: Deduplicate fsid comparisons Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after:1 week Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D24749 Modified: head/lib/libugidfw/ugidfw.c head/sbin/mksnap_ffs/mksnap_ffs.c head/sbin/umount/umount.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/kern/vfs_subr.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_bsdextended/mac_bsdextended.h head/sys/sys/mount.h head/usr.sbin/autofs/autounmountd.c head/usr.sbin/mountd/mountd.c Modified: head/lib/libugidfw/ugidfw.c == --- head/lib/libugidfw/ugidfw.c Thu May 21 01:55:10 2020(r361312) +++ head/lib/libugidfw/ugidfw.c Thu May 21 01:55:35 2020(r361313) @@ -334,9 +334,8 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { numfs = getmntinfo(, MNT_NOWAIT); for (i = 0; i < numfs; i++) - if (memcmp(&(rule->mbr_object.mbo_fsid), - &(mntbuf[i].f_fsid), - sizeof(mntbuf[i].f_fsid)) == 0) + if (fsidcmp(>mbr_object.mbo_fsid, + [i].f_fsid) == 0) break; len = snprintf(cur, left, "filesys %s ", i == numfs ? "???" : mntbuf[i].f_mntonname); Modified: head/sbin/mksnap_ffs/mksnap_ffs.c == --- head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:10 2020 (r361312) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:35 2020 (r361313) @@ -81,8 +81,7 @@ issamefs(const char *path, struct statfs *stfsp) return (-1); if (statfs(path, ) < 0) return (-1); - if ((stfsbuf.f_fsid.val[0] != stfsp->f_fsid.val[0]) || - (stfsbuf.f_fsid.val[1] != stfsp->f_fsid.val[1])) + if (fsidcmp(_fsid, >f_fsid) != 0) return (0); return (1); } Modified: head/sbin/umount/umount.c == --- head/sbin/umount/umount.c Thu May 21 01:55:10 2020(r361312) +++ head/sbin/umount/umount.c Thu May 21 01:55:35 2020(r361313) @@ -505,8 +505,7 @@ getmntentry(const char *fromname, const char *onname, continue; if (onname != NULL && strcmp(sfs->f_mntonname, onname) != 0) continue; - if (fsid != NULL && bcmp(>f_fsid, fsid, - sizeof(*fsid)) != 0) + if (fsid != NULL && fsidcmp(>f_fsid, fsid) != 0) continue; switch (what) { Modified: head/sys/fs/nfs/nfsdport.h == --- head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:10 2020(r361312) +++ head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:35 2020(r361313) @@ -85,8 +85,7 @@ struct nfsexstuff { #defineNFSVNO_SETEXRDONLY(e) ((e)->nes_exflag = (MNT_EXPORTED|MNT_EXRDONLY)) #defineNFSVNO_CMPFH(f1, f2) \ -((f1)->fh_fsid.val[0] == (f2)->fh_fsid.val[0] && \ - (f1)->fh_fsid.val[1] == (f2)->fh_fsid.val[1] && \ +(fsidcmp(&(f1)->fh_fsid, &(f2)->fh_fsid) == 0 && \ bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0) #defineNFSLOCKHASH(f) \ Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cThu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdport.cThu May 21 01:55:35 2020 (r361313) @@ -4019,11 +4019,8 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, if (tds->nfsdev_nmp != NULL) { if (tds->nfsdev_mdsisset == 0 && ds == NULL) ds = tds; - else if (tds->nfsdev_mdsisset != 0 && - mp->mnt_stat.f_fsid.val[0] == -
svn commit: r361312 - stable/12/tests/sys/netpfil/pf/ioctl
Author: kevans Date: Thu May 21 01:55:10 2020 New Revision: 361312 URL: https://svnweb.freebsd.org/changeset/base/361312 Log: MFC r361065: pf tests: fix up a couple WARNS= 6 nits common_init_tbl is only used within this single CU, so it should be marked static. WARNS=6 also complained about the var defined by `ATF_TC_WITH_CLEANUP(getastats);` being unused, which turns out to be because it's not been hooked up in ATF_TP_ADD_TCS. kp@ did not immediately recall any reason for this, and the case passes on my local system, so hook it up. Note that I've not yet set WARNS= 6 here. Investigation is underway to see if we can feasibly default WARNS to 6 for src builds to catch directories too deep to inherit a WARNS from the top-level subdirectories' Makefile.inc. Those particular WARNS settings will be subsequently removed as they become redundant with a more-global default. Modified: stable/12/tests/sys/netpfil/pf/ioctl/validation.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/ioctl/validation.c == --- stable/12/tests/sys/netpfil/pf/ioctl/validation.c Thu May 21 01:53:03 2020(r361311) +++ stable/12/tests/sys/netpfil/pf/ioctl/validation.c Thu May 21 01:55:10 2020(r361312) @@ -51,7 +51,7 @@ static int dev; #define COMMON_CLEANUP() \ close(dev); -void +static void common_init_tbl(struct pfr_table *tbl) { bzero(tbl, sizeof(struct pfr_table)); @@ -795,6 +795,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, addtables); ATF_TP_ADD_TC(tp, deltables); ATF_TP_ADD_TC(tp, gettables); + ATF_TP_ADD_TC(tp, getastats); ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361311 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd
Author: kevans Date: Thu May 21 01:53:03 2020 New Revision: 361311 URL: https://svnweb.freebsd.org/changeset/base/361311 Log: MFC r361000, r361036: improve inetd(8) examples r361000: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. r361036: inetd(8): Add comments to all examples Modified: stable/12/usr.sbin/inetd/inetd.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/inetd/inetd.8 Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/inetd/inetd.8 == --- stable/12/usr.sbin/inetd/inetd.8Thu May 21 01:23:59 2020 (r361310) +++ stable/12/usr.sbin/inetd/inetd.8Thu May 21 01:53:03 2020 (r361311) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,14 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpdftpd -l ntalkdgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shellstream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/datedate + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd -/var/run/echo stream unix nowait root internal + +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ @@ -914,6 +930,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Enji Cooper > Sent: Wednesday, May 20, 2020 11:58 PM > To: Shawn Webb > Cc: Wei Hu ; src-committ...@freebsd.org; svn-src- > a...@freebsd.org; svn-src-h...@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > > > On May 20, 2020, at 08:54, Enji Cooper wrote: > > > >>> On May 20, 2020, at 08:11, Shawn Webb > wrote: > >>> > >>> On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > >>> Author: whu > >>> Date: Wed May 20 11:03:59 2020 > >>> New Revision: 361275 > >>> URL: > >>> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > >>> > nweb.freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7C > weh% > >>> > 40microsoft.com%7Cd6ff3617bffa43d10a7708d7fcd68470%7C72f988bf86f141 > a > >>> > f91ab2d7cd011db47%7C1%7C0%7C637255870581110888sdata=mzz6R > ILCVBk > >>> q06RI1PAfVNKWZO2y7jBO0C1E%2F%2FEJwUY%3Dreserved=0 > >>> > >>> Log: > >>> HyperV socket implementation for FreeBSD > >>> > >>> This change adds Hyper-V socket feature in FreeBSD. New socket > >>> address family AF_HYPERV and its kernel support are added. > > > > Hi Wei, > >Could you please further describe what this feature is/does? > > I realize after looking at the review that it contains the content I was > hoping > for. It would have been helpful to folks if this context had been included in > the > commit message. Hi Enji, I thought I just keep it simple for the commit log message while people can refer to the review site for details. Sorry about that. Let me know if there is anyway to make up for it. Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361311 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd
Author: kevans Date: Thu May 21 01:53:03 2020 New Revision: 361311 URL: https://svnweb.freebsd.org/changeset/base/361311 Log: MFC r361000, r361036: improve inetd(8) examples r361000: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. r361036: inetd(8): Add comments to all examples Modified: stable/11/usr.sbin/inetd/inetd.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/inetd/inetd.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/inetd/inetd.8 == --- stable/11/usr.sbin/inetd/inetd.8Thu May 21 01:23:59 2020 (r361310) +++ stable/11/usr.sbin/inetd/inetd.8Thu May 21 01:53:03 2020 (r361311) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,14 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpdftpd -l ntalkdgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shellstream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/datedate + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd -/var/run/echo stream unix nowait root internal + +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ @@ -914,6 +930,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Shawn Webb > Sent: Wednesday, May 20, 2020 11:11 PM > To: Wei Hu > Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src- > h...@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: https://svnweb.freebsd.org/changeset/base/361275 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket address > > family AF_HYPERV and its kernel support are added. > > > > Submitted by: Wei Hu > > Reviewed by: Dexuan Cui > > Relnotes: yes > > Sponsored by: Microsoft > > Differential Revision:https://reviews.freebsd.org/D24061 > > Hey Wei Hu, > > Would it be good to bump __FreeBSD_version after a change like this? > Hi Shawn, I was not familiar to the mechanism of __FreeBSD_version. But it looks like a good idea. However I am not sure if I have the right to update the chapter.xml file. Can you help on what I need to do the update this version number? Thanks, Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361310 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl
Author: kevans Date: Thu May 21 01:23:59 2020 New Revision: 361310 URL: https://svnweb.freebsd.org/changeset/base/361310 Log: MFC r361022-r361023, r361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.sh == --- stable/11/usr.sbin/certctl/certctl.sh Wed May 20 23:27:01 2020 (r361309) +++ stable/11/usr.sbin/certctl/certctl.sh Thu May 21 01:23:59 2020 (r361310) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361310 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl
Author: kevans Date: Thu May 21 01:23:59 2020 New Revision: 361310 URL: https://svnweb.freebsd.org/changeset/base/361310 Log: MFC r361022-r361023, r361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/certctl/certctl.sh == --- stable/12/usr.sbin/certctl/certctl.sh Wed May 20 23:27:01 2020 (r361309) +++ stable/12/usr.sbin/certctl/certctl.sh Thu May 21 01:23:59 2020 (r361310) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361309 - stable/12/usr.sbin/bsdinstall/scripts
Author: dteske Date: Wed May 20 23:27:01 2020 New Revision: 361309 URL: https://svnweb.freebsd.org/changeset/base/361309 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision:https://reviews.freebsd.org/D23641 Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig == --- stable/12/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 23:18:47 2020(r361308) +++ stable/12/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 23:27:01 2020(r361309) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE +
svn commit: r361307 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake
Author: sjg Date: Wed May 20 22:25:46 2020 New Revision: 361307 URL: https://svnweb.freebsd.org/changeset/base/361307 Log: Merge bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests Added: head/contrib/bmake/filemon/ - copied from r361291, vendor/NetBSD/bmake/dist/filemon/ head/contrib/bmake/mk/compiler.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/compiler.mk head/contrib/bmake/mk/dirdeps-targets.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk head/contrib/bmake/unit-tests/Makefile - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile head/contrib/bmake/unit-tests/Makefile.config.in - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile.config.in head/contrib/bmake/unit-tests/cond-late.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp head/contrib/bmake/unit-tests/cond-late.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk head/contrib/bmake/unit-tests/dollar.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.exp head/contrib/bmake/unit-tests/dollar.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.mk head/contrib/bmake/unit-tests/include-main.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.exp head/contrib/bmake/unit-tests/include-main.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.mk head/contrib/bmake/unit-tests/include-sub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-sub.mk head/contrib/bmake/unit-tests/include-subsub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-subsub.mk head/contrib/bmake/unit-tests/varmod-edge.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp head/contrib/bmake/unit-tests/varmod-edge.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk Deleted: head/contrib/bmake/unit-tests/Makefile.in Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/Makefile head/contrib/bmake/Makefile.config.in head/contrib/bmake/VERSION head/contrib/bmake/arch.c head/contrib/bmake/boot-strap head/contrib/bmake/bsd.after-import.mk head/contrib/bmake/compat.c head/contrib/bmake/config.h.in head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/job.c head/contrib/bmake/make-bootstrap.sh.in head/contrib/bmake/make.1 head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/meta.h head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/autodep.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/doc.mk head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/init.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk
svn commit: r361306 - in head: stand/libsa/geli sys/opencrypto
Author: jhb Date: Wed May 20 22:25:41 2020 New Revision: 361306 URL: https://svnweb.freebsd.org/changeset/base/361306 Log: Fix libstand build breakage after r361298. - Use enc_xform_aes_xts.setkey() directly instead of duplicating the code now that it no longer calls malloc(). - Rather than bringing back all of xform_userland.h, add a conditional #include of to xform_enc.h. - Update calls to encrypt/decrypt callbacks in enc_xform_aes_xts for separate input/output pointers. Pointy hat to:jhb Modified: head/stand/libsa/geli/geliboot_crypto.c head/sys/opencrypto/xform_enc.h Modified: head/stand/libsa/geli/geliboot_crypto.c == --- head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:20:53 2020 (r361305) +++ head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:25:41 2020 (r361306) @@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size xts_len = keysize << 1; ctxp = - rijndael_set_key(>key1, key, xts_len / 2); - rijndael_set_key(>key2, key + (xts_len / 16), xts_len / 2); + enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); + enc_xform_aes_xts.reinit(ctxp, iv); - enc_xform_aes_xts.reinit((caddr_t)ctxp, iv); - switch (enc) { case 0: /* decrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.decrypt(ctxp, data + i, + data + i); } break; case 1: /* encrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.encrypt(ctxp, data + i, + data + 1); } break; } Modified: head/sys/opencrypto/xform_enc.h == --- head/sys/opencrypto/xform_enc.h Wed May 20 22:20:53 2020 (r361305) +++ head/sys/opencrypto/xform_enc.h Wed May 20 22:25:41 2020 (r361306) @@ -36,6 +36,9 @@ #include #include #include +#ifdef _STANDALONE +#include +#endif #define AESICM_BLOCKSIZE AES_BLOCK_LEN #defineAES_XTS_BLOCKSIZE 16 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys
On 5/20/20 3:08 PM, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:08:26 2020 > New Revision: 361303 > URL: https://svnweb.freebsd.org/changeset/base/361303 > > Log: > Change the samantic of struct link_map l_addr member. > > It previously returned the object map base address, while all other > ELF operating systems return load offset, i.e. the difference between > map base and the link base. > > Explain the meaning of the field in the man page. > > Stop filling the mips-only l_offs member, which is apparently unused. Thanks! -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361305 - stable/11/usr.sbin/bsdinstall/scripts
Author: dteske Date: Wed May 20 22:20:53 2020 New Revision: 361305 URL: https://svnweb.freebsd.org/changeset/base/361305 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision:https://reviews.freebsd.org/D23641 Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig == --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 22:19:43 2020(r361304) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfigWed May 20 22:20:53 2020(r361305) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE +
svn commit: r361304 - stable/12/contrib/elftoolchain/libelf
Author: emaste Date: Wed May 20 22:19:43 2020 New Revision: 361304 URL: https://svnweb.freebsd.org/changeset/base/361304 Log: MFC r361104 (jhibbits): elftoolchain: Add powerpc64 definition powerpc is already in place, but powerpc64 is needed separately. Modified: stable/12/contrib/elftoolchain/libelf/_libelf_config.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelf/_libelf_config.h == --- stable/12/contrib/elftoolchain/libelf/_libelf_config.h Wed May 20 22:08:26 2020(r361303) +++ stable/12/contrib/elftoolchain/libelf/_libelf_config.h Wed May 20 22:19:43 2020(r361304) @@ -91,6 +91,12 @@ #endif #defineLIBELF_CLASSELFCLASS32 +#elif defined(__powerpc64__) + +#defineLIBELF_ARCH EM_PPC64 +#defineLIBELF_BYTEORDERELFDATA2MSB +#defineLIBELF_CLASSELFCLASS64 + #elif defined(__powerpc__) #defineLIBELF_ARCH EM_PPC ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys
Author: kib Date: Wed May 20 22:08:26 2020 New Revision: 361303 URL: https://svnweb.freebsd.org/changeset/base/361303 Log: Change the samantic of struct link_map l_addr member. It previously returned the object map base address, while all other ELF operating systems return load offset, i.e. the difference between map base and the link base. Explain the meaning of the field in the man page. Stop filling the mips-only l_offs member, which is apparently unused. PR: 246561 Requested by: Damjan Jovanovic Reviewed by: emaste, jhb, cem (previous version) Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D24918 Modified: head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/dlinfo.3 == --- head/lib/libc/gen/dlinfo.3 Wed May 20 22:00:31 2020(r361302) +++ head/lib/libc/gen/dlinfo.3 Wed May 20 22:08:26 2020(r361303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2003 +.Dd May 19, 2020 .Dt DLINFO 3 .Os .Sh NAME @@ -105,7 +105,7 @@ structure is defined in .In link.h and has the following members: .Bd -literal -offset indent -caddr_t l_addr;/* Base Address of library */ +caddr_t l_addr;/* Load Offset of library */ const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, /* linked list of mapped libs */ @@ -113,7 +113,9 @@ struct link_map *l_next, /* linked list of mapped li .Ed .Bl -tag -width ".Va l_addr" .It Va l_addr -The base address of the object loaded into memory. +The load offset of the object, that is, the difference between +the actual load address and the base virtual address the object +was linked at. .It Va l_name The full name of the loaded shared object. .It Va l_ld Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cWed May 20 22:00:31 2020 (r361302) +++ head/libexec/rtld-elf/rtld.cWed May 20 22:08:26 2020 (r361303) @@ -4032,12 +4032,8 @@ linkmap_add(Obj_Entry *obj) struct link_map *prev; obj->linkmap.l_name = obj->path; -obj->linkmap.l_addr = obj->mapbase; +obj->linkmap.l_addr = obj->relocbase; obj->linkmap.l_ld = obj->dynamic; -#ifdef __mips__ -/* GDB needs load offset on MIPS to use the symbols */ -obj->linkmap.l_offs = obj->relocbase; -#endif if (r_debug.r_map == NULL) { r_debug.r_map = l; Modified: head/sys/sys/link_elf.h == --- head/sys/sys/link_elf.h Wed May 20 22:00:31 2020(r361302) +++ head/sys/sys/link_elf.h Wed May 20 22:08:26 2020(r361303) @@ -57,9 +57,9 @@ #defineLA_SER_SECURE 0x80/* default (secure) path prepended */ typedef struct link_map { - caddr_t l_addr; /* Base Address of library */ + caddr_t l_addr; /* Load Offset of library */ #ifdef __mips__ - caddr_t l_offs; /* Load Offset of library */ + caddr_t l_xxx; /* unused */ #endif const char *l_name;/* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86
On Wed, May 20, 2020 at 10:00:31PM +, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:00:31 2020 > New Revision: 361302 > URL: https://svnweb.freebsd.org/changeset/base/361302 > > Log: > amd64: Add a knob to flush RSB on context switches if machine has SMEP. > > The flush is needed to prevent cross-process ret2spec, which is not handled > on kernel entry if IBPB is enabled but SMEP is present. > While there, add i386 RSB flush. > > Reported by:Anthony Steinhauser > Reviewed by:markj, Anthony Steinhauser > Discussed with: philip > admbugs:961 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week https://reviews.freebsd.org/D24868 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86
Author: kib Date: Wed May 20 22:00:31 2020 New Revision: 361302 URL: https://svnweb.freebsd.org/changeset/base/361302 Log: amd64: Add a knob to flush RSB on context switches if machine has SMEP. The flush is needed to prevent cross-process ret2spec, which is not handled on kernel entry if IBPB is enabled but SMEP is present. While there, add i386 RSB flush. Reported by: Anthony Steinhauser Reviewed by: markj, Anthony Steinhauser Discussed with: philip admbugs: 961 Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/share/man/man7/security.7 head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/share/man/man7/security.7 == --- head/share/man/man7/security.7 Wed May 20 21:41:36 2020 (r361301) +++ head/share/man/man7/security.7 Wed May 20 22:00:31 2020 (r361302) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2020 +.Dd May 16, 2020 .Dt SECURITY 7 .Os .Sh NAME @@ -992,6 +992,13 @@ See also .Xr proccontrol 1 mode .Dv kpti . +.It Dv machdep.mitigations.flush_rsb_ctxsw +amd64. +Controls Return Stack Buffer flush on context switch, to prevent +cross-process ret2spec attacks. +Only needed, and only enabled by default, if the machine +supports SMEP, otherwise IBRS would do necessary flushing on kernel +entry anyway. .It Dv hw.mds_disable amd64 and i386. Controls Microarchitectural Data Sampling hardware information leak Modified: head/sys/amd64/amd64/cpu_switch.S == --- head/sys/amd64/amd64/cpu_switch.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/cpu_switch.S Wed May 20 22:00:31 2020 (r361302) @@ -221,6 +221,8 @@ done_load_dr: movq%rax,(%rsp) movqPCPU(CURTHREAD),%rdi callfpu_activate_sw + cmpb$0,cpu_flush_rsb_ctxsw(%rip) + jne rsb_flush ret /* Modified: head/sys/amd64/amd64/initcpu.c == --- head/sys/amd64/amd64/initcpu.c Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/initcpu.c Wed May 20 22:00:31 2020 (r361302) @@ -238,12 +238,24 @@ initializecpu(void) cr4 |= CR4_PKE; /* +* If SMEP is present, we only need to flush RSB (by default) +* on context switches, to prevent cross-process ret2spec +* attacks. Do it automatically if ibrs_disable is set, to +* complete the mitigation. +* * Postpone enabling the SMEP on the boot CPU until the page * tables are switched from the boot loader identity mapping * to the kernel tables. The boot loader enables the U bit in * its tables. */ - if (!IS_BSP()) { + if (IS_BSP()) { + if (cpu_stdext_feature & CPUID_STDEXT_SMEP && + !TUNABLE_INT_FETCH( + "machdep.mitigations.cpu_flush_rsb_ctxsw", + _flush_rsb_ctxsw) && + hw_ibrs_disable) + cpu_flush_rsb_ctxsw = 1; + } else { if (cpu_stdext_feature & CPUID_STDEXT_SMEP) cr4 |= CR4_SMEP; if (cpu_stdext_feature & CPUID_STDEXT_SMAP) Modified: head/sys/amd64/amd64/support.S == --- head/sys/amd64/amd64/support.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/support.S Wed May 20 22:00:31 2020 (r361302) @@ -1613,23 +1613,27 @@ ENTRY(pmap_pti_pcid_invlrng) retq .altmacro - .macro ibrs_seq_label l -handle_ibrs_\l: + .macro rsb_seq_label l +rsb_seq_\l: .endm - .macro ibrs_call_label l - callhandle_ibrs_\l + .macro rsb_call_label l + callrsb_seq_\l .endm - .macro ibrs_seq count + .macro rsb_seq count ll=1 .rept \count - ibrs_call_label %(ll) + rsb_call_label %(ll) nop - ibrs_seq_label %(ll) + rsb_seq_label %(ll) addq$8,%rsp ll=ll+1 .endr .endm +ENTRY(rsb_flush) + rsb_seq 32 + ret + /* all callers already saved %rax, %rdx, and %rcx */ ENTRY(handle_ibrs_entry) cmpb$0,hw_ibrs_ibpb_active(%rip) @@ -1641,8 +1645,7 @@ ENTRY(handle_ibrs_entry) wrmsr movb$1,PCPU(IBPB_SET) testl $CPUID_STDEXT_SMEP,cpu_stdext_feature(%rip) - jne 1f - ibrs_seq 32 + je rsb_flush 1: ret END(handle_ibrs_entry) Modified: head/sys/i386/i386/support.s
svn commit: r361301 - in stable/12: contrib/elftoolchain/common contrib/elftoolchain/libelftc lib/libelf
Author: emaste Date: Wed May 20 21:41:36 2020 New Revision: 361301 URL: https://svnweb.freebsd.org/changeset/base/361301 Log: MFC r349577 (arichardson): Allow bootstrapping elftoolchain on MacOS and Linux This is required in order to build on non-FreeBSD systems without setting all the XAR/XSTRINGS/etc. variables Modified: stable/12/contrib/elftoolchain/common/_elftc.h stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c stable/12/lib/libelf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/common/_elftc.h == --- stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:39:19 2020(r361300) +++ stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:41:36 2020(r361301) @@ -374,11 +374,14 @@ extern const char *__progname; #include #definehtobe32(x) OSSwapHostToBigInt32(x) +#definehtole32(x) OSSwapHostToLittleInt32(x) +#ifndef roundup2 #defineroundup2roundup +#endif -#defineELFTC_BYTE_ORDER_BYTE_ORDER -#defineELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN -#defineELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN +#defineELFTC_BYTE_ORDER__DARWIN_BYTE_ORDER +#defineELFTC_BYTE_ORDER_LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#defineELFTC_BYTE_ORDER_BIG_ENDIAN __DARWIN_BIG_ENDIAN #defineELFTC_HAVE_MMAP 1 #defineELFTC_HAVE_STRMODE 1 @@ -418,7 +421,9 @@ extern const char *__progname; /* Whether we need to supply {be,le}32dec. */ #define ELFTC_NEED_BYTEORDER_EXTENSIONS1 +#ifndef roundup2 #defineroundup2roundup +#endif #endif /* __GLIBC__ || __linux__ */ Modified: stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c == --- stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:39:19 2020(r361300) +++ stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:41:36 2020(r361301) @@ -37,7 +37,7 @@ ELFTC_VCSID("$Id$"); * stat'. */ -#ifdefined(__FreeBSD__) || defined(__NetBSD__) +#ifdefined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #defineATIME st_atimespec #defineMTIME st_mtimespec #defineLIBELFTC_HAVE_UTIMES1 Modified: stable/12/lib/libelf/Makefile == --- stable/12/lib/libelf/Makefile Wed May 20 21:39:19 2020 (r361300) +++ stable/12/lib/libelf/Makefile Wed May 20 21:41:36 2020 (r361301) @@ -79,6 +79,13 @@ INCS=libelf.h gelf.h # SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h +# Allow bootstrapping elftoolchain on Linux: +.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux" +native-elf-format.h: + ${ELFTCDIR}/common/native-elf-format > ${.TARGET} || rm ${.TARGET} +SRCS+= native-elf-format.h +.endif + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES=${GENSRCS} CLEANDIRS= sys ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361300 - head/usr.sbin/bsdinstall/scripts
Author: dteske Date: Wed May 20 21:39:19 2020 New Revision: 361300 URL: https://svnweb.freebsd.org/changeset/base/361300 Log: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude MFC after:0 days X-MFC-to: stable/11 Differential Revision:https://reviews.freebsd.org/D23641 Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig == --- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:22:25 2020 (r361299) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:39:19 2020 (r361300) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } +
svn commit: r361299 - head/sys/x86/x86
Author: kib Date: Wed May 20 21:22:25 2020 New Revision: 361299 URL: https://svnweb.freebsd.org/changeset/base/361299 Log: Do not consider CAP_RDCL_NO as an indicator for all MDS vulnerabilities handled by hardware. Reported by: Anthony Steinhauser admbugs: 962 Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c == --- head/sys/x86/x86/cpu_machdep.c Wed May 20 21:21:01 2020 (r361298) +++ head/sys/x86/x86/cpu_machdep.c Wed May 20 21:22:25 2020 (r361299) @@ -1078,11 +1078,11 @@ hw_mds_recalculate(void) * reported. For instance, hypervisor might unknowingly * filter the cap out. * For the similar reasons, and for testing, allow to enable -* mitigation even for RDCL_NO or MDS_NO caps. +* mitigation even when MDS_NO cap is set. */ if (cpu_vendor_id != CPU_VENDOR_INTEL || hw_mds_disable == 0 || - ((cpu_ia32_arch_caps & (IA32_ARCH_CAP_RDCL_NO | - IA32_ARCH_CAP_MDS_NO)) != 0 && hw_mds_disable == 3)) { + ((cpu_ia32_arch_caps & IA32_ARCH_CAP_MDS_NO) != 0 && + hw_mds_disable == 3)) { mds_handler = mds_handler_void; } else if (((cpu_stdext_feature3 & CPUID_STDEXT3_MD_CLEAR) != 0 && hw_mds_disable == 3) || hw_mds_disable == 1) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361298 - in head/sys: crypto/chacha20 dev/cxgbe/crypto opencrypto
Author: jhb Date: Wed May 20 21:21:01 2020 New Revision: 361298 URL: https://svnweb.freebsd.org/changeset/base/361298 Log: Various cleanups to the software encryption transform interface. - Consistently use 'void *' for key schedules / key contexts instead of a mix of 'caddr_t', 'uint8_t *', and 'void *'. - Add a ctxsize member to enc_xform similar to what auth transforms use and require callers to malloc/zfree the context. The setkey callback now supplies the caller-allocated context pointer and the zerokey callback is removed. Callers now always use zfree() to ensure key contexts are zeroed. - Consistently use C99 initializers for all statically-initialized instances of 'struct enc_xform'. - Change the encrypt and decrypt functions to accept separate in and out buffer pointers. Almost all of the backend crypto functions already supported separate input and output buffers and this makes it simpler to support separate buffers in OCF. - Remove xform_userland.h shim to permit transforms to be compiled in userland. Transforms no longer call malloc/free directly. Reviewed by: cem (earlier version) Sponsored by: Netflix Differential Revision:https://reviews.freebsd.org/D24855 Deleted: head/sys/opencrypto/xform_userland.h Modified: head/sys/crypto/chacha20/chacha-sw.c head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_aes_icm.c head/sys/opencrypto/xform_aes_xts.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_cml.c head/sys/opencrypto/xform_comp.h head/sys/opencrypto/xform_enc.h head/sys/opencrypto/xform_gmac.c head/sys/opencrypto/xform_null.c head/sys/opencrypto/xform_rijndael.c Modified: head/sys/crypto/chacha20/chacha-sw.c == --- head/sys/crypto/chacha20/chacha-sw.cWed May 20 21:16:54 2020 (r361297) +++ head/sys/crypto/chacha20/chacha-sw.cWed May 20 21:21:01 2020 (r361298) @@ -7,63 +7,42 @@ __FBSDID("$FreeBSD$"); #include static int -chacha20_xform_setkey(u_int8_t **sched, const u_int8_t *key, int len) +chacha20_xform_setkey(void *ctx, const uint8_t *key, int len) { - struct chacha_ctx *ctx; if (len != CHACHA_MINKEYLEN && len != 32) return (EINVAL); - ctx = malloc(sizeof(*ctx), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); - *sched = (void *)ctx; - if (ctx == NULL) - return (ENOMEM); - chacha_keysetup(ctx, key, len * 8); return (0); } static void -chacha20_xform_reinit(caddr_t key, const u_int8_t *iv) +chacha20_xform_reinit(void *ctx, const u_int8_t *iv) { - struct chacha_ctx *ctx; - ctx = (void *)key; chacha_ivsetup(ctx, iv + 8, iv); } static void -chacha20_xform_zerokey(u_int8_t **sched) +chacha20_xform_crypt(void *ctx, const uint8_t *in, uint8_t *out) { - struct chacha_ctx *ctx; - ctx = (void *)*sched; - explicit_bzero(ctx, sizeof(*ctx)); - free(ctx, M_CRYPTO_DATA); - *sched = NULL; + chacha_encrypt_bytes(ctx, in, out, 1); } static void -chacha20_xform_crypt(caddr_t cctx, u_int8_t *bytes) +chacha20_xform_crypt_multi(void *ctx, const uint8_t *in, uint8_t *out, +size_t len) { - struct chacha_ctx *ctx; - ctx = (void *)cctx; - chacha_encrypt_bytes(ctx, bytes, bytes, 1); + chacha_encrypt_bytes(ctx, in, out, len); } -static void -chacha20_xform_crypt_multi(void *vctx, uint8_t *bytes, size_t len) -{ - struct chacha_ctx *ctx; - - ctx = vctx; - chacha_encrypt_bytes(ctx, bytes, bytes, len); -} - struct enc_xform enc_xform_chacha20 = { .type = CRYPTO_CHACHA20, .name = "chacha20", + .ctxsize = sizeof(struct chacha_ctx), .blocksize = 1, .ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN, .minkey = CHACHA_MINKEYLEN, @@ -71,7 +50,6 @@ struct enc_xform enc_xform_chacha20 = { .encrypt = chacha20_xform_crypt, .decrypt = chacha20_xform_crypt, .setkey = chacha20_xform_setkey, - .zerokey = chacha20_xform_zerokey, .reinit = chacha20_xform_reinit, .encrypt_multi = chacha20_xform_crypt_multi, .decrypt_multi = chacha20_xform_crypt_multi, Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c == --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:21:01 2020 (r361298) @@ -1354,8 +1354,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr { struct auth_hash *axf; struct enc_xform *exf; - void *auth_ctx; - uint8_t *kschedule; + void *auth_ctx, *kschedule; char block[GMAC_BLOCK_LEN]; char digest[GMAC_DIGEST_LEN]; char
svn commit: r361297 - in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips
Author: jhb Date: Wed May 20 21:16:54 2020 New Revision: 361297 URL: https://svnweb.freebsd.org/changeset/base/361297 Log: Print CPU informtion later in boot. Match other architectures and print CPU information during cpu_startup(). In particular, this prints the information after the message buffer is initialized which allows it to be retrieved after boot via dmesg(8). While here, add some extern declarations to in place of duplicated declarations in various source files. Reviewed by: brooks Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D24936 Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/include/md_var.h head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mips/cpu.c head/sys/mips/mips/machdep.c Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c == --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:15:43 2020(r361296) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:16:54 2020(r361297) @@ -148,8 +148,6 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_ "Board revision"); #endif -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/atheros/ar71xx_machdep.c == --- head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -275,8 +275,6 @@ ar71xx_platform_check_mac_hints(void) return (0); } -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -97,8 +97,6 @@ struct octeon_feature_description { }; extern int *end; -extern char cpu_model[]; -extern char cpu_board[]; static char octeon_kenv[0x2000]; static const struct octeon_feature_description octeon_feature_descriptions[] = { Modified: head/sys/mips/include/md_var.h == --- head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/include/md_var.h Wed May 20 21:16:54 2020 (r361297) @@ -42,6 +42,8 @@ * Miscellaneous machine-dependent declarations. */ extern longMaxmem; +extern charcpu_board[]; +extern charcpu_model[]; extern charsigcode[]; extern int szsigcode; #if defined(__mips_n32) || defined(__mips_n64) @@ -75,6 +77,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_identify(void); void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; Modified: head/sys/mips/mediatek/mtk_soc.c == --- head/sys/mips/mediatek/mtk_soc.cWed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mediatek/mtk_soc.cWed May 20 21:16:54 2020 (r361297) @@ -396,8 +396,6 @@ mtk_soc_try_early_detect(void) bus_space_unmap(bst, bsh, MTK_DEFAULT_SIZE); } -extern char cpu_model[]; - void mtk_soc_set_cpu_model(void) { Modified: head/sys/mips/mips/cpu.c == --- head/sys/mips/mips/cpu.cWed May 20 21:15:43 2020(r361296) +++ head/sys/mips/mips/cpu.cWed May 20 21:16:54 2020(r361297) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static void cpu_identify(void); - struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ @@ -294,18 +292,16 @@ mips_cpu_init(void) mips_icache_sync_all(); mips_dcache_wbinv_all(); - /* Print some info about CPU */ - cpu_identify(); } -static void +void cpu_identify(void) { uint32_t cfg0, cfg1, cfg2, cfg3; #if defined(CPU_MIPS1004K) || defined (CPU_MIPS74K) || defined (CPU_MIPS24K) uint32_t cfg7; #endif - printf("cpu%d: ", 0); /* XXX per-cpu */ + printf("CPU: "); switch (cpuinfo.cpu_vendor) { case MIPS_PRID_CID_MTI: printf("MIPS Technologies"); @@ -347,6 +343,8 @@ cpu_identify(void) printf("Unknown cid %#x", cpuinfo.cpu_vendor);
svn commit: r361296 - in head/sys/mips: include mips
Author: jhb Date: Wed May 20 21:15:43 2020 New Revision: 361296 URL: https://svnweb.freebsd.org/changeset/base/361296 Log: Simplify hot-patching cpu_switch() for lack of UserLocal register. Rather than walking all of cpu_switch looking for the sequence of instructions to patch, add a global label at the location that needs the patch applied. Reviewed by: brooks, Alfredo Mazzinghi Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D24931 Modified: head/sys/mips/include/md_var.h head/sys/mips/mips/cpu.c head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/md_var.h == --- head/sys/mips/include/md_var.h Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) @@ -75,6 +75,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; void busdma_swi(void); Modified: head/sys/mips/mips/cpu.c == --- head/sys/mips/mips/cpu.cWed May 20 21:02:08 2020(r361295) +++ head/sys/mips/mips/cpu.cWed May 20 21:15:43 2020(r361296) @@ -68,44 +68,6 @@ struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ ((uint32_t)(((a) << 26)|((b) << 21)|((c) << 16)|((d) << 11)|(e))) -#if defined(__mips_n64) - -# define _LOAD_T0_MDTLS_A1 \ -_ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ -_ENCODE_INSN(OP_LD, A1, T1, 0, \ -offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ -_ENCODE_INSN(0, T0, T1, V0, OP_DADDU) - -#else /* mips 32 */ - -# define _LOAD_T0_MDTLS_A1 \ -_ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ -_ENCODE_INSN(OP_LW, A1, T1, 0, \ -offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ -_ENCODE_INSN(0, T0, T1, V0, OP_ADDU) - -#endif /* ! __mips_n64 */ - -#if defined(__mips_n64) || defined(__mips_n32) - -# define _MTC0_V0_USERLOCAL \ -_ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) - -#else /* mips o32 */ - -# define _MTC0_V0_USERLOCAL \ -_ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) - -#endif /* ! (__mips_n64 || __mipsn32) */ - #define_JR_RA _ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR) #define_NOP0 @@ -120,18 +82,9 @@ remove_userlocal_code(uint32_t *cpu_switch_code) { uint32_t *instructp; - for (instructp = cpu_switch_code;; instructp++) { - if (instructp[0] == _JR_RA) - panic("%s: Unable to patch cpu_switch().", __func__); - if (instructp[0] == _LOAD_T0_MDTLS_A1 && - instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && - instructp[2] == _ADDU_V0_T0_T1 && - instructp[3] == _MTC0_V0_USERLOCAL) { - instructp[0] = _JR_RA; - instructp[1] = _NOP; - break; - } - } + instructp = cpu_switch_code; + instructp[0] = _JR_RA; + instructp[1] = _NOP; } /* @@ -202,7 +155,7 @@ mips_get_identity(struct mips_cpuinfo *cpuinfo) * cpu_switch() and remove unsupported code. */ cpuinfo->userlocal_reg = false; - remove_userlocal_code((uint32_t *)cpu_switch); + remove_userlocal_code((uint32_t *)cpu_switch_set_userlocal); } Modified: head/sys/mips/mips/swtch.S == --- head/sys/mips/mips/swtch.S Wed May 20 21:02:08 2020(r361295) +++ head/sys/mips/mips/swtch.S Wed May 20 21:15:43 2020(r361296) @@ -383,6 +383,8 @@ sw2: * Note that this code is removed if the CPU doesn't support ULRI by * remove_userlocal_code() in cpu.c. */ + .globl cpu_switch_set_userlocal +cpu_switch_set_userlocal: PTR_L t0, TD_MDTLS(a1)# Get TLS pointer PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset PTR_ADDU v0, t0, t1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361295 - head/stand/common
Author: kevans Date: Wed May 20 21:02:08 2020 New Revision: 361295 URL: https://svnweb.freebsd.org/changeset/base/361295 Log: loader: fix userboot's ability to detect a guest's interpreter Some time after r338418, I believe with -Os/-Oz -ffunction-sections -fdata-sections, the bootprog_interp variable that held our "$Interpreter:" marker started getting strip from all loaders, with exception to userboot since it used bootprog_interp to determine what flavor of userboot it was. At some point, it had been brought to my attention that this was no longer working and I had worked up some potential solutions to use the variable that involved printing it out. My vague recollection is that this was rejected, and I forgot to explore the alternatives; I cannot find records of this discussion anymore. Fast forward to present day, Andrew reported that it was non-functional and offered (effectively) this patch (sans comment) to stop the compiler from optimizing it out by assigning it to a volatile variable. This removes concerns about user-facing change while retaining the interpreter marker. Furthermore, it could certainly be uglier. Reported and tested by: Andrew Gierth MFC after:3 days Modified: head/stand/common/interp.c Modified: head/stand/common/interp.c == --- head/stand/common/interp.c Wed May 20 20:58:48 2020(r361294) +++ head/stand/common/interp.c Wed May 20 21:02:08 2020(r361295) @@ -45,8 +45,17 @@ __FBSDID("$FreeBSD$"); void interact(void) { - static char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ + const char * volatile interp_identifier; + /* +* Because interp_identifier is volatile, it cannot be optimized out by +* the compiler as it's considered an externally observable event. This +* prevents the compiler from optimizing out our carefully placed +* $Interpreter:4th string that userboot may use to determine that +* we need to switch interpreters. +*/ + interp_identifier = bootprog_interp; interp_init(); printf("\n"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361294 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar
Author: mm Date: Wed May 20 20:58:48 2020 New Revision: 361294 URL: https://svnweb.freebsd.org/changeset/base/361294 Log: MFV r361280: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_compat_zstd_2.tar.zst.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/README.md head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_filter_program.c head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/filter_fork.h head/contrib/libarchive/libarchive/filter_fork_posix.c head/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c head/contrib/libarchive/libarchive/test/test_compat_zstd.c head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c head/contrib/libarchive/tar/bsdtar.1 head/lib/libarchive/tests/Makefile head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS == --- head/contrib/libarchive/NEWSWed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/NEWSWed May 20 20:58:48 2020 (r361294) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: head/contrib/libarchive/README.md == --- head/contrib/libarchive/README.md Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/README.md Wed May 20 20:58:48 2020 (r361294) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: head/contrib/libarchive/libarchive/archive.h == --- head/contrib/libarchive/libarchive/archive.hWed May 20 20:58:17 2020(r361293) +++ head/contrib/libarchive/libarchive/archive.hWed May 20 20:58:48 2020(r361294) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define
svn commit: r361293 - in head/sys: kern sys
Author: jhb Date: Wed May 20 20:58:17 2020 New Revision: 361293 URL: https://svnweb.freebsd.org/changeset/base/361293 Log: Remove copyinfrom() and copyinstrfrom(). These functions were added in 2001 and are currently unused. copyinfrom() looks to have never been used. copyinstrfrom() was used for two weeks before the code was refactored to remove it's sole use. Reviewed by: brooks, kib Obtained from:CheriBSD Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D24928 Modified: head/sys/kern/subr_uio.c head/sys/sys/uio.h Modified: head/sys/kern/subr_uio.c == --- head/sys/kern/subr_uio.cWed May 20 20:24:37 2020(r361292) +++ head/sys/kern/subr_uio.cWed May 20 20:58:17 2020(r361293) @@ -346,44 +346,6 @@ again: } int -copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, -int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyin(src, dst, len); - break; - case UIO_SYSSPACE: - bcopy(src, dst, len); - break; - default: - panic("copyinfrom: bad seg %d\n", seg); - } - return (error); -} - -int -copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, -size_t * __restrict copied, int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyinstr(src, dst, len, copied); - break; - case UIO_SYSSPACE: - error = copystr(src, dst, len, copied); - break; - default: - panic("copyinstrfrom: bad seg %d\n", seg); - } - return (error); -} - -int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) { u_int iovlen; Modified: head/sys/sys/uio.h == --- head/sys/sys/uio.h Wed May 20 20:24:37 2020(r361292) +++ head/sys/sys/uio.h Wed May 20 20:58:17 2020(r361293) @@ -80,12 +80,8 @@ struct vm_page; struct bus_dma_segment; struct uio *cloneuio(struct uio *uiop); -intcopyinfrom(const void * __restrict src, void * __restrict dst, - size_t len, int seg); intcopyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error); -intcopyinstrfrom(const void * __restrict src, void * __restrict dst, - size_t len, size_t * __restrict copied, int seg); intcopyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop); intcopyout_map(struct thread *td, vm_offset_t *addr, size_t sz); intcopyout_unmap(struct thread *td, vm_offset_t addr, size_t sz); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r360833 - head
On Tue, May 12, 2020 at 10:16:03PM +, Brooks Davis wrote: > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > > > On Sat, May 09, 2020 at 02:01:29AM +, Kyle Evans wrote: > > > > Author: kevans > > > > Date: Sat May 9 02:01:29 2020 > > > > New Revision: 360833 > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > Log: > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > This can be run as root or normal user with no problem; if they hadn't > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host > > > > certctl to > > > > rehash the DESTDIR. This would allow one to build systems > > > > WITHOUT_OPENSSL + > > > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > > > appropriate *ssl from somewhere else. > > > > > > > > Cross-builds are fine because this will always use the host certctl, > > > > or just > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > Modified: > > > > head/Makefile.inc1 > > > > > > > > Modified: head/Makefile.inc1 > > > > == > > > > --- head/Makefile.inc1Sat May 9 01:48:08 2020(r360832) > > > > +++ head/Makefile.inc1Sat May 9 02:01:29 2020(r360833) > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: > > > > _installcheck > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > .endfor > > > > .endif > > > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > > > + # We could make certctl a bootstrap tool, but it requires OpenSSL > > > > and > > > > + # friends, which we likely don't want. We'll rehash on a > > > > best-effort > > > > + # basis, otherwise we'll just mention that we're not doing it to > > > > raise > > > > + # awareness. > > > > + @if which certctl>/dev/null; then \ > > > > + certctl rehash \ > > > > > > Does this update METALOG with the added links? > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > In general I'm not enthusiastic about additions to installworld that do > > > anything other than copying files, creating links, etc in simple ways. > > > > I will happily back this out if I can get some qualified eyes to > > review/improve it. It does not update METALOG, and it probably should. > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > `certctl rehash` all over the tree in various points that may need it; > > the release(7) scripts will need to be done if we don't do it here at > > a minimum, and I haven't put much thought into it beyond that. > > I'm not in a rush to back this out given that it's solving a real > problem, but lets talk about improvements. > > I kind of feel like this belongs in distribution (which I think would > deal with release scripts) or in etcupdate/mergemaster, but I'm not > sure either of those are correct. I'd be happy to review changes to > update the METALOG (I guess we'd extend certctl with an option to do > that?) I think that's the most important things because we really > should be routinely validating that DESTDIR only contains things in the > METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding > "env DESTDIR=${DESTDIR}" so it's explicit. I did discover that this is causing me a minor hassle downstream in CheriBSD. Our crossbuild tool (cheribuild) checks for files not in the METALOG and prompts to ask if they should be included when run interactively. This means all my disk image builds now stall unless I remember to wait until I'm past that stage. Without addressing the question of which stage (if any) the certctl rehash should take place in, I have a potential fix for the failure to handle METALOG files in https://reviews.freebsd.org/D24932. It needs some documentation updates before it can land, but I think it's complete. -- Brooks signature.asc Description: PGP signature
Re: svn commit: r361284 - in head/sys/amd64: include vmm
There’s a better way to do this. People have been wanting larger names to be merged into 12.x and 11.x, and that was going to be hard with how I originally did this. Your compat shim doesn’t make it any easier. What I was going to do was return the ioctl in HEAD to the original size, and create a new ioctl for the larger size, That would fix the compatibility issue (since we don’t support a newer userland on an older kernel) and make it possible to merge to -stable branches. I’d like to revert this commit and go in that direction. Scott > On May 20, 2020, at 11:27 AM, Conrad Meyer wrote: > > Author: cem > Date: Wed May 20 17:27:54 2020 > New Revision: 361284 > URL: https://svnweb.freebsd.org/changeset/base/361284 > > Log: > vmm(4): Add 12 user ABI compat after r349948 > > Reported by: kp > Reviewed by: jhb, kp > Tested by: kp > Differential Revision: https://reviews.freebsd.org/D24929 > > Modified: > head/sys/amd64/include/vmm_dev.h > head/sys/amd64/vmm/vmm_dev.c ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361292 - head/share/vt/keymaps
Author: emaste Date: Wed May 20 20:24:37 2020 New Revision: 361292 URL: https://svnweb.freebsd.org/changeset/base/361292 Log: vt: fix duplicate keymap descriptions PR: 246495 Submitted by: Jorge Maidana MFC after:1 week Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps == --- head/share/vt/keymaps/INDEX.keymaps Wed May 20 19:51:39 2020 (r361291) +++ head/share/vt/keymaps/INDEX.keymaps Wed May 20 20:24:37 2020 (r361292) @@ -309,10 +309,10 @@ kz.kst.kbd:da:Kasakhisk kz.kst.kbd:de:Kasachisch kz.kst.kbd:fr:Kazakh -kz.io.kbd:en:Kazakh -kz.io.kbd:da:Kasakhisk -kz.io.kbd:de:Kasachisch -kz.io.kbd:fr:Kazakh +kz.io.kbd:en:Kazakh (with IO) +kz.io.kbd:da:Kasakhisk (IO) +kz.io.kbd:de:Kasachisch (mit IO) +kz.io.kbd:fr:Kazakh (avec IO) latinamerican.kbd:en:Latin American latinamerican.kbd:da:Latinamerikansk @@ -412,19 +412,19 @@ es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak +es.kbd:en:Spanish +es.kbd:da:Spansk +es.kbd:de:Spanisch +es.kbd:fr:Espagnol +es.kbd:pt:Espanhol +es.kbd:es:Español + es.acc.kbd:en:Spanish (accent keys) es.acc.kbd:da:Spansk (accenttaster) es.acc.kbd:de:Spanisch (accent keys) es.acc.kbd:fr:Espagnol (avec accents) es.acc.kbd:pt:Espanhol (com acentos) es.acc.kbd:es:Español (con acentos) - -es.kbd:en:Spanish (accent keys) -es.kbd:da:Spansk (accenttaster) -es.kbd:de:Spanisch (accent keys) -es.kbd:fr:Espagnol (avec accents) -es.kbd:pt:Espanhol (com acentos) -es.kbd:es:Español (con acentos) si.kbd:en:Slovenian si.kbd:da:Slovensk ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361291 - head/sys/mips/mips
Author: jhb Date: Wed May 20 19:51:39 2020 New Revision: 361291 URL: https://svnweb.freebsd.org/changeset/base/361291 Log: Merge freebsd32_exec_setregs() into exec_setregs() on MIPS. The stack pointer was being decremented by 64k twice previously. Reviewed by: brooks Obtained from:CheriBSD Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D24930 Modified: head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/freebsd32_machdep.c == --- head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -68,8 +68,6 @@ #include #include -static void freebsd32_exec_setregs(struct thread *, struct image_params *, -uintptr_t); static int get_mcontext32(struct thread *, mcontext32_t *, int); static int set_mcontext32(struct thread *, mcontext32_t *); static void freebsd32_sendsig(sig_t, ksiginfo_t *, sigset_t *); @@ -97,7 +95,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), .sv_copyout_strings = freebsd32_copyout_strings, - .sv_setregs = freebsd32_exec_setregs, + .sv_setregs = exec_setregs, .sv_fixlimit= NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32, @@ -125,26 +123,6 @@ static Elf32_Brandinfo freebsd_brand_info = { SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, _brand_info); - -static void -freebsd32_exec_setregs(struct thread *td, struct image_params *imgp, -uintptr_t stack) -{ - exec_setregs(td, imgp, stack); - - /* -* See comment in exec_setregs about running 32-bit binaries with 64-bit -* registers. -*/ - td->td_frame->sp -= 65536; - - /* -* Clear extended address space bit for userland. -*/ - td->td_frame->sr &= ~MIPS_SR_UX; - - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; -} int set_regs32(struct thread *td, struct reg32 *regs) Modified: head/sys/mips/mips/pm_machdep.c == --- head/sys/mips/mips/pm_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/pm_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -441,11 +441,14 @@ exec_setregs(struct thread *td, struct image_params *i td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | (mips_rd_status() & MIPS_SR_INT_MASK); -#if defined(__mips_n32) +#if defined(__mips_n32) || defined(__mips_n64) td->td_frame->sr |= MIPS_SR_PX; -#elif defined(__mips_n64) - td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif +#if defined(__mips_n64) + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_frame->sr |= MIPS_SR_UX; + td->td_frame->sr |= MIPS_SR_KX; +#endif /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) @@ -470,7 +473,12 @@ exec_setregs(struct thread *td, struct image_params *i PCPU_SET(fpcurthread, (struct thread *)0); td->td_md.md_ss_addr = 0; - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; +#ifdef COMPAT_FREEBSD32 + if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; + else +#endif + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; } int ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361290 - in head: . release/packages release/scripts share/mk sys/conf
Author: emaste Date: Wed May 20 19:45:22 2020 New Revision: 361290 URL: https://svnweb.freebsd.org/changeset/base/361290 Log: pkgbase: use -dev,-dbg instead of -development,-debug -development is long and awkward, and is also inconsistent with prior art from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow the Debian convention, and similarly for debug info packages. Also remove redundant pkgbase development tag from includes. We already tag include files with package=runtime,dev; there is no need to separately tag them as dev. Discussed with: bapt Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D24139 Modified: head/Makefile.inc1 head/release/packages/generate-ucl.sh head/release/scripts/mtree-to-plist.awk head/share/mk/bsd.incs.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/sys/conf/kmod.mk Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed May 20 19:35:38 2020(r361289) +++ head/Makefile.inc1 Wed May 20 19:45:22 2020(r361290) @@ -1889,7 +1889,7 @@ create-world-package-${pkgname}: .PHONY _default_flavor= -default .if make(*package*) && exists(${KSTAGEDIR}/kernel.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif create-kernel-packages:.PHONY . for flavor in "" ${_debug} @@ -1923,7 +1923,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul . for _kernel in ${BUILDKERNELS:[2..-1]} . if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif . for flavor in "" ${_debug} create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel} Modified: head/release/packages/generate-ucl.sh == --- head/release/packages/generate-ucl.sh Wed May 20 19:35:38 2020 (r361289) +++ head/release/packages/generate-ucl.sh Wed May 20 19:45:22 2020 (r361290) @@ -61,13 +61,13 @@ main() { pkgdeps="runtime" _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" ;; - *_lib32_development) - outname="${outname%%_lib32_development}" + *_lib32_dev) + outname="${outname%%_lib32_dev}" _descr="32-bit Libraries, Development Files" pkgdeps="${outname}" ;; - *_lib32_debug) - outname="${outname%%_lib32_debug}" + *_lib32_dbg) + outname="${outname%%_lib32_dbg}" _descr="32-bit Libraries, Debugging Symbols" pkgdeps="${outname}" ;; @@ -76,13 +76,13 @@ main() { _descr="32-bit Libraries" pkgdeps="${outname}" ;; - *_development) - outname="${outname%%_development}" + *_dev) + outname="${outname%%_dev}" _descr="Development Files" pkgdeps="${outname}" ;; - *_debug) - outname="${outname%%_debug}" + *_dbg) + outname="${outname%%_dbg}" _descr="Debugging Symbols" pkgdeps="${outname}" ;; Modified: head/release/scripts/mtree-to-plist.awk == --- head/release/scripts/mtree-to-plist.awk Wed May 20 19:35:38 2020 (r361289) +++ head/release/scripts/mtree-to-plist.awk Wed May 20 19:45:22 2020 (r361290) @@ -70,7 +70,7 @@ output=output"."_kernconf } if ($1 ~ /^\/usr\/lib\/debug\/boot/) { - output=output"-debug.plist" + output=output"-dbg.plist" } else { output=output".plist" } Modified: head/share/mk/bsd.incs.mk == --- head/share/mk/bsd.incs.mk Wed May 20 19:35:38 2020(r361289) +++ head/share/mk/bsd.incs.mk Wed May 20 19:45:22 2020(r361290) @@ -60,7 +60,7 @@ stage_includes: stage_as.${header:T} installincludes: _${group}INS_${header:T} _${group}INS_${header:T}: ${header} - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN_${.ALLSRC:T}} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN_${.ALLSRC:T}} \ -g
svn commit: r361289 - vendor/NetBSD/bmake/20200517
Author: sjg Date: Wed May 20 19:35:38 2020 New Revision: 361289 URL: https://svnweb.freebsd.org/changeset/base/361289 Log: tag bmake-20200517 Added: vendor/NetBSD/bmake/20200517/ - copied from r361288, vendor/NetBSD/bmake/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361288 - in vendor/NetBSD/bmake/dist: . filemon mk mk/sys unit-tests
Author: sjg Date: Wed May 20 19:34:48 2020 New Revision: 361288 URL: https://svnweb.freebsd.org/changeset/base/361288 Log: Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests Added: vendor/NetBSD/bmake/dist/filemon/ vendor/NetBSD/bmake/dist/filemon/filemon.h (contents, props changed) vendor/NetBSD/bmake/dist/filemon/filemon_dev.c (contents, props changed) vendor/NetBSD/bmake/dist/filemon/filemon_ktrace.c (contents, props changed) vendor/NetBSD/bmake/dist/mk/compiler.mk (contents, props changed) vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/Makefile (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/Makefile.config.in (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/dollar.exp vendor/NetBSD/bmake/dist/unit-tests/dollar.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-main.exp vendor/NetBSD/bmake/dist/unit-tests/include-main.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-sub.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-subsub.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk (contents, props changed) Deleted: vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/Makefile.config.in vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/arch.c vendor/NetBSD/bmake/dist/boot-strap vendor/NetBSD/bmake/dist/bsd.after-import.mk vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/config.h.in vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/make-bootstrap.sh.in vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/meta.h vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/autodep.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/doc.mk vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/options.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/mk/sys.vars.mk vendor/NetBSD/bmake/dist/mk/sys/AIX.mk vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk vendor/NetBSD/bmake/dist/mk/sys/Generic.mk vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk vendor/NetBSD/bmake/dist/mk/sys/Linux.mk
Re: svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
On Wed, May 20, 2020 at 06:29:23PM +, Mark Johnston wrote: > Author: markj > Date: Wed May 20 18:29:23 2020 > New Revision: 361287 > URL: https://svnweb.freebsd.org/changeset/base/361287 > > Log: > Don't block on the range lock in zfs_getpages(). > > After r358443 the vnode object lock no longer synchronizes concurrent > zfs_getpages() and zfs_write() (which must update vnode pages to > maintain coherence). This created a potential deadlock between ZFS > range locks and VM page busy locks: a fault on a mapped file will cause > the fault page to be busied, after which zfs_getpages() locks a range > around the file offset in order to map adjacent, resident pages; > zfs_write() locks the range first, and then must busy vnode pages when > synchronizing. > > Solve this by adding a non-blocking mode for ZFS range locks, and using > it in zfs_getpages(). If zfs_getpages() fails to acquire the range > lock, only the fault page will be populated. I will work on getting this submitted to OpenZFS. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: markj Date: Wed May 20 18:29:23 2020 New Revision: 361287 URL: https://svnweb.freebsd.org/changeset/base/361287 Log: Don't block on the range lock in zfs_getpages(). After r358443 the vnode object lock no longer synchronizes concurrent zfs_getpages() and zfs_write() (which must update vnode pages to maintain coherence). This created a potential deadlock between ZFS range locks and VM page busy locks: a fault on a mapped file will cause the fault page to be busied, after which zfs_getpages() locks a range around the file offset in order to map adjacent, resident pages; zfs_write() locks the range first, and then must busy vnode pages when synchronizing. Solve this by adding a non-blocking mode for ZFS range locks, and using it in zfs_getpages(). If zfs_getpages() fails to acquire the range lock, only the fault page will be populated. Reported by: bdrewery Reviewed by: avg Tested by:pho Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D24839 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 17:48:18 2020(r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 18:29:23 2020(r361287) @@ -78,6 +78,8 @@ void rangelock_fini(rangelock_t *); locked_range_t *rangelock_enter(rangelock_t *, uint64_t, uint64_t, rangelock_type_t); +locked_range_t *rangelock_tryenter(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); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 17:48:18 2020(r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 18:29:23 2020(r361287) @@ -136,10 +136,11 @@ rangelock_fini(rangelock_t *rl) } /* - * Check if a write lock can be grabbed, or wait and recheck until available. + * Check if a write lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_writer(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_writer(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = >rl_tree; locked_range_t *lr; @@ -169,7 +170,7 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t */ if (avl_numnodes(tree) == 0) { avl_add(tree, new); - return; + return (B_TRUE); } /* @@ -190,8 +191,10 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t goto wait; avl_insert(tree, new, where); - return; + return (B_TRUE); wait: + if (nonblock) + return (B_FALSE); if (!lr->lr_write_wanted) { cv_init(>lr_write_cv, NULL, CV_DEFAULT, NULL); lr->lr_write_wanted = B_TRUE; @@ -373,10 +376,11 @@ rangelock_add_reader(avl_tree_t *tree, locked_range_t } /* - * Check if a reader lock can be grabbed, or wait and recheck until available. + * Check if a reader lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_reader(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_reader(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = >rl_tree; locked_range_t *prev, *next; @@ -397,6 +401,8 @@ retry: */ if (prev && (off < prev->lr_offset + prev->lr_length)) { if ((prev->lr_type == RL_WRITER) || (prev->lr_write_wanted)) { + if (nonblock) + return (B_FALSE); if (!prev->lr_read_wanted) { cv_init(>lr_read_cv, NULL, CV_DEFAULT, NULL); @@ -421,6 +427,8 @@ retry: if (off + len <= next->lr_offset) goto got_lock; if ((next->lr_type == RL_WRITER) || (next->lr_write_wanted)) { + if (nonblock) +
svn commit: r361286 - in head/tests/sys: fifo kern/pipe
Author: markj Date: Wed May 20 17:48:18 2020 New Revision: 361286 URL: https://svnweb.freebsd.org/changeset/base/361286 Log: Avoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests. Fix some style issues in the modified tests while here. Reported by: Jenkins via lwhsu MFC after:1 week Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fifo/fifo_kqueue.c head/tests/sys/kern/pipe/pipe_kqueue_test.c Modified: head/tests/sys/fifo/fifo_kqueue.c == --- head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:48:18 2020 (r361286) @@ -219,10 +219,14 @@ ATF_TC_BODY(fifo_kqueue__connecting_reader, tc) ATF_REQUIRE(close(p[1]) == 0); } +/* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ ATF_TC_WITHOUT_HEAD(fifo_kqueue__reads); ATF_TC_BODY(fifo_kqueue__reads, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, i, n; + int kq, p[2]; + char c; ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); @@ -231,39 +235,38 @@ ATF_TC_BODY(fifo_kqueue__reads, tc) ATF_REQUIRE((p[1] = open("testfifo", O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); - /* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ - - char c = 0; - ssize_t r; - while ((r = write(p[1], , 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], , 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + ATF_REQUIRE(bytes > 1); - for (int i = 0; i < PIPE_BUF + 1; ++i) { + for (i = 0; i < bytes / 2; i++) ATF_REQUIRE(read(p[0], , 1) == 1); - } + bytes -= i; - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; EV_SET([0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), - &(struct timespec) { 0, 0 }) == 1); + &(struct timespec){ 0, 0 }) == 1); ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == EV_CLEAR); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65023); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); - while ((r = read(p[0], , 1)) == 1) { - } - ATF_REQUIRE(r < 0); + while (bytes-- > 0) + ATF_REQUIRE(read(p[0], , 1) == 1); + n = read(p[0], , 1); + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), Modified: head/tests/sys/kern/pipe/pipe_kqueue_test.c == --- head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:48:18 2020 (r361286) @@ -243,28 +243,30 @@ ATF_TC_BODY(pipe_kqueue__closed_read_end_register_befo ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end); ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, n; + int kq, p[2]; + char c; ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); ATF_REQUIRE(p[0] >= 0); ATF_REQUIRE(p[1] >= 0); - char c = 0; - ssize_t r; - while ((r = write(p[1], , 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], , 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(close(p[1]) == 0); - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; - EV_SET([0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET([0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); - EV_SET([1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET([1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); /* @@ -284,7 +286,7 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65536); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); ATF_REQUIRE(close(kq) == 0); @@ -294,19 +296,21 @@
svn commit: r361285 - stable/12/sys/arm64/arm64
Author: markj Date: Wed May 20 17:33:11 2020 New Revision: 361285 URL: https://svnweb.freebsd.org/changeset/base/361285 Log: MFC r360690: Simplify arm64's pmap_bootstrap() a bit. Modified: stable/12/sys/arm64/arm64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/pmap.c == --- stable/12/sys/arm64/arm64/pmap.cWed May 20 17:27:54 2020 (r361284) +++ stable/12/sys/arm64/arm64/pmap.cWed May 20 17:33:11 2020 (r361285) @@ -779,9 +779,7 @@ void pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) { - u_int l1_slot, l2_slot; - pt_entry_t *l2; - vm_offset_t va, freemempos; + vm_offset_t freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; uint64_t kern_delta; @@ -807,7 +805,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ * Find the minimum physical address. physmap is sorted, * but may contain empty ranges. */ - for (i = 0; i < (physmap_idx * 2); i += 2) { + for (i = 0; i < physmap_idx * 2; i += 2) { if (physmap[i] == physmap[i + 1]) continue; if (physmap[i] <= min_pa) @@ -820,38 +818,14 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ /* Create a direct map region early so we can use it for pa -> va */ freemempos = pmap_bootstrap_dmap(l1pt, min_pa, freemempos); - va = KERNBASE; start_pa = pa = KERNBASE - kern_delta; /* -* Read the page table to find out what is already mapped. -* This assumes we have mapped a block of memory from KERNBASE -* using a single L1 entry. +* Create the l2 tables up to VM_MAX_KERNEL_ADDRESS. We assume that the +* loader allocated the first and only l2 page table page used to map +* the kernel, preloaded files and module metadata. */ - l2 = pmap_early_page_idx(l1pt, KERNBASE, _slot, _slot); - - /* Sanity check the index, KERNBASE should be the first VA */ - KASSERT(l2_slot == 0, ("The L2 index is non-zero")); - - /* Find how many pages we have mapped */ - for (; l2_slot < Ln_ENTRIES; l2_slot++) { - if ((l2[l2_slot] & ATTR_DESCR_MASK) == 0) - break; - - /* Check locore used L2 blocks */ - KASSERT((l2[l2_slot] & ATTR_DESCR_MASK) == L2_BLOCK, - ("Invalid bootstrap L2 table")); - KASSERT((l2[l2_slot] & ~ATTR_MASK) == pa, - ("Incorrect PA in L2 table")); - - va += L2_SIZE; - pa += L2_SIZE; - } - - va = roundup2(va, L1_SIZE); - - /* Create the l2 tables up to VM_MAX_KERNEL_ADDRESS */ - freemempos = pmap_bootstrap_l2(l1pt, va, freemempos); + freemempos = pmap_bootstrap_l2(l1pt, KERNBASE + L1_SIZE, freemempos); /* And the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE), freemempos); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361284 - in head/sys/amd64: include vmm
Author: cem Date: Wed May 20 17:27:54 2020 New Revision: 361284 URL: https://svnweb.freebsd.org/changeset/base/361284 Log: vmm(4): Add 12 user ABI compat after r349948 Reported by: kp Reviewed by: jhb, kp Tested by:kp Differential Revision:https://reviews.freebsd.org/D24929 Modified: head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/include/vmm_dev.h == --- head/sys/amd64/include/vmm_dev.hWed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/include/vmm_dev.hWed May 20 17:27:54 2020 (r361284) @@ -56,6 +56,13 @@ struct vm_memseg { charname[VM_MAX_SUFFIXLEN + 1]; }; +struct vm_memseg_fbsd12 { + int segid; + size_t len; + charname[64]; +}; +_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); + struct vm_register { int cpuid; int regnum; /* enum vm_reg_name */ @@ -338,8 +345,12 @@ enum { _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #defineVM_REINIT \ _IO('v', IOCNUM_REINIT) +#defineVM_ALLOC_MEMSEG_FBSD12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) #defineVM_ALLOC_MEMSEG \ _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg) +#defineVM_GET_MEMSEG_FBSD12\ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) #defineVM_GET_MEMSEG \ _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg) #defineVM_MMAP_MEMSEG \ Modified: head/sys/amd64/vmm/vmm_dev.c == --- head/sys/amd64/vmm/vmm_dev.cWed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/vmm/vmm_dev.cWed May 20 17:27:54 2020 (r361284) @@ -252,7 +252,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag CTASSERT(sizeof(((struct vm_memseg *)0)->name) >= VM_MAX_SUFFIXLEN + 1); static int -get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { struct devmem_softc *dsc; int error; @@ -269,17 +269,16 @@ get_memseg(struct vmmdev_softc *sc, struct vm_memseg * } KASSERT(dsc != NULL, ("%s: devmem segment %d not found", __func__, mseg->segid)); - error = copystr(dsc->name, mseg->name, sizeof(mseg->name), - NULL); + error = copystr(dsc->name, mseg->name, len, NULL); } else { - bzero(mseg->name, sizeof(mseg->name)); + bzero(mseg->name, len); } return (error); } static int -alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { char *name; int error; @@ -295,8 +294,8 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg */ if (VM_MEMSEG_NAME(mseg)) { sysmem = false; - name = malloc(sizeof(mseg->name), M_VMMDEV, M_WAITOK); - error = copystr(mseg->name, name, sizeof(mseg->name), NULL); + name = malloc(len, M_VMMDEV, M_WAITOK); + error = copystr(mseg->name, name, len, NULL); if (error) goto done; } @@ -438,6 +437,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_MAP_PPTDEV_MMIO: case VM_BIND_PPTDEV: case VM_UNBIND_PPTDEV: +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: +#endif case VM_ALLOC_MEMSEG: case VM_MMAP_MEMSEG: case VM_REINIT: @@ -451,6 +453,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da state_changed = 2; break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: +#endif case VM_GET_MEMSEG: case VM_MMAP_GETNEXT: /* @@ -633,11 +638,25 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = vm_mmap_memseg(sc->vm, mm->gpa, mm->segid, mm->segoff, mm->len, mm->prot, mm->flags); break; +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + break; +#endif case VM_ALLOC_MEMSEG: - error = alloc_memseg(sc, (struct vm_memseg *)data); + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg *)0)->name)); break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: + error = get_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct
svn commit: r361283 - head/share/man/man5
Author: emaste Date: Wed May 20 17:27:22 2020 New Revision: 361283 URL: https://svnweb.freebsd.org/changeset/base/361283 Log: src.conf.5: regen after r361282, GNU_DIFF knob descriptions Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Wed May 20 17:20:48 2020 (r361282) +++ head/share/man/man5/src.conf.5 Wed May 20 17:27:22 2020 (r361283) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 8, 2020 +.Dd May 20, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -690,8 +690,6 @@ This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . .It Va WITHOUT_GNU_GREP Set to not build GNU ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361282 - head/tools/build/options
Author: emaste Date: Wed May 20 17:20:48 2020 New Revision: 361282 URL: https://svnweb.freebsd.org/changeset/base/361282 Log: Update GNU_DIFF knob descriptions After r317209 the WITH_/WITHOUT_GNU_DIFF knob controls only diff3; diff is always BSD diff. MFC after:1 week Modified: head/tools/build/options/WITHOUT_GNU_DIFF head/tools/build/options/WITH_GNU_DIFF Modified: head/tools/build/options/WITHOUT_GNU_DIFF == --- head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . Modified: head/tools/build/options/WITH_GNU_DIFF == --- head/tools/build/options/WITH_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITH_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Build and install GNU -.Xr diff 1 -and .Xr diff3 1 . ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361281 - vendor/libarchive/3.4.3
Author: mm Date: Wed May 20 16:14:07 2020 New Revision: 361281 URL: https://svnweb.freebsd.org/changeset/base/361281 Log: Tag vendor/libarchive/3.4.3 Added: vendor/libarchive/3.4.3/ - copied from r361280, vendor/libarchive/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361280 - in vendor/libarchive/dist: . build build/ci/github_actions build/cmake contrib/oss-fuzz libarchive libarchive/test tar
Author: mm Date: Wed May 20 16:13:02 2020 New Revision: 361280 URL: https://svnweb.freebsd.org/changeset/base/361280 Log: Update vendor/libarchive/dist to git fc6563f5130d8a7ee1fc27c0e55baef35119f26c Libarchive 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: vendor/libarchive/dist/contrib/oss-fuzz/ vendor/libarchive/dist/contrib/oss-fuzz/corpus.zip (contents, props changed) vendor/libarchive/dist/contrib/oss-fuzz/libarchive_fuzzer.cc (contents, props changed) vendor/libarchive/dist/contrib/oss-fuzz/oss-fuzz-build.sh (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zstd_2.tar.zst.uu vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/README.md vendor/libarchive/dist/build/ci/github_actions/ci.cmd vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_digest.c vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry_stat.3 vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_support_filter_program.c vendor/libarchive/dist/libarchive/archive_read_support_filter_zstd.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c vendor/libarchive/dist/libarchive/archive_write_add_filter_zstd.c vendor/libarchive/dist/libarchive/archive_write_set_options.3 vendor/libarchive/dist/libarchive/filter_fork.h vendor/libarchive/dist/libarchive/filter_fork_posix.c vendor/libarchive/dist/libarchive/filter_fork_windows.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c vendor/libarchive/dist/libarchive/test/test_compat_zstd.c vendor/libarchive/dist/libarchive/test/test_write_filter_zstd.c vendor/libarchive/dist/tar/bsdtar.1 Modified: vendor/libarchive/dist/CMakeLists.txt == --- vendor/libarchive/dist/CMakeLists.txt Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/CMakeLists.txt Wed May 20 16:13:02 2020 (r361280) @@ -18,7 +18,7 @@ endif() # RelWithDebInfo : Release build with Debug Info # MinSizeRel : Release Min Size build IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the # value type is "UNINITIALIZED". @@ -157,32 +157,32 @@ IF (MSVC) # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" # Enable level 4 C4062: The enumerate has no associated handler in a switch # statement and there is no default that can catch it. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4062") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14062") # Enable level 4 C4254: A larger bit field was assigned to a smaller bit # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14254") # Enable level 4 C4295: An array was initialized but the last character in # the array is not a null; accessing the array may # produce unexpected results. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14295") # Enable level 4 C4296: An unsigned variable was used in a comparison # operation with zero.
svn commit: r361279 - head/sys/dev/bnxt
Author: kp Date: Wed May 20 16:07:37 2020 New Revision: 361279 URL: https://svnweb.freebsd.org/changeset/base/361279 Log: bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two Reviewed by: gallatin, rpokala MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D24922 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h == --- head/sys/dev/bnxt/bnxt.hWed May 20 13:51:27 2020(r361278) +++ head/sys/dev/bnxt/bnxt.hWed May 20 16:07:37 2020(r361279) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #define NETXTREME_E_VF20x16d3 #define NETXTREME_E_VF30x16dc +/* Maximum numbers of RX and TX descriptors. iflib requires this to be a power + * of two. The hardware has no particular limitation. */ +#define BNXT_MAX_RXD ((INT32_MAX >> 1) + 1) +#define BNXT_MAX_TXD ((INT32_MAX >> 1) + 1) + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) Modified: head/sys/dev/bnxt/if_bnxt.c == --- head/sys/dev/bnxt/if_bnxt.c Wed May 20 13:51:27 2020(r361278) +++ head/sys/dev/bnxt/if_bnxt.c Wed May 20 16:07:37 2020(r361279) @@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {BNXT_MAX_RXD, BNXT_MAX_RXD, BNXT_MAX_RXD}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {BNXT_MAX_TXD, BNXT_MAX_TXD, BNXT_MAX_TXD}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> On May 20, 2020, at 08:54, Enji Cooper wrote: > >>> On May 20, 2020, at 08:11, Shawn Webb wrote: >>> >>> On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: >>> Author: whu >>> Date: Wed May 20 11:03:59 2020 >>> New Revision: 361275 >>> URL: https://svnweb.freebsd.org/changeset/base/361275 >>> >>> Log: >>> HyperV socket implementation for FreeBSD >>> >>> This change adds Hyper-V socket feature in FreeBSD. New socket address >>> family AF_HYPERV and its kernel support are added. > > Hi Wei, >Could you please further describe what this feature is/does? I realize after looking at the review that it contains the content I was hoping for. It would have been helpful to folks if this context had been included in the commit message. Thank you, -Enji ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> On May 20, 2020, at 08:11, Shawn Webb wrote: > > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: >> Author: whu >> Date: Wed May 20 11:03:59 2020 >> New Revision: 361275 >> URL: https://svnweb.freebsd.org/changeset/base/361275 >> >> Log: >> HyperV socket implementation for FreeBSD >> >> This change adds Hyper-V socket feature in FreeBSD. New socket address >> family AF_HYPERV and its kernel support are added. Hi Wei, Could you please further describe what this feature is/does? Thanks, -Enji ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 > > Log: > HyperV socket implementation for FreeBSD > > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > > Submitted by: Wei Hu > Reviewed by:Dexuan Cui > Relnotes: yes > Sponsored by: Microsoft > Differential Revision: https://reviews.freebsd.org/D24061 Hey Wei Hu, Would it be good to bump __FreeBSD_version after a change like this? Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc signature.asc Description: PGP signature
svn commit: r361278 - in head/sys/dev/hyperv: hvsock vmbus
Author: lwhsu Date: Wed May 20 13:51:27 2020 New Revision: 361278 URL: https://svnweb.freebsd.org/changeset/base/361278 Log: Fix i386 build for r361275 kponsored by: The FreeBSD Foundation Modified: head/sys/dev/hyperv/hvsock/hv_sock.c head/sys/dev/hyperv/vmbus/vmbus_br.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c == --- head/sys/dev/hyperv/hvsock/hv_sock.cWed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/hvsock/hv_sock.cWed May 20 13:51:27 2020 (r361278) @@ -792,7 +792,7 @@ hvs_trans_sosend(struct socket *so, struct sockaddr *a int error = 0; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %lu\n", + "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %zd\n", __func__, uio->uio_resid); if (so->so_type != SOCK_STREAM) @@ -1154,7 +1154,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg return (EINVAL); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: called, uio_rw = %s, uio_resid = %lu, cplen = %u, " + "%s: called, uio_rw = %s, uio_resid = %zd, cplen = %u, " "datap = %p\n", __func__, (uio->uio_rw == UIO_READ) ? "read from br":"write to br", uio->uio_resid, cplen, datap); @@ -1168,7 +1168,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg SOCKBUF_LOCK(sb); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: after uiomove, uio_resid = %lu, error = %d\n", + "%s: after uiomove, uio_resid = %zd, error = %d\n", __func__, uio->uio_resid, error); return (error); @@ -1372,8 +1372,9 @@ hvsock_canwrite_check(struct hvs_pcb *pcb) * We must always reserve a 0-length-payload packet for the FIN. */ HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: writeable is %u, should be greater than %lu\n", - __func__, writeable, HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)); + "%s: writeable is %u, should be greater than %ju\n", + __func__, writeable, + (uintmax_t)(HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0))); if (writeable < HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)) { /* Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c == --- head/sys/dev/hyperv/vmbus/vmbus_br.cWed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/vmbus/vmbus_br.cWed May 20 13:51:27 2020 (r361278) @@ -66,9 +66,10 @@ vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) ravail = br->vbr_dsize - wavail; snprintf(state, sizeof(state), - "intrcnt:%lu rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " + "intrcnt:%ju rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " "ravail:%u wavail:%u", - intrcnt, rindex, windex, imask, psndsz, fvalue, ravail, wavail); + (uintmax_t)intrcnt, rindex, windex, imask, psndsz, fvalue, + ravail, wavail); return sysctl_handle_string(oidp, state, sizeof(state), req); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361277 - in head/sys/dev/mlx5: . mlx5_core
Author: kib Date: Wed May 20 11:20:45 2020 New Revision: 361277 URL: https://svnweb.freebsd.org/changeset/base/361277 Log: mlx5_core: add more port module event types to decode. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after:3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h == --- head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020(r361276) +++ head/sys/dev/mlx5/device.h Wed May 20 11:20:45 2020(r361277) @@ -565,6 +565,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE= 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER= 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT= 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:20:45 2020 (r361277) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:20:45 2020 (r361277) @@ -1304,7 +1304,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361276 - in head/sys/dev/mlx5: . mlx5_core
Author: kib Date: Wed May 20 11:10:10 2020 New Revision: 361276 URL: https://svnweb.freebsd.org/changeset/base/361276 Log: mlx5_core: add "PMD type not enabled" port module event type. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after:3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h == --- head/sys/dev/mlx5/device.h Wed May 20 11:03:59 2020(r361275) +++ head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020(r361276) @@ -564,6 +564,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) @@ -1303,7 +1303,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
Author: whu Date: Wed May 20 11:03:59 2020 New Revision: 361275 URL: https://svnweb.freebsd.org/changeset/base/361275 Log: HyperV socket implementation for FreeBSD This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added. Submitted by: Wei Hu Reviewed by: Dexuan Cui Relnotes: yes Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D24061 Added: head/sys/dev/hyperv/hvsock/ head/sys/dev/hyperv/hvsock/hv_sock.c (contents, props changed) head/sys/dev/hyperv/hvsock/hv_sock.h (contents, props changed) head/sys/modules/hyperv/hvsock/ head/sys/modules/hyperv/hvsock/Makefile (contents, props changed) Modified: head/sys/conf/files.x86 head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_br.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/modules/hyperv/Makefile head/sys/sys/socket.h Modified: head/sys/conf/files.x86 == --- head/sys/conf/files.x86 Wed May 20 11:01:10 2020(r361274) +++ head/sys/conf/files.x86 Wed May 20 11:03:59 2020(r361275) @@ -133,6 +133,7 @@ dev/hwpmc/hwpmc_core.c optionalhwpmc dev/hwpmc/hwpmc_uncore.c optionalhwpmc dev/hwpmc/hwpmc_tsc.c optionalhwpmc dev/hwpmc/hwpmc_x86.c optionalhwpmc +dev/hyperv/hvsock/hv_sock.coptionalhyperv dev/hyperv/input/hv_kbd.c optionalhyperv dev/hyperv/input/hv_kbdc.c optionalhyperv dev/hyperv/pcib/vmbus_pcib.c optionalhyperv pci Added: head/sys/dev/hyperv/hvsock/hv_sock.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/hvsock/hv_sock.cWed May 20 11:03:59 2020 (r361275) @@ -0,0 +1,1748 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Microsoft Corp. + * 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 unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hv_sock.h" + +#define HVSOCK_DBG_NONE0x0 +#define HVSOCK_DBG_INFO0x1 +#define HVSOCK_DBG_ERR 0x2 +#define HVSOCK_DBG_VERBOSE 0x3 + + +SYSCTL_NODE(_net, OID_AUTO, hvsock, CTLFLAG_RD, 0, "HyperV socket"); + +static int hvs_dbg_level; +SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, CTLFLAG_RWTUN, _dbg_level, +0, "hyperv socket debug level: 0 = none, 1 = info, 2 = error, 3 = verbose"); + + +#define HVSOCK_DBG(level, ...) do {\ + if (hvs_dbg_level >= (level)) \ + printf(__VA_ARGS__);\ + } while (0) + +MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control structures"); + +/* The MTU is 16KB per host side's design */ +#define HVSOCK_MTU_SIZE(1024 * 16) +#define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct vmpipe_proto_header)) + +#define HVSOCK_HEADER_LEN (sizeof(struct hvs_pkt_header)) + +#define
svn commit: r361274 - head/sys/dev/xen/evtchn
Author: royger Date: Wed May 20 11:01:10 2020 New Revision: 361274 URL: https://svnweb.freebsd.org/changeset/base/361274 Log: dev/xenstore: fix return with locks held Fix returning from xenstore device with locks held, which triggers the following panic: # cat /dev/xen/xenstore ^C userret: returning with the following locks held: exclusive sx evtchn_ringc_sx (evtchn_ringc_sx) r = 0 (0xf8000650be40) locked @ /usr/src/sys/dev/xen/evtchn/evtchn_dev.c:262 Note this is not a security issue since access to the device is limited to root by default. Sponsored by: Citrix Systems R MFC after:1 week Modified: head/sys/dev/xen/evtchn/evtchn_dev.c Modified: head/sys/dev/xen/evtchn/evtchn_dev.c == --- head/sys/dev/xen/evtchn/evtchn_dev.cWed May 20 08:15:09 2020 (r361273) +++ head/sys/dev/xen/evtchn/evtchn_dev.cWed May 20 11:01:10 2020 (r361274) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(>ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(>ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, >ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361273 - head/sys/dev/iwm
Author: avg Date: Wed May 20 08:15:09 2020 New Revision: 361273 URL: https://svnweb.freebsd.org/changeset/base/361273 Log: iwm: improve rfkill handling Previously the driver handled the bit within itself, but did not expose the state change to net80211 and interface layers. This change uses net80211 KPI for rfkill signaling. The code is modeled after similar code in iwn and wpi. Reviewed by: adrian MFC after:2 weeks Differential Revision: https://reviews.freebsd.org/D24923 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c == --- head/sys/dev/iwm/if_iwm.c Wed May 20 04:16:13 2020(r361272) +++ head/sys/dev/iwm/if_iwm.c Wed May 20 08:15:09 2020(r361273) @@ -5064,20 +5064,48 @@ iwm_parent(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; int startall = 0; + int rfkill = 0; IWM_LOCK(sc); if (ic->ic_nrunning > 0) { if (!(sc->sc_flags & IWM_FLAG_HW_INITED)) { iwm_init(sc); - startall = 1; + rfkill = iwm_check_rfkill(sc); + if (!rfkill) + startall = 1; } } else if (sc->sc_flags & IWM_FLAG_HW_INITED) iwm_stop(sc); IWM_UNLOCK(sc); if (startall) ieee80211_start_all(ic); + else if (rfkill) + taskqueue_enqueue(sc->sc_tq, >sc_rftoggle_task); } +static void +iwm_rftoggle_task(void *arg, int npending __unused) +{ + struct iwm_softc *sc = arg; + struct ieee80211com *ic = >sc_ic; + int rfkill; + + IWM_LOCK(sc); + rfkill = iwm_check_rfkill(sc); + IWM_UNLOCK(sc); + if (rfkill) { + device_printf(sc->sc_dev, + "%s: rfkill switch, disabling interface\n", __func__); + ieee80211_suspend_all(ic); + ieee80211_notify_radio(ic, 0); + } else { + device_printf(sc->sc_dev, + "%s: rfkill cleared, re-enabling interface\n", __func__); + ieee80211_resume_all(ic); + ieee80211_notify_radio(ic, 1); + } +} + /* * The interrupt side of things */ @@ -5814,12 +5842,7 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_RF_KILL) { handled |= IWM_CSR_INT_BIT_RF_KILL; - if (iwm_check_rfkill(sc)) { - device_printf(sc->sc_dev, - "%s: rfkill switch, disabling interface\n", - __func__); - iwm_stop(sc); - } + taskqueue_enqueue(sc->sc_tq, >sc_rftoggle_task); } /* @@ -6024,7 +6047,17 @@ iwm_attach(device_t dev) callout_init_mtx(>sc_watchdog_to, >sc_mtx, 0); callout_init_mtx(>sc_led_blink_to, >sc_mtx, 0); TASK_INIT(>sc_es_task, 0, iwm_endscan_cb, sc); + TASK_INIT(>sc_rftoggle_task, 0, iwm_rftoggle_task, sc); + sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK, + taskqueue_thread_enqueue, >sc_tq); + error = taskqueue_start_threads(>sc_tq, 1, 0, "iwm_taskq"); + if (error != 0) { + device_printf(dev, "can't start taskq thread, error %d\n", + error); + goto fail; + } + error = iwm_dev_check(dev); if (error != 0) goto fail; @@ -6590,6 +6623,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 ieee80211_draintask(>sc_ic, >sc_es_task); } iwm_stop_device(sc); + taskqueue_drain_all(sc->sc_tq); + taskqueue_free(sc->sc_tq); if (do_net80211) { IWM_LOCK(sc); iwm_xmit_queue_drain(sc); Modified: head/sys/dev/iwm/if_iwmvar.h == --- head/sys/dev/iwm/if_iwmvar.hWed May 20 04:16:13 2020 (r361272) +++ head/sys/dev/iwm/if_iwmvar.hWed May 20 08:15:09 2020 (r361273) @@ -499,7 +499,9 @@ struct iwm_softc { uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; int sc_wantresp; + struct taskqueue*sc_tq; struct task sc_es_task; + struct task sc_rftoggle_task; struct iwm_rx_phy_info sc_last_phy_info; int sc_ampdu_ref; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"