Re: svn commit: r340038 - in head: lib/libc/sys sys/kern

2018-11-01 Thread Conrad Meyer
On Thu, Nov 1, 2018 at 5:46 PM Konstantin Belousov  wrote:
>
> On Thu, Nov 01, 2018 at 11:46:23PM +, Conrad Meyer wrote:
> > ...
> > @@ -232,7 +232,15 @@ points outside the process's allocated address space.
> >  A signal was delivered before the time limit expired and
> >  before any of the selected events occurred.
> >  .It Bq Er EINVAL
> > -The specified time limit is invalid. One of its components is negative or 
> > too large.
> > +The specified time limit is invalid.
> > +One of its components is negative or too large.
> > +.It Bq Er EINVAL
> > +The number of pollfd structures specified by
> > +.Fa nfds
> > +exceeds the system tunable
> > +.Va kern.maxfilesperproc
> > +and
> > +.Dv FD_SETSIZE .
>
> This is somewhat confusing.  Looking only at the man page text, most
> straight reading of it is that nfds cannot exceed min(maxfilesperproc,
> FD_SETSIZE).  But in fact nfds cannot exceed max of it, which is
> significantly different, i.e. poll(2) does not suffer from the (userspace)
> FD_SETSIZE limitation of select(2).

min(maxfilesperproc, FD_SETSIZE) would be written as "nfds exceeds ...
maxfilesperproc OR FD_SETSIZE," rather than "and."  I think the
sentence is unambiguous.

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


svn commit: r340040 - head/stand/lua

2018-11-01 Thread Kyle Evans
Author: kevans
Date: Fri Nov  2 03:25:23 2018
New Revision: 340040
URL: https://svnweb.freebsd.org/changeset/base/340040

Log:
  lualoader: Implement boot-conf
  
  MFC after:3 days

Modified:
  head/stand/lua/cli.lua
  head/stand/lua/cli.lua.8

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Thu Nov  1 23:56:10 2018(r340039)
+++ head/stand/lua/cli.lua  Fri Nov  2 03:25:23 2018(r340040)
@@ -115,6 +115,16 @@ function cli.autoboot(...)
core.autoboot(argstr)
 end
 
+cli['boot-conf'] = function(...)
+   local _, argv = cli.arguments(...)
+   local kernel, argstr = parseBootArgs(argv)
+   if kernel ~= nil then
+   loader.perform("unload")
+   config.selectKernel(kernel)
+   end
+   core.autoboot(argstr)
+end
+
 -- Used for splitting cli varargs into cmd_name and the rest of argv
 function cli.arguments(...)
local argv = {...}

Modified: head/stand/lua/cli.lua.8
==
--- head/stand/lua/cli.lua.8Thu Nov  1 23:56:10 2018(r340039)
+++ head/stand/lua/cli.lua.8Fri Nov  2 03:25:23 2018(r340040)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 9, 2018
+.Dd October 31, 2018
 .Dt CLI.LUA 8
 .Os
 .Sh NAME
@@ -80,10 +80,11 @@ Arguments may be passed to it as usual, space-delimite
 As of present, the
 .Nm
 module by default provides commands for
-.Ic autoboot
+.Ic autoboot ,
+.Ic boot ,
 and
-.Ic boot .
-In both cases, the
+.Ic boot-conf.
+In all three cases, the
 .Xr core.lua 8
 module will load all ELF modules as-needed before executing the equivalent
 built-in loader commands.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-01 Thread Mark Millard via svn-src-head
On 2018-Nov-1, at 5:41 PM, Konstantin Belousov  wrote:

> On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote:
>> Konstantin Belousov kostikbel at gmail.com wrote on
>> Tue Oct 30 18:04:04 UTC 2018 :
>> 
>>> On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote:
 On Tue, 30 Oct 2018 at 10:17, Michael Tuexen
  wrote:
> 
>> On 29. Oct 2018, at 22:08, Alex Richardson  
>> wrote:
>> 
>> Author: arichardson
>> Date: Mon Oct 29 21:08:02 2018
>> New Revision: 339876
>> URL: https://svnweb.freebsd.org/changeset/base/339876
>> 
>> Log:
>> rtld: set obj->textsize correctly
>> 
>> With lld-generated binaries the first PT_LOAD will usually be a read-only
>> segment unless you pass --no-rosegment. For those binaries the textsize 
>> is
>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries 
>> to
>> be parsed correctly use the end of the last PT_LOAD that is marked as
>> executable instead.
>> 
>> I noticed that the value was wrong while adding some debug prints for 
>> some rtld
>> changes for CHERI binaries. `obj->textsize` only seems to be used by PPC 
>> so the
>> effect is untested. However, the value before was definitely wrong and 
>> the new
>> result matches the phdrs.
> I build kernel and world with a revision later than this on a PPC. 
> Buildword
> ends up with a world where almost all binaries are segfaulting 
> Especially gdb
> (but svn, ls or so all segfault).
> 
> Best regards
> Michael
 
 This is rather surprising since if anything the range of the icache
 flush should increase rather than decrease after this change.
 
 I can only see this causing a behaviour change if we actually need to
 flush more than just the executable segments.
 Is it possible that some binary/library contains a non-executable
 segment as the first PT_LOAD?
 Or is there some linker script that adds custom PHDRS?
 
>>> Could it be that there is a hole between start of the object mapping and
>>> the last PT_LOADable segment eligible for execution ?
>> 
>> [This note may be easier to deal with than the first
>> note that I sent out.]
>> 
>> [My examples are from devel/powerpc64-xtoolchain-gcc used
>> to buildworld buildkernel targeting a head -r339076 based
>> powerpc64 environment. I do that on powerpc64 as well.]
>> 
>> powerpc64 loads the readonly data and the readonly code in one PT_LOAD,
>> the first. The 2nd PT_LOAD is for sections without the readonly status,
>> that includes .got and .plt being spanned. See below from
>> objdump -ph for /bin/ls :
>> 
>> Program Header:
>>PHDR off0x0040 vaddr 0x1040 paddr 
>> 0x1040 align 2**3
>> filesz 0x0188 memsz 0x0188 flags r--
>>  INTERP off0x01c8 vaddr 0x11c8 paddr 
>> 0x11c8 align 2**0
>> filesz 0x0015 memsz 0x0015 flags r--
>>LOAD off0x vaddr 0x1000 paddr 
>> 0x1000 align 2**16
>> filesz 0x910c memsz 0x910c flags r-x
>>LOAD off0x9110 vaddr 0x10019110 paddr 
>> 0x10019110 align 2**16
>> filesz 0x0ee0 memsz 0x10e8 flags rw-
>> DYNAMIC off0x9138 vaddr 0x10019138 paddr 
>> 0x10019138 align 2**3
>> filesz 0x01c0 memsz 0x01c0 flags rw-
>>NOTE off0x01e0 vaddr 0x11e0 paddr 
>> 0x11e0 align 2**2
>> filesz 0x0030 memsz 0x0030 flags r--
>>   STACK off0x vaddr 0x paddr 
>> 0x align 2**4
>> filesz 0x memsz 0x flags rw-
> 
> We only need program headers, and we only need them from the object
> which load causes the fault.  It might be not the binary but some library
> that triggers the fault.  So the backtrace and some information from the
> state of the image is needed.
> 
> You can build only rtld and use it as the standalone program to initiate
> the image activation:
>   /ld-elf.so.1 /bin/ls
> or similar.

It will be a while before I can get an environment set
up which allows me to get a backtrace from a 32-bit
powerpc system. I have demonstrated that I get the crash
with what I tried to verify such.

I'll work on getting an environment in place that allows
what you are asking for.

Problem reproduction details (if you care) . . .

I've been trying to provide evidence but my 32-bit powerpc
environment is not as modern as has the problem. Also: the
buildworld it was installed from was built via clang, which
means that the libgcc_s.so that was built does not correctly
support C++ exceptions. (clang's generated output is the
source of that pr

Re: svn commit: r340038 - in head: lib/libc/sys sys/kern

2018-11-01 Thread Konstantin Belousov
On Thu, Nov 01, 2018 at 11:46:23PM +, Conrad Meyer wrote:
> Author: cem
> Date: Thu Nov  1 23:46:23 2018
> New Revision: 340038
> URL: https://svnweb.freebsd.org/changeset/base/340038
> 
> Log:
>   kern_poll: Restore explanatory comment removed in r177374
>   
>   The comment isn't stale.  The check is bogus in the sense that poll(2)
>   does not require pollfd entries to be unique in fd space, so there is no
>   reason there cannot be more pollfd entries than open or even allowed
>   fds.  The check is mostly a seatbelt against accidental misuse or
>   abuse.  FD_SETSIZE, while usually unrelated to poll, is used as an
>   arbitrary floor for systems with very low kern.maxfilesperproc.
>   
>   Additionally, document this possible EINVAL condition in the poll.2
>   manual.
>   
>   No functional change.
>   
>   Reviewed by:markj
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D17671
> 
> Modified:
>   head/lib/libc/sys/poll.2
>   head/sys/kern/sys_generic.c
> 
> Modified: head/lib/libc/sys/poll.2
> ==
> --- head/lib/libc/sys/poll.2  Thu Nov  1 23:42:35 2018(r340037)
> +++ head/lib/libc/sys/poll.2  Thu Nov  1 23:46:23 2018(r340038)
> @@ -28,7 +28,7 @@
>  .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
>  .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>  .\"
> -.Dd November 13, 2014
> +.Dd November 1, 2018
>  .Dt POLL 2
>  .Os
>  .Sh NAME
> @@ -232,7 +232,15 @@ points outside the process's allocated address space.
>  A signal was delivered before the time limit expired and
>  before any of the selected events occurred.
>  .It Bq Er EINVAL
> -The specified time limit is invalid. One of its components is negative or 
> too large.
> +The specified time limit is invalid.
> +One of its components is negative or too large.
> +.It Bq Er EINVAL
> +The number of pollfd structures specified by
> +.Fa nfds
> +exceeds the system tunable
> +.Va kern.maxfilesperproc
> +and
> +.Dv FD_SETSIZE .
This is somewhat confusing.  Looking only at the man page text, most
straight reading of it is that nfds cannot exceed min(maxfilesperproc,
FD_SETSIZE).  But in fact nfds cannot exceed max of it, which is
significantly different, i.e. poll(2) does not suffer from the (userspace)
FD_SETSIZE limitation of select(2).

>  .El
>  .Sh SEE ALSO
>  .Xr accept 2 ,
> 
> Modified: head/sys/kern/sys_generic.c
> ==
> --- head/sys/kern/sys_generic.c   Thu Nov  1 23:42:35 2018
> (r340037)
> +++ head/sys/kern/sys_generic.c   Thu Nov  1 23:46:23 2018
> (r340038)
> @@ -1339,6 +1339,13 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_in
>   } else
>   sbt = -1;
>  
> + /*
> +  * This is kinda bogus.  We have fd limits, but that is not
> +  * really related to the size of the pollfd array.  Make sure
> +  * we let the process use at least FD_SETSIZE entries and at
> +  * least enough for the system-wide limits.  We want to be reasonably
> +  * safe, but not overly restrictive.
> +  */
>   if (nfds > maxfilesperproc && nfds > FD_SETSIZE) 
>   return (EINVAL);
>   if (nfds > nitems(stackfds))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-01 Thread Konstantin Belousov
On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote:
> Konstantin Belousov kostikbel at gmail.com wrote on
> Tue Oct 30 18:04:04 UTC 2018 :
> 
> > On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote:
> > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen
> > >  wrote:
> > > >
> > > > > On 29. Oct 2018, at 22:08, Alex Richardson  > > > > FreeBSD.org> wrote:
> > > > >
> > > > > Author: arichardson
> > > > > Date: Mon Oct 29 21:08:02 2018
> > > > > New Revision: 339876
> > > > > URL: https://svnweb.freebsd.org/changeset/base/339876
> > > > >
> > > > > Log:
> > > > >  rtld: set obj->textsize correctly
> > > > >
> > > > >  With lld-generated binaries the first PT_LOAD will usually be a 
> > > > > read-only
> > > > >  segment unless you pass --no-rosegment. For those binaries the 
> > > > > textsize is
> > > > >  determined by the next PT_LOAD. To allow both LLD and bfd 2.17 
> > > > > binaries to
> > > > >  be parsed correctly use the end of the last PT_LOAD that is marked as
> > > > >  executable instead.
> > > > >
> > > > >  I noticed that the value was wrong while adding some debug prints 
> > > > > for some rtld
> > > > >  changes for CHERI binaries. `obj->textsize` only seems to be used by 
> > > > > PPC so the
> > > > >  effect is untested. However, the value before was definitely wrong 
> > > > > and the new
> > > > >  result matches the phdrs.
> > > > I build kernel and world with a revision later than this on a PPC. 
> > > > Buildword
> > > > ends up with a world where almost all binaries are segfaulting 
> > > > Especially gdb
> > > > (but svn, ls or so all segfault).
> > > >
> > > > Best regards
> > > > Michael
> > > 
> > > This is rather surprising since if anything the range of the icache
> > > flush should increase rather than decrease after this change.
> > > 
> > > I can only see this causing a behaviour change if we actually need to
> > > flush more than just the executable segments.
> > > Is it possible that some binary/library contains a non-executable
> > > segment as the first PT_LOAD?
> > > Or is there some linker script that adds custom PHDRS?
> > > 
> > Could it be that there is a hole between start of the object mapping and
> > the last PT_LOADable segment eligible for execution ?
> 
> [This note may be easier to deal with than the first
> note that I sent out.]
> 
> [My examples are from devel/powerpc64-xtoolchain-gcc used
> to buildworld buildkernel targeting a head -r339076 based
> powerpc64 environment. I do that on powerpc64 as well.]
> 
> powerpc64 loads the readonly data and the readonly code in one PT_LOAD,
> the first. The 2nd PT_LOAD is for sections without the readonly status,
> that includes .got and .plt being spanned. See below from
> objdump -ph for /bin/ls :
> 
> Program Header:
> PHDR off0x0040 vaddr 0x1040 paddr 
> 0x1040 align 2**3
>  filesz 0x0188 memsz 0x0188 flags r--
>   INTERP off0x01c8 vaddr 0x11c8 paddr 
> 0x11c8 align 2**0
>  filesz 0x0015 memsz 0x0015 flags r--
> LOAD off0x vaddr 0x1000 paddr 
> 0x1000 align 2**16
>  filesz 0x910c memsz 0x910c flags r-x
> LOAD off0x9110 vaddr 0x10019110 paddr 
> 0x10019110 align 2**16
>  filesz 0x0ee0 memsz 0x10e8 flags rw-
>  DYNAMIC off0x9138 vaddr 0x10019138 paddr 
> 0x10019138 align 2**3
>  filesz 0x01c0 memsz 0x01c0 flags rw-
> NOTE off0x01e0 vaddr 0x11e0 paddr 
> 0x11e0 align 2**2
>  filesz 0x0030 memsz 0x0030 flags r--
>STACK off0x vaddr 0x paddr 
> 0x align 2**4
>  filesz 0x memsz 0x flags rw-
We only need program headers, and we only need them from the object
which load causes the fault.  It might be not the binary but some library
that triggers the fault.  So the backtrace and some information from the
state of the image is needed.

You can build only rtld and use it as the standalone program to initiate
the image activation:
/ld-elf.so.1 /bin/ls
or similar.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340038 - in head: lib/libc/sys sys/kern

2018-11-01 Thread Conrad Meyer
Author: cem
Date: Thu Nov  1 23:46:23 2018
New Revision: 340038
URL: https://svnweb.freebsd.org/changeset/base/340038

Log:
  kern_poll: Restore explanatory comment removed in r177374
  
  The comment isn't stale.  The check is bogus in the sense that poll(2)
  does not require pollfd entries to be unique in fd space, so there is no
  reason there cannot be more pollfd entries than open or even allowed
  fds.  The check is mostly a seatbelt against accidental misuse or
  abuse.  FD_SETSIZE, while usually unrelated to poll, is used as an
  arbitrary floor for systems with very low kern.maxfilesperproc.
  
  Additionally, document this possible EINVAL condition in the poll.2
  manual.
  
  No functional change.
  
  Reviewed by:  markj
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D17671

Modified:
  head/lib/libc/sys/poll.2
  head/sys/kern/sys_generic.c

Modified: head/lib/libc/sys/poll.2
==
--- head/lib/libc/sys/poll.2Thu Nov  1 23:42:35 2018(r340037)
+++ head/lib/libc/sys/poll.2Thu Nov  1 23:46:23 2018(r340038)
@@ -28,7 +28,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2014
+.Dd November 1, 2018
 .Dt POLL 2
 .Os
 .Sh NAME
@@ -232,7 +232,15 @@ points outside the process's allocated address space.
 A signal was delivered before the time limit expired and
 before any of the selected events occurred.
 .It Bq Er EINVAL
-The specified time limit is invalid. One of its components is negative or too 
large.
+The specified time limit is invalid.
+One of its components is negative or too large.
+.It Bq Er EINVAL
+The number of pollfd structures specified by
+.Fa nfds
+exceeds the system tunable
+.Va kern.maxfilesperproc
+and
+.Dv FD_SETSIZE .
 .El
 .Sh SEE ALSO
 .Xr accept 2 ,

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Thu Nov  1 23:42:35 2018(r340037)
+++ head/sys/kern/sys_generic.c Thu Nov  1 23:46:23 2018(r340038)
@@ -1339,6 +1339,13 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_in
} else
sbt = -1;
 
+   /*
+* This is kinda bogus.  We have fd limits, but that is not
+* really related to the size of the pollfd array.  Make sure
+* we let the process use at least FD_SETSIZE entries and at
+* least enough for the system-wide limits.  We want to be reasonably
+* safe, but not overly restrictive.
+*/
if (nfds > maxfilesperproc && nfds > FD_SETSIZE) 
return (EINVAL);
if (nfds > nitems(stackfds))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340037 - in head/contrib/unbound: . util

2018-11-01 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Nov  1 23:42:35 2018
New Revision: 340037
URL: https://svnweb.freebsd.org/changeset/base/340037

Log:
  Merge upstream r4932: turn so-reuseport option off by default.
  
  MFC after:3 days

Modified:
  head/contrib/unbound/config.h
  head/contrib/unbound/config.h.in
  head/contrib/unbound/configure
  head/contrib/unbound/configure.ac
  head/contrib/unbound/util/config_file.c
Directory Properties:
  head/contrib/unbound/   (props changed)

Modified: head/contrib/unbound/config.h
==
--- head/contrib/unbound/config.h   Thu Nov  1 23:11:47 2018
(r340036)
+++ head/contrib/unbound/config.h   Thu Nov  1 23:42:35 2018
(r340037)
@@ -664,6 +664,9 @@
 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void
 
+/* if REUSEPORT is enabled by default */
+#define REUSEPORT_DEFAULT 0
+
 /* default rootkey location */
 #define ROOT_ANCHOR_FILE "/var/unbound/root.key"
 

Modified: head/contrib/unbound/config.h.in
==
--- head/contrib/unbound/config.h.inThu Nov  1 23:11:47 2018
(r340036)
+++ head/contrib/unbound/config.h.inThu Nov  1 23:42:35 2018
(r340037)
@@ -663,6 +663,9 @@
 /* Define as the return type of signal handlers (`int' or `void'). */
 #undef RETSIGTYPE
 
+/* if REUSEPORT is enabled by default */
+#undef REUSEPORT_DEFAULT
+
 /* default rootkey location */
 #undef ROOT_ANCHOR_FILE
 

Modified: head/contrib/unbound/configure
==
--- head/contrib/unbound/configure  Thu Nov  1 23:11:47 2018
(r340036)
+++ head/contrib/unbound/configure  Thu Nov  1 23:42:35 2018
(r340037)
@@ -15966,6 +15966,17 @@ fi
 done
 
 
+# check if we can use SO_REUSEPORT
+if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
+
+$as_echo "#define REUSEPORT_DEFAULT 1" >>confdefs.h
+
+else
+
+$as_echo "#define REUSEPORT_DEFAULT 0" >>confdefs.h
+
+fi
+
 # set memory allocation checking if requested
 # Check whether --enable-alloc-checks was given.
 if test "${enable_alloc_checks+set}" = set; then :

Modified: head/contrib/unbound/configure.ac
==
--- head/contrib/unbound/configure.ac   Thu Nov  1 23:11:47 2018
(r340036)
+++ head/contrib/unbound/configure.ac   Thu Nov  1 23:42:35 2018
(r340037)
@@ -461,6 +461,13 @@ ACX_CHECK_NONBLOCKING_BROKEN
 ACX_MKDIR_ONE_ARG
 AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])])
 
+# check if we can use SO_REUSEPORT
+if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
+   AC_DEFINE(REUSEPORT_DEFAULT, 1, [if REUSEPORT is enabled by default])
+else
+   AC_DEFINE(REUSEPORT_DEFAULT, 0, [if REUSEPORT is enabled by default])
+fi
+
 # set memory allocation checking if requested
 AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks],
[ enable to memory allocation statistics, for debug purposes ]), 

Modified: head/contrib/unbound/util/config_file.c
==
--- head/contrib/unbound/util/config_file.c Thu Nov  1 23:11:47 2018
(r340036)
+++ head/contrib/unbound/util/config_file.c Thu Nov  1 23:42:35 2018
(r340037)
@@ -177,7 +177,7 @@ config_create(void)
cfg->if_automatic = 0;
cfg->so_rcvbuf = 0;
cfg->so_sndbuf = 0;
-   cfg->so_reuseport = 1;
+   cfg->so_reuseport = REUSEPORT_DEFAULT;
cfg->ip_transparent = 0;
cfg->ip_freebind = 0;
cfg->num_ifs = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340036 - in head/sys: conf modules/bios/smapi

2018-11-01 Thread Ed Maste
Author: emaste
Date: Thu Nov  1 23:11:47 2018
New Revision: 340036
URL: https://svnweb.freebsd.org/changeset/base/340036

Log:
  Retire CLANG_NO_IAS34
  
  CLANG_NO_IAS34 was introduced in r276696 to allow then-HEAD kernels to
  be built with clang 3.4 in FreeBSD 10.  As FreeBSD 11 and later includes
  a version of Clang with a sufficiently capable integrated assembler we
  do not need the workaround any longer.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/Makefile.amd64
  head/sys/conf/Makefile.i386
  head/sys/conf/kern.mk
  head/sys/modules/bios/smapi/Makefile

Modified: head/sys/conf/Makefile.amd64
==
--- head/sys/conf/Makefile.amd64Thu Nov  1 23:10:53 2018
(r340035)
+++ head/sys/conf/Makefile.amd64Thu Nov  1 23:11:47 2018
(r340036)
@@ -37,9 +37,6 @@ INCLUDES+= -I$S/contrib/libfdt
 CFLAGS+=   -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 .endif
 
-ASM_CFLAGS.acpi_wakecode.S=${CLANG_NO_IAS34}
-ASM_CFLAGS.mpboot.S=   ${CLANG_NO_IAS34}
-
 %BEFORE_DEPEND
 
 %OBJS

Modified: head/sys/conf/Makefile.i386
==
--- head/sys/conf/Makefile.i386 Thu Nov  1 23:10:53 2018(r340035)
+++ head/sys/conf/Makefile.i386 Thu Nov  1 23:11:47 2018(r340036)
@@ -32,9 +32,6 @@ S=../../..
 
 INCLUDES+= -I$S/contrib/libfdt
 
-ASM_CFLAGS.acpi_wakecode.S=${CLANG_NO_IAS34}
-ASM_CFLAGS.mpboot.s=   ${CLANG_NO_IAS34}
-
 %BEFORE_DEPEND
 
 %OBJS

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Thu Nov  1 23:10:53 2018(r340035)
+++ head/sys/conf/kern.mk   Thu Nov  1 23:11:47 2018(r340036)
@@ -39,10 +39,6 @@ CWARNEXTRA+= -Wno-address-of-packed-member
 .endif
 
 CLANG_NO_IAS= -no-integrated-as
-.if ${COMPILER_VERSION} < 30500
-# XXX: clang < 3.5 integrated-as doesn't grok .codeNN directives
-CLANG_NO_IAS34= -no-integrated-as
-.endif
 .endif
 
 .if ${COMPILER_TYPE} == "gcc"

Modified: head/sys/modules/bios/smapi/Makefile
==
--- head/sys/modules/bios/smapi/MakefileThu Nov  1 23:10:53 2018
(r340035)
+++ head/sys/modules/bios/smapi/MakefileThu Nov  1 23:11:47 2018
(r340036)
@@ -8,5 +8,3 @@ SRCS=   smapi.c smapi_bios.S \
bus_if.h device_if.h
 
 .include 
-
-CFLAGS.smapi_bios.S=   ${CLANG_NO_IAS34}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340035 - in head/sys: compat/freebsd32 kern sys

2018-11-01 Thread Brooks Davis
Author: brooks
Date: Thu Nov  1 23:10:53 2018
New Revision: 340035
URL: https://svnweb.freebsd.org/changeset/base/340035

Log:
  Regent after r340034: Use mode_t when the documented signature does.
  
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17784

Modified:
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/systrace_args.c
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Nov  1 23:06:50 
2018(r340034)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Nov  1 23:10:53 
2018(r340035)
@@ -54,7 +54,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
struct open_args *p = params;
uarg[0] = (intptr_t) p->path; /* char * */
iarg[1] = p->flags; /* int */
-   iarg[2] = p->mode; /* int */
+   iarg[2] = p->mode; /* mode_t */
*n_args = 3;
break;
}
@@ -108,7 +108,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
case 15: {
struct chmod_args *p = params;
uarg[0] = (intptr_t) p->path; /* char * */
-   iarg[1] = p->mode; /* int */
+   iarg[1] = p->mode; /* mode_t */
*n_args = 2;
break;
}
@@ -396,7 +396,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
/* umask */
case 60: {
struct umask_args *p = params;
-   iarg[0] = p->newmask; /* int */
+   iarg[0] = p->newmask; /* mode_t */
*n_args = 1;
break;
}
@@ -692,7 +692,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
case 124: {
struct fchmod_args *p = params;
iarg[0] = p->fd; /* int */
-   iarg[1] = p->mode; /* int */
+   iarg[1] = p->mode; /* mode_t */
*n_args = 2;
break;
}
@@ -732,7 +732,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
case 132: {
struct mkfifo_args *p = params;
uarg[0] = (intptr_t) p->path; /* char * */
-   iarg[1] = p->mode; /* int */
+   iarg[1] = p->mode; /* mode_t */
*n_args = 2;
break;
}
@@ -770,7 +770,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
case 136: {
struct mkdir_args *p = params;
uarg[0] = (intptr_t) p->path; /* char * */
-   iarg[1] = p->mode; /* int */
+   iarg[1] = p->mode; /* mode_t */
*n_args = 2;
break;
}
@@ -3329,7 +3329,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "int";
break;
case 2:
-   p = "int";
+   p = "mode_t";
break;
default:
break;
@@ -3414,7 +3414,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "userland char *";
break;
case 1:
-   p = "int";
+   p = "mode_t";
break;
default:
break;
@@ -3864,7 +3864,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
case 60:
switch(ndx) {
case 0:
-   p = "int";
+   p = "mode_t";
break;
default:
break;
@@ -4353,7 +4353,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "int";
break;
case 1:
-   p = "int";
+   p = "mode_t";
break;
default:
break;
@@ -4418,7 +4418,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "userland char *";
break;
case 1:
-   p = "int";
+   p = "mode_t";
break;
default:
break;
@@ -4488,7 +4488,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
p = "userland char *";
break;
case 1:
-   p = "int";
+   p = "mode_t";
break;
default:
break;

Modified: head/sys/kern/systrace_args.c
==
--- head/sys/kern/systrace_args

svn commit: r340034 - in head/sys: compat/freebsd32 kern

2018-11-01 Thread Brooks Davis
Author: brooks
Date: Thu Nov  1 23:06:50 2018
New Revision: 340034
URL: https://svnweb.freebsd.org/changeset/base/340034

Log:
  Use mode_t when the documented signature does.
  
  This is more clear and produces better results when generating function
  stubs from syscalls.master.
  
  Reviewed by:  kib, emaste
  Obtained from:CheribSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17784

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Thu Nov  1 23:01:24 2018
(r340033)
+++ head/sys/compat/freebsd32/syscalls.master   Thu Nov  1 23:06:50 2018
(r340034)
@@ -73,7 +73,7 @@
 4  AUE_WRITE   NOPROTO { ssize_t write(int fd, const void *buf, \
size_t nbyte); }
 5  AUE_OPEN_RWTC   NOPROTO { int open(char *path, int flags, \
-   int mode); }
+   mode_t mode); }
 6  AUE_CLOSE   NOPROTO { int close(int fd); }
 7  AUE_WAIT4   STD { int freebsd32_wait4(int pid, int *status, \
int options, struct rusage32 *rusage); }
@@ -85,7 +85,7 @@
 13 AUE_FCHDIR  NOPROTO { int fchdir(int fd); }
 14 AUE_MKNOD   COMPAT11 { int freebsd32_mknod(char *path, \
int mode, int dev); }
-15 AUE_CHMOD   NOPROTO { int chmod(char *path, int mode); }
+15 AUE_CHMOD   NOPROTO { int chmod(char *path, mode_t mode); }
 16 AUE_CHOWN   NOPROTO { int chown(char *path, int uid, int gid); }
 17 AUE_NULLNOPROTO { caddr_t break(char *nsize); }
 18 AUE_GETFSSTAT   COMPAT4 { int freebsd32_getfsstat( \
@@ -155,7 +155,7 @@
size_t count); }
 59 AUE_EXECVE  STD { int freebsd32_execve(char *fname, \
uint32_t *argv, uint32_t *envv); }
-60 AUE_UMASK   NOPROTO { int umask(int newmask); }
+60 AUE_UMASK   NOPROTO { int umask(mode_t newmask); }
 61 AUE_CHROOT  NOPROTO { int chroot(char *path); }
 62 AUE_FSTAT   COMPAT  { int freebsd32_fstat(int fd, \
struct ostat32 *ub); }
@@ -253,7 +253,7 @@
struct timeval32 *tv, \
struct timezone *tzp); }
 123AUE_FCHOWN  NOPROTO { int fchown(int fd, int uid, int gid); }
-124AUE_FCHMOD  NOPROTO { int fchmod(int fd, int mode); }
+124AUE_FCHMOD  NOPROTO { int fchmod(int fd, mode_t mode); }
 125AUE_RECVFROMOBSOL   orecvfrom
 126AUE_SETREUIDNOPROTO { int setreuid(int ruid, int euid); }
 127AUE_SETREGIDNOPROTO { int setregid(int rgid, int egid); }
@@ -262,14 +262,14 @@
int length); }
 130AUE_FTRUNCATE   COMPAT|NOPROTO  { int ftruncate(int fd, int length); }
 131AUE_FLOCK   NOPROTO { int flock(int fd, int how); }
-132AUE_MKFIFO  NOPROTO { int mkfifo(char *path, int mode); }
+132AUE_MKFIFO  NOPROTO { int mkfifo(char *path, mode_t mode); }
 133AUE_SENDTO  NOPROTO { int sendto(int s, caddr_t buf, \
size_t len, int flags, caddr_t to, \
int tolen); }
 134AUE_SHUTDOWNNOPROTO { int shutdown(int s, int how); }
 135AUE_SOCKETPAIR  NOPROTO { int socketpair(int domain, int type, \
int protocol, int *rsv); }
-136AUE_MKDIR   NOPROTO { int mkdir(char *path, int mode); }
+136AUE_MKDIR   NOPROTO { int mkdir(char *path, mode_t mode); }
 137AUE_RMDIR   NOPROTO { int rmdir(char *path); }
 138AUE_UTIMES  STD { int freebsd32_utimes(char *path, \
struct timeval32 *tptr); }

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Thu Nov  1 23:01:24 2018
(r340033)
+++ head/sys/kern/syscalls.master   Thu Nov  1 23:06:50 2018
(r340034)
@@ -113,7 +113,7 @@
int open(
_In_z_ char *path,
int flags,
-   int mode
+   mode_t mode
);
}
 ; XXX should be{ int open(const char *path, int flags, ...); }
@@ -170,7 +170,7 @@
 15 AUE_CHMOD   STD {
int chmod(
_In_z_ char *path,
-   int mode
+   mode_t mode
);
}
 16 AUE_CHOWN   STD {
@@ -433,7 +433,7 @@
}
 60 AUE_UMASK   STD {
int umask(
-   int newmask
+

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

2018-11-01 Thread Ed Maste
Author: emaste
Date: Thu Nov  1 23:01:24 2018
New Revision: 340033
URL: https://svnweb.freebsd.org/changeset/base/340033

Log:
  style: remove "All rights reserved" from comment
  
  imp removed it from the template in r91, so remove it from the
  example license header in style.9 as well.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Thu Nov  1 22:54:52 2018(r340032)
+++ head/share/man/man9/style.9 Thu Nov  1 23:01:24 2018(r340033)
@@ -26,7 +26,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2018
+.Dd November 1, 2018
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -68,7 +68,6 @@ line of the comment having a dash after the star like 
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
  * Copyright (c) 1984-2025 John Q. Public
- * All rights reserved.
  *
  * Long, boring license goes here, but trimmed for brevity
  */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340032 - head/contrib/smbfs/smbutil

2018-11-01 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Nov  1 22:54:52 2018
New Revision: 340032
URL: https://svnweb.freebsd.org/changeset/base/340032

Log:
  smbutil(1): Reference nsmb.conf(5) and mount_smbfs(8)
  
  Reviewed by:  bcr
  Approved by:krion (mentor, implicit), mat (mentor, implicit)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D17809

Modified:
  head/contrib/smbfs/smbutil/smbutil.1

Modified: head/contrib/smbfs/smbutil/smbutil.1
==
--- head/contrib/smbfs/smbutil/smbutil.1Thu Nov  1 22:50:50 2018
(r340031)
+++ head/contrib/smbfs/smbutil/smbutil.1Thu Nov  1 22:54:52 2018
(r340032)
@@ -1,5 +1,5 @@
 .\" $Id: smbutil.1,v 1.5 2002/04/16 02:48:16 bp Exp $
-.Dd February 14, 2000
+.Dd November 1, 2018
 .Dt SMBUTIL 1
 .Os
 .Sh NAME
@@ -127,6 +127,9 @@ See
 .Pa ./examples/dot.nsmbrc
 for details.
 .El
+.Sh SEE ALSO
+.Xr nsmb.conf 5 ,
+.Xr mount_smbfs 8
 .Sh AUTHORS
 .An Boris Popov Aq b...@butya.kz ,
 .Aq b...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340031 - head/contrib/smbfs/mount_smbfs

2018-11-01 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Nov  1 22:50:50 2018
New Revision: 340031
URL: https://svnweb.freebsd.org/changeset/base/340031

Log:
  mount_smbfs(8): Mention /etc/nsmb.conf, smbutil(1) and nsmb.conf(5)
  
  Reviewed by:  bcr
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D17808

Modified:
  head/contrib/smbfs/mount_smbfs/mount_smbfs.8

Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8
==
--- head/contrib/smbfs/mount_smbfs/mount_smbfs.8Thu Nov  1 22:23:15 
2018(r340030)
+++ head/contrib/smbfs/mount_smbfs/mount_smbfs.8Thu Nov  1 22:50:50 
2018(r340031)
@@ -136,12 +136,14 @@ are 137.
 Path to mount point.
 .El
 .Sh FILES
-.Bl -tag -width ".Pa ~/.nsmbrc" -compact
+.Bl -tag -width ".Pa /etc/nsmb.conf" -compact
 .It Pa ~/.nsmbrc
-Keeps static parameters for connections and other information.
+Keeps user-specific static parameters for connections and other information.
 See
 .Pa /usr/share/examples/smbfs/dot.nsmbrc
 for details.
+.It Pa /etc/nsmb.conf
+Keeps system-wide static parameters for connections and other information.
 .El
 .Sh EXAMPLES
 The following example illustrates how to connect to SMB server
@@ -163,7 +165,11 @@ for smbfs mounts (the example below does not prompt fo
 .Pp
 .Dl "//guest@samba/public/smb/public smbfs  rw,noauto,-N 0   0"
 .Sh SEE ALSO
-.Bl -dash
+.Xr smbutil 1 ,
+.Xr nsmb.conf 5
+.Pp
+Other resources:
+.Bl -dash -compact
 .It
 Chapter dedicated to Samba configuration in the
 .Fx
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340030 - in head/sys/riscv: include riscv

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 22:23:15 2018
New Revision: 340030
URL: https://svnweb.freebsd.org/changeset/base/340030

Log:
  Restrict setting PTE execute permissions on RISC-V.
  
  Previously, RISC-V was enabling execute permissions in PTEs for any
  readable page.  Now, execute permissions are only enabled if they were
  explicitly specified (e.g. via PROT_EXEC to mmap).  The one exception
  is that the initial kernel mapping in locore still maps all of the
  kernel RWX.
  
  While here, change the fault type passed to vm_fault and
  pmap_fault_fixup to only include a single VM_PROT_* value representing
  the faulting access to match other architectures rather than passing a
  bitmask.
  
  Reviewed by:  markj
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D17783

Modified:
  head/sys/riscv/include/pte.h
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/pmap.c
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/include/pte.h
==
--- head/sys/riscv/include/pte.hThu Nov  1 22:17:51 2018
(r340029)
+++ head/sys/riscv/include/pte.hThu Nov  1 22:23:15 2018
(r340030)
@@ -78,7 +78,7 @@ typedef   uint64_tpn_t;   /* page 
number */
 #definePTE_V   (1 << 0) /* Valid */
 #definePTE_RWX (PTE_R | PTE_W | PTE_X)
 #definePTE_RX  (PTE_R | PTE_X)
-#definePTE_KERN(PTE_V | PTE_RWX | PTE_A | PTE_D)
+#definePTE_KERN(PTE_V | PTE_R | PTE_W | PTE_A | PTE_D)
 
 #definePTE_PPN0_S  10
 #definePTE_PPN1_S  19

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Thu Nov  1 22:17:51 2018
(r340029)
+++ head/sys/riscv/riscv/locore.S   Thu Nov  1 22:23:15 2018
(r340030)
@@ -94,7 +94,7 @@ _start:
add t3, t4, t2
li  t5, 0
 2:
-   li  t0, (PTE_KERN)
+   li  t0, (PTE_KERN | PTE_X)
sllit2, t4, PTE_PPN1_S  /* << PTE_PPN1_S */
or  t5, t0, t2
sd  t5, (s1)/* Store PTE entry to position */

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Thu Nov  1 22:17:51 2018(r340029)
+++ head/sys/riscv/riscv/pmap.c Thu Nov  1 22:23:15 2018(r340030)
@@ -2010,7 +2010,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t
 }
 
 int
-pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
+pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype)
 {
pt_entry_t orig_l3;
pt_entry_t new_l3;
@@ -2027,12 +2027,13 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_
 
orig_l3 = pmap_load(l3);
if ((orig_l3 & PTE_V) == 0 ||
-   ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) ||
-   ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0))
+   (ftype == VM_PROT_WRITE && (orig_l3 & PTE_W) == 0) ||
+   (ftype == VM_PROT_EXECUTE && (orig_l3 & PTE_X) == 0) ||
+   (ftype == VM_PROT_READ && (orig_l3 & PTE_R) == 0))
goto done;
 
new_l3 = orig_l3 | PTE_A;
-   if ((prot & VM_PROT_WRITE) != 0)
+   if (ftype == VM_PROT_WRITE)
new_l3 |= PTE_D;
 
if (orig_l3 != new_l3) {
@@ -2088,7 +2089,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pa = VM_PAGE_TO_PHYS(m);
pn = (pa / PAGE_SIZE);
 
-   new_l3 = PTE_V | PTE_R | PTE_X | PTE_A;
+   new_l3 = PTE_V | PTE_R | PTE_A;
+   if (prot & VM_PROT_EXECUTE)
+   new_l3 |= PTE_X;
if (flags & VM_PROT_WRITE)
new_l3 |= PTE_D;
if (prot & VM_PROT_WRITE)
@@ -2464,7 +2467,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v
pa = VM_PAGE_TO_PHYS(m);
pn = (pa / PAGE_SIZE);
 
-   entry = (PTE_V | PTE_R | PTE_X);
+   entry = PTE_V | PTE_R;
+   if (prot & VM_PROT_EXECUTE)
+   entry |= PTE_X;
entry |= (pn << PTE_PPN0_S);
 
/*

Modified: head/sys/riscv/riscv/trap.c
==
--- head/sys/riscv/riscv/trap.c Thu Nov  1 22:17:51 2018(r340029)
+++ head/sys/riscv/riscv/trap.c Thu Nov  1 22:23:15 2018(r340030)
@@ -207,9 +207,11 @@ data_abort(struct trapframe *frame, int lower)
 
if ((frame->tf_scause == EXCP_FAULT_STORE) ||
(frame->tf_scause == EXCP_STORE_PAGE_FAULT)) {
-   ftype = (VM_PROT_READ | VM_PROT_WRITE);
+   ftype = VM_PROT_WRITE;
+   } else if (frame->tf_scause == EXCP_INST_PAGE_FAULT) {
+   ftype = VM_PROT_EXECUTE;
} else {
-   ftype = (VM_PROT_READ);
+   ftype = VM_PROT_READ;
  

svn commit: r340029 - head/sys/riscv/riscv

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 22:17:51 2018
New Revision: 340029
URL: https://svnweb.freebsd.org/changeset/base/340029

Log:
  Set PTE_A and PTE_D for user mappings in pmap_enter().
  
  This assumes that an access according to the prot in 'flags' triggered
  a fault and is going to be retried after the fault returns, so the two
  flags are set preemptively to avoid refaulting on the retry.
  
  While here, only bother setting PTE_D for kernel mappings in pmap_enter
  for writable mappings.
  
  Reviewed by:  markj
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D17782

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

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Thu Nov  1 22:15:25 2018(r340028)
+++ head/sys/riscv/riscv/pmap.c Thu Nov  1 22:17:51 2018(r340029)
@@ -2088,13 +2088,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pa = VM_PAGE_TO_PHYS(m);
pn = (pa / PAGE_SIZE);
 
-   new_l3 = PTE_V | PTE_R | PTE_X;
+   new_l3 = PTE_V | PTE_R | PTE_X | PTE_A;
+   if (flags & VM_PROT_WRITE)
+   new_l3 |= PTE_D;
if (prot & VM_PROT_WRITE)
new_l3 |= PTE_W;
if ((va >> 63) == 0)
new_l3 |= PTE_U;
-   else
-   new_l3 |= PTE_A | PTE_D;
+   else if (prot & VM_PROT_WRITE)
+   new_l3 |= PTE_D;
 
new_l3 |= (pn << PTE_PPN0_S);
if ((flags & PMAP_ENTER_WIRED) != 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340028 - head/sys/riscv/riscv

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 22:15:25 2018
New Revision: 340028
URL: https://svnweb.freebsd.org/changeset/base/340028

Log:
  SBI calls expect a pointer to a u_long rather than a pointer.
  
  This is just cosmetic.
  
  A weirder issue is that the SBI doc claims the hart mask pointer should
  be a physical address, not a virtual address.  However, the implementation
  in bbl seems to just dereference the address directly.
  
  Reviewed by:  markj
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D17781

Modified:
  head/sys/riscv/riscv/intr_machdep.c
  head/sys/riscv/riscv/mp_machdep.c

Modified: head/sys/riscv/riscv/intr_machdep.c
==
--- head/sys/riscv/riscv/intr_machdep.c Thu Nov  1 22:13:22 2018
(r340027)
+++ head/sys/riscv/riscv/intr_machdep.c Thu Nov  1 22:15:25 2018
(r340028)
@@ -202,7 +202,7 @@ riscv_unmask_ipi(void)
 static void
 ipi_send(struct pcpu *pc, int ipi)
 {
-   uintptr_t mask;
+   u_long mask;
 
CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi);
 
@@ -242,7 +242,7 @@ void
 ipi_selected(cpuset_t cpus, u_int ipi)
 {
struct pcpu *pc;
-   uintptr_t mask;
+   u_long mask;
 
CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi);
 

Modified: head/sys/riscv/riscv/mp_machdep.c
==
--- head/sys/riscv/riscv/mp_machdep.c   Thu Nov  1 22:13:22 2018
(r340027)
+++ head/sys/riscv/riscv/mp_machdep.c   Thu Nov  1 22:15:25 2018
(r340028)
@@ -181,7 +181,7 @@ riscv64_cpu_attach(device_t dev)
 static void
 release_aps(void *dummy __unused)
 {
-   uintptr_t mask;
+   u_long mask;
int cpu, i;
 
if (mp_ncpus == 1)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340026 - head/stand/libsa

2018-11-01 Thread Toomas Soome
Author: tsoome
Date: Thu Nov  1 22:13:18 2018
New Revision: 340026
URL: https://svnweb.freebsd.org/changeset/base/340026

Log:
  libsa: cstyle cleanup tftp.c
  
  No functinal changes intended.

Modified:
  head/stand/libsa/tftp.c

Modified: head/stand/libsa/tftp.c
==
--- head/stand/libsa/tftp.c Thu Nov  1 22:11:26 2018(r340025)
+++ head/stand/libsa/tftp.c Thu Nov  1 22:13:18 2018(r340026)
@@ -63,30 +63,29 @@ __FBSDID("$FreeBSD$");
 struct tftp_handle;
 struct tftprecv_extra;
 
-static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload,
-time_t tleft, void *recv_extra);
-static int tftp_open(const char *path, struct open_file *f);
-static int tftp_close(struct open_file *f);
-static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len);
-static int tftp_read(struct open_file *f, void *buf, size_t size, size_t 
*resid);
-static off_t   tftp_seek(struct open_file *f, off_t offset, int where);
-static int tftp_set_blksize(struct tftp_handle *h, const char *str);
-static int tftp_stat(struct open_file *f, struct stat *sb);
+static ssize_t recvtftp(struct iodesc *, void **, void **, time_t, void *);
+static int tftp_open(const char *, struct open_file *);
+static int tftp_close(struct open_file *);
+static int tftp_parse_oack(struct tftp_handle *, char *, size_t);
+static int tftp_read(struct open_file *, void *, size_t, size_t *);
+static off_t tftp_seek(struct open_file *, off_t, int);
+static int tftp_set_blksize(struct tftp_handle *, const char *);
+static int tftp_stat(struct open_file *, struct stat *);
 
 struct fs_ops tftp_fsops = {
-   "tftp",
-   tftp_open,
-   tftp_close,
-   tftp_read,
-   null_write,
-   tftp_seek,
-   tftp_stat,
-   null_readdir
+   .fs_name = "tftp",
+   .fo_open = tftp_open,
+   .fo_close = tftp_close,
+   .fo_read = tftp_read,
+   .fo_write = null_write,
+   .fo_seek = tftp_seek,
+   .fo_stat = tftp_stat,
+   .fo_readdir = null_readdir
 };
 
 extern struct in_addr servip;
 
-static int  tftpport = 2000;
+static int tftpport = 2000;
 static int is_open = 0;
 
 /*
@@ -94,21 +93,21 @@ static int  is_open = 0;
  * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and
  * IP header lengths).
  */
-#define TFTP_REQUESTED_BLKSIZE 1428
+#defineTFTP_REQUESTED_BLKSIZE 1428
 
 /*
  * Choose a blksize big enough so we can test with Ethernet
  * Jumbo frames in the future.
  */
-#define TFTP_MAX_BLKSIZE 9008
+#defineTFTP_MAX_BLKSIZE 9008
 
 struct tftp_handle {
struct iodesc  *iodesc;
-   int currblock;  /* contents of lastdata */
-   int islastblock;/* flag */
-   int validsize;
-   int off;
-   char   *path;   /* saved for re-requests */
+   int currblock;  /* contents of lastdata */
+   int islastblock;/* flag */
+   int validsize;
+   int off;
+   char*path;  /* saved for re-requests */
unsigned inttftp_blksize;
unsigned long   tftp_tsize;
void*pkt;
@@ -117,7 +116,7 @@ struct tftp_handle {
 
 struct tftprecv_extra {
struct tftp_handle  *tftp_handle;
-   unsigned short   rtype; /* Received type */
+   unsigned short  rtype;  /* Received type */
 };
 
 #defineTFTP_MAX_ERRCODE EOPTNEG
@@ -141,25 +140,25 @@ tftp_senderr(struct tftp_handle *h, u_short errcode, c
 {
struct {
u_char header[HEADER_SIZE];
-   struct tftphdr  t;
+   struct tftphdr t;
u_char space[63]; /* +1 from t */
} __packed __aligned(4) wbuf;
-   char   *wtail;
-   int len;
+   char *wtail;
+   int len;
 
len = strlen(msg);
if (len > sizeof(wbuf.space))
len = sizeof(wbuf.space);
 
-   wbuf.t.th_opcode = htons((u_short) ERROR);
-   wbuf.t.th_code   = htons(errcode);
+   wbuf.t.th_opcode = htons((u_short)ERROR);
+   wbuf.t.th_code = htons(errcode);
 
wtail = wbuf.t.th_msg;
bcopy(msg, wtail, len);
wtail[len] = '\0';
wtail += len + 1;
 
-   sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t);
+   sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t);
 }
 
 static void
@@ -169,14 +168,14 @@ tftp_sendack(struct tftp_handle *h, u_short block)
u_char header[HEADER_SIZE];
struct tftphdr  t;
} __packed __aligned(4) wbuf;
-   char   *wtail;
+   char *wtail;
 
-   wbuf.t.th_opcode = htons((u_short) ACK);
-   wtail = (char *) &wbuf.t.th_block;
+   wbuf.t.th_opcode = htons((u_short)ACK);
+   wtail = (char *)&wbuf.t.th_block;
wbuf.t.th_bl

svn commit: r340027 - head/sys/riscv/riscv

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 22:13:22 2018
New Revision: 340027
URL: https://svnweb.freebsd.org/changeset/base/340027

Log:
  Don't allow debuggers to modify SSTATUS, only to read it.
  
  Reviewed by:  markj
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D17771

Modified:
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Thu Nov  1 22:13:18 2018
(r340026)
+++ head/sys/riscv/riscv/machdep.c  Thu Nov  1 22:13:22 2018
(r340027)
@@ -178,7 +178,6 @@ set_regs(struct thread *td, struct reg *regs)
 
frame = td->td_frame;
frame->tf_sepc = regs->sepc;
-   frame->tf_sstatus = regs->sstatus;
frame->tf_ra = regs->ra;
frame->tf_sp = regs->sp;
frame->tf_gp = regs->gp;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340025 - head/sys/riscv/riscv

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 22:11:26 2018
New Revision: 340025
URL: https://svnweb.freebsd.org/changeset/base/340025

Log:
  Implement ptrace_set_pc() and fail PT_*STEP requests explicitly.
  
  Reviewed by:  markj
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D17769

Modified:
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Thu Nov  1 21:51:41 2018
(r340024)
+++ head/sys/riscv/riscv/machdep.c  Thu Nov  1 22:11:26 2018
(r340025)
@@ -254,7 +254,7 @@ int
 ptrace_set_pc(struct thread *td, u_long addr)
 {
 
-   panic("ptrace_set_pc");
+   td->td_frame->tf_sepc = addr;
return (0);
 }
 
@@ -263,7 +263,7 @@ ptrace_single_step(struct thread *td)
 {
 
/* TODO; */
-   return (0);
+   return (EOPNOTSUPP);
 }
 
 int
@@ -271,7 +271,7 @@ ptrace_clear_single_step(struct thread *td)
 {
 
/* TODO; */
-   return (0);
+   return (EOPNOTSUPP);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340024 - in head/sys/cam: . scsi

2018-11-01 Thread Warner Losh
Author: imp
Date: Thu Nov  1 21:51:41 2018
New Revision: 340024
URL: https://svnweb.freebsd.org/changeset/base/340024

Log:
  Add comments explaining what hold/unhold do
  
  They act as a simple one-deep semaphore to keep open/close/probe from
  running at the same time to avoid races that creates.

Modified:
  head/sys/cam/cam_periph.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Thu Nov  1 21:49:49 2018(r340023)
+++ head/sys/cam/cam_periph.c   Thu Nov  1 21:51:41 2018(r340024)
@@ -470,6 +470,12 @@ cam_periph_release(struct cam_periph *periph)
mtx_unlock(mtx);
 }
 
+/*
+ * hold/unhold act as mutual exclusion for sections of the code that
+ * need to sleep and want to make sure that other sections that
+ * will interfere are held off. This only protects exclusive sections
+ * from each other.
+ */
 int
 cam_periph_hold(struct cam_periph *periph, int priority)
 {

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Nov  1 21:49:49 2018(r340023)
+++ head/sys/cam/scsi/scsi_da.c Thu Nov  1 21:51:41 2018(r340024)
@@ -2697,9 +2697,10 @@ daregister(struct cam_periph *periph, void *arg)
TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph);
 
/*
-* Take an exclusive refcount on the periph while dastart is called
-* to finish the probe.  The reference will be dropped in dadone at
-* the end of probe.
+* Take an exclusive section lock qon the periph while dastart is called
+* to finish the probe.  The lock will be dropped in dadone at the end
+* of probe. This locks out daopen and daclose from racing with the
+* probe.
 *
 * XXX if cam_periph_hold returns an error, we don't hold a refcount.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340023 - head/sys/dev/cxgbe

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 21:49:49 2018
New Revision: 340023
URL: https://svnweb.freebsd.org/changeset/base/340023

Log:
  Check cannot_use_txpkts() rather than needs_tso() in add_to_txpkts().
  
  Currently this is a no-op, but will matter in the future when
  cannot_use_txpkts() starts checking other conditions than just
  needs_tso().
  
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Thu Nov  1 21:46:37 2018(r340022)
+++ head/sys/dev/cxgbe/t4_sge.c Thu Nov  1 21:49:49 2018(r340023)
@@ -4725,8 +4725,11 @@ add_to_txpkts(struct mbuf *m, struct txpkts *txp, u_in
 
MPASS(txp->wr_type == 0 || txp->wr_type == 1);
 
+   if (cannot_use_txpkts(m))
+   return (1);
+
nsegs = mbuf_nsegs(m);
-   if (needs_tso(m) || (txp->wr_type == 1 && nsegs != 1))
+   if (txp->wr_type == 1 && nsegs != 1)
return (1);
 
plen = txp->plen + m->m_pkthdr.len;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340022 - head/sys/dev/cxgbe

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 21:46:37 2018
New Revision: 340022
URL: https://svnweb.freebsd.org/changeset/base/340022

Log:
  Add support for port unit wiring to cxgbe(4).
  
  - Add a bus_child_location_str method to the nexus drivers that prints
out 'port=N' as the location string exported via devinfo and the
'%location' sysctl node.
  
  - We can't use a bus_hint_device_unit to wire the unit numbers of
devices with a fixed devclass as the device gets assigned a unit in
make_device() before the device creator can set softc, etc.
Instead, when adding a child device, use a helper function much like
a bus_hint_device_unit method to look for wiring hints or to return
-1 to let the system choose a unit number.  This function requires
an "at" hint for the port pointing to the nexus device and a "port"
hint listing the port number.  For example:
  
  hint.cxl.4.at="t5nex0"
  hint.cxl.4.port="0"
  
wires cxl4 to the first port on the t5nex0 adapter.
  
  Requested by: gallatin
  MFC after:2 months

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Nov  1 21:39:33 2018
(r340021)
+++ head/sys/dev/cxgbe/t4_main.cThu Nov  1 21:46:37 2018
(r340022)
@@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$");
 static int t4_probe(device_t);
 static int t4_attach(device_t);
 static int t4_detach(device_t);
+static int t4_child_location_str(device_t, device_t, char *, size_t);
 static int t4_ready(device_t);
 static int t4_read_port_device(device_t, int, device_t *);
 static device_method_t t4_methods[] = {
@@ -99,6 +100,8 @@ static device_method_t t4_methods[] = {
DEVMETHOD(device_attach,t4_attach),
DEVMETHOD(device_detach,t4_detach),
 
+   DEVMETHOD(bus_child_location_str, t4_child_location_str),
+
DEVMETHOD(t4_is_main_ready, t4_ready),
DEVMETHOD(t4_read_port_device,  t4_read_port_device),
 
@@ -158,6 +161,8 @@ static device_method_t t5_methods[] = {
DEVMETHOD(device_attach,t4_attach),
DEVMETHOD(device_detach,t4_detach),
 
+   DEVMETHOD(bus_child_location_str, t4_child_location_str),
+
DEVMETHOD(t4_is_main_ready, t4_ready),
DEVMETHOD(t4_read_port_device,  t4_read_port_device),
 
@@ -191,6 +196,8 @@ static device_method_t t6_methods[] = {
DEVMETHOD(device_attach,t4_attach),
DEVMETHOD(device_detach,t4_detach),
 
+   DEVMETHOD(bus_child_location_str, t4_child_location_str),
+
DEVMETHOD(t4_is_main_ready, t4_ready),
DEVMETHOD(t4_read_port_device,  t4_read_port_device),
 
@@ -837,6 +844,24 @@ t4_init_devnames(struct adapter *sc)
 }
 
 static int
+t4_ifnet_unit(struct adapter *sc, struct port_info *pi)
+{
+   const char *parent, *name;
+   long value;
+   int line, unit;
+
+   line = 0;
+   parent = device_get_nameunit(sc->dev);
+   name = sc->names->ifnet_name;
+   while (resource_find_dev(&line, name, &unit, "at", parent) == 0) {
+   if (resource_long_value(name, unit, "port", &value) == 0 &&
+   value == pi->port_id)
+   return (unit);
+   }
+   return (-1);
+}
+
+static int
 t4_attach(device_t dev)
 {
struct adapter *sc;
@@ -1037,7 +1062,8 @@ t4_attach(device_t dev)
pi->flags |= FIXED_IFMEDIA;
PORT_UNLOCK(pi);
 
-   pi->dev = device_add_child(dev, sc->names->ifnet_name, -1);
+   pi->dev = device_add_child(dev, sc->names->ifnet_name,
+   t4_ifnet_unit(sc, pi));
if (pi->dev == NULL) {
device_printf(dev,
"failed to add device for port %d.\n", i);
@@ -1250,6 +1276,16 @@ done:
t4_sysctls(sc);
 
return (rc);
+}
+
+static int
+t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen)
+{
+   struct port_info *pi;
+
+   pi = device_get_softc(dev);
+   snprintf(buf, buflen, "port=%d", pi->port_id);
+   return (0);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340021 - head/sys/dev/cxgbe

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 21:39:33 2018
New Revision: 340021
URL: https://svnweb.freebsd.org/changeset/base/340021

Log:
  Assert that reclaim_tx_descs() is always making forward progress.
  
  MFC after:2 months
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Thu Nov  1 21:34:17 2018(r340020)
+++ head/sys/dev/cxgbe/t4_sge.c Thu Nov  1 21:39:33 2018(r340021)
@@ -5079,6 +5079,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n)
KASSERT(can_reclaim >= ndesc,
("%s: unexpected number of credits: %d, %d",
__func__, can_reclaim, ndesc));
+   KASSERT(ndesc != 0,
+   ("%s: descriptor with no credits: cidx %d",
+   __func__, eq->cidx));
 
for (m = txsd->m; m != NULL; m = nextpkt) {
nextpkt = m->m_nextpkt;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340020 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc sys

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 21:34:17 2018
New Revision: 340020
URL: https://svnweb.freebsd.org/changeset/base/340020

Log:
  Don't enter DDB for fatal traps before panic by default.
  
  Add a new 'debugger_on_trap' knob separate from 'debugger_on_panic'
  and make the calls to kdb_trap() in MD fatal trap handlers prior to
  calling panic() conditional on this new knob instead of
  'debugger_on_panic'.  Disable the new knob by default.  Developers who
  wish to recover from a fatal fault by adjusting saved register state
  and retrying the faulting instruction can still do so by enabling the
  new knob.  However, for the more common case this makes the user
  experience for panics due to a fatal fault match the user experience
  for other panics, e.g. 'c' in DDB will generate a crash dump and
  reboot the system rather than being stuck in an infinite loop of fatal
  fault messages and DDB prompts.
  
  Reviewed by:  kib, avg
  MFC after:2 months
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D17768

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/arm/arm/trap-v4.c
  head/sys/arm/arm/trap-v6.c
  head/sys/arm64/arm64/trap.c
  head/sys/i386/i386/trap.c
  head/sys/kern/kern_shutdown.c
  head/sys/mips/mips/trap.c
  head/sys/powerpc/powerpc/trap.c
  head/sys/sys/kdb.h

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Thu Nov  1 21:28:22 2018(r340019)
+++ head/sys/amd64/amd64/trap.c Thu Nov  1 21:34:17 2018(r340020)
@@ -916,7 +916,7 @@ trap_fatal(frame, eva)
curproc->p_pid, curthread->td_name);
 
 #ifdef KDB
-   if (debugger_on_panic) {
+   if (debugger_on_trap) {
kdb_why = KDB_WHY_TRAP;
handled = kdb_trap(type, 0, frame);
kdb_why = KDB_WHY_UNSET;

Modified: head/sys/arm/arm/trap-v4.c
==
--- head/sys/arm/arm/trap-v4.c  Thu Nov  1 21:28:22 2018(r340019)
+++ head/sys/arm/arm/trap-v4.c  Thu Nov  1 21:34:17 2018(r340020)
@@ -456,7 +456,7 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, 
printf(", pc =%08x\n\n", tf->tf_pc);
 
 #ifdef KDB
-   if (debugger_on_panic) {
+   if (debugger_on_trap) {
kdb_why = KDB_WHY_TRAP;
handled = kdb_trap(fsr, 0, tf);
kdb_why = KDB_WHY_UNSET;

Modified: head/sys/arm/arm/trap-v6.c
==
--- head/sys/arm/arm/trap-v6.c  Thu Nov  1 21:28:22 2018(r340019)
+++ head/sys/arm/arm/trap-v6.c  Thu Nov  1 21:34:17 2018(r340020)
@@ -599,7 +599,7 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr
printf(", pc =%08x\n\n", tf->tf_pc);
 
 #ifdef KDB
-   if (debugger_on_panic) {
+   if (debugger_on_trap) {
kdb_why = KDB_WHY_TRAP;
kdb_trap(fsr, 0, tf);
kdb_why = KDB_WHY_UNSET;

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Thu Nov  1 21:28:22 2018(r340019)
+++ head/sys/arm64/arm64/trap.c Thu Nov  1 21:34:17 2018(r340020)
@@ -256,7 +256,7 @@ no_pmap_fault:
printf(" esr: %.8lx\n", esr);
 
 #ifdef KDB
-   if (debugger_on_panic) {
+   if (debugger_on_trap) {
kdb_why = KDB_WHY_TRAP;
handled = kdb_trap(ESR_ELx_EXCEPTION(esr), 0,
frame);

Modified: head/sys/i386/i386/trap.c
==
--- head/sys/i386/i386/trap.c   Thu Nov  1 21:28:22 2018(r340019)
+++ head/sys/i386/i386/trap.c   Thu Nov  1 21:34:17 2018(r340020)
@@ -977,7 +977,7 @@ trap_fatal(frame, eva)
curproc->p_pid, curthread->td_name);
 
 #ifdef KDB
-   if (debugger_on_panic) {
+   if (debugger_on_trap) {
kdb_why = KDB_WHY_TRAP;
frame->tf_err = eva;/* smuggle fault address to ddb */
handled = kdb_trap(type, 0, frame);

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Thu Nov  1 21:28:22 2018
(r340019)
+++ head/sys/kern/kern_shutdown.c   Thu Nov  1 21:34:17 2018
(r340020)
@@ -115,13 +115,18 @@ SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CT
 
 #ifdef KDB
 #ifdef KDB_UNATTENDED
-int debugger_on_panic = 0;
+static int debugger_on_panic = 0;
 #else
-int debugger_on_panic = 1;
+static int debugger_on_panic = 1;
 #endif
 SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic,
 CTLFLAG_RWTUN | CTLFLAG_SECURE,
 &debugger_on_panic, 0, "

svn commit: r340018 - head/tools/tools/crypto

2018-11-01 Thread John Baldwin
Author: jhb
Date: Thu Nov  1 21:25:26 2018
New Revision: 340018
URL: https://svnweb.freebsd.org/changeset/base/340018

Log:
  Compile cryptocheck with in-tree openssl again.
  
  Reviewed by:  cem
  MFC after:2 months
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D17767

Modified:
  head/tools/tools/crypto/Makefile

Modified: head/tools/tools/crypto/Makefile
==
--- head/tools/tools/crypto/MakefileThu Nov  1 20:42:54 2018
(r340017)
+++ head/tools/tools/crypto/MakefileThu Nov  1 21:25:26 2018
(r340018)
@@ -32,10 +32,7 @@ MAN=
 BINDIR?=   /usr/local/bin
 
 # cryptocheck: test symmetric crypto functions
-# Use openssl from ports for Blake2 algorithms
-CFLAGS.cryptocheck.c+= $$(pkg-config --cflags openssl)
-LDFLAGS.cryptocheck+=  $$(pkg-config --libs openssl)
-LIBADD.cryptocheck+=   util
+LIBADD.cryptocheck+=   crypto util
 
 # cryptokeytest: test asymmetric crypto functions
 LIBADD.cryptokeytest+= crypto
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Devin Teske


> On Nov 1, 2018, at 11:33 AM, Oliver Pinter  
> wrote:
> 
> 
> 
> On Wednesday, October 31, 2018, Devin Teske  > wrote:
> Author: dteske
> Date: Wed Oct 31 20:37:12 2018
> New Revision: 339971
> URL: https://svnweb.freebsd.org/changeset/base/339971 
> 
> 
> Log:
>   Add new rc keywords: enable, disable, delete
> 
>   This adds new keywords to rc/service to enable/disable a service's
>   rc.conf(5) variable and "delete" to remove the variable.
> 
>   When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>   (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>   deleted if empty after modification using "service $foo delete".
> 
>   Submitted by: lme (modified)
>   Reviewed by:  0mp (previous version), lme, bcr
>   Relnotes: yes
>   Sponsored by: Smule, Inc.
>   Differential Revision:https://reviews.freebsd.org/D17113 
> 
> 
> 
> Hi!
> 
> Really nice. Do you plan to MFC this commit to stable branches?
> 

It will be eligible for MFC on Nov 3. I'll submit the request, but it's up to 
re@
--
Devin


signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r339898 - head/lib/libc/amd64/sys

2018-11-01 Thread Charlie Li
On 01/11/2018 12:04, Brooks Davis wrote:
> Is this failure with devel/llvm70?  It's currently missing the patch
> required to make this work.  https://reviews.freebsd.org/D17709 contains
> this patch among others.  I'll see about getting it applied.
> 
Yes, devel/llvm70. Will build with your port commit at my next opportunity.

-- 
Charlie Li
Can't think of a witty .sigline today…

(This email address is for mailing list use only; replace local-part
with vishwin for off-list communication)



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Oliver Pinter
On Wednesday, October 31, 2018, Devin Teske  wrote:

> Author: dteske
> Date: Wed Oct 31 20:37:12 2018
> New Revision: 339971
> URL: https://svnweb.freebsd.org/changeset/base/339971
>
> Log:
>   Add new rc keywords: enable, disable, delete
>
>   This adds new keywords to rc/service to enable/disable a service's
>   rc.conf(5) variable and "delete" to remove the variable.
>
>   When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>   (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>   deleted if empty after modification using "service $foo delete".
>
>   Submitted by: lme (modified)
>   Reviewed by:  0mp (previous version), lme, bcr
>   Relnotes: yes
>   Sponsored by: Smule, Inc.
>   Differential Revision:https://reviews.freebsd.org/D17113



Hi!

Really nice. Do you plan to MFC this commit to stable branches?


>
> Modified:
>   head/libexec/rc/rc.conf
>   head/libexec/rc/rc.subr
>   head/share/man/man5/rc.conf.5
>   head/share/man/man8/rc.8
>
> Modified: head/libexec/rc/rc.conf
> 
> ==
> --- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018(r339970)
> +++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018(r339971)
> @@ -617,6 +617,7 @@ savecore_enable="YES"   # Extract core from dump
> devices
>  savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
> # By default, only the 10 most recent kernel dumps
> # are saved.
> +service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d
> files.
>  crashinfo_enable="YES" # Automatically generate crash dump summary.
>  crashinfo_program="/usr/sbin/crashinfo"# Script to generate
> crash dump summary.
>  quota_enable="NO"  # turn on quotas on startup (or NO).
>
> Modified: head/libexec/rc/rc.subr
> 
> ==
> --- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018(r339970)
> +++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018(r339971)
> @@ -922,7 +922,7 @@ run_rc_command()
> eval _override_command=\$${name}_program
> command=${_override_command:-$command}
>
> -   _keywords="start stop restart rcvar enabled describe extracommands
> $extra_commands"
> +   _keywords="start stop restart rcvar enable disable delete enabled
> describe extracommands $extra_commands"
> rc_pid=
> _pidcmd=
> _procname=${procname:-${command}}
> @@ -977,12 +977,13 @@ run_rc_command()
> if [ "$_elem" != "$rc_arg" ]; then
> continue
> fi
> -   # if ${rcvar} is set, $1 is not
> "rcvar" and not "describe"
> -   # and ${rc_pid} is not set, then
> run
> +   # if ${rcvar} is set, $1 is not
> "rcvar", "describe",
> +   # "enable" or "delete", and
> ${rc_pid} is not set, run:
> #   checkyesno ${rcvar}
> # and return if that failed
> #
> if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" !=
> "stop" \
> +   -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \
> -a "$rc_arg" != "describe" ] ||
> [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z
> "${rc_pid}" ]; then
> if ! checkyesno ${rcvar}; then
> @@ -1028,6 +1029,31 @@ run_rc_command()
>
> extracommands)
> echo "$extra_commands"
> +   ;;
> +
> +   enable)
> +   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") &&
> +   echo "$name enabled in ${_out%%:*}"
> +   ;;
> +
> +   disable)
> +   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") &&
> +   echo "$name disabled in ${_out%%:*}"
> +   ;;
> +
> +   delete)
> +   _files=
> +   for _file in $(sysrc -lEs "$name"); do
> +   _out=$(sysrc -Fif $_file "$rcvar") &&
> _files="$_files $_file"
> +   done
> +   /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar
> deleted in ${_files# }"
> +   # delete file in rc.conf.d if desired and
> empty.
> +   checkyesno service_delete_empty || _files=
> +   for _file in $_files; do
> +   [ "$_file" = "${_file#*/rc.conf.d/}" ] &&
> continue
> +   [ $(/usr/bin/stat -f%z $_file) -gt 0 ] &&
> continue
> +   /bin/rm "

svn commit: r340015 - head/usr.sbin/nscd

2018-11-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Nov  1 18:19:10 2018
New Revision: 340015
URL: https://svnweb.freebsd.org/changeset/base/340015

Log:
  Unbreak nscd(8).  Without this change the CMSG gets truncated.
  
  Reviewed by:  des
  MFC after:2 weeks
  Sponsored by: Chalmers University of Technology
  Differential Revision:https://reviews.freebsd.org/D17452

Modified:
  head/usr.sbin/nscd/nscdcli.c
  head/usr.sbin/nscd/query.c

Modified: head/usr.sbin/nscd/nscdcli.c
==
--- head/usr.sbin/nscd/nscdcli.cThu Nov  1 17:45:29 2018
(r340014)
+++ head/usr.sbin/nscd/nscdcli.cThu Nov  1 18:19:10 2018
(r340015)
@@ -138,14 +138,14 @@ send_credentials(struct nscd_connection_ *connection, 
struct msghdr   cred_hdr;
struct ioveciov;
 
-   struct {
+   union {
struct cmsghdr  hdr;
-   struct cmsgcred creds;
+   char cred[CMSG_SPACE(sizeof(struct cmsgcred))];
} cmsg;
 
TRACE_IN(send_credentials);
memset(&cmsg, 0, sizeof(cmsg));
-   cmsg.hdr.cmsg_len = sizeof(cmsg);
+   cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred));
cmsg.hdr.cmsg_level = SOL_SOCKET;
cmsg.hdr.cmsg_type = SCM_CREDS;
 
@@ -153,7 +153,7 @@ send_credentials(struct nscd_connection_ *connection, 
cred_hdr.msg_iov = &iov;
cred_hdr.msg_iovlen = 1;
cred_hdr.msg_control = &cmsg;
-   cred_hdr.msg_controllen = sizeof(cmsg);
+   cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred));
 
iov.iov_base = &type;
iov.iov_len = sizeof(int);

Modified: head/usr.sbin/nscd/query.c
==
--- head/usr.sbin/nscd/query.c  Thu Nov  1 17:45:29 2018(r340014)
+++ head/usr.sbin/nscd/query.c  Thu Nov  1 18:19:10 2018(r340015)
@@ -160,7 +160,7 @@ on_query_startup(struct query_state *qstate)
struct cmsgcred *cred;
int elem_type;
 
-   struct {
+   union {
struct cmsghdr  hdr;
char cred[CMSG_SPACE(sizeof(struct cmsgcred))];
} cmsg;
@@ -171,8 +171,8 @@ on_query_startup(struct query_state *qstate)
memset(&cred_hdr, 0, sizeof(struct msghdr));
cred_hdr.msg_iov = &iov;
cred_hdr.msg_iovlen = 1;
-   cred_hdr.msg_control = (caddr_t)&cmsg;
-   cred_hdr.msg_controllen = CMSG_LEN(sizeof(struct cmsgcred));
+   cred_hdr.msg_control = &cmsg;
+   cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred));
 
memset(&iov, 0, sizeof(struct iovec));
iov.iov_base = &elem_type;
@@ -183,7 +183,8 @@ on_query_startup(struct query_state *qstate)
return (-1);
}
 
-   if (cmsg.hdr.cmsg_len < CMSG_LEN(sizeof(struct cmsgcred))
+   if (cred_hdr.msg_controllen < CMSG_LEN(sizeof(struct cmsgcred))
+   || cmsg.hdr.cmsg_len < CMSG_LEN(sizeof(struct cmsgcred))
|| cmsg.hdr.cmsg_level != SOL_SOCKET
|| cmsg.hdr.cmsg_type != SCM_CREDS) {
TRACE_OUT(on_query_startup);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340014 - head/bin/getfacl

2018-11-01 Thread Mark Johnston
Author: markj
Date: Thu Nov  1 17:45:29 2018
New Revision: 340014
URL: https://svnweb.freebsd.org/changeset/base/340014

Log:
  Avoid copying a struct stat for acl_from_stat() calls.
  
  CID:  1375584
  MFC after:2 weeks

Modified:
  head/bin/getfacl/getfacl.c

Modified: head/bin/getfacl/getfacl.c
==
--- head/bin/getfacl/getfacl.c  Thu Nov  1 17:43:28 2018(r340013)
+++ head/bin/getfacl/getfacl.c  Thu Nov  1 17:45:29 2018(r340014)
@@ -88,7 +88,7 @@ getgname(gid_t gid)
  * contained in struct stat
  */
 static acl_t
-acl_from_stat(struct stat sb)
+acl_from_stat(const struct stat *sb)
 {
acl_t acl;
acl_entry_t entry;
@@ -111,13 +111,13 @@ acl_from_stat(struct stat sb)
return NULL;
 
/* calculate user mode */
-   if (sb.st_mode & S_IRUSR)
+   if (sb->st_mode & S_IRUSR)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
-   if (sb.st_mode & S_IWUSR)
+   if (sb->st_mode & S_IWUSR)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
-   if (sb.st_mode & S_IXUSR)
+   if (sb->st_mode & S_IXUSR)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -135,13 +135,13 @@ acl_from_stat(struct stat sb)
return NULL;
 
/* calculate group mode */
-   if (sb.st_mode & S_IRGRP)
+   if (sb->st_mode & S_IRGRP)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
-   if (sb.st_mode & S_IWGRP)
+   if (sb->st_mode & S_IWGRP)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
-   if (sb.st_mode & S_IXGRP)
+   if (sb->st_mode & S_IXGRP)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -159,13 +159,13 @@ acl_from_stat(struct stat sb)
return NULL;
 
/* calculate other mode */
-   if (sb.st_mode & S_IROTH)
+   if (sb->st_mode & S_IROTH)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
-   if (sb.st_mode & S_IWOTH)
+   if (sb->st_mode & S_IWOTH)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
-   if (sb.st_mode & S_IXOTH)
+   if (sb->st_mode & S_IXOTH)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -229,7 +229,7 @@ print_acl(char *path, acl_type_t type, int hflag, int 
errno = 0;
if (type == ACL_TYPE_DEFAULT)
return(0);
-   acl = acl_from_stat(sb);
+   acl = acl_from_stat(&sb);
if (!acl) {
warn("%s: acl_from_stat() failed", path);
return(-1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340013 - in head/sys/arm64: arm64 include

2018-11-01 Thread Andrew Turner
Author: andrew
Date: Thu Nov  1 17:43:28 2018
New Revision: 340013
URL: https://svnweb.freebsd.org/changeset/base/340013

Log:
  Add the ARMv8.3 SCTLR_EL1 fields.
  
  While here tag which architecture release fields were added and remove a
  field that only existed in very early releases of the ARMv8 spec.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/locore.S
  head/sys/arm64/include/armreg.h

Modified: head/sys/arm64/arm64/locore.S
==
--- head/sys/arm64/arm64/locore.S   Thu Nov  1 17:37:20 2018
(r340012)
+++ head/sys/arm64/arm64/locore.S   Thu Nov  1 17:43:28 2018
(r340013)
@@ -633,7 +633,7 @@ sctlr_set:
 sctlr_clear:
/* Bits to clear */
.quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \
-   SCTLR_ITD | SCTLR_THEE | SCTLR_A)
+   SCTLR_ITD | SCTLR_A)
 
.globl abort
 abort:

Modified: head/sys/arm64/include/armreg.h
==
--- head/sys/arm64/include/armreg.h Thu Nov  1 17:37:20 2018
(r340012)
+++ head/sys/arm64/include/armreg.h Thu Nov  1 17:43:28 2018
(r340013)
@@ -525,7 +525,7 @@
 #definePAR_S_MASK  (0x1 << PAR_S_SHIFT)
 
 /* SCTLR_EL1 - System Control Register */
-#defineSCTLR_RES0  0xc8222400  /* Reserved ARMv8.0, write 0 */
+#defineSCTLR_RES0  0xc8222440  /* Reserved ARMv8.0, write 0 */
 #defineSCTLR_RES1  0x30d00800  /* Reserved ARMv8.0, write 1 */
 
 #defineSCTLR_M 0x0001
@@ -534,23 +534,32 @@
 #defineSCTLR_SA0x0008
 #defineSCTLR_SA0   0x0010
 #defineSCTLR_CP15BEN   0x0020
-#defineSCTLR_THEE  0x0040
+/* Bit 6 is reserved */
 #defineSCTLR_ITD   0x0080
 #defineSCTLR_SED   0x0100
 #defineSCTLR_UMA   0x0200
+/* Bit 10 is reserved */
+/* Bit 11 is reserved */
 #defineSCTLR_I 0x1000
+#defineSCTLR_EnDB  0x2000 /* ARMv8.3 */
 #defineSCTLR_DZE   0x4000
 #defineSCTLR_UCT   0x8000
 #defineSCTLR_nTWI  0x0001
+/* Bit 17 is reserved */
 #defineSCTLR_nTWE  0x0004
 #defineSCTLR_WXN   0x0008
-#defineSCTLR_IESB  0x0020
-#defineSCTLR_SPAN  0x0080
+/* Bit 20 is reserved */
+#defineSCTLR_IESB  0x0020 /* ARMv8.2 */
+/* Bit 22 is reserved */
+#defineSCTLR_SPAN  0x0080 /* ARMv8.1 */
 #defineSCTLR_EOE   0x0100
 #defineSCTLR_EE0x0200
 #defineSCTLR_UCI   0x0400
-#defineSCTLR_nTLSMD0x1000
-#defineSCTLR_LSMAOE0x2000
+#defineSCTLR_EnDA  0x0800 /* ARMv8.3 */
+#defineSCTLR_nTLSMD0x1000 /* ARMv8.2 */
+#defineSCTLR_LSMAOE0x2000 /* ARMv8.2 */
+#defineSCTLR_EnIB  0x4000 /* ARMv8.3 */
+#defineSCTLR_EnIA  0x8000 /* ARMv8.3 */
 
 /* SPSR_EL1 */
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340010 - head/sys/dev/ixl

2018-11-01 Thread Eric Joyner
Author: erj
Date: Thu Nov  1 17:29:14 2018
New Revision: 340010
URL: https://svnweb.freebsd.org/changeset/base/340010

Log:
  ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"
  
  This should fix a build issue when "options RSS" is set.
  
  Reported by:  bz@
  Sponsored by: Intel Corporation

Modified:
  head/sys/dev/ixl/iavf_vc.c
  head/sys/dev/ixl/if_iavf.c

Modified: head/sys/dev/ixl/iavf_vc.c
==
--- head/sys/dev/ixl/iavf_vc.c  Thu Nov  1 17:26:18 2018(r340009)
+++ head/sys/dev/ixl/iavf_vc.c  Thu Nov  1 17:29:14 2018(r340010)
@@ -720,10 +720,6 @@ iavf_update_stats_counters(struct iavf_sc *sc, struct 
uint64_t tx_discards;
 
tx_discards = es->tx_discards;
-#if 0
-   for (int i = 0; i < vsi->num_queues; i++)
-   tx_discards += sc->vsi.queues[i].txr.br->br_drops;
-#endif
 
/* Update ifnet stats */
IXL_SET_IPACKETS(vsi, es->rx_unicast +
@@ -826,7 +822,7 @@ iavf_config_rss_lut(struct iavf_sc *sc)
/*
 * Fetch the RSS bucket id for the given indirection entry.
 * Cap it at the number of configured buckets (which is
-* num_queues.)
+* num_rx_queues.)
 */
que_id = rss_get_indirection_to_bucket(i);
que_id = que_id % sc->vsi.num_rx_queues;

Modified: head/sys/dev/ixl/if_iavf.c
==
--- head/sys/dev/ixl/if_iavf.c  Thu Nov  1 17:26:18 2018(r340009)
+++ head/sys/dev/ixl/if_iavf.c  Thu Nov  1 17:29:14 2018(r340010)
@@ -1946,10 +1946,10 @@ iavf_config_rss_reg(struct iavf_sc *sc)
/*
 * Fetch the RSS bucket id for the given indirection entry.
 * Cap it at the number of configured buckets (which is
-* num_queues.)
+* num_rx_queues.)
 */
que_id = rss_get_indirection_to_bucket(i);
-   que_id = que_id % vsi->num_queues;
+   que_id = que_id % vsi->num_rx_queues;
 #else
que_id = j;
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340009 - head/sys/netinet

2018-11-01 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Nov  1 17:26:18 2018
New Revision: 340009
URL: https://svnweb.freebsd.org/changeset/base/340009

Log:
  carpstats are the last virtualised variable in the file and end up at the
  end of the vnet_set.  The generated code uses an absolute relocation at
  one byte beyond the end of the carpstats array.  This means the relocation
  for the vnet does not happen for carpstats initialisation and as a result
  the kernel panics on module load.
  
  This problem has only been observed with carp and only on i386.
  We considered various possible solutions including using linker scripts
  to add padding to all kernel modules for pcpu and vnet sections.
  
  While the symbols (by chance) stay in the order of appearance in the file
  adding an unused non-file-local variable at the end of the file will extend
  the size of set_vnet and hence make the absolute relocation for carpstats
  work (think of this as a single-module set_vnet padding).
  
  This is a (tmporary) hack.  It is the least intrusive one as we need a
  timely solution for the upcoming release.  We will revisit the problem in
  HEAD.  For a lot more information and the possible alternate solutions
  please see the PR and the references therein.
  
  PR:   230857
  MFC after:3 days

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==
--- head/sys/netinet/ip_carp.c  Thu Nov  1 17:05:10 2018(r340008)
+++ head/sys/netinet/ip_carp.c  Thu Nov  1 17:26:18 2018(r340009)
@@ -2176,6 +2176,21 @@ static struct protosw in6_carp_protosw = {
 };
 #endif
 
+#ifdef VIMAGE
+#if defined(__i386__)
+/*
+ * XXX This is a hack to work around an absolute relocation outside
+ * set_vnet by one (on the stop symbol) for carpstats.  Add a dummy variable
+ * to the end of the file in the hope that the linker will just keep the
+ * order (as it seems to do at the moment).  It is understood to be fragile.
+ * See PR 230857 for a longer discussion of the problem and the referenced
+ * review for possible alternate solutions.  Each is a hack; we just need
+ * the least intrusive one for the next release.
+ */
+VNET_DEFINE(char, carp_zzz) = 0xde;
+#endif
+#endif
+
 static void
 carp_mod_cleanup(void)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-11-01 Thread Andrew Turner
Author: andrew
Date: Thu Nov  1 17:05:10 2018
New Revision: 340008
URL: https://svnweb.freebsd.org/changeset/base/340008

Log:
  Add the ARMv8.3 HCR_EL2 register fields.
  
  MFC after:1 month
  Sponsored by: DARPA, AFRL

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

Modified: head/sys/arm64/include/hypervisor.h
==
--- head/sys/arm64/include/hypervisor.h Thu Nov  1 16:50:19 2018
(r340007)
+++ head/sys/arm64/include/hypervisor.h Thu Nov  1 17:05:10 2018
(r340008)
@@ -80,6 +80,17 @@
 #defineHCR_RW  0x8000
 #defineHCR_CD  0x0001
 #defineHCR_ID  0x0002
+#defineHCR_E2H 0x0004
+#defineHCR_TLOR0x0008
+#defineHCR_TERR0x0010
+#defineHCR_TEA 0x0020
+#defineHCR_MIOCNCE 0x0040
+/* Bit 39 is reserved */
+#defineHCR_APK 0x0100
+#defineHCR_API 0x0200
+#defineHCR_NV  0x0400
+#defineHCR_NV1 0x0800
+#defineHCR_AT  0x1000
 
 #endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Devin Teske


> On 31 Oct 2018, at 11:06 PM, Alex Kozlov  wrote:
> 
>> On Wed, Oct 31, 2018 at 08:37:12PM +, Devin Teske wrote:
>> Author: dteske
>> Date: Wed Oct 31 20:37:12 2018
>> New Revision: 339971
>> URL: https://svnweb.freebsd.org/changeset/base/339971
>> 
>> Log:
>>  Add new rc keywords: enable, disable, delete
>> 
>>  This adds new keywords to rc/service to enable/disable a service's
>>  rc.conf(5) variable and "delete" to remove the variable.
> The enable command is just one typo away from enabled, so it's quite
> easy to enable rc-script instead of checking if it enabled.
> 

Thankfully, easily fixed unlike so many other one-character typos (e.g., one 
involving rm)
— 
Devin

>>  When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>>  (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>>  deleted if empty after modification using "service $foo delete".
>> 
>>  Submitted by:lme (modified)
>>  Reviewed by:0mp (previous version), lme, bcr
>>  Relnotes:yes
>>  Sponsored by:Smule, Inc.
>>  Differential Revision:https://reviews.freebsd.org/D17113
> 
> 
> -- 
> Alex
> 

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


Re: svn commit: r339898 - head/lib/libc/amd64/sys

2018-11-01 Thread Brooks Davis
On Thu, Nov 01, 2018 at 08:57:24AM -0400, Charlie Li wrote:
> On 29/10/2018 20:11, Konstantin Belousov wrote:
> > Author: kib
> > Date: Tue Oct 30 00:11:30 2018
> > New Revision: 339898
> > URL: https://svnweb.freebsd.org/changeset/base/339898
> > 
> > Log:
> >   Convert amd64_get/set_fs/gsbase to ifunc.
> >   
> >   Note that this is the first use of ifuncs in our userspace.
> >   
> >   Sponsored by: The FreeBSD Foundation
> >   MFC after:1 month
> > 
> > Deleted:
> >   head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c
> >   head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h
> > Modified:
> >   head/lib/libc/amd64/sys/Makefile.inc
> >   head/lib/libc/amd64/sys/amd64_get_fsbase.c
> >   head/lib/libc/amd64/sys/amd64_get_gsbase.c
> >   head/lib/libc/amd64/sys/amd64_set_fsbase.c
> >   head/lib/libc/amd64/sys/amd64_set_gsbase.c
> > 
> Using LLVM 7 to build world, fails:
> 
> --- amd64_get_fsbase.o ---
> /usr/src/lib/libc/amd64/sys/amd64_get_fsbase.c:60:1: error: ifunc
> resolver function must have no parameters
> --- amd64_get_gsbase.o ---
> /usr/src/lib/libc/amd64/sys/amd64_get_gsbase.c:60:1: error: ifunc
> resolver function must have no parameters
> DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static)
> ^
> /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44:
> note: expanded from macro 'DEFINE_UIFUNC'
> --- amd64_get_fsbase.o ---
> DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static)
> ^
> /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44:
> note: expanded from macro 'DEFINE_UIFUNC'
> --- amd64_get_gsbase.o ---
> qual ret_type name args __attribute__((ifunc(#name "_resolver")));  \
>^
> --- amd64_get_fsbase.o ---
> qual ret_type name args __attribute__((ifunc(#name "_resolver")));  \
>^
> 1 error generated.
> --- amd64_get_gsbase.o ---
> 1 error generated.
> *** [amd64_get_gsbase.o] Error code 1
> 
> make[4]: stopped in /usr/src/lib/libc
> 
> CI appears green after this commit, so I'm inclined to pin this on yet
> another instance of LLVM 7 being stricter than LLVM 6. Backing out this
> revision allows the build to continue (successfully).

Is this failure with devel/llvm70?  It's currently missing the patch
required to make this work.  https://reviews.freebsd.org/D17709 contains
this patch among others.  I'll see about getting it applied.

-- Brooks


signature.asc
Description: PGP signature


svn commit: r340005 - in head/sys: netinet netinet6

2018-11-01 Thread Mark Johnston
Author: markj
Date: Thu Nov  1 15:52:49 2018
New Revision: 340005
URL: https://svnweb.freebsd.org/changeset/base/340005

Log:
  Remove redundant checks for a NULL lbgroup table.
  
  No functional change intended.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17108

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Nov  1 15:51:49 2018(r340004)
+++ head/sys/netinet/in_pcb.c   Thu Nov  1 15:52:49 2018(r340005)
@@ -322,9 +322,6 @@ in_pcbinslbgrouphash(struct inpcb *inp)
INP_WLOCK_ASSERT(inp);
INP_HASH_WLOCK_ASSERT(pcbinfo);
 
-   if (pcbinfo->ipi_lbgrouphashbase == NULL)
-   return (0);
-
/*
 * Don't allow jailed socket to join local group.
 */
@@ -399,9 +396,6 @@ in_pcbremlbgrouphash(struct inpcb *inp)
INP_WLOCK_ASSERT(inp);
INP_HASH_WLOCK_ASSERT(pcbinfo);
 
-   if (pcbinfo->ipi_lbgrouphashbase == NULL)
-   return;
-
hdr = &pcbinfo->ipi_lbgrouphashbase[
INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
pcbinfo->ipi_lbgrouphashmask)];
@@ -2276,13 +2270,11 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st
/*
 * Then look in lb group (for wildcard match).
 */
-   if (pcbinfo->ipi_lbgrouphashbase != NULL &&
-   (lookupflags & INPLOOKUP_WILDCARD)) {
+   if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr,
fport, lookupflags);
-   if (inp != NULL) {
+   if (inp != NULL)
return (inp);
-   }
}
 
/*

Modified: head/sys/netinet6/in6_pcb.c
==
--- head/sys/netinet6/in6_pcb.c Thu Nov  1 15:51:49 2018(r340004)
+++ head/sys/netinet6/in6_pcb.c Thu Nov  1 15:52:49 2018(r340005)
@@ -1161,13 +1161,11 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s
/*
 * Then look in lb group (for wildcard match).
 */
-   if (pcbinfo->ipi_lbgrouphashbase != NULL &&
-   (lookupflags & INPLOOKUP_WILDCARD)) {
+   if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
inp = in6_pcblookup_lbgroup(pcbinfo, laddr, lport, faddr,
fport, lookupflags);
-   if (inp != NULL) {
+   if (inp != NULL)
return (inp);
-   }
}
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r340004 - head/sys/netinet

2018-11-01 Thread Mark Johnston
Author: markj
Date: Thu Nov  1 15:51:49 2018
New Revision: 340004
URL: https://svnweb.freebsd.org/changeset/base/340004

Log:
  Improve style in in_pcbinslbgrouphash() and related subroutines.
  
  No functional change intended.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17107

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Nov  1 15:50:57 2018(r340003)
+++ head/sys/netinet/in_pcb.c   Thu Nov  1 15:51:49 2018(r340004)
@@ -266,7 +266,7 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr,
 
grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag,
old_grp->il_lport, &old_grp->il_dependladdr, size);
-   if (!grp)
+   if (grp == NULL)
return (NULL);
 
KASSERT(old_grp->il_inpcnt < grp->il_inpsiz,
@@ -288,21 +288,20 @@ static void
 in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp,
 int i)
 {
-   struct inpcblbgroup *grp = *grpp;
+   struct inpcblbgroup *grp, *new_grp;
 
+   grp = *grpp;
for (; i + 1 < grp->il_inpcnt; ++i)
grp->il_inp[i] = grp->il_inp[i + 1];
grp->il_inpcnt--;
 
if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN &&
-   grp->il_inpcnt <= (grp->il_inpsiz / 4)) {
+   grp->il_inpcnt <= grp->il_inpsiz / 4) {
/* Shrink this group. */
-   struct inpcblbgroup *new_grp =
-   in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2);
-   if (new_grp)
+   new_grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2);
+   if (new_grp != NULL)
*grpp = new_grp;
}
-   return;
 }
 
 /*
@@ -316,9 +315,7 @@ in_pcbinslbgrouphash(struct inpcb *inp)
struct inpcbinfo *pcbinfo;
struct inpcblbgrouphead *hdr;
struct inpcblbgroup *grp;
-   uint16_t hashmask, lport;
-   uint32_t group_index;
-   struct ucred *cred;
+   uint32_t idx;
 
pcbinfo = inp->inp_pcbinfo;
 
@@ -328,19 +325,10 @@ in_pcbinslbgrouphash(struct inpcb *inp)
if (pcbinfo->ipi_lbgrouphashbase == NULL)
return (0);
 
-   hashmask = pcbinfo->ipi_lbgrouphashmask;
-   lport = inp->inp_lport;
-   group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask);
-   hdr = &pcbinfo->ipi_lbgrouphashbase[group_index];
-
/*
 * Don't allow jailed socket to join local group.
 */
-   if (inp->inp_socket != NULL)
-   cred = inp->inp_socket->so_cred;
-   else
-   cred = NULL;
-   if (cred != NULL && jailed(cred))
+   if (inp->inp_socket != NULL && jailed(inp->inp_socket->so_cred))
return (0);
 
 #ifdef INET6
@@ -354,24 +342,23 @@ in_pcbinslbgrouphash(struct inpcb *inp)
}
 #endif
 
-   hdr = &pcbinfo->ipi_lbgrouphashbase[
-   INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
-   pcbinfo->ipi_lbgrouphashmask)];
+   idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
+   pcbinfo->ipi_lbgrouphashmask);
+   hdr = &pcbinfo->ipi_lbgrouphashbase[idx];
CK_LIST_FOREACH(grp, hdr, il_list) {
if (grp->il_vflag == inp->inp_vflag &&
grp->il_lport == inp->inp_lport &&
memcmp(&grp->il_dependladdr,
-   &inp->inp_inc.inc_ie.ie_dependladdr,
-   sizeof(grp->il_dependladdr)) == 0) {
+   &inp->inp_inc.inc_ie.ie_dependladdr,
+   sizeof(grp->il_dependladdr)) == 0)
break;
-   }
}
if (grp == NULL) {
/* Create new load balance group. */
grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag,
inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr,
INPCBLBGROUP_SIZMIN);
-   if (!grp)
+   if (grp == NULL)
return (ENOBUFS);
} else if (grp->il_inpcnt == grp->il_inpsiz) {
if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) {
@@ -383,13 +370,13 @@ in_pcbinslbgrouphash(struct inpcb *inp)
 
/* Expand this local group. */
grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2);
-   if (!grp)
+   if (grp == NULL)
return (ENOBUFS);
}
 
KASSERT(grp->il_inpcnt < grp->il_inpsiz,
-   ("invalid local group size %d and count %d",
-grp->il_inpsiz, grp->il_inpcnt));
+   ("invalid local group size %d and count %d", grp->il_inpsiz,
+   grp->il_inpcnt));
 
grp->il_inp[grp->il_inpcnt] = inp;
grp->il_inpcnt++;
___
svn-src-head@freebsd.org 

svn commit: r340001 - head/share/man/man3

2018-11-01 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Nov  1 15:40:57 2018
New Revision: 340001
URL: https://svnweb.freebsd.org/changeset/base/340001

Log:
  CMSG_DATA(3): Use consistent variable names
  
  The description of CMSG_FIRSTHDR used two variables (mhdr and msg) to
  reference the same thing. Use msghdr consistency across the manual page
  instead.
  
  Reviewed by:  bcr
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  MFC after:  1 week
  Differential Revision:https://reviews.freebsd.org/D17804

Modified:
  head/share/man/man3/CMSG_DATA.3

Modified: head/share/man/man3/CMSG_DATA.3
==
--- head/share/man/man3/CMSG_DATA.3 Thu Nov  1 15:30:01 2018
(r34)
+++ head/share/man/man3/CMSG_DATA.3 Thu Nov  1 15:40:57 2018
(r340001)
@@ -2,7 +2,7 @@
 .\" Public domain, July 3, 2005
 .\"
 .\" $FreeBSD$
-.Dd August 19, 2018
+.Dd November 1, 2018
 .Dt CMSG_DATA 3
 .Os
 .Sh NAME
@@ -50,10 +50,10 @@ This routine accesses the data portion of the control 
 .Fa cmsg .
 It ensures proper alignment constraints on the beginning of ancillary
 data are met.
-.It Fn CMSG_FIRSTHDR mhdr
+.It Fn CMSG_FIRSTHDR msghdr
 This routine accesses the first control message attached to the
 message
-.Fa msg .
+.Fa msghdr .
 If no control messages are attached to the message, this routine
 returns
 .Dv NULL .
@@ -67,11 +67,11 @@ This value is what is normally stored in the
 of each control message.
 This routine accounts for any alignment constraints on the beginning of
 ancillary data.
-.It Fn CMSG_NXTHDR mhdr cmsg
+.It Fn CMSG_NXTHDR msghdr cmsg
 This routine returns the location of the control message following
 .Fa cmsg
 in the message
-.Fa mhdr .
+.Fa msghdr .
 If
 .Fa cmsg
 is the last control message in the chain, this routine returns
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-11-01 Thread Ben Widawsky
Author: bwidawsk
Date: Thu Nov  1 15:30:01 2018
New Revision: 34
URL: https://svnweb.freebsd.org/changeset/base/34

Log:
  linuxkpi: Add GFP flags needed for ttm drivers
  
  Submitted by: Johannes Lundberg 
  Requested by: bwidawsk
  MFC after:3 days
  Approved by:  emaste (mentor)

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

Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h
==
--- head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Nov  1 15:27:22 
2018(r33)
+++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Nov  1 15:30:01 
2018(r34)
@@ -52,6 +52,7 @@
 #define__GFP_RETRY_MAYFAIL 0
 #define__GFP_MOVABLE   0
 #define__GFP_COMP  0
+#define__GFP_KSWAPD_RECLAIM 0
 
 #define__GFP_IO0
 #define__GFP_NO_KSWAPD 0
@@ -73,6 +74,7 @@
 #defineGFP_TEMPORARY   M_NOWAIT
 #defineGFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO)
 #defineGFP_TRANSHUGE   0
+#defineGFP_TRANSHUGE_LIGHT 0
 
 CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0);
 CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339999 - head/sys/fs/nfsclient

2018-11-01 Thread Rick Macklem
Author: rmacklem
Date: Thu Nov  1 15:27:22 2018
New Revision: 33
URL: https://svnweb.freebsd.org/changeset/base/33

Log:
  Fix NFS client vnode locking to avoid a crash during forced dismount.
  
  A crash was reported where the crash occurred in nfs_advlock() when the
  NFS_ISV4(vp) macro was being executed. This was caused by the vnode
  being VI_DOOMED due to a forced dismount in progress.
  This patch fixes the problem by locking the vnode before executing the
  NFS_ISV4() macro.
  
  Tested by:rlibby
  PR:   232673
  Reviewed by:  kib
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D17757

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Thu Nov  1 15:19:36 2018
(r339998)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Nov  1 15:27:22 2018
(r33)
@@ -3033,14 +3033,19 @@ nfs_advlock(struct vop_advlock_args *ap)
int ret, error = EOPNOTSUPP;
u_quad_t size;

+   ret = NFSVOPLOCK(vp, LK_SHARED);
+   if (ret != 0)
+   return (EBADF);
if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) {
-   if (vp->v_type != VREG)
+   if (vp->v_type != VREG) {
+   NFSVOPUNLOCK(vp, 0);
return (EINVAL);
+   }
if ((ap->a_flags & F_POSIX) != 0)
cred = p->p_ucred;
else
cred = td->td_ucred;
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY);
+   NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY);
if (vp->v_iflag & VI_DOOMED) {
NFSVOPUNLOCK(vp, 0);
return (EBADF);
@@ -3119,9 +3124,6 @@ nfs_advlock(struct vop_advlock_args *ap)
NFSVOPUNLOCK(vp, 0);
return (0);
} else if (!NFS_ISV4(vp)) {
-   error = NFSVOPLOCK(vp, LK_SHARED);
-   if (error)
-   return (error);
if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) {
size = VTONFS(vp)->n_size;
NFSVOPUNLOCK(vp, 0);
@@ -3144,7 +3146,8 @@ nfs_advlock(struct vop_advlock_args *ap)
NFSVOPUNLOCK(vp, 0);
}
}
-   }
+   } else
+   NFSVOPUNLOCK(vp, 0);
return (error);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339995 - head/libexec/rc/rc.d

2018-11-01 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Nov  1 14:24:12 2018
New Revision: 339995
URL: https://svnweb.freebsd.org/changeset/base/339995

Log:
  Run unbound-anchor when root.key is empty, not just when it is absent.
  
  PR:   232555
  Submitted by: Ari Suutari 
  MFC after:3 days

Modified:
  head/libexec/rc/rc.d/local_unbound

Modified: head/libexec/rc/rc.d/local_unbound
==
--- head/libexec/rc/rc.d/local_unbound  Thu Nov  1 14:00:56 2018
(r339994)
+++ head/libexec/rc/rc.d/local_unbound  Thu Nov  1 14:24:12 2018
(r339995)
@@ -92,7 +92,7 @@ local_unbound_prestart()
fi
 
# Retrieve DNSSEC root key
-   if [ ! -f ${local_unbound_anchor} ] ; then
+   if [ ! -s ${local_unbound_anchor} ] ; then
run_rc_command anchor
fi
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339994 - head/lib/libbe

2018-11-01 Thread Kyle Evans
Author: kevans
Date: Thu Nov  1 14:00:56 2018
New Revision: 339994
URL: https://svnweb.freebsd.org/changeset/base/339994

Log:
  libbe(3): Don't promote non-cloned BEs
  
  Most easily reproducible by attempting to activate the currently activated
  BE, one would get a "not a cloned filesystem" error instead of success or a
  sane message.
  
  PR:   232488
  MFC after:3 days

Modified:
  head/lib/libbe/be.c

Modified: head/lib/libbe/be.c
==
--- head/lib/libbe/be.c Thu Nov  1 13:29:55 2018(r339993)
+++ head/lib/libbe/be.c Thu Nov  1 14:00:56 2018(r339994)
@@ -928,7 +928,8 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, 
 {
char be_path[BE_MAXPATHLEN];
char buf[BE_MAXPATHLEN];
-   nvlist_t *config, *vdevs;
+   nvlist_t *config, *dsprops, *vdevs;
+   char *origin;
uint64_t pool_guid;
zfs_handle_t *zhp;
int err;
@@ -969,7 +970,18 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, 
if (zhp == NULL)
return (-1);
 
-   err = zfs_promote(zhp);
+   if (be_prop_list_alloc(&dsprops) != 0)
+   return (-1);
+
+   if (be_get_dataset_props(lbh, be_path, dsprops) != 0) {
+   nvlist_free(dsprops);
+   return (-1);
+   }
+
+   if (nvlist_lookup_string(dsprops, "origin", &origin) == 0)
+   err = zfs_promote(zhp);
+   nvlist_free(dsprops);
+
zfs_close(zhp);
 
if (err)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339993 - head/stand/libsa

2018-11-01 Thread Toomas Soome
Author: tsoome
Date: Thu Nov  1 13:29:55 2018
New Revision: 339993
URL: https://svnweb.freebsd.org/changeset/base/339993

Log:
  libsa: tftp should use calloc
  
  instead of malloc() memset(), use calloc().

Modified:
  head/stand/libsa/tftp.c

Modified: head/stand/libsa/tftp.c
==
--- head/stand/libsa/tftp.c Thu Nov  1 13:12:05 2018(r339992)
+++ head/stand/libsa/tftp.c Thu Nov  1 13:29:55 2018(r339993)
@@ -448,11 +448,10 @@ tftp_open(const char *path, struct open_file *f)
if (is_open)
return (EBUSY);
 
-   tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
+   tftpfile = calloc(1, sizeof(*tftpfile));
if (!tftpfile)
return (ENOMEM);
 
-   memset(tftpfile, 0, sizeof(*tftpfile));
tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
if (io == NULL) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339992 - head/stand/libsa

2018-11-01 Thread Toomas Soome
Author: tsoome
Date: Thu Nov  1 13:12:05 2018
New Revision: 339992
URL: https://svnweb.freebsd.org/changeset/base/339992

Log:
  libsa: tftp should not read past file end
  
  When we have the file size via tsize option, use it to make sure we
  will not attempt to read past file end.

Modified:
  head/stand/libsa/tftp.c

Modified: head/stand/libsa/tftp.c
==
--- head/stand/libsa/tftp.c Thu Nov  1 11:41:40 2018(r339991)
+++ head/stand/libsa/tftp.c Thu Nov  1 13:12:05 2018(r339992)
@@ -498,11 +498,19 @@ tftp_read(struct open_file *f, void *addr, size_t size
 size_t *resid /* out */)
 {
struct tftp_handle *tftpfile;
+   size_t res;
int rc;
 
rc = 0;
+   res = size;
tftpfile = (struct tftp_handle *) f->f_fsdata;
 
+   /* Make sure we will not read past file end */
+   if (tftpfile->tftp_tsize > 0 &&
+   tftpfile->off + size > tftpfile->tftp_tsize) {
+   size = tftpfile->tftp_tsize - tftpfile->off;
+   }
+
while (size > 0) {
int needblock, count;
 
@@ -550,6 +558,7 @@ tftp_read(struct open_file *f, void *addr, size_t size
addr = (char *)addr + count;
tftpfile->off += count;
size -= count;
+   res -= count;
 
if ((tftpfile->islastblock) && (count == inbuffer))
break;  /* EOF */
@@ -562,8 +571,8 @@ tftp_read(struct open_file *f, void *addr, size_t size
 
}
 
-   if (resid)
-   *resid = size;
+   if (resid != NULL)
+   *resid = res;
return (rc);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r339898 - head/lib/libc/amd64/sys

2018-11-01 Thread Charlie Li
On 29/10/2018 20:11, Konstantin Belousov wrote:
> Author: kib
> Date: Tue Oct 30 00:11:30 2018
> New Revision: 339898
> URL: https://svnweb.freebsd.org/changeset/base/339898
> 
> Log:
>   Convert amd64_get/set_fs/gsbase to ifunc.
>   
>   Note that this is the first use of ifuncs in our userspace.
>   
>   Sponsored by:   The FreeBSD Foundation
>   MFC after:  1 month
> 
> Deleted:
>   head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c
>   head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h
> Modified:
>   head/lib/libc/amd64/sys/Makefile.inc
>   head/lib/libc/amd64/sys/amd64_get_fsbase.c
>   head/lib/libc/amd64/sys/amd64_get_gsbase.c
>   head/lib/libc/amd64/sys/amd64_set_fsbase.c
>   head/lib/libc/amd64/sys/amd64_set_gsbase.c
> 
Using LLVM 7 to build world, fails:

--- amd64_get_fsbase.o ---
/usr/src/lib/libc/amd64/sys/amd64_get_fsbase.c:60:1: error: ifunc
resolver function must have no parameters
--- amd64_get_gsbase.o ---
/usr/src/lib/libc/amd64/sys/amd64_get_gsbase.c:60:1: error: ifunc
resolver function must have no parameters
DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static)
^
/usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44:
note: expanded from macro 'DEFINE_UIFUNC'
--- amd64_get_fsbase.o ---
DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static)
^
/usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44:
note: expanded from macro 'DEFINE_UIFUNC'
--- amd64_get_gsbase.o ---
qual ret_type name args __attribute__((ifunc(#name "_resolver")));  \
   ^
--- amd64_get_fsbase.o ---
qual ret_type name args __attribute__((ifunc(#name "_resolver")));  \
   ^
1 error generated.
--- amd64_get_gsbase.o ---
1 error generated.
*** [amd64_get_gsbase.o] Error code 1

make[4]: stopped in /usr/src/lib/libc

CI appears green after this commit, so I'm inclined to pin this on yet
another instance of LLVM 7 being stricter than LLVM 6. Backing out this
revision allows the build to continue (successfully).

-- 
Charlie Li
Can't think of a witty .sigline today…

(This email address is for mailing list use only; replace local-part
with vishwin for off-list communication)



signature.asc
Description: OpenPGP digital signature


svn commit: r339991 - head/sys/netinet

2018-11-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Nov  1 11:41:40 2018
New Revision: 339991
URL: https://svnweb.freebsd.org/changeset/base/339991

Log:
  Remove debug code which slipped in accidently.
  
  MFC after:4 weeks
  X-MFC with:   r339989
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Thu Nov  1 11:37:19 2018
(r339990)
+++ head/sys/netinet/tcp_syncache.c Thu Nov  1 11:41:40 2018
(r339991)
@@ -1744,7 +1744,6 @@ syncache_respond(struct syncache *sc, struct syncache_
th->th_seq = htonl(sc->sc_iss);
else
th->th_seq = htonl(sc->sc_iss + 1);
-printf("SEG.SEQ=0x%x, ISS=0x%x.\n", ntohl(th->th_seq), sc->sc_iss);
th->th_ack = htonl(sc->sc_irs + 1);
th->th_off = sizeof(struct tcphdr) >> 2;
th->th_x2 = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339990 - head/contrib/smbfs/mount_smbfs

2018-11-01 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Nov  1 11:37:19 2018
New Revision: 339990
URL: https://svnweb.freebsd.org/changeset/base/339990

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

Modified:
  head/contrib/smbfs/mount_smbfs/mount_smbfs.8

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

svn commit: r339989 - head/sys/netinet

2018-11-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Nov  1 11:35:28 2018
New Revision: 339989
URL: https://svnweb.freebsd.org/changeset/base/339989

Log:
  Improve a comment to refer to the actual sections in the TCP
  specification for the comparisons made.
  Thanks to lstewart@ for the suggestion.
  
  MFC after:4 weeks
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D17595

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Thu Nov  1 10:25:22 2018
(r339988)
+++ head/sys/netinet/tcp_syncache.c Thu Nov  1 11:35:28 2018
(r339989)
@@ -581,15 +581,28 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr
/*
 * If the RST bit is set, check the sequence number to see
 * if this is a valid reset segment.
+*
 * RFC 793 page 37:
 *   In all states except SYN-SENT, all reset (RST) segments
 *   are validated by checking their SEQ-fields.  A reset is
 *   valid if its sequence number is in the window.
 *
-*   The sequence number in the reset segment is normally an
-*   echo of our outgoing acknowlegement numbers, but some hosts
-*   send a reset with the sequence number at the rightmost edge
-*   of our receive window, and we have to handle this case.
+* RFC 793 page 69:
+*   There are four cases for the acceptability test for an incoming
+*   segment:
+*
+* Segment Receive  Test
+* Length  Window
+* --- ---  ---
+*0   0 SEG.SEQ = RCV.NXT
+*0  >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+*   >0   0 not acceptable
+*   >0  >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+*   or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+*
+* Note that when receiving a SYN segment in the LISTEN state,
+* IRS is set to SEG.SEQ and RCV.NXT is set to SEG.SEQ+1, as
+* described in RFC 793, page 66.
 */
if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) &&
SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) ||
@@ -1731,6 +1744,7 @@ syncache_respond(struct syncache *sc, struct syncache_
th->th_seq = htonl(sc->sc_iss);
else
th->th_seq = htonl(sc->sc_iss + 1);
+printf("SEG.SEQ=0x%x, ISS=0x%x.\n", ntohl(th->th_seq), sc->sc_iss);
th->th_ack = htonl(sc->sc_irs + 1);
th->th_off = sizeof(struct tcphdr) >> 2;
th->th_x2 = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-11-01 Thread Andrew Turner
Author: andrew
Date: Thu Nov  1 10:25:22 2018
New Revision: 339988
URL: https://svnweb.freebsd.org/changeset/base/339988

Log:
  Use the correct offsets for the trap frame in fork_trampoline.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/swtch.S

Modified: head/sys/arm64/arm64/swtch.S
==
--- head/sys/arm64/arm64/swtch.SThu Nov  1 09:00:37 2018
(r339987)
+++ head/sys/arm64/arm64/swtch.SThu Nov  1 10:25:22 2018
(r339988)
@@ -236,12 +236,12 @@ ENTRY(fork_trampoline)
msr daifset, #2
 
/* Restore sp and lr */
-   ldp x0, x1, [sp]
+   ldp x0, x1, [sp, #TF_SP]
msr sp_el0, x0
mov lr, x1
 
/* Restore elr and spsr */
-   ldp x0, x1, [sp, #16]
+   ldp x0, x1, [sp, #TF_ELR]
msr elr_el1, x0
msr spsr_el1, x1
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r339985 - head/share/man/man4

2018-11-01 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Nov  1 08:17:27 2018
New Revision: 339985
URL: https://svnweb.freebsd.org/changeset/base/339985

Log:
  Fix markup issues and add references to updated RFCs.
  
  MFC after:3 days

Modified:
  head/share/man/man4/icmp6.4
  head/share/man/man4/ip6.4

Modified: head/share/man/man4/icmp6.4
==
--- head/share/man/man4/icmp6.4 Thu Nov  1 08:08:08 2018(r339984)
+++ head/share/man/man4/icmp6.4 Thu Nov  1 08:17:27 2018(r339985)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 7, 2012
+.Dd November 1, 2018
 .Dt ICMP6 4
 .Os
 .Sh NAME
@@ -188,11 +188,11 @@ By default, all messages types are allowed on newly cr
 sockets.
 The following macros may be used to refine the input set:
 .Bl -tag -width Ds
-.It Fn "void ICMP6_FILTER_SETPASSALL" "struct icmp6_filter *filterp"
+.It Ft void Fn ICMP6_FILTER_SETPASSALL "struct icmp6_filter *filterp"
 Allow all incoming messages.
 .Va filterp
 is modified to allow all message types.
-.It Fn "void ICMP6_FILTER_SETBLOCKALL" "struct icmp6_filter *filterp"
+.It Ft void Fn ICMP6_FILTER_SETBLOCKALL "struct icmp6_filter *filterp"
 Ignore all incoming messages.
 .Va filterp
 is modified to ignore all message types.
@@ -206,7 +206,7 @@ Allow ICMPv6 messages with the given
 is modified to allow such messages.
 .It Xo
 .Ft void
-.Fn ICMP6_FILTER_SETBLOCK" "int type" "struct icmp6_filter *filterp"
+.Fn ICMP6_FILTER_SETBLOCK "int type" "struct icmp6_filter *filterp"
 .Xc
 Ignore ICMPv6 messages with the given
 .Fa type .
@@ -214,13 +214,13 @@ Ignore ICMPv6 messages with the given
 is modified to ignore such messages.
 .It Xo
 .Ft int
-.Fn ICMP6_FILTER_WILLPASS" "int type" "const struct icmp6_filter *filterp"
+.Fn ICMP6_FILTER_WILLPASS "int type" "const struct icmp6_filter *filterp"
 .Xc
 Determine if the given filter will allow an ICMPv6 message of the given
 type.
 .It Xo
 .Ft int
-.Fn ICMP6_FILTER_WILLBLOCK" "int type" "const struct icmp6_filter *filterp"
+.Fn ICMP6_FILTER_WILLBLOCK "int type" "const struct icmp6_filter *filterp"
 .Xc
 Determine if the given filter will ignore an ICMPv6 message of the given
 type.
@@ -262,4 +262,22 @@ structure as the option value.
 "Protocol Version 6 (IPv6) Specification"
 .%N RFC 2463
 .%D December 1998
+.Re
+.Rs
+.%A W. Stevens
+.%A M. Thomas
+.%A E. Nordmark
+.%A T. Jinmei
+.%T "Advanced Sockets Application Program Interface (API) for IPv6"
+.%R RFC 3542
+.%D May 2003
+.Re
+.Rs
+.%A A. Conta
+.%A S. Deering
+.%A M. Gupta
+.%T "Internet Control Message Protocol (ICMPv6) for the Internet" \
+"Protocol Version 6 (IPv6) Specification"
+.%R RFC 4443
+.%D March 2006
 .Re

Modified: head/share/man/man4/ip6.4
==
--- head/share/man/man4/ip6.4   Thu Nov  1 08:08:08 2018(r339984)
+++ head/share/man/man4/ip6.4   Thu Nov  1 08:17:27 2018(r339985)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 19, 2018
+.Dd November 1, 2018
 .Dt IP6 4
 .Os
 .Sh NAME
@@ -652,9 +652,8 @@ An ancillary data object was improperly formed.
 .Xr setsockopt 2 ,
 .Xr socket 2 ,
 .Xr CMSG_DATA 3 ,
-.\" .Xr inet6_option_space 3 ,
-.\" .Xr inet6_rthdr_space 3 ,
 .Xr if_nametoindex 3 ,
+.Xr inet6_opt_init 3 ,
 .Xr bpf 4 ,
 .Xr icmp6 4 ,
 .Xr inet6 4 ,
@@ -686,16 +685,42 @@ An ancillary data object was improperly formed.
 .%D March 1999
 .Re
 .Rs
+.%A R. Gilligan
+.%A S. Thomson
+.%A J. Bound
+.%A J. McCann
 .%A W. Stevens
+.%T Basic Socket Interface Extensions for IPv6
+.%R RFC 3493
+.%D February 2003
+.Re
+.Rs
+.%A W. Stevens
+.%A M. Thomas
+.%A E. Nordmark
+.%A T. Jinmei
+.%T Advanced Sockets Application Program Interface (API) for IPv6
+.%R RFC 3542
+.%D May 2003
+.Re
+.Rs
+.%A S. Deering
+.%A R. Hinden
+.%T Internet Protocol, Version 6 (IPv6) Specification
+.%R RFC 8200
+.%D July 2017
+.Re
+.Rs
+.%A W. Stevens
 .%A B. Fenner
 .%A A. Rudoff
-.%T UNIX Network Programming, third edition
+.%T UNIX Network Programming, 3rd Edition
+.%I Addison-Wesley Professional
+.%D November 2003
 .Re
 .Sh STANDARDS
-Most of the socket options are defined in RFC 2292 or RFC 2553.
-The
-.Dv IPV6_V6ONLY
-socket option is defined in RFC 3493 Section 5.3.
+Most of the socket options are defined in RFC 2292 / 3542 or
+RFC 2553 / 3493.
 The
 .Dv IPV6_PORTRANGE
 socket option and the conflict resolution rule are not defined in the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"