svn commit: r330641 - stable/11/sys/dev/vt

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:57:26 2018
New Revision: 330641
URL: https://svnweb.freebsd.org/changeset/base/330641

Log:
  MFC r326599:
  
  Implement "vidcontrol -h " for vt(4)
  
  PR:   210415

Modified:
  stable/11/sys/dev/vt/vt.h
  stable/11/sys/dev/vt/vt_buf.c
  stable/11/sys/dev/vt/vt_core.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/vt/vt.h
==
--- stable/11/sys/dev/vt/vt.h   Thu Mar  8 07:55:03 2018(r330640)
+++ stable/11/sys/dev/vt/vt.h   Thu Mar  8 07:57:26 2018(r330641)
@@ -194,8 +194,8 @@ struct vt_buf {
 #defineVBF_SCROLL  0x8 /* scroll locked mode. */
 #defineVBF_HISTORY_FULL 0x10   /* All rows filled. */
unsigned int vb_history_size;
-   int  vb_roffset;/* (b) History rows offset. */
-   int  vb_curroffset; /* (b) Saved rows offset. */
+   unsigned int vb_roffset;/* (b) History rows offset. */
+   unsigned int vb_curroffset; /* (b) Saved rows offset. */
term_pos_t   vb_cursor; /* (u) Cursor position. */
term_pos_t   vb_mark_start; /* (b) Copy region start. */
term_pos_t   vb_mark_end;   /* (b) Copy region end. */
@@ -221,7 +221,7 @@ void vtbuf_cursor_position(struct vt_buf *, const term
 void vtbuf_scroll_mode(struct vt_buf *vb, int yes);
 void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area);
 void vtbuf_undirty(struct vt_buf *, term_rect_t *);
-void vtbuf_sethistory_size(struct vt_buf *, int);
+void vtbuf_sethistory_size(struct vt_buf *, unsigned int);
 int vtbuf_iscursor(const struct vt_buf *vb, int row, int col);
 void vtbuf_cursor_visibility(struct vt_buf *, int);
 #ifndef SC_NO_CUTPASTE

Modified: stable/11/sys/dev/vt/vt_buf.c
==
--- stable/11/sys/dev/vt/vt_buf.c   Thu Mar  8 07:55:03 2018
(r330640)
+++ stable/11/sys/dev/vt/vt_buf.c   Thu Mar  8 07:57:26 2018
(r330641)
@@ -132,11 +132,10 @@ vthistory_addlines(struct vt_buf *vb, int offset)
 #endif
 
vb->vb_curroffset += offset;
-   if (vb->vb_curroffset < 0)
-   vb->vb_curroffset = 0;
-   if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size)
+   if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size) {
vb->vb_flags |= VBF_HISTORY_FULL;
-   vb->vb_curroffset %= vb->vb_history_size;
+   vb->vb_curroffset %= vb->vb_history_size;
+   }
if ((vb->vb_flags & VBF_SCROLL) == 0) {
vb->vb_roffset = vb->vb_curroffset;
}
@@ -458,7 +457,7 @@ vtbuf_init(struct vt_buf *vb, const term_pos_t *p)
 }
 
 void
-vtbuf_sethistory_size(struct vt_buf *vb, int size)
+vtbuf_sethistory_size(struct vt_buf *vb, unsigned int size)
 {
term_pos_t p;
 
@@ -472,9 +471,9 @@ void
 vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, unsigned int history_size)
 {
term_char_t *old, *new, **rows, **oldrows, **copyrows, *row, *oldrow;
-   int bufsize, rowssize, w, h, c, r, history_was_full;
-   unsigned int old_history_size;
-   term_rect_t rect;
+   unsigned int w, h, c, r, old_history_size;
+   size_t bufsize, rowssize;
+   int history_full;
 
history_size = MAX(history_size, p->tp_row);
 
@@ -493,7 +492,8 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns
w = vb->vb_scr_size.tp_col;
h = vb->vb_scr_size.tp_row;
old_history_size = vb->vb_history_size;
-   history_was_full = vb->vb_flags & VBF_HISTORY_FULL;
+   history_full = vb->vb_flags & VBF_HISTORY_FULL ||
+   vb->vb_curroffset + h >= history_size;
 
vb->vb_history_size = history_size;
vb->vb_buffer = new;
@@ -502,20 +502,16 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns
vb->vb_scr_size = *p;
vtbuf_init_rows(vb);
 
-   /* Copy history and fill extra space if needed. */
+   /*
+* Copy rows to the new buffer. The first row in the history
+* is back to index 0, ie. the new buffer doesn't cycle.
+*/
if (history_size > old_history_size) {
-   /*
-* Copy rows to the new buffer. The first row in the history
-* is back to index 0, ie. the new buffer doesn't cycle.
-*
-* The rest of the new buffer is initialized with blank
-* content.
-*/
for (r = 0; r < old_history_size; r ++) {
row = rows[r];
 
/* Compute the corresponding row in the old buffer. */
-   if (history_was_full)
+   if (history_full)
/*
 * The buffer is 

svn commit: r330640 - stable/11/bin/cat

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:55:03 2018
New Revision: 330640
URL: https://svnweb.freebsd.org/changeset/base/330640

Log:
  MFC r327672:
  
  stddef.h is not used by cat.c, remove the include.

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

Modified: stable/11/bin/cat/cat.c
==
--- stable/11/bin/cat/cat.c Thu Mar  8 07:52:32 2018(r330639)
+++ stable/11/bin/cat/cat.c Thu Mar  8 07:55:03 2018(r330640)
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330639 - in stable/11/bin: cat date kenv setfacl sh

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:52:32 2018
New Revision: 330639
URL: https://svnweb.freebsd.org/changeset/base/330639

Log:
  MFC r326651:
  
  Fix mandoc -Tlint warnings in bin/
  
  Many style-level issues are still reported.

Modified:
  stable/11/bin/cat/cat.1
  stable/11/bin/date/date.1
  stable/11/bin/kenv/kenv.1
  stable/11/bin/setfacl/setfacl.1
  stable/11/bin/sh/sh.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/cat/cat.1
==
--- stable/11/bin/cat/cat.1 Thu Mar  8 07:50:11 2018(r330638)
+++ stable/11/bin/cat/cat.1 Thu Mar  8 07:52:32 2018(r330639)
@@ -195,8 +195,8 @@ utility appeared in
 .At v1 .
 .An Dennis Ritchie
 designed and wrote the first man page.
-It appears to have been
-.Xr cat 1 .
+It appears to have been for
+.Nm .
 .Sh BUGS
 Because of the shell language mechanism used to perform output
 redirection, the command

Modified: stable/11/bin/date/date.1
==
--- stable/11/bin/date/date.1   Thu Mar  8 07:50:11 2018(r330638)
+++ stable/11/bin/date/date.1   Thu Mar  8 07:52:32 2018(r330639)
@@ -131,7 +131,8 @@ The
 option suppresses this behavior and causes the time to be set only on the
 current machine.
 .It Fl R
-Use RFC 2822 date and time output format. This is equivalent to use
+Use RFC 2822 date and time output format.
+This is equivalent to using
 .Dq Li %a, %d %b %Y \&%T %z
 as
 .Ar output_fmt

Modified: stable/11/bin/kenv/kenv.1
==
--- stable/11/bin/kenv/kenv.1   Thu Mar  8 07:50:11 2018(r330638)
+++ stable/11/bin/kenv/kenv.1   Thu Mar  8 07:52:32 2018(r330639)
@@ -91,11 +91,17 @@ The file can contain lines of the form
 .Pp
 .Dl name = "value"  # this is a comment
 .Pp
-where whitespace around name and '=', and
-everything after a '#' character, are ignored.  Almost any printable
-character except '=' is acceptable as part of a name.  Quotes
-are optional and necessary only if the value contains
-whitespace.
+where whitespace around
+.Sq name
+and
+.Sq = ,
+and everything after a
+.Sq #
+character, are ignored.
+Almost any printable character except
+.Sq =
+is acceptable as part of a name.
+Quotes are optional and necessary only if the value contains whitespace.
 .Sh SEE ALSO
 .Xr kenv 2 ,
 .Xr config 5 ,

Modified: stable/11/bin/setfacl/setfacl.1
==
--- stable/11/bin/setfacl/setfacl.1 Thu Mar  8 07:50:11 2018
(r330638)
+++ stable/11/bin/setfacl/setfacl.1 Thu Mar  8 07:52:32 2018
(r330639)
@@ -114,7 +114,8 @@ is
 the input is taken from stdin.
 .It Fl n
 Do not recalculate the permissions associated with the ACL
-mask entry.  This option is not applicable to NFSv4 ACLs.
+mask entry.
+This option is not applicable to NFSv4 ACLs.
 .It Fl x Ar entries | position
 If
 .Ar entries
@@ -291,7 +292,8 @@ specifying the access granted to the owner of the file
 .Dq Li group@
 specifying the access granted to the file owning group;
 .Dq Li everyone@
-specifying everyone.  Note that
+specifying everyone.
+Note that
 .Dq Li everyone@
 is not the same as traditional Unix
 .Dq Li other
@@ -301,8 +303,8 @@ literally, everyone, including file owner and owning g
 The ACL qualifier field describes the user or group associated with
 the ACL entry.
 It may consist of one of the following: uid or
-user name, or gid or group name.  In entries whose tag type is
-one of
+user name, or gid or group name.
+In entries whose tag type is one of
 .Dq Li owner@ ,
 .Dq Li group@ ,
 or

Modified: stable/11/bin/sh/sh.1
==
--- stable/11/bin/sh/sh.1   Thu Mar  8 07:50:11 2018(r330638)
+++ stable/11/bin/sh/sh.1   Thu Mar  8 07:52:32 2018(r330639)
@@ -1033,7 +1033,7 @@ The syntax of the
 command is:
 .Bd -unfilled -offset indent -compact
 .Ic case Ar word Ic in
-.Ar pattern Ns ) Ar list Li ;;
+.Ar pattern ) Ar list Li ;;
 .Ar ...
 .Ic esac
 .Ed
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330638 - in stable/11/bin/cat: . tests

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:50:11 2018
New Revision: 330638
URL: https://svnweb.freebsd.org/changeset/base/330638

Log:
  MFC r323865:
  
  Ammend bin/cat/cat.c so the output is the same aside
  from blank lines being numbered or unnumbered, depending on whether cat
  was invoked with -ne or -be.
  
  At present, when cat is invoked with -be, there is an aditional
  difference that the '$' on blank lines is placed on the far left of the
  output.
  
  Discussed in bug 210607.
  
  While here, revert the workaround from r304035 which skipped the unit test for
  this issue previously.
  
  PR:   210607

Modified:
  stable/11/bin/cat/cat.c
  stable/11/bin/cat/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/cat/cat.c
==
--- stable/11/bin/cat/cat.c Thu Mar  8 07:17:20 2018(r330637)
+++ stable/11/bin/cat/cat.c Thu Mar  8 07:50:11 2018(r330638)
@@ -226,10 +226,16 @@ cook_cat(FILE *fp)
} else
gobble = 0;
}
-   if (nflag && (!bflag || ch != '\n')) {
-   (void)fprintf(stdout, "%6d\t", ++line);
-   if (ferror(stdout))
-   break;
+   if (nflag) {
+   if (!bflag || ch != '\n') {
+   (void)fprintf(stdout, "%6d\t", ++line);
+   if (ferror(stdout))
+   break;
+   } else if (eflag) {
+   (void)fprintf(stdout, "%6s\t", "");
+   if (ferror(stdout))
+   break;
+   }
}
}
if (ch == '\n') {

Modified: stable/11/bin/cat/tests/Makefile
==
--- stable/11/bin/cat/tests/MakefileThu Mar  8 07:17:20 2018
(r330637)
+++ stable/11/bin/cat/tests/MakefileThu Mar  8 07:50:11 2018
(r330638)
@@ -17,10 +17,4 @@ ${PACKAGE}FILES+=d_vt_output.out
 
 .include 
 
-d_align.out: ${TESTSRC}/d_align.out
-   sed -E -e 's,^[[:space:]]{7}\,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp
-   mv ${.TARGET}.tmp ${.TARGET}
-
-CLEANFILES+=   d_align.out d_align.out.tmp
-
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330637 - stable/11/usr.bin/at

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:17:20 2018
New Revision: 330637
URL: https://svnweb.freebsd.org/changeset/base/330637

Log:
  MFC r303540:
  
  Use nitems() from sys/param.h
  
  Sponsored by: gandi.net (BSD Day Taiwan)

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

Modified: stable/11/usr.bin/at/at.c
==
--- stable/11/usr.bin/at/at.c   Thu Mar  8 07:16:53 2018(r330636)
+++ stable/11/usr.bin/at/at.c   Thu Mar  8 07:17:20 2018(r330637)
@@ -359,7 +359,7 @@ writefile(time_t runtimer, char queue)
else
{
size_t i;
-   for (i=0; i

svn commit: r330636 - stable/11/sbin/fsdb

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:16:53 2018
New Revision: 330636
URL: https://svnweb.freebsd.org/changeset/base/330636

Log:
  MFC r303539:
  
  Use nitems() from sys/param.h.

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

Modified: stable/11/sbin/fsdb/fsdb.c
==
--- stable/11/sbin/fsdb/fsdb.c  Thu Mar  8 07:15:14 2018(r330635)
+++ stable/11/sbin/fsdb/fsdb.c  Thu Mar  8 07:16:53 2018(r330636)
@@ -900,7 +900,7 @@ CMDFUNCSTART(newtype)
return 1;
 type = DIP(curinode, di_mode) & IFMT;
 for (tp = typenamemap;
-tp < [sizeof(typenamemap)/sizeof(*typenamemap)];
+tp < [nitems(typenamemap)];
 tp++) {
if (!strcmp(argv[1], tp->typename)) {
printf("setting type to %s\n", tp->typename);
@@ -908,7 +908,7 @@ CMDFUNCSTART(newtype)
break;
}
 }
-if (tp == [sizeof(typenamemap)/sizeof(*typenamemap)]) {
+if (tp == [nitems(typenamemap)]) {
warnx("type `%s' not known", argv[1]);
warnx("try one of `file', `dir', `socket', `fifo'");
return 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330635 - head/share/man/man5

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:15:14 2018
New Revision: 330635
URL: https://svnweb.freebsd.org/changeset/base/330635

Log:
  Chase rename of rwho script in r290252
  
  The script and associated variable was changed in r290252. Now just
  chase it.
  
  MFC With: r290252
  Reported by:  Aaron LI 

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

Modified: head/share/man/man5/periodic.conf.5
==
--- head/share/man/man5/periodic.conf.5 Thu Mar  8 07:05:19 2018
(r330634)
+++ head/share/man/man5/periodic.conf.5 Thu Mar  8 07:15:14 2018
(r330635)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 31, 2017
+.Dd March 7, 2018
 .Dt PERIODIC.CONF 5
 .Os
 .Sh NAME
@@ -433,7 +433,7 @@ if you want to run
 without the
 .Fl n
 option (to do DNS lookups).
-.It Va daily_status_rwho_enable
+.It Va daily_status_uptime_enable
 .Pq Vt bool
 Set to
 .Dq Li YES
___
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: r330634 - stable/11/usr.bin/indent/tests

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 07:05:19 2018
New Revision: 330634
URL: https://svnweb.freebsd.org/changeset/base/330634

Log:
  MFC r313544:
  
  indent(1): add regression test cases
  
  These examples show expected behavior of indent(1). They are meant to be used
  together with a regression test mechanism, either Kyua, a Makefile or perhaps
  something else. The mechanism should in essence do this:
indent -P${test}.pro < ${test}.0 > ${test}.0.run
  and compare ${test}.0.stdout to ${test}.0.run. If the files differ or the exit
  status isn't 0, the test failed.
  
  * ${test}.pro is an indent(1) profile: a list of options passed through a 
file.
The program doesn't complain if the file doesn't exist.
  * ${test}.0 is a C source file which acts as input for indent(1). It doesn't
have to have any particular formatting, since it's the output that matters.
  * ${test}.0.stdout contains expected output. It doesn't have to be formatted 
in
Kernel Normal Form as the point of the tests is to check for regressions in
the program and not to check that it always produces KNF.

Added:
  stable/11/usr.bin/indent/tests/
 - copied from r313544, head/usr.bin/indent/tests/
Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330633 - stable/11/usr.bin/indent

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 06:54:33 2018
New Revision: 330633
URL: https://svnweb.freebsd.org/changeset/base/330633

Log:
  MFC r309220:
  
  indent(1): Properly handle the wide string literal and wide char constant L.
  
  indent(1) treated the "L" in "L'a'" as if it were an identifier and forced
  a space character after it, breaking valid code.
  
  PR:   143090

Modified:
  stable/11/usr.bin/indent/indent.c
  stable/11/usr.bin/indent/indent_codes.h
  stable/11/usr.bin/indent/lexi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/indent/indent.c
==
--- stable/11/usr.bin/indent/indent.c   Thu Mar  8 06:51:17 2018
(r330632)
+++ stable/11/usr.bin/indent/indent.c   Thu Mar  8 06:54:33 2018
(r330633)
@@ -1017,6 +1017,16 @@ check_type:
ps.want_blank = true;
break;
 
+   case strpfx:
+   if (ps.want_blank)
+   *e_code++ = ' ';
+   for (t_ptr = token; *t_ptr; ++t_ptr) {
+   CHECK_SIZE_CODE;
+   *e_code++ = *t_ptr;
+   }
+   ps.want_blank = false;
+   break;
+
case period:/* treat a period kind of like a binary
 * operation */
*e_code++ = '.';/* move the period into line */

Modified: stable/11/usr.bin/indent/indent_codes.h
==
--- stable/11/usr.bin/indent/indent_codes.h Thu Mar  8 06:51:17 2018
(r330632)
+++ stable/11/usr.bin/indent/indent_codes.h Thu Mar  8 06:54:33 2018
(r330633)
@@ -68,3 +68,4 @@
 #define ifhead 30
 #define elsehead   31
 #define period 32
+#define strpfx 33

Modified: stable/11/usr.bin/indent/lexi.c
==
--- stable/11/usr.bin/indent/lexi.c Thu Mar  8 06:51:17 2018
(r330632)
+++ stable/11/usr.bin/indent/lexi.c Thu Mar  8 06:54:33 2018
(r330633)
@@ -228,6 +228,11 @@ lexi(void)
fill_buffer();
}
*e_token++ = '\0';
+
+   if (s_token[0] == 'L' && s_token[1] == '\0' &&
+ (*buf_ptr == '"' || *buf_ptr == '\''))
+   return (strpfx);
+
while (*buf_ptr == ' ' || *buf_ptr == '\t') {   /* get rid of blanks */
if (++buf_ptr >= buf_end)
fill_buffer();
___
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: r330632 - stable/11/include

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 06:51:17 2018
New Revision: 330632
URL: https://svnweb.freebsd.org/changeset/base/330632

Log:
  MFC r326283:
  
  netconfig.h: sync with upstream.
  
  Bring some comments and the license.
  Add SPDX License ID tag while here.

Modified:
  stable/11/include/netconfig.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/include/netconfig.h
==
--- stable/11/include/netconfig.h   Thu Mar  8 06:17:07 2018
(r330631)
+++ stable/11/include/netconfig.h   Thu Mar  8 06:51:17 2018
(r330632)
@@ -1,6 +1,36 @@
-/* $NetBSD: netconfig.h,v 1.1 2000/06/02 22:57:54 fvdl Exp $   */
+/* $NetBSD: netconfig.h,v 1.6 2008/04/28 20:22:54 martin Exp $ */
 /* $FreeBSD$ */
 
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ *
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
 
 #ifndef _NETCONFIG_H_
 #define _NETCONFIG_H_
@@ -30,10 +60,10 @@ typedef struct {
 /*
  * nc_semantics values
  */
-#define NC_TPI_CLTS1
-#define NC_TPI_COTS2
-#define NC_TPI_COTS_ORD3
-#define NC_TPI_RAW 4
+#define NC_TPI_CLTS1   /* Connectionless transport */
+#define NC_TPI_COTS2   /* Connection oriented transport */
+#define NC_TPI_COTS_ORD3   /* Connection oriented, ordered 
transport */
+#define NC_TPI_RAW 4   /* Raw connection */
 
 /*
  * nc_flag values
___
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: r330631 - in releng: 10.3 10.3/sys/conf 10.4 10.4/sys/conf

2018-03-07 Thread Gordon Tetlow
Author: gordon
Date: Thu Mar  8 06:17:07 2018
New Revision: 330631
URL: https://svnweb.freebsd.org/changeset/base/330631

Log:
  Bump newvers and document the updated patch for SA-18:01.ipsec
  
  Approved by:  so
  Security: FreeBSD-SA-18:01.ipsec
  Security: CVE-2018-6916

Modified:
  releng/10.3/UPDATING
  releng/10.3/sys/conf/newvers.sh
  releng/10.4/UPDATING
  releng/10.4/sys/conf/newvers.sh

Modified: releng/10.3/UPDATING
==
--- releng/10.3/UPDATINGThu Mar  8 05:41:53 2018(r330630)
+++ releng/10.3/UPDATINGThu Mar  8 06:17:07 2018(r330631)
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20180308   p28 FreeBSD-SA-18:01.ipsec [revised]
+
+   Fix ipsec validation and use-after-free.
+
 20180307   p27 FreeBSD-SA-18:01.ipsec
FreeBSD-SA-18:02.ntp
FreeBSD-EN-18:01.tzdata

Modified: releng/10.3/sys/conf/newvers.sh
==
--- releng/10.3/sys/conf/newvers.sh Thu Mar  8 05:41:53 2018
(r330630)
+++ releng/10.3/sys/conf/newvers.sh Thu Mar  8 06:17:07 2018
(r330631)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.3"
-BRANCH="RELEASE-p27"
+BRANCH="RELEASE-p28"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.4/UPDATING
==
--- releng/10.4/UPDATINGThu Mar  8 05:41:53 2018(r330630)
+++ releng/10.4/UPDATINGThu Mar  8 06:17:07 2018(r330631)
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20180307   p7  FreeBSD-SA-18:01.ipsec [revised]
+
+   Fix ipsec validation and use-after-free.
+
 20180307   p6  FreeBSD-SA-18:01.ipsec
FreeBSD-SA-18:02.ntp
FreeBSD-EN-18:01.tzdata

Modified: releng/10.4/sys/conf/newvers.sh
==
--- releng/10.4/sys/conf/newvers.sh Thu Mar  8 05:41:53 2018
(r330630)
+++ releng/10.4/sys/conf/newvers.sh Thu Mar  8 06:17:07 2018
(r330631)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.4"
-BRANCH="RELEASE-p6"
+BRANCH="RELEASE-p7"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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: r330630 - stable/11/contrib/top

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 05:41:53 2018
New Revision: 330630
URL: https://svnweb.freebsd.org/changeset/base/330630

Log:
  MFC r318587:
  
  Add -w to usage string.

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

Modified: stable/11/contrib/top/top.c
==
--- stable/11/contrib/top/top.c Thu Mar  8 05:40:13 2018(r330629)
+++ stable/11/contrib/top/top.c Thu Mar  8 05:41:53 2018(r330630)
@@ -535,7 +535,7 @@ char *argv[];
  default:
fprintf(stderr,
 "Top version %s\n"
-"Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
+"Usage: %s [-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
 "   [-J jail] [-U username] [number]\n",
version_string(), myname);
exit(1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330629 - stable/11/sbin/growfs

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 05:40:13 2018
New Revision: 330629
URL: https://svnweb.freebsd.org/changeset/base/330629

Log:
  MFC r326820:
  
  Tone down the description for the growfs "-y" flag.

Modified:
  stable/11/sbin/growfs/growfs.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/growfs/growfs.8
==
--- stable/11/sbin/growfs/growfs.8  Thu Mar  8 05:28:43 2018
(r330628)
+++ stable/11/sbin/growfs/growfs.8  Thu Mar  8 05:40:13 2018
(r330629)
@@ -37,7 +37,7 @@
 .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
 .\" $FreeBSD$
 .\"
-.Dd May 10, 2016
+.Dd December 13, 2017
 .Dt GROWFS 8
 .Os
 .Sh NAME
@@ -68,16 +68,10 @@ The following options are available:
 Causes the new file system parameters to be printed out without actually
 enlarging the file system.
 .It Fl y
-.Dq Expert mode .
-Usually
+Causes
 .Nm
-will ask you if you took a backup of your data before and will do some tests
-whether
-.Ar special
-is currently mounted or whether there are any active snapshots on the file
-system specified.
-This will be suppressed.
-So use this option with great care!
+to assume yes
+as the answer to all operator questions.
 .It Fl s Ar size
 Determines the
 .Ar size
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330628 - head/usr.bin/calendar/calendars

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Thu Mar  8 05:28:43 2018
New Revision: 330628
URL: https://svnweb.freebsd.org/changeset/base/330628

Log:
  calendars: update Judaic calendar to 2018+
  
  This was generated by
  
  ∴hebcal --years 10 -r 2018 | awk -F '[/\t]' '{print $3 "/" $1 "/" $2
  "*\t" $4}'
  
  MFC After:1 week

Modified:
  head/usr.bin/calendar/calendars/calendar.judaic

Modified: head/usr.bin/calendar/calendars/calendar.judaic
==
--- head/usr.bin/calendar/calendars/calendar.judaic Thu Mar  8 03:19:04 
2018(r330627)
+++ head/usr.bin/calendar/calendars/calendar.judaic Thu Mar  8 05:28:43 
2018(r330628)
@@ -1,694 +1,824 @@
 /*
- * Judaic Calendar. Maintained by Josef Grosch .
+ * Judaic Calendar.
  *
  * $FreeBSD$
  *
  */
 
-/*
- * $Id: calendar.judaic,v 1.45 2007/01/01 22:24:53 jgrosch Exp $
- */
-
 #ifndef _calendar_judaic_
 #define _calendar_judaic_
 
 /*
  * The calendar below has been obtained from the port deskutils/hebcal
- * for the year of 2010 to 2015 and for the city of New York.
+ * for the year of 2018 to 2027 and for the city of New York.
  */
 
-2010/Jan/16*   Rosh Chodesh Sh'vat
-2010/Jan/30*   Tu B'Shvat
-2010/Feb/13*   Shabbat Shekalim
-2010/Feb/14*   Rosh Chodesh Adar
-2010/Feb/15*   Rosh Chodesh Adar
-2010/Feb/25*   Ta'anit Esther
-2010/Feb/27*   Shabbat Zachor
-2010/Feb/28*   Purim
-2010/Mar/1*Shushan Purim
-2010/Mar/6*Shabbat Parah
-2010/Mar/13*   Shabbat HaChodesh
-2010/Mar/16*   Rosh Chodesh Nisan
-2010/Mar/27*   Shabbat HaGadol
-2010/Mar/29*   Ta'anit Bechorot
-2010/Mar/29*   Erev Pesach
-2010/Mar/30*   Pesach I
-2010/Mar/31*   Pesach II
-2010/Apr/1*Pesach III (CH''M)
-2010/Apr/2*Pesach IV (CH''M)
-2010/Apr/3*Pesach V (CH''M)
-2010/Apr/4*Pesach VI (CH''M)
-2010/Apr/5*Pesach VII
-2010/Apr/6*Pesach VIII
-2010/Apr/11*   Yom HaShoah
-2010/Apr/14*   Rosh Chodesh Iyyar
-2010/Apr/15*   Rosh Chodesh Iyyar
-2010/Apr/19*   Yom HaZikaron
-2010/Apr/20*   Yom HaAtzma'ut
-2010/May/2*Lag B'Omer
-2010/May/Dec*  Yom Yerushalayim
-2010/May/14*   Rosh Chodesh Sivan
-2010/May/18*   Erev Shavuot
-2010/May/19*   Shavuot I
-2010/May/20*   Shavuot II
-2010/Jun/Dec*  Rosh Chodesh Tamuz
-2010/Jun/13*   Rosh Chodesh Tamuz
-2010/Jun/29*   Tzom Tammuz
-2010/Jul/Dec*  Rosh Chodesh Av
-2010/Jul/17*   Shabbat Hazon
-2010/Jul/20*   Tish'a B'Av
-2010/Jul/24*   Shabbat Nachamu
-2010/Aug/Oct*  Rosh Chodesh Elul
-2010/Aug/11*   Rosh Chodesh Elul
-2010/Sep/8*Erev Rosh Hashana
-2010/Sep/9*Rosh Hashana 5771
-2010/Sep/Oct*  Rosh Hashana II
-2010/Sep/11*   Shabbat Shuva
-2010/Sep/Dec*  Tzom Gedaliah
-2010/Sep/17*   Erev Yom Kippur
-2010/Sep/18*   Yom Kippur
-2010/Sep/22*   Erev Sukkot
-2010/Sep/23*   Sukkot I
-2010/Sep/24*   Sukkot II
-2010/Sep/25*   Sukkot III (CH''M)
-2010/Sep/26*   Sukkot IV (CH''M)
-2010/Sep/27*   Sukkot V (CH''M)
-2010/Sep/28*   Sukkot VI (CH''M)
-2010/Sep/29*   Sukkot VII (Hoshana Raba)
-2010/Sep/30*   Shmini Atzeret
-2010/Oct/1*Simchat Torah
-2010/Oct/8*Rosh Chodesh Cheshvan
-2010/Oct/9*Rosh Chodesh Cheshvan
-2010/Nov/7*Rosh Chodesh Kislev
-2010/Nov/8*Rosh Chodesh Kislev
-2010/Dec/1*Chanukah: 1 Candle
-2010/Dec/2*Chanukah: 2 Candles
-2010/Dec/3*Chanukah: 3 Candles
-2010/Dec/4*Chanukah: 4 Candles
-2010/Dec/5*Chanukah: 5 Candles
-2010/Dec/6*Chanukah: 6 Candles
-2010/Dec/7*Rosh Chodesh Tevet
-2010/Dec/7*Chanukah: 7 Candles
-2010/Dec/8*Rosh Chodesh Tevet
-2010/Dec/8*Chanukah: 8 Candles
-2010/Dec/9*Chanukah: 8th Day
-2010/Dec/16*   Asara B'Tevet
-2011/1/6*  Rosh Chodesh Sh'vat
-2011/1/20* Tu B'Shvat
-2011/2/4*  Rosh Chodesh Adar I
-2011/2/5*  Rosh Chodesh Adar I
-2011/2/18* Purim Katan
-2011/3/5*  Shabbat Shekalim
-2011/3/6*  Rosh Chodesh Adar II
-2011/3/7*  Rosh Chodesh Adar II
-2011/3/17* Ta'anit Esther
-2011/3/19* Shabbat Zachor
-2011/3/20* Purim
-2011/3/21* Shushan Purim
-2011/3/26* Shabbat Parah
-2011/4/2*  Shabbat HaChodesh
-2011/4/5*  Rosh Chodesh Nisan
-2011/4/16* Shabbat HaGadol
-2011/4/18* Ta'anit Bechorot
-2011/4/18* Erev Pesach
-2011/4/19* Pesach I
-2011/4/20* Pesach II
-2011/4/21* Pesach III (CH''M)
-2011/4/22* Pesach IV (CH''M)
-2011/4/23* Pesach V (CH''M)
-2011/4/24* Pesach VI (CH''M)
-2011/4/25* Pesach VII
-2011/4/26* Pesach VIII
-2011/5/1*  Yom HaShoah
-2011/5/4*  Rosh Chodesh Iyyar
-2011/5/5*  Rosh Chodesh Iyyar
-2011/5/9*  Yom HaZikaron
-2011/5/10* Yom HaAtzma'ut
-2011/5/22* Lag B'Omer
-2011/6/1*  Yom Yerushalayim
-2011/6/3*  Rosh Chodesh Sivan
-2011/6/7*  Erev Shavuot
-2011/6/8*  Shavuot I
-2011/6/9*  Shavuot II
-2011/7/2*  Rosh Chodesh Tamuz
-2011/7/3*  Rosh Chodesh Tamuz
-2011/7/19* Tzom Tammuz
-2011/8/1*  Rosh Chodesh Av
-2011/8/6*  Shabbat Hazon
-2011/8/9*  Tish'a B'Av
-2011/8/13* 

svn commit: r330627 - head/share/man/man9

2018-03-07 Thread Alan Somers
Author: asomers
Date: Thu Mar  8 03:19:04 2018
New Revision: 330627
URL: https://svnweb.freebsd.org/changeset/base/330627

Log:
  g_bio(9): fix a documentation oversight from r163870
  
  MFC after:3 weeks

Modified:
  head/share/man/man9/g_bio.9

Modified: head/share/man/man9/g_bio.9
==
--- head/share/man/man9/g_bio.9 Thu Mar  8 01:03:26 2018(r330626)
+++ head/share/man/man9/g_bio.9 Thu Mar  8 03:19:04 2018(r330627)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2016
+.Dd Mar 7, 2018
 .Dt G_BIO 9
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ most important fields are described below:
 .Bl -tag -width ".Va bio_attribute"
 .It Va bio_cmd
 I/O request command.
-There are four I/O requests available in GEOM:
+There are five I/O requests available in GEOM:
 .Bl -tag -width ".Dv BIO_GETATTR"
 .It Dv BIO_READ
 A read request.
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Pedro Giffuni



On 07/03/2018 16:19, Brooks Davis wrote:

On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote:

FWIW ...

ibcs2 is candidate for future removal.

It is probably time again to see if actual users exist.  ibcs2 has wasted
a few hours of my time over the last few months so keeping it does have
a non-zero cost.


FWIW, I used it long ago on FreeBSD with Unesco's ISIS database software 
but the software is not developed anymore.



We tried to get some vendor interest in it but we failed and given this
is very i386-specific it is probably not worth spending huge efforts on it.

cloudabi seems to be, for all purposes, a better conceptual replacement.

This comment doesn't make much sense. iBCS is the Intel Binary
Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix,
SCO, and UnixWare.  Cloudabi is, in a sense, taking Capsicum to its
logical extreme and totally unrelated.


It is also a binary format (ELF-based) that can run on several platforms 
including Linux and FreeBSD.
It clearly targets the cloud market, which makes more sense nowadays 
than the i386 use space which were common in the early 90s.


Pedro.

___
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: r330436 - head/bin/chflags

2018-03-07 Thread Bruce Evans

On Mon, 5 Mar 2018, Bruce Evans wrote:


On Sun, 4 Mar 2018, Ian Lepore wrote:


On Mon, 2018-03-05 at 01:56 +, Bryan Drewery wrote:


Log:
\xa0 chflags: Add -x option to not traverse mount points.


Yay! \xa0One day later than I needed it, but still, yay!


I recently noticed that find(1) needs an option to not look at mount
points at all, and further options to classify mount points so that
you can prune them.

After reading the above and investigating further, I noticed that -x
is broken in most FreeBSD utilities, since POSIX requires not looking
at mount points at all for the few utilities that support -x.  E.g.,
for du in 2001 draft 7 POSIX:
...


This seems to be easy to fix by by skipping in callers of fts_read().
Fix for an old version of du:

XX Index: du.c
XX ===
XX RCS file: /home/ncvs/src/usr.bin/du/du.c,v
XX retrieving revision 1.34
XX diff -u -2 -r1.34 du.c
XX --- du.c 2 Jun 2004 07:09:34 -   1.34
XX +++ du.c 8 Mar 2018 00:57:12 -
XX @@ -86,9 +86,11 @@
XX  int listall;
XX  int depth;
XX -int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, 
ch, notused, rval;
XX +int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag;
XX +int xflag, ch, notused, rval;
XX  char**save;
XX  static char dot[] = ".";
XX 
XX  	Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0;

XX +xflag = 0;
XX 
XX  	save = argv;

XX @@ -148,4 +150,5 @@
XX  break;
XX  case 'x':
XX +xflag = 1;
XX  ftsoptions |= FTS_XDEV;
XX  break;
XX @@ -219,4 +222,7 @@
XX  break;
XX  case FTS_DP:
XX +if (xflag && p->fts_statp->st_dev !=
XX +p->fts_parent->fts_statp->st_dev)
XX +break;
XX  if (ignorep(p))
XX  break;

This patch won't apply cleanly in -current because -current has large
changes in all areas touched by the patch (mainly to undo formatting
away from KNF).

Bruce
___
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: r330539 - in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include

2018-03-07 Thread Jonathan Looney
On Tue, Mar 6, 2018 at 6:31 PM, Oliver Pinter  wrote:

> X-MFC-with:
>
> commit 27ac811b7acd31b1bdbf959fe49a957cdeabf780
> Author: bde 
> Date:   Fri Mar 24 17:34:55 2017 +
>

ACK. Thanks!

Jonathan
___
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: r330626 - stable/11/sys/conf

2018-03-07 Thread Navdeep Parhar
Author: np
Date: Thu Mar  8 01:03:26 2018
New Revision: 330626
URL: https://svnweb.freebsd.org/changeset/base/330626

Log:
  MFC r322659 (by glebius):
  Fix cut and paste typo that prevented T5 firmware to be compiled in.

Modified:
  stable/11/sys/conf/files
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files
==
--- stable/11/sys/conf/filesWed Mar  7 22:05:23 2018(r330625)
+++ stable/11/sys/conf/filesThu Mar  8 01:03:26 2018(r330626)
@@ -1378,7 +1378,7 @@ t4fw.fw   optional cxgbe  
\
no-obj no-implicit-rule \
clean   "t4fw.fw"
 t5fw_cfg.c optional cxgbe  \
-   compile-with"${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg 
t5fw_cfg_uwire.fw:t5fw_cfg_uwire t4fw.fw:t4fw -mt5fw_cfg -c${.TARGET}" \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg 
t5fw_cfg_uwire.fw:t5fw_cfg_uwire t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \
no-implicit-rule before-depend local\
clean   "t5fw_cfg.c"
 t5fw_cfg.fwo   optional cxgbe  \
___
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: r330451 - in stable/11/sys: dev/iwm dev/otus dev/usb/wlan net80211

2018-03-07 Thread Rodney W. Grimes
> On 7 March 2018 at 09:37, John Baldwin  wrote:
> > On Tuesday, March 06, 2018 06:46:37 PM Eitan Adler wrote:
> >> On 6 March 2018 at 08:26, John Baldwin  wrote:
> >> > On Monday, March 05, 2018 07:13:59 PM Eitan Adler wrote:
> >> >> On 5 March 2018 at 10:08, John Baldwin  wrote:
> >> >> > On Monday, March 05, 2018 07:54:58 AM Eitan Adler wrote:
> >> >> >> Author: eadler
> >> >> >> Date: Mon Mar  5 07:54:57 2018
> >> >> >> New Revision: 330451
> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/330451
> >> >> >>
> >> >> >> Log:
> >> >> >>   MFC r306837:
> >> >> >>
> >> >> >>   [net80211] extend the ieee80211_rx_stats struct to include more 
> >> >> >> information.
> >> >> >
> >> >> > Have you thought about the KBI implications of this change and some 
> >> >> > of the
> >> >> > other changes you've merged?
> >> >>
> >> >> I do have a copy of the modules from 11.1 and have loaded them at
> >> >> various points in time after merging. That said, I am not perfect.
> >> >> Unfortunately, my -STABLE box did not have fully functioning drivers
> >> >> before these changes so its difficult to test anything beyond "loads
> >> >> and does not panic.". I havn't done so today yet, but that will happen
> >> >> soon.
> >> >>
> >> >> Ensuring these things work through code inspection is certainly
> >> >> possible and I've skipped over several changes as a result.
> >> >
> >> > Loading a module doesn't alone doesn't actually test for breakage.
> >>
> >> I'm aware. In this case I should likely just revert this change since
> >> its a pretty blatant break.
> >
> > I suspect many of these changes for iwm, etc. are all intertwined so I'm not
> > sure if you can leave out individual ones.
> 
> Possibly. I do have iwm working on my laptop though. I also know of
> one open PR assigned to me w.r.t. a model I don't own. I'll be
> addressing it some time this week.

I believe I also have a tester of stable/11 iwm patches avaliable,
he has an 8265?

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


Re: svn commit: r330451 - in stable/11/sys: dev/iwm dev/otus dev/usb/wlan net80211

2018-03-07 Thread Eitan Adler
On 7 March 2018 at 09:37, John Baldwin  wrote:
> On Tuesday, March 06, 2018 06:46:37 PM Eitan Adler wrote:
>> On 6 March 2018 at 08:26, John Baldwin  wrote:
>> > On Monday, March 05, 2018 07:13:59 PM Eitan Adler wrote:
>> >> On 5 March 2018 at 10:08, John Baldwin  wrote:
>> >> > On Monday, March 05, 2018 07:54:58 AM Eitan Adler wrote:
>> >> >> Author: eadler
>> >> >> Date: Mon Mar  5 07:54:57 2018
>> >> >> New Revision: 330451
>> >> >> URL: https://svnweb.freebsd.org/changeset/base/330451
>> >> >>
>> >> >> Log:
>> >> >>   MFC r306837:
>> >> >>
>> >> >>   [net80211] extend the ieee80211_rx_stats struct to include more 
>> >> >> information.
>> >> >
>> >> > Have you thought about the KBI implications of this change and some of 
>> >> > the
>> >> > other changes you've merged?
>> >>
>> >> I do have a copy of the modules from 11.1 and have loaded them at
>> >> various points in time after merging. That said, I am not perfect.
>> >> Unfortunately, my -STABLE box did not have fully functioning drivers
>> >> before these changes so its difficult to test anything beyond "loads
>> >> and does not panic.". I havn't done so today yet, but that will happen
>> >> soon.
>> >>
>> >> Ensuring these things work through code inspection is certainly
>> >> possible and I've skipped over several changes as a result.
>> >
>> > Loading a module doesn't alone doesn't actually test for breakage.
>>
>> I'm aware. In this case I should likely just revert this change since
>> its a pretty blatant break.
>
> I suspect many of these changes for iwm, etc. are all intertwined so I'm not
> sure if you can leave out individual ones.

Possibly. I do have iwm working on my laptop though. I also know of
one open PR assigned to me w.r.t. a model I don't own. I'll be
addressing it some time this week.

>> > Batching
>> > up changes into a single diff is also helpful since if an API changes back
>> > and forth in HEAD multiple times, collapsing them means that for stable you
>> > may only need a single compat shim rather than several.
>>
>> Understood. My intention in doing them one-by-one was to make it
>> easier to bisect if something goes wrong.
>
> For stable I think we also want to balance this with:
>
> 1) Not putting stable in a known-broken state.  If there are followup fixes
>either for compile or runtime performances, those followup fixes should
>always be included in the commit that merges the original change.

To the extent possible I tried to do this.

> 2) Preserving ABI.  The desire to avoid putting stable into known-broken
>state means that MFCs should include the ABI shims along with the original
>change.

This part I missed very clearly. I'll be sure to be more careful in the future.





-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Konstantin Belousov
On Wed, Mar 07, 2018 at 09:19:55PM +, Brooks Davis wrote:
> On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote:
> > FWIW ...
> > 
> > ibcs2 is candidate for future removal.
> 
> It is probably time again to see if actual users exist.  ibcs2 has wasted
> a few hours of my time over the last few months so keeping it does have
> a non-zero cost.
There are users of it, I periodically (say two or three times per year)
get a report of something appearing broken in it.

Note that iBCS2 is disconnected from the build in HEAD in probably
in stable/11.  It seems that removing it from svn might be a reasonable
change after all.

> 
> > We tried to get some vendor interest in it but we failed and given this 
It was not a 'vendor interest'. It was an unability to get the
confirmation that some patch which was written using information from
the SCO headers, does not violate the license.

> > is very i386-specific it is probably not worth spending huge efforts on it.
> > 
> > cloudabi seems to be, for all purposes, a better conceptual replacement.
> 
> This comment doesn't make much sense. iBCS is the Intel Binary
> Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix,
> SCO, and UnixWare.  Cloudabi is, in a sense, taking Capsicum to its
> logical extreme and totally unrelated.
> 
> -- Brooks


___
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: r330625 - head/stand/lua

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 22:05:23 2018
New Revision: 330625
URL: https://svnweb.freebsd.org/changeset/base/330625

Log:
  lualoader: Return status in cli_execute_unparsed properly
  
  cli_execute was changed to return the status, cascade that to
  cli_execute_unparsed.
  
  This fixes a lot of false "Failed to execute" errors following r330620; no
  failures actually occurred, but [module]_error would've then promptly
  executed (and also "failed")

Modified:
  head/stand/lua/cli.lua

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Wed Mar  7 22:04:27 2018(r330624)
+++ head/stand/lua/cli.lua  Wed Mar  7 22:05:23 2018(r330625)
@@ -95,7 +95,7 @@ function cli_execute(...)
 end
 
 function cli_execute_unparsed(str)
-   cli_execute(loader.parse(str))
+   return cli_execute(loader.parse(str))
 end
 
 -- Module exports
___
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: r330624 - head/sys/vm

2018-03-07 Thread Jeff Roberson
Author: jeff
Date: Wed Mar  7 22:04:27 2018
New Revision: 330624
URL: https://svnweb.freebsd.org/changeset/base/330624

Log:
  Don't assert that the domain free lock is held until we're certain that
  there is a valid reservation.  This can trip erroneously when memory
  falls within a domain but doesn't have the reservation initialized because
  it does not meet size or alignment requirements.
  
  Reported by:  pho, mjg
  Sponsored by: Netflix, Dell/EMC Isilon

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==
--- head/sys/vm/vm_reserv.c Wed Mar  7 20:50:28 2018(r330623)
+++ head/sys/vm/vm_reserv.c Wed Mar  7 22:04:27 2018(r330624)
@@ -1044,9 +1044,9 @@ vm_reserv_free_page(vm_page_t m)
vm_reserv_t rv;
 
rv = vm_reserv_from_page(m);
-   vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
if (rv->object == NULL)
return (FALSE);
+   vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
vm_reserv_depopulate(rv, m - rv->pages);
return (TRUE);
 }
@@ -1093,9 +1093,9 @@ vm_reserv_is_page_free(vm_page_t m)
vm_reserv_t rv;
 
rv = vm_reserv_from_page(m);
-   vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
if (rv->object == NULL)
return (false);
+   vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
return (popmap_is_clear(rv->popmap, m - rv->pages));
 }
 
___
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: r330451 - in stable/11/sys: dev/iwm dev/otus dev/usb/wlan net80211

2018-03-07 Thread Adrian Chadd
(*whispers* you have to upgrade everything all at ooonnnce.)



-adrian
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Brooks Davis
On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote:
> FWIW ...
> 
> ibcs2 is candidate for future removal.

It is probably time again to see if actual users exist.  ibcs2 has wasted
a few hours of my time over the last few months so keeping it does have
a non-zero cost.

> We tried to get some vendor interest in it but we failed and given this 
> is very i386-specific it is probably not worth spending huge efforts on it.
> 
> cloudabi seems to be, for all purposes, a better conceptual replacement.

This comment doesn't make much sense. iBCS is the Intel Binary
Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix,
SCO, and UnixWare.  Cloudabi is, in a sense, taking Capsicum to its
logical extreme and totally unrelated.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-03-07 Thread Hans Petter Selasky

On 03/07/18 18:09, Conrad Meyer wrote:

On Wed, Mar 7, 2018 at 7:23 AM, Hans Petter Selasky
 wrote:

Author: hselasky
Date: Wed Mar  7 15:23:07 2018
New Revision: 330608
URL: https://svnweb.freebsd.org/changeset/base/330608

Log:
   Implement priority to traffic class mapping in mlx5core.

   Add support for mapping priority to traffic class via sysctl

   Submitted by: Slava Shwartsman 


Didn't we just give this guy a commit bit?  You can get him committing
his own changes :-).


Next time there is a stand-alone patch, which doesn't have too many 
dependencies in the code I'll let him push it. Right now the upstreaming 
is a bit complicated - many patches in the queue which can only go in 
one order.


--HPS
___
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: r330623 - in stable/11: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyvectl

2018-03-07 Thread John Baldwin
Author: jhb
Date: Wed Mar  7 20:50:28 2018
New Revision: 330623
URL: https://svnweb.freebsd.org/changeset/base/330623

Log:
  MFC 328102: Save and restore guest debug registers.
  
  Currently most of the debug registers are not saved and restored
  during VM transitions allowing guest and host debug register values to
  leak into the opposite context.  One result is that hardware
  watchpoints do not work reliably within a guest under VT-x.
  
  Due to differences in SVM and VT-x, slightly different approaches are
  used.
  
  For VT-x:
  
  - Enable debug register save/restore for VM entry/exit in the VMCS for
DR7 and MSR_DEBUGCTL.
  - Explicitly save DR0-3,6 of the guest.
  - Explicitly save DR0-3,6-7, MSR_DEBUGCTL, and the trap flag from
%rflags for the host.  Note that because DR6 is "software" managed
and not stored in the VMCS a kernel debugger which single steps
through VM entry could corrupt the guest DR6 (since a single step
trap taken after loading the guest DR6 could alter the DR6
register).  To avoid this, explicitly disable single-stepping via
the trace flag before loading the guest DR6.  A determined debugger
could still defeat this by setting a breakpoint after the guest DR6
was loaded and then single-stepping.
  
  For SVM:
  - Enable debug register caching in the VMCB for DR6/DR7.
  - Explicitly save DR0-3 of the guest.
  - Explicitly save DR0-3,6-7, and MSR_DEBUGCTL for the host.  Since SVM
saves the guest DR6 in the VMCB, the race with single-stepping
described for VT-x does not exist.
  
  For both platforms, expose all of the guest DRx values via --get-drX
  and --set-drX flags to bhyvectl.

Modified:
  stable/11/sys/amd64/include/vmm.h
  stable/11/sys/amd64/vmm/amd/svm.c
  stable/11/sys/amd64/vmm/amd/svm.h
  stable/11/sys/amd64/vmm/amd/vmcb.c
  stable/11/sys/amd64/vmm/intel/vmx.c
  stable/11/sys/amd64/vmm/intel/vmx.h
  stable/11/usr.sbin/bhyvectl/bhyvectl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/include/vmm.h
==
--- stable/11/sys/amd64/include/vmm.h   Wed Mar  7 18:45:24 2018
(r330622)
+++ stable/11/sys/amd64/include/vmm.h   Wed Mar  7 20:50:28 2018
(r330623)
@@ -83,6 +83,11 @@ enum vm_reg_name {
VM_REG_GUEST_PDPTE2,
VM_REG_GUEST_PDPTE3,
VM_REG_GUEST_INTR_SHADOW,
+   VM_REG_GUEST_DR0,
+   VM_REG_GUEST_DR1,
+   VM_REG_GUEST_DR2,
+   VM_REG_GUEST_DR3,
+   VM_REG_GUEST_DR6,
VM_REG_LAST
 };
 

Modified: stable/11/sys/amd64/vmm/amd/svm.c
==
--- stable/11/sys/amd64/vmm/amd/svm.c   Wed Mar  7 18:45:24 2018
(r330622)
+++ stable/11/sys/amd64/vmm/amd/svm.c   Wed Mar  7 20:50:28 2018
(r330623)
@@ -87,6 +87,7 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW, NULL, 
VMCB_CACHE_TPR  |   \
VMCB_CACHE_CR2  |   \
VMCB_CACHE_CR   |   \
+   VMCB_CACHE_DR   |   \
VMCB_CACHE_DT   |   \
VMCB_CACHE_SEG  |   \
VMCB_CACHE_NP)
@@ -504,6 +505,10 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop
PAT_VALUE(5, PAT_WRITE_THROUGH) |
PAT_VALUE(6, PAT_UNCACHED)  |
PAT_VALUE(7, PAT_UNCACHEABLE);
+
+   /* Set up DR6/7 to power-on state */
+   state->dr6 = 0x0ff0;
+   state->dr7 = 0x400;
 }
 
 /*
@@ -1861,6 +1866,60 @@ enable_gintr(void)
 __asm __volatile("stgi");
 }
 
+static __inline void
+svm_dr_enter_guest(struct svm_regctx *gctx)
+{
+
+   /* Save host control debug registers. */
+   gctx->host_dr7 = rdr7();
+   gctx->host_debugctl = rdmsr(MSR_DEBUGCTLMSR);
+
+   /*
+* Disable debugging in DR7 and DEBUGCTL to avoid triggering
+* exceptions in the host based on the guest DRx values.  The
+* guest DR6, DR7, and DEBUGCTL are saved/restored in the
+* VMCB.
+*/
+   load_dr7(0);
+   wrmsr(MSR_DEBUGCTLMSR, 0);
+
+   /* Save host debug registers. */
+   gctx->host_dr0 = rdr0();
+   gctx->host_dr1 = rdr1();
+   gctx->host_dr2 = rdr2();
+   gctx->host_dr3 = rdr3();
+   gctx->host_dr6 = rdr6();
+
+   /* Restore guest debug registers. */
+   load_dr0(gctx->sctx_dr0);
+   load_dr1(gctx->sctx_dr1);
+   load_dr2(gctx->sctx_dr2);
+   load_dr3(gctx->sctx_dr3);
+}
+
+static __inline void
+svm_dr_leave_guest(struct svm_regctx *gctx)
+{
+
+   /* Save guest debug registers. */
+   gctx->sctx_dr0 = rdr0();
+   gctx->sctx_dr1 = rdr1();
+   gctx->sctx_dr2 = rdr2();
+   gctx->sctx_dr3 = rdr3();
+
+   /*
+* Restore 

Re: svn commit: r330602 - head/sys/compat/cloudabi

2018-03-07 Thread Bruce Evans

On Wed, 7 Mar 2018, Benjamin Kaduk wrote:


On Wed, Mar 7, 2018 at 9:44 AM, Ed Maste  wrote:


On 7 March 2018 at 09:47, Eitan Adler  wrote:

...
Log:
  sys/cloudabi: Avoid relying on GNU specific extensions

  An empty initializer list is not technically valid C grammar.

  MFC After:1 week

-   cloudabi_fdstat_t fsb = {};
+   cloudabi_fdstat_t fsb = {0};


In practice it appears initializing via { 0 } also zeros any padding
in the struct, but I do not believe it's required by the C standard.
Perhaps a language lawyer can weigh in?

Commenting on this commit just because it's highlighted by this
change; I do not believe there's a difference between the GNU
extension { } and { 0 } here.


It is also a style bug to initialize variables in declarations.

It is interesting that this style bug gives other bugs that are more
serious than when the style rule was new:
- locking is often needed before complicated initializations.  It would
  be an even larger style bug to write the lock acquisition in initializers,
  and C doesn't have finalizers so it is impossible to obfuscate the lock
  release by writing it in finalizers
- this problem of initializing padding.

Auto initializers also used to be good for pessimizations.  Use them instead
of static initializers for constant values.  This asks the compiler to
initialize them on every entry to the function.  It was a typical
implementation to keep the values in an unnamed static object and copy this
to the stack at runtime.  Now compilers are more likely to optimize away
the copying, so the pessimization doesn't work so well.  Copying from a
static object tends to give zero padding, but optimizated variants should
only give zero padding if that is optimal.



The C spec says that if an incomplete initializer is given, then all other
fields
of the structure are initialized to zero.  The state of padding is
unspecified,
whether a complete or incomplete initializer is given.


This seems to apply to static objects too.  So initializing dynamic objects
by copying them from static objects is insecure even if you copy using
memcpy() (copying using struct assignment might skip the padding so
shouldn't be used).  A malicious compiler could initialize the padding with
security-related info.  non-malicious compiler might initialize the padding
with stack garbage that happens to be security-related.

Bruce
___
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: r330451 - in stable/11/sys: dev/iwm dev/otus dev/usb/wlan net80211

2018-03-07 Thread John Baldwin
On Tuesday, March 06, 2018 06:46:37 PM Eitan Adler wrote:
> On 6 March 2018 at 08:26, John Baldwin  wrote:
> > On Monday, March 05, 2018 07:13:59 PM Eitan Adler wrote:
> >> On 5 March 2018 at 10:08, John Baldwin  wrote:
> >> > On Monday, March 05, 2018 07:54:58 AM Eitan Adler wrote:
> >> >> Author: eadler
> >> >> Date: Mon Mar  5 07:54:57 2018
> >> >> New Revision: 330451
> >> >> URL: https://svnweb.freebsd.org/changeset/base/330451
> >> >>
> >> >> Log:
> >> >>   MFC r306837:
> >> >>
> >> >>   [net80211] extend the ieee80211_rx_stats struct to include more 
> >> >> information.
> >> >
> >> > Have you thought about the KBI implications of this change and some of 
> >> > the
> >> > other changes you've merged?
> >>
> >> I do have a copy of the modules from 11.1 and have loaded them at
> >> various points in time after merging. That said, I am not perfect.
> >> Unfortunately, my -STABLE box did not have fully functioning drivers
> >> before these changes so its difficult to test anything beyond "loads
> >> and does not panic.". I havn't done so today yet, but that will happen
> >> soon.
> >>
> >> Ensuring these things work through code inspection is certainly
> >> possible and I've skipped over several changes as a result.
> >
> > Loading a module doesn't alone doesn't actually test for breakage.
> 
> I'm aware. In this case I should likely just revert this change since
> its a pretty blatant break.

I suspect many of these changes for iwm, etc. are all intertwined so I'm not
sure if you can leave out individual ones.
 
> > Batching
> > up changes into a single diff is also helpful since if an API changes back
> > and forth in HEAD multiple times, collapsing them means that for stable you
> > may only need a single compat shim rather than several.
> 
> Understood. My intention in doing them one-by-one was to make it
> easier to bisect if something goes wrong.

For stable I think we also want to balance this with:

1) Not putting stable in a known-broken state.  If there are followup fixes
   either for compile or runtime performances, those followup fixes should
   always be included in the commit that merges the original change.

2) Preserving ABI.  The desire to avoid putting stable into known-broken
   state means that MFCs should include the ABI shims along with the original
   change.

-- 
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: r330622 - head/stand/defaults

2018-03-07 Thread Kyle Evans
On Wed, Mar 7, 2018 at 12:45 PM, Kyle Evans  wrote:
> Author: kevans
> Date: Wed Mar  7 18:45:24 2018
> New Revision: 330622
> URL: https://svnweb.freebsd.org/changeset/base/330622
>
> Log:
>   loader.conf(5): Document some other settings
>
>   These tend to have less coverage in other places and they don't have
>   defaults as of yet, so mention them here:
>   - fdt_overlays
>   - kernels_autodetect (lualoader only)
>

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14522

Whoops. =)
___
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: r330622 - head/stand/defaults

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:45:24 2018
New Revision: 330622
URL: https://svnweb.freebsd.org/changeset/base/330622

Log:
  loader.conf(5): Document some other settings
  
  These tend to have less coverage in other places and they don't have
  defaults as of yet, so mention them here:
  - fdt_overlays
  - kernels_autodetect (lualoader only)

Modified:
  head/stand/defaults/loader.conf.5

Modified: head/stand/defaults/loader.conf.5
==
--- head/stand/defaults/loader.conf.5   Wed Mar  7 18:41:16 2018
(r330621)
+++ head/stand/defaults/loader.conf.5   Wed Mar  7 18:45:24 2018
(r330622)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd January 6, 2016
+.Dd March 7, 2018
 .Dt LOADER.CONF 5
 .Os
 .Sh NAME
@@ -277,6 +277,23 @@ See the entropy entries in
 .Pq Dq /boot/entropy
 The name of the very early
 boot-time entropy cache file.
+.El
+.Sh OTHER SETTINGS
+Other settings that may be used in
+.Nm
+that have no default value:
+.Bl -tag -width bootfile -offset indent
+.It Va fdt_overlays
+Specifies a comma-delimited list of FDT overlays to apply.
+.Pa /boot/overlays
+is created by default for overlays to be placed in.
+.It Va kernels_autodetect
+If set to
+.Dq YES ,
+attempt to auto-detect kernels installed in
+.Pa /boot .
+This is an option specific to the Lua-based loader.
+It is not available in the default Forth-based loader.
 .El
 .Sh FILES
 .Bl -tag -width /boot/defaults/loader.conf -compact
___
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: r330621 - head/tools/boot

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:41:16 2018
New Revision: 330621
URL: https://svnweb.freebsd.org/changeset/base/330621

Log:
  lua-lint: Whitelist cli_execute_unparsed as a global

Modified:
  head/tools/boot/lua-lint.sh

Modified: head/tools/boot/lua-lint.sh
==
--- head/tools/boot/lua-lint.sh Wed Mar  7 18:37:04 2018(r330620)
+++ head/tools/boot/lua-lint.sh Wed Mar  7 18:41:16 2018(r330621)
@@ -16,4 +16,5 @@ LUACHECK=$(which luacheck)
 
 cd $(make -V SRCTOP)/stand
 ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \
-   --globals io.ischar --globals printc --globals cli_execute --std lua53
+   --globals io.ischar --globals printc --globals cli_execute \
+   --globals cli_execute_unparsed --std lua53
___
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: r330620 - head/stand/lua

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:37:04 2018
New Revision: 330620
URL: https://svnweb.freebsd.org/changeset/base/330620

Log:
  lualoader: Use cli_execute_unparsed for commands passed in via loader.conf
  
  This applies to:
  - exec
  - [module]_before
  - [module]_error
  - [module]_after
  
  Before this commit, these used loader.perform to execute them as a pure,
  unsalted loader command. This means that they were not able to take
  advantage of any Lua-salted loader commands, like boot and autoboot, or pure
  Lua loader commands (functions attached to the 'cli' module).
  
  They now have access to the full arsenal, just shy of being able to execute
  arbitrary Lua.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Wed Mar  7 18:31:31 2018(r330619)
+++ head/stand/lua/config.lua   Wed Mar  7 18:37:04 2018(r330620)
@@ -109,7 +109,7 @@ local pattern_table = {
{
str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, _)
-   if loader.perform(k) ~= 0 then
+   if cli_execute_unparsed(k) ~= 0 then
print(MSG_FAILEXEC:format(k))
end
end,
@@ -290,25 +290,25 @@ function config.loadmod(mod, silent)
str = str .. k
end
if v.before ~= nil then
-   pstatus = loader.perform(v.before) == 0
+   pstatus = cli_execute_unparsed(v.before) == 0
if not pstatus and not silent then
print(MSG_FAILEXBEF:format(v.before, k))
end
status = status and pstatus
end
 
-   if loader.perform(str) ~= 0 then
+   if cli_execute_unparsed(str) ~= 0 then
if not silent then
print(MSG_FAILEXMOD:format(str))
end
if v.error ~= nil then
-   loader.perform(v.error)
+   cli_execute_unparsed(v.error)
end
status = false
end
 
if v.after ~= nil then
-   pstatus = loader.perform(v.after) == 0
+   pstatus = cli_execute_unparsed(v.after) == 0
if not pstatus and not silent then
print(MSG_FAILEXAF:format(v.after, k))
end
___
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: r330619 - head/share/man/man9

2018-03-07 Thread Conrad Meyer
Author: cem
Date: Wed Mar  7 18:31:31 2018
New Revision: 330619
URL: https://svnweb.freebsd.org/changeset/base/330619

Log:
  fpu_kern.9: Document fpu_kern_enter API change in r329878
  
  While here, clean up some of the language.
  
  Reported by:  delphij
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/man/man9/fpu_kern.9

Modified: head/share/man/man9/fpu_kern.9
==
--- head/share/man/man9/fpu_kern.9  Wed Mar  7 18:31:01 2018
(r330618)
+++ head/share/man/man9/fpu_kern.9  Wed Mar  7 18:31:31 2018
(r330619)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 20, 2016
+.Dd March 7, 2018
 .Dt FPU_KERN 9
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Fn fpu_kern_alloc_ctx "u_int flags"
 .Ft void
 .Fn fpu_kern_free_ctx "struct fpu_kern_ctx *ctx"
-.Ft int
+.Ft void
 .Fn fpu_kern_enter "struct thread *td" "struct fpu_kern_ctx *ctx" "u_int flags"
 .Ft int
 .Fn fpu_kern_leave "struct thread *td" "struct fpu_kern_ctx *ctx"
@@ -139,19 +139,15 @@ after the function returns, as well as after each cont
 On i386 and amd64 this will be the
 .Nm Device Not Available
 exception (see Intel Software Developer Manual for the reference).
-Currently, no errors are defined which can be returned by
-.Fn fpu_kern_enter
-to the caller.
 .Pp
 The
 .Fn fpu_kern_leave
 function ends the region started by
 .Fn fpu_kern_enter .
-The uses of FPU in the kernel after the call to
-.Fn fpu_kern_leave
-are erroneous until the next call to
+It is erroneous to use the FPU in the kernel before
 .Fn fpu_kern_enter
-is performed.
+or after
+.Fn fpu_kern_leave .
 The function takes the
 .Fa td
 thread argument, which currently must be
@@ -161,9 +157,9 @@ and the
 context pointer, previously passed to
 .Fn fpu_kern_enter .
 After the function returns, the context may be freed or reused
-by other invocation of
+by another invocation of
 .Fn fpu_kern_enter .
-There are no errors defined for the function, it always returns 0.
+The function always returns 0.
 .Pp
 The
 .Fn fpu_kern_thread
@@ -210,3 +206,9 @@ facitily and this manual page were written by
 .An Konstantin Belousov Aq Mt k...@freebsd.org .
 The arm64 support was added by
 .An Andrew Turner Aq Mt and...@freebsd.org .
+.Sh BUGS
+.Fn fpu_kern_leave
+should probably have type
+.Ft void
+(like
+.Fn fpu_kern_enter ) .
___
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: r330618 - head/stand/lua

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:31:01 2018
New Revision: 330618
URL: https://svnweb.freebsd.org/changeset/base/330618

Log:
  lualoader: Use cli_execute_unparsed instead of loader.interpret
  
  loader.interpret should not be used for executing loader commands from an
  untrusted source (e.g. environment vars) as it will allow execution of
  arbitrary Lua. Replace it with a call to the recently introduced
  cli_execute_unparsed, which parses it out as a loader command and then
  dispatches it as a loader command. This effectively filters out arbitrary
  Lua.

Modified:
  head/stand/lua/menu.lua

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Wed Mar  7 18:28:41 2018(r330617)
+++ head/stand/lua/menu.lua Wed Mar  7 18:31:01 2018(r330618)
@@ -450,7 +450,7 @@ function menu.autoboot()
until time <= 0
 
local cmd = loader.getenv("menu_timeout_command") or "boot"
-   loader.interpret(cmd)
+   cli_execute_unparsed(cmd)
 end
 
 return menu
___
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: r330617 - head/stand/lua

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:28:41 2018
New Revision: 330617
URL: https://svnweb.freebsd.org/changeset/base/330617

Log:
  lualoader: Fix name, cli.execute_unparsed -> cli_execute_unparsed

Modified:
  head/stand/lua/cli.lua

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Wed Mar  7 18:25:27 2018(r330616)
+++ head/stand/lua/cli.lua  Wed Mar  7 18:28:41 2018(r330617)
@@ -94,7 +94,7 @@ function cli_execute(...)
 
 end
 
-function cli.execute_unparsed(str)
+function cli_execute_unparsed(str)
cli_execute(loader.parse(str))
 end
 
___
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: r330616 - in head/stand: liblua lua

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 18:25:27 2018
New Revision: 330616
URL: https://svnweb.freebsd.org/changeset/base/330616

Log:
  lualoader: Expose loader.parse and add cli_execute_unparsed
  
  This will be used for scenarios where the command to execute is coming in
  via the environment (from, for example, loader.conf(5)) and is thus not
  necessarily trusted.
  
  cli_execute_unparsed will immediately be used for handling
  module_{before,after,error} as well as menu_timeout_command. We still want
  to offer these variables the ability to execute Lua-intercepted loader
  commands, but we don't want them to be able to execute arbitrary Lua.
  
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D14580

Modified:
  head/stand/liblua/lutils.c
  head/stand/lua/cli.lua

Modified: head/stand/liblua/lutils.c
==
--- head/stand/liblua/lutils.c  Wed Mar  7 18:03:22 2018(r330615)
+++ head/stand/liblua/lutils.c  Wed Mar  7 18:25:27 2018(r330616)
@@ -97,6 +97,24 @@ lua_interpret(lua_State *L)
 }
 
 static int
+lua_parse(lua_State *L)
+{
+   int argc, nargc;
+   char**argv;
+
+   if (parse(, , luaL_checkstring(L, 1)) == 0) {
+   for (nargc = 0; nargc < argc; ++nargc) {
+   lua_pushstring(L, argv[nargc]);
+   }
+   free(argv);
+   return nargc;
+   }
+
+   lua_pushnil(L);
+   return 1;
+}
+
+static int
 lua_getchar(lua_State *L)
 {
 
@@ -325,6 +343,7 @@ static const struct luaL_Reg loaderlib[] = {
REG_SIMPLE(delay),
REG_SIMPLE(command),
REG_SIMPLE(interpret),
+   REG_SIMPLE(parse),
REG_SIMPLE(getenv),
REG_SIMPLE(perform),
/* Also registered as the global 'printc' */

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Wed Mar  7 18:03:22 2018(r330615)
+++ head/stand/lua/cli.lua  Wed Mar  7 18:25:27 2018(r330616)
@@ -94,6 +94,10 @@ function cli_execute(...)
 
 end
 
+function cli.execute_unparsed(str)
+   cli_execute(loader.parse(str))
+end
+
 -- Module exports
 
 function cli.boot(...)
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Pedro Giffuni

FWIW ...

ibcs2 is candidate for future removal.

We tried to get some vendor interest in it but we failed and given this 
is very i386-specific it is probably not worth spending huge efforts on it.


cloudabi seems to be, for all purposes, a better conceptual replacement.

Pedro.

On 07/03/2018 09:44, Eitan Adler wrote:

Author: eadler
Date: Wed Mar  7 14:44:32 2018
New Revision: 330601
URL: https://svnweb.freebsd.org/changeset/base/330601

Log:
   sys: Fix a few potential infoleaks in cloudabi
   
   While there is no immediate leak, if the structure changes underneath

   us, there might be in the future.
   
   Submitted by:	Domagoj Stolfa 

   MFC After:   1 month
   Sponsored by:DARPA/AFRL

Modified:
   head/sys/i386/ibcs2/ibcs2_ipc.c

Modified: head/sys/i386/ibcs2/ibcs2_ipc.c
==
--- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:41:29 2018
(r330600)
+++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:44:32 2018
(r330601)
@@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v)
struct msqid_ds bs;
int error;
  
+	memset(, 0, sizeof(is));

+
switch (uap->cmd) {
case IBCS2_IPC_STAT:
error = kern_msgctl(td, uap->msqid, IPC_STAT, );
@@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v)
union semun semun;
register_t rval;
int error;
+
+   memset(, 0, sizeof(is));
  
  	switch(uap->cmd) {

case IBCS2_IPC_STAT:



___
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: r330615 - in head/sys/amd64: include vmm/intel

2018-03-07 Thread Tycho Nightingale
Author: tychon
Date: Wed Mar  7 18:03:22 2018
New Revision: 330615
URL: https://svnweb.freebsd.org/changeset/base/330615

Log:
  Fix a lock recursion introduced in r327065.
  
  Reported by:  kmacy
  Reviewed by:  grehan, jhb
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D14548

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hWed Mar  7 17:37:36 2018
(r330614)
+++ head/sys/amd64/include/vmm.hWed Mar  7 18:03:22 2018
(r330615)
@@ -636,6 +636,7 @@ struct vm_exit {
} spinup_ap;
struct {
uint64_trflags;
+   uint64_tintr_status;
} hlt;
struct {
int vector;

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Wed Mar  7 17:37:36 2018
(r330614)
+++ head/sys/amd64/vmm/intel/vmx.c  Wed Mar  7 18:03:22 2018
(r330615)
@@ -2282,6 +2282,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1);
vmexit->exitcode = VM_EXITCODE_HLT;
vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS);
+   if (virtual_interrupt_delivery)
+   vmexit->u.hlt.intr_status =
+   vmcs_read(VMCS_GUEST_INTR_STATUS);
+   else
+   vmexit->u.hlt.intr_status = 0;
break;
case EXIT_REASON_MTF:
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1);
@@ -3267,12 +3272,13 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr)
 * interrupt by reevaluating virtual interrupts
 * following Section 29.2.1 in the Intel SDM Volume 3.
 */
-   uint64_t val;
+   struct vm_exit *vmexit;
uint8_t rvi, ppr;
 
-   vmx_getreg(vlapic_vtx->vmx, vlapic->vcpuid,
-   VMCS_IDENT(VMCS_GUEST_INTR_STATUS), );
-   rvi = val & APIC_TPR_INT;
+   vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid);
+   KASSERT(vmexit->exitcode == VM_EXITCODE_HLT,
+   ("vmx_pending_intr: exitcode not 'HLT'"));
+   rvi = vmexit->u.hlt.intr_status & APIC_TPR_INT;
lapic = vlapic->apic_page;
ppr = lapic->ppr & APIC_TPR_INT;
if (rvi > ppr) {
___
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: r330614 - head/share/man/man5

2018-03-07 Thread Ed Maste
Author: emaste
Date: Wed Mar  7 17:37:36 2018
New Revision: 330614
URL: https://svnweb.freebsd.org/changeset/base/330614

Log:
  Regen src.conf.5 after r330613 CROSS_TOOLCHAIN change

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Mar  7 17:33:41 2018
(r330613)
+++ head/share/man/man5/src.conf.5  Wed Mar  7 17:37:36 2018
(r330614)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd March 1, 2018
+.Dd March 7, 2018
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -397,6 +397,8 @@ When set, it enforces these options:
 .Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
 .It
 .Va WITHOUT_GCC_BOOTSTRAP
+.It
+.Va WITHOUT_LLD_BOOTSTRAP
 .El
 .It Va WITHOUT_CRYPT
 Set to not build any crypto code.
___
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: r330613 - head/share/mk

2018-03-07 Thread Ed Maste
Author: emaste
Date: Wed Mar  7 17:33:41 2018
New Revision: 330613
URL: https://svnweb.freebsd.org/changeset/base/330613

Log:
  Disable LLD_BOOTSTRAP under WITHOUT_CROSS_COMPILER
  
  LLD is a cross toolchain component. It shouldn't be built when
  requesting a build without building a cross compiler.
  
  (CROSS_COMPILER is somewhat unfortunately named; in any case, lld
  should be treated as GNU binutils here.)
  
  Submitted by: Dan McGregor 
  MFC after:1 week

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

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Wed Mar  7 17:18:46 2018(r330612)
+++ head/share/mk/src.opts.mk   Wed Mar  7 17:33:41 2018(r330613)
@@ -437,6 +437,7 @@ MK_BINUTILS_BOOTSTRAP:= no
 MK_CLANG_BOOTSTRAP:= no
 MK_ELFTOOLCHAIN_BOOTSTRAP:= no
 MK_GCC_BOOTSTRAP:= no
+MK_LLD_BOOTSTRAP:= no
 .endif
 
 .if ${MK_TOOLCHAIN} == "no"
___
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: r330575 - in head/sys: conf dev/acpica dev/pci

2018-03-07 Thread John Baldwin
On Wednesday, March 07, 2018 10:47:27 AM Andrew Turner wrote:
> Author: andrew
> Date: Wed Mar  7 10:47:27 2018
> New Revision: 330575
> URL: https://svnweb.freebsd.org/changeset/base/330575
> 
> Log:
>   Add an acpi attachment to the pci_host_generic driver and have the ACPI
>   bus provide it with its needed memory resources.
>   
>   This allows us to use PCIe on the ThunderX2 and, with a previous version
>   of the patch, on the SoftIron 3000 with ACPI.
>   
>   Obtained from:  ABT Systems Ltd
>   Sponsored by:   The FreeBSD Foundation
>   Sponsored by:   DARPA, AFRL
>   Sponsored by:   Cavium (Hardware)
>   Differential Revision:  https://reviews.freebsd.org/D8767
> 
> Added:
>   head/sys/dev/pci/pci_host_generic_acpi.c   (contents, props changed)
> Modified:
>   head/sys/conf/files.arm64
>   head/sys/dev/acpica/acpi.c
> 
> Modified: head/sys/conf/files.arm64
> ==
> --- head/sys/conf/files.arm64 Wed Mar  7 09:58:36 2018(r330574)
> +++ head/sys/conf/files.arm64 Wed Mar  7 10:47:27 2018(r330575)
> @@ -171,6 +171,8 @@ crypto/blowfish/bf_enc.c  optionalcrypto | ipsec 
> | ips
>  crypto/des/des_enc.c optionalcrypto | ipsec | ipsec_support 
> | netsmb
>  dev/acpica/acpi_bus_if.m optionalacpi
>  dev/acpica/acpi_if.m optionalacpi
> +dev/acpica/acpi_pci_link.c   optionalacpi pci
> +dev/acpica/acpi_pcib.c   optionalacpi pci
>  dev/ahci/ahci_generic.c  optionalahci
>  dev/axgbe/if_axgbe.c optionalaxgbe
>  dev/axgbe/xgbe-desc.coptionalaxgbe
> @@ -191,6 +193,7 @@ dev/neta/if_mvneta.c  optionalneta 
> mdio mii
>  dev/ofw/ofw_cpu.coptionalfdt
>  dev/ofw/ofwpci.c optionalfdt pci
>  dev/pci/pci_host_generic.c   optionalpci
> +dev/pci/pci_host_generic_acpi.c  optionalpci acpi
>  dev/pci/pci_host_generic_fdt.c   optionalpci fdt
>  dev/psci/psci.c  optionalpsci
>  dev/psci/psci_arm64.Soptionalpsci
> 
> Modified: head/sys/dev/acpica/acpi.c
> ==
> --- head/sys/dev/acpica/acpi.cWed Mar  7 09:58:36 2018
> (r330574)
> +++ head/sys/dev/acpica/acpi.cWed Mar  7 10:47:27 2018
> (r330575)
> @@ -1883,6 +1883,29 @@ acpi_enable_pcie(void)
>   alloc++;
>   }
>  }
> +#elif defined(__aarch64__)
> +static void
> +acpi_enable_pcie(device_t child, int segment)
> +{
> + ACPI_TABLE_HEADER *hdr;
> + ACPI_MCFG_ALLOCATION *alloc, *end;
> + ACPI_STATUS status;
> +
> + status = AcpiGetTable(ACPI_SIG_MCFG, 1, );
> + if (ACPI_FAILURE(status))
> + return;
> +
> + end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length);
> + alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1);
> + while (alloc < end) {
> + if (alloc->PciSegment == segment) {
> + bus_set_resource(child, SYS_RES_MEMORY, 0,
> + alloc->Address, 0x1000);
> + return;
> + }
> + alloc++;
> + }
> +}
>  #endif
>  
>  /*
> @@ -1974,6 +1997,9 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi
>  {
>  ACPI_DEVICE_INFO *devinfo;
>  struct acpi_device   *ad;
> +#ifdef __aarch64__
> +int segment;
> +#endif
>  struct acpi_prw_data prw;
>  ACPI_OBJECT_TYPE type;
>  ACPI_HANDLE h;
> @@ -2076,6 +2102,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi
>   ad->ad_cls_class = strtoul(devinfo->ClassCode.String,
>   NULL, 16);
>   }
> +#ifdef __aarch64__
> + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
> + if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", 
> ))) {
> + acpi_enable_pcie(child, segment);
> + }
> + }
> +#endif
>   AcpiOsFree(devinfo);
>   }
>   break;

This logic probably belongs in the attach routine of the pcib driver rather
than in MD #ifdef's in acpi.c.  I still think we should be using 
acpi_pcib_acpi.c
on arm64.  IIRC all that is required is using a layer of indirection for PCI
config access (using the existing pcib_if.m methods in the parent of acpi0 would
work for this).

-- 
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: r330611 - in releng: 10.3/sys/netipsec 10.4/sys/netipsec

2018-03-07 Thread Gordon Tetlow
Author: gordon
Date: Wed Mar  7 17:16:41 2018
New Revision: 330611
URL: https://svnweb.freebsd.org/changeset/base/330611

Log:
  Correct patch for ipsec vulnerability.
  
  Approved by:  so
  Security: FreeBSD-SA-18:01.netipsec

Modified:
  releng/10.3/sys/netipsec/xform_ah.c
  releng/10.4/sys/netipsec/xform_ah.c

Modified: releng/10.3/sys/netipsec/xform_ah.c
==
--- releng/10.3/sys/netipsec/xform_ah.c Wed Mar  7 17:08:07 2018
(r330610)
+++ releng/10.3/sys/netipsec/xform_ah.c Wed Mar  7 17:16:41 2018
(r330611)
@@ -619,11 +619,11 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski
DPRINTF(("%s: bad mbuf length %u (expecting %lu)"
" for packet in SA %s/%08lx\n", __func__,
m->m_pkthdr.len, (u_long) (skip + authsize + rplen),
-   ipsec_address(>sah->saidx.dst, buf, sizeof(buf)),
+   ipsec_address(>sah->saidx.dst),
(u_long) ntohl(sav->spi)));
AHSTAT_INC(ahs_badauthl);
-   error = EACCES;
-   goto bad;
+   m_freem(m);
+   return EACCES;
}
AHSTAT_ADD(ahs_ibytes, m->m_pkthdr.len - skip - hl);
 

Modified: releng/10.4/sys/netipsec/xform_ah.c
==
--- releng/10.4/sys/netipsec/xform_ah.c Wed Mar  7 17:08:07 2018
(r330610)
+++ releng/10.4/sys/netipsec/xform_ah.c Wed Mar  7 17:16:41 2018
(r330611)
@@ -619,11 +619,11 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski
DPRINTF(("%s: bad mbuf length %u (expecting %lu)"
" for packet in SA %s/%08lx\n", __func__,
m->m_pkthdr.len, (u_long) (skip + authsize + rplen),
-   ipsec_address(>sah->saidx.dst, buf, sizeof(buf)),
+   ipsec_address(>sah->saidx.dst),
(u_long) ntohl(sav->spi)));
AHSTAT_INC(ahs_badauthl);
-   error = EACCES;
-   goto bad;
+   m_freem(m);
+   return EACCES;
}
AHSTAT_ADD(ahs_ibytes, m->m_pkthdr.len - skip - hl);
 
___
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: r330612 - head/stand/ficl

2018-03-07 Thread Kyle Evans
Author: kevans
Date: Wed Mar  7 17:18:46 2018
New Revision: 330612
URL: https://svnweb.freebsd.org/changeset/base/330612

Log:
  stand/ficl: Fix testmain
  
  testmain is a userland application intended to be built with standard
  headers and whatnot, which we broke.
  
  Fix it by having the testmain build clobber cflags, reducing it to just the
  set of defines/includes it needs to build.
  
  Discussed with:   imp
  MFC after:3 days

Modified:
  head/stand/ficl/Makefile

Modified: head/stand/ficl/Makefile
==
--- head/stand/ficl/MakefileWed Mar  7 17:16:41 2018(r330611)
+++ head/stand/ficl/MakefileWed Mar  7 17:18:46 2018(r330612)
@@ -13,7 +13,8 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c
 CLEANFILES+=   softcore.c testmain testmain.o
 
 .ifmake testmain
-CFLAGS+=   -DTESTMAIN -D_TESTMAIN
+CFLAGS=-DTESTMAIN -D_TESTMAIN
+CFLAGS+=   -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
 SRCS+= testmain.c
 PROG=  testmain
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-03-07 Thread Conrad Meyer
On Wed, Mar 7, 2018 at 7:23 AM, Hans Petter Selasky
 wrote:
> Author: hselasky
> Date: Wed Mar  7 15:23:07 2018
> New Revision: 330608
> URL: https://svnweb.freebsd.org/changeset/base/330608
>
> Log:
>   Implement priority to traffic class mapping in mlx5core.
>
>   Add support for mapping priority to traffic class via sysctl
>
>   Submitted by: Slava Shwartsman 

Didn't we just give this guy a commit bit?  You can get him committing
his own changes :-).

Best,
Conrad
___
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: r330610 - in head/sys: dev/vt/hw/ofwfb powerpc/aim powerpc/include powerpc/ofw powerpc/powerpc powerpc/ps3

2018-03-07 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Mar  7 17:08:07 2018
New Revision: 330610
URL: https://svnweb.freebsd.org/changeset/base/330610

Log:
  Move the powerpc64 direct map base address from zero to high memory. This
  accomplishes a few things:
  - Makes NULL an invalid address in the kernel, which is useful for catching
bugs.
  - Lays groundwork for radix-tree translation on POWER9, which requires the
direct map be at high memory.
  - Similarly lays groundwork for a direct map on 64-bit Book-E.
  
  The new base address is chosen as the base of the fourth radix quadrant
  (the minimum kernel address in this translation mode) and because all
  supported CPUs ignore at least the first two bits of addresses in real
  mode, allowing direct-map addresses to be used in real-mode handlers.
  This is required by Linux and is part of the architecture standard
  starting in POWER ISA 3, so can be relied upon.
  
  Reviewed by:  jhibbits, Breno Leitao
  Differential Revision:D14499

Modified:
  head/sys/dev/vt/hw/ofwfb/ofwfb.c
  head/sys/powerpc/aim/aim_machdep.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/moea64_native.c
  head/sys/powerpc/aim/slb.c
  head/sys/powerpc/aim/trap_subr64.S
  head/sys/powerpc/include/sr.h
  head/sys/powerpc/include/vmparam.h
  head/sys/powerpc/ofw/ofw_machdep.c
  head/sys/powerpc/ofw/ofw_real.c
  head/sys/powerpc/powerpc/bus_machdep.c
  head/sys/powerpc/powerpc/genassym.c
  head/sys/powerpc/powerpc/mem.c
  head/sys/powerpc/powerpc/uma_machdep.c
  head/sys/powerpc/ps3/platform_ps3.c

Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c
==
--- head/sys/dev/vt/hw/ofwfb/ofwfb.cWed Mar  7 16:55:15 2018
(r330609)
+++ head/sys/dev/vt/hw/ofwfb/ofwfb.cWed Mar  7 17:08:07 2018
(r330610)
@@ -489,7 +489,7 @@ ofwfb_init(struct vt_device *vd)
#if defined(__powerpc__)
OF_decode_addr(node, fb_phys, >sc_memt, >fb.fb_vbase,
NULL);
-   sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */
+   sc->fb.fb_pbase = sc->fb.fb_vbase & ~DMAP_BASE_ADDRESS;
#ifdef __powerpc64__
/* Real mode under a hypervisor probably doesn't cover FB */
if (!(mfmsr() & (PSL_HV | PSL_DR)))

Modified: head/sys/powerpc/aim/aim_machdep.c
==
--- head/sys/powerpc/aim/aim_machdep.c  Wed Mar  7 16:55:15 2018
(r330609)
+++ head/sys/powerpc/aim/aim_machdep.c  Wed Mar  7 17:08:07 2018
(r330610)
@@ -455,11 +455,33 @@ va_to_vsid(pmap_t pm, vm_offset_t va)
 
 #endif
 
+/*
+ * These functions need to provide addresses that both (a) work in real mode
+ * (or whatever mode/circumstances the kernel is in in early boot (now)) and
+ * (b) can still, in principle, work once the kernel is going. Because these
+ * rely on existing mappings/real mode, unmap is a no-op.
+ */
 vm_offset_t
 pmap_early_io_map(vm_paddr_t pa, vm_size_t size)
 {
+   KASSERT(!pmap_bootstrapped, ("Not available after PMAP started!"));
 
-   return (pa);
+   /*
+* If we have the MMU up in early boot, assume it is 1:1. Otherwise,
+* try to get the address in a memory region compatible with the
+* direct map for efficiency later.
+*/
+   if (mfmsr() & PSL_DR)
+   return (pa);
+   else
+   return (DMAP_BASE_ADDRESS + pa);
+}
+
+void
+pmap_early_io_unmap(vm_offset_t va, vm_size_t size)
+{
+
+   KASSERT(!pmap_bootstrapped, ("Not available after PMAP started!"));
 }
 
 /* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cWed Mar  7 16:55:15 2018
(r330609)
+++ head/sys/powerpc/aim/mmu_oea64.cWed Mar  7 17:08:07 2018
(r330610)
@@ -551,7 +551,8 @@ moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, siz
/* If this address is direct-mapped, skip remapping */
if (hw_direct_map &&
translations[i].om_va == PHYS_TO_DMAP(pa_base) &&
-   moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) 
== LPTE_M)
+   moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT)
+   == LPTE_M)
continue;
 
PMAP_LOCK(kernel_pmap);
@@ -664,25 +665,26 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel
  }
}
PMAP_UNLOCK(kernel_pmap);
-   } else {
-   size = moea64_bpvo_pool_size*sizeof(struct pvo_entry);
-   off = (vm_offset_t)(moea64_bpvo_pool);
-   for (pa = off; pa < off + size; pa += PAGE_SIZE) 
-  

svn commit: r330609 - stable/10/sys/netipsec

2018-03-07 Thread Gordon Tetlow
Author: gordon
Date: Wed Mar  7 16:55:15 2018
New Revision: 330609
URL: https://svnweb.freebsd.org/changeset/base/330609

Log:
  Fixup the AH patch to properly compile.

Modified:
  stable/10/sys/netipsec/xform_ah.c

Modified: stable/10/sys/netipsec/xform_ah.c
==
--- stable/10/sys/netipsec/xform_ah.c   Wed Mar  7 15:23:07 2018
(r330608)
+++ stable/10/sys/netipsec/xform_ah.c   Wed Mar  7 16:55:15 2018
(r330609)
@@ -603,11 +603,11 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski
DPRINTF(("%s: bad mbuf length %u (expecting %lu)"
" for packet in SA %s/%08lx\n", __func__,
m->m_pkthdr.len, (u_long) (skip + authsize + rplen),
-   ipsec_address(>sah->saidx.dst, buf, sizeof(buf)),
+   ipsec_address(>sah->saidx.dst),
(u_long) ntohl(sav->spi)));
AHSTAT_INC(ahs_badauthl);
-   error = EACCES;
-   goto bad;
+   m_freem(m);
+   return EACCES;
}
AHSTAT_ADD(ahs_ibytes, m->m_pkthdr.len - skip - hl);
 
___
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: r330602 - head/sys/compat/cloudabi

2018-03-07 Thread Warner Losh
On Wed, Mar 7, 2018 at 8:44 AM, Ed Maste  wrote:

> On 7 March 2018 at 09:47, Eitan Adler  wrote:
> > Author: eadler
> > Date: Wed Mar  7 14:47:43 2018
> > New Revision: 330602
> > URL: https://svnweb.freebsd.org/changeset/base/330602
> >
> > Log:
> >   sys/cloudabi: Avoid relying on GNU specific extensions
> >
> >   An empty initializer list is not technically valid C grammar.
> >
> >   MFC After:1 week
> >
> > -   cloudabi_fdstat_t fsb = {};
> > +   cloudabi_fdstat_t fsb = {0};
>
> In practice it appears initializing via { 0 } also zeros any padding
> in the struct, but I do not believe it's required by the C standard.
> Perhaps a language lawyer can weigh in?
>

All the standard says are that all named are initialized to 0 (which has
the usual meaning for the integer 0 for pointers) unless otherwise stated:

6.7.8 para 9:

"Except where explicitly stated otherwise, for the purposes of this
subclause unnamed members of objects of structure and union type do not
participate in initialization. Unnamed members of structure objects have
indeterminate value even after initialization."

6.7.8 para 21:

"If there are fewer initializers in a brace-enclosed list than there are
elements or members of an aggregate, or fewer characters in a string
literal used to initialize an array of known size than there are elements
in the array, the remainder of the aggregate shall be initialized
implicitly the same as objects that have static storage duration."

The aggregate here, I believe refers to the elements, not the padded
structure, and the padding is definitely an unnamed part of the structure,
which makes it unspecified.

However 6.7.8 is quite long and detailed, and I'm not 100% sure I have
totally grokked all its subtle implications.

Commenting on this commit just because it's highlighted by this
> change; I do not believe there's a difference between the GNU
> extension { } and { 0 } here.
>

I believe that's correct as well.

Warner
___
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: r330602 - head/sys/compat/cloudabi

2018-03-07 Thread Benjamin Kaduk
On Wed, Mar 7, 2018 at 9:44 AM, Ed Maste  wrote:

> On 7 March 2018 at 09:47, Eitan Adler  wrote:
> > Author: eadler
> > Date: Wed Mar  7 14:47:43 2018
> > New Revision: 330602
> > URL: https://svnweb.freebsd.org/changeset/base/330602
> >
> > Log:
> >   sys/cloudabi: Avoid relying on GNU specific extensions
> >
> >   An empty initializer list is not technically valid C grammar.
> >
> >   MFC After:1 week
> >
> > -   cloudabi_fdstat_t fsb = {};
> > +   cloudabi_fdstat_t fsb = {0};
>
> In practice it appears initializing via { 0 } also zeros any padding
> in the struct, but I do not believe it's required by the C standard.
> Perhaps a language lawyer can weigh in?
>
> Commenting on this commit just because it's highlighted by this
> change; I do not believe there's a difference between the GNU
> extension { } and { 0 } here.
>
>
The C spec says that if an incomplete initializer is given, then all other
fields
of the structure are initialized to zero.  The state of padding is
unspecified,
whether a complete or incomplete initializer is given.

The "issue" being "fixed" here is that the formal C grammar does not
admit a totally empty initializer, so at least one element of the
initializer
needs to be given in order to satisfy the grammar.  This is pretty silly,
and the extension to allow a totally empty initializer a quite natural one
to make.

-Ben
___
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: r330602 - head/sys/compat/cloudabi

2018-03-07 Thread Ed Maste
On 7 March 2018 at 09:47, Eitan Adler  wrote:
> Author: eadler
> Date: Wed Mar  7 14:47:43 2018
> New Revision: 330602
> URL: https://svnweb.freebsd.org/changeset/base/330602
>
> Log:
>   sys/cloudabi: Avoid relying on GNU specific extensions
>
>   An empty initializer list is not technically valid C grammar.
>
>   MFC After:1 week
>
> -   cloudabi_fdstat_t fsb = {};
> +   cloudabi_fdstat_t fsb = {0};

In practice it appears initializing via { 0 } also zeros any padding
in the struct, but I do not believe it's required by the C standard.
Perhaps a language lawyer can weigh in?

Commenting on this commit just because it's highlighted by this
change; I do not believe there's a difference between the GNU
extension { } and { 0 } here.
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Warner Losh
The message is right if you s/cloudabi/ibcs/ though.

Warner

On Wed, Mar 7, 2018 at 8:29 AM, Oliver Pinter  wrote:

> Wrong commit message. IBCS isn't cloudabi.
>
> On Wednesday, March 7, 2018, Eitan Adler  wrote:
>
>> Author: eadler
>> Date: Wed Mar  7 14:44:32 2018
>> New Revision: 330601
>> URL: https://svnweb.freebsd.org/changeset/base/330601
>>
>> Log:
>>   sys: Fix a few potential infoleaks in cloudabi
>>
>>   While there is no immediate leak, if the structure changes underneath
>>   us, there might be in the future.
>>
>>   Submitted by: Domagoj Stolfa 
>>   MFC After:1 month
>>   Sponsored by: DARPA/AFRL
>>
>> Modified:
>>   head/sys/i386/ibcs2/ibcs2_ipc.c
>>
>> Modified: head/sys/i386/ibcs2/ibcs2_ipc.c
>> 
>> ==
>> --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:41:29 2018
>> (r330600)
>> +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:44:32 2018
>> (r330601)
>> @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v)
>> struct msqid_ds bs;
>> int error;
>>
>> +   memset(, 0, sizeof(is));
>> +
>> switch (uap->cmd) {
>> case IBCS2_IPC_STAT:
>> error = kern_msgctl(td, uap->msqid, IPC_STAT, );
>> @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v)
>> union semun semun;
>> register_t rval;
>> int error;
>> +
>> +   memset(, 0, sizeof(is));
>>
>> switch(uap->cmd) {
>> case IBCS2_IPC_STAT:
>> ___
>> svn-src-h...@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>>
>
___
svn-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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Oliver Pinter
Wrong commit message. IBCS isn't cloudabi.

On Wednesday, March 7, 2018, Eitan Adler  wrote:

> Author: eadler
> Date: Wed Mar  7 14:44:32 2018
> New Revision: 330601
> URL: https://svnweb.freebsd.org/changeset/base/330601
>
> Log:
>   sys: Fix a few potential infoleaks in cloudabi
>
>   While there is no immediate leak, if the structure changes underneath
>   us, there might be in the future.
>
>   Submitted by: Domagoj Stolfa 
>   MFC After:1 month
>   Sponsored by: DARPA/AFRL
>
> Modified:
>   head/sys/i386/ibcs2/ibcs2_ipc.c
>
> Modified: head/sys/i386/ibcs2/ibcs2_ipc.c
> 
> ==
> --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:41:29 2018
> (r330600)
> +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:44:32 2018
> (r330601)
> @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v)
> struct msqid_ds bs;
> int error;
>
> +   memset(, 0, sizeof(is));
> +
> switch (uap->cmd) {
> case IBCS2_IPC_STAT:
> error = kern_msgctl(td, uap->msqid, IPC_STAT, );
> @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v)
> union semun semun;
> register_t rval;
> int error;
> +
> +   memset(, 0, sizeof(is));
>
> switch(uap->cmd) {
> case IBCS2_IPC_STAT:
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-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: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 15:23:07 2018
New Revision: 330608
URL: https://svnweb.freebsd.org/changeset/base/330608

Log:
  Implement priority to traffic class mapping in mlx5core.
  
  Add support for mapping priority to traffic class via sysctl
  
  Submitted by: Slava Shwartsman 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_port.c
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
  head/sys/dev/mlx5/port.h

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:17:36 2018
(r330607)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:23:07 2018
(r330608)
@@ -943,6 +943,48 @@ int mlx5_modify_port_tc_rate_limit(struct mlx5_core_de
 }
 EXPORT_SYMBOL_GPL(mlx5_modify_port_tc_rate_limit);
 
+int mlx5_query_port_prio_tc(struct mlx5_core_dev *mdev,
+   u8 prio, u8 *tc)
+{
+   u32 in[MLX5_ST_SZ_DW(qtct_reg)];
+   u32 out[MLX5_ST_SZ_DW(qtct_reg)];
+   int err;
+
+   memset(in, 0, sizeof(in));
+   memset(out, 0, sizeof(out));
+
+   MLX5_SET(qtct_reg, in, port_number, 1);
+   MLX5_SET(qtct_reg, in, prio, prio);
+
+   err = mlx5_core_access_reg(mdev, in, sizeof(in), out,
+  sizeof(out), MLX5_REG_QTCT, 0, 0);
+   if (!err)
+   *tc = MLX5_GET(qtct_reg, out, tclass);
+
+   return err;
+}
+EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc);
+
+int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, int prio_index,
+ const u8 prio_tc)
+{
+   u32 in[MLX5_ST_SZ_DW(qtct_reg)] = {};
+   u32 out[MLX5_ST_SZ_DW(qtct_reg)];
+   int err;
+
+   if (prio_tc > mlx5_max_tc(mdev))
+   return -EINVAL;
+
+   MLX5_SET(qtct_reg, in, prio, prio_index);
+   MLX5_SET(qtct_reg, in, tclass, prio_tc);
+
+   err = mlx5_core_access_reg(mdev, in, sizeof(in), out,
+  sizeof(out), MLX5_REG_QTCT, 0, 1);
+
+   return (err);
+}
+EXPORT_SYMBOL_GPL(mlx5_set_port_prio_tc);
+
 int mlx5_modify_port_cong_params(struct mlx5_core_dev *mdev,
 void *in, int in_size)
 {

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Wed Mar  7 15:17:36 2018
(r330607)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Wed Mar  7 15:23:07 2018
(r330608)
@@ -429,6 +429,7 @@ struct mlx5e_params_ethtool {
u64 arg [0];
MLX5E_PARAMS(MLX5E_STATS_VAR)
u64 max_bw_value[IEEE_8021QAZ_MAX_TCS];
+   u8  prio_tc[IEEE_8021QAZ_MAX_TCS];
 };
 
 /* EEPROM Standards for plug in modules */

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar  7 15:17:36 2018
(r330607)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar  7 15:23:07 2018
(r330608)
@@ -175,6 +175,60 @@ done:
return (err);
 }
 
+static int
+mlx5e_get_prio_tc(struct mlx5e_priv *priv)
+{
+   struct mlx5_core_dev *mdev = priv->mdev;
+   int err = 0;
+   int i;
+
+   PRIV_LOCK(priv);
+   if (!MLX5_CAP_GEN(priv->mdev, ets)) {
+   PRIV_UNLOCK(priv);
+   return (EOPNOTSUPP);
+   }
+
+   for (i = 0; i <= mlx5_max_tc(priv->mdev); i++) {
+   err = -mlx5_query_port_prio_tc(mdev, i, 
&(priv->params_ethtool.prio_tc[i]));
+   if (err)
+   break;
+   }
+
+   PRIV_UNLOCK(priv);
+   return (err);
+}
+
+static int
+mlx5e_prio_to_tc_handler(SYSCTL_HANDLER_ARGS)
+{
+   struct mlx5e_priv *priv = arg1;
+   int prio_index = arg2;
+   struct mlx5_core_dev *mdev = priv->mdev;
+   int err;
+   uint8_t result = priv->params_ethtool.prio_tc[prio_index];
+
+   PRIV_LOCK(priv);
+   err = sysctl_handle_8(oidp, , 0, req);
+   if (err || !req->newptr ||
+   result == priv->params_ethtool.prio_tc[prio_index])
+   goto done;
+
+   if (result > mlx5_max_tc(mdev)) {
+   err = ERANGE;
+   goto done;
+   }
+
+   err = -mlx5_set_port_prio_tc(mdev, prio_index, result);
+   if (err)
+   goto done;
+
+   priv->params_ethtool.prio_tc[prio_index] = result;
+
+done:
+   PRIV_UNLOCK(priv);
+   return (err);
+}
+
 #defineMLX5_PARAM_OFFSET(n)\
 __offsetof(struct mlx5e_priv, params_ethtool.n)
 
@@ -943,5 +997,17 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv)
priv, i, mlx5e_tc_maxrate_handler, "QU",
"Max rate for priority, specified in 

svn commit: r330607 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 15:17:36 2018
New Revision: 330607
URL: https://svnweb.freebsd.org/changeset/base/330607

Log:
  Implement rate limit per traffic class in mlx5core.
  
  Add support for rate limiting traffic class via sysctl.
  
  Submitted by: Slava Shwartsman 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_port.c
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
  head/sys/dev/mlx5/mlx5_ifc.h
  head/sys/dev/mlx5/port.h

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:03:11 2018
(r330606)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:17:36 2018
(r330607)
@@ -860,6 +860,89 @@ int mlx5_query_port_cong_params(struct mlx5_core_dev *
  out, out_size);
 }
 
+static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out,
+int outlen)
+{
+   u32 in[MLX5_ST_SZ_DW(qtct_reg)];
+
+   if (!MLX5_CAP_GEN(mdev, ets))
+   return -ENOTSUPP;
+
+   memset(in, 0, sizeof(in));
+   return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen,
+   MLX5_REG_QETCR, 0, 0);
+}
+
+int mlx5_max_tc(struct mlx5_core_dev *mdev)
+{
+   u8 num_tc = MLX5_CAP_GEN(mdev, max_tc) ? : 8;
+
+   return num_tc - 1;
+}
+EXPORT_SYMBOL_GPL(mlx5_max_tc);
+
+static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in,
+  int inlen)
+{
+   u32 out[MLX5_ST_SZ_DW(qtct_reg)];
+
+   if (!MLX5_CAP_GEN(mdev, ets))
+   return -ENOTSUPP;
+
+   return mlx5_core_access_reg(mdev, in, inlen, out, sizeof(out),
+   MLX5_REG_QETCR, 0, 1);
+}
+
+int mlx5_query_port_tc_rate_limit(struct mlx5_core_dev *mdev,
+  u8 *max_bw_value,
+  u8 *max_bw_units)
+{
+   u32 out[MLX5_ST_SZ_DW(qetc_reg)];
+   void *ets_tcn_conf;
+   int err;
+   int i;
+
+   err = mlx5_query_port_qetcr_reg(mdev, out, sizeof(out));
+   if (err)
+   return err;
+
+   for (i = 0; i <= mlx5_max_tc(mdev); i++) {
+   ets_tcn_conf = MLX5_ADDR_OF(qetc_reg, out, tc_configuration[i]);
+
+   max_bw_value[i] = MLX5_GET(ets_tcn_config_reg, ets_tcn_conf,
+  max_bw_value);
+   max_bw_units[i] = MLX5_GET(ets_tcn_config_reg, ets_tcn_conf,
+  max_bw_units);
+   }
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(mlx5_query_port_tc_rate_limit);
+
+int mlx5_modify_port_tc_rate_limit(struct mlx5_core_dev *mdev,
+  const u8 *max_bw_value,
+  const u8 *max_bw_units)
+{
+   u32 in[MLX5_ST_SZ_DW(qetc_reg)] = {};
+   void *ets_tcn_conf;
+   int i;
+
+   MLX5_SET(qetc_reg, in, port_number, 1);
+
+   for (i = 0; i <= mlx5_max_tc(mdev); i++) {
+   ets_tcn_conf = MLX5_ADDR_OF(qetc_reg, in, tc_configuration[i]);
+
+   MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, r, 1);
+   MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, max_bw_units,
+max_bw_units[i]);
+   MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, max_bw_value,
+max_bw_value[i]);
+   }
+
+   return mlx5_set_port_qetcr_reg(mdev, in, sizeof(in));
+}
+EXPORT_SYMBOL_GPL(mlx5_modify_port_tc_rate_limit);
+
 int mlx5_modify_port_cong_params(struct mlx5_core_dev *mdev,
 void *in, int in_size)
 {

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Wed Mar  7 15:03:11 2018
(r330606)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Wed Mar  7 15:17:36 2018
(r330607)
@@ -70,6 +70,8 @@
 #include 
 #include 
 
+#defineIEEE_8021QAZ_MAX_TCS8
+
 #defineMLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE0x7
 #defineMLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE0xa
 #defineMLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE0xe
@@ -114,6 +116,9 @@
   (MLX5E_MAX_TX_HEADER - sizeof(struct mlx5e_tx_wqe) + \
   sizeof(((struct mlx5e_tx_wqe *)0)->eth.inline_hdr_start))/* bytes */
 
+#defineMLX5E_100MB (10)
+#defineMLX5E_1GB   (100)
+
 MALLOC_DECLARE(M_MLX5EN);
 
 struct mlx5_core_dev;
@@ -417,11 +422,13 @@ struct mlx5e_params {
   m(+1, u64 mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 
1: Disabled") \
   m(+1, u64 uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: 
Disabled")
 
+
 #defineMLX5E_PARAMS_NUM (0 

svn commit: r330606 - in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 15:03:11 2018
New Revision: 330606
URL: https://svnweb.freebsd.org/changeset/base/330606

Log:
  Implement missing query for current port rate in mlx5ib(4).
  
  - Factor out port speed definitions into new port.h header file,
similarly as done in Linux upstream.
  - Correct two existing port speed definitions in mlx5en according to
Linux upstream.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/dev/mlx5/port.h   (contents, props changed)
Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
  head/sys/dev/mlx5/mlx5_core/mlx5_port.c
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Wed Mar  7 15:02:13 2018(r330605)
+++ head/sys/dev/mlx5/driver.h  Wed Mar  7 15:03:11 2018(r330606)
@@ -928,41 +928,7 @@ int mlx5_core_access_reg(struct mlx5_core_dev *dev, vo
 u16 reg_num, int arg, int write);
 
 void mlx5_toggle_port_link(struct mlx5_core_dev *dev);
-int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);
-int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,
-int ptys_size, int proto_mask);
-int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev,
- u32 *proto_cap, int proto_mask);
-int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask,
-   u8 *an_disable_cap, u8 *an_disable_status);
-int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable,
- u32 eth_proto_admin, int proto_mask);
-int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev,
-   u32 *proto_admin, int proto_mask);
-int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin,
-   int proto_mask);
-int mlx5_set_port_status(struct mlx5_core_dev *dev,
-enum mlx5_port_status status);
-int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status);
-int mlx5_query_port_admin_status(struct mlx5_core_dev *dev,
-enum mlx5_port_status *status);
-int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port,
-   u32 rx_pause, u32 tx_pause);
-int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port,
- u32 *rx_pause, u32 *tx_pause);
-int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx);
-int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 
*pfc_en_rx);
 
-int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu);
-int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu);
-int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu);
-
-unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int 
module_num);
-int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num);
-int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i2c_addr, int page_num,
- int device_addr, int size, int module_num, u32 *data,
- int *size_read);
-
 int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
 void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
 int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
@@ -1067,8 +1033,4 @@ static inline int mlx5_core_is_pf(struct mlx5_core_dev
return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF);
 }
 
-#define MLX5_EEPROM_MAX_BYTES  32
-#define MLX5_EEPROM_IDENTIFIER_BYTE_MASK   0x00ff
-#define MLX5_EEPROM_REVISION_ID_BYTE_MASK  0xff00
-#define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK  0x0004
 #endif /* MLX5_DRIVER_H */

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Wed Mar  7 15:02:13 2018
(r330605)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Wed Mar  7 15:03:11 2018
(r330606)
@@ -27,7 +27,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include "mlx5_core.h"
 

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:02:13 2018
(r330605)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar  7 15:03:11 2018
(r330606)
@@ -26,7 +26,7 @@
  */
 
 #include 
-#include 
+#include 
 #include "mlx5_core.h"
 
 int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
@@ -110,13 +110,13 @@ int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 p
 EXPORT_SYMBOL_GPL(mlx5_set_port_caps);
 
 int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,
- 

svn commit: r330605 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml

2018-03-07 Thread Glen Barber
Author: gjb
Date: Wed Mar  7 15:02:13 2018
New Revision: 330605
URL: https://svnweb.freebsd.org/changeset/base/330605

Log:
  Document EN-18:01, EN-18:02, SA-18:01, SA-18:02.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/doc/share/xml/errata.xml
  stable/10/release/doc/share/xml/security.xml

Changes in other areas also in this revision:
Modified:
  stable/11/release/doc/share/xml/errata.xml
  stable/11/release/doc/share/xml/security.xml

Modified: stable/10/release/doc/share/xml/errata.xml
==
--- stable/10/release/doc/share/xml/errata.xml  Wed Mar  7 14:51:50 2018
(r330604)
+++ stable/10/release/doc/share/xml/errata.xml  Wed Mar  7 15:02:13 2018
(r330605)
@@ -25,6 +25,21 @@
Timezone database information
update
   
+
+  
+   FreeBSD-EN-18:01.tzdata
+   07March2018
+   Timezone database information
+   update
+  
+
+  
+   FreeBSD-EN-18:02.file
+   07March2018
+   Stack-based buffer overflow
+  
 
   
 

Modified: stable/10/release/doc/share/xml/security.xml
==
--- stable/10/release/doc/share/xml/security.xmlWed Mar  7 14:51:50 
2018(r330604)
+++ stable/10/release/doc/share/xml/security.xmlWed Mar  7 15:02:13 
2018(r330605)
@@ -68,6 +68,21 @@
09December2017
Multiple vulnerabilities
   
+
+  
+   FreeBSD-SA-18:01.ipsec
+   07March2018
+   Fix IPSEC validation and
+ use-after-free
+  
+
+  
+   FreeBSD-SA-18:02.ntp
+   07March2018
+   Multiple vulnerabilities
+  
 
   
 
___
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: r330605 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml

2018-03-07 Thread Glen Barber
Author: gjb
Date: Wed Mar  7 15:02:13 2018
New Revision: 330605
URL: https://svnweb.freebsd.org/changeset/base/330605

Log:
  Document EN-18:01, EN-18:02, SA-18:01, SA-18:02.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/doc/share/xml/errata.xml
  stable/11/release/doc/share/xml/security.xml

Changes in other areas also in this revision:
Modified:
  stable/10/release/doc/share/xml/errata.xml
  stable/10/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/errata.xml
==
--- stable/11/release/doc/share/xml/errata.xml  Wed Mar  7 14:51:50 2018
(r330604)
+++ stable/11/release/doc/share/xml/errata.xml  Wed Mar  7 15:02:13 2018
(r330605)
@@ -41,6 +41,21 @@
Timezone database information
update
   
+
+  
+   FreeBSD-EN-18:01.tzdata
+   07March2018
+   Timezone database information
+   update
+  
+
+  
+   FreeBSD-EN-18:02.file
+   07March2018
+   Stack-based buffer overflow
+  
 
   
 

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlWed Mar  7 14:51:50 
2018(r330604)
+++ stable/11/release/doc/share/xml/security.xmlWed Mar  7 15:02:13 
2018(r330605)
@@ -60,6 +60,21 @@
09December2017
Multiple vulnerabilities
   
+
+  
+   FreeBSD-SA-18:01.ipsec
+   07March2018
+   Fix IPSEC validation and
+ use-after-free
+  
+
+  
+   FreeBSD-SA-18:02.ntp
+   07March2018
+   Multiple vulnerabilities
+  
 
   
 
___
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: r330604 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:51:50 2018
New Revision: 330604
URL: https://svnweb.freebsd.org/changeset/base/330604

Log:
  Add log message for unsupported QSFPs in mlx5core.
  
  Submitted by: Matthew Finlay 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/device.h
  head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/device.h
==
--- head/sys/dev/mlx5/device.h  Wed Mar  7 14:49:27 2018(r330603)
+++ head/sys/dev/mlx5/device.h  Wed Mar  7 14:51:50 2018(r330604)
@@ -501,9 +501,10 @@ struct mlx5_eqe_vport_change {
 #define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF
 
 enum {
-   MLX5_MODULE_STATUS_PLUGGED= 0x1,
-   MLX5_MODULE_STATUS_UNPLUGGED  = 0x2,
-   MLX5_MODULE_STATUS_ERROR  = 0x3,
+   MLX5_MODULE_STATUS_PLUGGED_ENABLED  = 0x1,
+   MLX5_MODULE_STATUS_UNPLUGGED= 0x2,
+   MLX5_MODULE_STATUS_ERROR= 0x3,
+   MLX5_MODULE_STATUS_PLUGGED_DISABLED = 0x4,
 };
 
 enum {
@@ -512,7 +513,7 @@ enum {
MLX5_MODULE_EVENT_ERROR_BUS_STUCK = 0x2,
MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT   = 0x3,
MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST  = 0x4,
-   MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER= 0x5,
+   MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5,
MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE  = 0x6,
MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED  = 0x7,
 };

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Wed Mar  7 14:49:27 2018
(r330603)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Wed Mar  7 14:51:50 2018
(r330604)
@@ -618,8 +618,8 @@ static const char *mlx5_port_module_event_error_type_t
return "No EEPROM/retry timeout";
case MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST:
return "Enforce part number list";
-   case MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER:
-   return "Unknown identifier";
+   case MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE:
+   return "Unsupported Cable";
case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE:
return "High Temperature";
case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED:
@@ -655,8 +655,8 @@ static void mlx5_port_module_event(struct mlx5_core_de
 PORT_MODULE_EVENT_ERROR_TYPE_MASK;
 
switch (module_status) {
-   case MLX5_MODULE_STATUS_PLUGGED:
-   device_printf((>dev)->bsddev, "INFO: ""Module %u, status: 
plugged\n", module_num);
+   case MLX5_MODULE_STATUS_PLUGGED_ENABLED:
+   device_printf((>dev)->bsddev, "INFO: ""Module %u, status: 
plugged and enabled\n", module_num);
break;
 
case MLX5_MODULE_STATUS_UNPLUGGED:
@@ -665,6 +665,10 @@ static void mlx5_port_module_event(struct mlx5_core_de
 
case MLX5_MODULE_STATUS_ERROR:
device_printf((>dev)->bsddev, "INFO: ""Module %u, status: 
error, %s\n", module_num, 
mlx5_port_module_event_error_type_to_string(error_type));
+   break;
+
+   case MLX5_MODULE_STATUS_PLUGGED_DISABLED:
+   device_printf((>dev)->bsddev, "INFO: ""Module %u, status: 
plugged but disabled\n", module_num);
break;
 
default:

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Mar  7 14:49:27 2018
(r330603)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Mar  7 14:51:50 2018
(r330604)
@@ -2639,6 +2639,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t
int error = 0;
int mask = 0;
int size_read = 0;
+   int module_status;
int module_num;
int max_mtu;
uint8_t read_addr;
@@ -2838,8 +2839,9 @@ out:
goto err_i2c;
}
/* Check if module is present before doing an access */
-   if (mlx5_query_module_status(priv->mdev, module_num) !=
-   MLX5_MODULE_STATUS_PLUGGED) {
+   module_status = mlx5_query_module_status(priv->mdev, 
module_num);
+   if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED &&
+   module_status != MLX5_MODULE_STATUS_PLUGGED_DISABLED) {
error = EINVAL;
goto err_i2c;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To 

svn commit: r330603 - head/sys/dev/mlx5/mlx5_core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:49:27 2018
New Revision: 330603
URL: https://svnweb.freebsd.org/changeset/base/330603

Log:
  Make sure default VNET is set when adding a new interface in mlx5core.
  
  Adding an interface might be done outside the device_attach() routine
  and will then cause a panic, due to the VNET not being set.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar  7 14:47:43 2018
(r330602)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar  7 14:49:27 2018
(r330603)
@@ -956,7 +956,9 @@ static void mlx5_add_device(struct mlx5_interface *int
dev_ctx = kmalloc(sizeof(*dev_ctx), GFP_KERNEL);
 
dev_ctx->intf= intf;
+   CURVNET_SET_QUIET(vnet0);
dev_ctx->context = intf->add(dev);
+   CURVNET_RESTORE();
 
if (dev_ctx->context) {
spin_lock_irq(>ctx_lock);
___
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: r330602 - head/sys/compat/cloudabi

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 14:47:43 2018
New Revision: 330602
URL: https://svnweb.freebsd.org/changeset/base/330602

Log:
  sys/cloudabi: Avoid relying on GNU specific extensions
  
  An empty initializer list is not technically valid C grammar.
  
  MFC After:1 week

Modified:
  head/sys/compat/cloudabi/cloudabi_fd.c

Modified: head/sys/compat/cloudabi/cloudabi_fd.c
==
--- head/sys/compat/cloudabi/cloudabi_fd.c  Wed Mar  7 14:44:32 2018
(r330601)
+++ head/sys/compat/cloudabi/cloudabi_fd.c  Wed Mar  7 14:47:43 2018
(r330602)
@@ -382,7 +382,7 @@ int
 cloudabi_sys_fd_stat_get(struct thread *td,
 struct cloudabi_sys_fd_stat_get_args *uap)
 {
-   cloudabi_fdstat_t fsb = {};
+   cloudabi_fdstat_t fsb = {0};
struct file *fp;
cap_rights_t rights;
struct filecaps fcaps;
___
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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 14:44:32 2018
New Revision: 330601
URL: https://svnweb.freebsd.org/changeset/base/330601

Log:
  sys: Fix a few potential infoleaks in cloudabi
  
  While there is no immediate leak, if the structure changes underneath
  us, there might be in the future.
  
  Submitted by: Domagoj Stolfa 
  MFC After:1 month
  Sponsored by: DARPA/AFRL

Modified:
  head/sys/i386/ibcs2/ibcs2_ipc.c

Modified: head/sys/i386/ibcs2/ibcs2_ipc.c
==
--- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:41:29 2018
(r330600)
+++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:44:32 2018
(r330601)
@@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v)
struct msqid_ds bs;
int error;
 
+   memset(, 0, sizeof(is));
+
switch (uap->cmd) {
case IBCS2_IPC_STAT:
error = kern_msgctl(td, uap->msqid, IPC_STAT, );
@@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v)
union semun semun;
register_t rval;
int error;
+
+   memset(, 0, sizeof(is));
 
switch(uap->cmd) {
case IBCS2_IPC_STAT:
___
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: r330600 - in head/sys/dev/mlx5: . mlx5_core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:41:29 2018
New Revision: 330600
URL: https://svnweb.freebsd.org/changeset/base/330600

Log:
  Add timeout handle to commands with callback in mlx5core.
  
  The current implementation does not handle timeout in case of command
  with callback request, and this can lead to deadlock if the command
  doesn't get firmware response. Add delayed callback timeout work
  before posting the command to firmware. In case of real firmware
  command completion we will cancel the delayed work. In case of
  firmware command timeout the callback timeout handler will be called
  and it will simulate firmware completion with timeout error.
  
  linux commit 65ee67084589c1783a74b4a4a5db38d7264ec8b5
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Wed Mar  7 14:35:28 2018(r330599)
+++ head/sys/dev/mlx5/driver.h  Wed Mar  7 14:41:29 2018(r330600)
@@ -727,6 +727,7 @@ struct mlx5_cmd_work_ent {
void   *uout;
int uout_size;
mlx5_cmd_cbk_t  callback;
+struct delayed_work cb_timeout_work;
void   *context;
int idx;
struct completion   done;

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:35:28 2018
(r330599)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:41:29 2018
(r330600)
@@ -246,6 +246,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent
 
 static void free_cmd(struct mlx5_cmd_work_ent *ent)
 {
+cancel_delayed_work_sync(>cb_timeout_work);
kfree(ent);
 }
 
@@ -499,6 +500,30 @@ static void dump_command(struct mlx5_core_dev *dev,
pr_debug("\n");
 }
 
+static u16 msg_to_opcode(struct mlx5_cmd_msg *in)
+{
+struct mlx5_inbox_hdr *hdr = (struct mlx5_inbox_hdr *)(in->first.data);
+
+return be16_to_cpu(hdr->opcode);
+}
+
+static void cb_timeout_handler(struct work_struct *work)
+{
+struct delayed_work *dwork = container_of(work, struct delayed_work,
+  work);
+struct mlx5_cmd_work_ent *ent = container_of(dwork,
+ struct mlx5_cmd_work_ent,
+ cb_timeout_work);
+struct mlx5_core_dev *dev = container_of(ent->cmd, struct 
mlx5_core_dev,
+ cmd);
+
+ent->ret = -ETIMEDOUT;
+mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command 
resource\n",
+   mlx5_command_str(msg_to_opcode(ent->in)),
+   msg_to_opcode(ent->in));
+mlx5_cmd_comp_handler(dev, 1UL << ent->idx);
+}
+
 static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode,
   struct mlx5_outbox_hdr *hdr)
 {
@@ -731,6 +756,7 @@ static void cmd_work_handler(struct work_struct *work)
struct mlx5_cmd_work_ent *ent = container_of(work, struct 
mlx5_cmd_work_ent, work);
struct mlx5_cmd *cmd = ent->cmd;
struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, 
cmd);
+unsigned long cb_timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC);
struct mlx5_cmd_layout *lay;
struct semaphore *sem;
 
@@ -761,6 +787,9 @@ static void cmd_work_handler(struct work_struct *work)
dump_command(dev, ent, 1);
ent->ts1 = ktime_get_ns();
ent->busy = 0;
+if (ent->callback)
+schedule_delayed_work(>cb_timeout_work, cb_timeout);
+
/* ring doorbell after the descriptor is valid */
mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx);
/* make sure data is written to RAM */
@@ -805,13 +834,6 @@ static const char *deliv_status_to_str(u8 status)
}
 }
 
-static u16 msg_to_opcode(struct mlx5_cmd_msg *in)
-{
-   struct mlx5_inbox_hdr *hdr = (struct mlx5_inbox_hdr *)(in->first.data);
-
-   return be16_to_cpu(hdr->opcode);
-}
-
 static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
 {
int timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC);
@@ -867,6 +889,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, 
if (!callback)
init_completion(>done);
 
+INIT_DELAYED_WORK(>cb_timeout_work, cb_timeout_handler);
INIT_WORK(>work, cmd_work_handler);
if (page_queue) {
cmd_work_handler(>work);
@@ -1065,6 +1088,8 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, 
i 

svn commit: r330599 - head/sys/dev/mlx5/mlx5_core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:35:28 2018
New Revision: 330599
URL: https://svnweb.freebsd.org/changeset/base/330599

Log:
  Fix potential deadlock in command mode change in mlx5core.
  
  Call command completion handler in case of timeout when working in
  interrupts mode. Avoid flushing the commands workqueue after acquiring
  the semaphores to prevent a potential deadlock.
  
  linux commit commit 9cba4ebcf374c3772f6eb61f2d065294b2451b49
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:29:30 2018
(r330598)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:35:28 2018
(r330599)
@@ -735,11 +735,6 @@ static void cmd_work_handler(struct work_struct *work)
struct semaphore *sem;
 
sem = ent->page_queue ? >pages_sem : >sem;
-   if (cmd->moving_to_polling) {
-   mlx5_core_warn(dev, "not expecting command execution, 
ignoring...\n");
-   return;
-   }
-
down(sem);
 
if (alloc_ent(ent) < 0) {
@@ -826,13 +821,13 @@ static int wait_func(struct mlx5_core_dev *dev, struct
if (cmd->mode == CMD_MODE_POLLING) {
wait_for_completion(>done);
err = ent->ret;
-   } else {
-   if (!wait_for_completion_timeout(>done, timeout))
-   err = -ETIMEDOUT;
-   else
-   err = 0;
-   }
+   } else if (!wait_for_completion_timeout(>done, timeout)) {
+ent->ret = -ETIMEDOUT;
+mlx5_cmd_comp_handler(dev, 1UL << ent->idx);
+}
 
+err = ent->ret;
+
if (err == -ETIMEDOUT) {
mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a 
command resource\n",
   mlx5_command_str(msg_to_opcode(ent->in)),
@@ -881,27 +876,28 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, 
goto out_free;
}
 
-   if (!callback) {
-   err = wait_func(dev, ent);
-   if (err == -ETIMEDOUT)
-   goto out;
+   if (callback)
+goto out;
 
-   ds = ent->ts2 - ent->ts1;
-   op = be16_to_cpu(((struct mlx5_inbox_hdr 
*)in->first.data)->opcode);
-   if (op < ARRAY_SIZE(cmd->stats)) {
-   stats = >stats[op];
-   spin_lock_irq(>lock);
-   stats->sum += ds;
-   ++stats->n;
-   spin_unlock_irq(>lock);
-   }
-   mlx5_core_dbg_mask(dev, 1 << MLX5_CMD_TIME,
-  "fw exec time for %s is %lld nsec\n",
-  mlx5_command_str(op), (long long)ds);
-   *status = ent->status;
-   free_cmd(ent);
-   }
+err = wait_func(dev, ent);
+if (err == -ETIMEDOUT)
+goto out;
 
+ds = ent->ts2 - ent->ts1;
+op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode);
+if (op < ARRAY_SIZE(cmd->stats)) {
+stats = >stats[op];
+spin_lock_irq(>lock);
+stats->sum += ds;
+++stats->n;
+spin_unlock_irq(>lock);
+}
+mlx5_core_dbg_mask(dev, 1 << MLX5_CMD_TIME,
+   "fw exec time for %s is %lld nsec\n",
+   mlx5_command_str(op), (long long)ds);
+*status = ent->status;
+free_cmd(ent);
+
return err;
 
 out_free:
@@ -1017,7 +1013,7 @@ static void clean_debug_files(struct mlx5_core_dev *de
 }
 
 
-void mlx5_cmd_use_events(struct mlx5_core_dev *dev)
+static void mlx5_cmd_change_mod(struct mlx5_core_dev *dev, int mode)
 {
struct mlx5_cmd *cmd = >cmd;
int i;
@@ -1026,26 +1022,21 @@ void mlx5_cmd_use_events(struct mlx5_core_dev *dev)
down(>sem);
 
down(>pages_sem);
+   cmd->mode = mode;
 
-   flush_workqueue(cmd->wq);
-
-   cmd->mode = CMD_MODE_EVENTS;
-
up(>pages_sem);
for (i = 0; i < cmd->max_reg_cmds; i++)
up(>sem);
 }
 
-void mlx5_cmd_use_polling(struct mlx5_core_dev *dev)
+void mlx5_cmd_use_events(struct mlx5_core_dev *dev)
 {
-   struct mlx5_cmd *cmd = >cmd;
+mlx5_cmd_change_mod(dev, CMD_MODE_EVENTS);
+}
 
-   synchronize_irq(dev->priv.eq_table.pages_eq.irqn);
-   flush_workqueue(dev->priv.pg_wq);
-   cmd->moving_to_polling = 1;
-   flush_workqueue(cmd->wq);
-   cmd->mode = CMD_MODE_POLLING;
-   cmd->moving_to_polling = 0;
+void mlx5_cmd_use_polling(struct mlx5_core_dev *dev)
+{
+mlx5_cmd_change_mod(dev, CMD_MODE_POLLING);
 }
 
 static void free_msg(struct mlx5_core_dev 

svn commit: r330598 - head/sys/dev/mlx5/mlx5_core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:29:30 2018
New Revision: 330598
URL: https://svnweb.freebsd.org/changeset/base/330598

Log:
  Use a macro in mlx5_command_str() instead of copying OP name.
  
  linux commit 42ca502e179d0654ef441333a9d0f35c948734f3
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:03:31 2018
(r330597)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Wed Mar  7 14:29:30 2018
(r330598)
@@ -296,403 +296,141 @@ static void dump_buf(void *buf, int size, int data_onl
 
 const char *mlx5_command_str(int command)
 {
-   switch (command) {
-   case MLX5_CMD_OP_QUERY_HCA_CAP:
-   return "QUERY_HCA_CAP";
+#define MLX5_COMMAND_STR_CASE(__cmd) case MLX5_CMD_OP_ ## __cmd: 
return #__cmd
 
-   case MLX5_CMD_OP_SET_HCA_CAP:
-   return "SET_HCA_CAP";
-
-   case MLX5_CMD_OP_QUERY_ADAPTER:
-   return "QUERY_ADAPTER";
-
-   case MLX5_CMD_OP_INIT_HCA:
-   return "INIT_HCA";
-
-   case MLX5_CMD_OP_TEARDOWN_HCA:
-   return "TEARDOWN_HCA";
-
-   case MLX5_CMD_OP_ENABLE_HCA:
-   return "MLX5_CMD_OP_ENABLE_HCA";
-
-   case MLX5_CMD_OP_DISABLE_HCA:
-   return "MLX5_CMD_OP_DISABLE_HCA";
-
-   case MLX5_CMD_OP_QUERY_PAGES:
-   return "QUERY_PAGES";
-
-   case MLX5_CMD_OP_MANAGE_PAGES:
-   return "MANAGE_PAGES";
-
-   case MLX5_CMD_OP_QUERY_ISSI:
-   return "QUERY_ISSI";
-
-   case MLX5_CMD_OP_SET_ISSI:
-   return "SET_ISSI";
-
-   case MLX5_CMD_OP_CREATE_MKEY:
-   return "CREATE_MKEY";
-
-   case MLX5_CMD_OP_QUERY_MKEY:
-   return "QUERY_MKEY";
-
-   case MLX5_CMD_OP_DESTROY_MKEY:
-   return "DESTROY_MKEY";
-
-   case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS:
-   return "QUERY_SPECIAL_CONTEXTS";
-
-   case MLX5_CMD_OP_PAGE_FAULT_RESUME:
-   return "PAGE_FAULT_RESUME";
-
-   case MLX5_CMD_OP_CREATE_EQ:
-   return "CREATE_EQ";
-
-   case MLX5_CMD_OP_DESTROY_EQ:
-   return "DESTROY_EQ";
-
-   case MLX5_CMD_OP_QUERY_EQ:
-   return "QUERY_EQ";
-
-   case MLX5_CMD_OP_GEN_EQE:
-   return "GEN_EQE";
-
-   case MLX5_CMD_OP_CREATE_CQ:
-   return "CREATE_CQ";
-
-   case MLX5_CMD_OP_DESTROY_CQ:
-   return "DESTROY_CQ";
-
-   case MLX5_CMD_OP_QUERY_CQ:
-   return "QUERY_CQ";
-
-   case MLX5_CMD_OP_MODIFY_CQ:
-   return "MODIFY_CQ";
-
-   case MLX5_CMD_OP_CREATE_QP:
-   return "CREATE_QP";
-
-   case MLX5_CMD_OP_DESTROY_QP:
-   return "DESTROY_QP";
-
-   case MLX5_CMD_OP_RST2INIT_QP:
-   return "RST2INIT_QP";
-
-   case MLX5_CMD_OP_INIT2RTR_QP:
-   return "INIT2RTR_QP";
-
-   case MLX5_CMD_OP_RTR2RTS_QP:
-   return "RTR2RTS_QP";
-
-   case MLX5_CMD_OP_RTS2RTS_QP:
-   return "RTS2RTS_QP";
-
-   case MLX5_CMD_OP_SQERR2RTS_QP:
-   return "SQERR2RTS_QP";
-
-   case MLX5_CMD_OP_2ERR_QP:
-   return "2ERR_QP";
-
-   case MLX5_CMD_OP_2RST_QP:
-   return "2RST_QP";
-
-   case MLX5_CMD_OP_QUERY_QP:
-   return "QUERY_QP";
-
-   case MLX5_CMD_OP_SQD_RTS_QP:
-   return "SQD_RTS_QP";
-
-   case MLX5_CMD_OP_MAD_IFC:
-   return "MAD_IFC";
-
-   case MLX5_CMD_OP_INIT2INIT_QP:
-   return "INIT2INIT_QP";
-
-   case MLX5_CMD_OP_CREATE_PSV:
-   return "CREATE_PSV";
-
-   case MLX5_CMD_OP_DESTROY_PSV:
-   return "DESTROY_PSV";
-
-   case MLX5_CMD_OP_CREATE_SRQ:
-   return "CREATE_SRQ";
-
-   case MLX5_CMD_OP_DESTROY_SRQ:
-   return "DESTROY_SRQ";
-
-   case MLX5_CMD_OP_QUERY_SRQ:
-   return "QUERY_SRQ";
-
-   case MLX5_CMD_OP_ARM_RQ:
-   return "ARM_RQ";
-
-   case MLX5_CMD_OP_CREATE_XRC_SRQ:
-   return "CREATE_XRC_SRQ";
-
-   case MLX5_CMD_OP_DESTROY_XRC_SRQ:
-   return "DESTROY_XRC_SRQ";
-
-   case MLX5_CMD_OP_QUERY_XRC_SRQ:
-   return "QUERY_XRC_SRQ";
-
-   case MLX5_CMD_OP_ARM_XRC_SRQ:
-   return "ARM_XRC_SRQ";
-
-   case MLX5_CMD_OP_CREATE_DCT:
-   return "CREATE_DCT";
-
-   case MLX5_CMD_OP_SET_DC_CNAK_TRACE:
-   return "SET_DC_CNAK_TRACE";
-
-   case MLX5_CMD_OP_DESTROY_DCT:
-   return "DESTROY_DCT";
-
-   case MLX5_CMD_OP_DRAIN_DCT:
-   return "DRAIN_DCT";
-
-   case MLX5_CMD_OP_QUERY_DCT:
-   return "QUERY_DCT";
-
-   case 

svn commit: r330597 - head/sys/dev/mlx5/mlx5_ib

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 14:03:31 2018
New Revision: 330597
URL: https://svnweb.freebsd.org/changeset/base/330597

Log:
  Disable unsupported disassociate ucontext functionality in mlx5ib(4).
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c

Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
==
--- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.cWed Mar  7 13:59:46 2018
(r330596)
+++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.cWed Mar  7 14:03:31 2018
(r330597)
@@ -1241,62 +1241,6 @@ static int mlx5_ib_set_vma_data(struct vm_area_struct 
return 0;
 }
 
-static void mlx5_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
-{
-   int ret;
-   struct vm_area_struct *vma;
-   struct mlx5_ib_vma_private_data *vma_private, *n;
-   struct mlx5_ib_ucontext *context = to_mucontext(ibcontext);
-   struct task_struct *owning_process  = NULL;
-   struct mm_struct   *owning_mm   = NULL;
-
-   owning_process = get_pid_task(ibcontext->tgid, PIDTYPE_PID);
-   if (!owning_process)
-   return;
-
-   owning_mm = get_task_mm(owning_process);
-   if (!owning_mm) {
-   pr_info("no mm, disassociate ucontext is pending task 
termination\n");
-   while (1) {
-   put_task_struct(owning_process);
-   usleep_range(1000, 2000);
-   owning_process = get_pid_task(ibcontext->tgid,
- PIDTYPE_PID);
-   if (!owning_process /* ||
-   owning_process->state == TASK_DEAD */) {
-   pr_info("disassociate ucontext done, task was 
terminated\n");
-   /* in case task was dead need to release the
-* task struct.
-*/
-   if (owning_process)
-   put_task_struct(owning_process);
-   return;
-   }
-   }
-   }
-
-   /* need to protect from a race on closing the vma as part of
-* mlx5_ib_vma_close.
-*/
-   down_read(_mm->mmap_sem);
-   list_for_each_entry_safe(vma_private, n, >vma_private_list,
-list) {
-   vma = vma_private->vma;
-   ret = zap_vma_ptes(vma, vma->vm_start,
-  PAGE_SIZE);
-   WARN_ONCE(ret, "%s: zap_vma_ptes failed", __func__);
-   /* context going to be destroyed, should
-* not access ops any more.
-*/
-   vma->vm_ops = NULL;
-   list_del(_private->list);
-   kfree(vma_private);
-   }
-   up_read(_mm->mmap_sem);
-   mmput(owning_mm);
-   put_task_struct(owning_process);
-}
-
 static inline char *mmap_cmd2str(enum mlx5_ib_mmap_cmd cmd)
 {
switch (cmd) {
@@ -3055,8 +2999,6 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
dev->ib_dev.get_vf_stats= mlx5_ib_get_vf_stats;
dev->ib_dev.set_vf_guid = mlx5_ib_set_vf_guid;
}
-
-   dev->ib_dev.disassociate_ucontext = mlx5_ib_disassociate_ucontext;
 
mlx5_ib_internal_fill_odp_caps(dev);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330596 - head/sys/dev/mlx4/mlx4_ib

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:59:46 2018
New Revision: 330596
URL: https://svnweb.freebsd.org/changeset/base/330596

Log:
  Bump version information in mlx4ib(4).
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c

Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
==
--- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:58:58 2018
(r330595)
+++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:59:46 2018
(r330596)
@@ -63,8 +63,10 @@
 #include "wc.h"
 
 #define DRV_NAME   MLX4_IB_DRV_NAME
-#define DRV_VERSION"3.4.1-BETA"
-#define DRV_RELDATE"October 2017"
+#ifndef DRV_VERSION
+#define DRV_VERSION"3.4.1"
+#endif
+#define DRV_RELDATE"February 2018"
 
 #define MLX4_IB_FLOW_MAX_PRIO 0xFFF
 #define MLX4_IB_FLOW_QPN_MASK 0xFF
___
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: r330595 - head/sys/dev/mlx4/mlx4_ib

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:58:58 2018
New Revision: 330595
URL: https://svnweb.freebsd.org/changeset/base/330595

Log:
  The mlx4ib(4) should not be loaded before the ibcore is initialized.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c

Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
==
--- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:57:32 2018
(r330594)
+++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:58:58 2018
(r330595)
@@ -3317,7 +3317,7 @@ static void __exit mlx4_ib_cleanup(void)
destroy_workqueue(wq);
 }
 
-module_init_order(mlx4_ib_init, SI_ORDER_MIDDLE);
+module_init_order(mlx4_ib_init, SI_ORDER_THIRD);
 module_exit(mlx4_ib_cleanup);
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330594 - head/sys/dev/mlx4/mlx4_ib

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:57:32 2018
New Revision: 330594
URL: https://svnweb.freebsd.org/changeset/base/330594

Log:
  Disable unsupported disassociate ucontext functionality in mlx4ib(4).
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c

Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
==
--- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:54:44 2018
(r330593)
+++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cWed Mar  7 13:57:32 2018
(r330594)
@@ -1135,68 +1135,6 @@ static const struct vm_operations_struct mlx4_ib_vm_op
.close = mlx4_ib_vma_close
 };
 
-static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
-{
-   int i;
-   int ret = 0;
-   struct vm_area_struct *vma;
-   struct mlx4_ib_ucontext *context = to_mucontext(ibcontext);
-   struct task_struct *owning_process  = NULL;
-   struct mm_struct   *owning_mm   = NULL;
-
-   owning_process = get_pid_task(ibcontext->tgid, PIDTYPE_PID);
-   if (!owning_process)
-   return;
-
-   owning_mm = get_task_mm(owning_process);
-   if (!owning_mm) {
-   pr_info("no mm, disassociate ucontext is pending task 
termination\n");
-   while (1) {
-   /* make sure that task is dead before returning, it may
-* prevent a rare case of module down in parallel to a
-* call to mlx4_ib_vma_close.
-*/
-   put_task_struct(owning_process);
-   msleep(1);
-   owning_process = get_pid_task(ibcontext->tgid,
- PIDTYPE_PID);
-   if (!owning_process /* ||
-   owning_process->state == TASK_DEAD */) {
-   pr_info("disassociate ucontext done, task was 
terminated\n");
-   /* in case task was dead need to release the 
task struct */
-   if (owning_process)
-   put_task_struct(owning_process);
-   return;
-   }
-   }
-   }
-
-   /* need to protect from a race on closing the vma as part of
-* mlx4_ib_vma_close().
-*/
-   down_read(_mm->mmap_sem);
-   for (i = 0; i < HW_BAR_COUNT; i++) {
-   vma = context->hw_bar_info[i].vma;
-   if (!vma)
-   continue;
-
-   ret = zap_vma_ptes(context->hw_bar_info[i].vma,
-  context->hw_bar_info[i].vma->vm_start,
-  PAGE_SIZE);
-   if (ret) {
-   pr_err("Error: zap_vma_ptes failed for index=%d, 
ret=%d\n", i, ret);
-   BUG_ON(1);
-   }
-
-   /* context going to be destroyed, should not access ops any 
more */
-   context->hw_bar_info[i].vma->vm_ops = NULL;
-   }
-
-   up_read(_mm->mmap_sem);
-   mmput(owning_mm);
-   put_task_struct(owning_process);
-}
-
 static void mlx4_ib_set_vma_data(struct vm_area_struct *vma,
 struct mlx4_ib_vma_private_data 
*vma_private_data)
 {
@@ -2694,7 +2632,6 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
ibdev->ib_dev.process_mad   = mlx4_ib_process_mad;
ibdev->ib_dev.get_port_immutable = mlx4_port_immutable;
ibdev->ib_dev.get_dev_fw_str= get_fw_ver_str;
-   ibdev->ib_dev.disassociate_ucontext = mlx4_ib_disassociate_ucontext;
 
if (!mlx4_is_slave(ibdev->dev)) {
ibdev->ib_dev.alloc_fmr = mlx4_ib_fmr_alloc;
___
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: r330593 - head/sys/arm64/include

2018-03-07 Thread Andrew Turner
Author: andrew
Date: Wed Mar  7 13:54:44 2018
New Revision: 330593
URL: https://svnweb.freebsd.org/changeset/base/330593

Log:
  Bump MAXCPUS on arm64. We are starting to see hardware with more than 96
  cores so increase it to the same as amd64.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: Cavium (Hardware)

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

Modified: head/sys/arm64/include/param.h
==
--- head/sys/arm64/include/param.h  Wed Mar  7 13:49:26 2018
(r330592)
+++ head/sys/arm64/include/param.h  Wed Mar  7 13:54:44 2018
(r330593)
@@ -56,7 +56,7 @@
 
 #if defined(SMP) || defined(KLD_MODULE)
 #ifndef MAXCPU
-#defineMAXCPU  96
+#defineMAXCPU  256
 #endif
 #else
 #defineMAXCPU  1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330592 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:49:26 2018
New Revision: 330592
URL: https://svnweb.freebsd.org/changeset/base/330592

Log:
  MFV r330591: 8984 fix for 6764 breaks ACL inheritance
  
  illumos/illumos-gate@e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc
  
https://github.com/illumos/illumos-gate/commit/e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc
  
  https://www.illumos.org/issues/8984
Consider a directory configured as:
drwx-ws---+ 2 henson cpp 3 Jan 23 12:35 dropbox/
user:henson:rwxpdDaARWcC--:f-i:allow
owner@:--:f-i:allow
group@:--:f-i:allow
everyone@:--:f-i:allow
owner@:rwxpdDaARWcC--:-di:allow
group:cpp:-wx---:---:allow
owner@:rwxpdDaARWcC--:---:allow
A new file created in this directory ends up looking like:
rw-r--r-+ 1 astudent cpp 0 Jan 23 12:39 testfile
user:henson:rw-pdDaARWcC--:--I:allow
owner@:--:--I:allow
group@:--:--I:allow
everyone@:--:--I:allow
owner@:rw-p--aARWcCos:---:allow
group@:r-a-R-c--s:---:allow
everyone@:r-a-R-c--s:---:allow
with extraneous group@ and everyone@ entries allowing read access that
shouldn't exist.
Per Albert Lee on the zfs mailing list:
"aclinherit=passthrough/passthrough-x should still
ignore the requested mode when an inheritable ACE for owner@ group@,
or everyone@ is present in the parent directory.
It appears there was an oversight in my fix for
https://www.illumos.org/issues/6764 which made calling zfs_acl_chmod
from zfs_acl_inherit unconditional. I think the parent ACL check for
aclinherit=passthrough needs to be reintroduced in zfs_acl_inherit."
We have a large number of faculty who use dropbox directories like the 
example
to have students submit projects. All of these directories are now allowing
  
  Reviewed by: Sam Zaydel 
  Reviewed by: Paul B. Henson 
  Reviewed by: Prakash Surya 
  Approved by: Matthew Ahrens 
  Author: Dominik Hassler 
  
  PR:   216886
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c   Wed Mar 
 7 13:47:01 2018(r330591)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c   Wed Mar 
 7 13:49:26 2018(r330592)
@@ -1476,7 +1476,7 @@ zfs_ace_can_use(vtype_t vtype, uint16_t acep_flags)
  */
 static zfs_acl_t *
 zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp,
-uint64_t mode)
+uint64_t mode, boolean_t *need_chmod)
 {
void*pacep = NULL;
void*acep;
@@ -1490,7 +1490,10 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a
size_t  data1sz, data2sz;
uint_t  aclinherit;
boolean_t   isdir = (vtype == VDIR);
+   boolean_t   isreg = (vtype == VREG);
 
+   *need_chmod = B_TRUE;
+
aclp = zfs_acl_alloc(paclp->z_version);
aclinherit = zfsvfs->z_acl_inherit;
if (aclinherit == ZFS_ACL_DISCARD || vtype == VLNK)
@@ -1513,6 +1516,17 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a
continue;
 
/*
+* If owner@, group@, or everyone@ inheritable
+* then zfs_acl_chmod() isn't needed.
+*/
+   if ((aclinherit == ZFS_ACL_PASSTHROUGH ||
+   aclinherit == ZFS_ACL_PASSTHROUGH_X) &&
+   ((iflags & (ACE_OWNER|ACE_EVERYONE)) ||
+   ((iflags & OWNING_GROUP) == OWNING_GROUP)) &&
+   (isreg || (isdir && (iflags & ACE_DIRECTORY_INHERIT_ACE
+   *need_chmod = B_FALSE;
+
+   /*
 * Strip inherited execute permission from file if
 * not in mode
 */
@@ -1599,6 +1613,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
zfsvfs_t*zfsvfs = dzp->z_zfsvfs;
zfs_acl_t   *paclp;
gid_t   gid;
+   boolean_t   need_chmod = B_TRUE;
boolean_t   trim = B_FALSE;
boolean_t   inherited = B_FALSE;
 
@@ -1694,7 +1709,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
!(dzp->z_pflags & ZFS_XATTR)) {
VERIFY(0 == zfs_acl_node_read(dzp, , B_FALSE));
acl_ids->z_aclp = zfs_acl_inherit(zfsvfs,
-   vap->va_type, paclp, acl_ids->z_mode);
+   vap->va_type, paclp, 

svn commit: r330591 - vendor-sys/illumos/dist/uts/common/fs/zfs

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:47:01 2018
New Revision: 330591
URL: https://svnweb.freebsd.org/changeset/base/330591

Log:
  8984 fix for 6764 breaks ACL inheritance
  
  illumos/illumos-gate@e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc
  
https://github.com/illumos/illumos-gate/commit/e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc
  
  https://www.illumos.org/issues/8984
Consider a directory configured as:
drwx-ws---+ 2 henson cpp 3 Jan 23 12:35 dropbox/
user:henson:rwxpdDaARWcC--:f-i:allow
owner@:--:f-i:allow
group@:--:f-i:allow
everyone@:--:f-i:allow
owner@:rwxpdDaARWcC--:-di:allow
group:cpp:-wx---:---:allow
owner@:rwxpdDaARWcC--:---:allow
A new file created in this directory ends up looking like:
rw-r--r-+ 1 astudent cpp 0 Jan 23 12:39 testfile
user:henson:rw-pdDaARWcC--:--I:allow
owner@:--:--I:allow
group@:--:--I:allow
everyone@:--:--I:allow
owner@:rw-p--aARWcCos:---:allow
group@:r-a-R-c--s:---:allow
everyone@:r-a-R-c--s:---:allow
with extraneous group@ and everyone@ entries allowing read access that
shouldn't exist.
Per Albert Lee on the zfs mailing list:
"aclinherit=passthrough/passthrough-x should still
ignore the requested mode when an inheritable ACE for owner@ group@,
or everyone@ is present in the parent directory.
It appears there was an oversight in my fix for
https://www.illumos.org/issues/6764 which made calling zfs_acl_chmod
from zfs_acl_inherit unconditional. I think the parent ACL check for
aclinherit=passthrough needs to be reintroduced in zfs_acl_inherit."
We have a large number of faculty who use dropbox directories like the 
example
to have students submit projects. All of these directories are now allowing
  
  Reviewed by: Sam Zaydel 
  Reviewed by: Paul B. Henson 
  Reviewed by: Prakash Surya 
  Approved by: Matthew Ahrens 
  Author: Dominik Hassler 

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed Mar  7 13:45:29 
2018(r330590)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed Mar  7 13:47:01 
2018(r330591)
@@ -1494,7 +1494,7 @@ zfs_ace_can_use(vtype_t vtype, uint16_t acep_flags)
  */
 static zfs_acl_t *
 zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp,
-uint64_t mode)
+uint64_t mode, boolean_t *need_chmod)
 {
void*pacep = NULL;
void*acep;
@@ -1508,7 +1508,10 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a
size_t  data1sz, data2sz;
uint_t  aclinherit;
boolean_t   isdir = (vtype == VDIR);
+   boolean_t   isreg = (vtype == VREG);
 
+   *need_chmod = B_TRUE;
+
aclp = zfs_acl_alloc(paclp->z_version);
aclinherit = zfsvfs->z_acl_inherit;
if (aclinherit == ZFS_ACL_DISCARD || vtype == VLNK)
@@ -1531,6 +1534,17 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a
continue;
 
/*
+* If owner@, group@, or everyone@ inheritable
+* then zfs_acl_chmod() isn't needed.
+*/
+   if ((aclinherit == ZFS_ACL_PASSTHROUGH ||
+   aclinherit == ZFS_ACL_PASSTHROUGH_X) &&
+   ((iflags & (ACE_OWNER|ACE_EVERYONE)) ||
+   ((iflags & OWNING_GROUP) == OWNING_GROUP)) &&
+   (isreg || (isdir && (iflags & ACE_DIRECTORY_INHERIT_ACE
+   *need_chmod = B_FALSE;
+
+   /*
 * Strip inherited execute permission from file if
 * not in mode
 */
@@ -1617,6 +1631,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
zfsvfs_t*zfsvfs = dzp->z_zfsvfs;
zfs_acl_t   *paclp;
gid_t   gid;
+   boolean_t   need_chmod = B_TRUE;
boolean_t   trim = B_FALSE;
boolean_t   inherited = B_FALSE;
 
@@ -1706,7 +1721,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
VERIFY(0 == zfs_acl_node_read(dzp, B_TRUE,
, B_FALSE));
acl_ids->z_aclp = zfs_acl_inherit(zfsvfs,
-   vap->va_type, paclp, acl_ids->z_mode);
+   vap->va_type, paclp, acl_ids->z_mode, _chmod);
inherited = B_TRUE;
} else {
acl_ids->z_aclp =
@@ -1716,15 +1731,18 @@ zfs_acl_ids_create(znode_t *dzp, int flag, 

svn commit: r330590 - in stable/11: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:45:29 2018
New Revision: 330590
URL: https://svnweb.freebsd.org/changeset/base/330590

Log:
  MFC r329719: MFV r329718: 8520 7198 lzc_rollback_to should support rolling 
back to origin

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c   
Wed Mar  7 13:40:15 2018(r330589)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c   
Wed Mar  7 13:45:29 2018(r330590)
@@ -4051,17 +4051,31 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, bo
 * a new snapshot is created before this request is processed.
 */
err = lzc_rollback_to(zhp->zfs_name, snap->zfs_name);
-   if (err == EXDEV) {
-   zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-   "'%s' is not the latest snapshot"), snap->zfs_name);
-   (void) zfs_error_fmt(zhp->zfs_hdl, EZFS_BUSY,
+   if (err != 0) {
+   char errbuf[1024];
+
+   (void) snprintf(errbuf, sizeof (errbuf),
dgettext(TEXT_DOMAIN, "cannot rollback '%s'"),
zhp->zfs_name);
-   return (err);
-   } else if (err != 0) {
-   (void) zfs_standard_error_fmt(zhp->zfs_hdl, errno,
-   dgettext(TEXT_DOMAIN, "cannot rollback '%s'"),
-   zhp->zfs_name);
+   switch (err) {
+   case EEXIST:
+   zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
+   "there is a snapshot or bookmark more recent "
+   "than '%s'"), snap->zfs_name);
+   (void) zfs_error(zhp->zfs_hdl, EZFS_EXISTS, errbuf);
+   break;
+   case ESRCH:
+   zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
+   "'%s' is not found among snapshots of '%s'"),
+   snap->zfs_name, zhp->zfs_name);
+   (void) zfs_error(zhp->zfs_hdl, EZFS_NOENT, errbuf);
+   break;
+   case EINVAL:
+   (void) zfs_error(zhp->zfs_hdl, EZFS_BADTYPE, errbuf);
+   break;
+   default:
+   (void) zfs_standard_error(zhp->zfs_hdl, err, errbuf);
+   }
return (err);
}
 

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c  
Wed Mar  7 13:40:15 2018(r330589)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c  
Wed Mar  7 13:45:29 2018(r330590)
@@ -2553,7 +2553,7 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx)
/* must have a most recent snapshot */
if (dsl_dataset_phys(ds)->ds_prev_snap_txg < TXG_INITIAL) {
dsl_dataset_rele(ds, FTAG);
-   return (SET_ERROR(EINVAL));
+   return (SET_ERROR(ESRCH));
}
 
/*
@@ -2573,11 +2573,46 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx)
 * the latest snapshot is it.
 */
if (ddra->ddra_tosnap != NULL) {
-   char namebuf[ZFS_MAX_DATASET_NAME_LEN];
+   dsl_dataset_t *snapds;
 
-   dsl_dataset_name(ds->ds_prev, namebuf);
-   if (strcmp(namebuf, ddra->ddra_tosnap) != 0)
-   return (SET_ERROR(EXDEV));
+   /* Check if the target snapshot exists at all. */
+   error = dsl_dataset_hold(dp, ddra->ddra_tosnap, FTAG, );
+   if (error != 0) {
+   /*
+* ESRCH is used to signal that the target snapshot does
+* not exist, while ENOENT is used to report that
+* the rolled back dataset does not exist.
+* ESRCH is also used to cover other cases where the
+* target snapshot is not related to the dataset being
+* rolled back such as being in a different pool.
+*/
+   if (error == ENOENT || error == EXDEV)
+   error = SET_ERROR(ESRCH);
+   dsl_dataset_rele(ds, FTAG);
+   return (error);
+   }
+   ASSERT(snapds->ds_is_snapshot);
+
+   /* Check if 

svn commit: r330589 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:40:15 2018
New Revision: 330589
URL: https://svnweb.freebsd.org/changeset/base/330589

Log:
  MFC r329714: MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for 
large blocks

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

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c   Wed Mar 
 7 13:39:10 2018(r330588)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c   Wed Mar 
 7 13:40:15 2018(r330589)
@@ -360,8 +360,8 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **d
 
 typedef struct zfs_ecksum_info {
/* histograms of set and cleared bits by bit number in a 64-bit word */
-   uint16_t zei_histogram_set[sizeof (uint64_t) * NBBY];
-   uint16_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
+   uint32_t zei_histogram_set[sizeof (uint64_t) * NBBY];
+   uint32_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
 
/* inline arrays of bits set and cleared. */
uint64_t zei_bits_set[ZFM_MAX_INLINE];
@@ -386,7 +386,7 @@ typedef struct zfs_ecksum_info {
 } zfs_ecksum_info_t;
 
 static void
-update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count)
+update_histogram(uint64_t value_arg, uint32_t *hist, uint32_t *count)
 {
size_t i;
size_t bits = 0;
@@ -552,7 +552,7 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *in
if (badbuf == NULL || goodbuf == NULL)
return (eip);
 
-   ASSERT3U(nui64s, <=, UINT16_MAX);
+   ASSERT3U(nui64s, <=, UINT32_MAX);
ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
ASSERT3U(size, <=, UINT32_MAX);
@@ -654,10 +654,10 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *in
} else {
fm_payload_set(ereport,
FM_EREPORT_PAYLOAD_ZFS_BAD_SET_HISTOGRAM,
-   DATA_TYPE_UINT16_ARRAY,
+   DATA_TYPE_UINT32_ARRAY,
NBBY * sizeof (uint64_t), eip->zei_histogram_set,
FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_HISTOGRAM,
-   DATA_TYPE_UINT16_ARRAY,
+   DATA_TYPE_UINT32_ARRAY,
NBBY * sizeof (uint64_t), eip->zei_histogram_cleared,
NULL);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330588 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:39:10 2018
New Revision: 330588
URL: https://svnweb.freebsd.org/changeset/base/330588

Log:
  MFC r329714: MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for 
large blocks

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

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c   Wed Mar 
 7 13:37:25 2018(r330587)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c   Wed Mar 
 7 13:39:10 2018(r330588)
@@ -360,8 +360,8 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **d
 
 typedef struct zfs_ecksum_info {
/* histograms of set and cleared bits by bit number in a 64-bit word */
-   uint16_t zei_histogram_set[sizeof (uint64_t) * NBBY];
-   uint16_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
+   uint32_t zei_histogram_set[sizeof (uint64_t) * NBBY];
+   uint32_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
 
/* inline arrays of bits set and cleared. */
uint64_t zei_bits_set[ZFM_MAX_INLINE];
@@ -386,7 +386,7 @@ typedef struct zfs_ecksum_info {
 } zfs_ecksum_info_t;
 
 static void
-update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count)
+update_histogram(uint64_t value_arg, uint32_t *hist, uint32_t *count)
 {
size_t i;
size_t bits = 0;
@@ -552,7 +552,7 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *in
if (badbuf == NULL || goodbuf == NULL)
return (eip);
 
-   ASSERT3U(nui64s, <=, UINT16_MAX);
+   ASSERT3U(nui64s, <=, UINT32_MAX);
ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
ASSERT3U(size, <=, UINT32_MAX);
@@ -654,10 +654,10 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *in
} else {
fm_payload_set(ereport,
FM_EREPORT_PAYLOAD_ZFS_BAD_SET_HISTOGRAM,
-   DATA_TYPE_UINT16_ARRAY,
+   DATA_TYPE_UINT32_ARRAY,
NBBY * sizeof (uint64_t), eip->zei_histogram_set,
FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_HISTOGRAM,
-   DATA_TYPE_UINT16_ARRAY,
+   DATA_TYPE_UINT32_ARRAY,
NBBY * sizeof (uint64_t), eip->zei_histogram_cleared,
NULL);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-03-07 Thread Andriy Gapon
Author: avg
Date: Wed Mar  7 13:37:25 2018
New Revision: 330587
URL: https://svnweb.freebsd.org/changeset/base/330587

Log:
  MFC r330338: db_nextframe/amd64: catch up with r328083 to recognize 
fast_syscall_common

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

Modified: stable/11/sys/amd64/amd64/db_trace.c
==
--- stable/11/sys/amd64/amd64/db_trace.cWed Mar  7 13:32:52 2018
(r330586)
+++ stable/11/sys/amd64/amd64/db_trace.cWed Mar  7 13:37:25 2018
(r330587)
@@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s
strcmp(name, "Xcpususpend") == 0 ||
strcmp(name, "Xrendezvous") == 0)
frame_type = INTERRUPT;
-   else if (strcmp(name, "Xfast_syscall") == 0)
+   else if (strcmp(name, "Xfast_syscall") == 0 ||
+   strcmp(name, "Xfast_syscall_pti") == 0 ||
+   strcmp(name, "fast_syscall_common") == 0)
frame_type = SYSCALL;
 #ifdef COMPAT_FREEBSD32
else if (strcmp(name, "Xint0x80_syscall") == 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: r330586 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:32:52 2018
New Revision: 330586
URL: https://svnweb.freebsd.org/changeset/base/330586

Log:
  Make sure VNET is set when calling sa6_recoverscope() in ibcore.
  
  Else panic will occur when VIMAGE is enabled.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_cma.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 13:30:38 
2018(r330585)
+++ head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 13:32:52 
2018(r330586)
@@ -3122,8 +3122,14 @@ static int cma_check_linklocal(struct rdma_dev_addr *d
 
if (IN6_IS_SCOPE_LINKLOCAL(_addr) ||
IN6_IS_ADDR_MC_INTFACELOCAL(_addr)) {
-   /* check if IPv6 scope ID is set */
-   if (sa6_recoverscope() || sin6.sin6_scope_id == 0)
+   bool failure;
+
+   CURVNET_SET_QUIET(dev_addr->net);
+   failure = sa6_recoverscope() || sin6.sin6_scope_id == 0;
+   CURVNET_RESTORE();
+
+   /* check if IPv6 scope ID is not set */
+   if (failure)
return -EINVAL;
dev_addr->bound_dev_if = sin6.sin6_scope_id;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330585 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:30:38 2018
New Revision: 330585
URL: https://svnweb.freebsd.org/changeset/base/330585

Log:
  Define values instead of using hardcoding.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_addr.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar  7 13:28:12 
2018(r330584)
+++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar  7 13:30:38 
2018(r330585)
@@ -248,6 +248,11 @@ static int addr4_resolve(struct sockaddr_in *src_in,
 u8 *edst,
 struct ifnet **ifpp)
 {
+   enum {
+   ADDR_VALID = 0,
+   ADDR_SRC_ANY = 1,
+   ADDR_DST_ANY = 2,
+   };
struct sockaddr_in dst_tmp = *dst_in;
in_port_t src_port;
struct sockaddr *saddr;
@@ -262,11 +267,11 @@ static int addr4_resolve(struct sockaddr_in *src_in,
/* set default TTL limit */
addr->hoplimit = V_ip_defttl;
 
-   type = 0;
+   type = ADDR_VALID;
if (src_in->sin_addr.s_addr == INADDR_ANY)
-   type |= 1;
+   type |= ADDR_SRC_ANY;
if (dst_tmp.sin_addr.s_addr == INADDR_ANY)
-   type |= 2;
+   type |= ADDR_DST_ANY;
 
/*
 * Make sure the socket address length field
@@ -276,8 +281,8 @@ static int addr4_resolve(struct sockaddr_in *src_in,
 
/* Step 1 - lookup destination route if any */
switch (type) {
-   case 0:
-   case 1:
+   case ADDR_VALID:
+   case ADDR_SRC_ANY:
/* regular destination route lookup */
rte = rtalloc1((struct sockaddr *)_tmp, 1, 0);
if (rte == NULL) {
@@ -297,7 +302,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
 
/* Step 2 - find outgoing network interface */
switch (type) {
-   case 0:
+   case ADDR_VALID:
/* check for loopback device */
if (rte->rt_ifp->if_flags & IFF_LOOPBACK) {
ifp = rte->rt_ifp;
@@ -316,7 +321,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
goto error_put_ifp;
}
break;
-   case 1:
+   case ADDR_SRC_ANY:
/* check for loopback device */
if (rte->rt_ifp->if_flags & IFF_LOOPBACK)
saddr = (struct sockaddr *)_tmp;
@@ -398,6 +403,11 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
 u8 *edst,
 struct ifnet **ifpp)
 {
+   enum {
+   ADDR_VALID = 0,
+   ADDR_SRC_ANY = 1,
+   ADDR_DST_ANY = 2,
+   };
struct sockaddr_in6 dst_tmp = *dst_in;
in_port_t src_port;
struct sockaddr *saddr;
@@ -412,11 +422,11 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
/* set default TTL limit */
addr->hoplimit = V_ip_defttl;
 
-   type = 0;
+   type = ADDR_VALID;
if (ipv6_addr_any(_in->sin6_addr))
-   type |= 1;
+   type |= ADDR_SRC_ANY;
if (ipv6_addr_any(_tmp.sin6_addr))
-   type |= 2;
+   type |= ADDR_DST_ANY;
 
/*
 * Make sure the socket address length field
@@ -433,7 +443,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
 
/* Step 1 - lookup destination route if any */
switch (type) {
-   case 0:
+   case ADDR_VALID:
/* sanity check for IPv4 addresses */
if (ipv6_addr_v4mapped(_in->sin6_addr) !=
ipv6_addr_v4mapped(_tmp.sin6_addr)) {
@@ -441,7 +451,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
goto done;
}
/* FALLTHROUGH */
-   case 1:
+   case ADDR_SRC_ANY:
/* regular destination route lookup */
rte = rtalloc1((struct sockaddr *)_tmp, 1, 0);
if (rte == NULL) {
@@ -461,7 +471,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
 
/* Step 2 - find outgoing network interface */
switch (type) {
-   case 0:
+   case ADDR_VALID:
/* check for loopback device */
if (rte->rt_ifp->if_flags & IFF_LOOPBACK) {
ifp = rte->rt_ifp;
@@ -480,7 +490,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
goto error_put_ifp;
}
break;
-   case 1:
+   case ADDR_SRC_ANY:
/* check for loopback device */
if (rte->rt_ifp->if_flags & IFF_LOOPBACK)
saddr = (struct sockaddr *)_tmp;
___
svn-src-all@freebsd.org 

svn commit: r330584 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:28:12 2018
New Revision: 330584
URL: https://svnweb.freebsd.org/changeset/base/330584

Log:
  Recover IPv6 scope ID for multicast link-local addresses as well as
  unicast link-local addresses.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_cma.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 13:25:40 
2018(r330583)
+++ head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 13:28:12 
2018(r330584)
@@ -2785,7 +2785,8 @@ static int cma_bind_addr(struct rdma_cm_id *id, struct
struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 
*) src_addr;
struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 
*) dst_addr;
src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id;
-   if (IN6_IS_SCOPE_LINKLOCAL(_addr6->sin6_addr))
+   if (IN6_IS_SCOPE_LINKLOCAL(_addr6->sin6_addr) ||
+   IN6_IS_ADDR_MC_INTFACELOCAL(_addr6->sin6_addr))
id->route.addr.dev_addr.bound_dev_if = 
dst_addr6->sin6_scope_id;
} else if (dst_addr->sa_family == AF_IB) {
((struct sockaddr_ib *) src_addr)->sib_pkey =
@@ -3119,13 +3120,13 @@ static int cma_check_linklocal(struct rdma_dev_addr *d
 
sin6 = *(struct sockaddr_in6 *)addr;
 
-   if (!(IN6_IS_SCOPE_LINKLOCAL(_addr)))
-   return 0;
-
-   if (sa6_recoverscope() || sin6.sin6_scope_id == 0)
-   return -EINVAL;
-
-   dev_addr->bound_dev_if = sin6.sin6_scope_id;
+   if (IN6_IS_SCOPE_LINKLOCAL(_addr) ||
+   IN6_IS_ADDR_MC_INTFACELOCAL(_addr)) {
+   /* check if IPv6 scope ID is set */
+   if (sa6_recoverscope() || sin6.sin6_scope_id == 0)
+   return -EINVAL;
+   dev_addr->bound_dev_if = sin6.sin6_scope_id;
+   }
 #endif
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: r330583 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:25:40 2018
New Revision: 330583
URL: https://svnweb.freebsd.org/changeset/base/330583

Log:
  Embed the IPv6 scope ID before calling rtalloc1() in ibcore.
  Else rtalloc1() will resolve to the loopback interface.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_addr.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar  7 13:16:03 
2018(r330582)
+++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar  7 13:25:40 
2018(r330583)
@@ -424,6 +424,13 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
 */
dst_tmp.sin6_len = sizeof(dst_tmp);
 
+   /*
+* Make sure the scope ID gets embedded, else rtalloc1() will
+* resolve to the loopback interface.
+*/
+   dst_tmp.sin6_scope_id = addr->bound_dev_if;
+   sa6_embedscope(_tmp, 0);
+
/* Step 1 - lookup destination route if any */
switch (type) {
case 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: r330582 - in head/sys: arm64/arm64 arm64/include dev/pci

2018-03-07 Thread Andrew Turner
Author: andrew
Date: Wed Mar  7 13:16:03 2018
New Revision: 330582
URL: https://svnweb.freebsd.org/changeset/base/330582

Log:
  Create macros for the ACPI interrupt cross references. This is considered a
  band aid until a better solution to find the correct interrupt controller
  can be found.
  
  While here fix one place in the GICv3 ITS driver where the offset wasn't
  correctly applied.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: Cavium (Hardware)

Modified:
  head/sys/arm64/arm64/gic_v3_acpi.c
  head/sys/arm64/arm64/gicv3_its.c
  head/sys/arm64/arm64/nexus.c
  head/sys/arm64/include/intr.h
  head/sys/dev/pci/pci_host_generic_acpi.c

Modified: head/sys/arm64/arm64/gic_v3_acpi.c
==
--- head/sys/arm64/arm64/gic_v3_acpi.c  Wed Mar  7 13:01:00 2018
(r330581)
+++ head/sys/arm64/arm64/gic_v3_acpi.c  Wed Mar  7 13:16:03 2018
(r330582)
@@ -27,6 +27,8 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_acpi.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -260,14 +262,14 @@ gic_v3_acpi_attach(device_t dev)
if (err != 0)
goto error;
 
-   sc->gic_pic = intr_pic_register(dev, 0);
+   sc->gic_pic = intr_pic_register(dev, ACPI_INTR_XREF);
if (sc->gic_pic == NULL) {
device_printf(dev, "could not register PIC\n");
err = ENXIO;
goto error;
}
 
-   if (intr_pic_claim_root(dev, 0, arm_gic_v3_intr, sc,
+   if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
err = ENXIO;
goto error;

Modified: head/sys/arm64/arm64/gicv3_its.c
==
--- head/sys/arm64/arm64/gicv3_its.cWed Mar  7 13:01:00 2018
(r330581)
+++ head/sys/arm64/arm64/gicv3_its.cWed Mar  7 13:16:03 2018
(r330582)
@@ -1734,12 +1734,13 @@ gicv3_its_acpi_attach(device_t dev)
if (err != 0)
return (err);
 
-   sc->sc_pic = intr_pic_register(dev, device_get_unit(dev) + 1);
+   sc->sc_pic = intr_pic_register(dev,
+   device_get_unit(dev) + ACPI_MSI_XREF);
intr_pic_add_handler(device_get_parent(dev), sc->sc_pic,
gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS);
 
/* Register this device to handle MSI interrupts */
-   intr_msi_register(dev, 1);
+   intr_msi_register(dev, device_get_unit(dev) + ACPI_MSI_XREF);
 
return (0);
 }

Modified: head/sys/arm64/arm64/nexus.c
==
--- head/sys/arm64/arm64/nexus.cWed Mar  7 13:01:00 2018
(r330581)
+++ head/sys/arm64/arm64/nexus.cWed Mar  7 13:16:03 2018
(r330582)
@@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include "acpi_bus_if.h"
+#include "pcib_if.h"
 #endif
 
 extern struct bus_space memmap_bus;
@@ -524,7 +525,8 @@ nexus_acpi_map_intr(device_t dev, device_t child, u_in
 * controllers for the largest base value that is no larger than
 * the IRQ value.
 */
-   irq = intr_map_irq(NULL, 0, (struct intr_map_data *)acpi_data);
+   irq = intr_map_irq(NULL, ACPI_INTR_XREF,
+   (struct intr_map_data *)acpi_data);
return (irq);
 }
 #endif

Modified: head/sys/arm64/include/intr.h
==
--- head/sys/arm64/include/intr.h   Wed Mar  7 13:01:00 2018
(r330581)
+++ head/sys/arm64/include/intr.h   Wed Mar  7 13:16:03 2018
(r330582)
@@ -48,4 +48,9 @@ arm_irq_memory_barrier(uintptr_t irq)
 void intr_ipi_dispatch(u_int, struct trapframe *);
 #endif
 
+#ifdef DEV_ACPI
+#defineACPI_INTR_XREF  1
+#defineACPI_MSI_XREF   2
+#endif
+
 #endif /* _MACHINE_INTR_H */

Modified: head/sys/dev/pci/pci_host_generic_acpi.c
==
--- head/sys/dev/pci/pci_host_generic_acpi.cWed Mar  7 13:01:00 2018
(r330581)
+++ head/sys/dev/pci/pci_host_generic_acpi.cWed Mar  7 13:16:03 2018
(r330582)
@@ -228,7 +228,8 @@ generic_pcie_acpi_alloc_msi(device_t pci, device_t chi
 {
 
 #if defined(INTRNG)
-   return (intr_alloc_msi(pci, child, 1, count, maxcount, irqs));
+   return (intr_alloc_msi(pci, child, ACPI_MSI_XREF, count, maxcount,
+   irqs));
 #else
return (ENXIO);
 #endif
@@ -240,7 +241,7 @@ generic_pcie_acpi_release_msi(device_t pci, device_t c
 {
 
 #if defined(INTRNG)
-   return (intr_release_msi(pci, child, 1, count, irqs));
+   return (intr_release_msi(pci, child, ACPI_MSI_XREF, count, irqs));
 #else
return (ENXIO);
 #endif
@@ -252,7 +253,7 @@ generic_pcie_acpi_map_msi(device_t pci, device_t child
 {
 
 #if defined(INTRNG)
-   return (intr_map_msi(pci, child, 1, irq, addr, data));
+   return 

svn commit: r330581 - head/sys/ofed/include/rdma

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 13:01:00 2018
New Revision: 330581
URL: https://svnweb.freebsd.org/changeset/base/330581

Log:
  Add IB_SPEED_HDR definition in ibcore.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/include/rdma/ib_verbs.h

Modified: head/sys/ofed/include/rdma/ib_verbs.h
==
--- head/sys/ofed/include/rdma/ib_verbs.h   Wed Mar  7 12:58:51 2018
(r330580)
+++ head/sys/ofed/include/rdma/ib_verbs.h   Wed Mar  7 13:01:00 2018
(r330581)
@@ -420,7 +420,8 @@ enum ib_port_speed {
IB_SPEED_QDR= 4,
IB_SPEED_FDR10  = 8,
IB_SPEED_FDR= 16,
-   IB_SPEED_EDR= 32
+   IB_SPEED_EDR= 32,
+   IB_SPEED_HDR= 64
 };
 
 /**
___
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: r330580 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 12:58:51 2018
New Revision: 330580
URL: https://svnweb.freebsd.org/changeset/base/330580

Log:
  Make sure the IPv6 scope ID gets properly masked in ibcore.
  
  When exchanging CM messages the IPv6 scope ID should be ignored
  for link local addresses when doing comparisons. Make sure the
  scope ID is always set to zero for link local addresses.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_cma.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 12:56:04 
2018(r330579)
+++ head/sys/ofed/drivers/infiniband/core/ib_cma.c  Wed Mar  7 12:58:51 
2018(r330580)
@@ -1116,6 +1116,17 @@ static void cma_save_ip4_info(struct sockaddr_in *src_
}
 }
 
+static void cma_ip6_clear_scope_id(struct in6_addr *addr)
+{
+   /* make sure link local scope ID gets zeroed */
+   if (IN6_IS_SCOPE_LINKLOCAL(addr) ||
+   IN6_IS_ADDR_MC_INTFACELOCAL(addr)) {
+   /* use byte-access to be alignment safe */
+   addr->s6_addr[2] = 0;
+   addr->s6_addr[3] = 0;
+   }
+}
+
 static void cma_save_ip6_info(struct sockaddr_in6 *src_addr,
  struct sockaddr_in6 *dst_addr,
  struct cma_hdr *hdr,
@@ -1128,6 +1139,7 @@ static void cma_save_ip6_info(struct sockaddr_in6 *src
.sin6_addr = hdr->dst_addr.ip6,
.sin6_port = local_port,
};
+   cma_ip6_clear_scope_id(_addr->sin6_addr);
}
 
if (dst_addr) {
@@ -1137,6 +1149,7 @@ static void cma_save_ip6_info(struct sockaddr_in6 *src
.sin6_addr = hdr->src_addr.ip6,
.sin6_port = hdr->port,
};
+   cma_ip6_clear_scope_id(_addr->sin6_addr);
}
 }
 
@@ -1395,6 +1408,7 @@ static bool cma_match_private_data(struct rdma_id_priv
ip6_addr = ((struct sockaddr_in6 *)addr)->sin6_addr;
if (cma_get_ip_ver(hdr) != 6)
return false;
+   cma_ip6_clear_scope_id(_addr);
if (!cma_any_addr(addr) &&
memcmp(>dst_addr.ip6, _addr, sizeof(ip6_addr)))
return false;
@@ -3242,6 +3256,8 @@ static int cma_format_hdr(void *hdr, struct rdma_id_pr
cma_hdr->src_addr.ip6 = src6->sin6_addr;
cma_hdr->dst_addr.ip6 = dst6->sin6_addr;
cma_hdr->port = src6->sin6_port;
+   cma_ip6_clear_scope_id(_hdr->src_addr.ip6);
+   cma_ip6_clear_scope_id(_hdr->dst_addr.ip6);
}
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: r330579 - head/sys/ofed/drivers/infiniband/core

2018-03-07 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar  7 12:56:04 2018
New Revision: 330579
URL: https://svnweb.freebsd.org/changeset/base/330579

Log:
  Fix for use-after-free when using delayed work structures in ibcore.
  
  It is not enough to cancel delayed work structures before freeing.
  Always cancel delayed work synchronously before freeing!
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_cm.c
  head/sys/ofed/drivers/infiniband/core/ib_mad.c
  head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_cm.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_cm.c   Wed Mar  7 11:09:07 
2018(r330578)
+++ head/sys/ofed/drivers/infiniband/core/ib_cm.c   Wed Mar  7 12:56:04 
2018(r330579)
@@ -4132,6 +4132,7 @@ static void __exit ib_cm_cleanup(void)
destroy_workqueue(cm.wq);
 
list_for_each_entry_safe(timewait_info, tmp, _list, list) {
+   cancel_delayed_work_sync(_info->work.work);
list_del(_info->list);
kfree(timewait_info);
}

Modified: head/sys/ofed/drivers/infiniband/core/ib_mad.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_mad.c  Wed Mar  7 11:09:07 
2018(r330578)
+++ head/sys/ofed/drivers/infiniband/core/ib_mad.c  Wed Mar  7 12:56:04 
2018(r330579)
@@ -572,7 +572,7 @@ static void unregister_mad_agent(struct ib_mad_agent_p
 */
cancel_mads(mad_agent_priv);
port_priv = mad_agent_priv->qp_info->port_priv;
-   cancel_delayed_work(_agent_priv->timed_work);
+   cancel_delayed_work_sync(_agent_priv->timed_work);
 
spin_lock_irqsave(_priv->reg_lock, flags);
remove_mad_reg_req(mad_agent_priv);

Modified: head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Wed Mar  7 11:09:07 
2018(r330578)
+++ head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Wed Mar  7 12:56:04 
2018(r330579)
@@ -103,8 +103,8 @@ void ib_cancel_rmpp_recvs(struct ib_mad_agent_private 
spin_unlock_irqrestore(>lock, flags);
 
list_for_each_entry(rmpp_recv, >rmpp_list, list) {
-   cancel_delayed_work(_recv->timeout_work);
-   cancel_delayed_work(_recv->cleanup_work);
+   cancel_delayed_work_sync(_recv->timeout_work);
+   cancel_delayed_work_sync(_recv->cleanup_work);
}
 
flush_workqueue(agent->qp_info->port_priv->wq);
___
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: r330578 - stable/11/sys/netinet/libalias

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 11:09:07 2018
New Revision: 330578
URL: https://svnweb.freebsd.org/changeset/base/330578

Log:
  MFC r327206:
  
  Fix CID 1008428.

Modified:
  stable/11/sys/netinet/libalias/alias_sctp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/libalias/alias_sctp.c
==
--- stable/11/sys/netinet/libalias/alias_sctp.c Wed Mar  7 11:03:01 2018
(r330577)
+++ stable/11/sys/netinet/libalias/alias_sctp.c Wed Mar  7 11:09:07 2018
(r330578)
@@ -420,9 +420,9 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS)
error = sysctl_handle_int(oidp, , 0, req);
if (error) return (error);
 
-   sysctl_log_level = (level > 
SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level);
-   sysctl_log_level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level);
-
+   level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level);
+   level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level);
+   sysctl_log_level = level;
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: r330577 - stable/11/contrib/ldns-host

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 11:03:01 2018
New Revision: 330577
URL: https://svnweb.freebsd.org/changeset/base/330577

Log:
  MFC r302779,r302807:
  
  merge upstream hg 06347b1f76fe (fix IXFR)
  
  Initialize first_serial to 0 in dozonetransfer(..) to fix -Wuninitialized
  warning
  
  PR:   209177

Modified:
  stable/11/contrib/ldns-host/ldns-host.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/ldns-host/ldns-host.c
==
--- stable/11/contrib/ldns-host/ldns-host.c Wed Mar  7 10:54:10 2018
(r330576)
+++ stable/11/contrib/ldns-host/ldns-host.c Wed Mar  7 11:03:01 2018
(r330577)
@@ -156,6 +156,19 @@ memerr:
 return LDNS_STATUS_MEM_ERR;
 }
 
+static uint32_t
+ldns_rr_soa_get_serial(const ldns_rr *rr)
+{
+const ldns_rdf *rdf;
+  
+if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) return 0;
+if (ldns_rr_rd_count(rr) != 7) return 0;
+rdf = ldns_rr_rdf(rr, 2);
+if (ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_INT32) return 0;
+if (ldns_rdf_size(rdf) != 4) return 0;
+return ldns_rdf2native_int32(rdf);
+}
+
 static ldns_status
 ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) {
 /* This routine is based on ldns_axfr_start, with the major
@@ -873,18 +886,16 @@ dozonetransfer(ldns_resolver *res, ldns_rdf *domain, b
 ldns_rdf *dname;
 ldns_rr_type rrtype;
 ldns_rr_list *rrl;
-int i, nsoa = 0;
+ldns_rr *rr;
+size_t i, nsoa = 0;
+uint32_t first_serial = 0;
 
 rrtype = o_rrtype;
 o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR;
 dname = search(res, domain, , absolute, false);
 
 for (;;) {
-rrl = ldns_pkt_answer(pkt);
-for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) {
-if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA)
-nsoa++;
-}
+rrl = ldns_rr_list_clone(ldns_pkt_answer(pkt));
 ldns_pkt_filter_answer(pkt, rrtype);
 report(res, dname != NULL ? dname : domain, pkt);
 if ((dname == NULL) ||
@@ -893,9 +904,29 @@ dozonetransfer(ldns_resolver *res, ldns_rdf *domain, b
 ldns_tcp_close(res);
 return false;
 }
-if (nsoa >= 2) {
-ldns_tcp_close(res);
-return true;
+for (i = 0; i < ldns_rr_list_rr_count(rrl); i++) {
+rr = ldns_rr_list_rr(rrl, i);
+if (nsoa == 0) {
+if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) {
+printf("; Transfer failed. "
+   "Didn't start with SOA answer.\n");
+ldns_tcp_close(res);
+return false;
+}
+first_serial = ldns_rr_soa_get_serial(rr);
+if ((o_mode == M_IXFR) && (first_serial <= o_ixfr_serial)) {
+ldns_tcp_close(res);
+return true;
+}
+}
+if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
+nsoa = nsoa < 2 ? nsoa + 1 : 1;
+if ((nsoa == 2) &&
+(ldns_rr_soa_get_serial(rr) == first_serial)) {
+ldns_tcp_close(res);
+return true;
+}
+}
 }
 if (ldns_tcp_read(, res) != LDNS_STATUS_OK) {
 printf("; Transfer failed.\n");
@@ -904,6 +935,7 @@ dozonetransfer(ldns_resolver *res, ldns_rdf *domain, b
 ldns_pkt_set_answerfrom(nextpkt,
 ldns_rdf_clone(ldns_pkt_answerfrom(pkt)));
 ldns_pkt_free(pkt);
+ldns_rr_list_free(rrl);
 pkt = nextpkt;
 }
 }
___
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: r330576 - in stable/11/sys: dev/iwm dev/otus dev/usb/wlan net80211

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 10:54:10 2018
New Revision: 330576
URL: https://svnweb.freebsd.org/changeset/base/330576

Log:
  Revert MFC of r330463 r330462 r330454 r330452 r330451:
  
  These commits have KPI/KBI considerations (or are a result of those that
  do). I did not properly take into account these concerns when merging to
  a kbi-stable branch.
  
  Requested by: jhb
  Pointyhat to: eadler

Modified:
  stable/11/sys/dev/iwm/if_iwm.c
  stable/11/sys/dev/otus/if_otus.c
  stable/11/sys/dev/usb/wlan/if_rsu.c
  stable/11/sys/net80211/ieee80211_freebsd.h
  stable/11/sys/net80211/ieee80211_ht.c
  stable/11/sys/net80211/ieee80211_input.c
  stable/11/sys/net80211/ieee80211_output.c
  stable/11/sys/net80211/ieee80211_proto.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iwm/if_iwm.c
==
--- stable/11/sys/dev/iwm/if_iwm.c  Wed Mar  7 10:47:27 2018
(r330575)
+++ stable/11/sys/dev/iwm/if_iwm.c  Wed Mar  7 10:54:10 2018
(r330576)
@@ -3260,13 +3260,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *
}
 
/* rssi is in 1/2db units */
-   rxs.c_rssi = rssi * 2;
-   rxs.c_nf = sc->sc_noise;
-   if (ieee80211_add_rx_params(m, ) == 0) {
-   if (ni)
-   ieee80211_free_node(ni);
-   goto fail;
-   }
+   rxs.rssi = rssi * 2;
+   rxs.nf = sc->sc_noise;
 
if (ieee80211_radiotap_active_vap(vap)) {
struct iwm_rx_radiotap_header *tap = >sc_rxtap;
@@ -3303,18 +3298,17 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *
IWM_UNLOCK(sc);
if (ni != NULL) {
IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m);
-   ieee80211_input_mimo(ni, m);
+   ieee80211_input_mimo(ni, m, );
ieee80211_free_node(ni);
} else {
IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m);
-   ieee80211_input_mimo_all(ic, m);
+   ieee80211_input_mimo_all(ic, m, );
}
IWM_LOCK(sc);
 
return TRUE;
 
-fail:
-   counter_u64_add(ic->ic_ierrors, 1);
+fail:  counter_u64_add(ic->ic_ierrors, 1);
return FALSE;
 }
 

Modified: stable/11/sys/dev/otus/if_otus.c
==
--- stable/11/sys/dev/otus/if_otus.cWed Mar  7 10:47:27 2018
(r330575)
+++ stable/11/sys/dev/otus/if_otus.cWed Mar  7 10:54:10 2018
(r330576)
@@ -1710,13 +1710,10 @@ otus_sub_rxeof(struct otus_softc *sc, uint8_t *buf, in
/* Add RSSI/NF to this mbuf */
bzero(, sizeof(rxs));
rxs.r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI;
-   rxs.c_nf = sc->sc_nf[0];/* XXX chain 0 != combined rssi/nf */
-   rxs.c_rssi = tail->rssi;
+   rxs.nf = sc->sc_nf[0];  /* XXX chain 0 != combined rssi/nf */
+   rxs.rssi = tail->rssi;
/* XXX TODO: add MIMO RSSI/NF as well */
-   if (ieee80211_add_rx_params(m, ) == 0) {
-   counter_u64_add(ic->ic_ierrors, 1);
-   return;
-   }
+   ieee80211_add_rx_params(m, );
 
/* XXX make a method */
STAILQ_INSERT_TAIL(>mq_head, m, m_stailqpkt);
@@ -1829,10 +1826,10 @@ tr_setup:
if (ni != NULL) {
if (ni->ni_flags & IEEE80211_NODE_HT)
m->m_flags |= M_AMPDU;
-   (void)ieee80211_input_mimo(ni, m);
+   (void)ieee80211_input_mimo(ni, m, NULL);
ieee80211_free_node(ni);
} else
-   (void)ieee80211_input_mimo_all(ic, m);
+   (void)ieee80211_input_mimo_all(ic, m, NULL);
}
 #ifdef IEEE80211_SUPPORT_SUPERG
ieee80211_ff_age_all(ic, 100);

Modified: stable/11/sys/dev/usb/wlan/if_rsu.c
==
--- stable/11/sys/dev/usb/wlan/if_rsu.c Wed Mar  7 10:47:27 2018
(r330575)
+++ stable/11/sys/dev/usb/wlan/if_rsu.c Wed Mar  7 10:54:10 2018
(r330576)
@@ -1546,14 +1546,12 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i
rxs.c_ieee = le32toh(bss->config.dsconfig);
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ);
/* This is a number from 0..100; so let's just divide it down a bit */
-   rxs.c_rssi = le32toh(bss->rssi) / 2;
-   rxs.c_nf = -96;
-   if (ieee80211_add_rx_params(m, ) == 0)
-   return;
+   rxs.rssi = le32toh(bss->rssi) / 2;
+   rxs.nf = -96;
 
/* XXX avoid a LOR */
RSU_UNLOCK(sc);
-   ieee80211_input_mimo_all(ic, m);
+   ieee80211_input_mimo_all(ic, m, );
RSU_LOCK(sc);
 }
 

Modified: 

svn commit: r330575 - in head/sys: conf dev/acpica dev/pci

2018-03-07 Thread Andrew Turner
Author: andrew
Date: Wed Mar  7 10:47:27 2018
New Revision: 330575
URL: https://svnweb.freebsd.org/changeset/base/330575

Log:
  Add an acpi attachment to the pci_host_generic driver and have the ACPI
  bus provide it with its needed memory resources.
  
  This allows us to use PCIe on the ThunderX2 and, with a previous version
  of the patch, on the SoftIron 3000 with ACPI.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation
  Sponsored by: DARPA, AFRL
  Sponsored by: Cavium (Hardware)
  Differential Revision:https://reviews.freebsd.org/D8767

Added:
  head/sys/dev/pci/pci_host_generic_acpi.c   (contents, props changed)
Modified:
  head/sys/conf/files.arm64
  head/sys/dev/acpica/acpi.c

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Mar  7 09:58:36 2018(r330574)
+++ head/sys/conf/files.arm64   Wed Mar  7 10:47:27 2018(r330575)
@@ -171,6 +171,8 @@ crypto/blowfish/bf_enc.coptionalcrypto | ipsec 
| ips
 crypto/des/des_enc.c   optionalcrypto | ipsec | ipsec_support 
| netsmb
 dev/acpica/acpi_bus_if.m   optionalacpi
 dev/acpica/acpi_if.m   optionalacpi
+dev/acpica/acpi_pci_link.c optionalacpi pci
+dev/acpica/acpi_pcib.c optionalacpi pci
 dev/ahci/ahci_generic.coptionalahci
 dev/axgbe/if_axgbe.c   optionalaxgbe
 dev/axgbe/xgbe-desc.c  optionalaxgbe
@@ -191,6 +193,7 @@ dev/neta/if_mvneta.coptionalneta 
mdio mii
 dev/ofw/ofw_cpu.c  optionalfdt
 dev/ofw/ofwpci.c   optionalfdt pci
 dev/pci/pci_host_generic.c optionalpci
+dev/pci/pci_host_generic_acpi.coptionalpci acpi
 dev/pci/pci_host_generic_fdt.c optionalpci fdt
 dev/psci/psci.coptionalpsci
 dev/psci/psci_arm64.S  optionalpsci

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed Mar  7 09:58:36 2018(r330574)
+++ head/sys/dev/acpica/acpi.c  Wed Mar  7 10:47:27 2018(r330575)
@@ -1883,6 +1883,29 @@ acpi_enable_pcie(void)
alloc++;
}
 }
+#elif defined(__aarch64__)
+static void
+acpi_enable_pcie(device_t child, int segment)
+{
+   ACPI_TABLE_HEADER *hdr;
+   ACPI_MCFG_ALLOCATION *alloc, *end;
+   ACPI_STATUS status;
+
+   status = AcpiGetTable(ACPI_SIG_MCFG, 1, );
+   if (ACPI_FAILURE(status))
+   return;
+
+   end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length);
+   alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1);
+   while (alloc < end) {
+   if (alloc->PciSegment == segment) {
+   bus_set_resource(child, SYS_RES_MEMORY, 0,
+   alloc->Address, 0x1000);
+   return;
+   }
+   alloc++;
+   }
+}
 #endif
 
 /*
@@ -1974,6 +1997,9 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi
 {
 ACPI_DEVICE_INFO *devinfo;
 struct acpi_device *ad;
+#ifdef __aarch64__
+int segment;
+#endif
 struct acpi_prw_data prw;
 ACPI_OBJECT_TYPE type;
 ACPI_HANDLE h;
@@ -2076,6 +2102,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi
ad->ad_cls_class = strtoul(devinfo->ClassCode.String,
NULL, 16);
}
+#ifdef __aarch64__
+   if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
+   if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", 
))) {
+   acpi_enable_pcie(child, segment);
+   }
+   }
+#endif
AcpiOsFree(devinfo);
}
break;

Added: head/sys/dev/pci/pci_host_generic_acpi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/pci/pci_host_generic_acpi.cWed Mar  7 10:47:27 2018
(r330575)
@@ -0,0 +1,329 @@
+/*-
+ * Copyright (c) 2015 Ruslan Bukin 
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Semihalf under
+ * the sponsorship of the FreeBSD Foundation.
+ *
+ * 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 

svn commit: r330574 - head/sys/arm64/arm64

2018-03-07 Thread Andrew Turner
Author: andrew
Date: Wed Mar  7 09:58:36 2018
New Revision: 330574
URL: https://svnweb.freebsd.org/changeset/base/330574

Log:
  Restrict the arm64 DMAP region to the 1G blocks where we have at least
  one physical page. This is in preparation for limiting it further as this
  is needed on some hardware, however testing has shown issues with further
  restricting the DMAP and ACPI.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: Cavium (Hardware)

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Mar  7 09:40:41 2018(r330573)
+++ head/sys/arm64/arm64/pmap.c Wed Mar  7 09:58:36 2018(r330574)
@@ -570,21 +570,32 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
vm_offset_t va;
vm_paddr_t pa;
u_int l1_slot;
+   int i;
 
-   pa = dmap_phys_base = min_pa & ~L1_OFFSET;
-   va = DMAP_MIN_ADDRESS;
-   for (; va < DMAP_MAX_ADDRESS && pa < max_pa;
-   pa += L1_SIZE, va += L1_SIZE, l1_slot++) {
-   l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT);
+   dmap_phys_base = min_pa & ~L1_OFFSET;
+   dmap_phys_max = 0;
+   dmap_max_addr = 0;
 
-   pmap_load_store(_dmap[l1_slot],
-   (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN |
-   ATTR_IDX(CACHED_MEMORY) | L1_BLOCK);
-   }
+   for (i = 0; i < (physmap_idx * 2); i += 2) {
+   pa = physmap[i] & ~L1_OFFSET;
+   va = pa - dmap_phys_base + DMAP_MIN_ADDRESS;
 
-   /* Set the upper limit of the DMAP region */
-   dmap_phys_max = pa;
-   dmap_max_addr = va;
+   for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1];
+   pa += L1_SIZE, va += L1_SIZE) {
+   l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT);
+   /* We already have an entry */
+   if (pagetable_dmap[l1_slot] != 0)
+   continue;
+   pmap_load_store(_dmap[l1_slot],
+   (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN |
+   ATTR_IDX(CACHED_MEMORY) | L1_BLOCK);
+   }
+
+   if (pa > dmap_phys_max) {
+   dmap_phys_max = pa;
+   dmap_max_addr = va;
+   }
+   }
 
cpu_tlb_flushID();
 }
___
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: r330573 - head/share/man/man4

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 09:40:41 2018
New Revision: 330573
URL: https://svnweb.freebsd.org/changeset/base/330573

Log:
  psm.4: remove useless information
  
  Obtained from:DragonflyBSD (f49f67c528ec63f5524da5c11e060a0e67866242)
  MFC After:1 week

Modified:
  head/share/man/man4/psm.4

Modified: head/share/man/man4/psm.4
==
--- head/share/man/man4/psm.4   Wed Mar  7 09:31:27 2018(r330572)
+++ head/share/man/man4/psm.4   Wed Mar  7 09:40:41 2018(r330573)
@@ -868,11 +868,6 @@ unless the X server is accessing the mouse via
 .Xr moused 8 .
 Clicking any button without moving the mouse may also work.
 .Sh BUGS
-The ioctl command
-.Dv MOUSEIOCREAD
-has been removed.
-It was never functional anyway.
-.Pp
 Enabling the extended support for Synaptics touchpads has been reported to
 cause problems with responsivity on some (newer) models of Synaptics
 hardware, particularly those with guest devices.
___
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: r330572 - head/lib/libc/rpc

2018-03-07 Thread Eitan Adler
Author: eadler
Date: Wed Mar  7 09:31:27 2018
New Revision: 330572
URL: https://svnweb.freebsd.org/changeset/base/330572

Log:
  des_crypt.3: Fix typo.
  
  Obtained from:DragonflyBSD (a78d083cf561cf325e8f1a151251b8901159e2ce)
  MFC After:3 days

Modified:
  head/lib/libc/rpc/des_crypt.3

Modified: head/lib/libc/rpc/des_crypt.3
==
--- head/lib/libc/rpc/des_crypt.3   Wed Mar  7 06:39:00 2018
(r330571)
+++ head/lib/libc/rpc/des_crypt.3   Wed Mar  7 09:31:27 2018
(r330572)
@@ -108,7 +108,7 @@ vector upon return.
 No error.
 .It Bq Er DESERR_NOHWDEVICE
 Encryption succeeded, but done in software instead of the requested hardware.
-.It Bq Er DESERR_HWERR
+.It Bq Er DESERR_HWERROR
 An error occurred in the hardware or driver.
 .It Bq Er DESERR_BADPARAM
 Bad argument to routine.
___
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"