svn commit: r343599 - in head/lib/libc/tests/stdlib: . dynthr_mod

2019-01-31 Thread Kyle Evans
Author: kevans
Date: Thu Jan 31 02:49:24 2019
New Revision: 343599
URL: https://svnweb.freebsd.org/changeset/base/343599

Log:
  libc/tests: Add test case for jemalloc/libthr bug fixed in r343566
  
  Submitted by: Andrew Gierth (original reproducer; kevans massaged for atf)
  Reviewed by:  kib
  MFC after:2 weeks
  X-MFC-with:   r343566 (or after)
  Differential Revision:https://reviews.freebsd.org/D19027

Added:
  head/lib/libc/tests/stdlib/dynthr_mod/
  head/lib/libc/tests/stdlib/dynthr_mod/Makefile   (contents, props changed)
  head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c   (contents, props changed)
  head/lib/libc/tests/stdlib/dynthr_test.c   (contents, props changed)
Modified:
  head/lib/libc/tests/stdlib/Makefile

Modified: head/lib/libc/tests/stdlib/Makefile
==
--- head/lib/libc/tests/stdlib/Makefile Thu Jan 31 00:09:38 2019
(r343598)
+++ head/lib/libc/tests/stdlib/Makefile Thu Jan 31 02:49:24 2019
(r343599)
@@ -2,6 +2,7 @@
 
 .include 
 
+ATF_TESTS_C+=  dynthr_test
 ATF_TESTS_C+=  heapsort_test
 ATF_TESTS_C+=  mergesort_test
 ATF_TESTS_C+=  qsort_test
@@ -61,5 +62,7 @@ LIBADD.${t}+= netbsd util
 .endfor
 
 LIBADD.strtod_test+=   m
+
+SUBDIR+=   dynthr_mod
 
 .include 

Added: head/lib/libc/tests/stdlib/dynthr_mod/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/tests/stdlib/dynthr_mod/Makefile  Thu Jan 31 02:49:24 
2019(r343599)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+SHLIB_NAME=dynthr_mod.so
+SHLIBDIR=  ${TESTSDIR}
+SRCS=  dynthr_mod.c
+LIBADD=pthread
+
+TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/:H}
+
+
+.include 

Added: head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c  Thu Jan 31 02:49:24 
2019(r343599)
@@ -0,0 +1,71 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Andrew Gierth
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Though this file is initially distributed under the 2-clause BSD license,
+ * the author grants permission for its redistribution under alternative
+ * licenses as set forth at .
+ * This paragraph and the RELICENSE.txt file are not part of the license and
+ * may be omitted in redistributions.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static pthread_t thr;
+
+static void *
+mod_thread(void *ptr)
+{
+   char *volatile dummy;
+
+   dummy = malloc(500);
+   return (NULL);
+}
+
+void
+mod_main(int op)
+{
+   int rc;
+
+   switch (op) {
+   case 1:
+   rc = pthread_create(&thr, NULL, mod_thread, NULL);
+   if (rc != 0)
+   _exit(1);
+   break;
+   case 0:
+   pthread_join(thr, NULL);
+   break;
+   }
+}
+

Added: head/lib/libc/tests/stdlib/dynthr_test.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/tests/stdlib/dynthr_test.cThu Jan 31 02:49:24 2019
(r343599)
@@ -0,0 +1,93 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 Andrew Gierth
+ *
+ * Redistribution and use in source and binary forms, wi

svn commit: r343601 - in head/usr.bin/xinstall: . tests

2019-01-31 Thread Kyle Evans
Author: kevans
Date: Thu Jan 31 05:20:11 2019
New Revision: 343601
URL: https://svnweb.freebsd.org/changeset/base/343601

Log:
  install(1): Fix relative path calculation with partial common dest/src
  
  For example, from the referenced PR [1]:
  
  $ mkdir /tmp/lib/ /tmp/libexec
  $ touch /tmp/lib/foo.so
  $ install -lrs /tmp/lib/foo.so /tmp/libexec/
  
  The common path identification bits terminate src at /tmp/lib/ and the
  destination at /tmp/libe. The subsequent backtracking is then incorrect, as
  it traverses the destination and backtraces exactly one level while eating
  the 'libexec' because it was previously (falsely) identified as common with
  'lib'.
  
  The obvious fix would be to make sure we've actually terminated just after
  directory separators and rewind a character if we haven't. In the above
  example, we would end up rewinding to /tmp/ and subsequently doing the right
  thing.
  
  Test case added.
  
  PR:   235330 [1]
  MFC after:1 week

Modified:
  head/usr.bin/xinstall/tests/install_test.sh
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/tests/install_test.sh
==
--- head/usr.bin/xinstall/tests/install_test.sh Thu Jan 31 04:16:52 2019
(r343600)
+++ head/usr.bin/xinstall/tests/install_test.sh Thu Jan 31 05:20:11 2019
(r343601)
@@ -377,6 +377,29 @@ mkdir_simple_body() {
atf_check install -d dir1/dir2/dir3
 }
 
+atf_test_case symbolic_link_relative_absolute_common
+symbolic_link_relative_absolute_common_head() {
+   atf_set "descr" "Verify -l rs with absolute paths having common 
components"
+}
+symbolic_link_relative_absolute_common_body() {
+   filename=foo.so
+   src_path=lib
+   src_path_prefixed=$PWD/$src_path
+   dest_path=$PWD/libexec/
+   src_file=$src_path_prefixed/$filename
+   dest_file=$dest_path/$filename
+
+   atf_check mkdir $src_path_prefixed $dest_path
+   atf_check touch $src_file
+   atf_check install -l sr $src_file $dest_path
+
+   dest_path_relative=$(readlink $dest_file)
+   src_path_relative="../lib/$filename"
+   if [ "$src_path_relative" != "$dest_path_relative" ]; then
+   atf_fail "unexpected symlink contents ('$src_path_relative' != 
'$dest_path_relative')"
+   fi
+}
+
 atf_init_test_cases() {
atf_add_test_case copy_to_nonexistent
atf_add_test_case copy_to_nonexistent_safe
@@ -415,5 +438,6 @@ atf_init_test_cases() {
atf_add_test_case symbolic_link_relative_absolute_source_and_dest1
atf_add_test_case 
symbolic_link_relative_absolute_source_and_dest1_double_slash
atf_add_test_case symbolic_link_relative_absolute_source_and_dest2
+   atf_add_test_case symbolic_link_relative_absolute_common
atf_add_test_case mkdir_simple
 }

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cThu Jan 31 04:16:52 2019
(r343600)
+++ head/usr.bin/xinstall/xinstall.cThu Jan 31 05:20:11 2019
(r343601)
@@ -673,7 +673,7 @@ makelink(const char *from_name, const char *to_name,
}
 
if (dolink & LN_RELATIVE) {
-   char *to_name_copy, *cp, *d, *s;
+   char *to_name_copy, *cp, *d, *ld, *ls, *s;
 
if (*from_name != '/') {
/* this is already a relative link */
@@ -709,8 +709,19 @@ makelink(const char *from_name, const char *to_name,
free(to_name_copy);
 
/* Trim common path components. */
-   for (s = src, d = dst; *s == *d; s++, d++)
+   ls = ld = NULL;
+   for (s = src, d = dst; *s == *d; ls = s, ld = d, s++, d++)
continue;
+   /*
+* If we didn't end after a directory separator, then we've
+* falsely matched the last component.  For example, if one
+* invoked install -lrs /lib/foo.so /libexec/ then the source
+* would terminate just after the separator while the
+* destination would terminate in the middle of 'libexec',
+* leading to a full directory getting falsely eaten.
+*/
+   if ((ls != NULL && *ls != '/') || (ld != NULL && *ld != '/'))
+   s--, d--;
while (*s != '/')
s--, d--;
 
___
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: r343600 - head/sys/contrib/ipfilter/netinet

2019-01-31 Thread Cy Schubert
Author: cy
Date: Thu Jan 31 04:16:52 2019
New Revision: 343600
URL: https://svnweb.freebsd.org/changeset/base/343600

Log:
  Document the instance context pointer.
  
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Thu Jan 31 02:49:24 2019
(r343599)
+++ head/sys/contrib/ipfilter/netinet/fil.c Thu Jan 31 04:16:52 2019
(r343600)
@@ -2815,7 +2815,8 @@ ipf_firewall(fin, passp)
 /*-2 == requires authentication */
 /*  Kernel: */
 /*   > 0 == filter error # for packet   */
-/* Parameters: ip(I)   - pointer to start of IPv4/6 packet  */
+/* Parameters: ctx(I)  - pointer to the instance context*/
+/* ip(I)   - pointer to start of IPv4/6 packet  */
 /* hlen(I) - length of header   */
 /* ifp(I)  - pointer to interface this packet is on */
 /* out(I)  - 0 == packet going in, 1 == packet going out*/
___
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: r343602 - stable/12/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Author: araujo
Date: Thu Jan 31 07:08:37 2019
New Revision: 343602
URL: https://svnweb.freebsd.org/changeset/base/343602

Log:
  MFC r343077:
  
  Fix broken uart on Win2016 guest.
  
  Obtained from:Joyent (commit/2bf1a940afbd1382faff159e7c93c72779ca10f4)

Modified:
  stable/12/usr.sbin/bhyve/uart_emul.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/uart_emul.c
==
--- stable/12/usr.sbin/bhyve/uart_emul.cThu Jan 31 05:20:11 2019
(r343601)
+++ stable/12/usr.sbin/bhyve/uart_emul.cThu Jan 31 07:08:37 2019
(r343602)
@@ -431,6 +431,13 @@ uart_write(struct uart_softc *sc, int offset, uint8_t 
sc->thre_int_pending = true;
break;
case REG_IER:
+   /* Assert an interrupt if re-enabling the THRE intr, since we
+* always report THRE as active in the status register.
+*/
+   if ((sc->ier & IER_ETXRDY) == 0 &&
+   (value & IER_ETXRDY) != 0) {
+   sc->thre_int_pending = true;
+   }
/*
 * Apply mask so that bits 4-7 are 0
 * Also enables bits 0-3 only if they're 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: r343603 - head/sys/dev/ipw

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jan 31 10:44:00 2019
New Revision: 343603
URL: https://svnweb.freebsd.org/changeset/base/343603

Log:
  ipw(4): reuse ieee80211_tx_complete function
  
  This should partially fix 'netstat -b -I wlan0' output
  
  MFC after:1 week

Modified:
  head/sys/dev/ipw/if_ipw.c

Modified: head/sys/dev/ipw/if_ipw.c
==
--- head/sys/dev/ipw/if_ipw.c   Thu Jan 31 07:08:37 2019(r343602)
+++ head/sys/dev/ipw/if_ipw.c   Thu Jan 31 10:44:00 2019(r343603)
@@ -1326,10 +1326,7 @@ ipw_release_sbd(struct ipw_softc *sc, struct ipw_soft_
bus_dmamap_unload(sc->txbuf_dmat, sbuf->map);
SLIST_INSERT_HEAD(&sc->free_sbuf, sbuf, next);
 
-   if (sbuf->m->m_flags & M_TXCB)
-   ieee80211_process_callback(sbuf->ni, sbuf->m, 0/*XXX*/);
-   m_freem(sbuf->m);
-   ieee80211_free_node(sbuf->ni);
+   ieee80211_tx_complete(sbuf->ni, sbuf->m, 0/*XXX*/);
 
sc->sc_tx_timer = 0;
break;
___
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: r343605 - in stable: 10/sys/geom/uzip 11/sys/geom/uzip 12/sys/geom/uzip

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jan 31 11:36:28 2019
New Revision: 343605
URL: https://svnweb.freebsd.org/changeset/base/343605

Log:
  MFC r343473:
  geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced
  
  PR:   203499
  Submitted by: 
  
  MFC r343475:
  geom_uzip(4): set 'gp != NULL' assertion on top of the function
  
  There was yet another access to this variable in g_trace() few
  lines upper.
  
  PR:   203499
  Reported by:  cem

Modified:
  stable/12/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/geom/uzip/g_uzip.c
  stable/11/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/geom/uzip/g_uzip.c
==
--- stable/12/sys/geom/uzip/g_uzip.cThu Jan 31 11:12:31 2019
(r343604)
+++ stable/12/sys/geom/uzip/g_uzip.cThu Jan 31 11:36:28 2019
(r343605)
@@ -886,6 +886,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
 {
struct g_provider *pp;
 
+   KASSERT(gp != NULL, ("NULL geom"));
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name);
g_topology_assert();
 
@@ -895,7 +896,6 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
return (ENXIO);
}
 
-   KASSERT(gp != NULL, ("NULL geom"));
pp = LIST_FIRST(&gp->provider);
KASSERT(pp != NULL, ("NULL provider"));
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 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: r343604 - head/sys/dev/bwn

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jan 31 11:12:31 2019
New Revision: 343604
URL: https://svnweb.freebsd.org/changeset/base/343604

Log:
  bwn(4): reuse ieee80211_tx_complete function.
  
  MFC after:1 week

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Thu Jan 31 10:44:00 2019(r343603)
+++ head/sys/dev/bwn/if_bwn.c   Thu Jan 31 11:12:31 2019(r343604)
@@ -6211,20 +6211,15 @@ bwn_pio_handle_txeof(struct bwn_mac *mac,
tq->tq_used -= roundup(tp->tp_m->m_pkthdr.len + BWN_HDRSIZE(mac), 4);
tq->tq_free++;
 
-   /* XXX ieee80211_tx_complete()? */
if (tp->tp_ni != NULL) {
/*
 * Do any tx complete callback.  Note this must
 * be done before releasing the node reference.
 */
-
bwn_ratectl_tx_complete(tp->tp_ni, status);
-   if (tp->tp_m->m_flags & M_TXCB)
-   ieee80211_process_callback(tp->tp_ni, tp->tp_m, 0);
-   ieee80211_free_node(tp->tp_ni);
-   tp->tp_ni = NULL;
}
-   m_freem(tp->tp_m);
+   ieee80211_tx_complete(tp->tp_ni, tp->tp_m, 0);
+   tp->tp_ni = NULL;
tp->tp_m = NULL;
TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list);
 
___
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: r343605 - in stable: 10/sys/geom/uzip 11/sys/geom/uzip 12/sys/geom/uzip

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jan 31 11:36:28 2019
New Revision: 343605
URL: https://svnweb.freebsd.org/changeset/base/343605

Log:
  MFC r343473:
  geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced
  
  PR:   203499
  Submitted by: 
  
  MFC r343475:
  geom_uzip(4): set 'gp != NULL' assertion on top of the function
  
  There was yet another access to this variable in g_trace() few
  lines upper.
  
  PR:   203499
  Reported by:  cem

Modified:
  stable/11/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/geom/uzip/g_uzip.c
  stable/12/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/geom/uzip/g_uzip.c
==
--- stable/11/sys/geom/uzip/g_uzip.cThu Jan 31 11:12:31 2019
(r343604)
+++ stable/11/sys/geom/uzip/g_uzip.cThu Jan 31 11:36:28 2019
(r343605)
@@ -863,6 +863,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
 {
struct g_provider *pp;
 
+   KASSERT(gp != NULL, ("NULL geom"));
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name);
g_topology_assert();
 
@@ -872,7 +873,6 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
return (ENXIO);
}
 
-   KASSERT(gp != NULL, ("NULL geom"));
pp = LIST_FIRST(&gp->provider);
KASSERT(pp != NULL, ("NULL provider"));
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 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: r343605 - in stable: 10/sys/geom/uzip 11/sys/geom/uzip 12/sys/geom/uzip

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jan 31 11:36:28 2019
New Revision: 343605
URL: https://svnweb.freebsd.org/changeset/base/343605

Log:
  MFC r343473:
  geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced
  
  PR:   203499
  Submitted by: 
  
  MFC r343475:
  geom_uzip(4): set 'gp != NULL' assertion on top of the function
  
  There was yet another access to this variable in g_trace() few
  lines upper.
  
  PR:   203499
  Reported by:  cem

Modified:
  stable/10/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/geom/uzip/g_uzip.c
  stable/12/sys/geom/uzip/g_uzip.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/geom/uzip/g_uzip.c
==
--- stable/10/sys/geom/uzip/g_uzip.cThu Jan 31 11:12:31 2019
(r343604)
+++ stable/10/sys/geom/uzip/g_uzip.cThu Jan 31 11:36:28 2019
(r343605)
@@ -864,6 +864,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
 {
struct g_provider *pp;
 
+   KASSERT(gp != NULL, ("NULL geom"));
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name);
g_topology_assert();
 
@@ -873,7 +874,6 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla
return (ENXIO);
}
 
-   KASSERT(gp != NULL, ("NULL geom"));
pp = LIST_FIRST(&gp->provider);
KASSERT(pp != NULL, ("NULL provider"));
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 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: r343606 - head/share/mk

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 15:07:32 2019
New Revision: 343606
URL: https://svnweb.freebsd.org/changeset/base/343606

Log:
  Enable lld as the system linker by default on i386
  
  The migration to LLVM's lld linker has been in progress for quite some
  time - I opened an LLVM tracking bug (23214) in April 2015 to track
  issues using lld as FreeBSD's linker, and requested the first exp-run
  using lld as /usr/bin/ld in November 2016.
  
  In 12.0 LLD is the system linker on amd64, arm64, and armv7.  i386 was
  not switched initially as there were additional ports failures not found
  on amd64.  Those have largely been addressed now, although there are a
  small number of issues that are still being worked on.  In some of these
  cases having lld as the system linker makes it easier for developers and
  third parties to investigate failures.
  
  Thanks to antoine@ for handling the exp-runs and to everyone in the
  FreeBSD and LLVM communites who have fixed issues with lld to get us to
  this point.
  
  PR:   214864
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Jan 31 11:36:28 2019(r343605)
+++ head/share/mk/src.opts.mk   Thu Jan 31 15:07:32 2019(r343606)
@@ -321,11 +321,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
 .else
 __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
 .endif
-.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7"
+.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \
+${__T} == "i386"
 __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
-.elif ${__T} == "i386"
-__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP
-__DEFAULT_NO_OPTIONS+=LLD_IS_LD
 .else
 __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .endif
___
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: r343608 - head/share/man/man5

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 15:50:11 2019
New Revision: 343608
URL: https://svnweb.freebsd.org/changeset/base/343608

Log:
  regen src.conf.5 after r343606

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Thu Jan 31 15:44:49 2019
(r343607)
+++ head/share/man/man5/src.conf.5  Thu Jan 31 15:50:11 2019
(r343608)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd December 15, 2018
+.Dd January 31, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -335,6 +335,8 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_CTF
 .It
+.Va WITHOUT_LOADER_ZFS
+.It
 .Va WITHOUT_ZFS
 .El
 .It Va WITHOUT_CLANG
@@ -1045,12 +1047,12 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386.
 Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.
 .Pp
 This is a default setting on
-arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, 
mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, 
riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, 
mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, 
powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and 
sparc64/sparc64.
 .It Va WITH_LLD_IS_LD
 Set to use LLVM's LLD as the system linker, instead of GNU binutils ld.
 .Pp
 This is a default setting on
-amd64/amd64, arm/armv7 and arm64/aarch64.
+amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386.
 .It Va WITHOUT_LLVM_COV
 Set to not build the
 .Xr llvm-cov 1
@@ -1082,7 +1084,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_AARCH64
 Set to build LLVM target support for AArch64.
 The
@@ -1090,7 +1092,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_ALL
 Set to only build the required LLVM target support.
 This option is preferred to specific target support options.
@@ -1156,7 +1158,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_MIPS
 Set to build LLVM target support for MIPS.
 The
@@ -1164,7 +1166,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_POWERPC
 Set to not build LLVM target support for PowerPC.
 The
@@ -1172,7 +1174,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64.
 .It Va WITH_LLVM_TARGET_POWERPC
 Set to build LLVM target support for PowerPC.
 The
@@ -1180,7 +1182,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and 
powerpc/powerpcspe.
 .It Va WITHOUT_LLVM_TARGET_SPARC
 Set to not build LLVM target support for SPARC.
 The
@@ -1188,7 +1190,7 @@ The
 option should be used rather than this in most cases.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+arm/a

svn commit: r343607 - head/sys/sys

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jan 31 15:44:49 2019
New Revision: 343607
URL: https://svnweb.freebsd.org/changeset/base/343607

Log:
  Reserve a bit in the FreeBSD feature control note for marking the
  image as not compatible with ASLR.
  
  Requested by: emaste
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days
  Differential revision:https://reviews.freebsd.org/D5603

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu Jan 31 15:07:32 2019(r343606)
+++ head/sys/sys/elf_common.h   Thu Jan 31 15:44:49 2019(r343607)
@@ -762,6 +762,9 @@ typedef struct {
 #defineNT_FREEBSD_ARCH_TAG 3
 #defineNT_FREEBSD_FEATURE_CTL  4
 
+/* NT_FREEBSD_FEATURE_CTL desc[0] bits */
+#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
+
 /* Values for n_type.  Used in core files. */
 #defineNT_PRSTATUS 1   /* Process status. */
 #defineNT_FPREGSET 2   /* Floating point registers. */
___
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: r343609 - head/usr.bin/elfdump

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 16:11:15 2019
New Revision: 343609
URL: https://svnweb.freebsd.org/changeset/base/343609

Log:
  elfdump: whitespace fixup in advance of other changes

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jan 31 15:50:11 2019
(r343608)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:11:15 2019
(r343609)
@@ -320,7 +320,7 @@ static const char *p_flags[] = {
 /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */
 static const char *
 sh_types(uint64_t machine, uint64_t sht) {
-   static char unknown_buf[64]; 
+   static char unknown_buf[64];
 
if (sht < 0x6000) {
switch (sht) {
@@ -1068,11 +1068,11 @@ elf_print_note(Elf32_Ehdr *e, void *sh)
name = elf_get_word(e, sh, SH_NAME);
n = (char *)e + offset;
fprintf(out, "\nnote (%s):\n", shstrtab + name);
-   while (n < ((char *)e + offset + size)) {
+   while (n < ((char *)e + offset + size)) {
namesz = elf_get_word(e, n, N_NAMESZ);
descsz = elf_get_word(e, n, N_DESCSZ);
-   s = n + sizeof(Elf_Note);
-   desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0);
+   s = n + sizeof(Elf_Note);
+   desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0);
fprintf(out, "\t%s %d\n", s, desc);
n += sizeof(Elf_Note) + namesz + descsz;
}
___
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: r343610 - head/usr.bin/elfdump

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 16:19:04 2019
New Revision: 343610
URL: https://svnweb.freebsd.org/changeset/base/343610

Log:
  elfdump: include note type names
  
  Based on a patch submitted by Dan McGregor.
  
  PR:   228290
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:11:15 2019
(r343609)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:19:04 2019
(r343610)
@@ -317,6 +317,11 @@ static const char *p_flags[] = {
"PF_X|PF_W|PF_R"
 };
 
+static const char *nt_types[] = {
+   "", "NT_FREEBSD_ABI_TAG", "NT_FREEBSD_NOINIT_TAG",
+   "NT_FREEBSD_ARCH_TAG", "NT_FREEBSD_FEATURE_CTL"
+};
+
 /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */
 static const char *
 sh_types(uint64_t machine, uint64_t sht) {
@@ -1071,9 +1076,14 @@ elf_print_note(Elf32_Ehdr *e, void *sh)
while (n < ((char *)e + offset + size)) {
namesz = elf_get_word(e, n, N_NAMESZ);
descsz = elf_get_word(e, n, N_DESCSZ);
+   type = elf_get_word(e, n, N_TYPE);
+   if (type < nitems(nt_types))
+   nt_type = nt_types[type];
+   else
+   nt_type = "Unknown type";
s = n + sizeof(Elf_Note);
desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0);
-   fprintf(out, "\t%s %d\n", s, desc);
+   fprintf(out, "\t%s %d (%s)\n", s, desc, nt_type);
n += sizeof(Elf_Note) + namesz + descsz;
}
 }
___
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: r343611 - head/usr.bin/elfdump

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 16:21:09 2019
New Revision: 343611
URL: https://svnweb.freebsd.org/changeset/base/343611

Log:
  elfdump: fix build after r343610
  
  One patch hunk did not survive the trip from git to svn.
  
  PR:   228290
  MFC with: r343610

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:19:04 2019
(r343610)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:21:09 2019
(r343611)
@@ -1066,7 +1066,9 @@ elf_print_note(Elf32_Ehdr *e, void *sh)
u_int32_t namesz;
u_int32_t descsz;
u_int32_t desc;
+   u_int32_t type;
char *n, *s;
+   const char *nt_type;
 
offset = elf_get_off(e, sh, SH_OFFSET);
size = elf_get_size(e, sh, SH_SIZE);
___
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: r343612 - stable/12/stand/libsa/zfs

2019-01-31 Thread Toomas Soome
Author: tsoome
Date: Thu Jan 31 16:43:35 2019
New Revision: 343612
URL: https://svnweb.freebsd.org/changeset/base/343612

Log:
  MFC r343123:
  loader should ignore active multi_vdev_crash_dump feature on zpool
  
  Since the loader zfs reader does not need to read the dump zvol, we can
  just enable the feature.
  
  illumos issue #9051 https://www.illumos.org/issues/9051

Modified:
  stable/12/stand/libsa/zfs/zfsimpl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/libsa/zfs/zfsimpl.c
==
--- stable/12/stand/libsa/zfs/zfsimpl.c Thu Jan 31 16:21:09 2019
(r343611)
+++ stable/12/stand/libsa/zfs/zfsimpl.c Thu Jan 31 16:43:35 2019
(r343612)
@@ -62,6 +62,7 @@ static const char *features_for_read[] = {
"org.illumos:sha512",
"org.illumos:skein",
"org.zfsonlinux:large_dnode",
+   "com.joyent:multi_vdev_crash_dump",
NULL
 };
 
___
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: r343613 - head/usr.bin/elfdump

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 16:49:06 2019
New Revision: 343613
URL: https://svnweb.freebsd.org/changeset/base/343613

Log:
  elfdump: use designated array initialization for note types
  
  This ensures the note type name is in the correct slot.
  
  PR:   228290
  Submitted by: kib
  MFC with: 343610
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:43:35 2019
(r343612)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jan 31 16:49:06 2019
(r343613)
@@ -317,9 +317,13 @@ static const char *p_flags[] = {
"PF_X|PF_W|PF_R"
 };
 
+#define NT_ELEM(x) [x] = #x,
 static const char *nt_types[] = {
-   "", "NT_FREEBSD_ABI_TAG", "NT_FREEBSD_NOINIT_TAG",
-   "NT_FREEBSD_ARCH_TAG", "NT_FREEBSD_FEATURE_CTL"
+   "",
+   NT_ELEM(NT_FREEBSD_ABI_TAG)
+   NT_ELEM(NT_FREEBSD_NOINIT_TAG)
+   NT_ELEM(NT_FREEBSD_ARCH_TAG)
+   NT_ELEM(NT_FREEBSD_FEATURE_CTL)
 };
 
 /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */
@@ -1079,7 +1083,7 @@ elf_print_note(Elf32_Ehdr *e, void *sh)
namesz = elf_get_word(e, n, N_NAMESZ);
descsz = elf_get_word(e, n, N_DESCSZ);
type = elf_get_word(e, n, N_TYPE);
-   if (type < nitems(nt_types))
+   if (type < nitems(nt_types) && nt_types[type] != NULL)
nt_type = nt_types[type];
else
nt_type = "Unknown type";
___
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: r343614 - head/contrib/elftoolchain/readelf

2019-01-31 Thread Ed Maste
Author: emaste
Date: Thu Jan 31 17:04:55 2019
New Revision: 343614
URL: https://svnweb.freebsd.org/changeset/base/343614

Log:
  readelf: dump elf note data
  
  Output format is compatible with GNU readelf's handling of unknown note
  types (modulo a GNU char signedness bug); future changes will add type-
  specific decoding.
  
  Reviewed by:  kib
  MFC after:1 week
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Thu Jan 31 16:49:06 2019
(r343613)
+++ head/contrib/elftoolchain/readelf/readelf.c Thu Jan 31 17:04:55 2019
(r343614)
@@ -3567,6 +3567,7 @@ dump_notes_content(struct readelf *re, const char *buf
 {
Elf_Note *note;
const char *end, *name;
+   uint32_t i;
 
printf("\nNotes at offset %#010jx with length %#010jx:\n",
(uintmax_t) off, (uintmax_t) sz);
@@ -3578,7 +3579,9 @@ dump_notes_content(struct readelf *re, const char *buf
return;
}
note = (Elf_Note *)(uintptr_t) buf;
-   name = (char *)(uintptr_t)(note + 1);
+   buf += sizeof(Elf_Note);
+   name = buf;
+   buf += roundup2(note->n_namesz, 4);
/*
 * The name field is required to be nul-terminated, and
 * n_namesz includes the terminating nul in observed
@@ -3596,8 +3599,11 @@ dump_notes_content(struct readelf *re, const char *buf
printf("  %-13s %#010jx", name, (uintmax_t) note->n_descsz);
printf("  %s\n", note_type(name, re->ehdr.e_type,
note->n_type));
-   buf += sizeof(Elf_Note) + roundup2(note->n_namesz, 4) +
-   roundup2(note->n_descsz, 4);
+   printf("   description data:");
+   for (i = 0; i < note->n_descsz; i++)
+   printf(" %02x", (unsigned char)buf[i]);
+   printf("\n");
+   buf += roundup2(note->n_descsz, 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"


svn commit: r343615 - stable/12/stand/libsa

2019-01-31 Thread Toomas Soome
Author: tsoome
Date: Thu Jan 31 17:06:59 2019
New Revision: 343615
URL: https://svnweb.freebsd.org/changeset/base/343615

Log:
  MFC r343124:
  
  libsa: add asprintf()
  
  asprintf() is a nice tool for string processing.

Modified:
  stable/12/stand/libsa/printf.c
  stable/12/stand/libsa/stand.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/libsa/printf.c
==
--- stable/12/stand/libsa/printf.c  Thu Jan 31 17:04:55 2019
(r343614)
+++ stable/12/stand/libsa/printf.c  Thu Jan 31 17:06:59 2019
(r343615)
@@ -122,6 +122,34 @@ snprint_func(int ch, void *arg)
 }
 
 int
+asprintf(char **buf, const char *cfmt, ...)
+{
+   int retval;
+   struct print_buf arg;
+   va_list ap;
+
+   *buf = NULL;
+   va_start(ap, cfmt);
+   retval = kvprintf(cfmt, NULL, NULL, 10, ap);
+   va_end(ap);
+   if (retval <= 0)
+   return (-1);
+
+   arg.size = retval + 1;
+   arg.buf = *buf = malloc(arg.size);
+   if (*buf == NULL)
+   return (-1);
+
+   va_start(ap, cfmt);
+   retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap);
+   va_end(ap);
+
+   if (arg.size >= 1)
+   *(arg.buf)++ = 0;
+   return (retval);
+}
+
+int
 snprintf(char *buf, size_t size, const char *cfmt, ...)
 {
int retval;

Modified: stable/12/stand/libsa/stand.h
==
--- stable/12/stand/libsa/stand.h   Thu Jan 31 17:04:55 2019
(r343614)
+++ stable/12/stand/libsa/stand.h   Thu Jan 31 17:06:59 2019
(r343615)
@@ -268,6 +268,7 @@ extern void *reallocf(void *ptr, size_t size);
 extern voidmallocstats(void);
 
 extern int printf(const char *fmt, ...) __printflike(1, 2);
+extern int asprintf(char **buf, const char *cfmt, ...) __printflike(2, 3);
 extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3);
 extern int snprintf(char *buf, size_t size, const char *cfmt, ...) 
__printflike(3, 4);
 extern int vprintf(const char *fmt, __va_list);
___
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: r343616 - head/sys/vm

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 31 17:52:48 2019
New Revision: 343616
URL: https://svnweb.freebsd.org/changeset/base/343616

Log:
  In zone_alloc_bucket() max argument was calculated based on uz_count.
  Then bucket_alloc() also selects bucket size based on uz_count. However,
  since zone lock is dropped, uz_count may reduce. In this case max may
  be greater than ub_entries and that would yield into writing beyond end
  of the allocation.
  
  Reported by:  pho

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Thu Jan 31 17:06:59 2019(r343615)
+++ head/sys/vm/uma_core.c  Thu Jan 31 17:52:48 2019(r343616)
@@ -2844,7 +2844,7 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do
return (NULL);
 
bucket->ub_cnt = zone->uz_import(zone->uz_arg, bucket->ub_bucket,
-   max, domain, flags);
+   MIN(max, bucket->ub_entries), domain, flags);
 
/*
 * Initialize the memory if necessary.
___
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: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpaa...

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jan 31 19:05:56 2019
New Revision: 343617
URL: https://svnweb.freebsd.org/changeset/base/343617

Log:
  Make iflib a loadable module.
  
  iflib is already a module, but it is unconditionally compiled into the
  kernel.  There are drivers which do not need iflib(4), and there are
  situations where somebody might not want iflib in kernel because of
  using the corresponding driver as module.
  
  Reviewed by:  marius
  Discussed with:   erj
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D19041

Added:
  head/sys/modules/iflib/
  head/sys/modules/iflib/Makefile   (contents, props changed)
Modified:
  head/UPDATING
  head/share/man/man4/bnxt.4
  head/share/man/man4/em.4
  head/share/man/man4/iavf.4
  head/share/man/man4/ixgbe.4
  head/share/man/man4/ixl.4
  head/share/man/man4/vmx.4
  head/sys/amd64/conf/GENERIC
  head/sys/arm64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/i386/conf/GENERIC
  head/sys/mips/conf/OCTEON1
  head/sys/mips/conf/std.XLP
  head/sys/modules/Makefile
  head/sys/powerpc/conf/GENERIC64
  head/sys/powerpc/conf/MPC85XX
  head/sys/powerpc/conf/MPC85XXSPE
  head/sys/powerpc/conf/QORIQ64
  head/sys/powerpc/conf/dpaa/DPAA
  head/sys/sparc64/conf/GENERIC

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jan 31 17:52:48 2019(r343616)
+++ head/UPDATING   Thu Jan 31 19:05:56 2019(r343617)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20190131:
+   Iflib is no longer unconditionally compiled into the kernel.  Drivers
+   using iflib and statically compiled into the kernel, now require
+   the 'device iflib' config option.  For the same drivers loaded as
+   modules on kernels not having 'device iflib', the iflib.ko module
+   is loaded automatically.
+
 20181230:
r342635 changes the way efibootmgr(8) works by requiring users to add
the -b (bootnum) parameter for commands where the bootnum was previously

Modified: head/share/man/man4/bnxt.4
==
--- head/share/man/man4/bnxt.4  Thu Jan 31 17:52:48 2019(r343616)
+++ head/share/man/man4/bnxt.4  Thu Jan 31 19:05:56 2019(r343617)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 20, 2018
+.Dd January 30, 2019
 .Dt BNXT 4
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@ To compile this driver into the kernel,
 place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device iflib"
 .Cd "device bnxt"
 .Ed
 .Pp

Modified: head/share/man/man4/em.4
==
--- head/share/man/man4/em.4Thu Jan 31 17:52:48 2019(r343616)
+++ head/share/man/man4/em.4Thu Jan 31 19:05:56 2019(r343617)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 20, 2018
+.Dd January 30, 2019
 .Dt EM 4
 .Os
 .Sh NAME
@@ -39,9 +39,10 @@
 .Nd "Intel(R) PRO/1000 Gigabit Ethernet adapter driver"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
-place the following line in your
+place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device iflib"
 .Cd "device em"
 .Ed
 .Pp

Modified: head/share/man/man4/iavf.4
==
--- head/share/man/man4/iavf.4  Thu Jan 31 17:52:48 2019(r343616)
+++ head/share/man/man4/iavf.4  Thu Jan 31 19:05:56 2019(r343617)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 5, 2018
+.Dd January 30, 2019
 .Dt IAVF 4
 .Os
 .Sh NAME
@@ -41,6 +41,7 @@
 To compile this driver into the kernel, place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device iflib"
 .Cd "device iavf"
 .Ed
 .Pp

Modified: head/share/man/man4/ixgbe.4
==
--- head/share/man/man4/ixgbe.4 Thu Jan 31 17:52:48 2019(r343616)
+++ head/share/man/man4/ixgbe.4 Thu Jan 31 19:05:56 2019(r343617)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 19, 2010
+.Dd January 30, 2019
 .Dt IXGBE 4
 .Os
 .Sh NAME
@@ -39,9 +39,10 @@
 .Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
-place the following line in your
+place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device iflib"
 .Cd "d

svn commit: r343618 - head/sys/modules/iflib

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jan 31 20:04:18 2019
New Revision: 343618
URL: https://svnweb.freebsd.org/changeset/base/343618

Log:
  Make iflib a loadable module: add seemingly missed header.
  
  Reported by:  CI (i.e. it is not reproducable in my local builds)
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/modules/iflib/Makefile

Modified: head/sys/modules/iflib/Makefile
==
--- head/sys/modules/iflib/Makefile Thu Jan 31 19:05:56 2019
(r343617)
+++ head/sys/modules/iflib/Makefile Thu Jan 31 20:04:18 2019
(r343618)
@@ -8,6 +8,6 @@ SRCS= \
iflib_clone.c \
mp_ring.c
 SRCS+= ifdi_if.c
-SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h
+SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
 
 .include 
___
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: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpa

2019-01-31 Thread Ian Lepore
On Thu, 2019-01-31 at 19:05 +, Konstantin Belousov wrote:
> +SRCS+= ifdi_if.c
> +SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h

ifdi_if.h appears twice.

-- 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"


Re: svn commit: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpa

2019-01-31 Thread Ian Lepore
On Thu, 2019-01-31 at 13:00 -0700, Ian Lepore wrote:
> On Thu, 2019-01-31 at 19:05 +, Konstantin Belousov wrote:
> > +SRCS+= ifdi_if.c
> > +SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h
> 
> ifdi_if.h appears twice.
> 

Oops, nevermind. Right after sending that, I realized one is a .c and
the other a .h.

-- 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: r343619 - in head/sys: net netpfil/ipfw

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 31 21:04:50 2019
New Revision: 343619
URL: https://svnweb.freebsd.org/changeset/base/343619

Log:
  Revert r316461: Remove "IPFW static rules" rmlock, and use pfil's global lock.
  
  The pfil(9) system is about to be converted to epoch(9) synchronization, so
  we need [temporarily] go back with ipfw internal locking.
  
  Discussed with:   ae

Modified:
  head/sys/net/pfil.c
  head/sys/net/pfil.h
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/ipfw/ip_fw_dynamic.c
  head/sys/netpfil/ipfw/ip_fw_iface.c
  head/sys/netpfil/ipfw/ip_fw_nat.c
  head/sys/netpfil/ipfw/ip_fw_private.h
  head/sys/netpfil/ipfw/ip_fw_sockopt.c
  head/sys/netpfil/ipfw/ip_fw_table.c
  head/sys/netpfil/ipfw/ip_fw_table_value.c

Modified: head/sys/net/pfil.c
==
--- head/sys/net/pfil.c Thu Jan 31 20:04:18 2019(r343618)
+++ head/sys/net/pfil.c Thu Jan 31 21:04:50 2019(r343619)
@@ -64,6 +64,7 @@ LIST_HEAD(pfilheadhead, pfil_head);
 VNET_DEFINE(struct pfilheadhead, pfil_head_list);
 #defineV_pfil_head_listVNET(pfil_head_list)
 VNET_DEFINE(struct rmlock, pfil_lock);
+#defineV_pfil_lock VNET(pfil_lock)
 
 #definePFIL_LOCK_INIT_REAL(l, t)   \
rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE)

Modified: head/sys/net/pfil.h
==
--- head/sys/net/pfil.h Thu Jan 31 20:04:18 2019(r343618)
+++ head/sys/net/pfil.h Thu Jan 31 21:04:50 2019(r343619)
@@ -40,7 +40,6 @@
 #include 
 #include 
 #include 
-#include 
 
 struct mbuf;
 struct ifnet;
@@ -100,9 +99,6 @@ struct pfil_head {
 #defineph_ifnet ph_un.phu_ptr
LIST_ENTRY(pfil_head) ph_list;
 };
-
-VNET_DECLARE(struct rmlock, pfil_lock);
-#defineV_pfil_lock VNET(pfil_lock)
 
 /* Public functions for pfil hook management by packet filters. */
 struct pfil_head *pfil_head_get(int, u_long);

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Thu Jan 31 20:04:18 2019
(r343618)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Thu Jan 31 21:04:50 2019
(r343619)
@@ -1404,6 +1404,7 @@ ipfw_chk(struct ip_fw_args *args)
int is_ipv4 = 0;
 
int done = 0;   /* flag to exit the outer loop */
+   IPFW_RLOCK_TRACKER;
 
if (m->m_flags & M_SKIP_FIREWALL || (! V_ipfw_vnet_ready))
return (IP_FW_PASS);/* accept */

Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- head/sys/netpfil/ipfw/ip_fw_dynamic.c   Thu Jan 31 20:04:18 2019
(r343618)
+++ head/sys/netpfil/ipfw/ip_fw_dynamic.c   Thu Jan 31 21:04:50 2019
(r343619)
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/netpfil/ipfw/ip_fw_iface.c
==
--- head/sys/netpfil/ipfw/ip_fw_iface.c Thu Jan 31 20:04:18 2019
(r343618)
+++ head/sys/netpfil/ipfw/ip_fw_iface.c Thu Jan 31 21:04:50 2019
(r343619)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/netpfil/ipfw/ip_fw_nat.c
==
--- head/sys/netpfil/ipfw/ip_fw_nat.c   Thu Jan 31 20:04:18 2019
(r343618)
+++ head/sys/netpfil/ipfw/ip_fw_nat.c   Thu Jan 31 21:04:50 2019
(r343619)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/netpfil/ipfw/ip_fw_private.h
==
--- head/sys/netpfil/ipfw/ip_fw_private.h   Thu Jan 31 20:04:18 2019
(r343618)
+++ head/sys/netpfil/ipfw/ip_fw_private.h   Thu Jan 31 21:04:50 2019
(r343619)
@@ -312,6 +312,8 @@ struct ip_fw_chain {
void**srvstate; /* runtime service mappings */
 #if defined( __linux__ ) || defined( _WIN32 )
spinlock_t rwmtx;
+#else
+   struct rmlock   rwmtx;
 #endif
int static_len; /* total len of static rules (v0) */
uint32_tgencnt; /* NAT generation count */
@@ -452,23 +454,25 @@ struct ipfw_ifc {
 #defineIPFW_PF_RUNLOCK(p)  IPFW_RUNLOCK(p)
 #else /* FreeBSD */
 #defineIPFW_LOCK_INIT(_chain) do { \
+   rm_init_flags(&(_chain)->rwmtx, "IPFW static rules", RM_RECURSE); \
rw_init(&(_chain)->uh_lock, "IPFW UH lock");\
} while (0)
 
 #defineIPFW_LOCK_DESTROY(_chain) do {  \
+   rm_destroy(&(_chain)->rwmtx);   \
rw_destro

svn commit: r343620 - head/sys/net

2019-01-31 Thread John Baldwin
Author: jhb
Date: Thu Jan 31 21:35:37 2019
New Revision: 343620
URL: https://svnweb.freebsd.org/changeset/base/343620

Log:
  Don't set IFCAP_TXRTLMT during lagg_clone_create().
  
  lagg_capabilities() will set the capability once interfaces supporting
  the feature are added to the lagg.  Setting it on a lagg without any
  interfaces is pointless as the if_snd_tag_alloc call will always fail
  in that case.
  
  Reviewed by:  hselasky, gallatin
  MFC after:2 weeks
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D19040

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Jan 31 21:04:50 2019(r343619)
+++ head/sys/net/if_lagg.c  Thu Jan 31 21:35:37 2019(r343620)
@@ -514,10 +514,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
 #ifdef RATELIMIT
ifp->if_snd_tag_alloc = lagg_snd_tag_alloc;
-   ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS | 
IFCAP_TXRTLMT;
-#else
-   ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS;
 #endif
+   ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS;
 
/*
 * Attach as an ordinary ethernet device, children will be attached
___
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: r343621 - head/sys/dev/ixgbe

2019-01-31 Thread Eric Joyner
Author: erj
Date: Thu Jan 31 21:44:33 2019
New Revision: 343621
URL: https://svnweb.freebsd.org/changeset/base/343621

Log:
  ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status
  
  From Piotr:
  
  This patch introduces adapter->task_requests register responsible for
  recording requests for mod_task, msf_task, mbx_task, fdir_task and
  phy_task calls. Instead of enqueueing these tasks with
  GROUPTASK_ENQUEUE, handlers will be called directly from
  ixgbe_if_update_admin_status() while holding ctx lock.
  
  SIOCGIFXMEDIA ioctl() call reads adapter->media list. The list is
  deleted and rewritten in ixgbe_handle_msf() task without holding ctx
  lock. This change is needed to maintain data coherency when sharing
  adapter info via ioctl() calls.
  
  Patch co-authored by Krzysztof Galazka .
  
  PR:   221317
  Submitted by: Piotr Pietruszewski 
  Reviewed by:  sbruno@, IntelNetworking
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D18468

Modified:
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/ixgbe.h
  head/sys/dev/ixgbe/ixgbe_type.h

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Thu Jan 31 21:35:37 2019(r343620)
+++ head/sys/dev/ixgbe/if_ix.c  Thu Jan 31 21:44:33 2019(r343621)
@@ -120,6 +120,7 @@ static int  ixgbe_if_resume(if_ctx_t ctx);
 static void ixgbe_if_stop(if_ctx_t ctx);
 void ixgbe_if_enable_intr(if_ctx_t ctx);
 static void ixgbe_if_disable_intr(if_ctx_t ctx);
+static void ixgbe_link_intr_enable(if_ctx_t ctx);
 static int  ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid);
 static void ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq * ifmr);
 static int  ixgbe_if_media_change(if_ctx_t ctx);
@@ -173,7 +174,7 @@ static void ixgbe_init_device_features(struct adapter 
 static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
 static void ixgbe_add_media_types(if_ctx_t ctx);
 static void ixgbe_update_stats_counters(struct adapter *adapter);
-static void ixgbe_config_link(struct adapter *adapter);
+static void ixgbe_config_link(if_ctx_t ctx);
 static void ixgbe_get_slot_info(struct adapter *);
 static void ixgbe_check_wol_support(struct adapter *adapter);
 static void ixgbe_enable_rx_drop(struct adapter *);
@@ -254,6 +255,7 @@ static device_method_t ixgbe_if_methods[] = {
DEVMETHOD(ifdi_msix_intr_assign, ixgbe_if_msix_intr_assign),
DEVMETHOD(ifdi_intr_enable, ixgbe_if_enable_intr),
DEVMETHOD(ifdi_intr_disable, ixgbe_if_disable_intr),
+   DEVMETHOD(ifdi_link_intr_enable, ixgbe_link_intr_enable),
DEVMETHOD(ifdi_tx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable),
DEVMETHOD(ifdi_rx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable),
DEVMETHOD(ifdi_tx_queues_alloc, ixgbe_if_tx_queues_alloc),
@@ -446,19 +448,6 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs
 
}
 
-   iflib_config_gtask_init(ctx, &adapter->mod_task, ixgbe_handle_mod,
-   "mod_task");
-   iflib_config_gtask_init(ctx, &adapter->msf_task, ixgbe_handle_msf,
-   "msf_task");
-   iflib_config_gtask_init(ctx, &adapter->phy_task, ixgbe_handle_phy,
-   "phy_task");
-   if (adapter->feat_cap & IXGBE_FEATURE_SRIOV)
-   iflib_config_gtask_init(ctx, &adapter->mbx_task,
-   ixgbe_handle_mbx, "mbx_task");
-   if (adapter->feat_en & IXGBE_FEATURE_FDIR)
-   iflib_config_gtask_init(ctx, &adapter->fdir_task,
-   ixgbe_reinit_fdir, "fdir_task");
-
device_printf(iflib_get_dev(ctx), "allocated for %d queues\n",
adapter->num_tx_queues);
 
@@ -1362,8 +1351,9 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
  * ixgbe_config_link
  /
 static void
-ixgbe_config_link(struct adapter *adapter)
+ixgbe_config_link(if_ctx_t ctx)
 {
+   struct adapter  *adapter = iflib_get_softc(ctx);
struct ixgbe_hw *hw = &adapter->hw;
u32 autoneg, err = 0;
boolsfp, negotiate;
@@ -1371,7 +1361,8 @@ ixgbe_config_link(struct adapter *adapter)
sfp = ixgbe_is_sfp(hw);
 
if (sfp) {
-   GROUPTASK_ENQUEUE(&adapter->mod_task);
+   adapter->task_requests |= IXGBE_REQUEST_TASK_MOD;
+   iflib_admin_intr_deferred(ctx);
} else {
if (hw->mac.ops.check_link)
err = ixgbe_check_link(hw, &adapter->link_speed,
@@ -1388,7 +1379,6 @@ ixgbe_config_link(struct adapter *adapter)
err = hw->mac.ops.setup_link(hw, autoneg,
adapter->link_up);
}
-
 } /* ixgbe_config_link */
 
 /
@@ -2096,8 +2086,6 @@ ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq 
 
INIT_DEBUGOUT("ixg

svn commit: r343622 - head/sys/dev/ixgbe

2019-01-31 Thread Eric Joyner
Author: erj
Date: Thu Jan 31 21:53:03 2019
New Revision: 343622
URL: https://svnweb.freebsd.org/changeset/base/343622

Log:
  ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled
  
  This patch and commit message are based on r340256 created by Jacob Keller:
  
  The iflib stack does not disable TSO automatically when TXCSUM is
  disabled, instead assuming that the driver will correctly handle TSOs
  even when CSUM_IP is not set.
  
  This results in iflib calling ixgbe_isc_txd_encap with packets which have
  CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of
  this, ixgbe_tx_ctx_setup will not setup the IPv4 checksum offloading.
  
  This results in bad TSO packets being sent if a user disables TXCSUM
  without disabling TSO.
  
  Fix this by updating the ixgbe_tx_ctx_setup function to check both
  CSUM_IP and CSUM_IP_TSO when deciding whether to enable checksums.
  
  Once this is corrected, another issue for TSO packets is revealed. The
  driver sets IFLIB_NEED_ZERO_CSUM in order to enable a work around that
  causes the ip->sum field to be zero'd. This is necessary for ix
  hardware to correctly perform TSOs.
  
  However, if TXCSUM is disabled, then the work around is not enabled, as
  CSUM_IP will not be set when the iflib stack checks to see if it should
  clear the sum field.
  
  Fix this by adding IFLIB_TSO_INIT_IP to the iflib flags for the ix and
  ixv interface files.
  
  Once both of these changes are made, the ix and ixv drivers should
  correctly offload TSO packets when TSO offload is enabled, regardless
  of whether TXCSUM is enabled or disabled.
  
  Submitted by: Piotr Pietruszewski 
  Reviewed by:  IntelNetworking
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D18470

Modified:
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Thu Jan 31 21:44:33 2019(r343621)
+++ head/sys/dev/ixgbe/if_ix.c  Thu Jan 31 21:53:03 2019(r343622)
@@ -379,6 +379,7 @@ static struct if_shared_ctx ixgbe_sctx_init = {
.isc_vendor_info = ixgbe_vendor_info_array,
.isc_driver_version = ixgbe_driver_version,
.isc_driver = &ixgbe_if_driver,
+   .isc_flags = IFLIB_TSO_INIT_IP,
 
.isc_nrxd_min = {MIN_RXD},
.isc_ntxd_min = {MIN_TXD},

Modified: head/sys/dev/ixgbe/if_ixv.c
==
--- head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 21:44:33 2019(r343621)
+++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 21:53:03 2019(r343622)
@@ -220,6 +220,7 @@ static struct if_shared_ctx ixv_sctx_init = {
.isc_vendor_info = ixv_vendor_info_array,
.isc_driver_version = ixv_driver_version,
.isc_driver = &ixv_if_driver,
+   .isc_flags = IFLIB_TSO_INIT_IP,
 
.isc_nrxd_min = {MIN_RXD},
.isc_ntxd_min = {MIN_TXD},

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cThu Jan 31 21:44:33 2019
(r343621)
+++ head/sys/dev/ixgbe/ix_txrx.cThu Jan 31 21:53:03 2019
(r343622)
@@ -131,7 +131,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *T
 
switch (pi->ipi_ipproto) {
case IPPROTO_TCP:
-   if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP))
+   if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP | 
CSUM_TSO))
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
else
offload = FALSE;
___
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: r343623 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-01-31 Thread Sean Eric Fagan
Author: sef
Date: Thu Jan 31 22:06:46 2019
New Revision: 343623
URL: https://svnweb.freebsd.org/changeset/base/343623

Log:
  MFC r342928:
 Change ZFS quotas to return EINVAL when not present (matches man page).
  
  Approved by:  mav
  Reviewed by:  markj
  PR:   234413
  Sponsored by: iXsystems Inc
  Reported by:  Emrion 

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Thu Jan 31 21:53:03 2019(r343622)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Thu Jan 31 22:06:46 2019(r343623)
@@ -144,7 +144,7 @@ zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, 
quotaobj = isgroup ? zfsvfs->z_groupquota_obj : zfsvfs->z_userquota_obj;
 
if (quotaobj == 0 || zfsvfs->z_replay) {
-   error = ENOENT;
+   error = EINVAL;
goto done;
}
(void)sprintf(buf, "%llx", (longlong_t)id);
___
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: r343624 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-01-31 Thread Sean Eric Fagan
Author: sef
Date: Thu Jan 31 22:08:02 2019
New Revision: 343624
URL: https://svnweb.freebsd.org/changeset/base/343624

Log:
  MFC r342928:
 Change ZFS quotas to return EINVAL when not present (matches man page).
  
  Approved by:  mav
  Reviewed by:  markj
  PR:   234413
  Sponsored by: iXsystems Inc
  Reported by:  Emrion 

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Thu Jan 31 22:06:46 2019(r343623)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Thu Jan 31 22:08:02 2019(r343624)
@@ -140,7 +140,7 @@ zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, 
quotaobj = isgroup ? zfsvfs->z_groupquota_obj : zfsvfs->z_userquota_obj;
 
if (quotaobj == 0 || zfsvfs->z_replay) {
-   error = ENOENT;
+   error = EINVAL;
goto done;
}
(void)sprintf(buf, "%llx", (longlong_t)id);
___
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: r343625 - svnadmin/conf

2019-01-31 Thread Alexander Motin
Author: mav
Date: Thu Jan 31 22:20:20 2019
New Revision: 343625
URL: https://svnweb.freebsd.org/changeset/base/343625

Log:
  Release Sean Eric Fagan (sef) from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Jan 31 22:08:02 2019(r343624)
+++ svnadmin/conf/mentors   Thu Jan 31 22:20:20 2019(r343625)
@@ -31,7 +31,6 @@ ngie  emaste  Co-mentor: jtl
 peterj jhb Co-mentor: grog
 ramken Co-mentor: mav
 rgrimesphk Co-mentor: bde
-sefmav
 slavashkib Co-mentor: hselasky
 slmken Co-mentor: scottl, ambrisko
 thjjtl
___
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: r343626 - head/sys/kern

2019-01-31 Thread Mark Johnston
Author: markj
Date: Thu Jan 31 22:27:39 2019
New Revision: 343626
URL: https://svnweb.freebsd.org/changeset/base/343626

Log:
  Prevent some kobj memory allocation failures from panicking the system.
  
  Parts of the kobj(9) KPI assume a non-sleepable context for the purpose
  of internal memory allocations, but currently have no way to signal an
  allocation failure to the caller, so they just panic in this case.  This
  can occur even when kobj_create() is called with M_WAITOK.  Fix some
  instances of the problem by plumbing wait flags from kobj_create() through
  internal subroutines.  Change kobj_class_compile() to assume a sleepable
  context when called externally, since all existing callers use it in a
  sleepable context.
  
  To fix the problem fully the kobj_init() KPI must be changed.
  
  Reported and tested by:   pho
  Reviewed by:  kib (previous version)
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19023

Modified:
  head/sys/kern/subr_kobj.c

Modified: head/sys/kern/subr_kobj.c
==
--- head/sys/kern/subr_kobj.c   Thu Jan 31 22:20:20 2019(r343625)
+++ head/sys/kern/subr_kobj.c   Thu Jan 31 22:27:39 2019(r343626)
@@ -125,38 +125,43 @@ kobj_class_compile_common(kobj_class_t cls, kobj_ops_t
cls->ops = ops;
 }
 
-void
-kobj_class_compile(kobj_class_t cls)
+static int
+kobj_class_compile1(kobj_class_t cls, int mflags)
 {
kobj_ops_t ops;
 
KOBJ_ASSERT(MA_NOTOWNED);
 
-   /*
-* Allocate space for the compiled ops table.
-*/
-   ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT);
-   if (!ops)
-   panic("%s: out of memory", __func__);
+   ops = malloc(sizeof(struct kobj_ops), M_KOBJ, mflags);
+   if (ops == NULL)
+   return (ENOMEM);
 
-   KOBJ_LOCK();
-   
/*
 * We may have lost a race for kobj_class_compile here - check
 * to make sure someone else hasn't already compiled this
 * class.
 */
+   KOBJ_LOCK();
if (cls->ops) {
KOBJ_UNLOCK();
free(ops, M_KOBJ);
-   return;
+   return (0);
}
-
kobj_class_compile_common(cls, ops);
KOBJ_UNLOCK();
+   return (0);
 }
 
 void
+kobj_class_compile(kobj_class_t cls)
+{
+   int error;
+
+   error = kobj_class_compile1(cls, M_WAITOK);
+   KASSERT(error == 0, ("kobj_class_compile1 returned %d", error));
+}
+
+void
 kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops)
 {
 
@@ -254,24 +259,6 @@ kobj_class_free(kobj_class_t cls)
free(ops, M_KOBJ);
 }
 
-kobj_t
-kobj_create(kobj_class_t cls,
-   struct malloc_type *mtype,
-   int mflags)
-{
-   kobj_t obj;
-
-   /*
-* Allocate and initialise the new object.
-*/
-   obj = malloc(cls->size, mtype, mflags | M_ZERO);
-   if (!obj)
-   return NULL;
-   kobj_init(obj, cls);
-
-   return obj;
-}
-
 static void
 kobj_init_common(kobj_t obj, kobj_class_t cls)
 {
@@ -280,30 +267,52 @@ kobj_init_common(kobj_t obj, kobj_class_t cls)
cls->refs++;
 }
 
-void
-kobj_init(kobj_t obj, kobj_class_t cls)
+static int
+kobj_init1(kobj_t obj, kobj_class_t cls, int mflags)
 {
-   KOBJ_ASSERT(MA_NOTOWNED);
-  retry:
-   KOBJ_LOCK();
+   int error;
 
-   /*
-* Consider compiling the class' method table.
-*/
-   if (!cls->ops) {
+   KOBJ_LOCK();
+   while (cls->ops == NULL) {
/*
 * kobj_class_compile doesn't want the lock held
 * because of the call to malloc - we drop the lock
 * and re-try.
 */
KOBJ_UNLOCK();
-   kobj_class_compile(cls);
-   goto retry;
+   error = kobj_class_compile1(cls, mflags);
+   if (error != 0)
+   return (error);
+   KOBJ_LOCK();
}
-
kobj_init_common(obj, cls);
-
KOBJ_UNLOCK();
+   return (0);
+}
+
+kobj_t
+kobj_create(kobj_class_t cls, struct malloc_type *mtype, int mflags)
+{
+   kobj_t obj;
+
+   obj = malloc(cls->size, mtype, mflags | M_ZERO);
+   if (obj == NULL)
+   return (NULL);
+   if (kobj_init1(obj, cls, mflags) != 0) {
+   free(obj, mtype);
+   return (NULL);
+   }
+   return (obj);
+}
+
+void
+kobj_init(kobj_t obj, kobj_class_t cls)
+{
+   int error;
+
+   error = kobj_init1(obj, cls, M_NOWAIT);
+   if (error != 0)
+   panic("kobj_init1 failed: error %d", error);
 }
 
 void
___
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...@fre

svn commit: r343627 - in head/sys: kern sys

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 31 22:37:28 2019
New Revision: 343627
URL: https://svnweb.freebsd.org/changeset/base/343627

Log:
  Add new m_ext type for data for M_NOFREE mbufs, which doesn't actually do
  anything except several assertions.  This type is going to be used for
  temporary on stack mbufs, that point into data in receive ring of a NIC,
  that shall not be freed.  Such mbuf can not be stored or reallocated, its
  life time is current context.

Modified:
  head/sys/kern/kern_mbuf.c
  head/sys/sys/mbuf.h

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Thu Jan 31 22:27:39 2019(r343626)
+++ head/sys/kern/kern_mbuf.c   Thu Jan 31 22:37:28 2019(r343627)
@@ -847,7 +847,8 @@ mb_free_ext(struct mbuf *m)
 */
if (m->m_flags & M_NOFREE) {
freembuf = 0;
-   KASSERT(m->m_ext.ext_type == EXT_EXTREF,
+   KASSERT(m->m_ext.ext_type == EXT_EXTREF ||
+   m->m_ext.ext_type == EXT_RXRING,
("%s: no-free mbuf %p has wrong type", __func__, m));
} else
freembuf = 1;
@@ -890,6 +891,10 @@ mb_free_ext(struct mbuf *m)
KASSERT(m->m_ext.ext_free != NULL,
("%s: ext_free not set", __func__));
m->m_ext.ext_free(m);
+   break;
+   case EXT_RXRING:
+   KASSERT(m->m_ext.ext_free == NULL,
+   ("%s: ext_free is set", __func__));
break;
default:
KASSERT(m->m_ext.ext_type == 0,

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Thu Jan 31 22:27:39 2019(r343626)
+++ head/sys/sys/mbuf.h Thu Jan 31 22:37:28 2019(r343627)
@@ -443,6 +443,7 @@ struct mbuf {
 #defineEXT_JUMBO16 5   /* jumbo cluster 16184 bytes */
 #defineEXT_PACKET  6   /* mbuf+cluster from packet zone */
 #defineEXT_MBUF7   /* external mbuf reference */
+#defineEXT_RXRING  8   /* data in NIC receive ring */
 
 #defineEXT_VENDOR1 224 /* for vendor-internal use */
 #defineEXT_VENDOR2 225 /* for vendor-internal use */
___
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: r343628 - head/sys/dev/nvdimm

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jan 31 22:43:20 2019
New Revision: 343628
URL: https://svnweb.freebsd.org/changeset/base/343628

Log:
  nvdimm: enumerate NVDIMM SPA ranges from the root device
  
  Move the enumeration of NVDIMM SPA ranges from the spa GEOM class
  initializer into the NVDIMM root device. This will be necessary for a
  later change where NVDIMM namespaces require NVDIMM device enumeration
  to be reliably ordered before SPA enumeration.
  
  Submitted by: D Scott Phillips 
  Sponsored by: Intel Corporation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18734

Modified:
  head/sys/dev/nvdimm/nvdimm.c
  head/sys/dev/nvdimm/nvdimm_spa.c
  head/sys/dev/nvdimm/nvdimm_var.h

Modified: head/sys/dev/nvdimm/nvdimm.c
==
--- head/sys/dev/nvdimm/nvdimm.cThu Jan 31 22:37:28 2019
(r343627)
+++ head/sys/dev/nvdimm/nvdimm.cThu Jan 31 22:43:20 2019
(r343628)
@@ -227,6 +227,31 @@ nvdimm_resume(device_t dev)
return (0);
 }
 
+static int
+nvdimm_root_create_spa(void *nfitsubtbl, void *arg)
+{
+   enum SPA_mapping_type spa_type;
+   ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr;
+   struct SPA_mapping *spa;
+   struct nvdimm_root_dev *dev;
+   int error;
+
+   nfitaddr = nfitsubtbl;
+   dev = arg;
+   spa_type = nvdimm_spa_type_from_uuid(
+   (struct uuid *)nfitaddr->RangeGuid);
+   if (spa_type == SPA_TYPE_UNKNOWN)
+   return (0);
+   spa = malloc(sizeof(struct SPA_mapping), M_NVDIMM, M_WAITOK | M_ZERO);
+   error = nvdimm_spa_init(spa, nfitaddr, spa_type);
+   if (error != 0) {
+   nvdimm_spa_fini(spa);
+   free(spa, M_NVDIMM);
+   }
+   SLIST_INSERT_HEAD(&dev->spas, spa, link);
+   return (0);
+}
+
 static ACPI_STATUS
 nvdimm_root_create_dev(ACPI_HANDLE handle, UINT32 nesting_level, void *context,
 void **return_value)
@@ -276,6 +301,7 @@ nvdimm_root_attach(device_t dev)
 {
ACPI_HANDLE handle;
ACPI_STATUS status;
+   ACPI_TABLE_NFIT *nfitbl;
int error;
 
handle = acpi_get_handle(dev);
@@ -284,15 +310,33 @@ nvdimm_root_attach(device_t dev)
if (ACPI_FAILURE(status))
device_printf(dev, "failed adding children\n");
error = bus_generic_attach(dev);
+   if (error != 0)
+   return (error);
+   status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl);
+   if (ACPI_FAILURE(status)) {
+   device_printf(dev, "cannot get NFIT\n");
+   return (ENXIO);
+   }
+   error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS,
+   nvdimm_root_create_spa, device_get_softc(dev));
+   AcpiPutTable(&nfitbl->Header);
return (error);
 }
 
 static int
 nvdimm_root_detach(device_t dev)
 {
+   struct nvdimm_root_dev *root;
+   struct SPA_mapping *spa, *next;
device_t *children;
int i, error, num_children;
 
+   root = device_get_softc(dev);
+   SLIST_FOREACH_SAFE(spa, &root->spas, link, next) {
+   nvdimm_spa_fini(spa);
+   SLIST_REMOVE_HEAD(&root->spas, link);
+   free(spa, M_NVDIMM);
+   }
error = bus_generic_detach(dev);
if (error != 0)
return (error);
@@ -356,6 +400,7 @@ static device_method_t nvdimm_root_methods[] = {
 static driver_tnvdimm_root_driver = {
"nvdimm_root",
nvdimm_root_methods,
+   sizeof(struct nvdimm_root_dev),
 };
 
 DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, 
NULL,

Modified: head/sys/dev/nvdimm/nvdimm_spa.c
==
--- head/sys/dev/nvdimm/nvdimm_spa.cThu Jan 31 22:37:28 2019
(r343627)
+++ head/sys/dev/nvdimm/nvdimm_spa.cThu Jan 31 22:43:20 2019
(r343628)
@@ -82,19 +82,6 @@ __FBSDID("$FreeBSD$");
 #define UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD \
 {0x08018188,0x42cd,0xbb48,0x10,0x0f,{0x53,0x87,0xd5,0x3d,0xed,0x3d}}
 
-struct SPA_mapping *spa_mappings;
-int spa_mappings_cnt;
-
-static int
-nvdimm_spa_count(void *nfitsubtbl __unused, void *arg)
-{
-   int *cnt;
-
-   cnt = arg;
-   (*cnt)++;
-   return (0);
-}
-
 static struct nvdimm_SPA_uuid_list_elm {
const char  *u_name;
struct uuid u_id;
@@ -419,22 +406,17 @@ nvdimm_spa_g_access(struct g_provider *pp, int r, int 
return (0);
 }
 
-static g_init_t nvdimm_spa_g_init;
-static g_fini_t nvdimm_spa_g_fini;
-
 struct g_class nvdimm_spa_g_class = {
.name = "SPA",
.version =  G_VERSION,
.start =nvdimm_spa_g_start,
.access =   nvdimm_spa_g_access,
-   .init = nvdimm_spa_g_init,
-   .fini = nvdimm_spa_g_fini,
 };
 DECLARE_GEOM_CLASS(nvdimm_spa_g_class, g_spa);
 
-static int
-n

svn commit: r343629 - in head/sys: dev/nvdimm modules/nvdimm

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jan 31 22:47:04 2019
New Revision: 343629
URL: https://svnweb.freebsd.org/changeset/base/343629

Log:
  nvdimm: only enumerate present nvdimm devices
  
  Not all child devices of the NVDIMM root device represent DIMM devices
  which are present in the system. The spec says (ACPI 6.2, sec 9.20.2):
  
  For each NVDIMM present or intended to be supported by platform,
  platform firmware also exposes an NVDIMM device ... under the
  NVDIMM root device.
  
  Present NVDIMM devices are found by walking all of the NFIT table's
  SPA ranges, then walking the NVDIMM regions mentioned by those SPA
  ranges.
  
  A set of NFIT walking helper functions are introduced to avoid the
  need to splat the enumeration logic across several disparate
  callbacks.
  
  Submitted by: D Scott Phillips 
  Sponsored by: Intel Corporation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D18439

Added:
  head/sys/dev/nvdimm/nvdimm_nfit.c   (contents, props changed)
Modified:
  head/sys/dev/nvdimm/nvdimm.c
  head/sys/dev/nvdimm/nvdimm_var.h
  head/sys/modules/nvdimm/Makefile

Modified: head/sys/dev/nvdimm/nvdimm.c
==
--- head/sys/dev/nvdimm/nvdimm.cThu Jan 31 22:43:20 2019
(r343628)
+++ head/sys/dev/nvdimm/nvdimm.cThu Jan 31 22:47:04 2019
(r343629)
@@ -77,99 +77,6 @@ nvdimm_find_by_handle(nfit_handle_t nv_handle)
 }
 
 static int
-nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg)
-{
-   ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr;
-   struct nvdimm_dev *nv;
-   int i;
-
-   nfitflshaddr = nfitsubtbl;
-   nv = arg;
-   if (nfitflshaddr->DeviceHandle != nv->nv_handle)
-   return (0);
-
-   MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0);
-   nv->nv_flush_addr = mallocarray(nfitflshaddr->HintCount,
-   sizeof(uint64_t *), M_NVDIMM, M_WAITOK);
-   for (i = 0; i < nfitflshaddr->HintCount; i++)
-   nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i];
-   nv->nv_flush_addr_cnt = nfitflshaddr->HintCount;
-   return (0);
-}
-
-int
-nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type,
-int (*cb)(void *, void *), void *arg)
-{
-   ACPI_NFIT_HEADER *nfithdr;
-   ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr;
-   ACPI_NFIT_MEMORY_MAP *nfitmap;
-   ACPI_NFIT_INTERLEAVE *nfitintrl;
-   ACPI_NFIT_SMBIOS *nfitsmbios;
-   ACPI_NFIT_CONTROL_REGION *nfitctlreg;
-   ACPI_NFIT_DATA_REGION *nfitdtreg;
-   ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr;
-   char *ptr;
-   int error;
-
-   error = 0;
-   for (ptr = (char *)(nfitbl + 1);
-   ptr < (char *)nfitbl + nfitbl->Header.Length;
-   ptr += nfithdr->Length) {
-   nfithdr = (ACPI_NFIT_HEADER *)ptr;
-   if (nfithdr->Type != type)
-   continue;
-   switch (nfithdr->Type) {
-   case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
-   nfitaddr = __containerof(nfithdr,
-   ACPI_NFIT_SYSTEM_ADDRESS, Header);
-   error = cb(nfitaddr, arg);
-   break;
-   case ACPI_NFIT_TYPE_MEMORY_MAP:
-   nfitmap = __containerof(nfithdr,
-   ACPI_NFIT_MEMORY_MAP, Header);
-   error = cb(nfitmap, arg);
-   break;
-   case ACPI_NFIT_TYPE_INTERLEAVE:
-   nfitintrl = __containerof(nfithdr,
-   ACPI_NFIT_INTERLEAVE, Header);
-   error = cb(nfitintrl, arg);
-   break;
-   case ACPI_NFIT_TYPE_SMBIOS:
-   nfitsmbios = __containerof(nfithdr,
-   ACPI_NFIT_SMBIOS, Header);
-   error = cb(nfitsmbios, arg);
-   break;
-   case ACPI_NFIT_TYPE_CONTROL_REGION:
-   nfitctlreg = __containerof(nfithdr,
-   ACPI_NFIT_CONTROL_REGION, Header);
-   error = cb(nfitctlreg, arg);
-   break;
-   case ACPI_NFIT_TYPE_DATA_REGION:
-   nfitdtreg = __containerof(nfithdr,
-   ACPI_NFIT_DATA_REGION, Header);
-   error = cb(nfitdtreg, arg);
-   break;
-   case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-   nfitflshaddr = __containerof(nfithdr,
-   ACPI_NFIT_FLUSH_ADDRESS, Header);
-   error = cb(nfitflshaddr, arg);
-   break;
-   case ACPI_NFIT_TYPE_RESERVED:
-   default:
-   if (bootverbose)
-   printf("NFIT subtype %d unknown\n",
-   nf

svn commit: r343630 - in head/sys: kern sys

2019-01-31 Thread Brooks Davis
Author: brooks
Date: Thu Jan 31 22:58:17 2019
New Revision: 343630
URL: https://svnweb.freebsd.org/changeset/base/343630

Log:
  Regen after r342190.
  
  Differential Revision:https://reviews.freebsd.org/D18444

Modified:
  head/sys/kern/systrace_args.c
  head/sys/sys/sysproto.h

Modified: head/sys/kern/systrace_args.c
==
--- head/sys/kern/systrace_args.c   Thu Jan 31 22:47:04 2019
(r343629)
+++ head/sys/kern/systrace_args.c   Thu Jan 31 22:58:17 2019
(r343630)
@@ -972,7 +972,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
uarg[1] = p->namelen; /* u_int */
uarg[2] = (intptr_t) p->old; /* void * */
uarg[3] = (intptr_t) p->oldlenp; /* size_t * */
-   uarg[4] = (intptr_t) p->new; /* void * */
+   uarg[4] = (intptr_t) p->new; /* const void * */
uarg[5] = p->newlen; /* size_t */
*n_args = 6;
break;
@@ -4867,7 +4867,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "userland size_t *";
break;
case 4:
-   p = "userland void *";
+   p = "userland const void *";
break;
case 5:
p = "size_t";

Modified: head/sys/sys/sysproto.h
==
--- head/sys/sys/sysproto.h Thu Jan 31 22:47:04 2019(r343629)
+++ head/sys/sys/sysproto.h Thu Jan 31 22:58:17 2019(r343630)
@@ -560,7 +560,7 @@ struct sysctl_args {
char namelen_l_[PADL_(u_int)]; u_int namelen; char 
namelen_r_[PADR_(u_int)];
char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)];
char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char 
oldlenp_r_[PADR_(size_t *)];
-   char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)];
+   char new_l_[PADL_(const void *)]; const void * new; char 
new_r_[PADR_(const void *)];
char newlen_l_[PADL_(size_t)]; size_t newlen; char 
newlen_r_[PADR_(size_t)];
 };
 struct mlock_args {
___
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: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 31 23:01:03 2019
New Revision: 343631
URL: https://svnweb.freebsd.org/changeset/base/343631

Log:
  New pfil(9) KPI together with newborn pfil API and control utility.
  
  The KPI have been reviewed and cleansed of features that were planned
  back 20 years ago and never implemented.  The pfil(9) internals have
  been made opaque to protocols with only returned types and function
  declarations exposed. The KPI is made more strict, but at the same time
  more extensible, as kernel uses same command structures that userland
  ioctl uses.
  
  In nutshell [KA]PI is about declaring filtering points, declaring
  filters and linking and unlinking them together.
  
  New [KA]PI makes it possible to reconfigure pfil(9) configuration:
  change order of hooks, rehook filter from one filtering point to a
  different one, disconnect a hook on output leaving it on input only,
  prepend/append a filter to existing list of filters.
  
  Now it possible for a single packet filter to provide multiple rulesets
  that may be linked to different points. Think of per-interface ACLs in
  Cisco or Juniper. None of existing packet filters yet support that,
  however limited usage is already possible, e.g. default ruleset can
  be moved to single interface, as soon as interface would pride their
  filtering points.
  
  Another future feature is possiblity to create pfil heads, that provide
  not an mbuf pointer but just a memory pointer with length. That would
  allow filtering at very early stages of a packet lifecycle, e.g. when
  packet has just been received by a NIC and no mbuf was yet allocated.
  
  Differential Revision:https://reviews.freebsd.org/D18951

Added:
  head/sbin/pfilctl/
  head/sbin/pfilctl/Makefile   (contents, props changed)
  head/sbin/pfilctl/pfilctl.8   (contents, props changed)
  head/sbin/pfilctl/pfilctl.c   (contents, props changed)
Modified:
  head/ObsoleteFiles.inc
  head/sbin/Makefile
  head/share/man/man9/Makefile
  head/share/man/man9/pfil.9
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  head/sys/net/if_bridge.c
  head/sys/net/if_enc.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_var.h
  head/sys/net/pfil.c
  head/sys/net/pfil.h
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/ip_var.h
  head/sys/netinet/siftr.c
  head/sys/netinet6/ip6_fastfwd.c
  head/sys/netinet6/ip6_forward.c
  head/sys/netinet6/ip6_input.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/ip6_var.h
  head/sys/netpfil/ipfw/ip_fw_eaction.c
  head/sys/netpfil/ipfw/ip_fw_pfil.c
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Jan 31 22:58:17 2019(r343630)
+++ head/ObsoleteFiles.inc  Thu Jan 31 23:01:03 2019(r343631)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190131: pfil(9) changed
+OLD_FILES+=usr/share/man/man9/pfil_hook_get.9
+OLD_FILES+=usr/share/man/man9/pfil_rlock.9
+OLD_FILES+=usr/share/man/man9/pfil_runlock.9
+OLD_FILES+=usr/share/man/man9/pfil_wlock.9
+OLD_FILES+=usr/share/man/man9/pfil_wunlock.9
 # 20190126: adv(4) / adw(4) removal
 OLD_FILES+=usr/share/man/man4/adv.4.gz
 OLD_FILES+=usr/share/man/man4/adw.4.gz

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Thu Jan 31 22:58:17 2019(r343630)
+++ head/sbin/Makefile  Thu Jan 31 23:01:03 2019(r343631)
@@ -52,6 +52,7 @@ SUBDIR=adjkerntz \
newfs_msdos \
nfsiod \
nos-tun \
+   pfilctl \
ping \
rcorder \
reboot \

Added: head/sbin/pfilctl/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/pfilctl/Makefile  Thu Jan 31 23:01:03 2019(r343631)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+PROG=  pfilctl
+SRCS=  pfilctl.c
+WARNS?=6
+
+MAN=   pfilctl.8
+
+.include 

Added: head/sbin/pfilctl/pfilctl.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/pfilctl/pfilctl.8 Thu Jan 31 23:01:03 2019(r343631)
@@ -0,0 +1,117 @@
+.\" Copyright (c) 2019 Gleb Smirnoff 
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided

svn commit: r343632 - head/sys/kern

2019-01-31 Thread Brooks Davis
Author: brooks
Date: Thu Jan 31 23:01:12 2019
New Revision: 343632
URL: https://svnweb.freebsd.org/changeset/base/343632

Log:
  Remove iBCS2: also remove xenix syscall function support.
  
  Missed in r342243.

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Thu Jan 31 23:01:03 2019
(r343631)
+++ head/sys/kern/makesyscalls.sh   Thu Jan 31 23:01:12 2019
(r343632)
@@ -526,8 +526,7 @@ sed -e '
if (!flag("NOPROTO") && !flag("NODEF")) {
if (funcname == "nosys" || funcname == "lkmnosys" ||
funcname == "sysarch" || funcname ~ /^freebsd/ || 
-   funcname ~ /^linux/ || funcname ~ /^xenix/ ||
-   funcname ~ /^cloudabi/) {
+   funcname ~ /^linux/ || funcname ~ /^cloudabi/) {
printf("%s\t%s(struct thread *, struct %s *)",
rettype, funcname, argalias) > sysdcl
} else {
@@ -546,8 +545,7 @@ sed -e '
} else {
if (funcname == "nosys" || funcname == "sysarch" || 
funcname == "lkmnosys" || funcname ~ /^freebsd/ ||
-   funcname ~ /^linux/ || funcname ~ /^xenix/ ||
-   funcname ~ /^cloudabi/) {
+   funcname ~ /^linux/ || funcname ~ /^cloudabi/) {
printf("%s, %s, NULL, 0, 0, %s, %s },", 
funcname, auditev, flags, thr_flag) > sysent
column = column + length(funcname) + 
length(auditev) + length(flags) + 3 
} else {
___
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: r343630 - in head/sys: kern sys

2019-01-31 Thread Brooks Davis
On Thu, Jan 31, 2019 at 10:58:17PM +, Brooks Davis wrote:
> Author: brooks
> Date: Thu Jan 31 22:58:17 2019
> New Revision: 343630
> URL: https://svnweb.freebsd.org/changeset/base/343630
> 
> Log:
>   Regen after r342190.

Yes, that was a while ago...  I can only assume I was interrupted and
forgot to get back to it.  Fortunately, no functional change and testing
was against a tree with the files regenerated.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r343630 - in head/sys: kern sys

2019-01-31 Thread Bryan Drewery
On 1/31/19 3:04 PM, Brooks Davis wrote:
> On Thu, Jan 31, 2019 at 10:58:17PM +, Brooks Davis wrote:
>> Author: brooks
>> Date: Thu Jan 31 22:58:17 2019
>> New Revision: 343630
>> URL: https://svnweb.freebsd.org/changeset/base/343630
>>
>> Log:
>>   Regen after r342190.
> 
> Yes, that was a while ago...  I can only assume I was interrupted and
> forgot to get back to it.  Fortunately, no functional change and testing
> was against a tree with the files regenerated.
> 
> -- Brooks
> 

I've been needing to get involved again. I'll start thinking about and
tackling generating these during the build soon.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r343633 - head/usr.bin/shar

2019-01-31 Thread Bryan Drewery
Author: bdrewery
Date: Thu Jan 31 23:21:18 2019
New Revision: 343633
URL: https://svnweb.freebsd.org/changeset/base/343633

Log:
  Shar files may be seen as binary by grep.
  
  Suggest using -a to egrep to properly see executed commands.
  
  This is a minor improvement to the manpage.  A better improvement
  would be removal or gigantic warnings.
  
  Sponsored by: Dell EMC
  MFC after:1 week

Modified:
  head/usr.bin/shar/shar.1

Modified: head/usr.bin/shar/shar.1
==
--- head/usr.bin/shar/shar.1Thu Jan 31 23:01:12 2019(r343632)
+++ head/usr.bin/shar/shar.1Thu Jan 31 23:21:18 2019(r343633)
@@ -28,7 +28,7 @@
 .\" @(#)shar.1 8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd June 6, 1993
+.Dd January 31, 2019
 .Dt SHAR 1
 .Os
 .Sh NAME
@@ -103,5 +103,5 @@ Archives produced using this implementation of
 .Nm
 may be easily examined with the command:
 .Bd -literal -offset indent
-egrep -v '^[X#]' shar.file
+egrep -av '^[X#]' shar.file
 .Ed
___
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: r343633 - head/usr.bin/shar

2019-01-31 Thread Bryan Drewery
On 1/31/19 3:21 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Thu Jan 31 23:21:18 2019
> New Revision: 343633
> URL: https://svnweb.freebsd.org/changeset/base/343633
> 
> Log:
>   Shar files may be seen as binary by grep.
>   
>   Suggest using -a to egrep to properly see executed commands.
>   
>   This is a minor improvement to the manpage.  A better improvement
>   would be removal or gigantic warnings.

I dare someone to remove this utility.
There may still be documentation suggesting its use somewhere due to
pre-bugzilla days but now we can do proper binary attachments I believe.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Author: araujo
Date: Thu Jan 31 23:32:19 2019
New Revision: 343634
URL: https://svnweb.freebsd.org/changeset/base/343634

Log:
  Mostly a cosmetic change to replace strlen with strnlen.
  
  Obtained from:Project ACRN
  MFC after:2 weeks

Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/smbiostbl.c
  head/usr.sbin/bhyve/usb_mouse.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Thu Jan 31 23:21:18 2019
(r343633)
+++ head/usr.sbin/bhyve/bhyverun.c  Thu Jan 31 23:32:19 2019
(r343634)
@@ -233,8 +233,8 @@ usage(int code)
"   -W: force virtio to use single-vector MSI\n"
"   -x: local apic is in x2APIC mode\n"
"   -Y: disable MPtable generation\n",
-   progname, (int)strlen(progname), "", (int)strlen(progname), "",
-   (int)strlen(progname), "");
+   progname, (int)strnlen(progname, PATH_MAX), "", 
(int)strnlen(progname, PATH_MAX), "",
+   (int)strnlen(progname, PATH_MAX), "");
 
exit(code);
 }

Modified: head/usr.sbin/bhyve/smbiostbl.c
==
--- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019
(r343633)
+++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019
(r343634)
@@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te
int len;
 
string = template_strings[i];
-   len = strlen(string) + 1;
+   len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
memcpy(curaddr, string, len);
curaddr += len;
}
@@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp
return (-1);
 
MD5Init(&mdctx);
-   MD5Update(&mdctx, vmname, strlen(vmname));
+   MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
MD5Update(&mdctx, hostname, sizeof(hostname));
MD5Final(digest, &mdctx);
 

Modified: head/usr.sbin/bhyve/usb_mouse.c
==
--- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019
(r343633)
+++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019
(r343634)
@@ -70,6 +70,7 @@ enum {
UMSTR_MAX
 };
 
+#define UMOUSE_DESC_MAX_LEN32
 static const char *umouse_desc_strings[] = {
"\x04\x09",
"BHYVE",
@@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer
goto done;
}
 
-   slen = 2 + strlen(str) * 2;
+   slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
udata[0] = slen;
udata[1] = UDESC_STRING;
 
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Konstantin Belousov
On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> Author: araujo
> Date: Thu Jan 31 23:32:19 2019
> New Revision: 343634
> URL: https://svnweb.freebsd.org/changeset/base/343634
> 
> Log:
>   Mostly a cosmetic change to replace strlen with strnlen.
This is not cosmetic, and more, for instance the usage() part of the change
does not make any sense to me.

>   
>   Obtained from:  Project ACRN
>   MFC after:  2 weeks
> 
> Modified:
>   head/usr.sbin/bhyve/bhyverun.c
>   head/usr.sbin/bhyve/smbiostbl.c
>   head/usr.sbin/bhyve/usb_mouse.c
> 
> Modified: head/usr.sbin/bhyve/bhyverun.c
> ==
> --- head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:21:18 2019
> (r343633)
> +++ head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:32:19 2019
> (r343634)
> @@ -233,8 +233,8 @@ usage(int code)
>   "   -W: force virtio to use single-vector MSI\n"
>   "   -x: local apic is in x2APIC mode\n"
>   "   -Y: disable MPtable generation\n",
> - progname, (int)strlen(progname), "", (int)strlen(progname), "",
> - (int)strlen(progname), "");
> + progname, (int)strnlen(progname, PATH_MAX), "", 
> (int)strnlen(progname, PATH_MAX), "",
> + (int)strnlen(progname, PATH_MAX), "");
>  
>   exit(code);
>  }
> 
> Modified: head/usr.sbin/bhyve/smbiostbl.c
> ==
> --- head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:21:18 2019
> (r343633)
> +++ head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:32:19 2019
> (r343634)
> @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te
>   int len;
>  
>   string = template_strings[i];
> - len = strlen(string) + 1;
> + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
>   memcpy(curaddr, string, len);
>   curaddr += len;
>   }
> @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp
>   return (-1);
>  
>   MD5Init(&mdctx);
> - MD5Update(&mdctx, vmname, strlen(vmname));
> + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
>   MD5Update(&mdctx, hostname, sizeof(hostname));
>   MD5Final(digest, &mdctx);
>  
> 
> Modified: head/usr.sbin/bhyve/usb_mouse.c
> ==
> --- head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:21:18 2019
> (r343633)
> +++ head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:32:19 2019
> (r343634)
> @@ -70,6 +70,7 @@ enum {
>   UMSTR_MAX
>  };
>  
> +#define UMOUSE_DESC_MAX_LEN  32
>  static const char *umouse_desc_strings[] = {
>   "\x04\x09",
>   "BHYVE",
> @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer
>   goto done;
>   }
>  
> - slen = 2 + strlen(str) * 2;
> + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
>   udata[0] = slen;
>   udata[1] = UDESC_STRING;
>  
___
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: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf

2019-01-31 Thread Bryan Drewery
On 1/31/19 3:01 PM, Gleb Smirnoff wrote:
> Author: glebius
> Date: Thu Jan 31 23:01:03 2019
> New Revision: 343631
> URL: https://svnweb.freebsd.org/changeset/base/343631
> 
> Log:
>   New pfil(9) KPI together with newborn pfil API and control utility.
>   
>   The KPI have been reviewed and cleansed of features that were planned
>   back 20 years ago and never implemented.  The pfil(9) internals have
>   been made opaque to protocols with only returned types and function
>   declarations exposed. The KPI is made more strict, but at the same time
>   more extensible, as kernel uses same command structures that userland
>   ioctl uses.
>   
>   In nutshell [KA]PI is about declaring filtering points, declaring
>   filters and linking and unlinking them together.
>   
>   New [KA]PI makes it possible to reconfigure pfil(9) configuration:
>   change order of hooks, rehook filter from one filtering point to a
>   different one, disconnect a hook on output leaving it on input only,
>   prepend/append a filter to existing list of filters.
>   
>   Now it possible for a single packet filter to provide multiple rulesets
>   that may be linked to different points. Think of per-interface ACLs in
>   Cisco or Juniper. None of existing packet filters yet support that,
>   however limited usage is already possible, e.g. default ruleset can
>   be moved to single interface, as soon as interface would pride their
>   filtering points.
>   
>   Another future feature is possiblity to create pfil heads, that provide
>   not an mbuf pointer but just a memory pointer with length. That would
>   allow filtering at very early stages of a packet lifecycle, e.g. when
>   packet has just been received by a NIC and no mbuf was yet allocated.
>   
>   Differential Revision:  https://reviews.freebsd.org/D18951
> 
> Added:
>   head/sbin/pfilctl/
>   head/sbin/pfilctl/Makefile   (contents, props changed)
>   head/sbin/pfilctl/pfilctl.8   (contents, props changed)
>   head/sbin/pfilctl/pfilctl.c   (contents, props changed)
> Modified:
>   head/ObsoleteFiles.inc
>   head/sbin/Makefile
>   head/share/man/man9/Makefile
>   head/share/man/man9/pfil.9
>   head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
>   head/sys/net/if_bridge.c
>   head/sys/net/if_enc.c
>   head/sys/net/if_ethersubr.c
>   head/sys/net/if_var.h
>   head/sys/net/pfil.c
>   head/sys/net/pfil.h
>   head/sys/netinet/ip_fastfwd.c
>   head/sys/netinet/ip_input.c
>   head/sys/netinet/ip_output.c
>   head/sys/netinet/ip_var.h
>   head/sys/netinet/siftr.c
>   head/sys/netinet6/ip6_fastfwd.c
>   head/sys/netinet6/ip6_forward.c
>   head/sys/netinet6/ip6_input.c
>   head/sys/netinet6/ip6_output.c
>   head/sys/netinet6/ip6_var.h
>   head/sys/netpfil/ipfw/ip_fw_eaction.c
>   head/sys/netpfil/ipfw/ip_fw_pfil.c
>   head/sys/netpfil/pf/pf_ioctl.c

This breaks the build.

https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/9220/console

> 23:28:54 cc1: warnings being treated as errors
> 23:28:54 /usr/src/sbin/pfilctl/pfilctl.c: In function 'help':
> 23:28:54 /usr/src/sbin/pfilctl/pfilctl.c:97: warning: nested extern 
> declaration of '__progname'
> 23:28:54 --- all_subdir_lib ---
> 23:28:54 --- clog.3.gz ---
> 23:28:54 gzip -cn /usr/src/lib/msun/man/clog.3 > clog.3.gz
> 23:28:54 --- all_subdir_sbin ---
> 23:28:54 *** [pfilctl.o] Error code 1
> 23:28:54 
> 23:28:54 make[4]: stopped in /usr/src/sbin/pfilctl


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r343633 - head/usr.bin/shar

2019-01-31 Thread Shawn Webb
On Thu, Jan 31, 2019 at 03:29:03PM -0800, Bryan Drewery wrote:
> On 1/31/19 3:21 PM, Bryan Drewery wrote:
> > Author: bdrewery
> > Date: Thu Jan 31 23:21:18 2019
> > New Revision: 343633
> > URL: https://svnweb.freebsd.org/changeset/base/343633
> > 
> > Log:
> >   Shar files may be seen as binary by grep.
> >   
> >   Suggest using -a to egrep to properly see executed commands.
> >   
> >   This is a minor improvement to the manpage.  A better improvement
> >   would be removal or gigantic warnings.
> 
> I dare someone to remove this utility.
> There may still be documentation suggesting its use somewhere due to
> pre-bugzilla days but now we can do proper binary attachments I believe.

The recommended way to submit a new port is with a shar:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-submitting.html

:D

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r343635 - head/sys/netpfil/ipfw

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Fri Feb  1 00:33:17 2019
New Revision: 343635
URL: https://svnweb.freebsd.org/changeset/base/343635

Log:
  Fix build without INET6.

Modified:
  head/sys/netpfil/ipfw/ip_fw_pfil.c

Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c
==
--- head/sys/netpfil/ipfw/ip_fw_pfil.c  Thu Jan 31 23:32:19 2019
(r343634)
+++ head/sys/netpfil/ipfw/ip_fw_pfil.c  Fri Feb  1 00:33:17 2019
(r343635)
@@ -533,10 +533,12 @@ ipfw_divert(struct mbuf **m0, int incoming, struct ipf
  * attach or detach hooks for a given protocol family
  */
 VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet_hook);
-VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet6_hook);
-VNET_DEFINE_STATIC(pfil_hook_t, ipfw_link_hook);
 #defineV_ipfw_inet_hookVNET(ipfw_inet_hook)
+#ifdef INET6
+VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet6_hook);
 #defineV_ipfw_inet6_hook   VNET(ipfw_inet6_hook)
+#endif
+VNET_DEFINE_STATIC(pfil_hook_t, ipfw_link_hook);
 #defineV_ipfw_link_hookVNET(ipfw_link_hook)
 
 static 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: r343636 - head/sbin/pfilctl

2019-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Fri Feb  1 00:34:18 2019
New Revision: 343636
URL: https://svnweb.freebsd.org/changeset/base/343636

Log:
  Hopefully fix compilation by other compilers.

Modified:
  head/sbin/pfilctl/pfilctl.c

Modified: head/sbin/pfilctl/pfilctl.c
==
--- head/sbin/pfilctl/pfilctl.c Fri Feb  1 00:33:17 2019(r343635)
+++ head/sbin/pfilctl/pfilctl.c Fri Feb  1 00:34:18 2019(r343636)
@@ -94,9 +94,8 @@ main(int argc __unused, char *argv[] __unused)
 static void
 help(void)
 {
-   extern char *__progname;
 
-   fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", __progname);
+   fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", getprogname());
exit(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: r343637 - in stable/12/sys/x86: include x86

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Fri Feb  1 00:36:14 2019
New Revision: 343637
URL: https://svnweb.freebsd.org/changeset/base/343637

Log:
  MFC r343146:
  x86 busdma: fix mis-use of bus_addr_t where vm_paddr_t is assumed.

Modified:
  stable/12/sys/x86/include/busdma_impl.h
  stable/12/sys/x86/x86/busdma_bounce.c
  stable/12/sys/x86/x86/busdma_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/x86/include/busdma_impl.h
==
--- stable/12/sys/x86/include/busdma_impl.h Fri Feb  1 00:34:18 2019
(r343636)
+++ stable/12/sys/x86/include/busdma_impl.h Fri Feb  1 00:36:14 2019
(r343637)
@@ -87,7 +87,7 @@ struct bus_dma_impl {
 };
 
 void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op);
-int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr);
+int bus_dma_run_filter(struct bus_dma_tag_common *dmat, vm_paddr_t paddr);
 int common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
 bus_size_t alignment,
 bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,

Modified: stable/12/sys/x86/x86/busdma_bounce.c
==
--- stable/12/sys/x86/x86/busdma_bounce.c   Fri Feb  1 00:34:18 2019
(r343636)
+++ stable/12/sys/x86/x86/busdma_bounce.c   Fri Feb  1 00:36:14 2019
(r343637)
@@ -139,7 +139,7 @@ static int alloc_bounce_pages(bus_dma_tag_t dmat, u_in
 static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
 int commit);
 static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
-vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size);
+vm_offset_t vaddr, vm_paddr_t addr1, vm_paddr_t addr2, bus_size_t size);
 static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
 static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
 pmap_t pmap, void *buf, bus_size_t buflen, int flags);
@@ -507,7 +507,7 @@ static void
 _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf,
 bus_size_t buflen, int flags)
 {
-   bus_addr_t curaddr;
+   vm_paddr_t curaddr;
bus_size_t sgsize;
 
if (map != &nobounce_dmamap && map->pagesneeded == 0) {
@@ -536,7 +536,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap
 {
vm_offset_t vaddr;
vm_offset_t vendaddr;
-   bus_addr_t paddr;
+   vm_paddr_t paddr;
bus_size_t sg_len;
 
if (map != &nobounce_dmamap && map->pagesneeded == 0) {
@@ -643,12 +643,19 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam
  * Add a single contiguous physical range to the segment list.
  */
 static int
-_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
+_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t curaddr,
 bus_size_t sgsize, bus_dma_segment_t *segs, int *segp)
 {
bus_addr_t baddr, bmask;
int seg;
 
+   KASSERT(curaddr <= BUS_SPACE_MAXADDR,
+   ("ds_addr %#jx > BUS_SPACE_MAXADDR %#jx; dmat %p fl %#x low %#jx "
+   "hi %#jx",
+   (uintmax_t)curaddr, (uintmax_t)BUS_SPACE_MAXADDR,
+   dmat, dmat->bounce_flags, (uintmax_t)dmat->common.lowaddr,
+   (uintmax_t)dmat->common.highaddr));
+
/*
 * Make sure we don't cross any boundaries.
 */
@@ -695,7 +702,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dm
 int *segp)
 {
bus_size_t sgsize;
-   bus_addr_t curaddr;
+   vm_paddr_t curaddr;
int error;
 
if (map == NULL)
@@ -747,7 +754,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_
 int *segp)
 {
bus_size_t sgsize, max_sgsize;
-   bus_addr_t curaddr;
+   vm_paddr_t curaddr;
vm_offset_t kvaddr, vaddr;
int error;
 
@@ -1194,7 +1201,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t 
 
 static bus_addr_t
 add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
-bus_addr_t addr1, bus_addr_t addr2, bus_size_t size)
+vm_paddr_t addr1, vm_paddr_t addr2, bus_size_t size)
 {
struct bounce_zone *bz;
struct bounce_page *bpage;

Modified: stable/12/sys/x86/x86/busdma_machdep.c
==
--- stable/12/sys/x86/x86/busdma_machdep.c  Fri Feb  1 00:34:18 2019
(r343636)
+++ stable/12/sys/x86/x86/busdma_machdep.c  Fri Feb  1 00:36:14 2019
(r343637)
@@ -99,14 +99,15 @@ bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op)
  * to check for a match, if there is no filter callback then assume a match.
  */
 int
-bus_dma_run_filter(struct bus_dma_tag_common *tc, bus_addr_t paddr)
+bus_dma_run_filter(struct bus_dma_tag_common *tc, vm_paddr_t paddr)
 {
int retval;
 
retval = 0;
do {
-   if (((paddr > tc->lowaddr && paddr <= tc

Re: svn commit: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Warner Losh
On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov  On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> > Author: araujo
> > Date: Thu Jan 31 23:32:19 2019
> > New Revision: 343634
> > URL: https://svnweb.freebsd.org/changeset/base/343634
> >
> > Log:
> >   Mostly a cosmetic change to replace strlen with strnlen.
> This is not cosmetic, and more, for instance the usage() part of the change
> does not make any sense to me.
>

I specifically objected as well and was blown off. What gives?

Warner

>
> >   Obtained from:  Project ACRN
> >   MFC after:  2 weeks
> >
> > Modified:
> >   head/usr.sbin/bhyve/bhyverun.c
> >   head/usr.sbin/bhyve/smbiostbl.c
> >   head/usr.sbin/bhyve/usb_mouse.c
> >
> > Modified: head/usr.sbin/bhyve/bhyverun.c
> >
> ==
> > --- head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:21:18 2019
> (r343633)
> > +++ head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:32:19 2019
> (r343634)
> > @@ -233,8 +233,8 @@ usage(int code)
> >   "   -W: force virtio to use single-vector MSI\n"
> >   "   -x: local apic is in x2APIC mode\n"
> >   "   -Y: disable MPtable generation\n",
> > - progname, (int)strlen(progname), "",
> (int)strlen(progname), "",
> > - (int)strlen(progname), "");
> > + progname, (int)strnlen(progname, PATH_MAX), "",
> (int)strnlen(progname, PATH_MAX), "",
> > + (int)strnlen(progname, PATH_MAX), "");
> >
> >   exit(code);
> >  }
> >
> > Modified: head/usr.sbin/bhyve/smbiostbl.c
> >
> ==
> > --- head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:21:18 2019
> (r343633)
> > +++ head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:32:19 2019
> (r343634)
> > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure
> *te
> >   int len;
> >
> >   string = template_strings[i];
> > - len = strlen(string) + 1;
> > + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
> >   memcpy(curaddr, string, len);
> >   curaddr += len;
> >   }
> > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure
> *temp
> >   return (-1);
> >
> >   MD5Init(&mdctx);
> > - MD5Update(&mdctx, vmname, strlen(vmname));
> > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
> >   MD5Update(&mdctx, hostname, sizeof(hostname));
> >   MD5Final(digest, &mdctx);
> >
> >
> > Modified: head/usr.sbin/bhyve/usb_mouse.c
> >
> ==
> > --- head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:21:18 2019
> (r343633)
> > +++ head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:32:19 2019
> (r343634)
> > @@ -70,6 +70,7 @@ enum {
> >   UMSTR_MAX
> >  };
> >
> > +#define UMOUSE_DESC_MAX_LEN  32
> >  static const char *umouse_desc_strings[] = {
> >   "\x04\x09",
> >   "BHYVE",
> > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer
> *xfer
> >   goto done;
> >   }
> >
> > - slen = 2 + strlen(str) * 2;
> > + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
> >   udata[0] = slen;
> >   udata[1] = UDESC_STRING;
> >
>
>
___
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: r343638 - stable/12/sys/x86/x86

2019-01-31 Thread Konstantin Belousov
Author: kib
Date: Fri Feb  1 00:37:55 2019
New Revision: 343638
URL: https://svnweb.freebsd.org/changeset/base/343638

Log:
  MFC r343147:
  i386/PAE busdma: allow more bounce pages.

Modified:
  stable/12/sys/x86/x86/busdma_bounce.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/x86/x86/busdma_bounce.c
==
--- stable/12/sys/x86/x86/busdma_bounce.c   Fri Feb  1 00:36:14 2019
(r343637)
+++ stable/12/sys/x86/x86/busdma_bounce.c   Fri Feb  1 00:37:55 2019
(r343638)
@@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #ifdef __i386__
-#define MAX_BPAGES 512
+#define MAX_BPAGES (Maxmem > atop(0x1ULL) ? 8192 : 512)
 #else
 #define MAX_BPAGES 8192
 #endif
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Em sex, 1 de fev de 2019 às 08:36, Warner Losh  escreveu:

>
>
> On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov  wrote:
>
>> On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
>> > Author: araujo
>> > Date: Thu Jan 31 23:32:19 2019
>> > New Revision: 343634
>> > URL: https://svnweb.freebsd.org/changeset/base/343634
>> >
>> > Log:
>> >   Mostly a cosmetic change to replace strlen with strnlen.
>> This is not cosmetic, and more, for instance the usage() part of the
>> change
>> does not make any sense to me.
>>
>
> I specifically objected as well and was blown off. What gives?
>

I have asked you feedback and got none! I will revert the usage() changes
later then.

Best,


>
> Warner
>
> >
>> >   Obtained from:  Project ACRN
>> >   MFC after:  2 weeks
>> >
>> > Modified:
>> >   head/usr.sbin/bhyve/bhyverun.c
>> >   head/usr.sbin/bhyve/smbiostbl.c
>> >   head/usr.sbin/bhyve/usb_mouse.c
>> >
>> > Modified: head/usr.sbin/bhyve/bhyverun.c
>> >
>> ==
>> > --- head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:21:18 2019
>> (r343633)
>> > +++ head/usr.sbin/bhyve/bhyverun.cThu Jan 31 23:32:19 2019
>> (r343634)
>> > @@ -233,8 +233,8 @@ usage(int code)
>> >   "   -W: force virtio to use single-vector MSI\n"
>> >   "   -x: local apic is in x2APIC mode\n"
>> >   "   -Y: disable MPtable generation\n",
>> > - progname, (int)strlen(progname), "",
>> (int)strlen(progname), "",
>> > - (int)strlen(progname), "");
>> > + progname, (int)strnlen(progname, PATH_MAX), "",
>> (int)strnlen(progname, PATH_MAX), "",
>> > + (int)strnlen(progname, PATH_MAX), "");
>> >
>> >   exit(code);
>> >  }
>> >
>> > Modified: head/usr.sbin/bhyve/smbiostbl.c
>> >
>> ==
>> > --- head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:21:18 2019
>> (r343633)
>> > +++ head/usr.sbin/bhyve/smbiostbl.c   Thu Jan 31 23:32:19 2019
>> (r343634)
>> > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure
>> *te
>> >   int len;
>> >
>> >   string = template_strings[i];
>> > - len = strlen(string) + 1;
>> > + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
>> >   memcpy(curaddr, string, len);
>> >   curaddr += len;
>> >   }
>> > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure
>> *temp
>> >   return (-1);
>> >
>> >   MD5Init(&mdctx);
>> > - MD5Update(&mdctx, vmname, strlen(vmname));
>> > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
>> >   MD5Update(&mdctx, hostname, sizeof(hostname));
>> >   MD5Final(digest, &mdctx);
>> >
>> >
>> > Modified: head/usr.sbin/bhyve/usb_mouse.c
>> >
>> ==
>> > --- head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:21:18 2019
>> (r343633)
>> > +++ head/usr.sbin/bhyve/usb_mouse.c   Thu Jan 31 23:32:19 2019
>> (r343634)
>> > @@ -70,6 +70,7 @@ enum {
>> >   UMSTR_MAX
>> >  };
>> >
>> > +#define UMOUSE_DESC_MAX_LEN  32
>> >  static const char *umouse_desc_strings[] = {
>> >   "\x04\x09",
>> >   "BHYVE",
>> > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer
>> *xfer
>> >   goto done;
>> >   }
>> >
>> > - slen = 2 + strlen(str) * 2;
>> > + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
>> >   udata[0] = slen;
>> >   udata[1] = UDESC_STRING;
>> >
>>
>>

-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Konstantin Belousov
On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote:
> Em sex, 1 de fev de 2019 às 08:36, Warner Losh  escreveu:
> 
> >
> >
> > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov  > wrote:
> >
> >> On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> >> > Author: araujo
> >> > Date: Thu Jan 31 23:32:19 2019
> >> > New Revision: 343634
> >> > URL: https://svnweb.freebsd.org/changeset/base/343634
> >> >
> >> > Log:
> >> >   Mostly a cosmetic change to replace strlen with strnlen.
> >> This is not cosmetic, and more, for instance the usage() part of the
> >> change
> >> does not make any sense to me.
> >>
> >
> > I specifically objected as well and was blown off. What gives?
> >
> 
> I have asked you feedback and got none! I will revert the usage() changes
> later then.

I noted the usage() chunk because it is the first one in the commit and
I stopped after I see the obvious issues with it, not because it is the
only wrong part.
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov 
escreveu:

> On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote:
> > Em sex, 1 de fev de 2019 às 08:36, Warner Losh 
> escreveu:
> >
> > >
> > >
> > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov  > > wrote:
> > >
> > >> On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> > >> > Author: araujo
> > >> > Date: Thu Jan 31 23:32:19 2019
> > >> > New Revision: 343634
> > >> > URL: https://svnweb.freebsd.org/changeset/base/343634
> > >> >
> > >> > Log:
> > >> >   Mostly a cosmetic change to replace strlen with strnlen.
> > >> This is not cosmetic, and more, for instance the usage() part of the
> > >> change
> > >> does not make any sense to me.
> > >>
> > >
> > > I specifically objected as well and was blown off. What gives?
> > >
> >
> > I have asked you feedback and got none! I will revert the usage() changes
> > later then.
>
> I noted the usage() chunk because it is the first one in the commit and
> I stopped after I see the obvious issues with it, not because it is the
> only wrong part.
>

Are you implying that all the patch is wrong?
I have no problem to revert it at all if you give me the right reason, it
was basically a port from another project that also uses bhyve.

Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Konstantin Belousov
On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote:
> Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov 
> escreveu:
> 
> > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote:
> > > Em sex, 1 de fev de 2019 às 08:36, Warner Losh 
> > escreveu:
> > >
> > > >
> > > >
> > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov  > > > wrote:
> > > >
> > > >> On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> > > >> > Author: araujo
> > > >> > Date: Thu Jan 31 23:32:19 2019
> > > >> > New Revision: 343634
> > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634
> > > >> >
> > > >> > Log:
> > > >> >   Mostly a cosmetic change to replace strlen with strnlen.
> > > >> This is not cosmetic, and more, for instance the usage() part of the
> > > >> change
> > > >> does not make any sense to me.
> > > >>
> > > >
> > > > I specifically objected as well and was blown off. What gives?
> > > >
> > >
> > > I have asked you feedback and got none! I will revert the usage() changes
> > > later then.
> >
> > I noted the usage() chunk because it is the first one in the commit and
> > I stopped after I see the obvious issues with it, not because it is the
> > only wrong part.
> >
> 
> Are you implying that all the patch is wrong?
> I have no problem to revert it at all if you give me the right reason, it
> was basically a port from another project that also uses bhyve.

By default, all uses of strncmp() and strncpy() are bugs.
Your commit message have no explanation what the change fixes/improves.

So I looked at the second chunk, for smbios_generic_initializer(). It
also seems to be wrong.  If template_string[i] length is greater than
SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its
length is less than the constant, then what is the point ?

I also looked at the third chunk, smbios_type1_initializer().  I cannot
understand the reasoning behind it, at all.

Only usb_mouse.c is left, I do not expect anything good from it.
___
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: r343634 - head/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Em sex, 1 de fev de 2019 às 09:21, Konstantin Belousov 
escreveu:

> On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote:
> > Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov <
> kostik...@gmail.com>
> > escreveu:
> >
> > > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote:
> > > > Em sex, 1 de fev de 2019 às 08:36, Warner Losh 
> > > escreveu:
> > > >
> > > > >
> > > > >
> > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov <
> kostik...@gmail.com
> > > > > wrote:
> > > > >
> > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +, Marcelo Araujo wrote:
> > > > >> > Author: araujo
> > > > >> > Date: Thu Jan 31 23:32:19 2019
> > > > >> > New Revision: 343634
> > > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634
> > > > >> >
> > > > >> > Log:
> > > > >> >   Mostly a cosmetic change to replace strlen with strnlen.
> > > > >> This is not cosmetic, and more, for instance the usage() part of
> the
> > > > >> change
> > > > >> does not make any sense to me.
> > > > >>
> > > > >
> > > > > I specifically objected as well and was blown off. What gives?
> > > > >
> > > >
> > > > I have asked you feedback and got none! I will revert the usage()
> changes
> > > > later then.
> > >
> > > I noted the usage() chunk because it is the first one in the commit and
> > > I stopped after I see the obvious issues with it, not because it is the
> > > only wrong part.
> > >
> >
> > Are you implying that all the patch is wrong?
> > I have no problem to revert it at all if you give me the right reason, it
> > was basically a port from another project that also uses bhyve.
>
> By default, all uses of strncmp() and strncpy() are bugs.
> Your commit message have no explanation what the change fixes/improves.
>
> So I looked at the second chunk, for smbios_generic_initializer(). It
> also seems to be wrong.  If template_string[i] length is greater than
> SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its
> length is less than the constant, then what is the point ?
>
> I also looked at the third chunk, smbios_type1_initializer().  I cannot
> understand the reasoning behind it, at all.
>
> Only usb_mouse.c is left, I do not expect anything good from it.
>

Thanks kib, I will recheck the patch and open another review!
I will revert this commit in a few.

Best,

-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r343639 - in stable: 10/share/man/man4 11/share/man/man4 12/share/man/man4

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 02:43:13 2019
New Revision: 343639
URL: https://svnweb.freebsd.org/changeset/base/343639

Log:
  MFC r343495:
  wlan.4: improve wording
  
  PR:   218075
  Submitted by: Aaron Taylor 

Modified:
  stable/11/share/man/man4/wlan.4
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/share/man/man4/wlan.4
  stable/12/share/man/man4/wlan.4
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/share/man/man4/wlan.4
==
--- stable/11/share/man/man4/wlan.4 Fri Feb  1 00:37:55 2019
(r343638)
+++ stable/11/share/man/man4/wlan.4 Fri Feb  1 02:43:13 2019
(r343639)
@@ -167,9 +167,8 @@ was used to be compatible with
 .Pp
 Mesh stations follow the 802.11s Draft 3.0 specification which is
 not ratified and subject to change.
-Beware that this specification is incompatible with earlier drafts;
-and stations implementing earlier drafts (e.g. Linux)
-may not interoperate.
+Be aware that this specification is incompatible with earlier drafts.
+Stations implementing earlier drafts (e.g., Linux) may be incompatible.
 .Sh SEE ALSO
 .Xr an 4 ,
 .Xr ath 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"


svn commit: r343639 - in stable: 10/share/man/man4 11/share/man/man4 12/share/man/man4

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 02:43:13 2019
New Revision: 343639
URL: https://svnweb.freebsd.org/changeset/base/343639

Log:
  MFC r343495:
  wlan.4: improve wording
  
  PR:   218075
  Submitted by: Aaron Taylor 

Modified:
  stable/10/share/man/man4/wlan.4
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man4/wlan.4
  stable/12/share/man/man4/wlan.4
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/share/man/man4/wlan.4
==
--- stable/10/share/man/man4/wlan.4 Fri Feb  1 00:37:55 2019
(r343638)
+++ stable/10/share/man/man4/wlan.4 Fri Feb  1 02:43:13 2019
(r343639)
@@ -167,9 +167,8 @@ was used to be compatible with
 .Pp
 Mesh stations follow the 802.11s Draft 3.0 specification which is
 not ratified and subject to change.
-Beware that this specification is incompatible with earlier drafts;
-and stations implementing earlier drafts (e.g. Linux)
-may not interoperate.
+Be aware that this specification is incompatible with earlier drafts.
+Stations implementing earlier drafts (e.g., Linux) may be incompatible.
 .Sh SEE ALSO
 .Xr an 4 ,
 .Xr ath 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"


svn commit: r343639 - in stable: 10/share/man/man4 11/share/man/man4 12/share/man/man4

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 02:43:13 2019
New Revision: 343639
URL: https://svnweb.freebsd.org/changeset/base/343639

Log:
  MFC r343495:
  wlan.4: improve wording
  
  PR:   218075
  Submitted by: Aaron Taylor 

Modified:
  stable/12/share/man/man4/wlan.4
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/share/man/man4/wlan.4
  stable/11/share/man/man4/wlan.4
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/share/man/man4/wlan.4
==
--- stable/12/share/man/man4/wlan.4 Fri Feb  1 00:37:55 2019
(r343638)
+++ stable/12/share/man/man4/wlan.4 Fri Feb  1 02:43:13 2019
(r343639)
@@ -167,9 +167,8 @@ was used to be compatible with
 .Pp
 Mesh stations follow the 802.11s Draft 3.0 specification which is
 not ratified and subject to change.
-Beware that this specification is incompatible with earlier drafts;
-and stations implementing earlier drafts (e.g. Linux)
-may not interoperate.
+Be aware that this specification is incompatible with earlier drafts.
+Stations implementing earlier drafts (e.g., Linux) may be incompatible.
 .Sh SEE ALSO
 .Xr an 4 ,
 .Xr ath 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"


svn commit: r343641 - stable/11/etc

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 03:02:52 2019
New Revision: 343641
URL: https://svnweb.freebsd.org/changeset/base/343641

Log:
  MFC r343497:
  Unbreak devd.conf(5) regex after r343249
  
  PR:   235239
  Submitted by: Helge Oldach 

Modified:
  stable/11/etc/devd.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/devd.conf
==
--- stable/11/etc/devd.conf Fri Feb  1 03:01:19 2019(r343640)
+++ stable/11/etc/devd.conf Fri Feb  1 03:02:52 2019(r343641)
@@ -41,7 +41,7 @@ options {
 #
 notify 0 {
match "system"  "IFNET";
-   match "subsystem"   "(?!usbus[0-9]+|?!wlan[0-9]+)";
+   match "subsystem"   "!(usbus|wlan)[0-9]+";
match "type""ATTACH";
action "/etc/pccard_ether $subsystem start";
 };
___
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: r343640 - stable/12/sbin/devd

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 03:01:19 2019
New Revision: 343640
URL: https://svnweb.freebsd.org/changeset/base/343640

Log:
  MFC r343497:
  Unbreak devd.conf(5) regex after r343249
  
  PR:   235239
  Submitted by: Helge Oldach 

Modified:
  stable/12/sbin/devd/devd.conf
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/devd/devd.conf
==
--- stable/12/sbin/devd/devd.conf   Fri Feb  1 02:43:13 2019
(r343639)
+++ stable/12/sbin/devd/devd.conf   Fri Feb  1 03:01:19 2019
(r343640)
@@ -42,7 +42,7 @@ options {
 #
 notify 0 {
match "system"  "IFNET";
-   match "subsystem"   "(?!usbus[0-9]+|?!wlan[0-9]+)";
+   match "subsystem"   "!(usbus|wlan)[0-9]+";
match "type""ATTACH";
action "/etc/pccard_ether $subsystem start";
 };
___
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: r343642 - head/usr.sbin/bhyve

2019-01-31 Thread Marcelo Araujo
Author: araujo
Date: Fri Feb  1 03:09:11 2019
New Revision: 343642
URL: https://svnweb.freebsd.org/changeset/base/343642

Log:
  Revert r343634:
  Mostly a cosmetic change to replace strlen with strnlen.
  
  Requested by: kib and imp

Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/smbiostbl.c
  head/usr.sbin/bhyve/usb_mouse.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Fri Feb  1 03:02:52 2019
(r343641)
+++ head/usr.sbin/bhyve/bhyverun.c  Fri Feb  1 03:09:11 2019
(r343642)
@@ -233,8 +233,8 @@ usage(int code)
"   -W: force virtio to use single-vector MSI\n"
"   -x: local apic is in x2APIC mode\n"
"   -Y: disable MPtable generation\n",
-   progname, (int)strnlen(progname, PATH_MAX), "", 
(int)strnlen(progname, PATH_MAX), "",
-   (int)strnlen(progname, PATH_MAX), "");
+   progname, (int)strlen(progname), "", (int)strlen(progname), "",
+   (int)strlen(progname), "");
 
exit(code);
 }

Modified: head/usr.sbin/bhyve/smbiostbl.c
==
--- head/usr.sbin/bhyve/smbiostbl.c Fri Feb  1 03:02:52 2019
(r343641)
+++ head/usr.sbin/bhyve/smbiostbl.c Fri Feb  1 03:09:11 2019
(r343642)
@@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te
int len;
 
string = template_strings[i];
-   len = strnlen(string, SMBIOS_MAX_LENGTH) + 1;
+   len = strlen(string) + 1;
memcpy(curaddr, string, len);
curaddr += len;
}
@@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp
return (-1);
 
MD5Init(&mdctx);
-   MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX));
+   MD5Update(&mdctx, vmname, strlen(vmname));
MD5Update(&mdctx, hostname, sizeof(hostname));
MD5Final(digest, &mdctx);
 

Modified: head/usr.sbin/bhyve/usb_mouse.c
==
--- head/usr.sbin/bhyve/usb_mouse.c Fri Feb  1 03:02:52 2019
(r343641)
+++ head/usr.sbin/bhyve/usb_mouse.c Fri Feb  1 03:09:11 2019
(r343642)
@@ -70,7 +70,6 @@ enum {
UMSTR_MAX
 };
 
-#define UMOUSE_DESC_MAX_LEN32
 static const char *umouse_desc_strings[] = {
"\x04\x09",
"BHYVE",
@@ -442,7 +441,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer
goto done;
}
 
-   slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
+   slen = 2 + strlen(str) * 2;
udata[0] = slen;
udata[1] = UDESC_STRING;
 
___
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: r343643 - in stable: 10/sys/dev/pcf 11/sys/dev/pcf 12/sys/dev/pcf

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 03:26:10 2019
New Revision: 343643
URL: https://svnweb.freebsd.org/changeset/base/343643

Log:
  MFC r343496:
  pcf(4): fix parentheses in if condition
  
  PR:   210709
  Submitted by: David Binderman 

Modified:
  stable/11/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/pcf/pcf_isa.c
  stable/12/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/dev/pcf/pcf_isa.c
==
--- stable/11/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:09:11 2019
(r343642)
+++ stable/11/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:26:10 2019
(r343643)
@@ -109,7 +109,7 @@ pcf_isa_probe(device_t dev)
 
/* The port address must be explicitly specified */
bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count);
-   if ((error = resource_int_value(PCF_NAME, 0, "port", &port) != 0))
+   if ((error = resource_int_value(PCF_NAME, 0, "port", &port)) != 0)
return (error);
 
/* Probe is only successful for the specified base io */
___
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: r343643 - in stable: 10/sys/dev/pcf 11/sys/dev/pcf 12/sys/dev/pcf

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 03:26:10 2019
New Revision: 343643
URL: https://svnweb.freebsd.org/changeset/base/343643

Log:
  MFC r343496:
  pcf(4): fix parentheses in if condition
  
  PR:   210709
  Submitted by: David Binderman 

Modified:
  stable/10/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/pcf/pcf_isa.c
  stable/12/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/dev/pcf/pcf_isa.c
==
--- stable/10/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:09:11 2019
(r343642)
+++ stable/10/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:26:10 2019
(r343643)
@@ -109,7 +109,7 @@ pcf_isa_probe(device_t dev)
 
/* The port address must be explicitly specified */
bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count);
-   if ((error = resource_int_value(PCF_NAME, 0, "port", &port) != 0))
+   if ((error = resource_int_value(PCF_NAME, 0, "port", &port)) != 0)
return (error);
 
/* Probe is only successfull for the specified base io */
___
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: r343643 - in stable: 10/sys/dev/pcf 11/sys/dev/pcf 12/sys/dev/pcf

2019-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb  1 03:26:10 2019
New Revision: 343643
URL: https://svnweb.freebsd.org/changeset/base/343643

Log:
  MFC r343496:
  pcf(4): fix parentheses in if condition
  
  PR:   210709
  Submitted by: David Binderman 

Modified:
  stable/12/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/pcf/pcf_isa.c
  stable/11/sys/dev/pcf/pcf_isa.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/dev/pcf/pcf_isa.c
==
--- stable/12/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:09:11 2019
(r343642)
+++ stable/12/sys/dev/pcf/pcf_isa.c Fri Feb  1 03:26:10 2019
(r343643)
@@ -111,7 +111,7 @@ pcf_isa_probe(device_t dev)
 
/* The port address must be explicitly specified */
bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count);
-   if ((error = resource_int_value(PCF_NAME, 0, "port", &port) != 0))
+   if ((error = resource_int_value(PCF_NAME, 0, "port", &port)) != 0)
return (error);
 
/* Probe is only successful for the specified base io */
___
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: r343644 - stable/12/stand/mips/beri/boot2

2019-01-31 Thread Toomas Soome
Author: tsoome
Date: Fri Feb  1 06:19:12 2019
New Revision: 343644
URL: https://svnweb.freebsd.org/changeset/base/343644

Log:
  MFC r343225:
  Unbreak mip64 build after r328437
  
  Add exit and getchar functions to beri/boot2 code. They are required by
  panic_action functin introduced in r328437

Modified:
  stable/12/stand/mips/beri/boot2/boot2.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/mips/beri/boot2/boot2.c
==
--- stable/12/stand/mips/beri/boot2/boot2.c Fri Feb  1 03:26:10 2019
(r343643)
+++ stable/12/stand/mips/beri/boot2/boot2.c Fri Feb  1 06:19:12 2019
(r343644)
@@ -651,3 +651,19 @@ xgetc(int fn)
return 0;
 }
 }
+
+int
+getchar(void)
+{
+
+   return xgetc(0);
+}
+
+void
+exit(int code)
+{
+
+printf("error: loader exit\n");
+while (1);
+__unreachable();
+}
___
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"