svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot

2018-04-12 Thread Rodney W. Grimes
Author: rgrimes
Date: Fri Apr 13 03:47:41 2018
New Revision: 332465
URL: https://svnweb.freebsd.org/changeset/base/332465

Log:
  MFC: r332075
  
  Exit with usage when extra arguments are on command line
  preventing mistakes such as "halt 0p" for "halt -p".
  Approved by:  bde (mentor, implicit), phk (mentor,implicit)
  MFC after:1 week

Modified:
  stable/10/sbin/reboot/reboot.c
Directory Properties:
  stable/10/   (props changed)

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

Modified: stable/10/sbin/reboot/reboot.c
==
--- stable/10/sbin/reboot/reboot.c  Fri Apr 13 03:32:18 2018
(r332464)
+++ stable/10/sbin/reboot/reboot.c  Fri Apr 13 03:47:41 2018
(r332465)
@@ -111,6 +111,8 @@ main(int argc, char *argv[])
}
argc -= optind;
argv += optind;
+   if (argc != 0)
+   usage();
 
if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
errx(1, "cannot dump (-d) when halting; must reboot instead");
___
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: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot

2018-04-12 Thread Rodney W. Grimes
Author: rgrimes
Date: Fri Apr 13 03:47:41 2018
New Revision: 332465
URL: https://svnweb.freebsd.org/changeset/base/332465

Log:
  MFC: r332075
  
  Exit with usage when extra arguments are on command line
  preventing mistakes such as "halt 0p" for "halt -p".
  Approved by:  bde (mentor, implicit), phk (mentor,implicit)
  MFC after:1 week

Modified:
  stable/11/sbin/reboot/reboot.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sbin/reboot/reboot.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sbin/reboot/reboot.c
==
--- stable/11/sbin/reboot/reboot.c  Fri Apr 13 03:32:18 2018
(r332464)
+++ stable/11/sbin/reboot/reboot.c  Fri Apr 13 03:47:41 2018
(r332465)
@@ -111,6 +111,8 @@ main(int argc, char *argv[])
}
argc -= optind;
argv += optind;
+   if (argc != 0)
+   usage();
 
if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
errx(1, "cannot dump (-d) when halting; must reboot instead");
___
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: r332464 - stable/11/usr.bin/yes

2018-04-12 Thread Kyle Evans
Author: kevans
Date: Fri Apr 13 03:32:18 2018
New Revision: 332464
URL: https://svnweb.freebsd.org/changeset/base/332464

Log:
  MFC r319897-r319898, r319904: Improve yes' throughput
  
  r319897: Improve yes' throughput
  
  On my system, this brings up the throughput from ~20 to ~600 MiB/s.
  
  Inspired by:
https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/
  
  r319898: Handle partial writes
  
  r319904: style(9) fixes.

Modified:
  stable/11/usr.bin/yes/yes.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/yes/yes.c
==
--- stable/11/usr.bin/yes/yes.c Fri Apr 13 03:30:10 2018(r332463)
+++ stable/11/usr.bin/yes/yes.c Fri Apr 13 03:32:18 2018(r332464)
@@ -44,20 +44,43 @@ static const char rcsid[] = "$FreeBSD$";
 #include 
 #include 
 #include 
+#include 
+#include 
 
 int
 main(int argc, char **argv)
 {
+   char buf[8192];
+   char y[2] = { 'y', '\n' };
+   char * exp = y;
+   size_t buflen = 0;
+   size_t explen = sizeof(y);
+   size_t more;
+   ssize_t ret;
 
if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
err(1, "capsicum");
 
-   if (argc > 1)
-   while (puts(argv[1]) != EOF)
-   ;
-   else
-   while (puts("y") != EOF)
-   ;
+   if (argc > 1) {
+   exp = argv[1];
+   explen = strlen(exp) + 1;
+   exp[explen - 1] = '\n';
+   }
+
+   if (explen <= sizeof(buf)) {
+   while (buflen < sizeof(buf) - explen) {
+   memcpy(buf + buflen, exp, explen);
+   buflen += explen;
+   }
+   exp = buf;
+   explen = buflen;
+   }
+
+   more = explen;
+   while ((ret = write(STDOUT_FILENO, exp + (explen - more), more)) > 0)
+   if ((more -= ret) == 0)
+   more = explen;
+
err(1, "stdout");
/*NOTREACHED*/
 }
___
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: r332463 - in stable/11: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes

2018-04-12 Thread Kyle Evans
Author: kevans
Date: Fri Apr 13 03:30:10 2018
New Revision: 332463
URL: https://svnweb.freebsd.org/changeset/base/332463

Log:
  MFC r308432, r308657: Capsicumize some trivial stdio programs
  
  r308432: Capsicumize some trivial stdio programs
  
  Trivially capsicumize some simple programs that just interact with
  stdio.  This list of programs uses 'pledge("stdio")' in OpenBSD.
  
  r308657: fold(1): Revert incorrect r308432
  
  As Jean-Sébastien notes, fold(1) requires handling argv-supplied files. That
  will require a slightly more sophisticated approach.

Modified:
  stable/11/bin/echo/echo.c
  stable/11/bin/sleep/sleep.c
  stable/11/usr.bin/basename/basename.c
  stable/11/usr.bin/dc/dc.c
  stable/11/usr.bin/dirname/dirname.c
  stable/11/usr.bin/getopt/getopt.c
  stable/11/usr.bin/locate/bigram/locate.bigram.c
  stable/11/usr.bin/logname/logname.c
  stable/11/usr.bin/printenv/printenv.c
  stable/11/usr.bin/yes/yes.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/echo/echo.c
==
--- stable/11/bin/echo/echo.c   Fri Apr 13 02:40:10 2018(r332462)
+++ stable/11/bin/echo/echo.c   Fri Apr 13 03:30:10 2018(r332463)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -77,6 +79,9 @@ main(int argc, char *argv[])
char space[] = " ";
char newline[] = "\n";
char *progname = argv[0];
+
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
 
/* This utility may NOT do getopt(3) option parsing. */
if (*++argv && !strcmp(*argv, "-n")) {

Modified: stable/11/bin/sleep/sleep.c
==
--- stable/11/bin/sleep/sleep.c Fri Apr 13 02:40:10 2018(r332462)
+++ stable/11/bin/sleep/sleep.c Fri Apr 13 03:30:10 2018(r332463)
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c   8.3 (Berkeley) 4/2
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -68,6 +69,9 @@ main(int argc, char *argv[])
double d;
time_t original;
char buf[2];
+
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
 
if (argc != 2)
usage();

Modified: stable/11/usr.bin/basename/basename.c
==
--- stable/11/usr.bin/basename/basename.c   Fri Apr 13 02:40:10 2018
(r332462)
+++ stable/11/usr.bin/basename/basename.c   Fri Apr 13 03:30:10 2018
(r332463)
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c8.4 (Berkeley) 
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 
@@ -63,6 +64,9 @@ main(int argc, char **argv)
int aflag, ch;
 
setlocale(LC_ALL, "");
+
+   if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS))
+   err(1, "capsicum");
 
aflag = 0;
suffix = NULL;

Modified: stable/11/usr.bin/dc/dc.c
==
--- stable/11/usr.bin/dc/dc.c   Fri Apr 13 02:40:10 2018(r332462)
+++ stable/11/usr.bin/dc/dc.c   Fri Apr 13 03:30:10 2018(r332463)
@@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,11 +60,11 @@ usage(void)
 }
 
 static void
-procfile(char *fname) {
+procfd(int fd, char *fname) {
struct stat st;
FILE *file;
 
-   file = fopen(fname, "r");
+   file = fdopen(fd, "r");
if (file == NULL)
err(1, "cannot open file %s", fname);
if (fstat(fileno(file), ) == -1)
@@ -80,7 +82,7 @@ procfile(char *fname) {
 int
 main(int argc, char *argv[])
 {
-   int ch;
+   int ch, fd;
bool extended_regs = false, preproc_done = false;
 
/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
@@ -97,7 +99,10 @@ main(int argc, char *argv[])
case 'f':
if (!preproc_done)
init_bmachine(extended_regs);
-   procfile(optarg);
+   fd = open(optarg, O_RDONLY);
+   if (fd < 0)
+   err(1, "cannot open file %s", optarg);
+   procfd(fd, optarg);
preproc_done = true;
break;
case 'x':
@@ -126,12 +131,23 @@ main(int argc, char *argv[])
if (argc > 1)
usage();
if (argc == 1) {
-   procfile(argv[0]);
+   fd = open(argv[0], O_RDONLY);
+   if (fd < 0)
+   err(1, "cannot open file %s", argv[0]);
+
+   

svn commit: r332462 - stable/11/usr.bin/locate/locate

2018-04-12 Thread Kyle Evans
Author: kevans
Date: Fri Apr 13 02:40:10 2018
New Revision: 332462
URL: https://svnweb.freebsd.org/changeset/base/332462

Log:
  MFC r306758 (emaste): locate: ANSIfy

Modified:
  stable/11/usr.bin/locate/locate/locate.c
  stable/11/usr.bin/locate/locate/util.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/locate/locate/locate.c
==
--- stable/11/usr.bin/locate/locate/locate.cFri Apr 13 00:29:42 2018
(r332461)
+++ stable/11/usr.bin/locate/locate/locate.cFri Apr 13 02:40:10 2018
(r332462)
@@ -134,9 +134,7 @@ extern int  check_bigram_char(int);
 extern char*patprep(char *);
 
 int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
 {
 register int ch;
 char **dbv = NULL;
@@ -225,10 +223,13 @@ main(argc, argv)
 }
 
 
+/*
+ * Arguments:
+ * db  database
+ * s   search strings
+ */
 void
-search_fopen(db, s)
-   char *db; /* database */
-   char **s; /* search strings */
+search_fopen(char *db, char **s)
 {
FILE *fp;
 #ifdef DEBUG
@@ -275,10 +276,13 @@ search_fopen(db, s)
 } 
 
 #ifdef MMAP
+/*
+ * Arguments:
+ * db  database
+ * s   search strings
+ */
 void
-search_mmap(db, s)
-   char *db; /* database */
-   char **s; /* search strings */
+search_mmap(char *db, char **s)
 {
 struct stat sb;
 int fd;

Modified: stable/11/usr.bin/locate/locate/util.c
==
--- stable/11/usr.bin/locate/locate/util.c  Fri Apr 13 00:29:42 2018
(r332461)
+++ stable/11/usr.bin/locate/locate/util.c  Fri Apr 13 02:40:10 2018
(r332462)
@@ -83,10 +83,7 @@ check_bigram_char(ch)
  *
  */
 char **
-colon(dbv, path, dot)
-   char **dbv;
-   char *path;
-   char *dot; /* default for single ':' */
+colon(char **dbv, char *path, char *dot)
 {
int vlen, slen;
char *c, *ch, *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: r332461 - stable/11/sys/cam/scsi

2018-04-12 Thread Alexander Motin
Author: mav
Date: Fri Apr 13 00:29:42 2018
New Revision: 332461
URL: https://svnweb.freebsd.org/changeset/base/332461

Log:
  MFC r332145: Do not fail devices just for errors in descriptor format.
  
  Sponsored by: iXsystems, Inc.

Modified:
  stable/11/sys/cam/scsi/scsi_cd.c
  stable/11/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_cd.c
==
--- stable/11/sys/cam/scsi/scsi_cd.cFri Apr 13 00:25:53 2018
(r332460)
+++ stable/11/sys/cam/scsi/scsi_cd.cFri Apr 13 00:29:42 2018
(r332461)
@@ -1129,7 +1129,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
 * supported" (0x25) error.
 */
if ((have_sense) && (asc != 0x25)
-&& (error_code == SSD_CURRENT_ERROR)) {
+&& (error_code == SSD_CURRENT_ERROR
+ || error_code == SSD_DESC_CURRENT_ERROR)) {
const char *sense_key_desc;
const char *asc_desc;
 

Modified: stable/11/sys/cam/scsi/scsi_da.c
==
--- stable/11/sys/cam/scsi/scsi_da.cFri Apr 13 00:25:53 2018
(r332460)
+++ stable/11/sys/cam/scsi/scsi_da.cFri Apr 13 00:29:42 2018
(r332461)
@@ -4468,7 +4468,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
(((csio->ccb_h.status & CAM_STATUS_MASK) ==
CAM_REQ_INVALID) ||
 ((have_sense) &&
- (error_code == SSD_CURRENT_ERROR) &&
+ (error_code == SSD_CURRENT_ERROR ||
+  error_code == SSD_DESC_CURRENT_ERROR) &&
  (sense_key == SSD_KEY_ILLEGAL_REQUEST 
{
softc->flags &= ~DA_FLAG_CAN_RC16;
free(rdcap, M_SCSIDA);
@@ -4485,7 +4486,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
 * unit not supported" (0x25) error.
 */
if ((have_sense) && (asc != 0x25)
-&& (error_code == SSD_CURRENT_ERROR)) {
+&& (error_code == SSD_CURRENT_ERROR
+ || error_code == SSD_DESC_CURRENT_ERROR)) {
const char *sense_key_desc;
const char *asc_desc;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332460 - stable/11/usr.sbin/makefs

2018-04-12 Thread Ed Maste
Author: emaste
Date: Fri Apr 13 00:25:53 2018
New Revision: 332460
URL: https://svnweb.freebsd.org/changeset/base/332460

Log:
  MFC r331758: makefs: sync fragment and block size with newfs
  
  r222319 in newfs raised the default blocksize for UFS/FFS filesystems
  from 16K to 32K and the default fragment size from 2K to 4K, with a
  rationale that most disks were now running with 4K sectors.
  
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/usr.sbin/makefs/ffs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/makefs/ffs.c
==
--- stable/11/usr.sbin/makefs/ffs.c Thu Apr 12 21:29:40 2018
(r332459)
+++ stable/11/usr.sbin/makefs/ffs.c Fri Apr 13 00:25:53 2018
(r332460)
@@ -108,8 +108,8 @@ __FBSDID("$FreeBSD$");
 /*
  * Various file system defaults (cribbed from newfs(8)).
  */
-#defineDFL_FRAGSIZE1024/* fragment size */
-#defineDFL_BLKSIZE 8192/* block size */
+#defineDFL_FRAGSIZE4096/* fragment size */
+#defineDFL_BLKSIZE 32768   /* block size */
 #defineDFL_SECSIZE 512 /* sector size */
 #defineDFL_CYLSPERGROUP65536   /* cylinders per group 
*/
 #defineDFL_FRAGSPERINODE   4   /* fragments per inode 
*/
___
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: r332459 - head/sys/netpfil/ipfw/nat64

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 21:29:40 2018
New Revision: 332459
URL: https://svnweb.freebsd.org/changeset/base/332459

Log:
  Fix integer types mismatch for flags field in nat64stl_cfg structure.
  
  Also preserve internal flags on NAT64STL reconfiguration.
  
  Obtained from:Yandex LLC
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/nat64/nat64stl.h
  head/sys/netpfil/ipfw/nat64/nat64stl_control.c

Modified: head/sys/netpfil/ipfw/nat64/nat64stl.h
==
--- head/sys/netpfil/ipfw/nat64/nat64stl.h  Thu Apr 12 21:21:18 2018
(r332458)
+++ head/sys/netpfil/ipfw/nat64/nat64stl.h  Thu Apr 12 21:29:40 2018
(r332459)
@@ -38,7 +38,7 @@ struct nat64stl_cfg {
 
struct in6_addr prefix6;/* IPv6 prefix */
uint8_t plen6;  /* prefix length */
-   uint8_t flags;  /* flags for internal use */
+   uint32_tflags;  /* flags for internal use */
 #defineNAT64STL_KIDX   0x0100
 #defineNAT64STL_46T0x0200
 #defineNAT64STL_64T0x0400

Modified: head/sys/netpfil/ipfw/nat64/nat64stl_control.c
==
--- head/sys/netpfil/ipfw/nat64/nat64stl_control.c  Thu Apr 12 21:21:18 
2018(r332458)
+++ head/sys/netpfil/ipfw/nat64/nat64stl_control.c  Thu Apr 12 21:29:40 
2018(r332459)
@@ -289,8 +289,8 @@ nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheade
 * For now allow to change only following values:
 *  flags.
 */
-
-   cfg->flags = uc->flags & NAT64STL_FLAGSMASK;
+   cfg->flags &= ~NAT64STL_FLAGSMASK;
+   cfg->flags |= uc->flags & NAT64STL_FLAGSMASK;
IPFW_UH_WUNLOCK(ch);
return (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: r332458 - head/sys/cam/scsi

2018-04-12 Thread Kenneth D. Merry
Author: ken
Date: Thu Apr 12 21:21:18 2018
New Revision: 332458
URL: https://svnweb.freebsd.org/changeset/base/332458

Log:
  Handle Programmable Early Warning for control commands in sa(4).
  
  When the tape position is inside the Early Warning area, the tape
  drive will return a sense key of NO SENSE, and an ASC/ASCQ of
  0x00,0x02, which means: End-of-partition/medium detected".  If
  this was in response to a control command like WRITE FILEMARKS,
  we correctly translate this as informational status and return
  0 from saerror().
  
  Programmable Early Warning should be handled the same way, but
  we weren't handling it that way.  As a result, if a PEW status
  (sense key of NO SENSE, ASC/ASCQ of 0x00,0x07, "Programmable early
  warning detected") came back in response to a WRITE FILEMARKS,
  we returned an error.
  
  The impact of this was that if an application was writing to a
  sa(4) device, and a PEW area was set (in the Device Configuration
  Extension subpage -- mode page 0x10, subpage 1), and a filemark
  needed to be written on close, we could wind up returning an error
  to the user on close because of a "failure" to write the filemarks.
  
  It actually isn't a failure, but rather just a status report from
  the drive, and shouldn't be treated as a failure.
  
  sys/cam/scsi/scsi_sa.c:
For control commands in saerror(), treat asc/ascq 0x00,0x07
the same as 0x00,{0-5} -- not an error.  Return 0, since
the command actually did succeed.
  
  Reported by:  Dr. Andreas Haakh 
  Tested by:Dr. Andreas Haakh 
  Sponsored by: Spectra Logic
  MFC after:3 days

Modified:
  head/sys/cam/scsi/scsi_sa.c

Modified: head/sys/cam/scsi/scsi_sa.c
==
--- head/sys/cam/scsi/scsi_sa.c Thu Apr 12 21:13:30 2018(r332457)
+++ head/sys/cam/scsi/scsi_sa.c Thu Apr 12 21:21:18 2018(r332458)
@@ -3453,12 +3453,13 @@ saerror(union ccb *ccb, u_int32_t cflgs, u_int32_t sfl
break;
}
/*
-* If this was just EOM/EOP, Filemark, Setmark or ILI detected
-* on a non read/write command, we assume it's not an error
-* and propagate the residule and return.
+* If this was just EOM/EOP, Filemark, Setmark, ILI or
+* PEW detected on a non read/write command, we assume
+* it's not an error and propagate the residual and return.
 */
-   if ((aqvalid && asc == 0 && ascq > 0 && ascq <= 5) ||
-   (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) {
+   if ((aqvalid && asc == 0 && ((ascq > 0 && ascq <= 5)
+ || (ascq == 0x07)))
+|| (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) {
csio->resid = resid;
QFRLS(ccb);
return (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"


Re: svn commit: r332453 - in head: share/mk sys/conf

2018-04-12 Thread Rodney W. Grimes
> Author: bdrewery
> Date: Thu Apr 12 20:27:57 2018
> New Revision: 332453
> URL: https://svnweb.freebsd.org/changeset/base/332453
> 
> Log:
>   Fix using wrong SYSDIR after r331683.
>   
>   This was inadvertently overriding the first found SYSDIR with the last
>   of /usr/src which could result in the wrong headers being used if not
>   building from /usr/src.
>   
>   SYSDIR?= is not used here to avoid evaluating the exists() when unneeded.
>   
>   Reported by:rgrimes, sjg, Mark Millard
>   Pointyhat to:   bdrewery
>   Sponsored by:   Dell EMC
> 
Thank you for following through with a fix!

> Modified:
>   head/share/mk/bsd.dtb.mk
>   head/share/mk/bsd.kmod.mk
>   head/sys/conf/kmod.mk
...

-- 
Rod Grimes rgri...@freebsd.org
___
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: r332457 - head/sys/netpfil/ipfw/nat64

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 21:13:30 2018
New Revision: 332457
URL: https://svnweb.freebsd.org/changeset/base/332457

Log:
  Use cfg->nomatch_verdict as return value from NAT64LSN handler when
  given mbuf is considered as not matched.
  
  If mbuf was consumed or freed during handling, we must return
  IP_FW_DENY, since ipfw's pfil handler ipfw_check_packet() expects
  IP_FW_DENY when mbuf pointer is NULL. This fixes KASSERT panics
  when NAT64 is used with INVARIANTS. Also remove unused nomatch_final
  field from struct nat64lsn_cfg.
  
  Reported by:  Justin Holcomb 
  Obtained from:Yandex LLC
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/nat64/nat64lsn.c
  head/sys/netpfil/ipfw/nat64/nat64lsn.h
  head/sys/netpfil/ipfw/nat64/nat64lsn_control.c

Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c
==
--- head/sys/netpfil/ipfw/nat64/nat64lsn.c  Thu Apr 12 21:05:20 2018
(r332456)
+++ head/sys/netpfil/ipfw/nat64/nat64lsn.c  Thu Apr 12 21:13:30 2018
(r332457)
@@ -351,10 +351,11 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st
if (nat_proto == NAT_PROTO_ICMP) {
ret = inspect_icmp_mbuf(pm, _proto, , );
if (ret != 0) {
-   if (ret == ENOMEM)
+   if (ret == ENOMEM) {
NAT64STAT_INC(>stats, nomem);
-   else
-   NAT64STAT_INC(>stats, noproto);
+   return (IP_FW_DENY);
+   }
+   NAT64STAT_INC(>stats, noproto);
return (cfg->nomatch_verdict);
}
/* XXX: Check addr for validity */
@@ -416,7 +417,7 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st
>stats, logdata);
 
if (ret == NAT64SKIP)
-   return (IP_FW_PASS);
+   return (cfg->nomatch_verdict);
if (ret == NAT64MFREE)
m_freem(*pm);
*pm = NULL;
@@ -1362,7 +1363,7 @@ nat64lsn_request_host(struct nat64lsn_cfg *cfg,
NAT64STAT_INC(>stats, jhostsreq);
}
 
-   return (IP_FW_PASS);
+   return (IP_FW_DENY);
 }
 
 static NAT64NOINLINE int
@@ -1391,7 +1392,7 @@ nat64lsn_request_portgroup(struct nat64lsn_cfg *cfg,
NAT64STAT_INC(>stats, jportreq);
}
 
-   return (IP_FW_PASS);
+   return (IP_FW_DENY);
 }
 
 static NAT64NOINLINE struct nat64lsn_state * 
@@ -1595,7 +1596,7 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i
 
action = nat64_do_handle_ip6(*pm, aaddr, aport, >stats, logdata);
if (action == NAT64SKIP)
-   return (IP_FW_PASS);
+   return (cfg->nomatch_verdict);
if (action == NAT64MFREE)
m_freem(*pm);
*pm = NULL; /* mark mbuf as consumed */
@@ -1631,7 +1632,7 @@ ipfw_nat64lsn(struct ip_fw_chain *ch, struct ip_fw_arg
ret = nat64lsn_translate6(cfg, >f_id, >m);
break;
default:
-   return (0);
+   return (cfg->nomatch_verdict);
}
return (ret);
 }

Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.h
==
--- head/sys/netpfil/ipfw/nat64/nat64lsn.h  Thu Apr 12 21:05:20 2018
(r332456)
+++ head/sys/netpfil/ipfw/nat64/nat64lsn.h  Thu Apr 12 21:13:30 2018
(r332457)
@@ -199,7 +199,6 @@ struct nat64lsn_cfg {
uint8_t plen4;
uint8_t plen6;
uint8_t nomatch_verdict;/* What to return to ipfw on no-match */
-   uint8_t nomatch_final;  /* Exit outer loop? */
struct in6_addr prefix6;/* IPv6 prefix to embed IPv4 hosts */
 
uint32_tihcount;/* Number of items in host hash */

Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c
==
--- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c  Thu Apr 12 21:05:20 
2018(r332456)
+++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c  Thu Apr 12 21:13:30 
2018(r332457)
@@ -190,7 +190,6 @@ nat64lsn_create(struct ip_fw_chain *ch, ip_fw3_opheade
cfg->st_icmp_ttl = uc->st_icmp_ttl;
 
cfg->nomatch_verdict = IP_FW_DENY;
-   cfg->nomatch_final = 1; /* Exit outer loop by default */
 
IPFW_UH_WLOCK(ch);
 
___
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: r332456 - head/sys/netpfil/ipfw/nat64

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 21:05:20 2018
New Revision: 332456
URL: https://svnweb.freebsd.org/changeset/base/332456

Log:
  Migrate NAT64 to FIB KPI.
  
  Obtained from:Yandex LLC
  MFC after:1 week

Modified:
  head/sys/netpfil/ipfw/nat64/nat64_translate.c
  head/sys/netpfil/ipfw/nat64/nat64_translate.h

Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c
==
--- head/sys/netpfil/ipfw/nat64/nat64_translate.c   Thu Apr 12 20:48:17 
2018(r332455)
+++ head/sys/netpfil/ipfw/nat64/nat64_translate.c   Thu Apr 12 21:05:20 
2018(r332456)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -76,11 +78,12 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa
logdata->af = family;
ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m);
 }
+
 #ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT
-static NAT64NOINLINE struct sockaddr* nat64_find_route4(struct route *ro,
-in_addr_t dest, struct mbuf *m);
-static NAT64NOINLINE struct sockaddr* nat64_find_route6(struct route_in6 *ro,
-struct in6_addr *dest, struct mbuf *m);
+static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *,
+struct sockaddr_in *, struct mbuf *);
+static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *,
+struct sockaddr_in6 *, struct mbuf *);
 
 static NAT64NOINLINE int
 nat64_output(struct ifnet *ifp, struct mbuf *m,
@@ -100,28 +103,38 @@ nat64_output(struct ifnet *ifp, struct mbuf *m,
 static NAT64NOINLINE int
 nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata)
 {
-   struct route_in6 ro6;
-   struct route ro4, *ro;
+   struct nhop6_basic nh6;
+   struct nhop4_basic nh4;
+   struct sockaddr_in6 dst6;
+   struct sockaddr_in dst4;
struct sockaddr *dst;
-   struct ifnet *ifp;
struct ip6_hdr *ip6;
struct ip *ip4;
+   struct ifnet *ifp;
int error;
 
ip4 = mtod(m, struct ip *);
switch (ip4->ip_v) {
case IPVERSION:
-   ro = 
-   dst = nat64_find_route4(, ip4->ip_dst.s_addr, m);
-   if (dst == NULL)
+   dst4.sin_addr = ip4->ip_dst;
+   error = nat64_find_route4(, , m);
+   if (error != 0)
NAT64STAT_INC(stats, noroute4);
+   else {
+   ifp = nh4.nh_ifp;
+   dst = (struct sockaddr *)
+   }
break;
case (IPV6_VERSION >> 4):
-   ip6 = (struct ip6_hdr *)ip4;
-   ro = (struct route *)
-   dst = nat64_find_route6(, >ip6_dst, m);
-   if (dst == NULL)
+   ip6 = mtod(m, struct ip6_hdr *);
+   dst6.sin6_addr = ip6->ip6_dst;
+   error = nat64_find_route6(, , m);
+   if (error != 0)
NAT64STAT_INC(stats, noroute6);
+   else {
+   ifp = nh6.nh_ifp;
+   dst = (struct sockaddr *)
+   }
break;
default:
m_freem(m);
@@ -129,18 +142,15 @@ nat64_output_one(struct mbuf *m, nat64_stats_block *st
DPRINTF(DP_DROPS, "dropped due to unknown IP version");
return (EAFNOSUPPORT);
}
-   if (dst == NULL) {
-   FREE_ROUTE(ro);
+   if (error != 0) {
m_freem(m);
return (EHOSTUNREACH);
}
if (logdata != NULL)
nat64_log(logdata, m, dst->sa_family);
-   ifp = ro->ro_rt->rt_ifp;
-   error = (*ifp->if_output)(ifp, m, dst, ro);
+   error = (*ifp->if_output)(ifp, m, dst, NULL);
if (error != 0)
NAT64STAT_INC(stats, oerrors);
-   FREE_ROUTE(ro);
return (error);
 }
 #else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */
@@ -470,36 +480,31 @@ fail:
return (ENOMEM);
 }
 
-#if __FreeBSD_version < 110
-#definert_expire   rt_rmx.rmx_expire
-#definert_mtu  rt_rmx.rmx_mtu
-#endif
-static NAT64NOINLINE struct sockaddr*
-nat64_find_route6(struct route_in6 *ro, struct in6_addr *dest, struct mbuf *m)
+static NAT64NOINLINE int
+nat64_find_route6(struct nhop6_basic *pnh, struct sockaddr_in6 *dst,
+struct mbuf *m)
 {
-   struct sockaddr_in6 *dst;
-   struct rtentry *rt;
 
-   bzero(ro, sizeof(*ro));
-   dst = (struct sockaddr_in6 *)>ro_dst;
+   if (fib6_lookup_nh_basic(M_GETFIB(m), >sin6_addr, 0, 0, 0,
+   pnh) != 0)
+   return (EHOSTUNREACH);
+   if (pnh->nh_flags & (NHF_BLACKHOLE | NHF_REJECT))
+   return (EHOSTUNREACH);
+   /*
+* XXX: we need to use destination address with embedded scope
+* zone id, because LLTABLE uses such 

svn commit: r332455 - in head: share/mk sys/conf

2018-04-12 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 12 20:48:17 2018
New Revision: 332455
URL: https://svnweb.freebsd.org/changeset/base/332455

Log:
  Use known SRCTOP if possible to determine SYSDIR.
  
  Suggested by: sjg
  Sponsored by: Dell EMC

Modified:
  head/share/mk/bsd.dtb.mk
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dtb.mk
==
--- head/share/mk/bsd.dtb.mkThu Apr 12 20:43:39 2018(r332454)
+++ head/share/mk/bsd.dtb.mkThu Apr 12 20:48:17 2018(r332455)
@@ -3,7 +3,8 @@
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
 .if !defined(SYSDIR)
-.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
+.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
+${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
 ${.CURDIR}/../../../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=${_dir}

Modified: head/share/mk/bsd.kmod.mk
==
--- head/share/mk/bsd.kmod.mk   Thu Apr 12 20:43:39 2018(r332454)
+++ head/share/mk/bsd.kmod.mk   Thu Apr 12 20:48:17 2018(r332455)
@@ -3,7 +3,8 @@
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
 .if !defined(SYSDIR)
-.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
+.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
+${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
 ${.CURDIR}/../../../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=${_dir:tA}

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Thu Apr 12 20:43:39 2018(r332454)
+++ head/sys/conf/kmod.mk   Thu Apr 12 20:48:17 2018(r332455)
@@ -83,7 +83,8 @@ OBJCOPY?= objcopy
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
 .if !defined(SYSDIR)
-.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
+.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
+${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/)
 SYSDIR=${_dir:tA}
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332454 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 i386/i386

2018-04-12 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 12 20:43:39 2018
New Revision: 332454
URL: https://svnweb.freebsd.org/changeset/base/332454

Log:
  Fix PSL_T inheritance on exec for x86.
  
  The miscellaneous x86 sysent->sv_setregs() implementations tried to
  migrate PSL_T from the previous program to the new executed one, but
  they evaluated regs->tf_eflags after the whole regs structure was
  bzeroed.  Make this functional by saving PSL_T value before zeroing.
  
  Note that if the debugger is not attached, executing the first
  instruction in the new program with PSL_T set results in SIGTRAP, and
  since all intercepted signals are reset to default dispostion on
  exec(2), this means that non-debugged process gets killed immediately
  if PSL_T is inherited.  In particular, since suid images drop
  P_TRACED, attempt to set PSL_T for execution of such program would
  kill the process.
  
  Another issue with userspace PSL_T handling is that it is reset by
  trap().  It is reasonable to clear PSL_T when entering SIGTRAP
  handler, to allow the signal to be handled without recursion or
  delivery of blocked fault.  But it is not reasonable to return back to
  the normal flow with PSL_T cleared.  This is too late to change, I
  think.
  
  Discussed with:   bde, Ali Mashtizadeh
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks
  Differential revision:https://reviews.freebsd.org/D14995

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Thu Apr 12 20:27:57 2018
(r332453)
+++ head/sys/amd64/amd64/machdep.c  Thu Apr 12 20:43:39 2018
(r332454)
@@ -581,9 +581,13 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_
 void
 exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
-   struct trapframe *regs = td->td_frame;
-   struct pcb *pcb = td->td_pcb;
+   struct trapframe *regs;
+   struct pcb *pcb;
+   register_t saved_rflags;
 
+   regs = td->td_frame;
+   pcb = td->td_pcb;
+
if (td->td_proc->p_md.md_ldt != NULL)
user_ldt_free(td);
 
@@ -593,11 +597,12 @@ exec_setregs(struct thread *td, struct image_params *i
clear_pcb_flags(pcb, PCB_32BIT);
pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
 
+   saved_rflags = regs->tf_rflags & PSL_T;
bzero((char *)regs, sizeof(struct trapframe));
regs->tf_rip = imgp->entry_addr;
regs->tf_rsp = ((stack - 8) & ~0xFul) + 8;
regs->tf_rdi = stack;   /* argv */
-   regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
+   regs->tf_rflags = PSL_USER | saved_rflags;
regs->tf_ss = _udatasel;
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;

Modified: head/sys/amd64/ia32/ia32_signal.c
==
--- head/sys/amd64/ia32/ia32_signal.c   Thu Apr 12 20:27:57 2018
(r332453)
+++ head/sys/amd64/ia32/ia32_signal.c   Thu Apr 12 20:43:39 2018
(r332454)
@@ -936,9 +936,13 @@ freebsd32_sigreturn(td, uap)
 void
 ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
-   struct trapframe *regs = td->td_frame;
-   struct pcb *pcb = td->td_pcb;
+   struct trapframe *regs;
+   struct pcb *pcb;
+   register_t saved_rflags;
 
+   regs = td->td_frame;
+   pcb = td->td_pcb;
+
if (td->td_proc->p_md.md_ldt != NULL)
user_ldt_free(td);
 #ifdef COMPAT_43
@@ -949,10 +953,11 @@ ia32_setregs(struct thread *td, struct image_params *i
pcb->pcb_gsbase = 0;
pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
+   saved_rflags = regs->tf_rflags & PSL_T;
bzero((char *)regs, sizeof(struct trapframe));
regs->tf_rip = imgp->entry_addr;
regs->tf_rsp = stack;
-   regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
+   regs->tf_rflags = PSL_USER | saved_rflags;
regs->tf_ss = _udatasel;
regs->tf_cs = _ucode32sel;
regs->tf_rbx = imgp->ps_strings;

Modified: head/sys/amd64/linux/linux_sysvec.c
==
--- head/sys/amd64/linux/linux_sysvec.c Thu Apr 12 20:27:57 2018
(r332453)
+++ head/sys/amd64/linux/linux_sysvec.c Thu Apr 12 20:43:39 2018
(r332454)
@@ -404,9 +404,13 @@ linux_copyout_strings(struct image_params *imgp)
 static void
 linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
-   struct trapframe *regs = td->td_frame;
-   struct pcb *pcb = td->td_pcb;
+   struct trapframe *regs;
+   struct pcb *pcb;
+   register_t saved_rflags;
 
+   regs = td->td_frame;
+   pcb = 

svn commit: r332453 - in head: share/mk sys/conf

2018-04-12 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 12 20:27:57 2018
New Revision: 332453
URL: https://svnweb.freebsd.org/changeset/base/332453

Log:
  Fix using wrong SYSDIR after r331683.
  
  This was inadvertently overriding the first found SYSDIR with the last
  of /usr/src which could result in the wrong headers being used if not
  building from /usr/src.
  
  SYSDIR?= is not used here to avoid evaluating the exists() when unneeded.
  
  Reported by:  rgrimes, sjg, Mark Millard
  Pointyhat to: bdrewery
  Sponsored by: Dell EMC

Modified:
  head/share/mk/bsd.dtb.mk
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dtb.mk
==
--- head/share/mk/bsd.dtb.mkThu Apr 12 20:21:04 2018(r332452)
+++ head/share/mk/bsd.dtb.mkThu Apr 12 20:27:57 2018(r332453)
@@ -5,7 +5,7 @@
 .if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
 ${.CURDIR}/../../../../.. /sys /usr/src/sys
-.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=${_dir}
 .endif
 .endfor

Modified: head/share/mk/bsd.kmod.mk
==
--- head/share/mk/bsd.kmod.mk   Thu Apr 12 20:21:04 2018(r332452)
+++ head/share/mk/bsd.kmod.mk   Thu Apr 12 20:27:57 2018(r332453)
@@ -5,7 +5,7 @@
 .if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
 ${.CURDIR}/../../../../.. /sys /usr/src/sys
-.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=${_dir:tA}
 .endif
 .endfor

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Thu Apr 12 20:21:04 2018(r332452)
+++ head/sys/conf/kmod.mk   Thu Apr 12 20:27:57 2018(r332453)
@@ -84,7 +84,7 @@ OBJCOPY?= objcopy
 .if empty(KERNBUILDDIR)
 .if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
-.if exists(${_dir}/kern/)
+.if !defined(SYSDIR) && exists(${_dir}/kern/)
 SYSDIR=${_dir:tA}
 .endif
 .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: r332452 - head/sys/dev/vt/font

2018-04-12 Thread Ed Maste
Author: emaste
Date: Thu Apr 12 20:21:04 2018
New Revision: 332452
URL: https://svnweb.freebsd.org/changeset/base/332452

Log:
  Update vt(4) "Terminus BSD Console" font to v4.46
  
  "Terminus BSD Console" is a derivative of Terminus that is provided
  by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the
  FreeBSD vt(4) console and other BSDs.
  
  PR:   227409
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/font/vt_font_default.c

Modified: head/sys/dev/vt/font/vt_font_default.c
==
--- head/sys/dev/vt/font/vt_font_default.c  Thu Apr 12 20:05:26 2018
(r332451)
+++ head/sys/dev/vt/font/vt_font_default.c  Thu Apr 12 20:21:04 2018
(r332452)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-static uint8_t font_bytes[1477 * 16] = {
+static uint8_t font_bytes[2224 * 16] = {
0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,
@@ -188,9 +188,9 @@ static uint8_t font_bytes[1477 * 16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c,
-   0x10, 0x10, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x08,
-   0x10, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x38, 0x04, 0x18, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x10, 0x10, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x04,
+   0x08, 0x10, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x38, 0x04, 0x18, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x7a, 0x40, 0x40, 0x40, 0x00,
@@ -198,7 +198,7 @@ static uint8_t font_bytes[1477 * 16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00,
-   0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x7c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x90, 0x48, 0x24, 0x12, 0x24, 0x48, 0x90, 0x00, 0x00, 0x00, 0x00,
@@ -340,7 +340,7 @@ static uint8_t font_bytes[1477 * 16] = {
0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00,
0x0c, 0x12, 0x40, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xff, 0x42, 0x42, 0x7e, 0x42,
-   0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8,
+   0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0,
0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00,
0x32, 0x4c, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x58, 0x00, 0x30, 0x10, 0x10,
@@ -496,222 +496,258 @@ static uint8_t font_bytes[1477 * 16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x03, 0x00,
0x32, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
-   0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42,
-   0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40,
-   0x40, 0x40, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x42, 0x42,
-   0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00,
-   0x40, 0x80, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38,
-   0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42,
-   0x42, 0x42, 0x42, 0x3c, 0x00, 

svn commit: r332451 - head/sbin/ipfw

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 20:05:26 2018
New Revision: 332451
URL: https://svnweb.freebsd.org/changeset/base/332451

Log:
  Fix indenting in ipv6.c file, use tabs instead of mixing tabs and spaces.
  
  MFC after:1 week

Modified:
  head/sbin/ipfw/ipv6.c

Modified: head/sbin/ipfw/ipv6.c
==
--- head/sbin/ipfw/ipv6.c   Thu Apr 12 19:59:36 2018(r332450)
+++ head/sbin/ipfw/ipv6.c   Thu Apr 12 20:05:26 2018(r332451)
@@ -48,11 +48,11 @@
} while (0)
 
 static struct _s_x icmp6codes[] = {
-  { "no-route",ICMP6_DST_UNREACH_NOROUTE },
-  { "admin-prohib",ICMP6_DST_UNREACH_ADMIN },
-  { "address", ICMP6_DST_UNREACH_ADDR },
-  { "port",ICMP6_DST_UNREACH_NOPORT },
-  { NULL, 0 }
+   { "no-route",   ICMP6_DST_UNREACH_NOROUTE },
+   { "admin-prohib",   ICMP6_DST_UNREACH_ADMIN },
+   { "address",ICMP6_DST_UNREACH_ADDR },
+   { "port",   ICMP6_DST_UNREACH_NOPORT },
+   { NULL, 0 }
 };
 
 void
@@ -87,50 +87,54 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code)
 void
 print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd)
 {
-   struct hostent *he = NULL;
-   int len = F_LEN((ipfw_insn *) cmd) - 1;
-   struct in6_addr *a = &(cmd->addr6);
-   char trad[255];
+   char trad[255];
+   struct hostent *he = NULL;
+   struct in6_addr *a = &(cmd->addr6);
+   int len, mb;
 
-   if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) {
-  bprintf(bp, " me6");
-  return;
-   }
-   if (cmd->o.opcode == O_IP6) {
-  bprintf(bp, " ip6");
-  return;
-   }
+   len = F_LEN((ipfw_insn *) cmd) - 1;
+   if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) {
+   bprintf(bp, " me6");
+   return;
+   }
+   if (cmd->o.opcode == O_IP6) {
+   bprintf(bp, " ip6");
+   return;
+   }
 
-   /*
-   * len == 4 indicates a single IP, whereas lists of 1 or more
-   * addr/mask pairs have len = (2n+1). We convert len to n so we
-   * use that to count the number of entries.
-   */
+   /*
+* len == 4 indicates a single IP, whereas lists of 1 or more
+* addr/mask pairs have len = (2n+1). We convert len to n so we
+* use that to count the number of entries.
+*/
bprintf(bp, " ");
-   for (len = len / 4; len > 0; len -= 2, a += 2) {
-  int mb = /* mask length */
-  (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ?
-  128 : contigmask((uint8_t *)&(a[1]), 128);
+   for (len = len / 4; len > 0; len -= 2, a += 2) {
+   /* mask length */
+   mb = (cmd->o.opcode == O_IP6_SRC ||
+   cmd->o.opcode == O_IP6_DST) ?  128:
+   contigmask((uint8_t *)&(a[1]), 128);
 
-  if (mb == 128 && co.do_resolv)
-  he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6);
-  if (he != NULL)   /* resolved to name */
-  bprintf(bp, "%s", he->h_name);
-  else if (mb == 0)   /* any */
-  bprintf(bp, "any");
-  else { /* numeric IP followed by some kind of mask */
-  if (inet_ntop(AF_INET6,  a, trad, sizeof( trad ) ) == NULL)
-  bprintf(bp, "Error ntop in print_ip6\n");
-  bprintf(bp, "%s",  trad );
-  if (mb < 0) /* mask not contiguous */
-  bprintf(bp, "/%s",
-  inet_ntop(AF_INET6, [1], trad, sizeof(trad)));
-  else if (mb < 128)
-  bprintf(bp, "/%d", mb);
-  }
-  if (len > 2)
-  bprintf(bp, ",");
-   }
+   if (mb == 128 && co.do_resolv)
+   he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6);
+
+   if (he != NULL)  /* resolved to name */
+   bprintf(bp, "%s", he->h_name);
+   else if (mb == 0)  /* any */
+   bprintf(bp, "any");
+   else {/* numeric IP followed by some kind of mask */
+   if (inet_ntop(AF_INET6,  a, trad,
+   sizeof(trad)) == NULL)
+   bprintf(bp, "Error ntop in print_ip6\n");
+   bprintf(bp, "%s",  trad );
+   if (mb < 0) /* mask not contiguous */
+   bprintf(bp, "/%s", inet_ntop(AF_INET6, [1],
+   trad, sizeof(trad)));
+   else if (mb < 128)
+   bprintf(bp, "/%d", mb);
+   }
+   if (len > 2)
+   bprintf(bp, ",");
+   }
 }
 
 void
@@ 

Re: svn commit: r332447 - stable/11/sys/dev/ixgbe

2018-04-12 Thread Ryan Stone
Spinning in the kernel for a full second is a really bad idea.  At
minimum this is going to hold off all callouts from one of the callout
threads for up to a full second as ixgbe_local_timer() waits for the
core mutex.  That chews up two CPU cores doing busy-wait loops (the
ixgbe_stop() thread busy-waits in msec_delay and the callout thread
adaptively spins waiting for the mutex).  If any other thread tries to
acquire the core lock they also adaptively spin on the mutex chewing
up yet more cores.  This includes any threads trying to fetch
interface status (e.g. ifconfig), various interrupt handlers, etc.
___
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: r332450 - head/sys/amd64/amd64

2018-04-12 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 12 19:59:36 2018
New Revision: 332450
URL: https://svnweb.freebsd.org/changeset/base/332450

Log:
  Optimize context switch for PTI on PCID pmap.
  
  In pti-enabled pmap, the PCID allocation scheme assigns temporal id
  for the kernel page table, and user page table twin PCID is
  calculating by setting high bit in the kernel PCID.  So the kernel AS
  is mapped with per-vmspace PCID, and we must completely shut down all
  mappings in KVA when switching contexts, so that newly switched thread
  would see all changes in KVA occured while it was not executing.
  After all, KVA is same between all threads.
  
  Currently the pti context switch for the user part of the page table
  gets its TLB entries flushed too. It is excessive. The same PCID
  flushing algorithm that is used for non-pti pmap, correctly works for
  the UVA mappings.  The only shared TLB entries are the pages from KVA
  accessed by the kernel entry trampoline.  All of them are static
  except per-thread TSS and LDT. For TSS and LDT, the lifetime of newly
  allocated entries is the whole thread life, so it is fine as well. If
  not fine, then explicit shutdowns for current pmap of the newly
  allocated LDT and TSS pages would be enough.
  
  Also restore the constant value for the pm_pcid for the kernel_pmap.
  Before, for PTI pmap, pm_pcid was erronously rolled same as user
  pmap's pm_pcid, but it was not used.
  
  Reviewed by:  markj (previous version)
  Discussed with:   alc
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month
  Differential revision:https://reviews.freebsd.org/D14961

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Thu Apr 12 19:44:04 2018(r332449)
+++ head/sys/amd64/amd64/pmap.c Thu Apr 12 19:59:36 2018(r332450)
@@ -7330,8 +7330,9 @@ pmap_pcid_alloc(pmap_t pmap, u_int cpuid)
 
CRITICAL_ASSERT(curthread);
gen = PCPU_GET(pcid_gen);
-   if (!pti && (pmap->pm_pcids[cpuid].pm_pcid == PMAP_PCID_KERN ||
-   pmap->pm_pcids[cpuid].pm_gen == gen))
+   if (pmap->pm_pcids[cpuid].pm_pcid == PMAP_PCID_KERN)
+   return (pti ? 0 : CR3_PCID_SAVE);
+   if (pmap->pm_pcids[cpuid].pm_gen == gen)
return (CR3_PCID_SAVE);
pcid_next = PCPU_GET(pcid_next);
KASSERT((!pti && pcid_next <= PMAP_PCID_OVERMAX) ||
@@ -7358,7 +7359,7 @@ pmap_activate_sw(struct thread *td)
 {
pmap_t oldpmap, pmap;
struct invpcid_descr d;
-   uint64_t cached, cr3, kcr3, ucr3;
+   uint64_t cached, cr3, kcr3, kern_pti_cached, ucr3;
register_t rflags;
u_int cpuid;
 
@@ -7407,11 +7408,10 @@ pmap_activate_sw(struct thread *td)
if (!invpcid_works)
rflags = intr_disable();
 
-   if (!cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) {
+   kern_pti_cached = pti ? 0 : cached;
+   if (!kern_pti_cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) 
{
load_cr3(pmap->pm_cr3 | pmap->pm_pcids[cpuid].pm_pcid |
-   cached);
-   if (cached)
-   PCPU_INC(pm_save_cnt);
+   kern_pti_cached);
}
PCPU_SET(curpmap, pmap);
if (pti) {
@@ -7419,13 +7419,13 @@ pmap_activate_sw(struct thread *td)
ucr3 = pmap->pm_ucr3 | pmap->pm_pcids[cpuid].pm_pcid |
PMAP_PCID_USER_PT;
 
-   /*
-* Manually invalidate translations cached
-* from the user page table, which are not
-* flushed by reload of cr3 with the kernel
-* page table pointer above.
-*/
-   if (pmap->pm_ucr3 != PMAP_NO_CR3) {
+   if (!cached && pmap->pm_ucr3 != PMAP_NO_CR3) {
+   /*
+* Manually invalidate translations cached
+* from the user page table.  They are not
+* flushed by reload of cr3 with the kernel
+* page table pointer above.
+*/
if (invpcid_works) {
d.pcid = PMAP_PCID_USER_PT |
pmap->pm_pcids[cpuid].pm_pcid;
@@ -7442,6 +7442,8 @@ pmap_activate_sw(struct thread *td)
}
if (!invpcid_works)
intr_restore(rflags);
+   if (cached)
+   PCPU_INC(pm_save_cnt);
} else if (cr3 != pmap->pm_cr3) {
load_cr3(pmap->pm_cr3);

svn commit: r332449 - head/sbin/ipfw

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 19:44:04 2018
New Revision: 332449
URL: https://svnweb.freebsd.org/changeset/base/332449

Log:
  Remove printing of "not" keyword from print_ip6() function.
  
  After r331668 handling of F_NOT flag done in one place by
  print_instruction() function. Also remove unused argument from
  print_ip[6]() functions.
  
  MFC after:1 week

Modified:
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h
  head/sbin/ipfw/ipv6.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Thu Apr 12 19:34:35 2018(r332448)
+++ head/sbin/ipfw/ipfw2.c  Thu Apr 12 19:44:04 2018(r332449)
@@ -1176,8 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_
  * Print the ip address contained in a command.
  */
 static void
-print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd,
-char const *s)
+print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd)
 {
struct hostent *he = NULL;
struct in_addr *ia;
@@ -1185,6 +1184,7 @@ print_ip(struct buf_pr *bp, const struct format_opts *
uint32_t *a = ((ipfw_insn_u32 *)cmd)->d;
char *t;
 
+   bprintf(bp, " ");
if (cmd->o.opcode == O_IP_DST_LOOKUP && len > 
F_INSN_SIZE(ipfw_insn_u32)) {
uint32_t d = a[1];
const char *arg = "";
@@ -1192,11 +1192,9 @@ print_ip(struct buf_pr *bp, const struct format_opts *
if (d < sizeof(lookup_key)/sizeof(lookup_key[0]))
arg = match_value(rule_options, lookup_key[d]);
t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1);
-   bprintf(bp, " lookup %s %s", arg, t);
+   bprintf(bp, "lookup %s %s", arg, t);
return;
}
-   bprintf(bp, "%s ", s);
-
if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) {
bprintf(bp, "me");
return;
@@ -1467,7 +1465,7 @@ print_instruction(struct buf_pr *bp, const struct form
case O_IP_DST_MASK:
case O_IP_DST_ME:
case O_IP_DST_SET:
-   print_ip(bp, fo, insntod(cmd, ip), "");
+   print_ip(bp, fo, insntod(cmd, ip));
break;
case O_IP6_SRC:
case O_IP6_SRC_MASK:
@@ -1475,7 +1473,7 @@ print_instruction(struct buf_pr *bp, const struct form
case O_IP6_DST:
case O_IP6_DST_MASK:
case O_IP6_DST_ME:
-   print_ip6(bp, insntod(cmd, ip6), "");
+   print_ip6(bp, insntod(cmd, ip6));
break;
case O_FLOW6ID:
print_flow6id(bp, insntod(cmd, u32));

Modified: head/sbin/ipfw/ipfw2.h
==
--- head/sbin/ipfw/ipfw2.h  Thu Apr 12 19:34:35 2018(r332448)
+++ head/sbin/ipfw/ipfw2.h  Thu Apr 12 19:44:04 2018(r332449)
@@ -401,7 +401,7 @@ int ipfw_delete_pipe(int pipe_or_queue, int n);
 
 /* ipv6.c */
 void print_unreach6_code(struct buf_pr *bp, uint16_t code);
-void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd, char const *s);
+void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd);
 void print_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd);
 void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd);
 void print_ext6hdr(struct buf_pr *bp, struct _ipfw_insn *cmd );

Modified: head/sbin/ipfw/ipv6.c
==
--- head/sbin/ipfw/ipv6.c   Thu Apr 12 19:34:35 2018(r332448)
+++ head/sbin/ipfw/ipv6.c   Thu Apr 12 19:44:04 2018(r332449)
@@ -85,17 +85,15 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code)
  * Print the ip address contained in a command.
  */
 void
-print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char const *s)
+print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd)
 {
struct hostent *he = NULL;
int len = F_LEN((ipfw_insn *) cmd) - 1;
struct in6_addr *a = &(cmd->addr6);
char trad[255];
 
-   bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s);
-
if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) {
-  bprintf(bp, "me6");
+  bprintf(bp, " me6");
   return;
}
if (cmd->o.opcode == O_IP6) {
@@ -108,7 +106,7 @@ print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char 
* addr/mask pairs have len = (2n+1). We convert len to n so we
* use that to count the number of entries.
*/
-
+   bprintf(bp, " ");
for (len = len / 4; len > 0; len -= 2, a += 2) {
   int mb = /* mask length */
   (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To 

svn commit: r332448 - head/sbin/ipfw

2018-04-12 Thread Andrey V. Elsukov
Author: ae
Date: Thu Apr 12 19:34:35 2018
New Revision: 332448
URL: https://svnweb.freebsd.org/changeset/base/332448

Log:
  Remove printing of "not" keyword from print_ip() function.
  
  After r331668 handling of F_NOT flag done in one place by
  print_instruction() function.
  
  MFC after:1 week

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Thu Apr 12 19:06:15 2018(r332447)
+++ head/sbin/ipfw/ipfw2.c  Thu Apr 12 19:34:35 2018(r332448)
@@ -1192,11 +1192,10 @@ print_ip(struct buf_pr *bp, const struct format_opts *
if (d < sizeof(lookup_key)/sizeof(lookup_key[0]))
arg = match_value(rule_options, lookup_key[d]);
t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1);
-   bprintf(bp, "%s lookup %s %s", cmd->o.len & F_NOT ? " not": "",
-   arg, t);
+   bprintf(bp, " lookup %s %s", arg, t);
return;
}
-   bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s);
+   bprintf(bp, "%s ", s);
 
if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) {
bprintf(bp, "me");
___
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: r332447 - stable/11/sys/dev/ixgbe

2018-04-12 Thread Stephen Hurd
Author: shurd
Date: Thu Apr 12 19:06:15 2018
New Revision: 332447
URL: https://svnweb.freebsd.org/changeset/base/332447

Log:
  Work around netmap issue with ixgbe
  
  After multiple start/stop of netmap, ixgbe will get into a bad state
  requiring a reboot to recover.  Adding a delay before stopping the interface
  appears to work around the issue.
  
  The -CURRENT driver has diverged too far from -STABLE for an MFC.
  
  PR:   221317
  Submitted by: Sylvain Galliano 
  Reported by:  Cassiano Peixoto 
  Sponsored by: Limelight Networks

Modified:
  stable/11/sys/dev/ixgbe/if_ix.c

Modified: stable/11/sys/dev/ixgbe/if_ix.c
==
--- stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:00:22 2018
(r332446)
+++ stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:06:15 2018
(r332447)
@@ -3567,6 +3567,8 @@ ixgbe_stop(void *arg)
 
mtx_assert(>core_mtx, MA_OWNED);
 
+   msec_delay(1000);
+
INIT_DEBUGOUT("ixgbe_stop: begin\n");
ixgbe_disable_intr(adapter);
callout_stop(>timer);
___
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: r332446 - head/release/i386

2018-04-12 Thread Ed Maste
Author: emaste
Date: Thu Apr 12 19:00:22 2018
New Revision: 332446
URL: https://svnweb.freebsd.org/changeset/base/332446

Log:
  switch i386 memstick installer images to MBR
  
  Some BIOSes have trouble booting from GPT in non-UEFI mode.  This is
  commonly reported with Lenovo laptops, including my x220.  As we do not
  currently support booting FreeBSD/i386 via UEFI there's no reason to
  prefer GPT.
  
  The "vestigial swap partition" was added in r265017 to work around an
  issue with loader's GPT support, so we should not need it when using
  MBR.
  
  We may want to make the same change to amd64, although the issue there is
  mitigated by such systems booting via UEFI in the common case.
  
  PR:   227422
  Reviewed by:  gjb
  MFC after:3 weeks
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/i386/make-memstick.sh

Modified: head/release/i386/make-memstick.sh
==
--- head/release/i386/make-memstick.sh  Thu Apr 12 18:25:53 2018
(r332445)
+++ head/release/i386/make-memstick.sh  Thu Apr 12 19:00:22 2018
(r332446)
@@ -36,11 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s gpt \
--b ${1}/boot/pmbr \
--p freebsd-boot:=${1}/boot/gptboot \
--p freebsd-ufs:=${2}.part \
--p freebsd-swap::1M \
+mkimg -s mbr \
+-b ${1}/boot/mbr \
+-p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \
 -o ${2}
 rm ${2}.part
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332445 - head

2018-04-12 Thread Brooks Davis
Author: brooks
Date: Thu Apr 12 18:25:53 2018
New Revision: 332445
URL: https://svnweb.freebsd.org/changeset/base/332445

Log:
  Add fpa.4.gz missing in the removal of FDDI in r332412.
  
  Reported by:  trasz

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Apr 12 18:24:00 2018(r332444)
+++ head/ObsoleteFiles.inc  Thu Apr 12 18:25:53 2018(r332445)
@@ -40,6 +40,7 @@
 
 # 20180409: remove FDDI support
 OLD_FILES+=usr/include/net/fddi.h
+OLD_FILES+=usr/share/man/man4/fpa.4.gz
 # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays
 OLD_DIRS+=boot/overlays
 # 20180311: remove sys/sys/i386/include/pcaudioio.h
___
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: r332444 - head

2018-04-12 Thread Brooks Davis
Author: brooks
Date: Thu Apr 12 18:24:00 2018
New Revision: 332444
URL: https://svnweb.freebsd.org/changeset/base/332444

Log:
  Allow -DNO_CLEAN builds across r332443.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Apr 12 18:23:14 2018(r332443)
+++ head/Makefile.inc1  Thu Apr 12 18:24:00 2018(r332444)
@@ -808,7 +808,8 @@ _cleanobj_fast_depend_hack: .PHONY
 # 20180404  r332048  sigreturn
 # 20180405  r332080  shmat
 # 20180406  r332119  setlogin
-.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat 
sigreturn statfs
+# 20170411  r332443  exect
+.for f in exect fstat fstatat fstatfs getdirentries getfsstat setlogin shmat 
sigreturn statfs
 .if exists(${OBJTOP}/lib/libc/.depend.${f}.o)
@if egrep -qw '${f}\.[sS]' \
${OBJTOP}/lib/libc/.depend.${f}.o; then \
___
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: r332443 - in head/lib/libc: amd64 amd64/sys gen i386 i386/sys mips/sys powerpc powerpc/sys powerpc64 powerpc64/sys sparc64 sparc64/sys

2018-04-12 Thread Brooks Davis
Author: brooks
Date: Thu Apr 12 18:23:14 2018
New Revision: 332443
URL: https://svnweb.freebsd.org/changeset/base/332443

Log:
  Replace MD assembly exect() with a portable version.
  
  Originally, on the VAX exect() enable tracing once the new executable
  image was loaded.  This was possible because tracing was controllable
  through user space code by setting the PSL_T flag.  The following
  instruction is a system call that activated tracing (as all
  instructions do) by copying PSL_T to PSL_TP (trace pending).  The
  first instruction of the new executable image would trigger a trace
  fault.
  
  This is not portable to all platforms and the behavior was replaced with
  ptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository.
  Platforms either incorrectly call execve(), trigger trace faults inside
  the original executable, or do contain an implementation of this
  function.
  
  The exect() interfaces is deprecated or removed on NetBSD and OpenBSD.
  
  Submitted by: Ali Mashtizadeh 
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D14989

Added:
  head/lib/libc/gen/exect.c   (contents, props changed)
Deleted:
  head/lib/libc/amd64/sys/exect.S
  head/lib/libc/i386/sys/exect.S
  head/lib/libc/mips/sys/exect.S
  head/lib/libc/powerpc/sys/exect.S
  head/lib/libc/powerpc64/sys/exect.S
  head/lib/libc/sparc64/sys/exect.S
Modified:
  head/lib/libc/amd64/Symbol.map
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libc/i386/Symbol.map
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/mips/sys/Makefile.inc
  head/lib/libc/powerpc/Symbol.map
  head/lib/libc/powerpc/sys/Makefile.inc
  head/lib/libc/powerpc64/Symbol.map
  head/lib/libc/powerpc64/sys/Makefile.inc
  head/lib/libc/sparc64/Symbol.map
  head/lib/libc/sparc64/sys/Makefile.inc

Modified: head/lib/libc/amd64/Symbol.map
==
--- head/lib/libc/amd64/Symbol.map  Thu Apr 12 17:47:36 2018
(r332442)
+++ head/lib/libc/amd64/Symbol.map  Thu Apr 12 18:23:14 2018
(r332443)
@@ -40,7 +40,6 @@ FBSD_1.0 {
amd64_set_fsbase;
amd64_set_gsbase;
brk;
-   exect;
sbrk;
vfork;
 };

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incThu Apr 12 17:47:36 2018
(r332442)
+++ head/lib/libc/amd64/sys/Makefile.incThu Apr 12 18:23:14 2018
(r332443)
@@ -8,8 +8,7 @@ SRCS+=  \
amd64_set_fsbase.c \
amd64_set_gsbase.c
 
-MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \
-   sbrk.S
+MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S
 
 # Don't generate default code for these syscalls:
 NOASM+=vfork.o

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu Apr 12 17:47:36 2018
(r332442)
+++ head/lib/libc/gen/Makefile.inc  Thu Apr 12 18:23:14 2018
(r332443)
@@ -41,6 +41,7 @@ SRCS+=__getosreldate.c \
errlst.c \
errno.c \
exec.c \
+   exect.c \
fdevname.c \
feature_present.c \
fmtcheck.c \

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapThu Apr 12 17:47:36 2018
(r332442)
+++ head/lib/libc/gen/Symbol.mapThu Apr 12 18:23:14 2018
(r332443)
@@ -105,6 +105,7 @@ FBSD_1.0 {
sys_errlist;
sys_nerr;
errno;
+   exect;
execl;
execle;
execlp;

Added: head/lib/libc/gen/exect.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/gen/exect.c   Thu Apr 12 18:23:14 2018(r332443)
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2018 Ali Mashtizadeh 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE 

Re: svn commit: r332434 - head/sys/conf

2018-04-12 Thread Ruslan Bukin
On Thu, Apr 12, 2018 at 06:41:37PM +0100, Ruslan Bukin wrote:
> On Thu, Apr 12, 2018 at 09:48:10AM -0700, John Baldwin wrote:
> > On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote:
> > > Author: br
> > > Date: Thu Apr 12 15:12:40 2018
> > > New Revision: 332434
> > > URL: https://svnweb.freebsd.org/changeset/base/332434
> > > 
> > > Log:
> > >   Add ld emulation types for hard-float mipses.
> > >   
> > >   Sponsored by:   DARPA, AFRL
> > 
> > We actually shouldn't need hf kernels anymore.  HAVE_FPU has been removed
> > and any mips kernel works fine with either hard or soft float userlands.
> > 
> 
> Ok I will work on removing hf targets. This should be kept I think until we 
> remove them.
> 

Oh sorry this is for kernels only. Ok I will revert this then.

Ruslan
___
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: r332434 - head/sys/conf

2018-04-12 Thread Ruslan Bukin
On Thu, Apr 12, 2018 at 09:48:10AM -0700, John Baldwin wrote:
> On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote:
> > Author: br
> > Date: Thu Apr 12 15:12:40 2018
> > New Revision: 332434
> > URL: https://svnweb.freebsd.org/changeset/base/332434
> > 
> > Log:
> >   Add ld emulation types for hard-float mipses.
> >   
> >   Sponsored by: DARPA, AFRL
> 
> We actually shouldn't need hf kernels anymore.  HAVE_FPU has been removed
> and any mips kernel works fine with either hard or soft float userlands.
> 

Ok I will work on removing hf targets. This should be kept I think until we 
remove them.

Thanks

Ruslan
___
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: r332442 - head/lib/libc/gen

2018-04-12 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Apr 12 17:47:36 2018
New Revision: 332442
URL: https://svnweb.freebsd.org/changeset/base/332442

Log:
  Bump .Dd value (forgot to do this in r332439)
  
  MFC after:3 days
  X-MFC-With:   332439

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

Modified: head/lib/libc/gen/syslog.3
==
--- head/lib/libc/gen/syslog.3  Thu Apr 12 17:43:19 2018(r332441)
+++ head/lib/libc/gen/syslog.3  Thu Apr 12 17:47:36 2018(r332442)
@@ -28,7 +28,7 @@
 .\" @(#)syslog.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 6, 2018
+.Dd April 12, 2018
 .Dt SYSLOG 3
 .Os
 .Sh NAME
___
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: r332441 - in head/sys: conf mips/beri mips/include mips/mips

2018-04-12 Thread Ruslan Bukin
Author: br
Date: Thu Apr 12 17:43:19 2018
New Revision: 332441
URL: https://svnweb.freebsd.org/changeset/base/332441

Log:
  Add SMP support for BERI CPU.
  
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL

Added:
  head/sys/mips/beri/beri_mp.c   (contents, props changed)
  head/sys/mips/beri/beri_mp.h   (contents, props changed)
Modified:
  head/sys/conf/options.mips
  head/sys/mips/beri/files.beri
  head/sys/mips/beri/std.beri
  head/sys/mips/include/cpufunc.h
  head/sys/mips/include/hwfunc.h
  head/sys/mips/mips/mp_machdep.c

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Thu Apr 12 17:16:13 2018(r332440)
+++ head/sys/conf/options.mips  Thu Apr 12 17:43:19 2018(r332441)
@@ -99,6 +99,7 @@ OCTEON_BOARD_CAPK_0100ND  opt_cvmx.h
 # Options specific to the BERI platform. 
 #
 BERI_LARGE_TLB opt_global.h
+PLATFORM_INIT_SECONDARYopt_global.h
 
 #
 # Options that control the NetFPGA-10G Embedded CPU Ethernet Core.

Added: head/sys/mips/beri/beri_mp.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/beri/beri_mp.cThu Apr 12 17:43:19 2018
(r332441)
@@ -0,0 +1,309 @@
+/*-
+ * Copyright (c) 2017 Ruslan Bukin 
+ * Copyright (c) 2012-2015 Robert N. M. Watson
+ * Copyright (c) 2013 SRI International
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+struct spin_entry {
+   uint64_t entry_addr;
+   uint64_t a0;
+   uint32_t rsvd1;
+   uint32_t pir;
+   uint64_t rsvd2;
+};
+
+static phandle_t cpu_of_nodes[MAXCPU];
+static device_t picmap[MAXCPU];
+
+int
+platform_processor_id(void)
+{
+   int cpu;
+
+   cpu = beri_get_cpu();
+
+   return (cpu);
+}
+
+void
+platform_cpu_mask(cpuset_t *mask)
+{
+   int ncores, ncpus, nthreads;
+   phandle_t cpus, cpu;
+   pcell_t reg;
+   char prop[16];
+   struct spin_entry *se;
+
+   ncores = beri_get_ncores();
+   nthreads = beri_get_nthreads();
+   KASSERT(ncores <= 0x1, ("%s: too many cores %d", __func__, ncores));
+   KASSERT(nthreads <= 0x1, ("%s: too many threads %d", __func__,
+   nthreads));
+   KASSERT(ncores < 0x || nthreads < 0x,
+   ("%s: cores x thread (%d x %d) would overflow", __func__, ncores,
+   nthreads));
+   ncpus = ncores * nthreads;
+   if (MAXCPU > 1 && ncpus > MAXCPU)
+   printf("%s: Hardware supports more CPUs (%d) than kernel 
(%d)\n",
+   __func__, ncpus, MAXCPU);
+   printf("%s: hardware has %d cores with %d threads each\n", __func__,
+   ncores, nthreads);
+
+   if ((cpus = OF_finddevice("/cpus")) <= 0) {
+   printf("%s: no \"/cpus\" device found in FDT\n", __func__);
+   goto error;
+   }
+   if ((cpu = OF_child(cpus)) <= 0) {
+   printf("%s: no children of \"/cpus\" found in FDT\n", __func__);
+   goto error;
+   }
+   CPU_ZERO(mask);
+   do {
+   if (OF_getprop(cpu, "reg", , sizeof(reg)) <= 0) {
+   printf("%s: cpu device with no reg property\n",
+   __func__);

svn commit: r332440 - head/usr.bin/mkimg

2018-04-12 Thread Benno Rice
Author: benno
Date: Thu Apr 12 17:16:13 2018
New Revision: 332440
URL: https://svnweb.freebsd.org/changeset/base/332440

Log:
  Fix a conditional that got mucked up.
  
  Sponsored by: iXsystems, Inc.

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

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Thu Apr 12 17:05:27 2018(r332439)
+++ head/usr.bin/mkimg/mkimg.c  Thu Apr 12 17:16:13 2018(r332440)
@@ -464,10 +464,10 @@ mkimg(void)
if (expand_number(size, ) == -1)
error = errno;
if (offset != NULL) {
-   if (*offset != '+') {
+   if (*offset != '+')
abs_offset = true;
+   else
offset++;
-   }
if (expand_number(offset, ) == -1)
error = errno;
}
___
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: r332439 - head/lib/libc/gen

2018-04-12 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Apr 12 17:05:27 2018
New Revision: 332439
URL: https://svnweb.freebsd.org/changeset/base/332439

Log:
  Fix quotes in the example code in syslog(3) BUGS section
  
  mdoc treats verbatim quotes in .Dl as a string delimiter and does
  not pass them to the rendered output. Use special char \*q to specify
  double quote
  
  PR:   216755
  MFC after:3 days

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

Modified: head/lib/libc/gen/syslog.3
==
--- head/lib/libc/gen/syslog.3  Thu Apr 12 17:00:36 2018(r332438)
+++ head/lib/libc/gen/syslog.3  Thu Apr 12 17:05:27 2018(r332439)
@@ -295,4 +295,4 @@ for later interpolation by
 .Pp
 Always use the proper secure idiom:
 .Pp
-.Dl syslog(priority, "%s", string);
+.Dl syslog(priority, \*q%s\*q, 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: r332438 - head/usr.bin/etdump

2018-04-12 Thread Benno Rice
Author: benno
Date: Thu Apr 12 17:00:36 2018
New Revision: 332438
URL: https://svnweb.freebsd.org/changeset/base/332438

Log:
  Remove a debugging printf that crept in.
  
  Sponsored by: iXsystems, Inc.

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

Modified: head/usr.bin/etdump/etdump.c
==
--- head/usr.bin/etdump/etdump.cThu Apr 12 15:50:19 2018
(r332437)
+++ head/usr.bin/etdump/etdump.cThu Apr 12 17:00:36 2018
(r332438)
@@ -257,7 +257,6 @@ main(int argc, char **argv)
argv += optind;
 
for (i = 0; i < argc; i++) {
-   printf("%d %s\n", optind, argv[i]);
if (strcmp(argv[i], "-") == 0) {
iso = stdin;
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332434 - head/sys/conf

2018-04-12 Thread John Baldwin
On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote:
> Author: br
> Date: Thu Apr 12 15:12:40 2018
> New Revision: 332434
> URL: https://svnweb.freebsd.org/changeset/base/332434
> 
> Log:
>   Add ld emulation types for hard-float mipses.
>   
>   Sponsored by:   DARPA, AFRL

We actually shouldn't need hf kernels anymore.  HAVE_FPU has been removed
and any mips kernel works fine with either hard or soft float userlands.

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


Re: svn commit: r332091 - stable/11/sys/vm

2018-04-12 Thread John Baldwin
On Thursday, April 12, 2018 12:49:35 AM Slawa Olhovchenkov wrote:
> On Wed, Apr 11, 2018 at 02:27:48PM -0700, John Baldwin wrote:
> 
> > On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote:
> > > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote:
> > > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote:
> > > > > On Fri, Apr 06, 2018 at 09:25:08AM +, Konstantin Belousov wrote:
> > > > > 
> > > > > > Author: kib
> > > > > > Date: Fri Apr  6 09:25:08 2018
> > > > > > New Revision: 332091
> > > > > > URL: https://svnweb.freebsd.org/changeset/base/332091
> > > > > > 
> > > > > > Log:
> > > > > >   MFC r331760:
> > > > > >   Make vm_map_max/min/pmap KBI stable.
> > > > > > 
> > > > > > Modified:
> > > > > >   stable/11/sys/vm/vm_map.c
> > > > > >   stable/11/sys/vm/vm_map.h
> > > > > > Directory Properties:
> > > > > >   stable/11/   (props changed)
> > > > > 
> > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE
> > > > > nvidia (build on 11.1-RELEASE) also don't work
> > > > 
> > > > Yes, this only helps with the future KBI, it doesn't restore the
> > > > existing one.  However, r320889 which was committed earlier should
> > > > have restored the KBI?
> > > 
> > > I am not sure.  It might have, but there might be more breakage
> > > accumulated.  My current opinion is that both vbox and nvidia (as well as
> > > in-tree and out of tree drm modules) must be marked as tied.  The modules
> > > definitely depends on much more kernel interfaces than a typical HBA or
> > > network controller driver, for which the stability claim is actually
> > > intended to apply.
> > 
> > I do think virtualbox is probably too hard to make work, but I didn't think
> > the nvidia driver was that bad.
> > 
> > I think that for kmods in ports we should consider moving to a different 
> > model
> > than we currently do where the port installs the source for the kernel
> > module to a standard location and we could have a way to rebuild all of the
> > modules as needed.  This would permit us to provide PORTS_MODULES-type
> > functionality via either ports or packages (and it is a bit more flexible as
> > you wouldn't to deinstall/reinstall the package each time you just wanted to
> > rebuild the kernel module).
> > 
> > I would suggest something like /usr/local/src/modules/ and a
> > 'LOCAL_MODULES' kernel option that is a list of ' ' to replace
> > PORTS_MODULES.  A package could still ship an initial module by default, but
> > recompiling the module would either overwrite it, or if the module is built 
> > as
> > part of the kernel (via LOCAL_MODULES) the new one would be installed with 
> > the
> > kernel itself into /boot/kernel leaving the one from the package in
> > /boot/modules.  For tied modules we could simply build it with a strict
> > MODULE_DEPEND line on the kernel so that the pre-built module won't load on
> > newer kernels and then encourage the user to use LOCAL_MODULES in 
> > pkg-message.
> > Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if 
> > you
> > move kernel to kernel.old during an upgrade, etc.
> 
> Hmm, what about packages? I am use nvidia driver as package.

Yes, in this model, the package would include the necessary sources to rebuild
the kernel module as part of the package, installed to 
/usr/local/src/modules/nvidia-driver
or some such.  The package could still install a pre-built module to
/boot/modules/nvidia-driver.ko, but if you had 'options 
LOCAL_MODULES="nivida-driver"
in your kernel config, then each time you built a kernel it would build an
nvidia-driver.ko from /usr/local/src/modules/nvidia-driver that would be
installed to /boot/kernel and would thus take precedence over the version in
/boot/modules.  For kernel modules that really need to be tied to the current
kernel we would recommend using LOCAL_MODULES when using custom kernels in the
pkg-message.

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


svn commit: r332437 - head/usr.bin/etdump

2018-04-12 Thread Benno Rice
Author: benno
Date: Thu Apr 12 15:50:19 2018
New Revision: 332437
URL: https://svnweb.freebsd.org/changeset/base/332437

Log:
  Check the return value of fseek.
  
  Reported by:  Coverity
  CID:  1388267
  Sponsored by: iXsystems, Inc.

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

Modified: head/usr.bin/etdump/etdump.c
==
--- head/usr.bin/etdump/etdump.cThu Apr 12 15:47:47 2018
(r332436)
+++ head/usr.bin/etdump/etdump.cThu Apr 12 15:50:19 2018
(r332437)
@@ -80,7 +80,9 @@ static int
 read_sector(FILE *iso, daddr_t sector, char *buffer)
 {
 
-   fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET);
+   if (fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET) != 0) {
+   return (errno);
+   }
if (fread(buffer, ISO_DEFAULT_BLOCK_SIZE, 1, iso) != 1) {
return (errno);
}
___
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: r332436 - head/usr.bin/mkimg

2018-04-12 Thread Benno Rice
Author: benno
Date: Thu Apr 12 15:47:47 2018
New Revision: 332436
URL: https://svnweb.freebsd.org/changeset/base/332436

Log:
  Add the ability to specify absolute and relative offsets to size partitions.
  
  To create hybrid boot media we want to specify a partition at a known 
location.
  This extends the syntax of size partitions to include an optional offset that
  can be absolute or relative. It also introduces validation to make sure that
  this hasn't resulted in overlapping partitions. I haven't added this to the
  file and process partition specifications yet but the mechanics are designed
  such that if someone comes up with a good way of specifying the offset it
  will be fairly easy to add in.
  
  Reviewed by:  imp
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D14916

Modified:
  head/usr.bin/mkimg/mkimg.c
  head/usr.bin/mkimg/scheme.h

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Thu Apr 12 15:36:24 2018(r332435)
+++ head/usr.bin/mkimg/mkimg.c  Thu Apr 12 15:47:47 2018(r332436)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -170,13 +171,14 @@ usage(const char *why)
print_schemes(1);
fputc('\n', stderr);
fprintf(stderr, "partition specification:\n");
-   fprintf(stderr, "\t[/]::\t-  empty partition of given "
-   "size\n");
-   fprintf(stderr, "\t[/]:=\t-  partition content and size "
-   "are determined\n\t\t\t\t   by the named file\n");
-   fprintf(stderr, "\t[/]:-\t-  partition content and size "
-   "are taken from\n\t\t\t\t   the output of the command to run\n");
-   fprintf(stderr, "\t-\t\t\t-  unused partition entry\n");
+   fprintf(stderr, "\t[/]::[:[+]]\t-  "
+   "empty partition of given size and\n\t\t\t\t\t"
+   "   optional relative or absolute offset\n");
+   fprintf(stderr, "\t[/]:=\t\t-  partition content and size "
+   "are\n\t\t\t\t\t   determined by the named file\n");
+   fprintf(stderr, "\t[/]:-\t\t-  partition content and size "
+   "are taken\n\t\t\t\t\t   from the output of the command to run\n");
+   fprintf(stderr, "\t-\t\t\t\t-  unused partition entry\n");
fprintf(stderr, "\twhere:\n");
fprintf(stderr, "\t\t\t-  scheme neutral partition type\n");
fprintf(stderr, "\t\t\t-  optional scheme-dependent partition "
@@ -397,12 +399,48 @@ capacity_resize(lba_t end)
 }
 
 static void
+mkimg_validate(void)
+{
+   struct part *part, *part2;
+   lba_t start, end, start2, end2;
+   int i, j;
+
+   i = 0;
+
+   TAILQ_FOREACH(part, , link) {
+   start = part->block;
+   end = part->block + part->size;
+   j = i + 1;
+   part2 = TAILQ_NEXT(part, link);
+   if (part2 == NULL)
+   break;
+
+   TAILQ_FOREACH_FROM(part2, , link) {
+   start2 = part2->block;
+   end2 = part2->block + part2->size;
+
+   if ((start >= start2 && start < end2) ||
+   (end > start2 && end <= end2)) {
+   errx(1, "partition %d overlaps partition %d",
+   i, j);
+   }
+
+   j++;
+   }
+
+   i++;
+   }
+}
+
+static void
 mkimg(void)
 {
FILE *fp;
struct part *part;
-   lba_t block;
-   off_t bytesize;
+   lba_t block, blkoffset;
+   off_t bytesize, byteoffset;
+   char *size, *offset;
+   bool abs_offset;
int error, fd;
 
/* First check partition information */
@@ -413,17 +451,46 @@ mkimg(void)
}
 
block = scheme_metadata(SCHEME_META_IMG_START, 0);
+   abs_offset = false;
TAILQ_FOREACH(part, , link) {
-   block = scheme_metadata(SCHEME_META_PART_BEFORE, block);
-   if (verbose)
-   fprintf(stderr, "partition %d: starting block %llu "
-   "... ", part->index + 1, (long long)block);
-   part->block = block;
+   byteoffset = blkoffset = 0;
+   abs_offset = false;
+
+   /* Look for an offset. Set size too if we can. */
switch (part->kind) {
case PART_KIND_SIZE:
-   if (expand_number(part->contents, ) == -1)
+   offset = part->contents;
+   size = strsep(, ":");
+   if (expand_number(size, ) == -1)
error = errno;
+   if (offset != NULL) {
+   if (*offset != '+') {
+   abs_offset = true;
+ 

svn commit: r332435 - in head/sys: conf dev/xdma mips/ingenic

2018-04-12 Thread Ruslan Bukin
Author: br
Date: Thu Apr 12 15:36:24 2018
New Revision: 332435
URL: https://svnweb.freebsd.org/changeset/base/332435

Log:
  Tune xDMA interface slightly:
  o Move descriptors allocation to DMA engine driver
  o Add generic xdma_request() routine
  o Add less-generic scatter-gather application based on xdma interface
  
  Typical operation flow in peripheral device driver is:
  
  1. Get xDMA controller
  sc->xdma_tx = xdma_ofw_get(sc->dev, "tx");
  
  2. Allocate virtual channel
  sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps);
  
  3. Setup transfer status callback
  xdma_setup_intr(sc->xchan_tx, my_tx_intr, sc, >ih_tx);
  
  4. Request a transfer(s)
  ret = xdma_request(sc->xchan_tx, );
  
  5. Free the channel
  xdma_channel_free(sc->xdma_tx);
  
  6. Free the controller
  xdma_put(sc->xdma_tx);
  
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14971

Added:
  head/sys/dev/xdma/xdma_bank.c   (contents, props changed)
  head/sys/dev/xdma/xdma_bio.c   (contents, props changed)
  head/sys/dev/xdma/xdma_mbuf.c   (contents, props changed)
  head/sys/dev/xdma/xdma_queue.c   (contents, props changed)
  head/sys/dev/xdma/xdma_sg.c   (contents, props changed)
  head/sys/dev/xdma/xdma_sglist.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/xdma/xdma.c
  head/sys/dev/xdma/xdma.h
  head/sys/dev/xdma/xdma_fdt_test.c
  head/sys/dev/xdma/xdma_if.m
  head/sys/mips/ingenic/jz4780_aic.c
  head/sys/mips/ingenic/jz4780_pdma.c
  head/sys/mips/ingenic/jz4780_pdma.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Apr 12 15:12:40 2018(r332434)
+++ head/sys/conf/files Thu Apr 12 15:36:24 2018(r332435)
@@ -3511,8 +3511,14 @@ wpi.fw   optional wpifw  
\
no-obj no-implicit-rule \
clean   "wpi.fw"
 dev/xdma/xdma.coptional xdma
-dev/xdma/xdma_if.m optional xdma
+dev/xdma/xdma_bank.c   optional xdma
+dev/xdma/xdma_bio.coptional xdma
 dev/xdma/xdma_fdt_test.c   optional xdma xdma_test fdt
+dev/xdma/xdma_if.m optional xdma
+dev/xdma/xdma_mbuf.c   optional xdma
+dev/xdma/xdma_queue.c  optional xdma
+dev/xdma/xdma_sg.c optional xdma
+dev/xdma/xdma_sglist.c optional xdma
 dev/xe/if_xe.c optional xe
 dev/xe/if_xe_pccard.c  optional xe pccard
 dev/xen/balloon/balloon.c  optional xenhvm

Modified: head/sys/dev/xdma/xdma.c
==
--- head/sys/dev/xdma/xdma.cThu Apr 12 15:12:40 2018(r332434)
+++ head/sys/dev/xdma/xdma.cThu Apr 12 15:36:24 2018(r332435)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Ruslan Bukin 
+ * Copyright (c) 2016-2018 Ruslan Bukin 
  * All rights reserved.
  *
  * This software was developed by SRI International and the University of
@@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -58,40 +57,28 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework");
-
 /*
  * Multiple xDMA controllers may work with single DMA device,
  * so we have global lock for physical channel management.
  */
-static struct mtx xdma_mtx;
-#defineXDMA_LOCK() mtx_lock(_mtx)
-#defineXDMA_UNLOCK()   mtx_unlock(_mtx)
-#defineXDMA_ASSERT_LOCKED()mtx_assert(_mtx, MA_OWNED)
+static struct sx xdma_sx;
 
-/*
- * Per channel locks.
- */
-#defineXCHAN_LOCK(xchan)   mtx_lock(&(xchan)->mtx_lock)
-#defineXCHAN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_lock)
-#defineXCHAN_ASSERT_LOCKED(xchan)  mtx_assert(&(xchan)->mtx_lock, 
MA_OWNED)
+#defineXDMA_LOCK() sx_xlock(_sx)
+#defineXDMA_UNLOCK()   sx_xunlock(_sx)
+#defineXDMA_ASSERT_LOCKED()sx_xassert(_sx, MA_OWNED)
 
 /*
  * Allocate virtual xDMA channel.
  */
 xdma_channel_t *
-xdma_channel_alloc(xdma_controller_t *xdma)
+xdma_channel_alloc(xdma_controller_t *xdma, uint32_t caps)
 {
xdma_channel_t *xchan;
int ret;
 
xchan = malloc(sizeof(xdma_channel_t), M_XDMA, M_WAITOK | M_ZERO);
-   if (xchan == NULL) {
-   device_printf(xdma->dev,
-   "%s: Can't allocate memory for channel.\n", __func__);
-   return (NULL);
-   }
xchan->xdma = xdma;
+   xchan->caps = caps;
 
XDMA_LOCK();
 
@@ -107,8 +94,18 @@ xdma_channel_alloc(xdma_controller_t *xdma)
}
 
TAILQ_INIT(>ie_handlers);
-   mtx_init(>mtx_lock, "xDMA", NULL, MTX_DEF);
 
+   sx_init(>sx_lock, "xDMA chan");
+   sx_init(>sx_qin_lock, 

svn commit: r332434 - head/sys/conf

2018-04-12 Thread Ruslan Bukin
Author: br
Date: Thu Apr 12 15:12:40 2018
New Revision: 332434
URL: https://svnweb.freebsd.org/changeset/base/332434

Log:
  Add ld emulation types for hard-float mipses.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Thu Apr 12 14:57:48 2018(r332433)
+++ head/sys/conf/kern.mk   Thu Apr 12 15:12:40 2018(r332434)
@@ -276,9 +276,13 @@ LD_EMULATION_armv6=armelf_fbsd
 LD_EMULATION_armv7=armelf_fbsd
 LD_EMULATION_i386=elf_i386_fbsd
 LD_EMULATION_mips= elf32btsmip_fbsd
+LD_EMULATION_mipshf= elf32btsmip_fbsd
 LD_EMULATION_mips64= elf64btsmip_fbsd
+LD_EMULATION_mips64hf= elf64btsmip_fbsd
 LD_EMULATION_mipsel= elf32ltsmip_fbsd
+LD_EMULATION_mipselhf= elf32ltsmip_fbsd
 LD_EMULATION_mips64el= elf64ltsmip_fbsd
+LD_EMULATION_mips64elhf= elf64ltsmip_fbsd
 LD_EMULATION_mipsn32= elf32btsmipn32_fbsd
 LD_EMULATION_mipsn32el= elf32btsmipn32_fbsd   # I don't think this is a thing 
that works
 LD_EMULATION_powerpc= elf32ppc_fbsd
___
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: r332433 - head/sys/sys

2018-04-12 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Apr 12 14:57:48 2018
New Revision: 332433
URL: https://svnweb.freebsd.org/changeset/base/332433

Log:
  Fix a typo.
  
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Thu Apr 12 14:35:37 2018(r332432)
+++ head/sys/sys/proc.h Thu Apr 12 14:57:48 2018(r332433)
@@ -668,7 +668,7 @@ struct proc {
struct racct*p_racct;   /* (b) Resource accounting. */
int p_throttled;/* (c) Flag for racct pcpu throttling */
/*
-* An orphan is the child that has beed re-parented to the
+* An orphan is the child that has been re-parented to the
 * debugger as a result of attaching to it.  Need to keep
 * track of them for parent to be able to collect the exit
 * status of what used to be children.
___
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: r332432 - head/sys/net

2018-04-12 Thread Sean Bruno
Author: sbruno
Date: Thu Apr 12 14:35:37 2018
New Revision: 332432
URL: https://svnweb.freebsd.org/changeset/base/332432

Log:
  Restore r332389 after resolution of locking fixes.
  
  Add one extra lock initialization to iflib_register() that was missed
  in the git<->phab conversion.
  
  Split out flag manipulation from general context manipulation in iflib
  
  To avoid blocking on the context lock in the swi thread and risk potential
  deadlocks, this change protects lighter weight updates that only need to
  be consistent with each other with their own lock.
  
  Submitted by:   Matthew Macy 
  Reviewed by:shurd
  Sponsored by:   Limelight Networks
  Differential Revision:  https://reviews.freebsd.org/D14967

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Apr 12 14:32:26 2018(r332431)
+++ head/sys/net/iflib.cThu Apr 12 14:35:37 2018(r332432)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014-2017, Matthew Macy 
+ * Copyright (c) 2014-2018, Matthew Macy 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -163,7 +163,8 @@ struct iflib_ctx {
if_shared_ctx_t ifc_sctx;
struct if_softc_ctx ifc_softc_ctx;
 
-   struct mtx ifc_mtx;
+   struct mtx ifc_ctx_mtx;
+   struct mtx ifc_state_mtx;
 
uint16_t ifc_nhwtxqs;
 
@@ -317,8 +318,10 @@ typedef struct iflib_sw_tx_desc_array {
 #defineIFC_INIT_DONE   0x020
 #defineIFC_PREFETCH0x040
 #defineIFC_DO_RESET0x080
-#defineIFC_CHECK_HUNG  0x100
+#defineIFC_DO_WATCHDOG 0x100
+#defineIFC_CHECK_HUNG  0x200
 
+
 #define CSUM_OFFLOAD   (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \
 CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \
 CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP)
@@ -534,13 +537,19 @@ rxd_info_zero(if_rxd_info_t ri)
 
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
-#define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
+#define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib 
ctx lock", MTX_DEF)
+#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx)
+#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx)
+#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx)
 
-#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx)
-#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx)
-#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx)
 
+#define STATE_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_state_mtx, _name, 
"iflib state lock", MTX_DEF)
+#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx)
+#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx)
+#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx)
 
+
+
 #define CALLOUT_LOCK(txq)  mtx_lock(>ift_mtx)
 #define CALLOUT_UNLOCK(txq)mtx_unlock(>ift_mtx)
 
@@ -2143,18 +2152,14 @@ iflib_timer(void *arg)
if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) 
callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
return;
-hung:
-   CTX_LOCK(ctx);
-   if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
+ hung:
device_printf(ctx->ifc_dev,  "TX(%d) desc avail = %d, pidx = %d\n",
  txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx);
-
-   IFDI_WATCHDOG_RESET(ctx);
-   ctx->ifc_watchdog_events++;
-
-   ctx->ifc_flags |= IFC_DO_RESET;
+   STATE_LOCK(ctx);
+   if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
+   ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET);
iflib_admin_intr_deferred(ctx);
-   CTX_UNLOCK(ctx);
+   STATE_UNLOCK(ctx);
 }
 
 static void
@@ -2672,10 +2677,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget)
return true;
return (iflib_rxd_avail(ctx, rxq, *cidxp, 1));
 err:
-   CTX_LOCK(ctx);
+   STATE_LOCK(ctx);
ctx->ifc_flags |= IFC_DO_RESET;
iflib_admin_intr_deferred(ctx);
-   CTX_UNLOCK(ctx);
+   STATE_UNLOCK(ctx);
return (false);
 }
 
@@ -3705,27 +3710,35 @@ _task_fn_admin(void *context)
if_softc_ctx_t sctx = >ifc_softc_ctx;
iflib_txq_t txq;
int i;
+   bool oactive, running, do_reset, do_watchdog;
 
-   if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) {
-   if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) {
-   return;
-   }
-   }
+   STATE_LOCK(ctx);
+   running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING);
+   oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE);
+   do_reset = (ctx->ifc_flags & 

svn commit: r332431 - head/usr.sbin/cron/cron

2018-04-12 Thread Kyle Evans
Author: kevans
Date: Thu Apr 12 14:32:26 2018
New Revision: 332431
URL: https://svnweb.freebsd.org/changeset/base/332431

Log:
  cron(8): Correct test sense
  
  We're about to use the result of fstat(2) either way, so don't do that if it
  fails...
  
  X-MFC-With: r332429

Modified:
  head/usr.sbin/cron/cron/database.c

Modified: head/usr.sbin/cron/cron/database.c
==
--- head/usr.sbin/cron/cron/database.c  Thu Apr 12 14:05:27 2018
(r332430)
+++ head/usr.sbin/cron/cron/database.c  Thu Apr 12 14:32:26 2018
(r332431)
@@ -86,7 +86,7 @@ load_database(old_db)
if (dp->d_name[0] == '.')
continue;
ret = fstatat(dirfd(dir), dp->d_name, , 0);
-   if (ret == 0 && !S_ISREG(st.st_mode))
+   if (ret != 0 || !S_ISREG(st.st_mode))
continue;
maxmtime = TMAX(st.st_mtime, maxmtime);
}
___
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: r332430 - head/share/misc

2018-04-12 Thread Ram Kishore Vegesna
Author: ram
Date: Thu Apr 12 14:05:27 2018
New Revision: 332430
URL: https://svnweb.freebsd.org/changeset/base/332430

Log:
  Added entry in the correct section.
  
  Reported by: Rodney,kevans
  Approved by: ken

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Thu Apr 12 13:52:55 2018
(r332429)
+++ head/share/misc/committers-src.dot  Thu Apr 12 14:05:27 2018
(r332430)
@@ -76,7 +76,6 @@ nate [label="Nate Willams\nn...@freebsd.org\n1993/06/1
 njl [label="Nate Lawson\n...@freebsd.org\n2002/08/07\n2008/02/16"]
 non [label="Noriaki Mitsnaga\n...@freebsd.org\n2000/06/19\n2007/03/06"]
 onoe [label="Atsushi Onoe\no...@freebsd.org\n2000/07/21\n2008/11/10"]
-ram [label="Ram Kishore Vegesna\n...@freebsd.org\n2018/04/04\n???/??/??"]
 rafan [label="Rong-En Fan\nra...@freebsd.org\n2007/01/31\n2012/07/23"]
 randi [label="Randi Harper\nra...@freebsd.org\n2010/04/20\n2012/05/10"]
 rink [label="Rink Springer\nr...@freebsd.org\n2006/01/16\n2010/11/04"]
@@ -283,6 +282,7 @@ pkelsey [label="Patrick Kelsey\pkel...@freebsd.org\n20
 pluknet [label="Sergey Kandaurov\npluk...@freebsd.org\n2010/10/05"]
 ps [label="Paul Saab\n...@freebsd.org\n2000/02/23"]
 qingli [label="Qing Li\nqin...@freebsd.org\n2005/04/13"]
+ram [label="Ram Kishore Vegesna\n...@freebsd.org\n2018/04/04"]
 ray [label="Aleksandr Rybalko\n...@freebsd.org\n2011/05/25"]
 rdivacky [label="Roman Divacky\nrdiva...@freebsd.org\n2008/03/13"]
 remko [label="Remko Lodder\nre...@freebsd.org\n2007/02/23"]
___
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: r332429 - head/usr.sbin/cron/cron

2018-04-12 Thread Kyle Evans
Author: kevans
Date: Thu Apr 12 13:52:55 2018
New Revision: 332429
URL: https://svnweb.freebsd.org/changeset/base/332429

Log:
  cron(8): Reload database if an existing job in cron.d changed as well
  
  Directory mtime will only change if a file is added or removed, not
  modified. For /var/cron/tabs, this is fine because of how crontab(1) manages
  it using temp files so all crontab(1) changes will trigger a reload of the
  database.
  
  For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case.
  Instead of checking their mtime, we should descend into them and check mtime
  on all jobs also.
  
  Reported by:  des
  Reviewed by:  bapt
  MFC after:1 week

Modified:
  head/usr.sbin/cron/cron/database.c

Modified: head/usr.sbin/cron/cron/database.c
==
--- head/usr.sbin/cron/cron/database.c  Thu Apr 12 13:40:02 2018
(r332428)
+++ head/usr.sbin/cron/cron/database.c  Thu Apr 12 13:52:55 2018
(r332429)
@@ -56,7 +56,7 @@ load_database(old_db)
{ SYSCRONTABS },
{ LOCALSYSCRONTABS }
};
-   int i;
+   int i, ret;
 
Debug(DLOAD, ("[%d] load_database()\n", getpid()))
 
@@ -79,6 +79,18 @@ load_database(old_db)
for (i = 0; i < nitems(syscrontabs); i++) {
if (stat(syscrontabs[i].name, [i].st) != -1) {
maxmtime = TMAX(syscrontabs[i].st.st_mtime, maxmtime);
+   /* Traverse into directory */
+   if (!(dir = opendir(syscrontabs[i].name)))
+   continue;
+   while (NULL != (dp = readdir(dir))) {
+   if (dp->d_name[0] == '.')
+   continue;
+   ret = fstatat(dirfd(dir), dp->d_name, , 0);
+   if (ret == 0 && !S_ISREG(st.st_mode))
+   continue;
+   maxmtime = TMAX(st.st_mtime, maxmtime);
+   }
+   closedir(dir);
} else {
syscrontabs[i].st.st_mtime = 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: r332428 - stable/11/sys/amd64/ia32

2018-04-12 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 12 13:40:02 2018
New Revision: 332428
URL: https://svnweb.freebsd.org/changeset/base/332428

Log:
  MFC r332061:
  Fix ERESTART for lcall $7,$0 syscalls.

Modified:
  stable/11/sys/amd64/ia32/ia32_syscall.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/ia32/ia32_syscall.c
==
--- stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:39:01 2018
(r332427)
+++ stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:40:02 2018
(r332428)
@@ -144,6 +144,7 @@ ia32_fetch_syscall_args(struct thread *td)
frame->tf_rip = eip;
frame->tf_cs = cs;
frame->tf_rsp += 2 * sizeof(u_int32_t);
+   frame->tf_err = 7;  /* size of lcall $7,$0 */
}
 #endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332427 - stable/11/sys/amd64/amd64

2018-04-12 Thread Konstantin Belousov
Author: kib
Date: Thu Apr 12 13:39:01 2018
New Revision: 332427
URL: https://svnweb.freebsd.org/changeset/base/332427

Log:
  MFC r332060:
  Make the INTO instruction operational in 32bit mode.

Modified:
  stable/11/sys/amd64/amd64/machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/machdep.c
==
--- stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 10:37:26 2018
(r332426)
+++ stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 13:39:01 2018
(r332427)
@@ -1644,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
setidt(IDT_BP, pti ? (bpt_pti) : (bpt), SDT_SYSIGT,
SEL_UPL, 0);
setidt(IDT_OF, pti ? (ofl_pti) : (ofl), SDT_SYSIGT,
-   SEL_KPL, 0);
+   SEL_UPL, 0);
setidt(IDT_BR, pti ? (bnd_pti) : (bnd), SDT_SYSIGT,
SEL_KPL, 0);
setidt(IDT_UD, pti ? (ill_pti) : (ill), SDT_SYSIGT,
___
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: r332386 - head/share/misc

2018-04-12 Thread Ram Kishore Vegesna via svn-src-all
oho, my bad added to the wrong section. Will fix and update.

Ken, I will send you the patch.

Thanks,
Ram

On Wed, Apr 11, 2018 at 7:57 PM, Kenneth D. Merry  wrote:

> On Tue, Apr 10, 2018 at 14:27:26 -0500, Kyle Evans wrote:
> > On Tue, Apr 10, 2018 at 2:22 PM, Rodney W. Grimes
> >  wrote:
> > > [ Charset UTF-8 unsupported, converting... ]
> > >> Author: ram
> > >> Date: Tue Apr 10 18:39:20 2018
> > >> New Revision: 332386
> > >> URL: https://svnweb.freebsd.org/changeset/base/332386
> > >>
> > >> Log:
> > >>   Updated mentors information.
> > >>
> > >>   Approved by: ken, mav
> > >>
> > >> Modified:
> > >>   head/share/misc/committers-src.dot
> > >>
> > >> Modified: head/share/misc/committers-src.dot
> > >> 
> ==
> > >> --- head/share/misc/committers-src.dotTue Apr 10 18:05:02
> 2018(r332385)
> > >> +++ head/share/misc/committers-src.dotTue Apr 10 18:39:20
> 2018(r332386)
> > >> @@ -76,6 +76,7 @@ nate [label="Nate Willams\nn...@freebsd.org\
> n1993/06/1
> > >>  njl [label="Nate Lawson\n...@freebsd.org\n2002/08/07\n2008/02/16"]
> > >>  non [label="Noriaki Mitsnaga\n...@freebsd.org\
> n2000/06/19\n2007/03/06"]
> > >>  onoe [label="Atsushi Onoe\no...@freebsd.org\n2000/
> 07/21\n2008/11/10"]
> > >> +ram [label="Ram Kishore Vegesna\n...@freebsd.org\
> n2018/04/04\n???/??/??"]
> > >
> ^
> > > That should be removed, you only have a start date.
> > > Oh and Welcome ram to the project!
> > >
> >
> > The entry is also smack dab in the middle of the alumni section,
> > rather than the later 'active' section. =)
>
> Oops.  My fault for not paying attention. :(
>
> Pointy hat to:  ken
>
> Ram, could you fix this and send me the diffs for approval before you
> commit it?
>
> Thanks,
>
> Ken
> --
> Kenneth Merry
> k...@freebsd.org
>
___
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: r332426 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs s...

2018-04-12 Thread Andriy Gapon
Author: avg
Date: Thu Apr 12 10:37:26 2018
New Revision: 332426
URL: https://svnweb.freebsd.org/changeset/base/332426

Log:
  allow ZFS pool to have temporary name for duration of current import
  
  The change adds -t  option to zpool create and -t option to zpool
  import in its form with an old name and a new name.  This allows to
  import (or create) a pool under a name that's different from its real,
  permanent name without affecting that name.  This is useful when working
  with VM images or images of other physical systems if they happen to
  have a ZFS pool with the same name as the host system.
  
  The changes come from ZoL with some small tweaks.
  The porting has been done by julian.
  
  The change is being submitted to OpenZFS:
  https://github.com/openzfs/openzfs/pull/600
  
  Submitted by: julian
  Reviewed by:  smh
  MFC after:2 weeks
  Sponsored by: Panzura (porting)
  Differential Revision: https://reviews.freebsd.org/D14972

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 12 07:39:24 
2018(r332425)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 12 10:37:26 
2018(r332426)
@@ -62,6 +62,7 @@
 .Ar ...
 .Op Fl m Ar mountpoint
 .Op Fl R Ar root
+.Op Fl t Ar tempname
 .Ar pool vdev ...
 .Nm
 .Cm destroy
@@ -115,6 +116,7 @@
 .Op Fl m
 .Op Fl N
 .Op Fl R Ar root
+.Op Fl t
 .Op Fl F Op Fl n
 .Ar pool | id
 .Op Ar newpool
@@ -961,6 +963,7 @@ do not actually discard any transactions.
 .Ar ...
 .Op Fl m Ar mountpoint
 .Op Fl R Ar root
+.Op Fl t Ar tempname
 .Ar pool vdev ...
 .Xc
 .Pp
@@ -1062,6 +1065,18 @@ or
 .Qq Cm none .
 For more information on dataset mount points, see
 .Xr zfs 8 .
+.It Fl t Ar tempname
+Sets the in-core pool name to
+.Pa tempname
+while the on-disk name will be the name specified as the pool name
+.Pa pool .
+This will set the default
+.Sy cachefile
+property to
+.Sy none .
+This is intended to handle name space collisions when creating pools
+for other systems, such as virtual machines or physical machines
+whose pools live on network block devices.
 .El
 .It Xo
 .Nm
@@ -1316,6 +1331,7 @@ Searches for and imports all pools found.
 .Op Fl m
 .Op Fl N
 .Op Fl R Ar root
+.Op Fl t
 .Op Fl F Op Fl n
 .Ar pool | id
 .Op Ar newpool
@@ -1375,6 +1391,20 @@ Import the pool without mounting any file systems.
 .It Fl R Ar root
 Equivalent to
 .Qq Fl o Cm cachefile=none,altroot= Ns Pa root
+.It Fl t
+Used with
+.Ar newpool .
+Specifies that
+.Ar newpool
+is temporary.
+Temporary pool names last until export.
+Ensures that the original pool name will be used in all label updates and
+therefore is retained upon export.
+Will also set
+.Sy cachefile
+property to
+.Sy none
+when not explicitly specified.
 .It Fl F
 Recovery mode for a non-importable pool. Attempt to return the pool to an
 importable state by discarding the last few transactions. Not all damaged pools

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Apr 12 
07:39:24 2018(r332425)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Apr 12 
10:37:26 2018(r332426)
@@ -220,8 +220,9 @@ get_usage(zpool_help_t idx)
case HELP_CREATE:
return (gettext("\tcreate [-fnd] [-B] "
"[-o property=value] ... \n"
-   "\t[-O file-system-property=value] ... \n"
-   "\t[-m mountpoint] [-R root]   ...\n"));
+   "\t[-O file-system-property=value] ...\n"
+   "\t[-m mountpoint] [-R root] [-t tempname] "
+   "  ...\n"));
case HELP_CHECKPOINT:
return (gettext("\tcheckpoint [--discard]  ...\n"));
case HELP_DESTROY:
@@ -239,7 +240,7 @@ get_usage(zpool_help_t idx)
"[-R root] [-F [-n]] -a\n"
"\timport [-o mntopts] [-o property=value] ... \n"
"\t[-d dir | -c cachefile] [-D] [-f] [-m] [-N] "
-   "[-R root] [-F [-n]]\n"
+   "[-R root] [-F [-n]] [-t]\n"
"\t[--rewind-to-checkpoint]  [newpool]\n"));
case HELP_IOSTAT:
return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
@@ -489,6 +490,21 @@ add_prop_list(const char *propname, char *propval, nvl
 }
 

svn commit: r332425 - head/share/misc

2018-04-12 Thread Maxim Konovalov
Author: maxim
Date: Thu Apr 12 07:39:24 2018
New Revision: 332425
URL: https://svnweb.freebsd.org/changeset/base/332425

Log:
  o OpenBSD 6.3 and DragonFly BSD 5.2.0 releases added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Thu Apr 12 07:25:36 2018
(r332424)
+++ head/share/misc/bsd-family-tree Thu Apr 12 07:39:24 2018
(r332425)
@@ -367,6 +367,8 @@ FreeBSD 5.2   |  | |  
  | |  | |  |   |   |
  | |  | |  NetBSD 7.1.2|   |
  | |  | |  |   |   |
+ | |  | |  |  OpenBSD 6.3  |
+ | |  | |  |   |   DragonFly 5.2.0
  | |  | |  v   |   |
  | v  | |  |   |
  || |  |   |
@@ -739,6 +741,8 @@ DragonFly 5.0.1 2017-11-06 [DFB]
 DragonFly 5.0.22017-12-04 [DFB]
 NetBSD 7.1.1   2017-12-22 [NBD]
 NetBSD 7.1.2   2018-03-15 [NBD]
+OpenBSD 6.32018-04-02 [OBD]
+DragonFly 5.2.02018-04-10 [DFB]
 
 Bibliography
 
___
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: r332424 - head/share/misc

2018-04-12 Thread Tom Jones
Author: thj
Date: Thu Apr 12 07:25:36 2018
New Revision: 332424
URL: https://svnweb.freebsd.org/changeset/base/332424

Log:
  Add myself to committers-src.dot
  
  Approved by:  jtl (mentor)
  Differential Revision:https://reviews.freebsd.org/D15042

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Thu Apr 12 07:20:50 2018
(r332423)
+++ head/share/misc/committers-src.dot  Thu Apr 12 07:25:36 2018
(r332424)
@@ -328,6 +328,7 @@ suz [label="SUZUKI Shinsuke\n...@freebsd.org\n2002/03/
 syrinx [label="Shteryana Shopova\nsyr...@freebsd.org\n2006/10/07"]
 takawata [label="Takanori Watanabe\ntakaw...@freebsd.org\n2000/07/06"]
 theraven [label="David Chisnall\nthera...@freebsd.org\n2011/11/11"]
+thj [label="Tom Jones\n...@freebsd.org\n2018/04/07"]
 thompsa [label="Andrew Thompson\nthom...@freebsd.org\n2005/05/25"]
 ticso [label="Bernd Walter\nti...@freebsd.org\n2002/01/31"]
 tijl [label="Tijl Coosemans\nt...@freebsd.org\n2010/07/16"]
@@ -618,6 +619,8 @@ joerg -> jmg
 joerg -> le
 joerg -> netchild
 joerg -> schweikh
+
+jtl -> thj
 
 julian -> glebius
 julian -> davidxu
___
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: r332423 - in head/sys: conf dev/cxgbe dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net sys

2018-04-12 Thread Vincenzo Maffione
Author: vmaffione
Date: Thu Apr 12 07:20:50 2018
New Revision: 332423
URL: https://svnweb.freebsd.org/changeset/base/332423

Log:
  netmap: align codebase to the current upstream (commit id 3fb001303718146)
  
  Changelist:
  - Turn tx_rings and rx_rings arrays into arrays of pointers to kring
structs. This patch includes fixes for ixv, ixl, ix, re, cxgbe, iflib,
vtnet and ptnet drivers to cope with the change.
  - Generalize the nm_config() callback to accept a struct containing many
parameters.
  - Introduce NKR_FAKERING to support buffers sharing (used for netmap
pipes)
  - Improved API for external VALE modules.
  - Various bug fixes and improvements to the netmap memory allocator,
including support for externally (userspace) allocated memory.
  - Refactoring of netmap pipes: now linked rings share the same netmap
buffers, with a separate set of kring pointers (rhead, rcur, rtail).
Buffer swapping does not need to happen anymore.
  - Large refactoring of the control API towards an extensible solution;
the goal is to allow the addition of more commands and extension of
existing ones (with new options) without the need of hacks or the
risk of running out of configuration space.
A new NIOCCTRL ioctl has been added to handle all the requests of the
new control API, which cover all the functionalities so far supported.
The netmap API bumps from 11 to 12 with this patch. Full backward
compatibility is provided for the old control command (NIOCREGIF), by
means of a new netmap_legacy module. Many parts of the old netmap.h
header has now been moved to netmap_legacy.h (included by netmap.h).
  
  Approved by:  hrs (mentor)

Added:
  head/sys/dev/netmap/netmap_legacy.c   (contents, props changed)
  head/sys/net/netmap_legacy.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/cxgbe/t4_netmap.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/netmap/if_ptnet.c
  head/sys/dev/netmap/if_re_netmap.h
  head/sys/dev/netmap/if_vtnet_netmap.h
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_freebsd.c
  head/sys/dev/netmap/netmap_generic.c
  head/sys/dev/netmap/netmap_kern.h
  head/sys/dev/netmap/netmap_mem2.c
  head/sys/dev/netmap/netmap_mem2.h
  head/sys/dev/netmap/netmap_monitor.c
  head/sys/dev/netmap/netmap_pipe.c
  head/sys/dev/netmap/netmap_pt.c
  head/sys/dev/netmap/netmap_vale.c
  head/sys/dev/re/if_re.c
  head/sys/modules/netmap/Makefile
  head/sys/net/iflib.c
  head/sys/net/netmap.h
  head/sys/net/netmap_user.h
  head/sys/net/netmap_virt.h
  head/sys/sys/param.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Apr 12 04:11:37 2018(r332422)
+++ head/sys/conf/files Thu Apr 12 07:20:50 2018(r332423)
@@ -2535,6 +2535,7 @@ dev/netmap/netmap_offloadings.c   optional netmap
 dev/netmap/netmap_pipe.c   optional netmap
 dev/netmap/netmap_pt.c optional netmap
 dev/netmap/netmap_vale.c   optional netmap
+dev/netmap/netmap_legacy.c optional netmap
 # compile-with "${NORMAL_C} -Wconversion -Wextra"
 dev/nfsmb/nfsmb.c  optional nfsmb pci
 dev/nge/if_nge.c   optional nge

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Thu Apr 12 04:11:37 2018
(r332422)
+++ head/sys/dev/cxgbe/t4_netmap.c  Thu Apr 12 07:20:50 2018
(r332423)
@@ -344,7 +344,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi
for_each_nm_rxq(vi, i, nm_rxq) {
struct irq *irq = >irq[vi->first_intr + i];
 
-   kring = >rx_rings[nm_rxq->nid];
+   kring = na->rx_rings[nm_rxq->nid];
if (!nm_kring_pending_on(kring) ||
nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID)
continue;
@@ -375,7 +375,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi
}
 
for_each_nm_txq(vi, i, nm_txq) {
-   kring = >tx_rings[nm_txq->nid];
+   kring = na->tx_rings[nm_txq->nid];
if (!nm_kring_pending_on(kring) ||
nm_txq->cntxt_id != INVALID_NM_TXQ_CNTXT_ID)
continue;
@@ -427,7 +427,7 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v
for_each_nm_txq(vi, i, nm_txq) {
struct sge_qstat *spg = (void *)_txq->desc[nm_txq->sidx];
 
-   kring = >tx_rings[nm_txq->nid];
+   kring = na->tx_rings[nm_txq->nid];
if (!nm_kring_pending_off(kring) ||
nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID)
continue;
@@ -445,7 +445,7 @@ cxgbe_netmap_off(struct adapter *sc,