svn commit: r362145 - in head/contrib/sqlite3: . tea

2020-06-12 Thread Cy Schubert
Author: cy
Date: Sat Jun 13 04:47:59 2020
New Revision: 362145
URL: https://svnweb.freebsd.org/changeset/base/362145

Log:
  MFV r362143:
  
  Update sqlite3 to 3.32.2 (3320200).
  
  CVE-2020-11655: SQLite through 3.31.1 allows attackers to cause a denial of
  service (segmentation fault) via a malformed window-function query because
  the AggInfo object's initialization is mishandled.
  
  CVE-2020-13434: SQLite through 3.32.0 has an integer overflow in
  sqlite3_str_vappendf in printf.c.
  
  CVE-2020-13435: SQLite through 3.32.0 has a segmentation fault in
  sqlite3ExprCodeTarget in expr.c.
  
  CVE-2020-13630: ext/fts3/fts3.c in SQLite before 3.32.0 has a
  use-after-free in fts3EvalNextRow, related to the snippet feature
  
  CVE-2020-13631: SQLite before 3.32.0 allows a virtual table to be renamed
  to the name of one of its shadow tables, related to alter.c and build.c.
  
  CVE-2020-13632: ext/fts3/fts3_snippet.c in SQLite before 3.32.0 ha s a
  NULL pointer dereference via a crafted matchinfo() query.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  MFC after:3 days
  Security: vuxml: c4ac9c79-ab37-11ea-8b5e-b42e99a1b9c3
https://nvd.nist.gov/vuln/detail/CVE-2020-11655
https://nvd.nist.gov/vuln/detail/CVE-2020-13434
https://nvd.nist.gov/vuln/detail/CVE-2020-13435
https://nvd.nist.gov/vuln/detail/CVE-2020-13630
https://nvd.nist.gov/vuln/detail/CVE-2020-13631
https://nvd.nist.gov/vuln/detail/CVE-2020-13632

Modified:
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/shell.c
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Sat Jun 13 03:52:15 2020
(r362144)
+++ head/contrib/sqlite3/configure  Sat Jun 13 04:47:59 2020
(r362145)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.32.0.
+# Generated by GNU Autoconf 2.69 for sqlite 3.32.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.32.0'
-PACKAGE_STRING='sqlite 3.32.0'
+PACKAGE_VERSION='3.32.2'
+PACKAGE_STRING='sqlite 3.32.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.32.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.32.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.32.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.32.0
+sqlite configure 3.32.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.32.0, which was
+It was created by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.32.0'
+ VERSION='3.32.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.32.0, which was
+This file was extended by sqlite $as_me 3.32.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.32.0
+sqlite config.status 3.32.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==
--- 

svn commit: r362142 - head/sys/net80211

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 03:16:09 2020
New Revision: 362142
URL: https://svnweb.freebsd.org/changeset/base/362142

Log:
  Fix !DEBUGNET build after r362138
  
  X-MFC-With:   r362138

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 03:04:40 2020
(r362141)
+++ head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 03:16:09 2020
(r362142)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 03:04:40 2020
(r362141)
+++ head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 03:16:09 2020
(r362142)
@@ -40,9 +40,7 @@
 #include 
 #include 
 
-#ifdef DEBUGNET
 #include 
-#endif
 
 /*
  * Common state locking definitions.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362141 - head/sys/kern

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 03:04:40 2020
New Revision: 362141
URL: https://svnweb.freebsd.org/changeset/base/362141

Log:
  Flip kern.tty_info_kstacks on by default
  
  It's a useful debug aid for anyone using Ctrl-T today, and doesn't seem to be
  widely known.  So, enable it out of the box to help people find it.
  
  It's a tunable and sysctl, so if you don't like it, it's easy to disable
  locally.
  
  If people really hate it, we can always flip it back.
  
  Reported by:  Daniel O'Connor

Modified:
  head/sys/kern/tty_info.c

Modified: head/sys/kern/tty_info.c
==
--- head/sys/kern/tty_info.cSat Jun 13 02:24:35 2020(r362140)
+++ head/sys/kern/tty_info.cSat Jun 13 03:04:40 2020(r362141)
@@ -239,7 +239,7 @@ sbuf_tty_drain(void *a, const char *d, int len)
 }
 
 #ifdef STACK
-static bool tty_info_kstacks = false;
+static bool tty_info_kstacks = true;
 SYSCTL_BOOL(_kern, OID_AUTO, tty_info_kstacks, CTLFLAG_RWTUN,
 _info_kstacks, 0,
 "Enable printing kernel stack(9) traces on ^T (tty info)");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362139 - in head/sys: compat/linuxkpi/common/include/linux sys

2020-06-12 Thread Doug Moore
Author: dougm
Date: Sat Jun 13 01:54:09 2020
New Revision: 362139
URL: https://svnweb.freebsd.org/changeset/base/362139

Log:
  Linuxkpi uses the rb-tree structures without using their interfaces,
  making them break when the representation changes. Revert changes that
  eliminated the color field from rb-trees, leaving everything as it was
  before.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25250

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h
  head/sys/sys/tree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Sat Jun 13 
00:59:36 2020(r362138)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Sat Jun 13 
01:54:09 2020(r362139)
@@ -57,7 +57,11 @@ RB_HEAD(linux_root, rb_node);
 RB_PROTOTYPE(linux_root, rb_node, __entry, panic_cmp);
 
 #definerb_parent(r)RB_PARENT(r, __entry)
+#definerb_color(r) RB_COLOR(r, __entry)
+#definerb_is_red(r)(rb_color(r) == RB_RED)
+#definerb_is_black(r)  (rb_color(r) == RB_BLACK)
 #definerb_set_parent(r, p) rb_parent((r)) = (p)
+#definerb_set_color(r, c)  rb_color((r)) = (c)
 #definerb_entry(ptr, type, member) container_of(ptr, type, member)
 
 #define RB_EMPTY_ROOT(root) RB_EMPTY((struct linux_root *)root)
@@ -78,6 +82,7 @@ rb_link_node(struct rb_node *node, struct rb_node *par
 struct rb_node **rb_link)
 {
rb_set_parent(node, parent);
+   rb_set_color(node, RB_RED);
node->__entry.rbe_left = node->__entry.rbe_right = NULL;
*rb_link = node;
 }

Modified: head/sys/sys/tree.h
==
--- head/sys/sys/tree.h Sat Jun 13 00:59:36 2020(r362138)
+++ head/sys/sys/tree.h Sat Jun 13 01:54:09 2020(r362139)
@@ -307,38 +307,35 @@ struct name { 
\
(root)->rbh_root = NULL;\
 } while (/*CONSTCOND*/ 0)
 
+#define RB_BLACK   0
+#define RB_RED 1
 #define RB_ENTRY(type) \
 struct {   \
struct type *rbe_left;  /* left element */  \
struct type *rbe_right; /* right element */ \
struct type *rbe_parent;/* parent element */\
+   int rbe_color;  /* node color */\
 }
 
-#define RB_LF(elm, field)  (elm)->field.rbe_left
-#define RB_RT(elm, field)  (elm)->field.rbe_right
-#define RB_FLIP(elm)   (*(__uintptr_t *)&(elm) ^= 1)
-#define RB_FLIP_LF(elm, field) RB_FLIP(RB_LF(elm, field))
-#define RB_FLIP_RT(elm, field) RB_FLIP(RB_RT(elm, field))
-#define RB_ISRED(elm)  ((*(__uintptr_t *)&(elm) & 1) != 0)
-#define RB_RED_LF(elm, field)  RB_ISRED(RB_LF(elm, field))
-#define RB_RED_RT(elm, field)  RB_ISRED(RB_RT(elm, field))
-#define RB_PTR(elm, field) ((__typeof(elm->field.rbe_parent)) \
-((__uintptr_t)(elm) & ~(__uintptr_t)1))
-#define RB_LEFT(elm, field)RB_PTR(RB_LF(elm, field), field)
-#define RB_RIGHT(elm, field)   RB_PTR(RB_RT(elm, field), field)
+#define RB_LEFT(elm, field)(elm)->field.rbe_left
+#define RB_RIGHT(elm, field)   (elm)->field.rbe_right
 #define RB_PARENT(elm, field)  (elm)->field.rbe_parent
+#define RB_COLOR(elm, field)   (elm)->field.rbe_color
+#define RB_ISRED(elm, field)   ((elm) != NULL && RB_COLOR(elm, field) 
== RB_RED)
 #define RB_ROOT(head)  (head)->rbh_root
 #define RB_EMPTY(head) (RB_ROOT(head) == NULL)
-#define RB_BOOLint
-#define RB_TRUE1
-#define RB_FALSE   0
 
-/* For debugging support */
-#define RB_COLOR(elm, field)   (RB_PARENT(elm, field) == NULL ? 
RB_FALSE : \
-   RB_LEFT(RB_PARENT(elm, field), 
field) == elm ? \
-   RB_RED_LF(RB_PARENT(elm, field), 
field) : \
-   RB_RED_RT(RB_PARENT(elm, field), 
field))
+#define RB_SET(elm, parent, field) do {
\
+   RB_PARENT(elm, field) = parent; \
+   RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;  \
+   RB_COLOR(elm, field) = RB_RED;  \
+} while (/*CONSTCOND*/ 0)
 
+#define RB_SET_BLACKRED(black, red, field) do {
\
+   RB_COLOR(black, 

svn commit: r362138 - head/sys/net80211

2020-06-12 Thread Conrad Meyer
Author: cem
Date: Sat Jun 13 00:59:36 2020
New Revision: 362138
URL: https://svnweb.freebsd.org/changeset/base/362138

Log:
  net80211: Add framework for debugnet(4) support
  
  Allow net80211 drivers to register a small vtable of debugnet-related
  methods.
  
  This is not a functional change.  Driver support is needed, similar to
  debugnet(4) for wired NICs.
  
  Reviewed by:  adrian, markj (earlier version both)
  Differential Revision:https://reviews.freebsd.org/D17308

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Fri Jun 12 23:43:44 2020
(r362137)
+++ head/sys/net80211/ieee80211_freebsd.c   Sat Jun 13 00:59:36 2020
(r362138)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+DEBUGNET_DEFINE(ieee80211);
 SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
 "IEEE 80211 parameters");
 
@@ -111,7 +112,14 @@ wlan_clone_create(struct if_clone *ifc, int unit, cadd
cp.icp_flags & IEEE80211_CLONE_MACADDR ?
cp.icp_macaddr : ic->ic_macaddr);
 
-   return (vap == NULL ? EIO : 0);
+   if (vap == NULL)
+   return (EIO);
+
+#ifdef DEBUGNET
+   if (ic->ic_debugnet_meth != NULL)
+   DEBUGNET_SET(vap->iv_ifp, ieee80211);
+#endif
+   return (0);
 }
 
 static void
@@ -1046,6 +1054,54 @@ ieee80211_get_vap_ifname(struct ieee80211vap *vap)
return "(none)";
return vap->iv_ifp->if_xname;
 }
+
+#ifdef DEBUGNET
+static void
+ieee80211_debugnet_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   IEEE80211_LOCK(ic);
+   ic->ic_debugnet_meth->dn8_init(ic, nrxr, ncl, clsize);
+   IEEE80211_UNLOCK(ic);
+}
+
+static void
+ieee80211_debugnet_event(struct ifnet *ifp, enum debugnet_ev ev)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   IEEE80211_LOCK(ic);
+   ic->ic_debugnet_meth->dn8_event(ic, ev);
+   IEEE80211_UNLOCK(ic);
+}
+
+static int
+ieee80211_debugnet_transmit(struct ifnet *ifp, struct mbuf *m)
+{
+   return (ieee80211_vap_transmit(ifp, m));
+}
+
+static int
+ieee80211_debugnet_poll(struct ifnet *ifp, int count)
+{
+   struct ieee80211vap *vap;
+   struct ieee80211com *ic;
+
+   vap = if_getsoftc(ifp);
+   ic = vap->iv_ic;
+
+   return (ic->ic_debugnet_meth->dn8_poll(ic, count));
+}
+#endif
 
 /*
  * Module glue.

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Fri Jun 12 23:43:44 2020
(r362137)
+++ head/sys/net80211/ieee80211_freebsd.h   Sat Jun 13 00:59:36 2020
(r362138)
@@ -40,6 +40,10 @@
 #include 
 #include 
 
+#ifdef DEBUGNET
+#include 
+#endif
+
 /*
  * Common state locking definitions.
  */
@@ -492,6 +496,36 @@ typedef int ieee80211_ioctl_setfunc(struct ieee80211va
 struct ieee80211req *);
 SET_DECLARE(ieee80211_ioctl_setset, ieee80211_ioctl_setfunc);
 #defineIEEE80211_IOCTL_SET(_name, _set) 
TEXT_SET(ieee80211_ioctl_setset, _set)
+
+#ifdef DEBUGNET
+typedef void debugnet80211_init_t(struct ieee80211com *, int *nrxr, int *ncl,
+int *clsize);
+typedef void debugnet80211_event_t(struct ieee80211com *, enum debugnet_ev);
+typedef int debugnet80211_poll_t(struct ieee80211com *, int);
+
+struct debugnet80211_methods {
+   debugnet80211_init_t*dn8_init;
+   debugnet80211_event_t   *dn8_event;
+   debugnet80211_poll_t*dn8_poll;
+};
+
+#defineDEBUGNET80211_DEFINE(driver)
\
+   static debugnet80211_init_t driver##_debugnet80211_init;
\
+   static debugnet80211_event_t driver##_debugnet80211_event;  \
+   static debugnet80211_poll_t driver##_debugnet80211_poll;
\
+   \
+   static struct debugnet80211_methods driver##_debugnet80211_methods = { \
+   .dn8_init = driver##_debugnet80211_init,
\
+   .dn8_event = driver##_debugnet80211_event,  \
+   .dn8_poll = driver##_debugnet80211_poll,
\
+   }
+#define DEBUGNET80211_SET(ic, driver)  \
+   (ic)->ic_debugnet_meth = ##_debugnet80211_methods
+#else
+#define DEBUGNET80211_DEFINE(driver)
+#define DEBUGNET80211_SET(ic, driver)
+#endif /* DEBUGNET */
+
 #endif /* _KERNEL */
 
 /* XXX this 

svn commit: r362137 - head/sys/sys

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:43:44 2020
New Revision: 362137
URL: https://svnweb.freebsd.org/changeset/base/362137

Log:
  Allow  to be used in assembly.
  
  Hide C-only declarations under #ifndef LOCORE.  This will be used by
  future changes to define ELF notes in assembly.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25211

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Fri Jun 12 23:42:36 2020(r362136)
+++ head/sys/sys/elf_common.h   Fri Jun 12 23:43:44 2020(r362137)
@@ -46,12 +46,14 @@
  * not include the padding.
  */
 
+#ifndef LOCORE
 typedef struct {
u_int32_t   n_namesz;   /* Length of name. */
u_int32_t   n_descsz;   /* Length of descriptor. */
u_int32_t   n_type; /* Type of this note. */
 } Elf_Note;
 typedef Elf_Note Elf_Nhdr;
+#endif
 
 /*
  * Option kinds.
@@ -112,12 +114,14 @@ typedef Elf_Note Elf_Nhdr;
  * The header for GNU-style hash sections.
  */
 
+#ifndef LOCORE
 typedef struct {
u_int32_t   gh_nbuckets;/* Number of hash buckets. */
u_int32_t   gh_symndx;  /* First visible symbol in .dynsym. */
u_int32_t   gh_maskwords;   /* #maskwords used in bloom filter. */
u_int32_t   gh_shift2;  /* Bloom filter shift count. */
 } Elf_GNU_Hash_Header;
+#endif
 
 /* Indexes into the e_ident array.  Keep synced with
http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362136 - head/sys/sys

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:42:36 2020
New Revision: 362136
URL: https://svnweb.freebsd.org/changeset/base/362136

Log:
  Allow  to be included from userland assembly files.
  
  This will be used by future changes to define ELF notes in assembly.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25211

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hFri Jun 12 23:10:30 2020(r362135)
+++ head/sys/sys/param.hFri Jun 12 23:42:36 2020(r362136)
@@ -136,8 +136,10 @@
 #endif
 
 #ifndef _KERNEL
+#ifndef LOCORE
 /* Signals. */
 #include 
+#endif
 #endif
 
 /* Machine type dependent parameters. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362135 - head/sys/opencrypto

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 23:10:30 2020
New Revision: 362135
URL: https://svnweb.freebsd.org/changeset/base/362135

Log:
  Various optimizations to software AES-CCM and AES-GCM.
  
  - Make use of cursors to avoid data copies for AES-CCM and AES-GCM.
  
Pass pointers into the request's input and/or output buffers
directly to the Update, encrypt, and decrypt hooks rather than
always copying all data into a temporary block buffer on the stack.
  
  - Move handling for partial final blocks out of the main loop.
  
This removes branches from the main loop and permits using
encrypt/decrypt_last which avoids a memset to clear the rest of the
block on the stack.
  
  - Shrink the on-stack buffers to assume AES block sizes and CCM/GCM
tag lengths.
  
  - For AAD data, pass larger chunks to axf->Update.  CCM can take each
AAD segment in a single call.  GMAC can take multiple blocks at a
time.
  
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D25058

Modified:
  head/sys/opencrypto/cryptosoft.c

Modified: head/sys/opencrypto/cryptosoft.c
==
--- head/sys/opencrypto/cryptosoft.cFri Jun 12 23:02:34 2020
(r362134)
+++ head/sys/opencrypto/cryptosoft.cFri Jun 12 23:10:30 2020
(r362135)
@@ -107,8 +107,8 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *
struct enc_xform *exf;
int i, blks, inlen, ivlen, outlen, resid;
struct crypto_buffer_cursor cc_in, cc_out;
-   const char *inblk;
-   char *outblk;
+   const unsigned char *inblk;
+   unsigned char *outblk;
int error;
bool encrypting;
 
@@ -404,11 +404,12 @@ CTASSERT(INT_MAX <= (uint64_t)-1);/* GCM: 
associated 
 static int
 swcr_gmac(struct swcr_session *ses, struct cryptop *crp)
 {
-   uint32_t blkbuf[howmany(EALG_MAX_BLOCK_LEN, sizeof(uint32_t))];
+   uint32_t blkbuf[howmany(AES_BLOCK_LEN, sizeof(uint32_t))];
u_char *blk = (u_char *)blkbuf;
-   u_char aalg[AALG_MAX_RESULT_LEN];
-   u_char iv[EALG_MAX_BLOCK_LEN];
+   u_char tag[GMAC_DIGEST_LEN];
+   u_char iv[AES_BLOCK_LEN];
struct crypto_buffer_cursor cc;
+   const u_char *inblk;
union authctx ctx;
struct swcr_auth *swa;
struct auth_hash *axf;
@@ -419,7 +420,9 @@ swcr_gmac(struct swcr_session *ses, struct cryptop *cr
axf = swa->sw_axf;
 
bcopy(swa->sw_ictx, , axf->ctxsize);
-   blksz = axf->blocksize;
+   blksz = GMAC_BLOCK_LEN;
+   KASSERT(axf->blocksize == blksz, ("%s: axf block size mismatch",
+   __func__));
 
/* Initialize the IV */
ivlen = AES_GCM_IV_LEN;
@@ -428,37 +431,49 @@ swcr_gmac(struct swcr_session *ses, struct cryptop *cr
axf->Reinit(, iv, ivlen);
crypto_cursor_init(, >crp_buf);
crypto_cursor_advance(, crp->crp_payload_start);
-   for (resid = crp->crp_payload_length; resid > 0; resid -= len) {
-   len = MIN(resid, blksz);
-   crypto_cursor_copydata(, len, blk);
-   bzero(blk + len, blksz - len);
+   for (resid = crp->crp_payload_length; resid >= blksz; resid -= len) {
+   len = crypto_cursor_seglen();
+   if (len >= blksz) {
+   inblk = crypto_cursor_segbase();
+   len = rounddown(MIN(len, resid), blksz);
+   crypto_cursor_advance(, len);
+   } else {
+   len = blksz;
+   crypto_cursor_copydata(, len, blk);
+   inblk = blk;
+   }
+   axf->Update(, inblk, len);
+   }
+   if (resid > 0) {
+   memset(blk, 0, blksz);
+   crypto_cursor_copydata(, resid, blk);
axf->Update(, blk, blksz);
}
 
/* length block */
-   bzero(blk, blksz);
+   memset(blk, 0, blksz);
blkp = (uint32_t *)blk + 1;
*blkp = htobe32(crp->crp_payload_length * 8);
axf->Update(, blk, blksz);
 
/* Finalize MAC */
-   axf->Final(aalg, );
+   axf->Final(tag, );
 
error = 0;
if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) {
-   u_char uaalg[AALG_MAX_RESULT_LEN];
+   u_char tag2[GMAC_DIGEST_LEN];
 
crypto_copydata(crp, crp->crp_digest_start, swa->sw_mlen,
-   uaalg);
-   if (timingsafe_bcmp(aalg, uaalg, swa->sw_mlen) != 0)
+   tag2);
+   if (timingsafe_bcmp(tag, tag2, swa->sw_mlen) != 0)
error = EBADMSG;
-   explicit_bzero(uaalg, sizeof(uaalg));
+   explicit_bzero(tag2, sizeof(tag2));
} else {
/* Inject the authentication data */
-   crypto_copyback(crp, crp->crp_digest_start, swa->sw_mlen, aalg);
+   crypto_copyback(crp, 

Re: svn commit: r362126 - head/sys/vm

2020-06-12 Thread Conrad Meyer
On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen  wrote:
>   Honor db_pager_quit in some vm_object ddb commands
>
>   These can be rather verbose.

We also have this (?)hack in OneFS, which eliminates the need for
every debug function to check the db_pager globals:

https://people.freebsd.org/~cem/db_pager.patch

I'm not sure how objectionable it is.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362131 - head/sys/opencrypto

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 22:27:26 2020
New Revision: 362131
URL: https://svnweb.freebsd.org/changeset/base/362131

Log:
  Fix a regression in r361804 for TLS 1.3.
  
  I was not including the record type stored in the first byte of the
  trailer as part of the payload to be encrypted and hashed.
  
  Sponsored by: Netflix

Modified:
  head/sys/opencrypto/ktls_ocf.c

Modified: head/sys/opencrypto/ktls_ocf.c
==
--- head/sys/opencrypto/ktls_ocf.c  Fri Jun 12 22:14:45 2020
(r362130)
+++ head/sys/opencrypto/ktls_ocf.c  Fri Jun 12 22:27:26 2020
(r362131)
@@ -293,6 +293,7 @@ ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls,
 * record_type even if only the first byte is used.
 */
trailer[0] = record_type;
+   crp->crp_payload_length++;
iov[iovcnt + 1].iov_base = trailer;
iov[iovcnt + 1].iov_len = AES_GMAC_HASH_LEN + 1;
uio.uio_iovcnt++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362130 - in head: share/man/man7 sys/amd64/amd64 sys/dev/cpuctl sys/x86/include sys/x86/x86

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:14:45 2020
New Revision: 362130
URL: https://svnweb.freebsd.org/changeset/base/362130

Log:
  Control for Special Register Buffer Data Sampling mitigation.
  
  New microcode update for Intel enables mitigation for SRBDS, which
  slows down RDSEED and related instructions.  The update also provides
  a control to limit the mitigation to SGX enclaves, which should
  restore the speed of random generator by the cost of potential
  cross-core bufer sampling.
  
  See 
https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling
  
  GIve the user control over it.
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25221

Modified:
  head/share/man/man7/security.7
  head/sys/amd64/amd64/initcpu.c
  head/sys/amd64/amd64/machdep.c
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/share/man/man7/security.7
==
--- head/share/man/man7/security.7  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/share/man/man7/security.7  Fri Jun 12 22:14:45 2020
(r362130)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 16, 2020
+.Dd June 11, 2020
 .Dt SECURITY 7
 .Os
 .Sh NAME
@@ -1040,6 +1040,13 @@ page table format used by hypervisors on Intel CPUs to
 physical address space to machine physical memory.
 May be disabled to work around a CPU Erratum called
 Machine Check Error Avoidance on Page Size Change.
+.It Dv machdep.mitigations.rngds.enable
+amd64 and i386.
+Controls mitigation of Special Register Buffer Data Sampling versus
+optimization of the MCU access.
+When set to zero, the mitigation is disabled, and the RDSEED and RDRAND
+instructions do not incur serialization overhead for shared buffer accesses,
+and do not serialize off-core memory accessses.
 .It Dv kern.elf32.aslr.enable
 Controls system-global Address Space Layout Randomization (ASLR) for
 normal non-PIE (Position Independent Executable) 32bit binaries.

Modified: head/sys/amd64/amd64/initcpu.c
==
--- head/sys/amd64/amd64/initcpu.c  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/amd64/amd64/initcpu.c  Fri Jun 12 22:14:45 2020
(r362130)
@@ -270,6 +270,7 @@ initializecpu(void)
hw_ibrs_recalculate(false);
hw_ssb_recalculate(false);
amd64_syscall_ret_flush_l1d_recalc();
+   x86_rngds_mitg_recalculate(false);
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
case CPU_VENDOR_HYGON:

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/amd64/amd64/machdep.c  Fri Jun 12 22:14:45 2020
(r362130)
@@ -1791,6 +1791,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
TUNABLE_INT_FETCH("machdep.mitigations.taa.enable", _taa_enable);
 
+   TUNABLE_INT_FETCH("machdep.mitigations.rndgs.enable",
+   _rngds_mitg_enable);
+
finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */
 

Modified: head/sys/dev/cpuctl/cpuctl.c
==
--- head/sys/dev/cpuctl/cpuctl.cFri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/dev/cpuctl/cpuctl.cFri Jun 12 22:14:45 2020
(r362130)
@@ -547,6 +547,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td
 #endif
hw_mds_recalculate();
x86_taa_recalculate();
+   x86_rngds_mitg_recalculate(true);
printcpuinfo();
return (0);
 }

Modified: head/sys/x86/include/x86_var.h
==
--- head/sys/x86/include/x86_var.h  Fri Jun 12 22:12:57 2020
(r362129)
+++ head/sys/x86/include/x86_var.h  Fri Jun 12 22:14:45 2020
(r362130)
@@ -95,6 +95,7 @@ externint hw_mds_disable;
 extern int hw_ssb_active;
 extern int x86_taa_enable;
 extern int cpu_flush_rsb_ctxsw;
+extern int x86_rngds_mitg_enable;
 
 struct pcb;
 struct thread;
@@ -139,6 +140,7 @@ voidhw_ibrs_recalculate(bool all_cpus);
 void   hw_mds_recalculate(void);
 void   hw_ssb_recalculate(bool all_cpus);
 void   x86_taa_recalculate(void);
+void   x86_rngds_mitg_recalculate(bool all_cpus);
 void   nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame);
 void   nmi_call_kdb_smp(u_int type, struct trapframe *frame);
 void   nmi_handle_intr(u_int type, struct trapframe *frame);

Modified: head/sys/x86/x86/cpu_machdep.c

svn commit: r362129 - in head/sys/x86: include x86

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:12:57 2020
New Revision: 362129
URL: https://svnweb.freebsd.org/changeset/base/362129

Log:
  x86: add bits definitions for SRBDS mitigation control.
  
  See 
https://software.intel.com/security-software-guidance/insights/deep-dive-special-register-buffer-data-sampling
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25221

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Fri Jun 12 22:10:03 2020
(r362128)
+++ head/sys/x86/include/specialreg.h   Fri Jun 12 22:12:57 2020
(r362129)
@@ -477,6 +477,7 @@
 #defineCPUID_STDEXT3_AVX5124FMAPS  0x0008
 #defineCPUID_STDEXT3_FSRM  0x0010
 #defineCPUID_STDEXT3_AVX512VP2INTERSECT0x0100
+#defineCPUID_STDEXT3_MCUOPT0x0200
 #defineCPUID_STDEXT3_MD_CLEAR  0x0400
 #defineCPUID_STDEXT3_TSXFA 0x2000
 #defineCPUID_STDEXT3_PCONFIG   0x0004
@@ -555,6 +556,7 @@
 #defineMSR_BBL_CR_BUSY 0x11b
 #defineMSR_BBL_CR_CTL3 0x11e
 #defineMSR_IA32_TSX_CTRL   0x122
+#defineMSR_IA32_MCU_OPT_CTRL   0x123
 #defineMSR_SYSENTER_CS_MSR 0x174
 #defineMSR_SYSENTER_ESP_MSR0x175
 #defineMSR_SYSENTER_EIP_MSR0x176
@@ -796,6 +798,9 @@
 
 /* MSR IA32_FLUSH_CMD */
 #defineIA32_FLUSH_CMD_L1D  0x0001
+
+/* MSR IA32_MCU_OPT_CTRL */
+#defineIA32_RNGDS_MITG_DIS 0x0001
 
 /* MSR IA32_HWP_CAPABILITIES */
 #defineIA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x)(((x) >> 0) & 
0xff)

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Fri Jun 12 22:10:03 2020(r362128)
+++ head/sys/x86/x86/identcpu.c Fri Jun 12 22:12:57 2020(r362129)
@@ -1028,6 +1028,7 @@ printcpuinfo(void)
   "\004AVX512_4FMAPS"
   "\005FSRM"
   "\011AVX512VP2INTERSECT"
+  "\012MCUOPT"
   "\013MD_CLEAR"
   "\016TSXFA"
   "\023PCONFIG"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362128 - in head/libexec/rtld-elf: . rtld-libc

2020-06-12 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 12 22:10:03 2020
New Revision: 362128
URL: https://svnweb.freebsd.org/changeset/base/362128

Log:
  rtld: set osrel when in the direct exec mode.
  
  Rtld itself is a shared object which does not have vendor note, so
  after the direct exec of ld-elf.so.1 process has p_osrel set to zero.
  This affects the ABI of syscalls.
  
  Set osrel to the __FreeBSD_version value at compile time right after
  rtld identified direct exec mode.  Then, switch to the osrel read from
  the binary note or zero if no note, right before starting calling
  ifunc resolvers, which is the first byte of the user code.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld-libc/Makefile.inc
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc
==
--- head/libexec/rtld-elf/rtld-libc/Makefile.incFri Jun 12 21:55:30 
2020(r362127)
+++ head/libexec/rtld-elf/rtld-libc/Makefile.incFri Jun 12 22:10:03 
2020(r362128)
@@ -46,7 +46,7 @@ _libc_string_objects= bcmp bcopy bzero memset memchr m
 # Also use all the syscall .o files from libc_nossp_pic:
 _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \
 cerror geteuid getegid sigfastblock munmap mprotect \
-sysarch __sysctl issetugid __getcwd utrace \
+sysarch __sysctl issetugid __getcwd utrace getpid \
 thr_self thr_kill pread mmap lseek _exit _fstat _fstatat _fstatfs \
 getdirentries _getdirentries _close _fcntl _open _openat _read \
 _sigprocmask _write readlink __realpathat _setjmp setjmp setjmperr

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri Jun 12 21:55:30 2020
(r362127)
+++ head/libexec/rtld-elf/rtld.cFri Jun 12 22:10:03 2020
(r362128)
@@ -384,11 +384,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 const char *argv0, *binpath;
 caddr_t imgentry;
 char buf[MAXPATHLEN];
-int argc, fd, i, phnum, rtld_argc;
+int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc;
+size_t sz;
 #ifdef __powerpc__
 int old_auxv_format = 1;
 #endif
-bool dir_enable, explicit_fd, search_in_path;
+bool dir_enable, direct_exec, explicit_fd, search_in_path;
 
 /*
  * On entry, the dynamic linker itself has not been relocated yet.
@@ -451,6 +452,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
ld_fast_sigblock = true;
 
 trust = !issetugid();
+direct_exec = false;
 
 md_abi_variant_hook(aux_info);
 
@@ -466,6 +468,21 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
argv0);
rtld_die();
}
+   direct_exec = true;
+
+   /*
+* Set osrel for us, it is later reset to the binary'
+* value before first instruction of code from the binary
+* is executed.
+*/
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_OSREL;
+   mib[3] = getpid();
+   osrel = __FreeBSD_version;
+   sz = sizeof(old_osrel);
+   (void)sysctl(mib, 4, _osrel, , , sizeof(osrel));
+
dbg("opening main program in direct exec mode");
if (argc >= 2) {
rtld_argc = parse_args(argv, argc, _in_path, , 
);
@@ -803,6 +820,18 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
  * init functions.
  */
 pre_init();
+
+if (direct_exec) {
+   /* Set osrel for direct-execed binary */
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_OSREL;
+   mib[3] = getpid();
+   osrel = obj_main->osrel;
+   sz = sizeof(old_osrel);
+   dbg("setting osrel to %d", osrel);
+   (void)sysctl(mib, 4, _osrel, , , sizeof(osrel));
+}
 
 wlock_acquire(rtld_bind_lock, );
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362127 - head/lib/libsecureboot

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:55:30 2020
New Revision: 362127
URL: https://svnweb.freebsd.org/changeset/base/362127

Log:
  verify_pcr_export: bump kenv_mvallen if needed
  
  The loader.ve.hashed list can easily exceed KENV_MVALLEN.
  If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to
  accommodate the value.
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cFri Jun 12 21:53:08 2020
(r362126)
+++ head/lib/libsecureboot/verify_file.cFri Jun 12 21:55:30 2020
(r362127)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "libsecureboot.h"
 #include 
@@ -532,6 +533,19 @@ verify_pcr_export(void)
DEBUG_PRINTF(1,
("%s: setenv(loader.ve.hashed, %s\n",
__func__, hinfo));
+   if ((hlen = strlen(hinfo)) > KENV_MVALLEN) {
+   /*
+* bump kenv_mvallen
+* roundup to multiple of KENV_MVALLEN
+*/
+   char mvallen[16];
+
+   hlen += KENV_MVALLEN -
+   (hlen % KENV_MVALLEN);
+   if (snprintf(mvallen, sizeof(mvallen),
+   "%d", (int) hlen) < 
sizeof(mvallen))
+   setenv("kenv_mvallen", mvallen, 
1);
+   }
free(hinfo);
}
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362126 - head/sys/vm

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:53:08 2020
New Revision: 362126
URL: https://svnweb.freebsd.org/changeset/base/362126

Log:
  Honor db_pager_quit in some vm_object ddb commands
  
  These can be rather verbose.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Fri Jun 12 21:51:20 2020(r362125)
+++ head/sys/vm/vm_object.c Fri Jun 12 21:53:08 2020(r362126)
@@ -2694,6 +2694,8 @@ DB_SHOW_COMMAND(vmochk, vm_object_check)
(void *)object->backing_object);
}
}
+   if (db_pager_quit)
+   return;
}
 }
 
@@ -2744,6 +2746,9 @@ DB_SHOW_COMMAND(object, vm_object_print_static)
 
db_printf("(off=0x%jx,page=0x%jx)",
(uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p));
+
+   if (db_pager_quit)
+   break;
}
if (count != 0)
db_printf("\n");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362125 - head/sys/security/mac_veriexec

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:51:20 2020
New Revision: 362125
URL: https://svnweb.freebsd.org/changeset/base/362125

Log:
  mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers
  
  v_writecount can actually be < 0 for text,
  so check for v_writecount > 0
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/sys/security/mac_veriexec/veriexec_fingerprint.c

Modified: head/sys/security/mac_veriexec/veriexec_fingerprint.c
==
--- head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:48:46 2020(r362124)
+++ head/sys/security/mac_veriexec/veriexec_fingerprint.c   Fri Jun 12 
21:51:20 2020(r362125)
@@ -215,7 +215,7 @@ mac_veriexec_fingerprint_check_vnode(struct vnode *vp,
int error;
 
/* reject fingerprint if writers are active */
-   if (vp->v_writecount)
+   if (vp->v_writecount > 0)
return (ETXTBSY);
 
if ((vp->v_mount->mnt_flag & MNT_VERIFIED) != 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362124 - head/stand/common

2020-06-12 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 12 21:48:46 2020
New Revision: 362124
URL: https://svnweb.freebsd.org/changeset/base/362124

Log:
  Minor cleanup of initialized variables
  
  Sort the list and cleanup trailing white-space
  
  Reviewed by:  stevek
  MFC after:1 week

Modified:
  head/stand/common/install.c

Modified: head/stand/common/install.c
==
--- head/stand/common/install.c Fri Jun 12 21:33:02 2020(r362123)
+++ head/stand/common/install.c Fri Jun 12 21:48:46 2020(r362124)
@@ -207,15 +207,15 @@ install(char *pkgname)
if (*s == '\0')
goto invalid_url;
 
-   proto = NULL;
devname = NULL;
devnamelen = 0;
-   
+   proto = NULL;
+   local = 0;
+
if (i == 4 && !strncasecmp(pkgname, "tftp", i)) {
devname = "net0";
devnamelen = 4;
proto = _fsops;
-   local = 0;
} else if (i == 4 && !strncasecmp(pkgname, "file", i)) {
currdev = getenv("currdev");
local = 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362123 - head/sys/crypto/aesni

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 21:33:02 2020
New Revision: 362123
URL: https://svnweb.freebsd.org/changeset/base/362123

Log:
  Fix AES-CCM requests with an AAD size smaller than a single block.
  
  The amount to copy for the first block is the minimum of the size of
  the AAD region or the remaining space in the first block.
  
  Reported by:  cryptocheck -z
  MFC after:2 weeks
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D25140

Modified:
  head/sys/crypto/aesni/aesni_ccm.c

Modified: head/sys/crypto/aesni/aesni_ccm.c
==
--- head/sys/crypto/aesni/aesni_ccm.c   Fri Jun 12 21:21:18 2020
(r362122)
+++ head/sys/crypto/aesni/aesni_ccm.c   Fri Jun 12 21:33:02 2020
(r362123)
@@ -155,7 +155,7 @@ cbc_mac_start(const unsigned char *auth_data, size_t a
 * already partially filled, by auth_amt, so we need
 * to handle that.  The last block needs to be zero padded.
 */
-   copy_amt = MIN(auth_len - auth_amt,
+   copy_amt = MIN(auth_len,
sizeof(staging_block) - auth_amt);
byte_ptr = (uint8_t*)_block;
bcopy(auth_ptr, _ptr[auth_amt], copy_amt);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362122 - in head/sys/mips: include mips

2020-06-12 Thread John Baldwin
Author: jhb
Date: Fri Jun 12 21:21:18 2020
New Revision: 362122
URL: https://svnweb.freebsd.org/changeset/base/362122

Log:
  Various fixes to TLS for MIPS.
  
  - Clear the current thread's TLS pointer on exec. Previously the TLS
pointer (and register) remain unchanged.
  
  - Explicitly clear the TLS pointer when new threads are created.
  
  - Make md_tls_tcb_offset per-process instead of per-thread.
  
The layout of the TLS and TCB are identical for all threads in a
process, it is only the TLS pointer values themselves that vary by
thread.  This also makes setting md_tls_tcb_offset in
cpu_set_user_tls() redundant with the setting in exec_setregs(), so
only set it in exec_setregs().
  
  Submitted by: Alfredo Mazzinghi (1)
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24957

Modified:
  head/sys/mips/include/proc.h
  head/sys/mips/mips/genassym.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/mips/mips/swtch.S
  head/sys/mips/mips/sys_machdep.c
  head/sys/mips/mips/trap.c
  head/sys/mips/mips/vm_machdep.c

Modified: head/sys/mips/include/proc.h
==
--- head/sys/mips/include/proc.hFri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/include/proc.hFri Jun 12 21:21:18 2020
(r362122)
@@ -64,7 +64,6 @@ struct mdthread {
int md_pc_count;/* performance counter */
int md_pc_spill;/* performance counter spill */
void*md_tls;
-   size_t  md_tls_tcb_offset;  /* TCB offset */
 #ifdef CPU_CNMIPS
struct octeon_cop2_state*md_cop2; /* kernel context */
struct octeon_cop2_state*md_ucop2; /* userland context */
@@ -79,8 +78,7 @@ struct mdthread {
 #defineMDTD_COP2USED   0x0002  /* Process used the COP2 */
 
 struct mdproc {
-   /* Avoid empty structs because they are undefined behavior. */
-   longmd_spare;
+   size_t  md_tls_tcb_offset;  /* TCB offset */
 };
 
 struct syscall_args {

Modified: head/sys/mips/mips/genassym.c
==
--- head/sys/mips/mips/genassym.c   Fri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/mips/genassym.c   Fri Jun 12 21:21:18 2020
(r362122)
@@ -70,13 +70,15 @@ __FBSDID("$FreeBSD$");
 #endif
 
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
+ASSYM(TD_PROC, offsetof(struct thread, td_proc));
 ASSYM(TD_UPTE, offsetof(struct thread, td_md.md_upte));
 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
 ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags));
 ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls));
-ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset));
+
+ASSYM(P_MDTLS_TCB_OFFSET, offsetof(struct proc, p_md.md_tls_tcb_offset));
 
 ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero));
 ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context));

Modified: head/sys/mips/mips/pm_machdep.c
==
--- head/sys/mips/mips/pm_machdep.c Fri Jun 12 21:17:56 2020
(r362121)
+++ head/sys/mips/mips/pm_machdep.c Fri Jun 12 21:21:18 2020
(r362122)
@@ -473,12 +473,15 @@ exec_setregs(struct thread *td, struct image_params *i
PCPU_SET(fpcurthread, (struct thread *)0);
td->td_md.md_ss_addr = 0;
 
+   td->td_md.md_tls = NULL;
 #ifdef COMPAT_FREEBSD32
if (!SV_PROC_FLAG(td->td_proc, SV_LP64))
-   td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32;
+   td->td_proc->p_md.md_tls_tcb_offset = TLS_TP_OFFSET +
+   TLS_TCB_SIZE32;
else
 #endif
-   td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE;
+   td->td_proc->p_md.md_tls_tcb_offset = TLS_TP_OFFSET +
+   TLS_TCB_SIZE;
 }
 
 int

Modified: head/sys/mips/mips/swtch.S
==
--- head/sys/mips/mips/swtch.S  Fri Jun 12 21:17:56 2020(r362121)
+++ head/sys/mips/mips/swtch.S  Fri Jun 12 21:21:18 2020(r362122)
@@ -386,7 +386,8 @@ sw2:
.globl  cpu_switch_set_userlocal
 cpu_switch_set_userlocal:
PTR_L   t0, TD_MDTLS(a1)# Get TLS pointer
-   PTR_L   t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset
+   PTR_L   t1, TD_PROC(a1)
+   PTR_L   t1, P_MDTLS_TCB_OFFSET(t1)  # Get TLS/TCB offset
PTR_ADDU v0, t0, t1
MTC0v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr
 

Modified: head/sys/mips/mips/sys_machdep.c
==
--- head/sys/mips/mips/sys_machdep.cFri 

svn commit: r362121 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:17:56 2020
New Revision: 362121
URL: https://svnweb.freebsd.org/changeset/base/362121

Log:
  FPU init: allocate initial state from UMA to ensure alignment
  
  The Intel Instruction Set Reference says this about the XSAVE instruction:
  
  Use of a destination operand not aligned to 64-byte boundary
  (in either 64-bit or 32-bit modes) results in a general-protection
  (#GP) exception.
  
  This alignment happens naturally when all malloc buckets are powers
  of two.  However, this change is necessary on some systems when
  certain non-power-of-two (and non-multiple of 64) malloc buckets
  are defined.
  
  Reviewed by:  cem; kib; earlier version by jhb
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:12:26 2020(r362120)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:17:56 2020(r362121)
@@ -372,8 +372,7 @@ fpuinitstate(void *arg __unused)
fpu_save_area_zone = uma_zcreate("FPU_save_area",
cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
XSAVE_AREA_ALIGN - 1, 0);
-   fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
-   M_WAITOK | M_ZERO);
+   fpu_initialstate = uma_zalloc(fpu_save_area_zone, M_WAITOK | M_ZERO);
if (use_xsave) {
max_ext_n = flsl(xsave_mask);
xsave_area_desc = malloc(max_ext_n * sizeof(struct

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 21:12:26 2020(r362120)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:17:56 2020(r362121)
@@ -483,8 +483,7 @@ npxinitstate(void *arg __unused)
fpu_save_area_zone = uma_zcreate("FPU_save_area",
cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
XSAVE_AREA_ALIGN - 1, 0);
-   npx_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
-   M_WAITOK | M_ZERO);
+   npx_initialstate = uma_zalloc(fpu_save_area_zone, M_WAITOK | M_ZERO);
if (use_xsave) {
if (xsave_mask >> 32 != 0)
max_ext_n = fls(xsave_mask >> 32) + 32;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362120 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:12:26 2020
New Revision: 362120
URL: https://svnweb.freebsd.org/changeset/base/362120

Log:
  FPU: make xsave_area_desc static
  
  ...because it can be.
  
  Reviewed by:  cem kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:10:45 2020(r362119)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:12:26 2020(r362120)
@@ -159,7 +159,7 @@ uint64_t xsave_mask;/* the same */
 static uma_zone_t fpu_save_area_zone;
 static struct savefpu *fpu_initialstate;
 
-struct xsave_area_elm_descr {
+static struct xsave_area_elm_descr {
u_int   offset;
u_int   size;
 } *xsave_area_desc;

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 21:10:45 2020(r362119)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:12:26 2020(r362120)
@@ -201,7 +201,7 @@ uint64_t xsave_mask;
 static uma_zone_t fpu_save_area_zone;
 static union savefpu *npx_initialstate;
 
-struct xsave_area_elm_descr {
+static struct xsave_area_elm_descr {
u_int   offset;
u_int   size;
 } *xsave_area_desc;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362119 - in head/sys: amd64/amd64 i386/i386

2020-06-12 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Jun 12 21:10:45 2020
New Revision: 362119
URL: https://svnweb.freebsd.org/changeset/base/362119

Log:
  FPU init: Do potentially blocking operations before disabling interrupts
  
  In particular, uma_zcreate creates sysctl oids, which locks an sx lock,
  which uses IPIs under contention.  IPIs tend not to work very well
  when interrupts are disabled.  Who knew, right?
  
  Reviewed by:  cem kib
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25098

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Fri Jun 12 20:39:42 2020(r362118)
+++ head/sys/amd64/amd64/fpu.c  Fri Jun 12 21:10:45 2020(r362119)
@@ -368,8 +368,18 @@ fpuinitstate(void *arg __unused)
register_t saveintr;
int cp[4], i, max_ext_n;
 
+   /* Do potentially blocking operations before disabling interrupts. */
+   fpu_save_area_zone = uma_zcreate("FPU_save_area",
+   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
+   XSAVE_AREA_ALIGN - 1, 0);
fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
M_WAITOK | M_ZERO);
+   if (use_xsave) {
+   max_ext_n = flsl(xsave_mask);
+   xsave_area_desc = malloc(max_ext_n * sizeof(struct
+   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
+   }
+
saveintr = intr_disable();
stop_emulating();
 
@@ -399,9 +409,6 @@ fpuinitstate(void *arg __unused)
offsetof(struct xstate_hdr, xstate_bv));
*xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE;
 
-   max_ext_n = flsl(xsave_mask);
-   xsave_area_desc = malloc(max_ext_n * sizeof(struct
-   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
/* x87 state */
xsave_area_desc[0].offset = 0;
xsave_area_desc[0].size = 160;
@@ -415,10 +422,6 @@ fpuinitstate(void *arg __unused)
xsave_area_desc[i].size = cp[0];
}
}
-
-   fpu_save_area_zone = uma_zcreate("FPU_save_area",
-   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
-   XSAVE_AREA_ALIGN - 1, 0);
 
start_emulating();
intr_restore(saveintr);

Modified: head/sys/i386/i386/npx.c
==
--- head/sys/i386/i386/npx.cFri Jun 12 20:39:42 2020(r362118)
+++ head/sys/i386/i386/npx.cFri Jun 12 21:10:45 2020(r362119)
@@ -479,8 +479,21 @@ npxinitstate(void *arg __unused)
if (!hw_float)
return;
 
+   /* Do potentially blocking operations before disabling interrupts. */
+   fpu_save_area_zone = uma_zcreate("FPU_save_area",
+   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
+   XSAVE_AREA_ALIGN - 1, 0);
npx_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF,
M_WAITOK | M_ZERO);
+   if (use_xsave) {
+   if (xsave_mask >> 32 != 0)
+   max_ext_n = fls(xsave_mask >> 32) + 32;
+   else
+   max_ext_n = fls(xsave_mask);
+   xsave_area_desc = malloc(max_ext_n * sizeof(struct
+   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
+   }
+
saveintr = intr_disable();
stop_emulating();
 
@@ -522,12 +535,6 @@ npxinitstate(void *arg __unused)
offsetof(struct xstate_hdr, xstate_bv));
*xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE;
 
-   if (xsave_mask >> 32 != 0)
-   max_ext_n = fls(xsave_mask >> 32) + 32;
-   else
-   max_ext_n = fls(xsave_mask);
-   xsave_area_desc = malloc(max_ext_n * sizeof(struct
-   xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
/* x87 state */
xsave_area_desc[0].offset = 0;
xsave_area_desc[0].size = 160;
@@ -541,10 +548,6 @@ npxinitstate(void *arg __unused)
xsave_area_desc[i].size = cp[0];
}
}
-
-   fpu_save_area_zone = uma_zcreate("FPU_save_area",
-   cpu_max_ext_state_size, NULL, NULL, NULL, NULL,
-   XSAVE_AREA_ALIGN - 1, 0);
 
start_emulating();
intr_restore(saveintr);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362113 - in head/sys/netinet: . tcp_stacks

2020-06-12 Thread Randall Stewart
Author: rrs
Date: Fri Jun 12 19:56:19 2020
New Revision: 362113
URL: https://svnweb.freebsd.org/changeset/base/362113

Log:
  So it turns out with the right window scaling you can get the code in all 
stacks to
  always want to do a window update, even when no data can be sent. Now in
  cases where you are not pacing thats probably ok, you just send an extra
  window update or two. However with bbr (and rack if its paced) every time
  the pacer goes off its going to send a "window update".
  
  Also in testing bbr I have found that if we are not responding to
  data right away we end up staying in startup but incorrectly holding
  a pacing gain of 192 (a loss). This is because the idle window code
  does not restict itself to only work with PROBE_BW. In all other
  states you dont want it doing a PROBE_BW state change.
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D25247

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_output.c   Fri Jun 12 19:56:19 2020
(r362113)
@@ -655,7 +655,10 @@ after_sack_rexmit:
adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else
+   adv = 0;
} else
oldwin = 0;
 

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_stacks/bbr.c   Fri Jun 12 19:56:19 2020
(r362113)
@@ -8078,7 +8078,7 @@ bbr_restart_after_idle(struct tcp_bbr *bbr, uint32_t c
bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_startup_pg;
bbr->r_ctl.rc_bbr_cwnd_gain = bbr->r_ctl.rc_startup_pg;
bbr_log_type_statechange(bbr, cts, __LINE__);
-   } else {
+   } else if (bbr->rc_bbr_state == BBR_STATE_PROBE_BW) {
bbr_substate_change(bbr, cts, __LINE__, 1);
}
}
@@ -12000,21 +12000,27 @@ bbr_window_update_needed(struct tcpcb *tp, struct sock
 * "adv" is the amount we could increase the window, taking into
 * account that we are limited by TCP_MAXWIN << tp->rcv_scale.
 */
-   uint32_t adv;
+   int32_t adv;
int32_t oldwin;
 
-   adv = min(recwin, TCP_MAXWIN << tp->rcv_scale);
+   adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else {
+   /* We can't increase the window */
+   adv = 0;
+   }
} else
oldwin = 0;
 
/*
-* If the new window size ends up being the same as the old size
-* when it is scaled, then don't force a window update.
+* If the new window size ends up being the same as or less
+* than the old size when it is scaled, then don't force
+* a window update.
 */
-   if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale)
+   if (oldwin >> tp->rcv_scale >= (adv + oldwin) >> tp->rcv_scale)
return (0);
 
if (adv >= (2 * maxseg) &&

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Fri Jun 12 18:41:12 2020
(r362112)
+++ head/sys/netinet/tcp_stacks/rack.c  Fri Jun 12 19:56:19 2020
(r362113)
@@ -12845,18 +12845,24 @@ again:
int32_t adv;
int oldwin;
 
-   adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale);
+   adv = recwin;
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
oldwin = (tp->rcv_adv - tp->rcv_nxt);
-   adv -= oldwin;
+   if (adv > oldwin)
+   adv -= oldwin;
+   else {
+   /* We can't increase the window */
+   adv = 0;
+   }
} else
oldwin = 0;
 
/*
-* If the new window size ends up being the same as the old
-* size when it is scaled, then don't force a window update.
+ 

svn commit: r362112 - head/sys/x86/x86

2020-06-12 Thread Andrew Gallatin
Author: gallatin
Date: Fri Jun 12 18:41:12 2020
New Revision: 362112
URL: https://svnweb.freebsd.org/changeset/base/362112

Log:
  x86: Bump default msi/msix vector limit to 2048
  
  Given that 64c/128t CPUs are currently available, and that many
  devices (nvme, many NICs) desire to map 1 MSI-X vector per core,
  or even 1 per-thread, it is becoming far easier to see MSI-X interrupt
  setup fail due to msi vector exhaustion, and devices fail to attach at
  boot on large system.
  
  This bump costs 12KB on amd64 (and 6KB on i386), which seems
  worth the trade off for a better out of the box experience on
  high end hardware.
  
  Reviewed by:  jhb
  MFC after:21 days
  Sponsored by: Netflix

Modified:
  head/sys/x86/x86/msi.c

Modified: head/sys/x86/x86/msi.c
==
--- head/sys/x86/x86/msi.c  Fri Jun 12 18:13:32 2020(r362111)
+++ head/sys/x86/x86/msi.c  Fri Jun 12 18:41:12 2020(r362112)
@@ -156,7 +156,7 @@ u_int first_msi_irq;
 SYSCTL_UINT(_machdep, OID_AUTO, first_msi_irq, CTLFLAG_RD, _msi_irq, 0,
 "Number of first IRQ reserved for MSI and MSI-X interrupts");
 
-u_int num_msi_irqs = 512;
+u_int num_msi_irqs = 2048;
 SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, _msi_irqs, 0,
 "Number of IRQs reserved for MSI and MSI-X interrupts");
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362111 - head/lib/libc/gen

2020-06-12 Thread Kyle Evans
Author: kevans
Date: Fri Jun 12 18:13:32 2020
New Revision: 362111
URL: https://svnweb.freebsd.org/changeset/base/362111

Log:
  posix_spawn: fix for some custom allocator setups
  
  libc cannot assume that aligned_alloc and free come from jemalloc, or that
  any application providing its own malloc and free is actually providing
  aligned_alloc.
  
  Switch back to malloc and just make sure we're passing a properly aligned
  stack into rfork_thread, as an application perhaps can't reasonably replace
  just malloc or just free without headaches.
  
  This unbreaks ksh93 after r361996, which provides malloc/free but no
  aligned_alloc.
  
  Reported by:  freqlabs
  Diagnosed by: Andrew Gierth 
  X-MFC-With:   r361996

Modified:
  head/lib/libc/gen/posix_spawn.c

Modified: head/lib/libc/gen/posix_spawn.c
==
--- head/lib/libc/gen/posix_spawn.c Fri Jun 12 17:48:12 2020
(r362110)
+++ head/lib/libc/gen/posix_spawn.c Fri Jun 12 18:13:32 2020
(r362111)
@@ -276,9 +276,19 @@ do_posix_spawn(pid_t *pid, const char *path,
stacksz += MAX(3, cnt + 2) * sizeof(char *);
stacksz = PSPAWN_STACK_ALIGN(stacksz);
}
-   stack = aligned_alloc(PSPAWN_STACK_ALIGNMENT, stacksz);
+
+   /*
+* aligned_alloc is not safe to use here, because we can't guarantee
+* that aligned_alloc and free will be provided by the same
+* implementation.  We've actively hit at least one application that
+* will provide its own malloc/free but not aligned_alloc leading to
+* a free by the wrong allocator.
+*/
+   stack = malloc(stacksz);
if (stack == NULL)
return (ENOMEM);
+   stacksz = (((uintptr_t)stack + stacksz) & ~PSPAWN_STACK_ALIGNBYTES) -
+   (uintptr_t)stack;
 #endif
psa.path = path;
psa.fa = fa;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
As far as I know, by undoing the change that introduced the compilation
error, I have fixed the compilation error.  If you mean to ask whether I
intend to fix the underlying linuxkpi error, which motivated the earlier
unfortunate change, then yes, I do.  I intend to make things better as
soon as I can.  Thanks for your inquiry.

Doug Moore

On 2020-06-12 12:53, Hans Petter Selasky wrote:
> On 2020-06-12 19:51, Hans Petter Selasky wrote:
>> On 2020-06-12 19:48, Doug Moore wrote:
>>> Author: dougm
>>> Date: Fri Jun 12 17:48:12 2020
>>> New Revision: 362110
>>> URL: https://svnweb.freebsd.org/changeset/base/362110
>>>
>>> Log:
>>>    Revert r362108, as it breaks compilation.
>>>
>>> Modified:
>>>    head/sys/compat/linuxkpi/common/include/linux/rbtree.h
>>>
>>> Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
>>> ==
>>>
>>> --- head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri
>>> Jun 12 17:31:38 2020    (r362109)
>>> +++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri
>>> Jun 12 17:48:12 2020    (r362110)
>>> @@ -37,8 +37,8 @@
>>>   struct rb_node {
>>>   RB_ENTRY(rb_node)    __entry;
>>>   };
>>> -#define    rb_left    RB_PTR(__entry.rbe_left)
>>> -#define    rb_right    RB_PTR(__entry.rbe_right)
>>> +#define    rb_left    __entry.rbe_left
>>> +#define    rb_right    __entry.rbe_right
>>>   /*
>>>    * We provide a false structure that has the same bit pattern as
>>> tree.h
>>>
>>
>> Are you planning to fix those compilation errors?
>>
>
> Or is the current code fine?
>
> --HPS
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Hans Petter Selasky

On 2020-06-12 19:51, Hans Petter Selasky wrote:

On 2020-06-12 19:48, Doug Moore wrote:

Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
   Revert r362108, as it breaks compilation.

Modified:
   head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
== 

--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri Jun 
12 17:31:38 2020    (r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h    Fri Jun 
12 17:48:12 2020    (r362110)

@@ -37,8 +37,8 @@
  struct rb_node {
  RB_ENTRY(rb_node)    __entry;
  };
-#define    rb_left    RB_PTR(__entry.rbe_left)
-#define    rb_right    RB_PTR(__entry.rbe_right)
+#define    rb_left    __entry.rbe_left
+#define    rb_right    __entry.rbe_right
  /*
   * We provide a false structure that has the same bit pattern as tree.h



Are you planning to fix those compilation errors?



Or is the current code fine?

--HPS

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Hans Petter Selasky

On 2020-06-12 19:48, Doug Moore wrote:

Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
   Revert r362108, as it breaks compilation.

Modified:
   head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:31:38 2020(r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:48:12 2020(r362110)
@@ -37,8 +37,8 @@
  struct rb_node {
RB_ENTRY(rb_node)   __entry;
  };
-#definerb_left RB_PTR(__entry.rbe_left)
-#definerb_rightRB_PTR(__entry.rbe_right)
+#definerb_left __entry.rbe_left
+#definerb_right__entry.rbe_right
  
  /*

   * We provide a false structure that has the same bit pattern as tree.h



Are you planning to fix those compilation errors?

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362110 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
Author: dougm
Date: Fri Jun 12 17:48:12 2020
New Revision: 362110
URL: https://svnweb.freebsd.org/changeset/base/362110

Log:
  Revert r362108, as it breaks compilation.

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:31:38 2020(r362109)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
17:48:12 2020(r362110)
@@ -37,8 +37,8 @@
 struct rb_node {
RB_ENTRY(rb_node)   __entry;
 };
-#definerb_left RB_PTR(__entry.rbe_left)
-#definerb_rightRB_PTR(__entry.rbe_right)
+#definerb_left __entry.rbe_left
+#definerb_right__entry.rbe_right
 
 /*
  * We provide a false structure that has the same bit pattern as tree.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362109 - in head/sys: arm64/coresight conf

2020-06-12 Thread Ruslan Bukin
Author: br
Date: Fri Jun 12 17:31:38 2020
New Revision: 362109
URL: https://svnweb.freebsd.org/changeset/base/362109

Log:
  Coresight replicator:
  o Add a header file;
  o Split-out FDT attachment to a separate file;
  o Add ACPI attachment.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/arm64/coresight/coresight_replicator.h   (contents, props changed)
  head/sys/arm64/coresight/coresight_replicator_acpi.c   (contents, props 
changed)
  head/sys/arm64/coresight/coresight_replicator_fdt.c   (contents, props 
changed)
Modified:
  head/sys/arm64/coresight/coresight_replicator.c
  head/sys/conf/files.arm64

Modified: head/sys/arm64/coresight/coresight_replicator.c
==
--- head/sys/arm64/coresight/coresight_replicator.c Fri Jun 12 16:51:55 
2020(r362108)
+++ head/sys/arm64/coresight/coresight_replicator.c Fri Jun 12 17:31:38 
2020(r362109)
@@ -41,25 +41,10 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
-#include 
-#include 
-
 #include "coresight_if.h"
 
-#defineREPLICATOR_IDFILTER00x00
-#defineREPLICATOR_IDFILTER10x04
-
-static struct ofw_compat_data compat_data[] = {
-   { "arm,coresight-dynamic-replicator",   1 },
-   { NULL, 0 }
-};
-
-struct replicator_softc {
-   struct resource *res;
-   struct coresight_platform_data  *pdata;
-};
-
 static struct resource_spec replicator_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },
{ -1, 0 }
@@ -111,21 +96,6 @@ replicator_disable(device_t dev, struct endpoint *endp
 }
 
 static int
-replicator_probe(device_t dev)
-{
-
-   if (!ofw_bus_status_okay(dev))
-   return (ENXIO);
-
-   if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
-   return (ENXIO);
-
-   device_set_desc(dev, "Coresight Dynamic Replicator");
-
-   return (BUS_PROBE_DEFAULT);
-}
-
-static int
 replicator_attach(device_t dev)
 {
struct replicator_softc *sc;
@@ -149,7 +119,6 @@ replicator_attach(device_t dev)
 
 static device_method_t replicator_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, replicator_probe),
DEVMETHOD(device_attach,replicator_attach),
 
/* Coresight interface */
@@ -159,14 +128,5 @@ static device_method_t replicator_methods[] = {
DEVMETHOD_END
 };
 
-static driver_t replicator_driver = {
-   "replicator",
-   replicator_methods,
-   sizeof(struct replicator_softc),
-};
-
-static devclass_t replicator_devclass;
-
-DRIVER_MODULE(replicator, simplebus, replicator_driver, replicator_devclass,
-0, 0);
-MODULE_VERSION(replicator, 1);
+DEFINE_CLASS_0(replicator, replicator_driver, replicator_methods,
+sizeof(struct replicator_softc));

Added: head/sys/arm64/coresight/coresight_replicator.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/coresight/coresight_replicator.h Fri Jun 12 17:31:38 
2020(r362109)
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2020 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef_ARM64_CORESIGHT_CORESIGHT_REPLICATOR_H_
+#define_ARM64_CORESIGHT_CORESIGHT_REPLICATOR_H_
+
+#defineREPLICATOR_IDFILTER00x00
+#define

svn commit: r362108 - head/sys/compat/linuxkpi/common/include/linux

2020-06-12 Thread Doug Moore
Author: dougm
Date: Fri Jun 12 16:51:55 2020
New Revision: 362108
URL: https://svnweb.freebsd.org/changeset/base/362108

Log:
  The linuxkpi code accesses left/right rb tree pointers without using
  RB_LEFT or RB_RIGHT, so they aren't stripping off the color bit
  encoded there. Strip off that bit for linuxkpi.
  
  Reported by:  dch
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25245

Modified:
  head/sys/compat/linuxkpi/common/include/linux/rbtree.h

Modified: head/sys/compat/linuxkpi/common/include/linux/rbtree.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
16:40:10 2020(r362107)
+++ head/sys/compat/linuxkpi/common/include/linux/rbtree.h  Fri Jun 12 
16:51:55 2020(r362108)
@@ -37,8 +37,8 @@
 struct rb_node {
RB_ENTRY(rb_node)   __entry;
 };
-#definerb_left __entry.rbe_left
-#definerb_right__entry.rbe_right
+#definerb_left RB_PTR(__entry.rbe_left)
+#definerb_rightRB_PTR(__entry.rbe_right)
 
 /*
  * We provide a false structure that has the same bit pattern as tree.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362107 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 16:40:10 2020
New Revision: 362107
URL: https://svnweb.freebsd.org/changeset/base/362107

Log:
  Whitespace change due to upstream cleanup.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Fri Jun 12 16:31:13 2020
(r362106)
+++ head/sys/netinet/sctp_constants.h   Fri Jun 12 16:40:10 2020
(r362107)
@@ -992,7 +992,7 @@ do { \
 #define sctp_sowwakeup_locked(inp, so) \
 do { \
if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \
-SOCKBUF_UNLOCK(&((so)->so_snd)); \
+   SOCKBUF_UNLOCK(&((so)->so_snd)); \
inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEOUTPUT; \
} else { \
sowwakeup_locked(so); \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362106 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 16:31:13 2020
New Revision: 362106
URL: https://svnweb.freebsd.org/changeset/base/362106

Log:
  More cleanups due to ifdef cleanup done upstream
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_pcb.h
  head/sys/netinet/sctp_structs.h
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Fri Jun 12 15:37:55 2020
(r362105)
+++ head/sys/netinet/sctp_constants.h   Fri Jun 12 16:31:13 2020
(r362106)
@@ -1012,7 +1012,7 @@ do { \
 do { \
if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \
inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEINPUT; \
-SOCKBUF_UNLOCK(&((so)->so_rcv)); \
+   SOCKBUF_UNLOCK(&((so)->so_rcv)); \
} else { \
sorwakeup_locked(so); \
} \

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Fri Jun 12 15:37:55 2020
(r362105)
+++ head/sys/netinet/sctp_input.c   Fri Jun 12 16:31:13 2020
(r362106)
@@ -5723,7 +5723,7 @@ out:
return;
 }
 
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
 extern int *sctp_cpuarry;
 #endif
 
@@ -5735,7 +5735,7 @@ sctp_input(struct mbuf **mp, int *offp, int proto SCTP
 
m = *mp;
off = *offp;
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
if (mp_ncpus > 1) {
struct ip *ip;
struct sctphdr *sh;

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Fri Jun 12 15:37:55 2020(r362105)
+++ head/sys/netinet/sctp_pcb.c Fri Jun 12 16:31:13 2020(r362106)
@@ -5535,18 +5535,14 @@ sctp_del_local_addr_restricted(struct sctp_tcb *stcb, 
return;
 }
 
-/*
- * Temporarily remove for __APPLE__ until we use the Tiger equivalents
- */
 /* sysctl */
 static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC;
 static int sctp_scale_up_for_address = SCTP_SCALE_FOR_ADDR;
 
-
-
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
 struct sctp_mcore_ctrl *sctp_mcore_workers = NULL;
 int *sctp_cpuarry = NULL;
+
 void
 sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use)
 {
@@ -5716,13 +5712,13 @@ sctp_pcb_init(void)
 #if defined(SCTP_LOCAL_TRACE_BUF)
memset(_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log));
 #endif
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *,
((mp_maxid + 1) * sizeof(struct sctpstat)),
SCTP_M_MCORE);
 #endif
(void)SCTP_GETTIME_TIMEVAL();
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
memset(SCTP_BASE_STATS, 0, sizeof(struct sctpstat) * (mp_maxid + 1));
SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = 
(uint32_t)tv.tv_sec;
SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = 
(uint32_t)tv.tv_usec;
@@ -5833,7 +5829,7 @@ sctp_pcb_init(void)
}
sctp_startup_iterator();
 
-#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP)
+#if defined(SCTP_MCORE_INPUT) && defined(SMP)
sctp_startup_mcore_threads();
 #endif
 
@@ -5988,7 +5984,7 @@ retry:
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_strmoq));
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf));
SCTP_ZONE_DESTROY(SCTP_BASE_INFO(ipi_zone_asconf_ack));
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE);
 #endif
 }

Modified: head/sys/netinet/sctp_pcb.h
==
--- head/sys/netinet/sctp_pcb.h Fri Jun 12 15:37:55 2020(r362105)
+++ head/sys/netinet/sctp_pcb.h Fri Jun 12 16:31:13 2020(r362106)
@@ -246,7 +246,7 @@ struct sctp_base_info {
 * All static structures that anchor the system must be here.
 */
struct sctp_epinfo sctppcbinfo;
-#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
struct sctpstat *sctpstat;
 #else
struct sctpstat sctpstat;
@@ -478,7 +478,6 @@ struct sctp_tcb {
 #include 
 
 
-/* TODO where to put non-_KERNEL things for __Userspace__? */
 #if 

svn commit: r362104 - in head: share/man/man4 sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:37:50 2020
New Revision: 362104
URL: https://svnweb.freebsd.org/changeset/base/362104

Log:
  Add compat.linux.debug sysctl, to make it possible to silence down
  the debug messages. While here, clean up some variable naming.
  
  Reviewed by:  bcr (manpages), emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25230

Modified:
  head/share/man/man4/linux.4
  head/sys/compat/linux/linux_mib.c
  head/sys/compat/linux/linux_mib.h
  head/sys/compat/linux/linux_util.c

Modified: head/share/man/man4/linux.4
==
--- head/share/man/man4/linux.4 Fri Jun 12 14:31:19 2020(r362103)
+++ head/share/man/man4/linux.4 Fri Jun 12 14:37:50 2020(r362104)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 10, 2020
+.Dd June 12, 2020
 .Dt LINUX 4
 .Os
 .Sh NAME
@@ -95,6 +95,10 @@ variables and
 .Xr loader 8
 tunables:
 .Bl -tag -width indent
+.It Va compat.linux.debug
+Enable debugging messages.
+Set to 0 to silence them.
+Defaults to 1.
 .It Va compat.linux.default_openfiles
 Default soft openfiles resource limit for Linux applications.
 Set to -1 to disable the limit.

Modified: head/sys/compat/linux/linux_mib.c
==
--- head/sys/compat/linux/linux_mib.c   Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_mib.c   Fri Jun 12 14:37:50 2020
(r362104)
@@ -63,6 +63,10 @@ static unsigned linux_osd_jail_slot;
 SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
 "Linux mode");
 
+int linux_debug = 1;
+SYSCTL_INT(_compat_linux, OID_AUTO, debug, CTLFLAG_RWTUN,
+_debug, 0, "Log warnings from linux(4); or 0 to disable");
+
 int linux_default_openfiles = 1024;
 SYSCTL_INT(_compat_linux, OID_AUTO, default_openfiles, CTLFLAG_RWTUN,
 _default_openfiles, 0,

Modified: head/sys/compat/linux/linux_mib.h
==
--- head/sys/compat/linux/linux_mib.h   Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_mib.h   Fri Jun 12 14:37:50 2020
(r362104)
@@ -62,6 +62,7 @@ int   linux_kernver(struct thread *td);
 
 #definelinux_use26(t)  (linux_kernver(t) >= 
LINUX_KERNVER_2006000)
 
+extern int linux_debug;
 extern int linux_default_openfiles;
 extern int linux_ignore_ip_recverr;
 extern int linux_preserve_vstatus;

Modified: head/sys/compat/linux/linux_util.c
==
--- head/sys/compat/linux/linux_util.c  Fri Jun 12 14:31:19 2020
(r362103)
+++ head/sys/compat/linux/linux_util.c  Fri Jun 12 14:37:50 2020
(r362104)
@@ -91,6 +91,9 @@ linux_msg(const struct thread *td, const char *fmt, ..
va_list ap;
struct proc *p;
 
+   if (linux_debug == 0)
+   return;
+
p = td->td_proc;
printf("linux: pid %d (%s): ", (int)p->p_pid, p->p_comm);
va_start(ap, fmt);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362103 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:31:19 2020
New Revision: 362103
URL: https://svnweb.freebsd.org/changeset/base/362103

Log:
  Fix naming clash.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cFri Jun 12 14:25:32 2020
(r362102)
+++ head/sys/compat/linux/linux_socket.cFri Jun 12 14:31:19 2020
(r362103)
@@ -943,7 +943,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
struct msghdr msg;
struct l_cmsghdr linux_cmsg;
struct l_cmsghdr *ptr_cmsg;
-   struct l_msghdr linux_msg;
+   struct l_msghdr linux_msghdr;
struct iovec *iov;
socklen_t datalen;
struct sockaddr *sa;
@@ -955,7 +955,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
l_size_t clen;
int error, fflag;
 
-   error = copyin(msghdr, _msg, sizeof(linux_msg));
+   error = copyin(msghdr, _msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
 
@@ -966,10 +966,11 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
 * order to handle this case.  This should be checked, but allows the
 * Linux ping to work.
 */
-   if (PTRIN(linux_msg.msg_control) != NULL && linux_msg.msg_controllen == 
0)
-   linux_msg.msg_control = PTROUT(NULL);
+   if (PTRIN(linux_msghdr.msg_control) != NULL &&
+   linux_msghdr.msg_controllen == 0)
+   linux_msghdr.msg_control = PTROUT(NULL);
 
-   error = linux_to_bsd_msghdr(, _msg);
+   error = linux_to_bsd_msghdr(, _msghdr);
if (error != 0)
return (error);
 
@@ -1007,7 +1008,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
goto bad;
}
 
-   if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) {
+   if (linux_msghdr.msg_controllen >= sizeof(struct l_cmsghdr)) {
 
error = ENOBUFS;
control = m_get(M_WAITOK, MT_CONTROL);
@@ -1015,8 +1016,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
data = mtod(control, void *);
datalen = 0;
 
-   ptr_cmsg = PTRIN(linux_msg.msg_control);
-   clen = linux_msg.msg_controllen;
+   ptr_cmsg = PTRIN(linux_msghdr.msg_control);
+   clen = linux_msghdr.msg_controllen;
do {
error = copyin(ptr_cmsg, _cmsg,
sizeof(struct l_cmsghdr));
@@ -1151,7 +1152,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
struct l_cmsghdr *linux_cmsg = NULL;
struct l_ucred linux_ucred;
socklen_t datalen, maxlen, outlen;
-   struct l_msghdr linux_msg;
+   struct l_msghdr linux_msghdr;
struct iovec *iov, *uiov;
struct mbuf *control = NULL;
struct mbuf **controlp;
@@ -1163,11 +1164,11 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
void *data;
int error, i, fd, fds, *fdp;
 
-   error = copyin(msghdr, _msg, sizeof(linux_msg));
+   error = copyin(msghdr, _msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
 
-   error = linux_to_bsd_msghdr(msg, _msg);
+   error = linux_to_bsd_msghdr(msg, _msghdr);
if (error != 0)
return (error);
 
@@ -1195,7 +1196,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
 
if (msg->msg_name) {
-   msg->msg_name = PTRIN(linux_msg.msg_name);
+   msg->msg_name = PTRIN(linux_msghdr.msg_name);
error = bsd_to_linux_sockaddr(sa, , msg->msg_namelen);
if (error == 0)
error = copyout(lsa, PTRIN(msg->msg_name),
@@ -1205,12 +1206,12 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
}
 
-   error = bsd_to_linux_msghdr(msg, _msg);
+   error = bsd_to_linux_msghdr(msg, _msghdr);
if (error != 0)
goto bad;
 
-   maxlen = linux_msg.msg_controllen;
-   linux_msg.msg_controllen = 0;
+   maxlen = linux_msghdr.msg_controllen;
+   linux_msghdr.msg_controllen = 0;
if (control) {
linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO);
 
@@ -1218,7 +1219,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
msg->msg_controllen = control->m_len;
 
cm = CMSG_FIRSTHDR(msg);
-   outbuf = PTRIN(linux_msg.msg_control);
+   outbuf = PTRIN(linux_msghdr.msg_control);
outlen = 0;
while (cm != NULL) {
linux_cmsg->cmsg_type =
@@ -1284,7 +1285,7 @@ linux_recvmsg_common(struct thread *td, 

svn commit: r362102 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:25:32 2020
New Revision: 362102
URL: https://svnweb.freebsd.org/changeset/base/362102

Log:
  Make linux(4) warn about unsupported fcntls.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25231

Modified:
  head/sys/compat/linux/linux_file.c

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Fri Jun 12 14:23:10 2020
(r362101)
+++ head/sys/compat/linux/linux_file.c  Fri Jun 12 14:25:32 2020
(r362102)
@@ -1371,9 +1371,10 @@ fcntl_common(struct thread *td, struct linux_fcntl_arg
 
case LINUX_F_DUPFD_CLOEXEC:
return (kern_fcntl(td, args->fd, F_DUPFD_CLOEXEC, args->arg));
+   default:
+   linux_msg(td, "unsupported fcntl cmd %d\n", args->cmd);
+   return (EINVAL);
}
-
-   return (EINVAL);
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362101 - head/sys/compat/linux

2020-06-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jun 12 14:23:10 2020
New Revision: 362101
URL: https://svnweb.freebsd.org/changeset/base/362101

Log:
  Minor code cleanup; no functional changes.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25232

Modified:
  head/sys/compat/linux/linux_socket.c
  head/sys/compat/linux/linux_socket.h

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cFri Jun 12 14:14:01 2020
(r362100)
+++ head/sys/compat/linux/linux_socket.cFri Jun 12 14:23:10 2020
(r362101)
@@ -92,10 +92,9 @@ static int
 linux_to_bsd_sockopt_level(int level)
 {
 
-   switch (level) {
-   case LINUX_SOL_SOCKET:
+   if (level == LINUX_SOL_SOCKET)
return (SOL_SOCKET);
-   }
+   /* Remaining values are RFC-defined protocol numbers. */
return (level);
 }
 
@@ -103,10 +102,8 @@ static int
 bsd_to_linux_sockopt_level(int level)
 {
 
-   switch (level) {
-   case SOL_SOCKET:
+   if (level == SOL_SOCKET)
return (LINUX_SOL_SOCKET);
-   }
return (level);
 }
 

Modified: head/sys/compat/linux/linux_socket.h
==
--- head/sys/compat/linux/linux_socket.hFri Jun 12 14:14:01 2020
(r362100)
+++ head/sys/compat/linux/linux_socket.hFri Jun 12 14:23:10 2020
(r362101)
@@ -170,12 +170,6 @@ int linux_accept(struct thread *td, struct linux_accep
 
 /* Socket defines */
 #defineLINUX_SOL_SOCKET1
-#defineLINUX_SOL_IP0
-#defineLINUX_SOL_TCP   6
-#defineLINUX_SOL_UDP   17
-#defineLINUX_SOL_IPV6  41
-#defineLINUX_SOL_IPX   256
-#defineLINUX_SOL_AX25  257
 
 #defineLINUX_SO_DEBUG  1
 #defineLINUX_SO_REUSEADDR  2
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362100 - head/sys/dev/nvme

2020-06-12 Thread Alexander Motin
Author: mav
Date: Fri Jun 12 14:14:01 2020
New Revision: 362100
URL: https://svnweb.freebsd.org/changeset/base/362100

Log:
  Fix config_intrhook leak on initial reset failure.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Fri Jun 12 13:59:58 2020
(r362099)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Fri Jun 12 14:14:01 2020
(r362100)
@@ -1126,12 +1126,14 @@ nvme_ctrlr_start_config_hook(void *arg)
status = nvme_ctrlr_hw_reset(ctrlr);
if (status != 0) {
nvme_ctrlr_fail(ctrlr);
+   config_intrhook_disestablish(>config_hook);
return;
}
 
status = nvme_ctrlr_hw_reset(ctrlr);
if (status != 0) {
nvme_ctrlr_fail(ctrlr);
+   config_intrhook_disestablish(>config_hook);
return;
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362099 - in head/sys: arm64/coresight conf

2020-06-12 Thread Ruslan Bukin
Author: br
Date: Fri Jun 12 13:59:58 2020
New Revision: 362099
URL: https://svnweb.freebsd.org/changeset/base/362099

Log:
  ARM Coresight Trace Memory Controller (TMC):
  o Split-out FDT attachment to a separate file;
  o Add ACPI attachment.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/arm64/coresight/coresight_tmc_acpi.c   (contents, props changed)
  head/sys/arm64/coresight/coresight_tmc_fdt.c   (contents, props changed)
Modified:
  head/sys/arm64/coresight/coresight_tmc.c
  head/sys/arm64/coresight/coresight_tmc.h
  head/sys/conf/files.arm64

Modified: head/sys/arm64/coresight/coresight_tmc.c
==
--- head/sys/arm64/coresight/coresight_tmc.cFri Jun 12 13:54:41 2020
(r362098)
+++ head/sys/arm64/coresight/coresight_tmc.cFri Jun 12 13:59:58 2020
(r362099)
@@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-#include 
-
 #include "coresight_if.h"
 
 #defineTMC_DEBUG
@@ -56,25 +53,6 @@ __FBSDID("$FreeBSD$");
 #definedprintf(fmt, ...)
 #endif
 
-static struct ofw_compat_data compat_data[] = {
-   { "arm,coresight-tmc",  1 },
-   { NULL, 0 }
-};
-
-struct tmc_softc {
-   struct resource *res;
-   device_tdev;
-   uint64_tcycle;
-   struct coresight_platform_data  *pdata;
-   uint32_tdev_type;
-#defineCORESIGHT_UNKNOWN   0
-#defineCORESIGHT_ETR   1
-#defineCORESIGHT_ETF   2
-   uint32_tnev;
-   struct coresight_event  *event;
-   boolean_t   etf_configured;
-};
-
 static struct resource_spec tmc_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },
{ -1, 0 }
@@ -335,21 +313,6 @@ tmc_read(device_t dev, struct endpoint *endp,
 }
 
 static int
-tmc_probe(device_t dev)
-{
-
-   if (!ofw_bus_status_okay(dev))
-   return (ENXIO);
-
-   if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
-   return (ENXIO);
-
-   device_set_desc(dev, "Coresight Trace Memory Controller (TMC)");
-
-   return (BUS_PROBE_DEFAULT);
-}
-
-static int
 tmc_attach(device_t dev)
 {
struct coresight_desc desc;
@@ -375,7 +338,6 @@ tmc_attach(device_t dev)
 
 static device_method_t tmc_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, tmc_probe),
DEVMETHOD(device_attach,tmc_attach),
 
/* Coresight interface */
@@ -386,13 +348,4 @@ static device_method_t tmc_methods[] = {
DEVMETHOD_END
 };
 
-static driver_t tmc_driver = {
-   "tmc",
-   tmc_methods,
-   sizeof(struct tmc_softc),
-};
-
-static devclass_t tmc_devclass;
-
-DRIVER_MODULE(tmc, simplebus, tmc_driver, tmc_devclass, 0, 0);
-MODULE_VERSION(tmc, 1);
+DEFINE_CLASS_0(tmc, tmc_driver, tmc_methods, sizeof(struct tmc_softc));

Modified: head/sys/arm64/coresight/coresight_tmc.h
==
--- head/sys/arm64/coresight/coresight_tmc.hFri Jun 12 13:54:41 2020
(r362098)
+++ head/sys/arm64/coresight/coresight_tmc.hFri Jun 12 13:59:58 2020
(r362099)
@@ -116,4 +116,20 @@
 #defineTMC_COMPID2 0xFF8 /* Component ID2 Register */
 #defineTMC_COMPID3 0xFFC /* Component ID3 Register */
 
+DECLARE_CLASS(tmc_driver);
+
+struct tmc_softc {
+   struct resource *res;
+   device_tdev;
+   uint64_tcycle;
+   struct coresight_platform_data  *pdata;
+   uint32_tdev_type;
+#defineCORESIGHT_UNKNOWN   0
+#defineCORESIGHT_ETR   1
+#defineCORESIGHT_ETF   2
+   uint32_tnev;
+   struct coresight_event  *event;
+   boolean_t   etf_configured;
+};
+
 #endif /* !_ARM64_CORESIGHT_CORESIGHT_TMC_H_ */

Added: head/sys/arm64/coresight/coresight_tmc_acpi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/coresight/coresight_tmc_acpi.c   Fri Jun 12 13:59:58 
2020(r362099)
@@ -0,0 +1,79 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Ruslan Bukin 
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory (Department of Computer Science and
+ * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+ * DARPA SSITH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following 

svn commit: r362095 - in head/contrib/sqlite3: . tea tea/generic

2020-06-12 Thread Cy Schubert
Author: cy
Date: Fri Jun 12 13:02:44 2020
New Revision: 362095
URL: https://svnweb.freebsd.org/changeset/base/362095

Log:
  MFV r362082:
  
  Update sqlite3 3.31.1 --> 3.32.0.
  
  PR:   247149
  Reported by:  spam...@bitbert.com
  Reminded by:  emaste
  MFC after:3 days
  Security: CVE-2020-11655, CVE-2020-13434, CVE-2020-13435,
CVE-2020-13630, CVE-2020-13631, CVE-2020-13632

Modified:
  head/contrib/sqlite3/Makefile.msc
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/shell.c
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/sqlite3ext.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
  head/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/Makefile.msc
==
--- head/contrib/sqlite3/Makefile.msc   Fri Jun 12 11:44:30 2020
(r362094)
+++ head/contrib/sqlite3/Makefile.msc   Fri Jun 12 13:02:44 2020
(r362095)
@@ -196,6 +196,7 @@ OSTRACE = 0
 DEBUG = 0
 !ENDIF
 
+
 # Enable use of available compiler optimizations?  Normally, this should be
 # non-zero.  Setting this to zero, thus disabling all compiler optimizations,
 # can be useful for testing.
@@ -288,6 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
+OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
 !ENDIF
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Fri Jun 12 11:44:30 2020
(r362094)
+++ head/contrib/sqlite3/configure  Fri Jun 12 13:02:44 2020
(r362095)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.31.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.32.0.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.31.1'
-PACKAGE_STRING='sqlite 3.31.1'
+PACKAGE_VERSION='3.32.0'
+PACKAGE_STRING='sqlite 3.32.0'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.31.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.32.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.31.1:";;
+ short | recursive ) echo "Configuration of sqlite 3.32.0:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.31.1
+sqlite configure 3.32.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.31.1, which was
+It was created by sqlite $as_me 3.32.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.31.1'
+ VERSION='3.32.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.31.1, which was
+This file was extended by sqlite $as_me 3.32.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.31.1
+sqlite config.status 3.32.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==

svn commit: r362091 - head/sys/arm64/include

2020-06-12 Thread Andrew Turner
Author: andrew
Date: Fri Jun 12 10:43:21 2020
New Revision: 362091
URL: https://svnweb.freebsd.org/changeset/base/362091

Log:
  Teach the arm64 vfp.h about struct thread.
  
  Ensure struct thread is defined in vfp.h. In some cases it is not and stops
  the kernel from building.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/include/vfp.h

Modified: head/sys/arm64/include/vfp.h
==
--- head/sys/arm64/include/vfp.hFri Jun 12 10:13:23 2020
(r362090)
+++ head/sys/arm64/include/vfp.hFri Jun 12 10:43:21 2020
(r362091)
@@ -42,6 +42,7 @@ struct vfpstate {
 
 #ifdef _KERNEL
 struct pcb;
+struct thread;
 
 void   vfp_init(void);
 void   vfp_discard(struct thread *);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362090 - head/sys/netinet

2020-06-12 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 12 10:13:23 2020
New Revision: 362090
URL: https://svnweb.freebsd.org/changeset/base/362090

Log:
  Small cleanup due to upstream ifdef cleanups.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctputil.h
==
--- head/sys/netinet/sctputil.h Fri Jun 12 09:34:10 2020(r362089)
+++ head/sys/netinet/sctputil.h Fri Jun 12 10:13:23 2020(r362090)
@@ -55,7 +55,7 @@ void sctp_m_freem(struct mbuf *m);
 #define sctp_m_freem m_freem
 #endif
 
-#if defined(SCTP_LOCAL_TRACE_BUF) || defined(__APPLE__)
+#if defined(SCTP_LOCAL_TRACE_BUF)
 void
  sctp_log_trace(uint32_t fr, const char *str SCTP_UNUSED, uint32_t a, 
uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f);
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362089 - in head: share/misc usr.bin/calendar/calendars

2020-06-12 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Fri Jun 12 09:34:10 2020
New Revision: 362089
URL: https://svnweb.freebsd.org/changeset/base/362089

Log:
  Add myself (gbe) to committers-doc.dot and calendar.freebsd
  
  Reviewed by:  bcr (mentor)
  Approved by:  bcr (mentor)
  Differential Revision:https://reviews.freebsd.org/D25241

Modified:
  head/share/misc/committers-doc.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-doc.dot
==
--- head/share/misc/committers-doc.dot  Fri Jun 12 07:36:32 2020
(r362088)
+++ head/share/misc/committers-doc.dot  Fri Jun 12 09:34:10 2020
(r362089)
@@ -70,6 +70,7 @@ ebrandi [label="Edson Brandi\nebra...@freebsd.org\n201
 gabor [label="Gabor Kovesdan\nga...@freebsd.org\n2007/02/02"]
 ganbold [label="Ganbold Tsagaankhuu\nganb...@freebsd.org\n2008/02/26"]
 gavin [label="Gavin Atkinson\nga...@freebsd.org\n2011/07/18"]
+gbe [label="Gordon Bergling\n...@freebsd.org\n2020/06/08"]
 gjb [label="Glen Barber\n...@freebsd.org\n2010/09/01"]
 hrs [label="Hiroki Sato\n...@freebsd.org\n2000/07/06"]
 issyl0 [label="Isabell Long\niss...@freebsd.org\n2012/04/25"]
@@ -115,6 +116,7 @@ bcr -> dexter
 bcr -> sg
 bcr -> carlavilla
 bcr -> "0mp"
+bcr -> gbe
 
 blackend -> ale
 

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdFri Jun 12 07:36:32 
2020(r362088)
+++ head/usr.bin/calendar/calendars/calendar.freebsdFri Jun 12 09:34:10 
2020(r362089)
@@ -357,6 +357,7 @@
 09/09  Yoshio Mita  born in Hiroshima, Japan, 1972
 09/09  Steven Hartland  born in Wordsley, United Kingdom, 
1973
 09/10  Wesley R. Peters  born in Hartford, Alabama, United 
States, 1961
+09/11  Gordon Bergling  born in Magdeburg, Germany, 1981
 09/12  Weongyo Jeong  born in Haman, Korea, 1980
 09/12  Benedict Christopher Reuschling  born in Darmstadt, 
Germany, 1981
 09/12  William C. Fumerola II  born in Detroit, Michigan, 
United States, 1981
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362085 - head/tools/tools/net80211/wlanstats

2020-06-12 Thread Adrian Chadd
Author: adrian
Date: Fri Jun 12 06:10:27 2020
New Revision: 362085
URL: https://svnweb.freebsd.org/changeset/base/362085

Log:
  [wlanstats] Add the per-node amsdu hardware decap'ed receive stats.
  
  This is useful for tracking hardware provided AMSDU frames to see
  when we're (a) seeing them, and (b) seeing the split between
  intermediary and final frames.
  
  Tested:
  
  * QCA9880 (athp) - AP mode

Modified:
  head/tools/tools/net80211/wlanstats/main.c
  head/tools/tools/net80211/wlanstats/wlanstats.c

Modified: head/tools/tools/net80211/wlanstats/main.c
==
--- head/tools/tools/net80211/wlanstats/main.c  Fri Jun 12 04:19:03 2020
(r362084)
+++ head/tools/tools/net80211/wlanstats/main.c  Fri Jun 12 06:10:27 2020
(r362085)
@@ -63,7 +63,7 @@ static struct {
   },
   {
 "amsdu",
-"input,output,amsdu_tooshort,amsdu_split,amsdu_decap,amsdu_encap,rssi,rate"
+
"input,output,amsdu_tooshort,amsdu_split,amsdu_decap,amsdu_encap,rx_amsdu_more,rx_amsdu_more_end,rssi,rate"
   },
 };
 

Modified: head/tools/tools/net80211/wlanstats/wlanstats.c
==
--- head/tools/tools/net80211/wlanstats/wlanstats.c Fri Jun 12 04:19:03 
2020(r362084)
+++ head/tools/tools/net80211/wlanstats/wlanstats.c Fri Jun 12 06:10:27 
2020(r362085)
@@ -276,7 +276,11 @@ static const struct fmt wlanstats[] = {
{ 8,  "amsdu_decap","decap","A-MSDU frames received" },
 #defineS_AMSDU_ENCAP   AFTER(S_AMSDU_DECAP)
{ 8,  "amsdu_encap","encap","A-MSDU frames transmitted" },
-#defineS_AMPDU_REORDER AFTER(S_AMSDU_ENCAP)
+#defineS_AMSDU_RX_MORE AFTER(S_AMSDU_ENCAP)
+   { 13,  "rx_amsdu_more", "rx_amsdu_more","A-MSDU HW intermediary 
decap'ed received" },
+#defineS_AMSDU_RX_MORE_END AFTER(S_AMSDU_RX_MORE)
+   { 17,  "rx_amsdu_more_end", "rx_amsdu_more_end","A-MSDU HW end 
decap'ed received" },
+#defineS_AMPDU_REORDER AFTER(S_AMSDU_RX_MORE_END)
{ 8,  "ampdu_reorder",  "reorder","A-MPDU frames held in reorder q" },
 #defineS_AMPDU_FLUSH   AFTER(S_AMPDU_REORDER)
{ 8,  "ampdu_flush","flush","A-MPDU frames sent up from 
reorder q" },
@@ -778,6 +782,8 @@ wlan_get_curstat(struct bsdstat *sf, int s, char b[], 
case S_AMSDU_SPLIT: STAT(amsdu_split);
case S_AMSDU_DECAP: STAT(amsdu_decap);
case S_AMSDU_ENCAP: STAT(amsdu_encap);
+   case S_AMSDU_RX_MORE:   NSTAT(rx_amsdu_more);
+   case S_AMSDU_RX_MORE_END:   NSTAT(rx_amsdu_more_end);
case S_AMPDU_REORDER:   STAT(ampdu_rx_reorder);
case S_AMPDU_FLUSH: STAT(ampdu_rx_flush);
case S_AMPDU_BARBAD:STAT(ampdu_bar_bad);
@@ -941,6 +947,8 @@ wlan_get_totstat(struct bsdstat *sf, int s, char b[], 
case S_AMSDU_SPLIT: STAT(amsdu_split);
case S_AMSDU_DECAP: STAT(amsdu_decap);
case S_AMSDU_ENCAP: STAT(amsdu_encap);
+   case S_AMSDU_RX_MORE:   NSTAT(rx_amsdu_more);
+   case S_AMSDU_RX_MORE_END:   NSTAT(rx_amsdu_more_end);
case S_AMPDU_REORDER:   STAT(ampdu_rx_reorder);
case S_AMPDU_FLUSH: STAT(ampdu_rx_flush);
case S_AMPDU_BARBAD:STAT(ampdu_bar_bad);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"