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

2020-11-07 Thread Olivier Cochard
Author: olivier (ports committer)
Date: Sun Nov  8 07:49:39 2020
New Revision: 367478
URL: https://svnweb.freebsd.org/changeset/base/367478

Log:
  Return the same value for smbios.chassis.maker as smbios.system.maker (and 
prevents returning a space character).
  
  Reviewed by:  grehan
  Approved by:  grehan
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D27123

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

Modified: head/usr.sbin/bhyve/smbiostbl.c
==
--- head/usr.sbin/bhyve/smbiostbl.c Sun Nov  8 04:24:29 2020
(r367477)
+++ head/usr.sbin/bhyve/smbiostbl.c Sun Nov  8 07:49:39 2020
(r367478)
@@ -374,7 +374,7 @@ struct smbios_table_type3 smbios_type3_template = {
 };
 
 const char *smbios_type3_strings[] = {
-   " ",/* manufacturer string */
+   "FreeBSD",  /* manufacturer string */
"1.0",  /* version string */
"None", /* serial number string */
"None", /* asset tag string */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2020-11-07 Thread Kyle Evans
Author: kevans
Date: Sun Nov  8 04:24:29 2020
New Revision: 367477
URL: https://svnweb.freebsd.org/changeset/base/367477

Log:
  imgact_binmisc: limit the extent of match on incoming entries
  
  imgact_binmisc matches magic/mask from imgp->image_header, which is only a
  single page in size mapped from the first page of an image. One can specify
  an interpreter that matches on, e.g., --offset 4096 --size 256 to read up to
  256 bytes past the mapped first page.
  
  The limitation is that we cannot specify a magic string that exceeds a
  single page, and we can't allow offset + size to exceed a single page
  either.  A static assert has been added in case someone finds it useful to
  try and expand the size, but it does seem a little unlikely.
  
  While this looks kind of exploitable at a sideways squinty-glance, there are
  a couple of mitigating factors:
  
  1.) imgact_binmisc is not enabled by default,
  2.) entries may only be added by the superuser,
  3.) trying to exploit this information to read what's mapped past the end
would be worse than a root canal or some other relatably painful
experience, and
  4.) there's no way one could pull this off without it being completely
obvious.
  
  The first page is mapped out of an sf_buf, the implementation of which (or
  lack thereof) depends on your platform.
  
  MFC after:1 week

Modified:
  head/sys/kern/imgact_binmisc.c
  head/sys/sys/imgact_binmisc.h

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Sun Nov  8 02:50:34 2020
(r367476)
+++ head/sys/kern/imgact_binmisc.c  Sun Nov  8 04:24:29 2020
(r367477)
@@ -236,6 +236,8 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe)
 
if (xbe->xbe_msize > IBE_MAGIC_MAX)
return (EINVAL);
+   if (xbe->xbe_moffset + xbe->xbe_msize > IBE_MATCH_MAX)
+   return (EINVAL);
 
for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++)
if (cnt >= IBE_NAME_MAX || !isascii((int)*p))

Modified: head/sys/sys/imgact_binmisc.h
==
--- head/sys/sys/imgact_binmisc.h   Sun Nov  8 02:50:34 2020
(r367476)
+++ head/sys/sys/imgact_binmisc.h   Sun Nov  8 04:24:29 2020
(r367477)
@@ -47,6 +47,11 @@
 #defineIBE_INTERP_LEN_MAX  (MAXPATHLEN + IBE_ARG_LEN_MAX)
 #defineIBE_MAX_ENTRIES 64  /* Max number of interpreter entries. */
 
+/* We only map the first page for identification purposes. */
+#defineIBE_MATCH_MAX   PAGE_SIZE
+_Static_assert(IBE_MAGIC_MAX <= IBE_MATCH_MAX,
+"Cannot identify binaries past the first page.");
+
 /*
  * Imgact bin misc interpreter entry flags.
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367476 - in head: include/xlocale lib/libc/locale share/colldef tools/tools/locale tools/tools/locale/tools usr.bin/localedef usr.bin/localedef/bootstrap

2020-11-07 Thread Thomas Munro
Author: tmunro
Date: Sun Nov  8 02:50:34 2020
New Revision: 367476
URL: https://svnweb.freebsd.org/changeset/base/367476

Log:
  Add collation version support to querylocale(3).
  
  Provide a way to ask for an opaque version string for a locale_t, so
  that potential changes in sort order can be detected.  Similar to
  ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is
  intended to allow databases to detect when text order-based indexes
  might need to be rebuilt.
  
  The CLDR version is extracted from CLDR source data by the Makefile
  under tools/tools/locale, written into the machine-generated Makefile
  under shared/colldef, passed to localedef -V, and then written into
  LC_COLLATE file headers.  The initial version is 34.0.
  tools/tools/locale was recently updated to pull down 35.0, but the
  output hasn't been committed under share/colldef yet, so that will
  provide the first observable change when it happens.  Other versioning
  schemes are possible in future, because the format is unspecified.
  
  Reviewed by:  bapt, 0mp, kib, yuripv (albeit a long time ago)
  Differential Revision:https://reviews.freebsd.org/D17166

Modified:
  head/include/xlocale/_locale.h
  head/lib/libc/locale/collate.c
  head/lib/libc/locale/collate.h
  head/lib/libc/locale/querylocale.3
  head/lib/libc/locale/xlocale.c
  head/lib/libc/locale/xlocale_private.h
  head/share/colldef/Makefile
  head/tools/tools/locale/Makefile
  head/tools/tools/locale/tools/cldr2def.pl
  head/usr.bin/localedef/bootstrap/bootstrap_xlocale_private.h
  head/usr.bin/localedef/collate.c
  head/usr.bin/localedef/localedef.1
  head/usr.bin/localedef/localedef.c
  head/usr.bin/localedef/localedef.h

Modified: head/include/xlocale/_locale.h
==
--- head/include/xlocale/_locale.h  Sun Nov  8 02:46:04 2020
(r367475)
+++ head/include/xlocale/_locale.h  Sun Nov  8 02:50:34 2020
(r367476)
@@ -43,6 +43,7 @@
 #define LC_MESSAGES_MASK (1<<5)
 #define LC_ALL_MASK  (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | 
\
  LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
+#define LC_VERSION_MASK  (1<<6)
 #define LC_GLOBAL_LOCALE ((locale_t)-1)
 
 #ifndef _LOCALE_T_DEFINED

Modified: head/lib/libc/locale/collate.c
==
--- head/lib/libc/locale/collate.c  Sun Nov  8 02:46:04 2020
(r367475)
+++ head/lib/libc/locale/collate.c  Sun Nov  8 02:50:34 2020
(r367476)
@@ -140,7 +140,9 @@ __collate_load_tables_l(const char *encoding, struct x
(void) _close(fd);
return (_LDP_ERROR);
}
-   if (sbuf.st_size < (COLLATE_STR_LEN + sizeof (info))) {
+   if (sbuf.st_size < (COLLATE_FMT_VERSION_LEN +
+   XLOCALE_DEF_VERSION_LEN +
+   sizeof (info))) {
(void) _close(fd);
errno = EINVAL;
return (_LDP_ERROR);
@@ -151,12 +153,14 @@ __collate_load_tables_l(const char *encoding, struct x
return (_LDP_ERROR);
}
 
-   if (strncmp(TMP, COLLATE_VERSION, COLLATE_STR_LEN) != 0) {
+   if (strncmp(TMP, COLLATE_FMT_VERSION, COLLATE_FMT_VERSION_LEN) != 0) {
(void) munmap(map, sbuf.st_size);
errno = EINVAL;
return (_LDP_ERROR);
}
-   TMP += COLLATE_STR_LEN;
+   TMP += COLLATE_FMT_VERSION_LEN;
+   strlcat(table->header.version, TMP, sizeof (table->header.version));
+   TMP += XLOCALE_DEF_VERSION_LEN;
 
info = (void *)TMP;
TMP += sizeof (*info);

Modified: head/lib/libc/locale/collate.h
==
--- head/lib/libc/locale/collate.h  Sun Nov  8 02:46:04 2020
(r367475)
+++ head/lib/libc/locale/collate.h  Sun Nov  8 02:50:34 2020
(r367476)
@@ -53,8 +53,10 @@
 #endif
 
 #defineCOLLATE_STR_LEN 24  /* should be 64-bit 
multiple */
-#defineCOLLATE_VERSION "BSD 1.0\n"
 
+#defineCOLLATE_FMT_VERSION_LEN 12
+#defineCOLLATE_FMT_VERSION "BSD 1.0\n"
+
 #defineCOLLATE_MAX_PRIORITY(0x7fff)/* max signed value */
 #defineCOLLATE_SUBST_PRIORITY  (0x4000)/* bit indicates subst 
table */
 
@@ -69,7 +71,8 @@
 /*
  * The collate file format is as follows:
  *
- * charversion[COLLATE_STR_LEN];   // must be 
COLLATE_VERSION
+ * charfmt_version[COLLATE_FMT_VERSION_LEN];   // must be 
COLLATE_FMT_VERSION
+ * chardef_version[XLOCALE_DEF_VERSION_LEN];   // NUL-terminated, may 
be empty
  * collate_info_t  info;   // see below, includes padding
  * collate_char_pri_t  char_data[256]; // 8 bit char values
  * collate_subst_t subst[*];   // 0 or more 

svn commit: r367475 - head

2020-11-07 Thread Warner Losh
Author: imp
Date: Sun Nov  8 02:46:04 2020
New Revision: 367475
URL: https://svnweb.freebsd.org/changeset/base/367475

Log:
  Also mention PORTS_MODULES
  
  PORTS_MODULES is also an effective way to update the tree. Also
  a minor rejustify on this an an adjacent paragraph.
  
  Suggested by: David Wolfskill

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sun Nov  8 02:20:21 2020(r367474)
+++ head/UPDATING   Sun Nov  8 02:46:04 2020(r367475)
@@ -2303,14 +2303,16 @@ COMMON ITEMS:
messages there.  If in doubt, please track -stable which has
much fewer pitfalls.
 
-   [1] If you have third party modules, such as vmware, you
-   should disable them at this point so they don't crash your
-   system on reboot. Alternatively, you should rebuild all the
-   modules you have in your system and install them as well.  If
-   you are running -current, you should seriously consider
-   placing all sources to all the modules for your system (or
-   symlinks to them) in /usr/local/sys/modules so this happens
-   automatically...
+   [1] If you have third party modules, such as vmware, you should disable
+   them at this point so they don't crash your system on
+   reboot. Alternatively, you should rebuild all the modules you have in
+   your system and install them as well.  If you are running -current, you
+   should seriously consider placing all sources to all the modules for
+   your system (or symlinks to them) in /usr/local/sys/modules so this
+   happens automatically. If all your modules come from ports, then adding
+   the port origin directories to PORTS_MODULES instead is also automatic
+   and effective, eg:
+PORTS_MODULES+=x11/nvidia-driver
 
[3] From the bootblocks, boot -s, and then do
fsck -p
@@ -2319,8 +2321,8 @@ COMMON ITEMS:
sh /etc/rc.d/zfs start  # mount zfs filesystem, if needed
cd src  # full path to source
adjkerntz -i# if CMOS is wall time
-   Also, when doing a major release upgrade, it is required that
-   you boot into single user mode to do the installworld.
+   Also, when doing a major release upgrade, it is required that you boot
+   into single user mode to do the installworld.
 
[4] Note: This step is non-optional.  Failure to do this step
can result in a significant reduction in the functionality of the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367474 - head

2020-11-07 Thread Warner Losh
Author: imp
Date: Sun Nov  8 02:20:21 2020
New Revision: 367474
URL: https://svnweb.freebsd.org/changeset/base/367474

Log:
  Be explicit about recompiling all the modules...
  
  Add a note about always recompiling all modules on every new kernel
  change / update. In addition, suggest using /usr/local/sys/modules
  so this happens automatically.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sun Nov  8 01:02:40 2020(r367473)
+++ head/UPDATING   Sun Nov  8 02:20:21 2020(r367474)
@@ -2305,7 +2305,12 @@ COMMON ITEMS:
 
[1] If you have third party modules, such as vmware, you
should disable them at this point so they don't crash your
-   system on reboot.
+   system on reboot. Alternatively, you should rebuild all the
+   modules you have in your system and install them as well.  If
+   you are running -current, you should seriously consider
+   placing all sources to all the modules for your system (or
+   symlinks to them) in /usr/local/sys/modules so this happens
+   automatically...
 
[3] From the bootblocks, boot -s, and then do
fsck -p
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367473 - stable/12/sys/net

2020-11-07 Thread Konstantin Belousov
Author: kib
Date: Sun Nov  8 01:02:40 2020
New Revision: 367473
URL: https://svnweb.freebsd.org/changeset/base/367473

Log:
  MFC r367252:
  net/if_media.c: improve IFMEDIA_DEBUG output.

Modified:
  stable/12/sys/net/if_media.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_media.c
==
--- stable/12/sys/net/if_media.cSun Nov  8 01:01:27 2020
(r367472)
+++ stable/12/sys/net/if_media.cSun Nov  8 01:02:40 2020
(r367473)
@@ -124,7 +124,7 @@ ifmedia_add(struct ifmedia *ifm, int mword, int data, 
printf("ifmedia_add: null ifm\n");
return;
}
-   printf("Adding entry for ");
+   printf("Adding entry for (%#010x) ", mword);
ifmedia_printword(mword);
}
 #endif
@@ -230,8 +230,8 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st
 #ifdef IFMEDIA_DEBUG
if (ifmedia_debug) {
printf(
-   "ifmedia_ioctl: no media found for 0x%x\n", 
-   newmedia);
+   "ifmedia_ioctl: no media found for %#010x mask %#010x\n", 
+   newmedia, ifm->ifm_mask);
}
 #endif
return (ENXIO);
@@ -338,7 +338,7 @@ ifmedia_match(struct ifmedia *ifm, int target, int mas
 #if defined(IFMEDIA_DEBUG) || defined(DIAGNOSTIC)
if (match) {
printf("ifmedia_match: multiple match for "
-   "0x%x/0x%x\n", target, mask);
+   "%#010x/%#010x\n", target, mask);
}
 #endif
match = next;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367472 - stable/12/sys/net

2020-11-07 Thread Konstantin Belousov
Author: kib
Date: Sun Nov  8 01:01:27 2020
New Revision: 367472
URL: https://svnweb.freebsd.org/changeset/base/367472

Log:
  MFC r367251:
  Cleanup of net/if_media.c: simplify cleanup loop in ifmedia_removeall().

Modified:
  stable/12/sys/net/if_media.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_media.c
==
--- stable/12/sys/net/if_media.cSun Nov  8 01:00:10 2020
(r367471)
+++ stable/12/sys/net/if_media.cSun Nov  8 01:01:27 2020
(r367472)
@@ -102,8 +102,7 @@ ifmedia_removeall(struct ifmedia *ifm)
 {
struct ifmedia_entry *entry;
 
-   for (entry = LIST_FIRST(>ifm_list); entry;
-entry = LIST_FIRST(>ifm_list)) {
+   while ((entry = LIST_FIRST(>ifm_list)) != NULL) {
LIST_REMOVE(entry, ifm_list);
free(entry, M_IFADDR);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367471 - stable/12/sys/net

2020-11-07 Thread Konstantin Belousov
Author: kib
Date: Sun Nov  8 01:00:10 2020
New Revision: 367471
URL: https://svnweb.freebsd.org/changeset/base/367471

Log:
  MFC r367250:
  Cleanup of net/if_media.c: some style.

Modified:
  stable/12/sys/net/if_media.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_media.c
==
--- stable/12/sys/net/if_media.cSun Nov  8 00:59:09 2020
(r367470)
+++ stable/12/sys/net/if_media.cSun Nov  8 01:00:10 2020
(r367471)
@@ -213,7 +213,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st
int error = 0;
 
if (ifp == NULL || ifr == NULL || ifm == NULL)
-   return(EINVAL);
+   return (EINVAL);
 
switch (cmd) {
 
@@ -244,10 +244,9 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st
 * Keep going in case the connected media changed.
 * Similarly, if best match changed (kernel debugger?).
 */
-   if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) &&
-   (newmedia == ifm->ifm_media) &&
-   (match == ifm->ifm_cur))
-   return 0;
+   if (IFM_SUBTYPE(newmedia) != IFM_AUTO &&
+   newmedia == ifm->ifm_media && match == ifm->ifm_cur)
+   return (0);
 
/*
 * We found a match, now make the driver switch to it.
@@ -347,7 +346,7 @@ ifmedia_match(struct ifmedia *ifm, int target, int mas
}
}
 
-   return match;
+   return (match);
 }
 
 /*
@@ -363,7 +362,8 @@ ifmedia_baudrate(int mword)
int i;
 
for (i = 0; ifmedia_baudrate_descriptions[i].ifmb_word != 0; i++) {
-   if (IFM_TYPE_MATCH(mword, 
ifmedia_baudrate_descriptions[i].ifmb_word))
+   if (IFM_TYPE_MATCH(mword, ifmedia_baudrate_descriptions[i].
+   ifmb_word))
return (ifmedia_baudrate_descriptions[i].ifmb_baudrate);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367470 - stable/12/sys/net

2020-11-07 Thread Konstantin Belousov
Author: kib
Date: Sun Nov  8 00:59:09 2020
New Revision: 367470
URL: https://svnweb.freebsd.org/changeset/base/367470

Log:
  MFC r367249:
  Cleanup of net/if_media.c: switch to ANSI C function definitions.

Modified:
  stable/12/sys/net/if_media.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_media.c
==
--- stable/12/sys/net/if_media.cSun Nov  8 00:31:49 2020
(r367469)
+++ stable/12/sys/net/if_media.cSun Nov  8 00:59:09 2020
(r367470)
@@ -85,11 +85,8 @@ static   void ifmedia_printword(int);
  * Initialize if_media struct for a specific interface instance.
  */
 void
-ifmedia_init(ifm, dontcare_mask, change_callback, status_callback)
-   struct ifmedia *ifm;
-   int dontcare_mask;
-   ifm_change_cb_t change_callback;
-   ifm_stat_cb_t status_callback;
+ifmedia_init(struct ifmedia *ifm, int dontcare_mask,
+ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback)
 {
 
LIST_INIT(>ifm_list);
@@ -101,8 +98,7 @@ ifmedia_init(ifm, dontcare_mask, change_callback, stat
 }
 
 void
-ifmedia_removeall(ifm)
-   struct ifmedia *ifm;
+ifmedia_removeall(struct ifmedia *ifm)
 {
struct ifmedia_entry *entry;
 
@@ -119,11 +115,7 @@ ifmedia_removeall(ifm)
  * for a specific interface instance.
  */
 void
-ifmedia_add(ifm, mword, data, aux)
-   struct ifmedia *ifm;
-   int mword;
-   int data;
-   void *aux;
+ifmedia_add(struct ifmedia *ifm, int mword, int data, void *aux)
 {
struct ifmedia_entry *entry;
 
@@ -154,10 +146,7 @@ ifmedia_add(ifm, mword, data, aux)
  * supported media for a specific interface instance.
  */
 void
-ifmedia_list_add(ifm, lp, count)
-   struct ifmedia *ifm;
-   struct ifmedia_entry *lp;
-   int count;
+ifmedia_list_add(struct ifmedia *ifm, struct ifmedia_entry *lp, int count)
 {
int i;
 
@@ -174,10 +163,7 @@ ifmedia_list_add(ifm, lp, count)
  * media-change callback.
  */
 void
-ifmedia_set(ifm, target)
-   struct ifmedia *ifm; 
-   int target;
-
+ifmedia_set(struct ifmedia *ifm, int target)
 {
struct ifmedia_entry *match;
 
@@ -219,11 +205,8 @@ compat_media(int media)
  * Device-independent media ioctl support function.
  */
 int
-ifmedia_ioctl(ifp, ifr, ifm, cmd)
-   struct ifnet *ifp;
-   struct ifreq *ifr;
-   struct ifmedia *ifm;
-   u_long cmd;
+ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm,
+u_long cmd)
 {
struct ifmedia_entry *match;
struct ifmediareq *ifmr = (struct ifmediareq *) ifr;
@@ -345,10 +328,7 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd)
  *
  */
 static struct ifmedia_entry *
-ifmedia_match(ifm, target, mask)
-   struct ifmedia *ifm; 
-   int target;
-   int mask;
+ifmedia_match(struct ifmedia *ifm, int target, int mask)
 {
struct ifmedia_entry *match, *next;
 
@@ -454,8 +434,7 @@ static const struct ifmedia_type_to_subtype ifmedia_ty
  * print a media word.
  */
 static void
-ifmedia_printword(ifmw)
-   int ifmw;
+ifmedia_printword(int ifmw)
 {
const struct ifmedia_description *desc;
const struct ifmedia_type_to_subtype *ttos;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367469 - stable/11/sys/dev/ocs_fc

2020-11-07 Thread Alexander Motin
Author: mav
Date: Sun Nov  8 00:31:49 2020
New Revision: 367469
URL: https://svnweb.freebsd.org/changeset/base/367469

Log:
  MFC r367041: Fix incorrect constants of target tag action.
  
  ocs_scsi_recv_cmd() receives the flags after ocs_get_flags_fcp_cmd(),
  which translates them from FCP_TASK_ATTR_* to OCS_SCSI_CMD_*.  As result
  non-SIMPLE requests turned into HEAD or ORDERED depending on direction.

Modified:
  stable/11/sys/dev/ocs_fc/ocs_cam.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ocs_fc/ocs_cam.c
==
--- stable/11/sys/dev/ocs_fc/ocs_cam.c  Sun Nov  8 00:30:53 2020
(r367468)
+++ stable/11/sys/dev/ocs_fc/ocs_cam.c  Sun Nov  8 00:31:49 2020
(r367469)
@@ -579,9 +579,9 @@ int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, 
 
if (flags & OCS_SCSI_CMD_SIMPLE)
atio->tag_action = MSG_SIMPLE_Q_TAG;
-   else if (flags &  FCP_TASK_ATTR_HEAD_OF_QUEUE)
+   else if (flags & OCS_SCSI_CMD_HEAD_OF_QUEUE)
atio->tag_action = MSG_HEAD_OF_Q_TAG;
-   else if (flags & FCP_TASK_ATTR_ORDERED)
+   else if (flags & OCS_SCSI_CMD_ORDERED)
atio->tag_action = MSG_ORDERED_Q_TAG;
else
atio->tag_action = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367468 - stable/12/sys/dev/ocs_fc

2020-11-07 Thread Alexander Motin
Author: mav
Date: Sun Nov  8 00:30:53 2020
New Revision: 367468
URL: https://svnweb.freebsd.org/changeset/base/367468

Log:
  MFC r367041: Fix incorrect constants of target tag action.
  
  ocs_scsi_recv_cmd() receives the flags after ocs_get_flags_fcp_cmd(),
  which translates them from FCP_TASK_ATTR_* to OCS_SCSI_CMD_*.  As result
  non-SIMPLE requests turned into HEAD or ORDERED depending on direction.

Modified:
  stable/12/sys/dev/ocs_fc/ocs_cam.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ocs_fc/ocs_cam.c
==
--- stable/12/sys/dev/ocs_fc/ocs_cam.c  Sun Nov  8 00:00:49 2020
(r367467)
+++ stable/12/sys/dev/ocs_fc/ocs_cam.c  Sun Nov  8 00:30:53 2020
(r367468)
@@ -579,9 +579,9 @@ int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, 
 
if (flags & OCS_SCSI_CMD_SIMPLE)
atio->tag_action = MSG_SIMPLE_Q_TAG;
-   else if (flags &  FCP_TASK_ATTR_HEAD_OF_QUEUE)
+   else if (flags & OCS_SCSI_CMD_HEAD_OF_QUEUE)
atio->tag_action = MSG_HEAD_OF_Q_TAG;
-   else if (flags & FCP_TASK_ATTR_ORDERED)
+   else if (flags & OCS_SCSI_CMD_ORDERED)
atio->tag_action = MSG_ORDERED_Q_TAG;
else
atio->tag_action = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367467 - stable/11/contrib/libcxxrt

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sun Nov  8 00:00:49 2020
New Revision: 367467
URL: https://svnweb.freebsd.org/changeset/base/367467

Log:
  MFC r367323:
  
  Update libcxxrt's private copy of elftoolchain demangler
  
  This updates the private copy of libelftc_dem_gnu3.c in libcxxrt with
  the most recent version from upstream r3877. Similar to r367322, this
  fixes a number of possible assertions, and allows it to correctly
  demangle several names that it could not handle before.
  
  PR:   250702
  
  MFC r367337:
  
  Make vector-related functions in libcxxrt's demangler static
  
  Follow-up to r367323 by re-adding static to a number of the functions
  copied from elftc's libelftc_vstr.c. This was requested by upstream.
  
  PR:   250702

Modified:
  stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c
==
--- stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c  Sat Nov  7 23:57:57 
2020(r367466)
+++ stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c  Sun Nov  8 00:00:49 
2020(r367467)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2007, 2008 Hyogeol Lee 
+ * Copyright (c) 2007 Hyogeol Lee 
+ * Copyright (c) 2015-2017 Kai Wang 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -54,12 +55,17 @@ struct vector_str {
 };
 
 #define BUFFER_GROWFACTOR  1.618
-#define VECTOR_DEF_CAPACITY8
+#define BUFFER_GROW(x) (((x)+0.5)*BUFFER_GROWFACTOR)
+
+#defineELFTC_FAILURE   0
 #defineELFTC_ISDIGIT(C)(isdigit((C) & 0xFF))
+#defineELFTC_SUCCESS   1
 
+#define VECTOR_DEF_CAPACITY8
+
 enum type_qualifier {
TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT,
-   TYPE_CST, TYPE_VEC
+   TYPE_CST, TYPE_VEC, TYPE_RREF
 };
 
 struct vector_type_qualifier {
@@ -73,35 +79,57 @@ enum read_cmd {
READ_TYPE, READ_FUNC, READ_PTRMEM
 };
 
+struct read_cmd_item {
+   enum read_cmd cmd;
+   void *data;
+};
+
 struct vector_read_cmd {
size_t size, capacity;
-   enum read_cmd *r_container;
+   struct read_cmd_item *r_container;
 };
 
+enum push_qualifier {
+   PUSH_ALL_QUALIFIER,
+   PUSH_CV_QUALIFIER,
+   PUSH_NON_CV_QUALIFIER,
+};
+
 struct cpp_demangle_data {
struct vector_stroutput;/* output string vector */
-   struct vector_stroutput_tmp;
struct vector_strsubst; /* substitution string vector */
struct vector_strtmpl;
struct vector_strclass_type;
+   struct vector_str   *cur_output;/* ptr to current output vec */
struct vector_read_cmd   cmd;
-   bool paren; /* parenthesis opened */
-   bool pfirst;/* first element of parameter */
bool mem_rst;   /* restrict member function */
bool mem_vat;   /* volatile member function */
bool mem_cst;   /* const member function */
+   bool mem_ref;   /* lvalue-ref member func */
+   bool mem_rref;  /* rvalue-ref member func */
+   bool is_tmpl;   /* template args */
+   bool is_functype;   /* function type */
+   bool ref_qualifier; /* ref qualifier */
+   enum type_qualifier  ref_qualifier_type; /* ref qualifier type */
+   enum push_qualifier  push_qualifier; /* which qualifiers to push */
int  func_type;
const char  *cur;   /* current mangled name ptr */
const char  *last_sname;/* last source name */
-   int  push_head;
 };
 
+struct type_delimit {
+   bool paren;
+   bool firstp;
+};
+
 #defineCPP_DEMANGLE_TRY_LIMIT  128
 #defineFLOAT_SPRINTF_TRY_LIMIT 5
 #defineFLOAT_QUADRUPLE_BYTES   16
 #defineFLOAT_EXTENED_BYTES 10
 
 #define SIMPLE_HASH(x,y)   (64 * x + y)
+#define DEM_PUSH_STR(d,s)  cpp_demangle_push_str((d), (s), strlen((s)))
+#define VEC_PUSH_STR(d,s)  vector_str_push((d), (s), strlen((s)))
 
 static size_t  get_strlen_sum(const struct vector_str *v);
 static boolvector_str_grow(struct vector_str *v);
@@ -213,7 +241,7 @@ vector_str_grow(struct vector_str *v)
 
assert(v->capacity > 0);
 
-   tmp_cap = v->capacity * BUFFER_GROWFACTOR;
+   tmp_cap = BUFFER_GROW(v->capacity);
 
assert(tmp_cap > v->capacity);
 
@@ -314,7 +342,7 @@ vector_str_push_vector_head(struct vector_str *dst, st
if (dst == NULL || org == NULL)
return (false);
 
-   tmp_cap = (dst->size + org->size) * 

svn commit: r367466 - in stable/11: contrib/elftoolchain contrib/elftoolchain/addr2line contrib/elftoolchain/ar contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contrib/elftoolchain/elfcopy...

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 23:57:57 2020
New Revision: 367466
URL: https://svnweb.freebsd.org/changeset/base/367466

Log:
  Sync up elftoolchain with head, except for the capsicum-related commits,
  which are incompatible with stable/11.
  
  MFC r308465 (by emaste):
  
  c++filt: flush output after newline
  
  Some tools spawn c++filt and pass it a single line at a time for
  demangling. This is akin to r276689 for addr2line.
  
  Sponsored by: The FreeBSD Foundation
  
  MFC r317626 (by emaste):
  
  revert r308465: c++filt: flush output after newline
  
  The ELF Tool Chain update to r3520 uses setvbuf to set line buffering.
  
  Sponsored by: The FreeBSD Foundation
  
  MFC r340746 (by oshogbo):
  
  strings: fix style nits
  
  Reviewed by:  cem, emaste, Joseph Koshy 
  Differential Revision:https://reviews.freebsd.org/D18036
  
  MFC r340750 (by mjg):
  
  strings: unbreak the build after r340746
  
  Discussed with:   oshogbo
  Sponsored by: The FreeBSD Foundation
  
  MFC r342918 (by emaste):
  
  Update to ELF Tool Chain r3668
  
  Highlights:
  - Make sure that only TLS sections are sorted into TLS segment.
  - Fixed multiple errors in "Section to Segment mapping".
  - Man page updates
  - ar improvements
  - elfcopy: avoid filter_reloc uninitialized variable for rela
  - elfcopy: avoid stripping relocations from static binaries
  - readelf: avoid printing directory in front of absolute path
  - readelf: add NT_FREEBSD_FEATURE_CTL FreeBSD note type
  - test improvements
  
  NOTES:
  
  Some of these changes originated in FreeBSD and simply reduce diffs
  between contrib and vendor.
  
  ELF Tool Chain ar is not (currently) used in FreeBSD, and there are
  improvements in both FreeBSD and ELF Tool Chain ar that are not in
  the other.
  
  Sponsored by: The FreeBSD Foundation
  
  MFC r343592 (by emaste):
  
  readelf: decode flag bits in DT_FLAGS/DT_FLAGS_1
  
  Decode d_val when the tag is DT_FLAGS or DT_FLAGS_1 based on the
  information at:
  
  https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html
  
  PR:   232983
  Submitted by: Bora Ozarslan borako.ozars...@gmail.com
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18784
  
  MFC r343593 (by emaste):
  
  readelf: fix i386 build
  
  Use %jx and (uintmax_t) cast.
  
  PR:   232983
  Sponsored by: The FreeBSD Foundation
  
  MFC r343614 (by emaste):
  
  readelf: dump elf note data
  
  Output format is compatible with GNU readelf's handling of unknown note
  types (modulo a GNU char signedness bug); future changes will add type-
  specific decoding.
  
  Reviewed by:  kib
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  
  MFC r343665 (by emaste):
  
  readelf: use table-based DT_FLAGS and DT_FLAGS_1 decoding
  
  Fewer lines of code and more maintainable.
  
  Reviewed by:  brooks, kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19053
  
  MFC r343669 (by emaste):
  
  readelf: decode FreeBSD note types
  
  Decode NT_FREEBSD_ABI_TAG, NT_FREEBSD_ARCH_TAG, and NT_FREEBSD_FEATURE_CTL.
  
  Reviewed by:  brooks, kib (earlier)
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19054
  
  MFC r345360 (by oshogbo):
  
  strings: do not depend on stdin
  
  Instead of depending on one stdin FILE structure and use freopen(3), pass to
  the functions appropriate FILE structure.
  
  Reviewed by:  cem
  Discussed with:   emaste
  Differential Revision:https://reviews.freebsd.org/D18037
  
  MFC r345361 (by oshogbo):
  
  strings: do not continue if getc or getcharacter returns EOF
  
  Reported by:  cem
  
  MFC r345362 (by oshogbo):
  
  Fix powerpc and arm builds after r345361.
  
  Reported by:  jenkins
  
  MFC r345364 (by oshogbo):
  
  In case of ENCODING_8BIT the EOF code will be pass to putchar.
  EOF check should be done before (uint8_t)c > 127 test.
  
  Reported by:  cem
  
  MFC r345431 (by oshogbo):
  
  strings: return an error code and the char value separately
  
  If we returning 32 bits value it's hard to distinguish if the returned value
  is a valid one or if its an error (in case of EOF). For that reason separate
  exit code of the function from the returned character.
  
  Reported by:  cem, se
  
  MFC r345593 (by markj):
  
  Prepend DW_AT_comp_dir to relative line number directory table entries.
  
  Relative directories may appear in the line number program for a CPU if
  files were included via a relative path, for instance with "-I.".
  Previously, dwarf_srclines(3) and dwarf_srcfiles(3) would return the
  relative path, so addr2line, for instance, would do the same.  However,
  we can get an absolute path by prepending the compilation directory, so
  change libdwarf to do that to improve compatibility with GNU binutils
  and since it is more useful in general.
  
  Reviewed 

svn commit: r367465 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

2020-11-07 Thread Simon J. Gerraty
Author: sjg
Date: Sat Nov  7 21:46:27 2020
New Revision: 367465
URL: https://svnweb.freebsd.org/changeset/base/367465

Log:
  Update to bmake-20201101
  
  Lots of new unit-tests increase code coverage.
  
  Lots of refactoring, cleanup and simlpification to reduce
  code size.
  
  Fixes for Bug 223564 and 245807
  
  Updates to dirdeps.mk and meta2deps.py

Added:
  head/contrib/bmake/unit-tests/cond-cmp-unary.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.exp
  head/contrib/bmake/unit-tests/cond-cmp-unary.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.mk
  head/contrib/bmake/unit-tests/cond-undef-lint.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.exp
  head/contrib/bmake/unit-tests/cond-undef-lint.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.mk
  head/contrib/bmake/unit-tests/counter-append.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/counter-append.exp
  head/contrib/bmake/unit-tests/counter-append.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/counter-append.mk
  head/contrib/bmake/unit-tests/dep-colon-bug-cross-file.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.exp
  head/contrib/bmake/unit-tests/dep-colon-bug-cross-file.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.mk
  head/contrib/bmake/unit-tests/dep-double-colon-indep.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.exp
  head/contrib/bmake/unit-tests/dep-double-colon-indep.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.mk
  head/contrib/bmake/unit-tests/dep-percent.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-percent.exp
  head/contrib/bmake/unit-tests/dep-percent.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/dep-percent.mk
  head/contrib/bmake/unit-tests/depsrc-end.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.exp
  head/contrib/bmake/unit-tests/depsrc-end.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.mk
  head/contrib/bmake/unit-tests/deptgt-end-jobs.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.exp
  head/contrib/bmake/unit-tests/deptgt-end-jobs.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.mk
  head/contrib/bmake/unit-tests/directive-dinclude.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.exp
  head/contrib/bmake/unit-tests/directive-dinclude.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.mk
  head/contrib/bmake/unit-tests/directive-export-gmake.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.exp
  head/contrib/bmake/unit-tests/directive-export-gmake.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.mk
  head/contrib/bmake/unit-tests/directive-hyphen-include.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.exp
  head/contrib/bmake/unit-tests/directive-hyphen-include.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.mk
  head/contrib/bmake/unit-tests/directive-include-fatal.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.exp
  head/contrib/bmake/unit-tests/directive-include-fatal.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.mk
  head/contrib/bmake/unit-tests/directive-include.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-include.exp
  head/contrib/bmake/unit-tests/directive-include.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-include.mk
  head/contrib/bmake/unit-tests/directive-sinclude.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.exp
  head/contrib/bmake/unit-tests/directive-sinclude.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.mk
  head/contrib/bmake/unit-tests/hanoi-include.exp
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.exp
  head/contrib/bmake/unit-tests/hanoi-include.mk
 - copied unchanged from r367461, 
vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.mk
  head/contrib/bmake/unit-tests/job-output-long-lines.exp
 - copied unchanged from r367461, 

svn commit: r367464 - head/sys/kern

2020-11-07 Thread Michael Tuexen
Author: tuexen
Date: Sat Nov  7 21:17:49 2020
New Revision: 367464
URL: https://svnweb.freebsd.org/changeset/base/367464

Log:
  The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK
  access the socket send or receive buffer. This is not possible for
  listening sockets since r319722.
  Because send()/recv() calls fail on listening sockets, fail also ioctl()
  indicating EINVAL.
  
  PR:   250366
  Reported by:  Yong-Hao Zou
  Reviewed by:  glebius, rscheff
  MFC after:1 week
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D26897

Modified:
  head/sys/kern/sys_socket.c

Modified: head/sys/kern/sys_socket.c
==
--- head/sys/kern/sys_socket.c  Sat Nov  7 19:57:19 2020(r367463)
+++ head/sys/kern/sys_socket.c  Sat Nov  7 21:17:49 2020(r367464)
@@ -207,21 +207,34 @@ soo_ioctl(struct file *fp, u_long cmd, void *data, str
 
case FIONREAD:
/* Unlocked read. */
-   *(int *)data = sbavail(>so_rcv);
+   if (SOLISTENING(so)) {
+   error = EINVAL;
+   } else {
+   *(int *)data = sbavail(>so_rcv);
+   }
break;
 
case FIONWRITE:
/* Unlocked read. */
-   *(int *)data = sbavail(>so_snd);
+   if (SOLISTENING(so)) {
+   error = EINVAL;
+   } else {
+   *(int *)data = sbavail(>so_snd);
+   }
break;
 
case FIONSPACE:
/* Unlocked read. */
-   if ((so->so_snd.sb_hiwat < sbused(>so_snd)) ||
-   (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt))
-   *(int *)data = 0;
-   else
-   *(int *)data = sbspace(>so_snd);
+   if (SOLISTENING(so)) {
+   error = EINVAL;
+   } else {
+   if ((so->so_snd.sb_hiwat < sbused(>so_snd)) ||
+   (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt)) {
+   *(int *)data = 0;
+   } else {
+   *(int *)data = sbspace(>so_snd);
+   }
+   }
break;
 
case FIOSETOWN:
@@ -242,7 +255,11 @@ soo_ioctl(struct file *fp, u_long cmd, void *data, str
 
case SIOCATMARK:
/* Unlocked read. */
-   *(int *)data = (so->so_rcv.sb_state & SBS_RCVATMARK) != 0;
+   if (SOLISTENING(so)) {
+   error = EINVAL;
+   } else {
+   *(int *)data = (so->so_rcv.sb_state & SBS_RCVATMARK) != 
0;
+   }
break;
default:
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367463 - stable/12/contrib/libcxxrt

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 19:57:19 2020
New Revision: 367463
URL: https://svnweb.freebsd.org/changeset/base/367463

Log:
  MFC r367323:
  
  Update libcxxrt's private copy of elftoolchain demangler
  
  This updates the private copy of libelftc_dem_gnu3.c in libcxxrt with
  the most recent version from upstream r3877. Similar to r367322, this
  fixes a number of possible assertions, and allows it to correctly
  demangle several names that it could not handle before.
  
  PR:   250702
  
  MFC r367337:
  
  Make vector-related functions in libcxxrt's demangler static
  
  Follow-up to r367323 by re-adding static to a number of the functions
  copied from elftc's libelftc_vstr.c. This was requested by upstream.
  
  PR:   250702

Modified:
  stable/12/contrib/libcxxrt/libelftc_dem_gnu3.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/libcxxrt/libelftc_dem_gnu3.c
==
--- stable/12/contrib/libcxxrt/libelftc_dem_gnu3.c  Sat Nov  7 19:55:03 
2020(r367462)
+++ stable/12/contrib/libcxxrt/libelftc_dem_gnu3.c  Sat Nov  7 19:57:19 
2020(r367463)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2007, 2008 Hyogeol Lee 
+ * Copyright (c) 2007 Hyogeol Lee 
+ * Copyright (c) 2015-2017 Kai Wang 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -54,12 +55,17 @@ struct vector_str {
 };
 
 #define BUFFER_GROWFACTOR  1.618
-#define VECTOR_DEF_CAPACITY8
+#define BUFFER_GROW(x) (((x)+0.5)*BUFFER_GROWFACTOR)
+
+#defineELFTC_FAILURE   0
 #defineELFTC_ISDIGIT(C)(isdigit((C) & 0xFF))
+#defineELFTC_SUCCESS   1
 
+#define VECTOR_DEF_CAPACITY8
+
 enum type_qualifier {
TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT,
-   TYPE_CST, TYPE_VEC
+   TYPE_CST, TYPE_VEC, TYPE_RREF
 };
 
 struct vector_type_qualifier {
@@ -73,35 +79,57 @@ enum read_cmd {
READ_TYPE, READ_FUNC, READ_PTRMEM
 };
 
+struct read_cmd_item {
+   enum read_cmd cmd;
+   void *data;
+};
+
 struct vector_read_cmd {
size_t size, capacity;
-   enum read_cmd *r_container;
+   struct read_cmd_item *r_container;
 };
 
+enum push_qualifier {
+   PUSH_ALL_QUALIFIER,
+   PUSH_CV_QUALIFIER,
+   PUSH_NON_CV_QUALIFIER,
+};
+
 struct cpp_demangle_data {
struct vector_stroutput;/* output string vector */
-   struct vector_stroutput_tmp;
struct vector_strsubst; /* substitution string vector */
struct vector_strtmpl;
struct vector_strclass_type;
+   struct vector_str   *cur_output;/* ptr to current output vec */
struct vector_read_cmd   cmd;
-   bool paren; /* parenthesis opened */
-   bool pfirst;/* first element of parameter */
bool mem_rst;   /* restrict member function */
bool mem_vat;   /* volatile member function */
bool mem_cst;   /* const member function */
+   bool mem_ref;   /* lvalue-ref member func */
+   bool mem_rref;  /* rvalue-ref member func */
+   bool is_tmpl;   /* template args */
+   bool is_functype;   /* function type */
+   bool ref_qualifier; /* ref qualifier */
+   enum type_qualifier  ref_qualifier_type; /* ref qualifier type */
+   enum push_qualifier  push_qualifier; /* which qualifiers to push */
int  func_type;
const char  *cur;   /* current mangled name ptr */
const char  *last_sname;/* last source name */
-   int  push_head;
 };
 
+struct type_delimit {
+   bool paren;
+   bool firstp;
+};
+
 #defineCPP_DEMANGLE_TRY_LIMIT  128
 #defineFLOAT_SPRINTF_TRY_LIMIT 5
 #defineFLOAT_QUADRUPLE_BYTES   16
 #defineFLOAT_EXTENED_BYTES 10
 
 #define SIMPLE_HASH(x,y)   (64 * x + y)
+#define DEM_PUSH_STR(d,s)  cpp_demangle_push_str((d), (s), strlen((s)))
+#define VEC_PUSH_STR(d,s)  vector_str_push((d), (s), strlen((s)))
 
 static size_t  get_strlen_sum(const struct vector_str *v);
 static boolvector_str_grow(struct vector_str *v);
@@ -213,7 +241,7 @@ vector_str_grow(struct vector_str *v)
 
assert(v->capacity > 0);
 
-   tmp_cap = v->capacity * BUFFER_GROWFACTOR;
+   tmp_cap = BUFFER_GROW(v->capacity);
 
assert(tmp_cap > v->capacity);
 
@@ -314,7 +342,7 @@ vector_str_push_vector_head(struct vector_str *dst, st
if (dst == NULL || org == NULL)
return (false);
 
-   tmp_cap = (dst->size + org->size) * 

svn commit: r367462 - in stable/12: contrib/elftoolchain/elfcopy contrib/elftoolchain/libelf contrib/elftoolchain/libelftc contrib/elftoolchain/readelf contrib/elftoolchain/strings lib/libelf sys/s...

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 19:55:03 2020
New Revision: 367462
URL: https://svnweb.freebsd.org/changeset/base/367462

Log:
  Sync up elftoolchain with head, except for the capsicum-related commits,
  which are incompatible with stable/12.
  
  MFC r345360 (by oshogbo):
  
  strings: do not depend on stdin
  
  Instead of depending on one stdin FILE structure and use freopen(3), pass to
  the functions appropriate FILE structure.
  
  Reviewed by:  cem
  Discussed with:   emaste
  Differential Revision:https://reviews.freebsd.org/D18037
  
  MFC r345361 (by oshogbo):
  
  strings: do not continue if getc or getcharacter returns EOF
  
  Reported by:  cem
  
  MFC r345362 (by oshogbo):
  
  Fix powerpc and arm builds after r345361.
  
  Reported by:  jenkins
  
  MFC r345364 (by oshogbo):
  
  In case of ENCODING_8BIT the EOF code will be pass to putchar.
  EOF check should be done before (uint8_t)c > 127 test.
  
  Reported by:  cem
  
  MFC r345431 (by oshogbo):
  
  strings: return an error code and the char value separately
  
  If we returning 32 bits value it's hard to distinguish if the returned value
  is a valid one or if its an error (in case of EOF). For that reason separate
  exit code of the function from the returned character.
  
  Reported by:  cem, se
  
  MFC r346323 (by emaste):
  
  readelf: speed up readelf -wo
  
  Use an array instead of STAILQ, and sort at the end instead of while
  adding new elements.
  
  PR:   212539
  Submitted by: Bora Özarslan 
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  
  MFC r346327 (by emaste):
  
  readelf: use size_t for object counts
  
  PR:   212539
  Reported by:  cem
  Sponsored by: The FreeBSD Foundation
  
  MFC r348776 (by csjp):
  
  Teach readelf about some OpenBSD ELF program headers
  
  - Add constants for OpenBSD wxneeded, bootdata and randomize to the
FreeBSD elf_common.h file. This is the file that gets used by the
elftoolchain library.
  - Update readelf and elfdump utilities to decode these program headers
if they are encountered.
  
  Note: FreeBSD has it's own version of elfdump(1), which will be updated
  in a subsequent commit. I am adding it here anyway because this diff is
  going to be submitted upstream.
  
  Discussed with:   emaste
  Reviewed by:  imp
  MFC afer: 2 weeks
  Differential Revision:https://reviews.freebsd.org/D20548
  
  Mcontrib/elftoolchain/elfdump/elfdump.c
  Mcontrib/elftoolchain/readelf/readelf.c
  Msys/sys/elf_common.h
  
  MFC r349510 (by luporl):
  
  [PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type)
  
  This prints out description text with the meaning of 'Flags' value in 
PowerPC64.
  
  Example:
  
  $ readelf -h ~/tmp/t1-Flag2
  ELF Header:
  
  Magic:   7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00
  Class: ELF64
  Data:  2's complement, big endian
  Version:   1 (current)
  OS/ABI:FreeBSD
  ABI Version:   0
  Type:  EXEC (Executable file)
  Machine:   PowerPC 64-bit
  Version:   0x1
  Entry point address:   0x1001
  Start of program headers:  64 (bytes into file)
  Start of section headers:  209368 (bytes into file)
  Flags: 0x2, OpenPOWER ELF V2 ABI
  Size of this header:   64 (bytes)
  Size of program headers:   56 (bytes)
  Number of program headers: 10
  Size of section headers:   64 (bytes)
  Number of section headers: 34
  Section header string table index: 31
  
  Submitted by:  alfredo.junior_eldorado.org.br
  Reviewed by:  luporl
  Differential Revision:https://reviews.freebsd.org/D20782
  
  MFC r350511 (by emaste):
  
  readelf: decode NT_GNU_PROPERTY_TYPE_0 / GNU_PROPERTY_X86_FEATURE_1_AND
  
  These bits are used for Intel CET IBT/Shadow Stack.
  
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20516
  
  MFC r354544 (by emaste):
  
  elfcopy/strip: Ensure sections have required alignment on output
  
  Object files may specify insufficient alignment on certain sections, for
  example due to a bug in NASM[1].  When we detect that case in elfcopy or
  strip, emit a warning and increase the alignment to the minimum
  required.
  
  The NASM bug was fixed in 2015[2], but we might as well have this fixup
  (and warning) in elfcopy in case we encounter such a file for any other
  reason.
  
  This might be reworked somewhat upstream - see ELF Tool Chain
  ticket 485[3].
  
  [1] https://bugzilla.nasm.us/show_bug.cgi?id=3392307
  [2] 
https://repo.or.cz/w/nasm.git/commit/1f0cb0f2c1ba632c0fab02424928cfb756a9160c
  [3] https://sourceforge.net/p/elftoolchain/tickets/485/
  
  PR:   198611
  Sponsored by: The 

svn commit: r367461 - vendor/NetBSD/bmake/20201101

2020-11-07 Thread Simon J. Gerraty
Author: sjg
Date: Sat Nov  7 19:42:15 2020
New Revision: 367461
URL: https://svnweb.freebsd.org/changeset/base/367461

Log:
  tag bmake-20201101

Added:
  vendor/NetBSD/bmake/20201101/
 - copied from r367460, vendor/NetBSD/bmake/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367460 - in vendor/NetBSD/bmake/dist: . filemon mk unit-tests

2020-11-07 Thread Simon J. Gerraty
Author: sjg
Date: Sat Nov  7 19:39:21 2020
New Revision: 367460
URL: https://svnweb.freebsd.org/changeset/base/367460

Log:
  Import bmake-20201101
  
  Lots of new unit-tests increase code coverage.
  
  Lots of refactoring, cleanup and simlpification to reduce
  code size.
  
  Fixes for Bug 223564 and 245807
  
  Updates to dirdeps.mk and meta2deps.py

Added:
  vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/counter-append.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/counter-append.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.exp
  vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.exp
  vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/dep-percent.exp
  vendor/NetBSD/bmake/dist/unit-tests/dep-percent.mk   (contents, props changed)
  vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.exp
  vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.mk   (contents, props changed)
  vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.exp
  vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.exp   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.exp   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-include.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-include.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.exp   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.exp
  vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/job-output-long-lines.exp
  vendor/NetBSD/bmake/dist/unit-tests/job-output-long-lines.mk   (contents, 
props changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-all.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-all.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-archive.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-archive.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-cond.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-cond.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-curdir.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-curdir.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-dir.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-dir.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-errors.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-errors.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-file.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-file.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-for.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-for.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph1.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph1.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph2.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph2.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph3.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph3.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-hash.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-hash.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.mk   (contents, props 
changed)
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-lint.exp
  vendor/NetBSD/bmake/dist/unit-tests/opt-debug-lint.mk   

svn commit: r367459 - head/usr.sbin/syslogd

2020-11-07 Thread Cy Schubert
Author: cy
Date: Sat Nov  7 19:17:37 2020
New Revision: 367459
URL: https://svnweb.freebsd.org/changeset/base/367459

Log:
  Fix build post-r367455.
  
  MFC after:2 weeks
  X-MFC with:   r367455

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Sat Nov  7 18:15:29 2020
(r367458)
+++ head/usr.sbin/syslogd/syslogd.c Sat Nov  7 19:17:37 2020
(r367459)
@@ -1873,7 +1873,7 @@ fprintlog_write(struct filed *f, struct iovlist *il, i
continue;
if (sl->sl_sa == NULL ||
sl->sl_family == AF_UNSPEC ||
-   sl->sl_family == AF_LOCAL) {
+   sl->sl_family == AF_LOCAL)
continue;
lsent = sendmsg(sl->sl_socket, , 0);
if (lsent == (ssize_t)il->totalsize)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367458 - in stable: 11 12

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 18:15:29 2020
New Revision: 367458
URL: https://svnweb.freebsd.org/changeset/base/367458

Log:
  MFC r340385 (by emaste):
  
  strings: enter capability mode when operating on stdin
  
  Reviewed by:  oshogbo
  Sponsored by: The FreeBSD Foundation
  
  MFC r340391 (by emaste):
  
  Revert r340385, strings capability mode
  
  This needs to be reworked for bootstrapping.
  
  (This is a record-only merge, so these revisions no longer show up in
  "svn mergeinfo --show-revs=eligible" output.)

Modified:
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/12/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367458 - in stable: 11 12

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 18:15:29 2020
New Revision: 367458
URL: https://svnweb.freebsd.org/changeset/base/367458

Log:
  MFC r340385 (by emaste):
  
  strings: enter capability mode when operating on stdin
  
  Reviewed by:  oshogbo
  Sponsored by: The FreeBSD Foundation
  
  MFC r340391 (by emaste):
  
  Revert r340385, strings capability mode
  
  This needs to be reworked for bootstrapping.
  
  (This is a record-only merge, so these revisions no longer show up in
  "svn mergeinfo --show-revs=eligible" output.)

Modified:
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367457 - in stable: 11/contrib/elftoolchain/libelf 11/lib/libdevctl 11/lib/libkvm 11/lib/libsysdecode 11/lib/libutil 11/sbin/hastd 11/share/man/man3 11/share/man/man4 11/share/man/man9...

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 18:10:59 2020
New Revision: 367457
URL: https://svnweb.freebsd.org/changeset/base/367457

Log:
  MFC r344855 (by jhb):
  
  Drop "All rights reserved" from my copyright statements.
  
  Reviewed by:  rgrimes
  Differential Revision:https://reviews.freebsd.org/D19485

Modified:
  stable/11/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/11/lib/libdevctl/devctl.3
  stable/11/lib/libdevctl/devctl.c
  stable/11/lib/libdevctl/devctl.h
  stable/11/lib/libkvm/kvm_aarch64.h
  stable/11/lib/libkvm/kvm_amd64.h
  stable/11/lib/libkvm/kvm_arm.h
  stable/11/lib/libkvm/kvm_i386.h
  stable/11/lib/libkvm/kvm_mips.h
  stable/11/lib/libkvm/kvm_native.3
  stable/11/lib/libkvm/kvm_sparc64.h
  stable/11/lib/libsysdecode/errno.c
  stable/11/lib/libsysdecode/signal.c
  stable/11/lib/libsysdecode/syscallnames.c
  stable/11/lib/libsysdecode/sysdecode.3
  stable/11/lib/libsysdecode/sysdecode.h
  stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3
  stable/11/lib/libsysdecode/sysdecode_cap_rights.3
  stable/11/lib/libsysdecode/sysdecode_enum.3
  stable/11/lib/libsysdecode/sysdecode_fcntl_arg.3
  stable/11/lib/libsysdecode/sysdecode_ioctlname.3
  stable/11/lib/libsysdecode/sysdecode_kevent.3
  stable/11/lib/libsysdecode/sysdecode_mask.3
  stable/11/lib/libsysdecode/sysdecode_quotactl_cmd.3
  stable/11/lib/libsysdecode/sysdecode_sigcode.3
  stable/11/lib/libsysdecode/sysdecode_socket_protocol.3
  stable/11/lib/libsysdecode/sysdecode_sockopt_name.3
  stable/11/lib/libsysdecode/sysdecode_syscallnames.3
  stable/11/lib/libsysdecode/sysdecode_utrace.3
  stable/11/lib/libutil/kinfo_getvmobject.3
  stable/11/sbin/hastd/refcnt.h
  stable/11/share/man/man3/sigevent.3
  stable/11/share/man/man4/ktr.4
  stable/11/share/man/man4/witness.4
  stable/11/share/man/man9/BUS_GET_CPUS.9
  stable/11/share/man/man9/BUS_RESCAN.9
  stable/11/share/man/man9/atomic.9
  stable/11/share/man/man9/bus_map_resource.9
  stable/11/share/man/man9/critical_enter.9
  stable/11/share/man/man9/ithread.9
  stable/11/share/man/man9/ktr.9
  stable/11/share/man/man9/runqueue.9
  stable/11/share/man/man9/scheduler.9
  stable/11/share/man/man9/sleepqueue.9
  stable/11/share/man/man9/swi.9
  stable/11/stand/efi/libefi/devpath.c
  stable/11/stand/i386/cdboot/cdboot.S
  stable/11/stand/i386/libi386/pxe.c
  stable/11/stand/i386/libi386/pxe.h
  stable/11/stand/i386/pxeldr/pxeldr.S
  stable/11/sys/amd64/include/intr_machdep.h
  stable/11/sys/arm/arm/ptrace_machdep.c
  stable/11/sys/dev/acpica/acpi_isab.c
  stable/11/sys/dev/acpica/acpi_pcivar.h
  stable/11/sys/dev/pci/vga_pci.c
  stable/11/sys/dev/rc/rc.c
  stable/11/sys/dev/rc/rcreg.h
  stable/11/sys/i386/pci/pci_pir.c
  stable/11/sys/kern/kern_ktr.c
  stable/11/sys/kern/kern_rwlock.c
  stable/11/sys/kern/subr_lock.c
  stable/11/sys/kern/subr_sleepqueue.c
  stable/11/sys/kern/subr_smp.c
  stable/11/sys/sys/_rwlock.h
  stable/11/sys/sys/refcount.h
  stable/11/sys/sys/rwlock.h
  stable/11/sys/sys/sleepqueue.h
  stable/11/sys/sys/turnstile.h
  stable/11/sys/x86/acpica/madt.c
  stable/11/sys/x86/include/apicvar.h
  stable/11/sys/x86/include/intr_machdep.h
  stable/11/sys/x86/isa/atpic.c
  stable/11/sys/x86/isa/elcr.c
  stable/11/sys/x86/x86/intr_machdep.c
  stable/11/sys/x86/x86/io_apic.c
  stable/11/sys/x86/x86/local_apic.c
  stable/11/sys/x86/x86/mptable.c
  stable/11/sys/x86/x86/mptable_pci.c
  stable/11/sys/x86/xen/pvcpu_enum.c
  stable/11/tests/sys/capsicum/ioctls_test.c
  stable/11/tests/sys/kern/ptrace_test.c
  stable/11/tools/tools/decioctl/decioctl.c
  stable/11/usr.sbin/devctl/devctl.8
  stable/11/usr.sbin/devctl/devctl.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/12/lib/libc/tests/gen/makecontext_test.c
  stable/12/lib/libdevctl/devctl.3
  stable/12/lib/libdevctl/devctl.c
  stable/12/lib/libdevctl/devctl.h
  stable/12/lib/libkvm/kvm_aarch64.h
  stable/12/lib/libkvm/kvm_amd64.h
  stable/12/lib/libkvm/kvm_arm.h
  stable/12/lib/libkvm/kvm_i386.h
  stable/12/lib/libkvm/kvm_mips.h
  stable/12/lib/libkvm/kvm_native.3
  stable/12/lib/libkvm/kvm_riscv.h
  stable/12/lib/libkvm/kvm_sparc64.h
  stable/12/lib/libsysdecode/errno.c
  stable/12/lib/libsysdecode/signal.c
  stable/12/lib/libsysdecode/syscallnames.c
  stable/12/lib/libsysdecode/sysdecode.3
  stable/12/lib/libsysdecode/sysdecode.h
  stable/12/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3
  stable/12/lib/libsysdecode/sysdecode_cap_rights.3
  stable/12/lib/libsysdecode/sysdecode_enum.3
  stable/12/lib/libsysdecode/sysdecode_fcntl_arg.3
  stable/12/lib/libsysdecode/sysdecode_ioctlname.3
  stable/12/lib/libsysdecode/sysdecode_kevent.3
  stable/12/lib/libsysdecode/sysdecode_mask.3
  stable/12/lib/libsysdecode/sysdecode_quotactl_cmd.3
  stable/12/lib/libsysdecode/sysdecode_sigcode.3
  stable/12/lib/libsysdecode/sysdecode_socket_protocol.3
  stable/12/lib/libsysdecode/sysdecode_sockopt_name.3
  

svn commit: r367457 - in stable: 11/contrib/elftoolchain/libelf 11/lib/libdevctl 11/lib/libkvm 11/lib/libsysdecode 11/lib/libutil 11/sbin/hastd 11/share/man/man3 11/share/man/man4 11/share/man/man9...

2020-11-07 Thread Dimitry Andric
Author: dim
Date: Sat Nov  7 18:10:59 2020
New Revision: 367457
URL: https://svnweb.freebsd.org/changeset/base/367457

Log:
  MFC r344855 (by jhb):
  
  Drop "All rights reserved" from my copyright statements.
  
  Reviewed by:  rgrimes
  Differential Revision:https://reviews.freebsd.org/D19485

Modified:
  stable/12/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/12/lib/libc/tests/gen/makecontext_test.c
  stable/12/lib/libdevctl/devctl.3
  stable/12/lib/libdevctl/devctl.c
  stable/12/lib/libdevctl/devctl.h
  stable/12/lib/libkvm/kvm_aarch64.h
  stable/12/lib/libkvm/kvm_amd64.h
  stable/12/lib/libkvm/kvm_arm.h
  stable/12/lib/libkvm/kvm_i386.h
  stable/12/lib/libkvm/kvm_mips.h
  stable/12/lib/libkvm/kvm_native.3
  stable/12/lib/libkvm/kvm_riscv.h
  stable/12/lib/libkvm/kvm_sparc64.h
  stable/12/lib/libsysdecode/errno.c
  stable/12/lib/libsysdecode/signal.c
  stable/12/lib/libsysdecode/syscallnames.c
  stable/12/lib/libsysdecode/sysdecode.3
  stable/12/lib/libsysdecode/sysdecode.h
  stable/12/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3
  stable/12/lib/libsysdecode/sysdecode_cap_rights.3
  stable/12/lib/libsysdecode/sysdecode_enum.3
  stable/12/lib/libsysdecode/sysdecode_fcntl_arg.3
  stable/12/lib/libsysdecode/sysdecode_ioctlname.3
  stable/12/lib/libsysdecode/sysdecode_kevent.3
  stable/12/lib/libsysdecode/sysdecode_mask.3
  stable/12/lib/libsysdecode/sysdecode_quotactl_cmd.3
  stable/12/lib/libsysdecode/sysdecode_sigcode.3
  stable/12/lib/libsysdecode/sysdecode_socket_protocol.3
  stable/12/lib/libsysdecode/sysdecode_sockopt_name.3
  stable/12/lib/libsysdecode/sysdecode_syscallnames.3
  stable/12/lib/libsysdecode/sysdecode_utrace.3
  stable/12/lib/libutil/kinfo_getvmobject.3
  stable/12/sbin/hastd/refcnt.h
  stable/12/share/man/man3/sigevent.3
  stable/12/share/man/man4/ktr.4
  stable/12/share/man/man4/witness.4
  stable/12/share/man/man9/BUS_GET_CPUS.9
  stable/12/share/man/man9/BUS_RESCAN.9
  stable/12/share/man/man9/atomic.9
  stable/12/share/man/man9/bus_map_resource.9
  stable/12/share/man/man9/critical_enter.9
  stable/12/share/man/man9/ithread.9
  stable/12/share/man/man9/ktr.9
  stable/12/share/man/man9/runqueue.9
  stable/12/share/man/man9/scheduler.9
  stable/12/share/man/man9/sleepqueue.9
  stable/12/share/man/man9/swi.9
  stable/12/stand/efi/libefi/devpath.c
  stable/12/stand/i386/cdboot/cdboot.S
  stable/12/stand/i386/libi386/pxe.c
  stable/12/stand/i386/libi386/pxe.h
  stable/12/stand/i386/pxeldr/pxeldr.S
  stable/12/sys/amd64/include/intr_machdep.h
  stable/12/sys/arm/arm/ptrace_machdep.c
  stable/12/sys/dev/acpica/acpi_isab.c
  stable/12/sys/dev/acpica/acpi_pcivar.h
  stable/12/sys/dev/pci/vga_pci.c
  stable/12/sys/dev/rc/rc.c
  stable/12/sys/dev/rc/rcreg.h
  stable/12/sys/i386/pci/pci_pir.c
  stable/12/sys/kern/kern_ktr.c
  stable/12/sys/kern/kern_rwlock.c
  stable/12/sys/kern/subr_lock.c
  stable/12/sys/kern/subr_sleepqueue.c
  stable/12/sys/kern/subr_smp.c
  stable/12/sys/sys/_rwlock.h
  stable/12/sys/sys/refcount.h
  stable/12/sys/sys/rwlock.h
  stable/12/sys/sys/sleepqueue.h
  stable/12/sys/sys/turnstile.h
  stable/12/sys/x86/acpica/madt.c
  stable/12/sys/x86/include/apicvar.h
  stable/12/sys/x86/include/intr_machdep.h
  stable/12/sys/x86/isa/atpic.c
  stable/12/sys/x86/isa/elcr.c
  stable/12/sys/x86/x86/intr_machdep.c
  stable/12/sys/x86/x86/io_apic.c
  stable/12/sys/x86/x86/local_apic.c
  stable/12/sys/x86/x86/mptable.c
  stable/12/sys/x86/x86/mptable_pci.c
  stable/12/sys/x86/xen/pvcpu_enum.c
  stable/12/tests/sys/capsicum/ioctls_test.c
  stable/12/tests/sys/kern/ptrace_test.c
  stable/12/tools/tools/decioctl/decioctl.c
  stable/12/usr.sbin/bhyve/gdb.c
  stable/12/usr.sbin/bhyve/gdb.h
  stable/12/usr.sbin/devctl/devctl.8
  stable/12/usr.sbin/devctl/devctl.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/11/lib/libdevctl/devctl.3
  stable/11/lib/libdevctl/devctl.c
  stable/11/lib/libdevctl/devctl.h
  stable/11/lib/libkvm/kvm_aarch64.h
  stable/11/lib/libkvm/kvm_amd64.h
  stable/11/lib/libkvm/kvm_arm.h
  stable/11/lib/libkvm/kvm_i386.h
  stable/11/lib/libkvm/kvm_mips.h
  stable/11/lib/libkvm/kvm_native.3
  stable/11/lib/libkvm/kvm_sparc64.h
  stable/11/lib/libsysdecode/errno.c
  stable/11/lib/libsysdecode/signal.c
  stable/11/lib/libsysdecode/syscallnames.c
  stable/11/lib/libsysdecode/sysdecode.3
  stable/11/lib/libsysdecode/sysdecode.h
  stable/11/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3
  stable/11/lib/libsysdecode/sysdecode_cap_rights.3
  stable/11/lib/libsysdecode/sysdecode_enum.3
  stable/11/lib/libsysdecode/sysdecode_fcntl_arg.3
  stable/11/lib/libsysdecode/sysdecode_ioctlname.3
  stable/11/lib/libsysdecode/sysdecode_kevent.3
  stable/11/lib/libsysdecode/sysdecode_mask.3
  stable/11/lib/libsysdecode/sysdecode_quotactl_cmd.3
  stable/11/lib/libsysdecode/sysdecode_sigcode.3
  

svn commit: r367456 - head/sys/kern

2020-11-07 Thread Kyle Evans
Author: kevans
Date: Sat Nov  7 18:07:55 2020
New Revision: 367456
URL: https://svnweb.freebsd.org/changeset/base/367456

Log:
  imgact_binmisc: move some calculations out of the exec path
  
  The offset we need to account for in the interpreter string comes in two
  variants:
  
  1. Fixed - macros other than #a that will not vary from invocation to
 invocation
  2. Variable - #a, which is substitued with the argv0 that we're replacing
  
  Note that we don't have a mechanism to modify an existing entry.  By
  recording both of these offset requirements when the interpreter is added,
  we can avoid some unnecessary calculations in the exec path.
  
  Most importantly, we can know up-front whether we need to grab
  calculate/grab the the filename for this interpreter. We also get to avoid
  walking the string a first time looking for macros. For most invocations,
  it's a swift exit as they won't have any, but there's no point entering a
  loop and searching for the macro indicator if we already know there will not
  be one.
  
  While we're here, go ahead and only calculate the argv0 name length once per
  invocation. While it's unlikely that we'll have more than one #a, there's no
  reason to recalculate it every time we encounter an #a when it will not
  change.
  
  I have not bothered trying to benchmark this at all, because it's arguably a
  minor and straightforward/obvious improvement.
  
  MFC after:1 week

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Sat Nov  7 17:18:44 2020
(r367455)
+++ head/sys/kern/imgact_binmisc.c  Sat Nov  7 18:07:55 2020
(r367456)
@@ -63,8 +63,10 @@ typedef struct imgact_binmisc_entry {
uint8_t  *ibe_magic;
uint8_t  *ibe_mask;
uint8_t  *ibe_interpreter;
+   ssize_t   ibe_interp_offset;
uint32_t  ibe_interp_argcnt;
uint32_t  ibe_interp_length;
+   uint32_t  ibe_argv0_cnt;
uint32_t  ibe_flags;
uint32_t  ibe_moffset;
uint32_t  ibe_msize;
@@ -154,7 +156,8 @@ imgact_binmisc_populate_interp(char *str, imgact_binmi
  * Allocate memory and populate a new entry for the interpreter table.
  */
 static imgact_binmisc_entry_t *
-imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe)
+imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe, ssize_t interp_offset,
+int argv0_cnt)
 {
imgact_binmisc_entry_t *ibe = NULL;
size_t namesz = min(strlen(xbe->xbe_name) + 1, IBE_NAME_MAX);
@@ -175,7 +178,8 @@ imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe)
ibe->ibe_moffset = xbe->xbe_moffset;
ibe->ibe_msize = xbe->xbe_msize;
ibe->ibe_flags = xbe->xbe_flags;
-
+   ibe->ibe_interp_offset = interp_offset;
+   ibe->ibe_argv0_cnt = argv0_cnt;
return (ibe);
 }
 
@@ -227,7 +231,8 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe)
 {
imgact_binmisc_entry_t *ibe;
char *p;
-   int cnt;
+   ssize_t interp_offset;
+   int argv0_cnt, cnt;
 
if (xbe->xbe_msize > IBE_MAGIC_MAX)
return (EINVAL);
@@ -242,23 +247,21 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe)
 
/* Make sure we don't have any invalid #'s. */
p = xbe->xbe_interpreter;
-   while (1) {
-   p = strchr(p, '#');
-   if (!p)
-   break;
-
+   interp_offset = 0;
+   argv0_cnt = 0;
+   while ((p = strchr(p, '#')) != NULL) {
p++;
switch(*p) {
case ISM_POUND:
/* "##" */
p++;
+   interp_offset--;
break;
-
case ISM_OLD_ARGV0:
/* "#a" */
p++;
+   argv0_cnt++;
break;
-
case 0:
default:
/* Anything besides the above is invalid. */
@@ -273,7 +276,7 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe)
}
 
/* Preallocate a new entry. */
-   ibe = imgact_binmisc_new_entry(xbe);
+   ibe = imgact_binmisc_new_entry(xbe, interp_offset, argv0_cnt);
 
SLIST_INSERT_HEAD(_list, ibe, link);
interp_list_entry_count++;
@@ -586,12 +589,16 @@ imgact_binmisc_exec(struct image_params *imgp)
const char *image_header = imgp->image_header;
const char *fname = NULL;
int error = 0;
-   size_t offset, l;
+#ifdef INVARIANTS
+   int argv0_cnt = 0;
+#endif
+   size_t namelen, offset;
imgact_binmisc_entry_t 

Re: svn commit: r367455 - head/usr.sbin/syslogd

2020-11-07 Thread Cy Schubert
In message <202011071718.0a7hijdy003...@repo.freebsd.org>, Bryan Drewery 
writes
:
> Author: bdrewery
> Date: Sat Nov  7 17:18:44 2020
> New Revision: 367455
> URL: https://svnweb.freebsd.org/changeset/base/367455
>
> Log:
>   syslogd: Stop trying to send remote messages through special sockets
>   
>   Specifically this was causing the /dev/klog fd and the signal pipe
>   handling fd to get a sendmsg(2) called on them and always returned
>   [ENOTSOCK].
>   
>   r310350 combined these sockets into the main socket list and properly
>   skipped AF_UNSPEC at the sendmsg(2) call but later in r344739 it was
>   broken such that these special sockets were no longer excluded since
>   the AF_UNSPEC check specifically excluded these special sockets. Only
>   these special sockets have sl_sa = NULL. The sl_family checks should
>   be redundant now but are left in case of future changes so the intent
>   is clearer.
>   
>   MFC after:  2 weeks
>
> Modified:
>   head/usr.sbin/syslogd/syslogd.c
>
> Modified: head/usr.sbin/syslogd/syslogd.c
> =
> =
> --- head/usr.sbin/syslogd/syslogd.c   Sat Nov  7 16:58:38 2020(r36745
> 4)
> +++ head/usr.sbin/syslogd/syslogd.c   Sat Nov  7 17:18:44 2020(r36745
> 5)
> @@ -1871,9 +1871,9 @@ fprintlog_write(struct filed *f, struct iovlist *il, i
>   STAILQ_FOREACH(sl, , next) {
>   if (sl->sl_socket < 0)
>   continue;
> - if (sl->sl_sa != NULL &&
> - (sl->sl_family == AF_LOCAL ||
> -  sl->sl_family == AF_UNSPEC))
> + if (sl->sl_sa == NULL ||
> + sl->sl_family == AF_UNSPEC ||
> + sl->sl_family == AF_LOCAL) {

The extraneous left brace broke the build.

>   continue;
>   lsent = sendmsg(sl->sl_socket, , 0);
>   if (lsent == (ssize_t)il->totalsize)
>


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.



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


svn commit: r367455 - head/usr.sbin/syslogd

2020-11-07 Thread Bryan Drewery
Author: bdrewery
Date: Sat Nov  7 17:18:44 2020
New Revision: 367455
URL: https://svnweb.freebsd.org/changeset/base/367455

Log:
  syslogd: Stop trying to send remote messages through special sockets
  
  Specifically this was causing the /dev/klog fd and the signal pipe
  handling fd to get a sendmsg(2) called on them and always returned
  [ENOTSOCK].
  
  r310350 combined these sockets into the main socket list and properly
  skipped AF_UNSPEC at the sendmsg(2) call but later in r344739 it was
  broken such that these special sockets were no longer excluded since
  the AF_UNSPEC check specifically excluded these special sockets. Only
  these special sockets have sl_sa = NULL. The sl_family checks should
  be redundant now but are left in case of future changes so the intent
  is clearer.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Sat Nov  7 16:58:38 2020
(r367454)
+++ head/usr.sbin/syslogd/syslogd.c Sat Nov  7 17:18:44 2020
(r367455)
@@ -1871,9 +1871,9 @@ fprintlog_write(struct filed *f, struct iovlist *il, i
STAILQ_FOREACH(sl, , next) {
if (sl->sl_socket < 0)
continue;
-   if (sl->sl_sa != NULL &&
-   (sl->sl_family == AF_LOCAL ||
-sl->sl_family == AF_UNSPEC))
+   if (sl->sl_sa == NULL ||
+   sl->sl_family == AF_UNSPEC ||
+   sl->sl_family == AF_LOCAL) {
continue;
lsent = sendmsg(sl->sl_socket, , 0);
if (lsent == (ssize_t)il->totalsize)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367454 - head/sys/contrib/openzfs/module/os/freebsd/zfs

2020-11-07 Thread Mateusz Guzik
Author: mjg
Date: Sat Nov  7 16:58:38 2020
New Revision: 367454
URL: https://svnweb.freebsd.org/changeset/base/367454

Log:
  zfs: remove 2 assertions that teardown lock is not held
  
  They are not very useful and hard to implement with rms.
  
  This has a side effect of simplying the code.

Modified:
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c

Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c
==
--- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c  Sat Nov  7 
16:57:53 2020(r367453)
+++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c  Sat Nov  7 
16:58:38 2020(r367454)
@@ -1451,10 +1451,6 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char 
 
if (zfsvfs->z_replay == B_FALSE)
ASSERT_VOP_LOCKED(dvp, __func__);
-#ifdef DIAGNOSTIC
-   if ((zdp->z_pflags & ZFS_XATTR) == 0)
-   VERIFY(!ZFS_TEARDOWN_HELD(zfsvfs));
-#endif
 
if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) {
ASSERT3P(dvp, ==, vp);
@@ -6523,39 +6519,6 @@ zfs_vptocnp(struct vop_vptocnp_args *ap)
return (error);
 }
 
-#ifdef DIAGNOSTIC
-#ifndef _SYS_SYSPROTO_H_
-struct vop_lock1_args {
-   struct vnode *a_vp;
-   int a_flags;
-   char *file;
-   int line;
-};
-#endif
-
-static int
-zfs_lock(struct vop_lock1_args *ap)
-{
-   vnode_t *vp;
-   znode_t *zp;
-   int err;
-
-#if __FreeBSD_version >= 1300064
-   err = vop_lock(ap);
-#else
-   err = vop_stdlock(ap);
-#endif
-   if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) {
-   vp = ap->a_vp;
-   zp = vp->v_data;
-   if (vp->v_mount != NULL && !VN_IS_DOOMED(vp) &&
-   zp != NULL && (zp->z_pflags & ZFS_XATTR) == 0)
-   VERIFY(!ZFS_TEARDOWN_HELD(zp->z_zfsvfs));
-   }
-   return (err);
-}
-#endif
-
 struct vop_vector zfs_vnodeops;
 struct vop_vector zfs_fifoops;
 struct vop_vector zfs_shareops;
@@ -6606,17 +6569,9 @@ struct vop_vector zfs_vnodeops = {
.vop_putpages = zfs_freebsd_putpages,
.vop_vptocnp =  zfs_vptocnp,
 #if __FreeBSD_version >= 1300064
-#ifdef DIAGNOSTIC
-   .vop_lock1 =zfs_lock,
-#else
.vop_lock1 =vop_lock,
-#endif
.vop_unlock =   vop_unlock,
.vop_islocked = vop_islocked,
-#else
-#ifdef DIAGNOSTIC
-   .vop_lock1 =zfs_lock,
-#endif
 #endif
 };
 VFS_VOP_VECTOR_REGISTER(zfs_vnodeops);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2020-11-07 Thread Mateusz Guzik
Author: mjg
Date: Sat Nov  7 16:57:53 2020
New Revision: 367453
URL: https://svnweb.freebsd.org/changeset/base/367453

Log:
  rms: several cleanups + debug read lockers handling
  
  This adds a dedicated counter updated with atomics when INVARIANTS
  is used. As a side effect one can reliably determine the lock is held
  for reading by at least one thread, but it's still not possible to
  find out whether curthread has the lock in said mode.
  
  This should be good enough in practice.
  
  Problem spotted by avg.

Modified:
  head/sys/kern/kern_rmlock.c
  head/sys/sys/_rmlock.h
  head/sys/sys/rmlock.h

Modified: head/sys/kern/kern_rmlock.c
==
--- head/sys/kern/kern_rmlock.c Sat Nov  7 16:41:59 2020(r367452)
+++ head/sys/kern/kern_rmlock.c Sat Nov  7 16:57:53 2020(r367453)
@@ -878,10 +878,105 @@ db_show_rm(const struct lock_object *lock)
  * problem at some point. The easiest way to lessen it is to provide a bitmap.
  */
 
+#define rms_int_membar()   __compiler_membar()
+
 #defineRMS_NOOWNER ((void *)0x1)
 #defineRMS_TRANSIENT   ((void *)0x2)
 #defineRMS_FLAGMASK0xf
 
+struct rmslock_pcpu {
+   int influx;
+   int readers;
+};
+
+_Static_assert(sizeof(struct rmslock_pcpu) == 8, "bad size");
+
+/*
+ * Internal routines
+ */
+static struct rmslock_pcpu *
+rms_int_pcpu(struct rmslock *rms)
+{
+
+   CRITICAL_ASSERT(curthread);
+   return (zpcpu_get(rms->pcpu));
+}
+
+static struct rmslock_pcpu *
+rms_int_remote_pcpu(struct rmslock *rms, int cpu)
+{
+
+   return (zpcpu_get_cpu(rms->pcpu, cpu));
+}
+
+static void
+rms_int_influx_enter(struct rmslock *rms, struct rmslock_pcpu *pcpu)
+{
+
+   CRITICAL_ASSERT(curthread);
+   MPASS(pcpu->influx == 0);
+   pcpu->influx = 1;
+}
+
+static void
+rms_int_influx_exit(struct rmslock *rms, struct rmslock_pcpu *pcpu)
+{
+
+   CRITICAL_ASSERT(curthread);
+   MPASS(pcpu->influx == 1);
+   pcpu->influx = 0;
+}
+
+#ifdef INVARIANTS
+static void
+rms_int_debug_readers_inc(struct rmslock *rms)
+{
+   int old;
+   old = atomic_fetchadd_int(>debug_readers, 1);
+   KASSERT(old >= 0, ("%s: bad readers count %d\n", __func__, old));
+}
+
+static void
+rms_int_debug_readers_dec(struct rmslock *rms)
+{
+   int old;
+
+   old = atomic_fetchadd_int(>debug_readers, -1);
+   KASSERT(old > 0, ("%s: bad readers count %d\n", __func__, old));
+}
+#else
+static void
+rms_int_debug_readers_inc(struct rmslock *rms)
+{
+}
+
+static void
+rms_int_debug_readers_dec(struct rmslock *rms)
+{
+}
+#endif
+
+static void
+rms_int_readers_inc(struct rmslock *rms, struct rmslock_pcpu *pcpu)
+{
+
+   CRITICAL_ASSERT(curthread);
+   rms_int_debug_readers_inc(rms);
+   pcpu->readers++;
+}
+
+static void
+rms_int_readers_dec(struct rmslock *rms, struct rmslock_pcpu *pcpu)
+{
+
+   CRITICAL_ASSERT(curthread);
+   rms_int_debug_readers_dec(rms);
+   pcpu->readers--;
+}
+
+/*
+ * Public API
+ */
 void
 rms_init(struct rmslock *rms, const char *name)
 {
@@ -889,9 +984,9 @@ rms_init(struct rmslock *rms, const char *name)
rms->owner = RMS_NOOWNER;
rms->writers = 0;
rms->readers = 0;
+   rms->debug_readers = 0;
mtx_init(>mtx, name, NULL, MTX_DEF | MTX_NEW);
-   rms->readers_pcpu = uma_zalloc_pcpu(pcpu_zone_4, M_WAITOK | M_ZERO);
-   rms->readers_influx = uma_zalloc_pcpu(pcpu_zone_4, M_WAITOK | M_ZERO);
+   rms->pcpu = uma_zalloc_pcpu(pcpu_zone_8, M_WAITOK | M_ZERO);
 }
 
 void
@@ -901,23 +996,21 @@ rms_destroy(struct rmslock *rms)
MPASS(rms->writers == 0);
MPASS(rms->readers == 0);
mtx_destroy(>mtx);
-   uma_zfree_pcpu(pcpu_zone_4, rms->readers_pcpu);
-   uma_zfree_pcpu(pcpu_zone_4, rms->readers_influx);
+   uma_zfree_pcpu(pcpu_zone_8, rms->pcpu);
 }
 
 static void __noinline
 rms_rlock_fallback(struct rmslock *rms)
 {
 
-   zpcpu_set_protected(rms->readers_influx, 0);
+   rms_int_influx_exit(rms, rms_int_pcpu(rms));
critical_exit();
 
mtx_lock(>mtx);
-   MPASS(*zpcpu_get(rms->readers_pcpu) == 0);
while (rms->writers > 0)
msleep(>readers, >mtx, PUSER - 1, 
mtx_name(>mtx), 0);
critical_enter();
-   zpcpu_add_protected(rms->readers_pcpu, 1);
+   rms_int_readers_inc(rms, rms_int_pcpu(rms));
mtx_unlock(>mtx);
critical_exit();
 }
@@ -925,43 +1018,46 @@ rms_rlock_fallback(struct rmslock *rms)
 void
 rms_rlock(struct rmslock *rms)
 {
+   struct rmslock_pcpu *pcpu;
 
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
MPASS(atomic_load_ptr(>owner) != curthread);
 
critical_enter();
-   zpcpu_set_protected(rms->readers_influx, 1);
-   __compiler_membar();
+   pcpu = rms_int_pcpu(rms);
+   rms_int_influx_enter(rms, pcpu);
+   rms_int_membar();
if (__predict_false(rms->writers > 0)) {

svn commit: r367452 - head/sys/kern

2020-11-07 Thread Kyle Evans
Author: kevans
Date: Sat Nov  7 16:41:59 2020
New Revision: 367452
URL: https://svnweb.freebsd.org/changeset/base/367452

Log:
  imgact_binmisc: reorder members of struct imgact_binmisc_entry (NFC)
  
  This doesn't change anything at the moment since the out-of-order elements
  were a pair of uint32_t, but future additions may have caused unnecessary
  padding by following the existing precedent.
  
  MFC after:1 week

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Sat Nov  7 16:35:48 2020
(r367451)
+++ head/sys/kern/imgact_binmisc.c  Sat Nov  7 16:41:59 2020
(r367452)
@@ -58,16 +58,16 @@ __FBSDID("$FreeBSD$");
  * Node of the interpreter list.
  */
 typedef struct imgact_binmisc_entry {
+   SLIST_ENTRY(imgact_binmisc_entry) link;
char *ibe_name;
uint8_t  *ibe_magic;
-   uint32_t  ibe_moffset;
-   uint32_t  ibe_msize;
uint8_t  *ibe_mask;
uint8_t  *ibe_interpreter;
uint32_t  ibe_interp_argcnt;
uint32_t  ibe_interp_length;
uint32_t  ibe_flags;
-   SLIST_ENTRY(imgact_binmisc_entry) link;
+   uint32_t  ibe_moffset;
+   uint32_t  ibe_msize;
 } imgact_binmisc_entry_t;
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367451 - stable/12/sys/arm64/arm64

2020-11-07 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Nov  7 16:35:48 2020
New Revision: 367451
URL: https://svnweb.freebsd.org/changeset/base/367451

Log:
  MFC r367327:
  
   arm64: implement bs_sr_
  
Implement the bs_sr_ generic functions based on the generic
mips implementation calling the generic bs_w_ functions in a loop.
  
ral(4) (rt2860.c) panics in RAL_SET_REGION_4() because bs_sr_4()
is NULL.  It seems ral(4) and ti(4) might be the only consumers of
these functions I could find quickly so keeping them in C rather than asm.

Modified:
  stable/12/sys/arm64/arm64/bus_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/arm64/bus_machdep.c
==
--- stable/12/sys/arm64/arm64/bus_machdep.c Sat Nov  7 16:34:21 2020
(r367450)
+++ stable/12/sys/arm64/arm64/bus_machdep.c Sat Nov  7 16:35:48 2020
(r367451)
@@ -116,6 +116,50 @@ generic_bs_subregion(void *t, bus_space_handle_t bsh, 
return (0);
 }
 
+/*
+ * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described
+ * by tag/handle starting at `offset'.
+ */
+static void
+generic_bs_sr_1(void *t, bus_space_handle_t bsh,
+bus_size_t offset, uint8_t value, size_t count)
+{
+   bus_addr_t addr = bsh + offset;
+
+   for (; count != 0; count--, addr++)
+   generic_bs_w_1(t, bsh, addr, value);
+}
+
+static void
+generic_bs_sr_2(void *t, bus_space_handle_t bsh,
+  bus_size_t offset, uint16_t value, size_t count)
+{
+   bus_addr_t addr = bsh + offset;
+
+   for (; count != 0; count--, addr += 2)
+   generic_bs_w_2(t, bsh, addr, value);
+}
+
+static void
+generic_bs_sr_4(void *t, bus_space_handle_t bsh,
+bus_size_t offset, uint32_t value, size_t count)
+{
+   bus_addr_t addr = bsh + offset;
+
+   for (; count != 0; count--, addr += 4)
+   generic_bs_w_4(t, bsh, addr, value);
+}
+
+static void
+generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset,
+uint64_t value, size_t count)
+{
+   bus_addr_t addr = bsh + offset;
+
+   for (; count != 0; count--, addr += 8)
+   generic_bs_w_8(t, bsh, addr, value);
+}
+
 struct bus_space memmap_bus = {
/* cookie */
.bs_cookie = NULL,
@@ -175,10 +219,10 @@ struct bus_space memmap_bus = {
.bs_sm_8 = NULL,
 
/* set region */
-   .bs_sr_1 = NULL,
-   .bs_sr_2 = NULL,
-   .bs_sr_4 = NULL,
-   .bs_sr_8 = NULL,
+   .bs_sr_1 =  generic_bs_sr_1,
+   .bs_sr_2 =  generic_bs_sr_2,
+   .bs_sr_4 =  generic_bs_sr_4,
+   .bs_sr_8 =  generic_bs_sr_8,
 
/* copy */
.bs_c_1 = NULL,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367450 - stable/12/sys/net80211

2020-11-07 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Nov  7 16:34:21 2020
New Revision: 367450
URL: https://svnweb.freebsd.org/changeset/base/367450

Log:
  MFC r367326:
  
   net80211: fix a typo
  
Correct a typo referring to the wrong flags in a comment.
No functional changes.

Modified:
  stable/12/sys/net80211/_ieee80211.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net80211/_ieee80211.h
==
--- stable/12/sys/net80211/_ieee80211.h Sat Nov  7 16:20:37 2020
(r367449)
+++ stable/12/sys/net80211/_ieee80211.h Sat Nov  7 16:34:21 2020
(r367450)
@@ -619,7 +619,7 @@ struct ieee80211_rx_stats {
} evm;
 
/* 32 bits */
-   uint8_t c_phytype;  /* PHY type, FW flags above */
+   uint8_t c_phytype;  /* PHY type, FP flags above */
uint8_t c_vhtnss;   /* VHT - number of spatial streams */
uint8_t c_pad2[2];
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367449 - in stable: 11/sys/kern 12/sys/kern

2020-11-07 Thread John Baldwin
Author: jhb
Date: Sat Nov  7 16:20:37 2020
New Revision: 367449
URL: https://svnweb.freebsd.org/changeset/base/367449

Log:
  MFC 366296: Avoid a dubious assignment to bio_data in aio_qbio().
  
  A user pointer is not a suitable value for bio_data and the next block
  of code always overwrites bio_data anyway.  Just use cb->aio_buf
  directly in the call to vm_fault_quick_hold_pages().

Modified:
  stable/12/sys/kern/vfs_aio.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/kern/vfs_aio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/kern/vfs_aio.c
==
--- stable/12/sys/kern/vfs_aio.cSat Nov  7 15:38:01 2020
(r367448)
+++ stable/12/sys/kern/vfs_aio.cSat Nov  7 16:20:37 2020
(r367449)
@@ -1278,7 +1278,6 @@ aio_qbio(struct proc *p, struct kaiocb *job)
bp->bio_length = cb->aio_nbytes;
bp->bio_bcount = cb->aio_nbytes;
bp->bio_done = aio_biowakeup;
-   bp->bio_data = (void *)(uintptr_t)cb->aio_buf;
bp->bio_offset = cb->aio_offset;
bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ;
bp->bio_dev = dev;
@@ -1288,7 +1287,7 @@ aio_qbio(struct proc *p, struct kaiocb *job)
if (cb->aio_lio_opcode == LIO_READ)
prot |= VM_PROT_WRITE;  /* Less backwards than it looks */
job->npages = vm_fault_quick_hold_pages(>p_vmspace->vm_map,
-   (vm_offset_t)bp->bio_data, bp->bio_length, prot, job->pages,
+   (vm_offset_t)cb->aio_buf, bp->bio_length, prot, job->pages,
nitems(job->pages));
if (job->npages < 0) {
error = EFAULT;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367449 - in stable: 11/sys/kern 12/sys/kern

2020-11-07 Thread John Baldwin
Author: jhb
Date: Sat Nov  7 16:20:37 2020
New Revision: 367449
URL: https://svnweb.freebsd.org/changeset/base/367449

Log:
  MFC 366296: Avoid a dubious assignment to bio_data in aio_qbio().
  
  A user pointer is not a suitable value for bio_data and the next block
  of code always overwrites bio_data anyway.  Just use cb->aio_buf
  directly in the call to vm_fault_quick_hold_pages().

Modified:
  stable/11/sys/kern/vfs_aio.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/kern/vfs_aio.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/kern/vfs_aio.c
==
--- stable/11/sys/kern/vfs_aio.cSat Nov  7 15:38:01 2020
(r367448)
+++ stable/11/sys/kern/vfs_aio.cSat Nov  7 16:20:37 2020
(r367449)
@@ -1280,7 +1280,6 @@ aio_qbio(struct proc *p, struct kaiocb *job)
bp->bio_length = cb->aio_nbytes;
bp->bio_bcount = cb->aio_nbytes;
bp->bio_done = aio_biowakeup;
-   bp->bio_data = (void *)(uintptr_t)cb->aio_buf;
bp->bio_offset = cb->aio_offset;
bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ;
bp->bio_dev = dev;
@@ -1290,7 +1289,7 @@ aio_qbio(struct proc *p, struct kaiocb *job)
if (cb->aio_lio_opcode == LIO_READ)
prot |= VM_PROT_WRITE;  /* Less backwards than it looks */
job->npages = vm_fault_quick_hold_pages(>p_vmspace->vm_map,
-   (vm_offset_t)bp->bio_data, bp->bio_length, prot, job->pages,
+   (vm_offset_t)cb->aio_buf, bp->bio_length, prot, job->pages,
nitems(job->pages));
if (job->npages < 0) {
error = EFAULT;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367448 - head/sys/dev/vt

2020-11-07 Thread Kyle Evans
Author: kevans
Date: Sat Nov  7 15:38:01 2020
New Revision: 367448
URL: https://svnweb.freebsd.org/changeset/base/367448

Log:
  vt: resolve conflict between VT_ALT_TO_ESC_HACK and DBG
  
  When using the ALT+CTRL+ESC sequence to break into kdb, the keyboard is
  completely borked when you return. watch(8) shows that it's working, but
  it's inserting escape sequences.
  
  Further investigation revealed that VT_ALT_TO_ESC_HACK is the default and
  directly conflicts with this sequence, so upon return from the debugger
  ALKED is set.
  
  If they triggered the break to debugger, it's safe to assume they didn't
  mean to use VT_ALT_TO_ESC_HACK, so just unset it to reduce the surprise when
  the keyboard seems non-functional upon return.
  
  Reviewed by:  tsoome
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D27109

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Sat Nov  7 14:58:01 2020(r367447)
+++ head/sys/dev/vt/vt_core.c   Sat Nov  7 15:38:01 2020(r367448)
@@ -725,13 +725,22 @@ vt_scroll(struct vt_window *vw, int offset, int whence
 }
 
 static int
-vt_machine_kbdevent(int c)
+vt_machine_kbdevent(struct vt_device *vd, int c)
 {
 
switch (c) {
case SPCLKEY | DBG: /* kbdmap(5) keyword `debug`. */
-   if (vt_kbd_debug)
+   if (vt_kbd_debug) {
kdb_enter(KDB_WHY_BREAK, "manual escape to debugger");
+#if VT_ALT_TO_ESC_HACK
+   /*
+* There's an unfortunate conflict between SPCLKEY|DBG
+* and VT_ALT_TO_ESC_HACK.  Just assume they didn't mean
+* it if we got to here.
+*/
+   vd->vd_kbstate &= ~ALKED;
+#endif
+   }
return (1);
case SPCLKEY | HALT: /* kbdmap(5) keyword `halt`. */
if (vt_kbd_halt)
@@ -864,7 +873,7 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, i
return (0);
 #endif
 
-   if (vt_machine_kbdevent(c))
+   if (vt_machine_kbdevent(vd, c))
return (0);
 
if (vw->vw_flags & VWF_SCROLL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2020-11-07 Thread Michal Meloun
Author: mmel
Date: Sat Nov  7 14:58:01 2020
New Revision: 367447
URL: https://svnweb.freebsd.org/changeset/base/367447

Log:
  Add a method to determine whether given interrupt is per CPU or not.
  
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_intr.c
  head/sys/sys/intr.h

Modified: head/sys/kern/subr_intr.c
==
--- head/sys/kern/subr_intr.c   Sat Nov  7 13:16:11 2020(r367446)
+++ head/sys/kern/subr_intr.c   Sat Nov  7 14:58:01 2020(r367447)
@@ -946,6 +946,21 @@ intr_resolve_irq(device_t dev, intptr_t xref, struct i
}
 }
 
+bool
+intr_is_per_cpu(struct resource *res)
+{
+   u_int res_id;
+   struct intr_irqsrc *isrc;
+
+   res_id = (u_int)rman_get_start(res);
+   isrc = intr_map_get_isrc(res_id);
+
+   if (isrc == NULL)
+   panic("Attempt to get isrc for non-active resource id: %u\n",
+   res_id);
+   return ((isrc->isrc_flags & INTR_ISRCF_PPI) != 0);
+}
+
 int
 intr_activate_irq(device_t dev, struct resource *res)
 {

Modified: head/sys/sys/intr.h
==
--- head/sys/sys/intr.h Sat Nov  7 13:16:11 2020(r367446)
+++ head/sys/sys/intr.h Sat Nov  7 14:58:01 2020(r367447)
@@ -115,6 +115,7 @@ int intr_pic_deregister(device_t, intptr_t);
 int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, 
u_int);
 struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *,
 intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t);
+bool intr_is_per_cpu(struct resource *);
 
 extern device_t intr_irq_root_dev;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367446 - in stable/12/sys: geom kern sys

2020-11-07 Thread Alexander Motin
Author: mav
Date: Sat Nov  7 13:16:11 2020
New Revision: 367446
URL: https://svnweb.freebsd.org/changeset/base/367446

Log:
  MFC r367022: Fix asymmetry in devstat(9) calls by GEOM.
  
  Before this GEOM passed bio pointer to transaction end, but not start.
  It was irrelevant until devstat(9) got DTrace hooks, that appeared to
  provide bio pointer on I/O completion, but not on submission.

Modified:
  stable/12/sys/geom/geom_io.c
  stable/12/sys/kern/subr_devstat.c
  stable/12/sys/sys/devicestat.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/geom/geom_io.c
==
--- stable/12/sys/geom/geom_io.cSat Nov  7 13:09:51 2020
(r367445)
+++ stable/12/sys/geom/geom_io.cSat Nov  7 13:16:11 2020
(r367446)
@@ -616,9 +616,9 @@ g_io_request(struct bio *bp, struct g_consumer *cp)
mtxp = mtx_pool_find(mtxpool_sleep, pp);
mtx_lock(mtxp);
if (g_collectstats & G_STATS_PROVIDERS)
-   devstat_start_transaction(pp->stat, >bio_t0);
+   devstat_start_transaction_bio_t0(pp->stat, bp);
if (g_collectstats & G_STATS_CONSUMERS)
-   devstat_start_transaction(cp->stat, >bio_t0);
+   devstat_start_transaction_bio_t0(cp->stat, bp);
pp->nstart++;
cp->nstart++;
mtx_unlock(mtxp);

Modified: stable/12/sys/kern/subr_devstat.c
==
--- stable/12/sys/kern/subr_devstat.c   Sat Nov  7 13:09:51 2020
(r367445)
+++ stable/12/sys/kern/subr_devstat.c   Sat Nov  7 13:16:11 2020
(r367446)
@@ -261,6 +261,17 @@ devstat_start_transaction_bio(struct devstat *ds, stru
return;
 
binuptime(>bio_t0);
+   devstat_start_transaction_bio_t0(ds, bp);
+}
+
+void
+devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp)
+{
+
+   /* sanity check */
+   if (ds == NULL)
+   return;
+
devstat_start_transaction(ds, >bio_t0);
DTRACE_DEVSTAT_BIO_START();
 }

Modified: stable/12/sys/sys/devicestat.h
==
--- stable/12/sys/sys/devicestat.h  Sat Nov  7 13:09:51 2020
(r367445)
+++ stable/12/sys/sys/devicestat.h  Sat Nov  7 13:16:11 2020
(r367446)
@@ -196,6 +196,7 @@ struct devstat *devstat_new_entry(const void *dev_name
 void devstat_remove_entry(struct devstat *ds);
 void devstat_start_transaction(struct devstat *ds, const struct bintime *now);
 void devstat_start_transaction_bio(struct devstat *ds, struct bio *bp);
+void devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp);
 void devstat_end_transaction(struct devstat *ds, u_int32_t bytes, 
 devstat_tag_type tag_type,
 devstat_trans_flags flags,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367445 - head/sys/kern

2020-11-07 Thread Edward Tomasz Napierala
Author: trasz
Date: Sat Nov  7 13:09:51 2020
New Revision: 367445
URL: https://svnweb.freebsd.org/changeset/base/367445

Log:
  Move TDB_USERWR check under 'if (traced)'.
  
  If we hadn't been traced in the first place when syscallenter()
  started executing, we can ignore TDB_USERWR.  TDB_USERWR can get set,
  sure, but if it does, it's because the debugger raced with the syscall,
  and it cannot depend on winning that race.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: EPSRC
  Differential Revision:https://reviews.freebsd.org/D26585

Modified:
  head/sys/kern/subr_syscall.c

Modified: head/sys/kern/subr_syscall.c
==
--- head/sys/kern/subr_syscall.cSat Nov  7 05:10:46 2020
(r367444)
+++ head/sys/kern/subr_syscall.cSat Nov  7 13:09:51 2020
(r367445)
@@ -97,21 +97,22 @@ syscallenter(struct thread *td)
if (p->p_ptevents & PTRACE_SCE)
ptracestop((td), SIGTRAP, NULL);
PROC_UNLOCK(p);
-   }
-   if (__predict_false((td->td_dbgflags & TDB_USERWR) != 0)) {
-   /*
-* Reread syscall number and arguments if debugger
-* modified registers or memory.
-*/
-   error = (p->p_sysent->sv_fetch_syscall_args)(td);
-   se = sa->callp;
+
+   if ((td->td_dbgflags & TDB_USERWR) != 0) {
+   /*
+* Reread syscall number and arguments if debugger
+* modified registers or memory.
+*/
+   error = (p->p_sysent->sv_fetch_syscall_args)(td);
+   se = sa->callp;
 #ifdef KTRACE
-   if (KTRPOINT(td, KTR_SYSCALL))
-   ktrsyscall(sa->code, se->sy_narg, sa->args);
+   if (KTRPOINT(td, KTR_SYSCALL))
+   ktrsyscall(sa->code, se->sy_narg, sa->args);
 #endif
-   if (error != 0) {
-   td->td_errno = error;
-   goto retval;
+   if (error != 0) {
+   td->td_errno = error;
+   goto retval;
+   }
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"