Re: svn commit: r358923 - in head: lib/libpmcstat usr.sbin/pmcstat

2020-03-12 Thread Ryan Moeller


> It's unclear from the context- is there any particular reason this
> can't instead using sysctl kern.module_path and accept a semicolon
> delimited list of directories for -k (maybe calling it -k kernelpath
> instead)?

No, that looks technically possible.

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


Re: svn commit: r358923 - in head: lib/libpmcstat usr.sbin/pmcstat

2020-03-12 Thread Warner Losh
On Thu, Mar 12, 2020, 6:35 PM Kyle Evans  wrote:

> On Thu, Mar 12, 2020 at 6:05 PM Ryan Moeller  wrote:
> >
> > Author: freqlabs
> > Date: Thu Mar 12 23:04:40 2020
> > New Revision: 358923
> > URL: https://svnweb.freebsd.org/changeset/base/358923
> >
> > Log:
> >   libpmcstat: Try /boot/modules if module not found
> >
> >   Modules from ports/pkg are commonly installed to /boot/modules rather
> than to
> >   the same directory the kernel resides in.  Look there if a module is
> not found
> >   next to the kernel.
> >
> >   Submitted by: mmacy
> >   Reported by:  Nick Principe 
> >   Approved by:  mmacy (mentor)
> >   MFC after:2 weeks
> >   Sponsored by: iXsystems, Inc.
> >
>
> It's unclear from the context- is there any particular reason this
> can't instead using sysctl kern.module_path and accept a semicolon
> delimited list of directories for -k (maybe calling it -k kernelpath
> instead)?
>

There are also #defines for these paths.

Warner

Thanks,
>
> Kyle Evans
>
___
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: r358928 - in head/sys/powerpc: booke powerpc

2020-03-12 Thread Justin Hibbits
Author: jhibbits
Date: Fri Mar 13 01:27:37 2020
New Revision: 358928
URL: https://svnweb.freebsd.org/changeset/base/358928

Log:
  powerpc: Simplify _nodrop variants of FPU and vector register saves
  
  No need for an extra temporary.  It doesn't even help with readability.
  
  Suggested by: kib (almost 2 years ago)

Modified:
  head/sys/powerpc/booke/spe.c
  head/sys/powerpc/powerpc/altivec.c
  head/sys/powerpc/powerpc/fpu.c

Modified: head/sys/powerpc/booke/spe.c
==
--- head/sys/powerpc/booke/spe.cFri Mar 13 01:06:08 2020
(r358927)
+++ head/sys/powerpc/booke/spe.cFri Mar 13 01:27:37 2020
(r358928)
@@ -183,14 +183,11 @@ save_vec(struct thread *td)
 void
 save_vec_nodrop(struct thread *td)
 {
-   struct thread *vtd;
struct pcb *pcb;
int i;
 
-   vtd = PCPU_GET(vecthread);
-   if (td == vtd) {
+   if (td == PCPU_GET(vecthread))
save_vec_int(td);
-   }
 
pcb = td->td_pcb;
 

Modified: head/sys/powerpc/powerpc/altivec.c
==
--- head/sys/powerpc/powerpc/altivec.c  Fri Mar 13 01:06:08 2020
(r358927)
+++ head/sys/powerpc/powerpc/altivec.c  Fri Mar 13 01:27:37 2020
(r358928)
@@ -168,12 +168,7 @@ save_vec(struct thread *td)
 void
 save_vec_nodrop(struct thread *td)
 {
-   struct thread *vtd;
 
-   vtd = PCPU_GET(vecthread);
-   if (td != vtd) {
-   return;
-   }
-
-   save_vec_int(td);
+   if (td == PCPU_GET(vecthread))
+   save_vec_int(td);
 }

Modified: head/sys/powerpc/powerpc/fpu.c
==
--- head/sys/powerpc/powerpc/fpu.c  Fri Mar 13 01:06:08 2020
(r358927)
+++ head/sys/powerpc/powerpc/fpu.c  Fri Mar 13 01:27:37 2020
(r358928)
@@ -204,12 +204,7 @@ save_fpu(struct thread *td)
 void
 save_fpu_nodrop(struct thread *td)
 {
-   struct thread *ftd;
 
-   ftd = PCPU_GET(fputhread);
-   if (td != ftd) {
-   return;
-   }
-
-   save_fpu_int(td);
+   if (td == PCPU_GET(fputhread))
+   save_fpu_int(td);
 }
___
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: r358927 - in stable/10/contrib/libarchive: cpio cpio/test libarchive libarchive/test

2020-03-12 Thread Martin Matuska
Author: mm
Date: Fri Mar 13 01:06:08 2020
New Revision: 358927
URL: https://svnweb.freebsd.org/changeset/base/358927

Log:
  MFC r358533:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
PR #1331: cpio.5: fix hard link description
Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
Issue #1338: XAR reader: fix UBSan warning about undefined behavior
Issue #1339: bsdcpio_test: fix datatype in from_hex()
Issue #1341: Safe writes: delete temporary file if rename fails.
Issue #1341: Safe writes: improve error handling

Added:
  
stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
 - copied unchanged from r358533, 
head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
Modified:
  stable/10/contrib/libarchive/cpio/cpio.c
  stable/10/contrib/libarchive/cpio/cpio.h
  stable/10/contrib/libarchive/cpio/test/test_format_newc.c
  stable/10/contrib/libarchive/libarchive/archive_read.c
  stable/10/contrib/libarchive/libarchive/archive_read_open_filename.c
  stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c
  stable/10/contrib/libarchive/libarchive/archive_util.c
  stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c
  stable/10/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  stable/10/contrib/libarchive/libarchive/cpio.5
  stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c

Modified: stable/10/contrib/libarchive/cpio/cpio.c
==
--- stable/10/contrib/libarchive/cpio/cpio.cFri Mar 13 01:05:55 2020
(r358926)
+++ stable/10/contrib/libarchive/cpio/cpio.cFri Mar 13 01:06:08 2020
(r358927)
@@ -737,7 +737,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath
 */
destpath = srcpath;
if (cpio->destdir) {
-   len = strlen(cpio->destdir) + strlen(srcpath) + 8;
+   len = cpio->destdir_len + strlen(srcpath) + 8;
if (len >= cpio->pass_destpath_alloc) {
while (len >= cpio->pass_destpath_alloc) {
cpio->pass_destpath_alloc += 512;
@@ -1226,15 +1226,14 @@ mode_pass(struct cpio *cpio, const char *destdir)
struct lafe_line_reader *lr;
const char *p;
int r;
-   size_t destdir_len;
 
/* Ensure target dir has a trailing '/' to simplify path surgery. */
-   destdir_len = strlen(destdir);
-   cpio->destdir = malloc(destdir_len + 8);
-   memcpy(cpio->destdir, destdir, destdir_len);
-   if (destdir_len == 0 || destdir[destdir_len - 1] != '/')
-   cpio->destdir[destdir_len++] = '/';
-   cpio->destdir[destdir_len++] = '\0';
+   cpio->destdir_len = strlen(destdir);
+   cpio->destdir = malloc(cpio->destdir_len + 8);
+   memcpy(cpio->destdir, destdir, cpio->destdir_len);
+   if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/')
+   cpio->destdir[cpio->destdir_len++] = '/';
+   cpio->destdir[cpio->destdir_len] = '\0';
 
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)

Modified: stable/10/contrib/libarchive/cpio/cpio.h
==
--- stable/10/contrib/libarchive/cpio/cpio.hFri Mar 13 01:05:55 2020
(r358926)
+++ stable/10/contrib/libarchive/cpio/cpio.hFri Mar 13 01:06:08 2020
(r358927)
@@ -64,6 +64,7 @@ struct cpio {
int   option_numeric_uid_gid; /* -n */
int   option_rename; /* -r */
char *destdir;
+   size_tdestdir_len;
size_tpass_destpath_alloc;
char *pass_destpath;
int   uid_override;

Modified: stable/10/contrib/libarchive/cpio/test/test_format_newc.c
==
--- stable/10/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
01:05:55 2020(r358926)
+++ stable/10/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
01:06:08 2020(r358927)
@@ -49,10 +49,11 @@ is_hex(const char *p, size_t l)
return (1);
 }
 
-static int
+/* Convert up to 8 hex characters to unsigned 32-bit decimal integer */
+static uint32_t
 from_hex(const char *p, size_t l)
 {
-   int r = 0;
+   uint32_t r = 0;
 
while (l > 0) {
r *= 16;
@@ -82,11 +83,11 @@ DEFINE_TEST(test_format_newc)
 {
FILE *list;
int r;
-   int devmajor, devminor, ino, gid;
-   int uid = -1;
+   uint32_t devmajor, devminor, ino, gid, uid;
time_t t, t2, now;
char *p, *e;
-   size_t s, fs, ns;
+   size_t s;
+   uint64_t fs, ns;
char result[1024];
 

svn commit: r358926 - in stable/11/contrib/libarchive: cpio cpio/test libarchive libarchive/test

2020-03-12 Thread Martin Matuska
Author: mm
Date: Fri Mar 13 01:05:55 2020
New Revision: 358926
URL: https://svnweb.freebsd.org/changeset/base/358926

Log:
  MFC r358533:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
PR #1331: cpio.5: fix hard link description
Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
Issue #1338: XAR reader: fix UBSan warning about undefined behavior
Issue #1339: bsdcpio_test: fix datatype in from_hex()
Issue #1341: Safe writes: delete temporary file if rename fails.
Issue #1341: Safe writes: improve error handling

Added:
  
stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
 - copied unchanged from r358533, 
head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
Modified:
  stable/11/contrib/libarchive/cpio/cpio.c
  stable/11/contrib/libarchive/cpio/cpio.h
  stable/11/contrib/libarchive/cpio/test/test_format_newc.c
  stable/11/contrib/libarchive/libarchive/archive_read.c
  stable/11/contrib/libarchive/libarchive/archive_read_open_filename.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c
  stable/11/contrib/libarchive/libarchive/archive_util.c
  stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  stable/11/contrib/libarchive/libarchive/cpio.5
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip.c

Modified: stable/11/contrib/libarchive/cpio/cpio.c
==
--- stable/11/contrib/libarchive/cpio/cpio.cFri Mar 13 01:05:40 2020
(r358925)
+++ stable/11/contrib/libarchive/cpio/cpio.cFri Mar 13 01:05:55 2020
(r358926)
@@ -737,7 +737,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath
 */
destpath = srcpath;
if (cpio->destdir) {
-   len = strlen(cpio->destdir) + strlen(srcpath) + 8;
+   len = cpio->destdir_len + strlen(srcpath) + 8;
if (len >= cpio->pass_destpath_alloc) {
while (len >= cpio->pass_destpath_alloc) {
cpio->pass_destpath_alloc += 512;
@@ -1228,15 +1228,14 @@ mode_pass(struct cpio *cpio, const char *destdir)
struct lafe_line_reader *lr;
const char *p;
int r;
-   size_t destdir_len;
 
/* Ensure target dir has a trailing '/' to simplify path surgery. */
-   destdir_len = strlen(destdir);
-   cpio->destdir = malloc(destdir_len + 8);
-   memcpy(cpio->destdir, destdir, destdir_len);
-   if (destdir_len == 0 || destdir[destdir_len - 1] != '/')
-   cpio->destdir[destdir_len++] = '/';
-   cpio->destdir[destdir_len++] = '\0';
+   cpio->destdir_len = strlen(destdir);
+   cpio->destdir = malloc(cpio->destdir_len + 8);
+   memcpy(cpio->destdir, destdir, cpio->destdir_len);
+   if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/')
+   cpio->destdir[cpio->destdir_len++] = '/';
+   cpio->destdir[cpio->destdir_len] = '\0';
 
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)

Modified: stable/11/contrib/libarchive/cpio/cpio.h
==
--- stable/11/contrib/libarchive/cpio/cpio.hFri Mar 13 01:05:40 2020
(r358925)
+++ stable/11/contrib/libarchive/cpio/cpio.hFri Mar 13 01:05:55 2020
(r358926)
@@ -64,6 +64,7 @@ struct cpio {
int   option_numeric_uid_gid; /* -n */
int   option_rename; /* -r */
char *destdir;
+   size_tdestdir_len;
size_tpass_destpath_alloc;
char *pass_destpath;
int   uid_override;

Modified: stable/11/contrib/libarchive/cpio/test/test_format_newc.c
==
--- stable/11/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
01:05:40 2020(r358925)
+++ stable/11/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
01:05:55 2020(r358926)
@@ -49,10 +49,11 @@ is_hex(const char *p, size_t l)
return (1);
 }
 
-static int
+/* Convert up to 8 hex characters to unsigned 32-bit decimal integer */
+static uint32_t
 from_hex(const char *p, size_t l)
 {
-   int r = 0;
+   uint32_t r = 0;
 
while (l > 0) {
r *= 16;
@@ -82,11 +83,11 @@ DEFINE_TEST(test_format_newc)
 {
FILE *list;
int r;
-   int devmajor, devminor, ino, gid;
-   int uid = -1;
+   uint32_t devmajor, devminor, ino, gid, uid;
time_t t, t2, now;
char *p, *e;
-   size_t s, fs, ns;
+   size_t s;
+   uint64_t fs, ns;
char result[1024];
 

svn commit: r358925 - in stable/12/contrib/libarchive: cpio cpio/test libarchive libarchive/test

2020-03-12 Thread Martin Matuska
Author: mm
Date: Fri Mar 13 01:05:40 2020
New Revision: 358925
URL: https://svnweb.freebsd.org/changeset/base/358925

Log:
  MFC r358533:
  Sync libarchive with vendor.
  
  Relevant vendor changes:
Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
PR #1331: cpio.5: fix hard link description
Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
Issue #1338: XAR reader: fix UBSan warning about undefined behavior
Issue #1339: bsdcpio_test: fix datatype in from_hex()
Issue #1341: Safe writes: delete temporary file if rename fails.
Issue #1341: Safe writes: improve error handling

Added:
  
stable/12/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
 - copied unchanged from r358533, 
head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
Modified:
  stable/12/contrib/libarchive/cpio/cpio.c
  stable/12/contrib/libarchive/cpio/cpio.h
  stable/12/contrib/libarchive/cpio/test/test_format_newc.c
  stable/12/contrib/libarchive/libarchive/archive_read.c
  stable/12/contrib/libarchive/libarchive/archive_read_open_filename.c
  stable/12/contrib/libarchive/libarchive/archive_read_support_format_xar.c
  stable/12/contrib/libarchive/libarchive/archive_util.c
  stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c
  stable/12/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  stable/12/contrib/libarchive/libarchive/cpio.5
  stable/12/contrib/libarchive/libarchive/test/test_read_format_zip.c

Modified: stable/12/contrib/libarchive/cpio/cpio.c
==
--- stable/12/contrib/libarchive/cpio/cpio.cFri Mar 13 00:12:15 2020
(r358924)
+++ stable/12/contrib/libarchive/cpio/cpio.cFri Mar 13 01:05:40 2020
(r358925)
@@ -737,7 +737,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath
 */
destpath = srcpath;
if (cpio->destdir) {
-   len = strlen(cpio->destdir) + strlen(srcpath) + 8;
+   len = cpio->destdir_len + strlen(srcpath) + 8;
if (len >= cpio->pass_destpath_alloc) {
while (len >= cpio->pass_destpath_alloc) {
cpio->pass_destpath_alloc += 512;
@@ -1228,15 +1228,14 @@ mode_pass(struct cpio *cpio, const char *destdir)
struct lafe_line_reader *lr;
const char *p;
int r;
-   size_t destdir_len;
 
/* Ensure target dir has a trailing '/' to simplify path surgery. */
-   destdir_len = strlen(destdir);
-   cpio->destdir = malloc(destdir_len + 8);
-   memcpy(cpio->destdir, destdir, destdir_len);
-   if (destdir_len == 0 || destdir[destdir_len - 1] != '/')
-   cpio->destdir[destdir_len++] = '/';
-   cpio->destdir[destdir_len++] = '\0';
+   cpio->destdir_len = strlen(destdir);
+   cpio->destdir = malloc(cpio->destdir_len + 8);
+   memcpy(cpio->destdir, destdir, cpio->destdir_len);
+   if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/')
+   cpio->destdir[cpio->destdir_len++] = '/';
+   cpio->destdir[cpio->destdir_len] = '\0';
 
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)

Modified: stable/12/contrib/libarchive/cpio/cpio.h
==
--- stable/12/contrib/libarchive/cpio/cpio.hFri Mar 13 00:12:15 2020
(r358924)
+++ stable/12/contrib/libarchive/cpio/cpio.hFri Mar 13 01:05:40 2020
(r358925)
@@ -64,6 +64,7 @@ struct cpio {
int   option_numeric_uid_gid; /* -n */
int   option_rename; /* -r */
char *destdir;
+   size_tdestdir_len;
size_tpass_destpath_alloc;
char *pass_destpath;
int   uid_override;

Modified: stable/12/contrib/libarchive/cpio/test/test_format_newc.c
==
--- stable/12/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
00:12:15 2020(r358924)
+++ stable/12/contrib/libarchive/cpio/test/test_format_newc.c   Fri Mar 13 
01:05:40 2020(r358925)
@@ -49,10 +49,11 @@ is_hex(const char *p, size_t l)
return (1);
 }
 
-static int
+/* Convert up to 8 hex characters to unsigned 32-bit decimal integer */
+static uint32_t
 from_hex(const char *p, size_t l)
 {
-   int r = 0;
+   uint32_t r = 0;
 
while (l > 0) {
r *= 16;
@@ -82,11 +83,11 @@ DEFINE_TEST(test_format_newc)
 {
FILE *list;
int r;
-   int devmajor, devminor, ino, gid;
-   int uid = -1;
+   uint32_t devmajor, devminor, ino, gid, uid;
time_t t, t2, now;
char *p, *e;
-   size_t s, fs, ns;
+   size_t s;
+   uint64_t fs, ns;
char result[1024];
 

Re: svn commit: r358923 - in head: lib/libpmcstat usr.sbin/pmcstat

2020-03-12 Thread Kyle Evans
On Thu, Mar 12, 2020 at 6:05 PM Ryan Moeller  wrote:
>
> Author: freqlabs
> Date: Thu Mar 12 23:04:40 2020
> New Revision: 358923
> URL: https://svnweb.freebsd.org/changeset/base/358923
>
> Log:
>   libpmcstat: Try /boot/modules if module not found
>
>   Modules from ports/pkg are commonly installed to /boot/modules rather than 
> to
>   the same directory the kernel resides in.  Look there if a module is not 
> found
>   next to the kernel.
>
>   Submitted by: mmacy
>   Reported by:  Nick Principe 
>   Approved by:  mmacy (mentor)
>   MFC after:2 weeks
>   Sponsored by: iXsystems, Inc.
>

It's unclear from the context- is there any particular reason this
can't instead using sysctl kern.module_path and accept a semicolon
delimited list of directories for -k (maybe calling it -k kernelpath
instead)?

Thanks,

Kyle Evans
___
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: r358924 - head/sys/dev/cxgbe

2020-03-12 Thread Navdeep Parhar
Author: np
Date: Fri Mar 13 00:12:15 2020
New Revision: 358924
URL: https://svnweb.freebsd.org/changeset/base/358924

Log:
  cxgbe(4): Do not display error messages related to the CLIP table if
  it's not in use by TOE or KTLS.
  
  Reviewed by:  jhb@
  MFC after:1 week
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D24046

Modified:
  head/sys/dev/cxgbe/t4_clip.c

Modified: head/sys/dev/cxgbe/t4_clip.c
==
--- head/sys/dev/cxgbe/t4_clip.cThu Mar 12 23:04:40 2020
(r358923)
+++ head/sys/dev/cxgbe/t4_clip.cFri Mar 13 00:12:15 2020
(r358924)
@@ -273,8 +273,12 @@ update_clip_table(struct adapter *sc)
 
inet_ntop(AF_INET6, &ce->lip, &ip[0],
sizeof(ip));
-   log(LOG_ERR, "%s: could not add %s (%d)\n",
-   __func__, ip, rc);
+   if (sc->flags & KERN_TLS_OK ||
+   sc->active_ulds != 0) {
+   log(LOG_ERR,
+   "%s: could not add %s (%d)\n",
+   __func__, ip, rc);
+   }
free(ce, M_CXGBE);
}
 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: r358923 - in head: lib/libpmcstat usr.sbin/pmcstat

2020-03-12 Thread Ryan Moeller
Author: freqlabs
Date: Thu Mar 12 23:04:40 2020
New Revision: 358923
URL: https://svnweb.freebsd.org/changeset/base/358923

Log:
  libpmcstat: Try /boot/modules if module not found
  
  Modules from ports/pkg are commonly installed to /boot/modules rather than to
  the same directory the kernel resides in.  Look there if a module is not found
  next to the kernel.
  
  Submitted by: mmacy
  Reported by:  Nick Principe 
  Approved by:  mmacy (mentor)
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/lib/libpmcstat/libpmcstat_image.c
  head/usr.sbin/pmcstat/pmcstat.8

Modified: head/lib/libpmcstat/libpmcstat_image.c
==
--- head/lib/libpmcstat/libpmcstat_image.c  Thu Mar 12 21:26:36 2020
(r358922)
+++ head/lib/libpmcstat/libpmcstat_image.c  Thu Mar 12 23:04:40 2020
(r358923)
@@ -278,6 +278,7 @@ pmcstat_image_get_elf_params(struct pmcstat_image *ima
GElf_Shdr sh;
enum pmcstat_image_type image_type;
char buffer[PATH_MAX];
+   char buffer_modules[PATH_MAX];
 
assert(image->pi_type == PMCSTAT_IMAGE_UNKNOWN);
 
@@ -292,23 +293,32 @@ pmcstat_image_get_elf_params(struct pmcstat_image *ima
assert(path != NULL);
 
/*
-* Look for kernel modules under FSROOT/KERNELPATH/NAME,
-* and user mode executable objects under FSROOT/PATHNAME.
+* Look for kernel modules under FSROOT/KERNELPATH/NAME and
+* FSROOT/boot/modules/NAME, and user mode executable objects
+* under FSROOT/PATHNAME.
 */
-   if (image->pi_iskernelmodule)
+   if (image->pi_iskernelmodule) {
(void) snprintf(buffer, sizeof(buffer), "%s%s/%s",
args->pa_fsroot, args->pa_kernel, path);
-   else
+   (void) snprintf(buffer_modules, sizeof(buffer_modules),
+   "%s/boot/modules/%s", args->pa_fsroot, path);
+   } else {
(void) snprintf(buffer, sizeof(buffer), "%s%s",
args->pa_fsroot, path);
+   }
 
e = NULL;
-   if ((fd = open(buffer, O_RDONLY, 0)) < 0) {
+   fd = open(buffer, O_RDONLY, 0);
+   if (fd < 0 && !image->pi_iskernelmodule) {
warnx("WARNING: Cannot open \"%s\".",
buffer);
goto done;
}
-
+   if (fd < 0 && (fd = open(buffer_modules, O_RDONLY, 0)) < 0) {
+   warnx("WARNING: Cannot open \"%s\" or \"%s\".",
+   buffer, buffer_modules);
+   goto done;
+   }
if (elf_version(EV_CURRENT) == EV_NONE) {
warnx("WARNING: failed to init elf\n");
goto done;

Modified: head/usr.sbin/pmcstat/pmcstat.8
==
--- head/usr.sbin/pmcstat/pmcstat.8 Thu Mar 12 21:26:36 2020
(r358922)
+++ head/usr.sbin/pmcstat/pmcstat.8 Thu Mar 12 23:04:40 2020
(r358923)
@@ -309,6 +309,8 @@ should look for the kernel and its modules.
 The default is to use the path of the running kernel obtained from the
 .Va kern.bootfile
 sysctl.
+Modules will also be searched for in /boot/modules if not found in
+.Ar kerneldir .
 .It Fl l Ar secs
 Set system-wide performance measurement duration for
 .Ar secs
___
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: r358922 - head/sys/kern

2020-03-12 Thread Conrad Meyer
Author: cem
Date: Thu Mar 12 21:26:36 2020
New Revision: 358922
URL: https://svnweb.freebsd.org/changeset/base/358922

Log:
  kern_shutdown: Add missing EKCD ifdef
  
  Submitted by: Puneeth Jothaiah 
  Reviewed by:  bdrewery
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Thu Mar 12 20:59:00 2020
(r358921)
+++ head/sys/kern/kern_shutdown.c   Thu Mar 12 21:26:36 2020
(r358922)
@@ -1231,6 +1231,7 @@ dumper_insert(const struct dumperinfo *di_template, co
 #endif
}
if (kda->kda_compression != KERNELDUMP_COMP_NONE) {
+#ifdef EKCD
/*
 * We can't support simultaneous unpadded block cipher
 * encryption and compression because there is no guarantee the
@@ -1241,6 +1242,7 @@ dumper_insert(const struct dumperinfo *di_template, co
error = EOPNOTSUPP;
goto cleanup;
}
+#endif
newdi->kdcomp = kerneldumpcomp_create(newdi,
kda->kda_compression);
if (newdi->kdcomp == 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: r358921 - stable/12/sys/dev/hwpmc

2020-03-12 Thread Matt Macy
Author: mmacy
Date: Thu Mar 12 20:59:00 2020
New Revision: 358921
URL: https://svnweb.freebsd.org/changeset/base/358921

Log:
  Fix sample check in hwpmc
  
  Don't drop samples with callchain pending
  
  Tested by: mjg@
  
  MFC of r353483

Modified:
  stable/12/sys/dev/hwpmc/hwpmc_mod.c

Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c
==
--- stable/12/sys/dev/hwpmc/hwpmc_mod.c Thu Mar 12 20:51:04 2020
(r358920)
+++ stable/12/sys/dev/hwpmc/hwpmc_mod.c Thu Mar 12 20:59:00 2020
(r358921)
@@ -4828,7 +4828,7 @@ pmc_capture_user_callchain(int cpu, int ring, struct t
nfree++;
 #endif
if (ps->ps_td != td ||
-  ps->ps_nsamples == PMC_USER_CALLCHAIN_PENDING ||
+  ps->ps_nsamples != PMC_USER_CALLCHAIN_PENDING ||
   ps->ps_pmc->pm_state != PMC_STATE_RUNNING)
continue;
 
___
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: r358920 - stable/12/lib/libefivar

2020-03-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Thu Mar 12 20:51:04 2020
New Revision: 358920
URL: https://svnweb.freebsd.org/changeset/base/358920

Log:
  MFC 339729:
  
  efivar(3): Fix some typos and improve style
  
  - Fix some typos.
  - Remove redundant semicolons from the synopsis section.
  - Stylize variable names and types with Vt and Va respectively.
  - Use a list to present non-implemented functions.
  - Sort the order of the sections.
  - Add a history section.
  - Use Nm when "libefivar" is mentioned.
  
  PR:   232626
  Reported by:  Tiwei Bie 
  Reviewed by:  bcr, imp
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D17686
  
  Approved by:  bcr (mentor)
  Differential Revision:https://reviews.freebsd.org/D24044

Modified:
  stable/12/lib/libefivar/efivar.3
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libefivar/efivar.3
==
--- stable/12/lib/libefivar/efivar.3Thu Mar 12 19:55:51 2020
(r358919)
+++ stable/12/lib/libefivar/efivar.3Thu Mar 12 20:51:04 2020
(r358920)
@@ -25,12 +25,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 14, 2016
+.Dd October 25, 2018
 .Dt LIBEFIVAR 3
 .Os
 .Sh NAME
 .Nm libefivar
-.Nd EFI Non Volatile Variable Suppoert
+.Nd EFI Non Volatile Variable Support
 .Sh SYNOPSIS
 .In efivar.h
 .Ft int
@@ -56,15 +56,17 @@
 .Ft int
 .Fn efi_set_variable "efi_guid_t guid" "const char *name" "void *data" "size_t 
data_size" "uint32_t attributes"
 .Ft int
-.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid";
+.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid"
 .Ft int
-.Fn efi_variables_supported "void";
+.Fn efi_variables_supported "void"
 .Sh DESCRIPTION
 The
 .Nm
 library implements access to EFI Variables via the EFI Runtime
-Serivces.
-All char * strings are converted to 16-bit UTF strings before passing
+Services.
+All
+.Vt "char *"
+strings are converted to 16-bit UTF strings before passing
 them to EFI.
 .Pp
 .Fn efi_variables_supported
@@ -74,28 +76,48 @@ Otherwise zero is returned.
 .Pp
 .Fn efi_del_variable
 deletes the EFI variable selected by
-.Dv guid
+.Va guid
 and
-.Dv name .
+.Va name .
 .Pp
+The following functions have not been implemented yet:
+.Bl -dash -offset indent -compact
+.It
+.Fn efi_append_variable
+.It
+.Fn efi_get_next_variable_name
+.It
 .Fn efi_get_variable
+.It
 .Fn efi_get_variable_attributes
+.It
 .Fn efi_get_variable_size
-.Fn efi_append_variable
-.Fn efi_set_variable
-.Fn efi_get_next_variable_name
-.Fn efi_str_to_guid
-.Fn efi_guid_to_str
-.Fn efi_name_to_guid
+.It
 .Fn efi_guid_to_name
+.It
+.Fn efi_guid_to_str
+.It
 .Fn efi_guid_to_symbol
-This function is not actually implemented.
-.Sh BUGS
-No facilities exist to process the strings as native UTF.
-This is a limitation in the Linux libefivar library interface.
+.It
+.Fn efi_name_to_guid
+.It
+.Fn efi_set_variable
+.It
+.Fn efi_str_to_guid
+.El
 .Sh SEE ALSO
 .Xr efidev 4
+.Sh HISTORY
+The
+.Nm
+library first appeared in
+.Fx 12.0 .
 .Sh AUTHORS
 .An -nosplit
 This software was originally written by
 .An Warner Losh .
+.Sh BUGS
+No facilities exist to process the strings as native UTF.
+This is a limitation in the Linux
+.Nm
+library interface.
___
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: r358919 - head/usr.bin/logger

2020-03-12 Thread Mariusz Zaborski
Author: oshogbo
Date: Thu Mar 12 19:55:51 2020
New Revision: 358919
URL: https://svnweb.freebsd.org/changeset/base/358919

Log:
  logger: capsicumize
  
  Submitted by: Tiger Gao 
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23744

Modified:
  head/usr.bin/logger/Makefile
  head/usr.bin/logger/logger.c

Modified: head/usr.bin/logger/Makefile
==
--- head/usr.bin/logger/MakefileThu Mar 12 19:10:53 2020
(r358918)
+++ head/usr.bin/logger/MakefileThu Mar 12 19:55:51 2020
(r358919)
@@ -9,4 +9,10 @@ PROG=  logger
 CFLAGS+= -DINET6
 .endif
 
+.if ${MK_CASPER} != "no"
+LIBADD+=casper
+LIBADD+=cap_syslog
+CFLAGS+=-DWITH_CASPER
+.endif
+
 .include 

Modified: head/usr.bin/logger/logger.c
==
--- head/usr.bin/logger/logger.cThu Mar 12 19:10:53 2020
(r358918)
+++ head/usr.bin/logger/logger.cThu Mar 12 19:55:51 2020
(r358919)
@@ -44,10 +44,12 @@ static char sccsid[] = "@(#)logger.c8.1 (Berkeley) 
6/
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -57,6 +59,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 #defineSYSLOG_NAMES
 #include 
 
@@ -76,6 +81,7 @@ static void   logmessage(int, const char *, const char *
struct socks *, ssize_t, const char *);
 static voidusage(void);
 
+static cap_channel_t *capsyslog;
 #ifdef INET6
 static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
 #else
@@ -92,12 +98,13 @@ static int send_to_all = 0; /* send message to all IPv
 int
 main(int argc, char *argv[])
 {
+   cap_channel_t *capcas;
struct socks *socks;
ssize_t nsock;
time_t now;
int ch, logflags, pri;
char *tag, *host, buf[1024], *timestamp, tbuf[26],
-   *hostname, hbuf[MAXHOSTNAMELEN];
+   *hostname, hbuf[MAXHOSTNAMELEN], *pristr;
const char *svcname, *src;
 
tag = NULL;
@@ -107,6 +114,7 @@ main(int argc, char *argv[])
src = NULL;
socks = NULL;
pri = LOG_USER | LOG_NOTICE;
+   pristr = NULL;
logflags = 0;
unsetenv("TZ");
while ((ch = getopt(argc, argv, "46Af:H:h:iP:p:S:st:")) != -1)
@@ -140,7 +148,7 @@ main(int argc, char *argv[])
svcname = optarg;
break;
case 'p':   /* priority */
-   pri = pencode(optarg);
+   pristr = optarg;
break;
case 's':   /* log to standard error */
logflags |= LOG_PERROR;
@@ -168,12 +176,25 @@ main(int argc, char *argv[])
nsock = 0;
}
 
+   capcas = cap_init();
+   if (capcas == NULL)
+   err(1, "Unable to contact Casper");
+   caph_cache_catpages();
+   caph_cache_tzdata();
+   if (caph_enter() < 0)
+   err(1, "Unable to enter capability mode");
+   capsyslog = cap_service_open(capcas, "system.syslog");
+   if (capsyslog == NULL)
+   err(1, "Unable to open system.syslog service");
+   cap_close(capcas);
+
+   if (pristr != NULL)
+   pri = pencode(pristr);
if (tag == NULL)
tag = getlogin();
/* setup for logging */
if (host == NULL)
-   openlog(tag, logflags, 0);
-   (void) fclose(stdout);
+   cap_openlog(capsyslog, tag, logflags, 0);
 
(void )time(&now);
(void )ctime_r(&now, tbuf);
@@ -349,7 +370,7 @@ logmessage(int pri, const char *timestamp, const char 
int len, i, lsent;
 
if (nsock == 0) {
-   syslog(pri, "%s", buf);
+   cap_syslog(capsyslog, pri, "%s", buf);
return;
}
if ((len = asprintf(&line, "<%d>%s %s %s: %s", pri, timestamp,
___
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: r358918 - stable/12/tests/sys/netpfil/pf

2020-03-12 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Mar 12 19:10:53 2020
New Revision: 358918
URL: https://svnweb.freebsd.org/changeset/base/358918

Log:
  MFC r358852:
  
  Skip sys.netpfil.pf.nat.exhaust on amd64 in CI as it sometimes panics kernel
  
  PR:   244703
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/tests/sys/netpfil/pf/nat.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/nat.sh
==
--- stable/12/tests/sys/netpfil/pf/nat.sh   Thu Mar 12 19:00:28 2020
(r358917)
+++ stable/12/tests/sys/netpfil/pf/nat.sh   Thu Mar 12 19:10:53 2020
(r358918)
@@ -11,6 +11,11 @@ exhaust_head()
 
 exhaust_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "amd64" ]; then
+   atf_skip "https://bugs.freebsd.org/244703";
+   fi
+
pft_init
 
epair_nat=$(vnet_mkepair)
___
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: r358917 - stable/12/contrib/smbfs/mount_smbfs

2020-03-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Thu Mar 12 19:00:28 2020
New Revision: 358917
URL: https://svnweb.freebsd.org/changeset/base/358917

Log:
  MFC r339990:
  
  mount_smbfs(8): Add the STANDARDS and HISTORY sections
  
  - Document that mount_smbfs(8) only supports SMB1 and that SMB2 and SMB3
are not supported at the moment. Suggest users to browse ports for
software compatible with newer versions of the protocol.
  - Copy supported servers list from README.
  - Add a SEE ALSO section and reference the chapter about Samba in the
FreeBSD Handbook.
  - Add a HISTORY section.
  - Style changes:
- Use Dq instead of Em in the EXAMPLES section.
- Mark command modifiers with Cm.
  
  Reviewed by:bcr
  Approved by:bcr (mentor)
  Approved by:krion (mentor, implicit), mat (mentor, implicit)
  Sponsored by:   Bally Wulff Games & Entertainment GmbH
  Differential Revision:  https://reviews.freebsd.org/D17798

Modified:
  stable/12/contrib/smbfs/mount_smbfs/mount_smbfs.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/smbfs/mount_smbfs/mount_smbfs.8
==
--- stable/12/contrib/smbfs/mount_smbfs/mount_smbfs.8   Thu Mar 12 18:28:23 
2020(r358916)
+++ stable/12/contrib/smbfs/mount_smbfs/mount_smbfs.8   Thu Mar 12 19:00:28 
2020(r358917)
@@ -1,6 +1,6 @@
 .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $
 .\" $FreeBSD$
-.Dd September 17, 2011
+.Dd November 1, 2018
 .Dt MOUNT_SMBFS 8
 .Os
 .Sh NAME
@@ -8,12 +8,12 @@
 .Nd "mount a shared resource from an SMB file server"
 .Sh SYNOPSIS
 .Nm
-.Op Fl E Ar cs1 : Ns Ar cs2
+.Op Fl E Ar cs1 Ns Cm \&: Ns Ar cs2
 .Op Fl I Ar host
 .Op Fl L Ar locale
-.Op Fl M Ar crights : Ns Ar srights
+.Op Fl M Ar crights Ns Cm \&: Ns Ar srights
 .Op Fl N
-.Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
+.Op Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns 
Ar sgroup
 .Op Fl R Ar retrycount
 .Op Fl T Ar timeout
 .Op Fl U Ar username
@@ -25,9 +25,9 @@
 .Op Fl n Ar opt
 .Op Fl u Ar uid
 .Sm off
-.No // Ar user No @ Ar server
-.Op Ar :port1 Op Ar :port2
-.No / Ar share
+.Cm \&// Ns Ar user Cm \&@ Ar server
+.Op Cm \&: Ar port1 Op Cm \&: Ar port2
+.Cm \&/ Ar share
 .Sm on
 .Ar node
 .Sh DESCRIPTION
@@ -37,7 +37,7 @@ command mounts a share from a remote server using SMB/
 .Pp
 The options are as follows:
 .Bl -tag -width indent
-.It Fl E Ar cs1 : Ns Ar cs2
+.It Fl E Ar cs1 Ns Cm \&: Ns Ar cs2
 Specifies local
 .Pq Ar cs1
 and server's
@@ -57,7 +57,7 @@ By default,
 tries to use an environment variable
 .Ev LC_*
 to determine it.
-.It Fl M Ar crights : Ns Ar srights
+.It Fl M Ar crights Ns Cm \&: Ns Ar srights
 Assign access rights to the newly created connection.
 .It Fl N
 Do not ask for a password.
@@ -69,7 +69,7 @@ file for additional configuration parameters and a pas
 If no password is found,
 .Nm
 prompts for it.
-.It Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
+.It Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns 
Ar sgroup
 Assign owner/group attributes to the newly created connection.
 .It Fl R Ar retrycount
 How many retries should be done before the SMB requester decides to drop
@@ -111,7 +111,7 @@ server.
 User ID and group ID assigned to files.
 The default are owner and group IDs from
 the directory where the volume is mounted.
-.It No // Ns Ar user Ns @ Ns Ar server Ns Oo Ar :port1 Ns Oo Ar :port2 Oc Oc 
Ns No / Ns Ar share
+.It Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Oo Cm \&: Ns Ar port1 Ns Oo 
Cm \&: Ns Ar port2 Oc Oc Ns Cm \&/ Ns Ar share
 The
 .Nm
 command will use
@@ -145,13 +145,13 @@ for details.
 .El
 .Sh EXAMPLES
 The following example illustrates how to connect to SMB server
-.Em SAMBA
+.Dq SAMBA
 as user
-.Em GUEST ,
+.Dq GUEST ,
 and mount shares
-.Em PUBLIC
+.Dq PUBLIC
 and
-.Em TMP :
+.Dq TMP :
 .Bd -literal -offset indent
 mount_smbfs -I samba.mydomain.com //guest@samba/public /smb/public
 mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp
@@ -159,9 +159,39 @@ mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@sa
 .Pp
 It is also possible to use
 .Xr fstab 5
-for smbfs mounts (the example below doesn't prompt for a password):
+for smbfs mounts (the example below does not prompt for a password):
 .Pp
 .Dl "//guest@samba/public/smb/public smbfs  rw,noauto,-N 0   0"
+.Sh SEE ALSO
+.Bl -dash
+.It
+Chapter dedicated to Samba configuration in the
+.Fx
+Handbook:
+.Lk "https://www.freebsd.org/doc/handbook/network-samba.html";
+.El
+.Sh STANDARDS
+.Nm
+offers support for SMB/CIFS/SMB1.
+It does not support newer versions of the protocol like SMB2 and SMB3.
+SMB2 and SMB3 are supported by software available in the
+.Xr ports 7
+collection.
+.Pp
+The list of supported SMB servers includes:
+.Bl -dash -compact
+.It
+Samba
+.It
+Windows 95/98/ME/2000/NT4.0 (SPs 4, 5, 6)
+.It
+IBM LanManager
+.It
+Net

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

2020-03-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Thu Mar 12 18:28:23 2020
New Revision: 358916
URL: https://svnweb.freebsd.org/changeset/base/358916

Log:
  ftw.3: Follow style(9) in the example
  
  Reported by:  oshogbo
  Approved by:  bcr (mentor)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D24043

Modified:
  head/lib/libc/gen/ftw.3

Modified: head/lib/libc/gen/ftw.3
==
--- head/lib/libc/gen/ftw.3 Thu Mar 12 16:15:03 2020(r358915)
+++ head/lib/libc/gen/ftw.3 Thu Mar 12 18:28:23 2020(r358916)
@@ -20,7 +20,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 5, 2020
+.Dd March 12, 2020
 .Dt FTW 3
 .Os
 .Sh NAME
@@ -209,6 +209,7 @@ nftw_callback(const char *path, const struct stat *sb,
 int
 main(int argc, char **argv)
 {
+
if (argc != 2) {
printf("Usage %s \\n", argv[0]);
return (EX_USAGE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358902 - head/lib/libc/powerpc64/string

2020-03-12 Thread Brandon Bergren
To be clear here, I meant non qword-aligned, as it was the VSX implementation 
that was actually tripping up here. The problem manifested when the source and 
destination didn't match on the least significant nybble.

Apparently it's also somewhat uncommon for programs to ever do anything with 
the return value as well.

On Wed, Mar 11, 2020, at 6:34 PM, Brandon Bergren wrote:
> Author: bdragon
> Date: Wed Mar 11 23:34:44 2020
> New Revision: 358902
> URL: https://svnweb.freebsd.org/changeset/base/358902
> 
> Log:
>   Fix r358688 -- Remember to actually save r3 before processing.
>   
>   Crash was noticed by pkubaj building gcc9.
>   
>   Apparently non dword-aligned char pointers are somewhat rare in the wild.
>   
>   Reported by:pkubaj
>   Sponsored by:   Tag1 Consulting, Inc.
> 
> Modified:
>   head/lib/libc/powerpc64/string/memcpy.S
> 
> Modified: head/lib/libc/powerpc64/string/memcpy.S
> ==
> --- head/lib/libc/powerpc64/string/memcpy.S   Wed Mar 11 22:25:45 2020
> (r358901)
> +++ head/lib/libc/powerpc64/string/memcpy.S   Wed Mar 11 23:34:44 2020
> (r358902)
> @@ -58,8 +58,8 @@ ENTRY(FN_NAME)
>   andi.   %r7, %r4, ALIGN_MASK
>   cmpd%r8, %r7
>   mr  %r7, %r5
> - bne .Lcopy_remaining_fix_index_byte
>   mr  %r8, %r3/* save dst */
> + bne .Lcopy_remaining_fix_index_byte
>  
>   /* align src */
>  .Lalignment_loop:
>

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


Re: svn commit: r358655 - head/sbin/mount_nfs

2020-03-12 Thread Gleb Smirnoff
On Thu, Mar 05, 2020 at 11:15:04PM +0100, Dimitry Andric wrote:
D> > S> > Why don't just declare the buffer as:
D> > S> >
D> > S> >   struct if_msghdr buf;
D> > S> >
D> > S> > and then do:
D> > S> >
D> > S> >   nread = read(s, &buf, sizeof buf);
D> > S> >
D> > S> > ?  You are never reading more than one if_msghdr anyway, and then 
there
D> > S> > is no need to cast anything.
D> > S>
D> > S> My inspiration: route socket can return other messages (man 4 route)
D> > 
D> > Yes, exactly. We don't know what size next datagram is going to be.
D> 
D> Oh, in that case this code seems completely wrong.  How do you know the
D> full datagram will be delivered with one read() call?
D> 
D> If it always is, then there is no need to read more than the size of
D> struct if_msghdr, since you are not using any data beyond it.  So in
D> that case, you can suffice with read(..., sizeof(if_msghdr)).
D> 
D> If the read() call will return partial results, you must repeatedly call
D> it in a loop, until you either reach EOF, or have enough data. In that
D> case, a buffer with the size of if_msghdr is also enough, since you
D> never need to read beyond that.

Sorry for delayed answer. The routing socket is a datagram socket,
it isn't like TCP, it can't deliver partial datagrams. If we don't
supply enough space for datagram that arrived, it won't be delivered.

So the right solution is suppling plenty of space, but parse only
part we are interested in.

-- 
Gleb Smirnoff
___
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: r358914 - stable/12/sys/kern

2020-03-12 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 12 16:09:41 2020
New Revision: 358914
URL: https://svnweb.freebsd.org/changeset/base/358914

Log:
  MFC r358676:
  buffer pager: deref ucred immediately after read.

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

Modified: stable/12/sys/kern/vfs_bio.c
==
--- stable/12/sys/kern/vfs_bio.cThu Mar 12 16:07:41 2020
(r358913)
+++ stable/12/sys/kern/vfs_bio.cThu Mar 12 16:09:41 2020
(r358914)
@@ -5219,6 +5219,10 @@ again:
br_flags, &bp);
if (error != 0)
goto end_pages;
+   if (bp->b_rcred == curthread->td_ucred) {
+   crfree(bp->b_rcred);
+   bp->b_rcred = NOCRED;
+   }
if (LIST_EMPTY(&bp->b_dep)) {
/*
 * Invalidation clears m->valid, but
___
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: r358913 - stable/12/usr.bin/posixshmcontrol

2020-03-12 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 12 16:07:41 2020
New Revision: 358913
URL: https://svnweb.freebsd.org/changeset/base/358913

Log:
  MFC r358826:
  posixshmcontrol: add an undocumented alias 'list' for the 'ls' command.

Modified:
  stable/12/usr.bin/posixshmcontrol/posixshmcontrol.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/posixshmcontrol/posixshmcontrol.c
==
--- stable/12/usr.bin/posixshmcontrol/posixshmcontrol.c Thu Mar 12 16:06:26 
2020(r358912)
+++ stable/12/usr.bin/posixshmcontrol/posixshmcontrol.c Thu Mar 12 16:07:41 
2020(r358913)
@@ -446,6 +446,7 @@ struct opmode {
 static const struct opmode opmodes[] = {
{ .cmd = "create",  .impl = create_shm},
{ .cmd = "rm",  .impl = delete_shm, },
+   { .cmd = "list",.impl = list_shm },
{ .cmd = "ls",  .impl = list_shm },
{ .cmd = "dump",.impl = read_shm, },
{ .cmd = "stat",.impl = stat_shm, },
___
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: r358912 - head/tools/build/mk

2020-03-12 Thread Enji Cooper
Author: ngie
Date: Thu Mar 12 16:06:26 2020
New Revision: 358912
URL: https://svnweb.freebsd.org/changeset/base/358912

Log:
  Remove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no
  
  This removes a lingering file on new installs of CURRENT, originally
  added in r345797.
  
  MFC after:1 week
  MFC with: r345797

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Mar 12 15:37:41 
2020(r358911)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Mar 12 16:06:26 
2020(r358912)
@@ -972,6 +972,7 @@ OLD_FILES+=usr/share/snmp/defs/mibII_tree.def
 OLD_FILES+=usr/share/snmp/defs/netgraph_tree.def
 OLD_FILES+=usr/share/snmp/defs/pf_tree.def
 OLD_FILES+=usr/share/snmp/defs/target_tree.def
+OLD_FILES+=usr/share/snmp/defs/tc.def
 OLD_FILES+=usr/share/snmp/defs/tree.def
 OLD_FILES+=usr/share/snmp/defs/usm_tree.def
 OLD_FILES+=usr/share/snmp/defs/vacm_tree.def
___
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: r358911 - in head/sys/netinet: . tcp_stacks

2020-03-12 Thread Michael Tuexen
Author: tuexen
Date: Thu Mar 12 15:37:41 2020
New Revision: 358911
URL: https://svnweb.freebsd.org/changeset/base/358911

Log:
  Use KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
  these are kernel modules. Also add a KMOD_TCPSTAT_ADD and use that
  instead of TCPSTAT_ADD.
  
  Reviewed by:  jtl@, rrs@
  MFC after:1 week
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D23904

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Mar 12 14:01:17 2020
(r358910)
+++ head/sys/netinet/tcp_input.cThu Mar 12 15:37:41 2020
(r358911)
@@ -266,14 +266,14 @@ VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHD
 #endif /* VIMAGE */
 
 /*
- * Kernel module interface for updating tcpstat.  The argument is an index
+ * Kernel module interface for updating tcpstat.  The first argument is an 
index
  * into tcpstat treated as an array.
  */
 void
-kmod_tcpstat_inc(int statnum)
+kmod_tcpstat_add(int statnum, int val)
 {
 
-   counter_u64_add(VNET(tcpstat)[statnum], 1);
+   counter_u64_add(VNET(tcpstat)[statnum], val);
 }
 
 #ifdef TCP_HHOOK

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Thu Mar 12 14:01:17 2020
(r358910)
+++ head/sys/netinet/tcp_stacks/bbr.c   Thu Mar 12 15:37:41 2020
(r358911)
@@ -1866,7 +1866,7 @@ bbr_progress_timeout_check(struct tcp_bbr *bbr)
bbr_log_progress_event(bbr, bbr->rc_tp, ticks, 
PROGRESS_DROP, __LINE__);
BBR_STAT_INC(bbr_progress_drops);
 #ifdef NETFLIX_STATS
-   TCPSTAT_INC(tcps_progdrops);
+   KMOD_TCPSTAT_INC(tcps_progdrops);
 #endif
return (1);
}
@@ -4067,7 +4067,7 @@ bbr_cong_signal(struct tcpcb *tp, struct tcphdr *th, u
}
break;
case CC_RTO_ERR:
-   TCPSTAT_INC(tcps_sndrexmitbad);
+   KMOD_TCPSTAT_INC(tcps_sndrexmitbad);
/* RTO was unnecessary, so reset everything. */
bbr_reset_lt_bw_sampling(bbr, bbr->r_ctl.rc_rcvtime);
if (bbr->rc_bbr_state != BBR_STATE_PROBE_RTT) {
@@ -4808,7 +4808,7 @@ bbr_timeout_delack(struct tcpcb *tp, struct tcp_bbr *b
bbr_log_to_event(bbr, cts, BBR_TO_FRM_DELACK);
tp->t_flags &= ~TF_DELACK;
tp->t_flags |= TF_ACKNOW;
-   TCPSTAT_INC(tcps_delack);
+   KMOD_TCPSTAT_INC(tcps_delack);
bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_DELACK;
return (0);
 }
@@ -4840,7 +4840,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
 */
bbr_log_to_event(bbr, cts, BBR_TO_FRM_PERSIST);
bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_PERSIT;
-   TCPSTAT_INC(tcps_persisttimeo);
+   KMOD_TCPSTAT_INC(tcps_persisttimeo);
/*
 * Have we exceeded the user specified progress time?
 */
@@ -4857,7 +4857,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
if (tp->t_rxtshift == TCP_MAXRXTSHIFT &&
(ticks - tp->t_rcvtime >= tcp_maxpersistidle ||
ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) {
-   TCPSTAT_INC(tcps_persistdrop);
+   KMOD_TCPSTAT_INC(tcps_persistdrop);
tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT);
goto out;
}
@@ -4873,7 +4873,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
 */
if (tp->t_state > TCPS_CLOSE_WAIT &&
(ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) {
-   TCPSTAT_INC(tcps_persistdrop);
+   KMOD_TCPSTAT_INC(tcps_persistdrop);
tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT);
goto out;
}
@@ -4916,7 +4916,7 @@ bbr_timeout_keepalive(struct tcpcb *tp, struct tcp_bbr
 * Keep-alive timer went off; send something or drop connection if
 * idle for too long.
 */
-   TCPSTAT_INC(tcps_keeptimeo);
+   KMOD_TCPSTAT_INC(tcps_keeptimeo);
if (tp->t_state < TCPS_ESTABLISHED)
goto dropit;
if ((V_tcp_always_keepalive || inp->inp_socket->so_options & 
SO_KEEPALIVE) &&
@@ -4933,7 +4933,7 @@ bbr_timeout_keepalive(struct tcpcb *tp, struct tcp_bbr
 * protocol spec, this requires the correspondent TCP to
 * respond.
 */
-   TCPSTAT_INC(tcps_keepprobe);
+   KMOD_TCPSTAT_INC(tcps_keepprobe);
t_template = tcpip_maketemplate(inp);
if (t_template) {
 

svn commit: r358910 - head

2020-03-12 Thread Ed Maste
Author: emaste
Date: Thu Mar 12 14:01:17 2020
New Revision: 358910
URL: https://svnweb.freebsd.org/changeset/base/358910

Log:
  Makefile.inc1: move dependency hack comment to the block it applies to

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Mar 12 13:42:08 2020(r358909)
+++ head/Makefile.inc1  Thu Mar 12 14:01:17 2020(r358910)
@@ -922,7 +922,6 @@ _sanity_check: .PHONY .MAKE
 # tree changes, particularly with respect to removing source files and
 # replacing generated files.  Handle these cases here in an ad-hoc fashion.
 _cleanobj_fast_depend_hack: .PHONY
-# Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls/Changes
 # 20200310  r358851  rename of openmp's ittnotify_static.c to .cpp
 .for f in ittnotify_static
@@ -934,6 +933,7 @@ _cleanobj_fast_depend_hack: .PHONY
   ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libomp/.depend.${f}.*}; 
\
fi
 .endfor
+# Syscall stubs rewritten in C and obsolete MD assembly implementations
 # 20191009  r353340  removal of opensolaris_atomic.S (also r353381)
 .if ${MACHINE} != i386
 .for f in opensolaris_atomic
___
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: r358909 - head

2020-03-12 Thread Ed Maste
Author: emaste
Date: Thu Mar 12 13:42:08 2020
New Revision: 358909
URL: https://svnweb.freebsd.org/changeset/base/358909

Log:
  Extend r358907 to explicitly remove stale lib32 dependency
  
  After r325072 stale lib32 dependencies were not remooved.  A more
  holistic approach is needed to address this but for the immediate issue
  (-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.
  
  Reported by:  dim
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Mar 12 12:47:10 2020(r358908)
+++ head/Makefile.inc1  Thu Mar 12 13:42:08 2020(r358909)
@@ -930,6 +930,7 @@ _cleanobj_fast_depend_hack: .PHONY
egrep -qw '${f}\.c' ${OBJTOP}/lib/libomp/.depend.${f}.pico; then \
echo "Removing stale dependencies for ${f}"; \
rm -f ${OBJTOP}/lib/libomp/.depend.${f}.* \
+  ${OBJTOP}/obj-lib32/lib/libomp/.depend.${f}.* \
   ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libomp/.depend.${f}.*}; 
\
fi
 .endfor
___
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: r358908 - in head/sys: conf modules powerpc/conf

2020-03-12 Thread Leandro Lupori
Author: luporl
Date: Thu Mar 12 12:47:10 2020
New Revision: 358908
URL: https://svnweb.freebsd.org/changeset/base/358908

Log:
  Enable ixl device on PowerPC64
  
  The ixl driver now works on PowerPC64 and may be compiled in-kernel and
  as a module.
  
  Reviewed by:  alfredo, erj
  Sponsored by: Eldorado Research Institute (eldorado.org.br)
  Differential Revision:https://reviews.freebsd.org/D23974

Modified:
  head/sys/conf/files.powerpc
  head/sys/conf/options.powerpc
  head/sys/modules/Makefile
  head/sys/powerpc/conf/GENERIC64

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Thu Mar 12 11:39:04 2020(r358907)
+++ head/sys/conf/files.powerpc Thu Mar 12 12:47:10 2020(r358908)
@@ -38,6 +38,43 @@ dev/iicbus/max6690.c optionalmax6690 powermac
 dev/iicbus/ofw_iicbus.coptionaliicbus aim
 dev/ipmi/ipmi.coptionalipmi
 dev/ipmi/ipmi_opal.c   optionalpowernv ipmi
+dev/ixl/if_ixl.c   optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_main.c  optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_qmgr.c  optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_iov.c   optionalixl pci pci_iov powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_i2c.c   optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/if_iavf.c  optionaliavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/iavf_vc.c  optionaliavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_txrx.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_osdep.c   optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_lan_hmc.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_hmc.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_common.c  optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_nvm.c optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_adminq.c  optionalixl pci powerpc64 | \
+   iavf pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_dcb.c optionalixl pci powerpc64 \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
 # Most ofw stuff below is brought in by conf/files for options FDT, but
 # we always want it, even on non-FDT platforms.
 dev/fdt/simplebus.cstandard

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Thu Mar 12 11:39:04 2020
(r358907)
+++ head/sys/conf/options.powerpc   Thu Mar 12 12:47:10 2020
(r358908)
@@ -37,3 +37,5 @@ OFWCONS_POLL_HZ   opt_ofw.h
 # AGP debugging support
 AGP_DEBUG  opt_agp.h
 
+# iWARP client interface support in ixl
+IXL_IW opt_ixl.h

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Mar 12 11:39:04 2020(r358907)
+++ head/sys/modules/Makefile   Thu Mar 12 12:47:10 2020(r358908)
@@ -766,6 +766,7 @@ _virtio=virtio
 
 .if ${MACHINE_ARCH} == "powerpc64"
 _ipmi= ipmi
+_ixl=  ixl
 _nvram=opal_nvram
 .endif
 .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"

Modified: head/sys/powerpc/conf/GENERIC64
==
--- head/sys/powerpc/conf/GENERIC64 Thu Mar 12 11:39:04 2020
(r358907)
+++ head/sys/powerpc/conf/GENERIC64 Thu Mar 12 12:47:10 2020
(r358908)
@@ -168,6 +168,7 @@ device  iflib
 # Ethernet hardware
 device em  # Intel PRO/1000 Gigabit Ethernet Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet Family
+device ixl   

svn commit: r358907 - head

2020-03-12 Thread Dimitry Andric
Author: dim
Date: Thu Mar 12 11:39:04 2020
New Revision: 358907
URL: https://svnweb.freebsd.org/changeset/base/358907

Log:
  Allow -DNO_CLEAN build across r358851.
  
  The openmp 10.0.0 import renamed one .c file to .cpp, and this is
  something our dependency system does not handle correctly.  Add another
  ad-hoc cleanup to get rid of the stale dependency.
  
  PR:   244251
  MFC after:6 weeks
  X-MFC-With:   358851

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Mar 12 06:45:08 2020(r358906)
+++ head/Makefile.inc1  Thu Mar 12 11:39:04 2020(r358907)
@@ -924,6 +924,15 @@ _sanity_check: .PHONY .MAKE
 _cleanobj_fast_depend_hack: .PHONY
 # Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls/Changes
+# 20200310  r358851  rename of openmp's ittnotify_static.c to .cpp
+.for f in ittnotify_static
+   @if [ -e "${OBJTOP}/lib/libomp/.depend.${f}.pico" ] && \
+   egrep -qw '${f}\.c' ${OBJTOP}/lib/libomp/.depend.${f}.pico; then \
+   echo "Removing stale dependencies for ${f}"; \
+   rm -f ${OBJTOP}/lib/libomp/.depend.${f}.* \
+  ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libomp/.depend.${f}.*}; 
\
+   fi
+.endfor
 # 20191009  r353340  removal of opensolaris_atomic.S (also r353381)
 .if ${MACHINE} != i386
 .for f in opensolaris_atomic
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358733 - head/sys/sys

2020-03-12 Thread Andriy Gapon
On 12/03/2020 09:48, Alan Cox wrote:
> Just to be clear, this is not just a matter of whether our release fences are
> poorly or inefficiently implemented.  Release fences (as defined by the C/C++
> standards that inspire our atomics) have *different* semantics than release
> stores. Specifically, a release fence places more ordering restrictions on the
> nearby store accesses than a release store does.  (In fact, "man 9 atomic"
> describes this.)  Thus, it is almost inevitable that a release fence will 
> have a
> higher cost than the best possible implementation of a release store.

For people like me who are new to these things here is a good explanation
(perhaps a bad title, though):
https://preshing.com/20131125/acquire-and-release-fences-dont-work-the-way-youd-expect/

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


Re: svn commit: r358733 - head/sys/sys

2020-03-12 Thread Alan Cox


On 3/11/20 9:16 PM, Mateusz Guzik wrote:

On 3/10/20, Konstantin Belousov  wrote:

On Tue, Mar 10, 2020 at 12:22:09AM +0100, Mateusz Guzik wrote:

On 3/9/20, Konstantin Belousov  wrote:

On Mon, Mar 09, 2020 at 01:56:17AM +0100, Mateusz Guzik wrote:

On 3/8/20, Mateusz Guzik  wrote:

Author: mjg
Date: Sun Mar  8 00:22:32 2020
New Revision: 358733
URL: https://svnweb.freebsd.org/changeset/base/358733

Log:
   seqc: tidy up

   - avoid hand-rolled read
   - match begin/end in terms of fence style


There were off lists questions about this so let me clarify.

The first bit is a cosmetic change, but the second one is not.


Modified:
   head/sys/sys/seqc.h

Modified: head/sys/sys/seqc.h
==
--- head/sys/sys/seqc.h Sat Mar  7 15:37:23 2020(r358732)
+++ head/sys/sys/seqc.h Sun Mar  8 00:22:32 2020(r358733)
@@ -66,7 +66,8 @@ static __inline void
  seqc_write_end(seqc_t *seqcp)
  {

-   atomic_store_rel_int(seqcp, *seqcp + 1);
+   atomic_thread_fence_rel();
+   *seqcp += 1;
MPASS(!seqc_in_modify(*seqcp));
critical_exit();
  }

For correct operation the counter has to be modified *before* any work
is done and *after* it is completed.

Consider a trivial case:
seqc++;
foo[0] = 0;
foo[1] = 1;
seqc++;

There are 2 ways in which this can be mucked with:
- the compiler can be looking at reordering or reworking the increment
(e.g., to collapse it to just += 2 instead). a compiler barrier
prevents that.
- even with generated machine code which increments in correct places
the cpu can be looking at reordering the operation (which is heavily
dependent on architecture), in particular it could end up issuing
seqc++; foo[1] = 1; which would defeat the point. This is where
release fences come in.

With the patched code there is:
seqc++;
atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo
starts getting modified */
foo[0] = 0;
foo[1] = 1;
atomic_thread_fence_rel(); /* make sure modifications to foo don't
leak past this spot */
seqc++;

In comparison, the previous code was:
seqc++;
atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo
starts getting modified */
foo[0] = 0;
foo[1] = 1;
atomic_store_rel_int(seqcp, *seqcp + 1); /* make sure modifications to
too don't leak past this spot and update seqc immediately */

There are 2 differences here -- one is an improvement and second one
does not matter:
the win is: the previous code forces the compiler to compute an
incremented value and then store it. On amd64 this translates to the
following (with rdx holding the address of the counter):

mov(%rdx),%eax /* load the value */
add$0x1,%eax/* add 1 */
mov%eax,(%rdx) /* store it */

On patched kernel this is:
addl   $0x1,(%rdx)

which is clearly much nicer.

I am not sure that the new code on amd64 is much nicer.

But the point was that on non-amd64, i.e. armv8 and potentially on
powerpc 3.0, the patch substitutes release store with full barrier. The
later is (much) slower.


If an arch performs something significantly more expensive here it's
probably a performance bug in the port.

It is a question of how much hardware support for fine-grained fences.
Relaxed architectures add some optimized operations already, but did not
(yet) implemented complete C11 optimized set.
I think they eventually converge.

Until they did not, I think it is more important to not pessimize
to-be Tier1 arches than to collapse three fast integer instructions
on amd64 into one rw op.


But perhaps more importantly
there are significantly more frequent users of
atomic_thread_fence_rel, like refcount(9). If the issue is real that
should be looked at.

For refcount(9) use of release fence removal, we would need
atomic_fetchadd_rel_int().


To reiterate, if atomic_thread_fence_rel is indeed very expensive on
certain architectures compared to other _rel variants, the kernel is
already heavily pessimized because of use of said standalone fence in
refcount(9) and few other places and this needs to be fixed.



Just to be clear, this is not just a matter of whether our release 
fences are poorly or inefficiently implemented.  Release fences (as 
defined by the C/C++ standards that inspire our atomics) have 
*different* semantics than release stores. Specifically, a release fence 
places more ordering restrictions on the nearby store accesses than a 
release store does.  (In fact, "man 9 atomic" describes this.)  Thus, it 
is almost inevitable that a release fence will have a higher cost than 
the best possible implementation of a release store.




If the cost can't be reduced (e.g., perhaps this can do a no-op store
+ fence somewhere akin to how lock xadd 0,(%esp) trickery used to
work), then the atomic APIs do indeed not to be completed w.r.t.
adding all the missing acq/rel variants (that's at least fetchadd and
swap).

We can also extend the API to do relevant addition/subtraction without
gua