svn commit: r354940 - stable/12/sys/dev/iicbus

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Thu Nov 21 07:48:03 2019
New Revision: 354940
URL: https://svnweb.freebsd.org/changeset/base/354940

Log:
  MFC r354212: iicbb: allow longer SCL low timeout and other improvements
  
  First, SCL low timeout is set to 25 milliseconds by default as opposed
  to 1 millisecond before.  The new value is based on the SMBus
  specification.  The timeout can be changed on a per bus basis using
  dev.iicbb.N.scl_low_timeout sysctl.
  
  The driver uses DELAY to wait for high SCL up to 1 millisecond, then it
  switches to pause_sbt(SBT_1MS) for the rest of the timeout.
  
  While here I made a number of other changes.  'udelay' that's used for
  timing clock and data signals is now calculated based on the requested
  bus frequency (dev.iicbus.N.frequency) instead of being hardcoded to 10
  microseconds.  The calculations are done in such a fashion that the
  default bus frequency of 10 is converted to udelay of 10 us.  This
  is for backward compatibility.  The actual frequency will be less than a
  quarter (I think) of the requested frequency.
  
  Also, I added detection of stuck low SCL in a few places.  Previously,
  the code would just carry on after the SCL low timeout and that might
  potentially lead to misinterpreted bits.
  
  Finally, I fixed several style issues near the code that I changed.
  Many more are still remaining.

Modified:
  stable/12/sys/dev/iicbus/iicbb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/iicbus/iicbb.c
==
--- stable/12/sys/dev/iicbus/iicbb.cThu Nov 21 07:39:33 2019
(r354939)
+++ stable/12/sys/dev/iicbus/iicbb.cThu Nov 21 07:48:03 2019
(r354940)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifdef FDT
@@ -68,9 +69,13 @@ __FBSDID("$FreeBSD$");
 #include "iicbus_if.h"
 #include "iicbb_if.h"
 
+/* Based on the SMBus specification. */
+#defineDEFAULT_SCL_LOW_TIMEOUT (25 * 1000)
+
 struct iicbb_softc {
device_t iicbus;
-   int udelay; /* signal toggle delay in usec */
+   u_int udelay;   /* signal toggle delay in usec */
+   u_int scl_low_timeout;
 };
 
 static int iicbb_attach(device_t);
@@ -86,6 +91,7 @@ static int iicbb_write(device_t, const char *, int, in
 static int iicbb_read(device_t, char *, int, int *, int, int);
 static int iicbb_reset(device_t, u_char, u_char, u_char *);
 static int iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs);
+static void iicbb_set_speed(struct iicbb_softc *sc, u_char);
 #ifdef FDT
 static phandle_t iicbb_get_node(device_t, device_t);
 #endif
@@ -142,9 +148,19 @@ iicbb_attach(device_t dev)
sc->iicbus = device_add_child(dev, "iicbus", -1);
if (!sc->iicbus)
return (ENXIO);
-   sc->udelay = 10;/* 10 uS default */
-   bus_generic_attach(dev);
 
+   sc->scl_low_timeout = DEFAULT_SCL_LOW_TIMEOUT;
+
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "delay", CTLFLAG_RD, &sc->udelay,
+   0, "Signal change delay controlled by bus frequency, microseconds");
+
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "scl_low_timeout", CTLFLAG_RWTUN, &sc->scl_low_timeout,
+   0, "SCL low timeout, microseconds");
+   bus_generic_attach(dev);
return (0);
 }
 
@@ -201,24 +217,17 @@ iicbb_print_child(device_t bus, device_t dev)
return (retval);
 }
 
-#define I2C_SETSDA(sc,dev,val) do {\
-   IICBB_SETSDA(device_get_parent(dev), val);  \
+#defineI2C_GETSDA(dev) (IICBB_GETSDA(device_get_parent(dev)))
+#defineI2C_SETSDA(dev, x)  (IICBB_SETSDA(device_get_parent(dev), 
x))
+#defineI2C_GETSCL(dev) (IICBB_GETSCL(device_get_parent(dev)))
+#defineI2C_SETSCL(dev, x)  (IICBB_SETSCL(device_get_parent(dev), 
x))
+
+#define I2C_SET(sc, dev, ctrl, val) do {   \
+   iicbb_setscl(dev, ctrl);\
+   I2C_SETSDA(dev, val);   \
DELAY(sc->udelay);  \
} while (0)
 
-#define I2C_SETSCL(dev,val) do {   \
-   iicbb_setscl(dev, val, 100);\
-   } while (0)
-
-#define I2C_SET(sc,dev,ctrl,data) do { \
-   I2C_SETSCL(dev, ctrl);  \
-   I2C_SETSDA(sc, dev, data);  \
-   } while (0)
-
-#define I2C_GETSDA(dev) (IICBB_GETSDA(device_get_parent(dev)))
-
-#define I2C_GETSCL(dev) (IICBB_GETSCL(device_get_parent(dev)))
-
 static int i2c_debug = 0;
 #define I2C_DEBUG(x)   do {\
if (i2c_debug) (x); \

svn commit: r354939 - in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src contrib/file/tests lib/libmagic

2019-11-20 Thread Xin LI
Author: delphij
Date: Thu Nov 21 07:39:33 2019
New Revision: 354939
URL: https://svnweb.freebsd.org/changeset/base/354939

Log:
  MFC r333923, r354595, r354802:
  
  MFV r354582: file 5.37
  
  MFV r354798:
  
  Apply vendor fixes:
  
  06de62c Detect multiplication overflow when computing sector position
  46a8443 Limit the number of elements in a vector (found by oss-fuzz)
  
  Security:   CVE-2019-18218

Added:
  stable/11/contrib/file/magic/Magdir/biosig
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/biosig
  stable/11/contrib/file/magic/Magdir/clojure
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/clojure
  stable/11/contrib/file/magic/Magdir/edid
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/edid
  stable/11/contrib/file/magic/Magdir/espressif
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/espressif
  stable/11/contrib/file/magic/Magdir/glibc
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/glibc
  stable/11/contrib/file/magic/Magdir/hardware
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/hardware
  stable/11/contrib/file/magic/Magdir/kicad
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/kicad
  stable/11/contrib/file/magic/Magdir/numpy
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/numpy
  stable/11/contrib/file/magic/Magdir/rpmsg
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/rpmsg
  stable/11/contrib/file/src/is_json.c
 - copied unchanged from r354595, head/contrib/file/src/is_json.c
  stable/11/contrib/file/tests/CVE-2014-1943.result
 - copied unchanged from r354595, 
head/contrib/file/tests/CVE-2014-1943.result
  stable/11/contrib/file/tests/CVE-2014-1943.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/CVE-2014-1943.testfile
  stable/11/contrib/file/tests/fit-map-data.result
 - copied unchanged from r354595, 
head/contrib/file/tests/fit-map-data.result
  stable/11/contrib/file/tests/fit-map-data.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/fit-map-data.testfile
  stable/11/contrib/file/tests/issue359xlsx.result
 - copied unchanged from r354595, 
head/contrib/file/tests/issue359xlsx.result
  stable/11/contrib/file/tests/issue359xlsx.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/issue359xlsx.testfile
  stable/11/contrib/file/tests/json1.result
 - copied unchanged from r354595, head/contrib/file/tests/json1.result
  stable/11/contrib/file/tests/json1.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json1.testfile
  stable/11/contrib/file/tests/json2.result
 - copied unchanged from r354595, head/contrib/file/tests/json2.result
  stable/11/contrib/file/tests/json2.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json2.testfile
  stable/11/contrib/file/tests/json3.result
 - copied unchanged from r354595, head/contrib/file/tests/json3.result
  stable/11/contrib/file/tests/json3.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json3.testfile
  stable/11/contrib/file/tests/regex-eol.magic
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.magic
  stable/11/contrib/file/tests/regex-eol.result
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.result
  stable/11/contrib/file/tests/regex-eol.testfile
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.testfile
  stable/11/contrib/file/tests/zstd-3-skippable-frames.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-3-skippable-frames.result
  stable/11/contrib/file/tests/zstd-dictionary-0.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-0.result
  stable/11/contrib/file/tests/zstd-dictionary-1.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-1.result
  stable/11/contrib/file/tests/zstd-dictionary-2.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-2.result
  stable/11/contrib/file/tests/zstd-skippable-frame-0.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-0.result
  stable/11/contrib/file/tests/zstd-skippable-frame-4.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-4.result
  stable/11/contrib/file/tests/zstd-skippable-frame-8.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-8.result
  stable/11/contrib/file/tests/zstd-skippable-frame-C.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-C.result
  stable/11/contrib/file/tests/zstd-v0.2-FF.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-v0.2-FF.result
  stable/11/contrib/file/tests/zstd-v0.2-FF.testfile
 - copied unchanged from r354595, 
head/contrib/file/te

svn commit: r354938 - in stable/12: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src contrib/file/tests lib/libmagic

2019-11-20 Thread Xin LI
Author: delphij
Date: Thu Nov 21 07:29:25 2019
New Revision: 354938
URL: https://svnweb.freebsd.org/changeset/base/354938

Log:
  MFC r354595, r354802:
  
  MFV r354582: file 5.37
  
  MFV r354798:
  
  Apply vendor fixes:
  
  06de62c Detect multiplication overflow when computing sector position
  46a8443 Limit the number of elements in a vector (found by oss-fuzz)
  
  Security:   CVE-2019-18218

Added:
  stable/12/contrib/file/magic/Magdir/biosig
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/biosig
  stable/12/contrib/file/magic/Magdir/clojure
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/clojure
  stable/12/contrib/file/magic/Magdir/edid
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/edid
  stable/12/contrib/file/magic/Magdir/espressif
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/espressif
  stable/12/contrib/file/magic/Magdir/glibc
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/glibc
  stable/12/contrib/file/magic/Magdir/hardware
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/hardware
  stable/12/contrib/file/magic/Magdir/kicad
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/kicad
  stable/12/contrib/file/magic/Magdir/numpy
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/numpy
  stable/12/contrib/file/magic/Magdir/rpmsg
 - copied unchanged from r354595, head/contrib/file/magic/Magdir/rpmsg
  stable/12/contrib/file/src/is_json.c
 - copied unchanged from r354595, head/contrib/file/src/is_json.c
  stable/12/contrib/file/tests/CVE-2014-1943.result
 - copied unchanged from r354595, 
head/contrib/file/tests/CVE-2014-1943.result
  stable/12/contrib/file/tests/CVE-2014-1943.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/CVE-2014-1943.testfile
  stable/12/contrib/file/tests/fit-map-data.result
 - copied unchanged from r354595, 
head/contrib/file/tests/fit-map-data.result
  stable/12/contrib/file/tests/fit-map-data.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/fit-map-data.testfile
  stable/12/contrib/file/tests/issue359xlsx.result
 - copied unchanged from r354595, 
head/contrib/file/tests/issue359xlsx.result
  stable/12/contrib/file/tests/issue359xlsx.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/issue359xlsx.testfile
  stable/12/contrib/file/tests/json1.result
 - copied unchanged from r354595, head/contrib/file/tests/json1.result
  stable/12/contrib/file/tests/json1.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json1.testfile
  stable/12/contrib/file/tests/json2.result
 - copied unchanged from r354595, head/contrib/file/tests/json2.result
  stable/12/contrib/file/tests/json2.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json2.testfile
  stable/12/contrib/file/tests/json3.result
 - copied unchanged from r354595, head/contrib/file/tests/json3.result
  stable/12/contrib/file/tests/json3.testfile
 - copied unchanged from r354595, head/contrib/file/tests/json3.testfile
  stable/12/contrib/file/tests/regex-eol.magic
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.magic
  stable/12/contrib/file/tests/regex-eol.result
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.result
  stable/12/contrib/file/tests/regex-eol.testfile
 - copied unchanged from r354595, head/contrib/file/tests/regex-eol.testfile
  stable/12/contrib/file/tests/zstd-3-skippable-frames.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-3-skippable-frames.result
  stable/12/contrib/file/tests/zstd-dictionary-0.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-0.result
  stable/12/contrib/file/tests/zstd-dictionary-1.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-1.result
  stable/12/contrib/file/tests/zstd-dictionary-2.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-dictionary-2.result
  stable/12/contrib/file/tests/zstd-skippable-frame-0.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-0.result
  stable/12/contrib/file/tests/zstd-skippable-frame-4.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-4.result
  stable/12/contrib/file/tests/zstd-skippable-frame-8.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-8.result
  stable/12/contrib/file/tests/zstd-skippable-frame-C.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-skippable-frame-C.result
  stable/12/contrib/file/tests/zstd-v0.2-FF.result
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-v0.2-FF.result
  stable/12/contrib/file/tests/zstd-v0.2-FF.testfile
 - copied unchanged from r354595, 
head/contrib/file/tests/zstd-

Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Li-Wen Hsu
Thanks for the fixes and sorry for the breakage.

While others might work on more proper fixes. Does it make sense to
have the attached patch to fix riscv* build?

BTW, ${LINKER_TYPE} == "bfd" seems causing failure in the clean stage,
that's why it didn't be caught in my test and CI, they have
"-DNO_CLEAN"

Li-Wen
Index: usr.sbin/jail/Makefile
===
--- usr.sbin/jail/Makefile	(revision 354935)
+++ usr.sbin/jail/Makefile	(working copy)
@@ -15,6 +15,13 @@
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}
 
+# workaround for riscv* with GNU ld (GNU Binutils) 2.33.1:
+#   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
+# https://bugs.freebsd.org/242109
+.if ${MACHINE_CPUARCH:Mriscv*}
+CFLAGS+=-Wl,--no-relax
+.endif
+
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354937 - head/share/man/man7

2019-11-20 Thread Warner Losh
Author: imp
Date: Thu Nov 21 06:48:30 2019
New Revision: 354937
URL: https://svnweb.freebsd.org/changeset/base/354937

Log:
  Include MACHINE in the which variable selection to use section.

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Nov 21 06:44:19 2019(r354936)
+++ head/share/man/man7/arch.7  Thu Nov 21 06:48:30 2019(r354937)
@@ -347,13 +347,17 @@ Unless the make variable
 is defined, make universe will not build mips, powerpc, nor sparc64
 architectures unless the xtoolchain binaries have been installed for
 the architecture.
-.Ss MACHINE_ARCH vs MACHINE_CPUARCH
+.Ss MACHINE_ARCH vs MACHINE_CPUARCH vs MACHINE
 .Dv MACHINE_CPUARCH
 should be preferred in Makefiles when the generic
 architecture is being tested.
 .Dv MACHINE_ARCH
 should be preferred when there is something specific to a particular type of
 architecture where there is a choice of many, or could be a choice of many.
+Use
+.Dv MACHINE
+when referring to the kernel, interfaces dependent on a specific type of kernel
+or similar things like boot sequences.
 .Bl -column -offset indent "Dv MACHINE" "Dv MACHINE_CPUARCH" "Dv MACHINE_ARCH"
 .It Dv MACHINE Ta Dv MACHINE_CPUARCH Ta Dv MACHINE_ARCH
 .It arm64 Ta aarch64 Ta aarch64
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 11:19 PM Dimitry Andric  wrote:

> Yes, such a table would be extremely helpful. :)
>

Yes. Committed. Great idea. Committed with some verbage about which one to
use to.

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


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
I write:

> jhb writes:
>
>> With PC-98 removed, I don't think we have any cases where MACHINE !=
>> MACHINE_CPUARCH now?
>>
>
> Well, there's arm64 / aarch64.
>

And riscv / riscv64.

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


svn commit: r354936 - head/share/man/man7

2019-11-20 Thread Warner Losh
Author: imp
Date: Thu Nov 21 06:44:19 2019
New Revision: 354936
URL: https://svnweb.freebsd.org/changeset/base/354936

Log:
  Add table for MACHINE_CPUARCH
  
  Add table and also some additional verbage of which one to use.

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Nov 21 04:12:08 2019(r354935)
+++ head/share/man/man7/arch.7  Thu Nov 21 06:44:19 2019(r354936)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 7, 2019
+.Dd November 20, 2019
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -347,6 +347,24 @@ Unless the make variable
 is defined, make universe will not build mips, powerpc, nor sparc64
 architectures unless the xtoolchain binaries have been installed for
 the architecture.
+.Ss MACHINE_ARCH vs MACHINE_CPUARCH
+.Dv MACHINE_CPUARCH
+should be preferred in Makefiles when the generic
+architecture is being tested.
+.Dv MACHINE_ARCH
+should be preferred when there is something specific to a particular type of
+architecture where there is a choice of many, or could be a choice of many.
+.Bl -column -offset indent "Dv MACHINE" "Dv MACHINE_CPUARCH" "Dv MACHINE_ARCH"
+.It Dv MACHINE Ta Dv MACHINE_CPUARCH Ta Dv MACHINE_ARCH
+.It arm64 Ta aarch64 Ta aarch64
+.It amd64 Ta amd64 Ta amd64
+.It arm Ta arm Ta arm, armv6, armv7
+.It i386 Ta i386 Ta i386
+.It mips Ta mips Ta mips, mipsel, mips64, mips64el, mipshf, mipselhf, 
mips64elhf, mipsn32
+.It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64
+.It riscv Ta riscv Ta riscv64, riscv64sf
+.It sparc64 Ta sparc64 Ta sparc64
+.El
 .Ss Predefined Macros
 The compiler provides a number of predefined macros.
 Some of these provide architecture-specific details and are explained below.
@@ -473,6 +491,8 @@ There is no standard name for the processor: each OS s
 conventions.
 .It Dv MACHINE_CPUARCH Represents the source location for a given
 .Dv MACHINE_ARCH .
+It is generally the common prefix for all the MACHINE_ARCH that
+share the same implementation, though 'riscv' breaks this rule.
 For example,
 .Dv MACHINE_CPUARCH
 is defined to be mips for all the flavors of mips that we support
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354922 - in head: etc libexec/rc libexec/rc/rc.d share/man/man5 sys/sys

2019-11-20 Thread Alexey Dokuchaev
On Wed, Nov 20, 2019 at 11:45:31PM +, Warner Losh wrote:
> New Revision: 354922
> URL: https://svnweb.freebsd.org/changeset/base/354922
> 
> Log:
>   Create /etc/os-release file.
>   
>   Each boot, regenerate /var/run/os-release based on the currently
>   running system. Create a /etc/os-release symlink pointing to this
>   file (so that this doesn't create a new reason /etc can not be
>   mounted read-only).
>   
>   This is compatible with what other systems do and is what the
>   sysutil/os-release port attempted to do, but in an incomplete way.

Thanks!  Hopefully, `sysutil/os-release' can be wiped out soon: not
just it was placed under wrong category, but it was badly and quite
unreadably coded.

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


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 11:19 PM Dimitry Andric  wrote:

> On 21 Nov 2019, at 01:44, John Baldwin  wrote:
> >
> > On 11/20/19 3:42 PM, Bjoern A. Zeeb wrote:
> >> On 20 Nov 2019, at 23:32, John Baldwin wrote:
> ...
> >> You can however find more of these elsewhere:
> >>
> >> ../lib/libc/tests/sys/Makefile:.if ${MACHINE_CPUARCH} != "aarch64" &&
> >> ${MACHINE_CPUARCH} != "riscv"
> >> ../lib/libcompiler_rt/Makefile.inc:.if ${MACHINE_CPUARCH} == "aarch64"
> >> || ${MACHINE_CPUARCH} == "riscv"
> >> ../stand/libsa/Makefile:.if ${MACHINE_CPUARCH} == "aarch64" ||
> >> ${MACHINE_CPUARCH} == "riscv"
> >> ../usr.bin/Makefile:.if ${MACHINE_ARCH} != "aarch64" &&
> >> ${MACHINE_CPUARCH} != "riscv"
> >> ../usr.bin/gprof/Makefile:.if ${MACHINE_ARCH} != "aarch64" &&
> >> ${MACHINE_ARCH} != "riscv" && \
> >
> > The tests comparing MACHINE_CPUARCH against aarch64 are confusing indeed.
> > My understanding is that MACHINE_CPUARCH is arm64 for aarch64?  It's kind
> > of hard to guess since arch(7) goes to great length to try to describe
> > these variables but doesn't give a handy table of what they actually are
> > for the various architectures.
>
> Yes, such a table would be extremely helpful. :)
>

Fair point. It does go on at length for all the MACHINE_ARCH types, but
doesn't list the plain MACHINE_CPUARCH. In all cases, it is either the one
MACHINE_ARCH supported, or the common prefix of all the MACHINE_ARCH
supported (though when we delete armv5, that will become slightly
inaccurate, so a table is likely good).

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


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 4:32 PM John Baldwin  wrote:

> On 11/20/19 3:04 PM, Warner Losh wrote:
> > On Wed, Nov 20, 2019 at 3:09 PM John Baldwin  wrote:
> >
> >> On 11/20/19 10:01 AM, Warner Losh wrote:
> >>> On Wed, Nov 20, 2019 at 9:54 AM Li-Wen Hsu  wrote:
> >>>
>  Author: lwhsu
>  Date: Wed Nov 20 16:54:21 2019
>  New Revision: 354900
>  URL: https://svnweb.freebsd.org/changeset/base/354900
> 
>  Log:
>    Use the correct variable, also limit the scope to bfd
> 
>    PR:   242109
>    Reported by:  jhb
>    Sponsored by: The FreeBSD Foundation
> 
>  Modified:
>    head/usr.sbin/jail/Makefile
> 
>  Modified: head/usr.sbin/jail/Makefile
> 
> 
> >>
> ==
>  --- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019
> >> (r354899)
>  +++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019
> >> (r354900)
>  @@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
>   # workaround for GNU ld (GNU Binutils) 2.33.1:
>   #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
>   # https://bugs.freebsd.org/242109
>  -.if ${MACHINE_ARCH} == "riscv"
>  +.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
> 
> >>>
> >>> MACHINE isn't the right thing to use here. It's never the proper thing
> in
> >>> userland makefiles, unless they are interfacing with the kernel.
> >>>
> >>> MACHINE_CPUARCH is what you want here.
> >>
> >> Eh, that claim doesn't seem quite true.  src.opts.mk only uses MACHINE
> >> and not
> >> MACHINE_CPUARCH for example (to set _TT that is then used all over the
> >> place in src.opts.mk).  My experience is that uses of *_CPUARCH are in
> >> fact
> >> pretty rare.
> >>
> >
> > However, __TT is used bogusly in many places in src.opts.mk. They are
> all
> > relatively new related to llvm (and one for google test). MACHINE has
> > always been for the kernel and MACHINE_ARCH for userland. MACHINE_CPUARCH
> > was created for those architectures where we have a number of
> MACHINE_ARCH
> > to make things easier to cope with.
> >
> > I've done several sweeps of the tree over the years to keep this
> enforced,
> > so I'm quite sure of the dichotomy...
>
> Here are some to fix then: :)
>
> sbin/reboot/Makefile:.if exists(${.CURDIR}/boot_${MACHINE}.8)
> sbin/reboot/Makefile:MAN+=  boot_${MACHINE}.8
> sbin/reboot/Makefile:MLINKS+= boot_${MACHINE}.8 boot.8
> sbin/reboot/Makefile:.if ${MACHINE} == "amd64"
> usr.sbin/bsdinstall/partedit/Makefile:PARTEDIT_ARCH= ${MACHINE}
> usr.sbin/bsdinstall/partedit/Makefile:.if ${MACHINE} == "i386" ||
> ${MACHINE} == "amd64"
> usr.sbin/pkg/Makefile:.  if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
>

I'm not sure these are wrong... reboot is based on the kernel we're
running, though. partedit is based on what kind of partition scheme the
kernel wants. pkg is just wrong, though.  Traditionally in BSD, different
ways of booting usually went hand and hand with needing different kernels.
Though after BSD passed from mini/micro computers where this was true into
embedded things got blurrier. Likewise with the partitioning schemes: those
used to be different for every type of computer, but now have standardized
around GPT with a few legacy systems like MBR and APM lingering on. BSD
labels were originally invented to have a standard way to label a disk, but
even that grew a lot of variations.


> This one also seems dubious, but in a different way:
>
> usr.bin/Makefile:
>
> # ARM64TODO gprof does not build
> # RISCVTODO gprof does not build
> .if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
> SUBDIR.${MK_TOOLCHAIN}+=gprof
> .endif
>

Yes. That's likely incorrect.
> Somewhat exacerbated by the whole aarch64 vs arm64 thing and probably
confusion on when to use CPUARCH vs ARCH.

When I invented CPUARCH, I didn't make it as clean as I'd like. It's always
for 'what directory do we use in the tree' and is also convenient for other
things. It was thought you'd use CPUARCH when you are testing generically
for an arch. You'd use MACHINE_ARCH when you needed a specific one (so both
of these should be MACHINE_CPUARCH). The notion was you'd only need to use
MACHINE_ARCH rarely in ifdefs and usually only inside of system-wide .mk
files.


> BTW, MACHINE_ARCH seems to matter just as much for the kernel.  64-bit
> mips runs a "mips64" kernel, not a "mips" kernel.
>

It does.

With PC-98 removed, I don't think we have any cases where MACHINE !=
> MACHINE_CPUARCH now?
>

Well, there's arm64 / aarch64.

I'm not at all opposed to changing the definitions, but they are what I've
been saying. I've done a lot of cleanup of mis-uses over the last 10 or 15
years, so these characterizations are correct. I'll admit I've done not the
best job at documenting it, though. Coming up with new definitions is
fraught, I'd think, since it's easy to have a notion of what the right
thing is, but har

Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Dimitry Andric
On 21 Nov 2019, at 01:44, John Baldwin  wrote:
> 
> On 11/20/19 3:42 PM, Bjoern A. Zeeb wrote:
>> On 20 Nov 2019, at 23:32, John Baldwin wrote:
...
>> You can however find more of these elsewhere:
>> 
>> ../lib/libc/tests/sys/Makefile:.if ${MACHINE_CPUARCH} != "aarch64" &&
>> ${MACHINE_CPUARCH} != "riscv"
>> ../lib/libcompiler_rt/Makefile.inc:.if ${MACHINE_CPUARCH} == "aarch64"
>> || ${MACHINE_CPUARCH} == "riscv"
>> ../stand/libsa/Makefile:.if ${MACHINE_CPUARCH} == "aarch64" ||
>> ${MACHINE_CPUARCH} == "riscv"
>> ../usr.bin/Makefile:.if ${MACHINE_ARCH} != "aarch64" &&
>> ${MACHINE_CPUARCH} != "riscv"
>> ../usr.bin/gprof/Makefile:.if ${MACHINE_ARCH} != "aarch64" &&
>> ${MACHINE_ARCH} != "riscv" && \
> 
> The tests comparing MACHINE_CPUARCH against aarch64 are confusing indeed.
> My understanding is that MACHINE_CPUARCH is arm64 for aarch64?  It's kind
> of hard to guess since arch(7) goes to great length to try to describe
> these variables but doesn't give a handy table of what they actually are
> for the various architectures.

Yes, such a table would be extremely helpful. :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r354934 - head/sys/arm/conf

2019-11-20 Thread Ravi Pokala
-Original Message-
From:  on behalf of Ed Maste 

Date: 2019-11-20, Wednesday at 19:10
To: , , 

Subject: svn commit: r354934 - head/sys/arm/conf

Author: emaste
Date: Thu Nov 21 03:10:02 2019
New Revision: 354934
URL: https://svnweb.freebsd.org/changeset/base/354934

Log:
  mark arm.arm (v4/v5) kernels as NO_UNIVERSE for now
  
  r354290 removed arm.arm from universe, but arm.arm kernels were still
  found and built during the kernel stage.  I'm not aware of a better way
  to address this at the moment, but since there aren't many arm.arm
  kernels anyhow just add an explicit NO_UNIVERSE to them.
  
  Reported by:  rpokala

Thanks Ed!

-Ravi

Modified:
  head/sys/arm/conf/DB-78XXX
  head/sys/arm/conf/DB-88F5XXX
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/RT1310
  head/sys/arm/conf/TS7800

Modified: head/sys/arm/conf/DB-78XXX

==
--- head/sys/arm/conf/DB-78XXX  Thu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/DB-78XXX  Thu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F78XX
 include"std.arm"

Modified: head/sys/arm/conf/DB-88F5XXX

==
--- head/sys/arm/conf/DB-88F5XXXThu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/DB-88F5XXXThu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F5XXX
 include"std.arm"

Modified: head/sys/arm/conf/DB-88F6XXX

==
--- head/sys/arm/conf/DB-88F6XXXThu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/DB-88F6XXXThu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F6XXX
 include"std.arm"

Modified: head/sys/arm/conf/RT1310

==
--- head/sys/arm/conf/RT1310Thu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/RT1310Thu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  RT1310
 include"std.arm"

Modified: head/sys/arm/conf/TS7800

==
--- head/sys/arm/conf/TS7800Thu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/TS7800Thu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  TS7800
 include"std.arm"



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


svn commit: r354935 - head/usr.sbin/jail

2019-11-20 Thread Glen Barber
Author: gjb
Date: Thu Nov 21 04:12:08 2019
New Revision: 354935
URL: https://svnweb.freebsd.org/changeset/base/354935

Log:
  Revert r354896, r354899, r354900:
   Fix build.
  
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  head/usr.sbin/jail/Makefile

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Thu Nov 21 03:10:02 2019(r354934)
+++ head/usr.sbin/jail/Makefile Thu Nov 21 04:12:08 2019(r354935)
@@ -15,13 +15,6 @@ NO_WMISSING_VARIABLE_DECLARATIONS=
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}
 
-# workaround for GNU ld (GNU Binutils) 2.33.1:
-#   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
-# https://bugs.freebsd.org/242109
-.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
-CFLAGS+=-Wl,--no-relax
-.endif
-
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354934 - head/sys/arm/conf

2019-11-20 Thread Ed Maste
Author: emaste
Date: Thu Nov 21 03:10:02 2019
New Revision: 354934
URL: https://svnweb.freebsd.org/changeset/base/354934

Log:
  mark arm.arm (v4/v5) kernels as NO_UNIVERSE for now
  
  r354290 removed arm.arm from universe, but arm.arm kernels were still
  found and built during the kernel stage.  I'm not aware of a better way
  to address this at the moment, but since there aren't many arm.arm
  kernels anyhow just add an explicit NO_UNIVERSE to them.
  
  Reported by:  rpokala

Modified:
  head/sys/arm/conf/DB-78XXX
  head/sys/arm/conf/DB-88F5XXX
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/RT1310
  head/sys/arm/conf/TS7800

Modified: head/sys/arm/conf/DB-78XXX
==
--- head/sys/arm/conf/DB-78XXX  Thu Nov 21 02:49:41 2019(r354933)
+++ head/sys/arm/conf/DB-78XXX  Thu Nov 21 03:10:02 2019(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F78XX
 include"std.arm"

Modified: head/sys/arm/conf/DB-88F5XXX
==
--- head/sys/arm/conf/DB-88F5XXXThu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/DB-88F5XXXThu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F5XXX
 include"std.arm"

Modified: head/sys/arm/conf/DB-88F6XXX
==
--- head/sys/arm/conf/DB-88F6XXXThu Nov 21 02:49:41 2019
(r354933)
+++ head/sys/arm/conf/DB-88F6XXXThu Nov 21 03:10:02 2019
(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  DB-88F6XXX
 include"std.arm"

Modified: head/sys/arm/conf/RT1310
==
--- head/sys/arm/conf/RT1310Thu Nov 21 02:49:41 2019(r354933)
+++ head/sys/arm/conf/RT1310Thu Nov 21 03:10:02 2019(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  RT1310
 include"std.arm"

Modified: head/sys/arm/conf/TS7800
==
--- head/sys/arm/conf/TS7800Thu Nov 21 02:49:41 2019(r354933)
+++ head/sys/arm/conf/TS7800Thu Nov 21 03:10:02 2019(r354934)
@@ -3,6 +3,7 @@
 #
 # $FreeBSD$
 #
+#NO_UNIVERSE
 
 ident  TS7800
 include"std.arm"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354933 - head/sys/arm/broadcom/bcm2835

2019-11-20 Thread Kyle Evans
Author: kevans
Date: Thu Nov 21 02:49:41 2019
New Revision: 354933
URL: https://svnweb.freebsd.org/changeset/base/354933

Log:
  bcm2835_sdhci: clean up DMA segments in error handling path
  
  Later parts assume that this would've been done if interrupts are enabled,
  but this is the only case in which that wouldn't have been true. This commit
  also reorders operations such that we're done touching slot/slot->intmask
  before we call back into the SDHCI framework and exit.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:47:55 
2019(r354932)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:49:41 
2019(r354933)
@@ -607,6 +607,25 @@ bcm_sdhci_dma_exit(struct bcm_sdhci_softc *sc)
 }
 
 static void
+bcm_sdhci_dma_unload(struct bcm_sdhci_softc *sc)
+{
+   struct sdhci_slot *slot = &sc->sc_slot;
+
+   if (sc->dmamap_seg_count == 0)
+   return;
+   if ((slot->curcmd->data->flags & MMC_DATA_READ) != 0)
+   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
+   BUS_DMASYNC_POSTREAD);
+   else
+   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
+   BUS_DMASYNC_POSTWRITE);
+   bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map);
+
+   sc->dmamap_seg_count = 0;
+   sc->dmamap_seg_index = 0;
+}
+
+static void
 bcm_sdhci_dma_intr(int ch, void *arg)
 {
struct bcm_sdhci_softc *sc = (struct bcm_sdhci_softc *)arg;
@@ -626,19 +645,8 @@ bcm_sdhci_dma_intr(int ch, void *arg)
goto out;
}
 
-   if (sc->dmamap_seg_count == 0)
-   return;
-   if ((slot->curcmd->data->flags & MMC_DATA_READ) != 0)
-   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
-   BUS_DMASYNC_POSTREAD);
-   else
-   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
-   BUS_DMASYNC_POSTWRITE);
-   bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map);
+   bcm_sdhci_dma_unload(sc);
 
-   sc->dmamap_seg_count = 0;
-   sc->dmamap_seg_index = 0;
-
/*
 * If we had no further segments pending, we need to determine how to
 * proceed next.  If the 'data/space pending' bit is already set and we
@@ -654,8 +662,10 @@ bcm_sdhci_dma_intr(int ch, void *arg)
 
bcm_sdhci_start_dma(slot);
if (slot->curcmd->error != 0) {
-   sdhci_finish_data(slot);
+   /* We won't recover from this error for this command. */
+   bcm_sdhci_dma_unload(sc);
bcm_sdhci_dma_exit(sc);
+   sdhci_finish_data(slot);
}
} else if ((reg & SDHCI_INT_DATA_END) != 0) {
bcm_sdhci_dma_exit(sc);
@@ -754,16 +764,7 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
 * regressed to SDHCI-driven PIO to finish the operation and
 * this is certainly caused by developer-error.
 */
-   if (slot->curcmd->data->flags & MMC_DATA_READ)
-   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
-   BUS_DMASYNC_POSTREAD);
-   else
-   bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
-   BUS_DMASYNC_POSTWRITE);
-   bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map);
-
-   sc->dmamap_seg_count = 0;
-   sc->dmamap_seg_index = 0;
+   bcm_sdhci_dma_unload(sc);
}
 
sdhci_finish_data(slot);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354932 - head/sys/arm/broadcom/bcm2835

2019-11-20 Thread Kyle Evans
Author: kevans
Date: Thu Nov 21 02:47:55 2019
New Revision: 354932
URL: https://svnweb.freebsd.org/changeset/base/354932

Log:
  bcm2835_sdhci: roll back r354823
  
  r354823 kicked DATA_END handling out of the DMA interrupt path "to make
  things easy", but this was likely a mistake -- if we know we're done after
  we've finished pending DMA operations, we should go ahead and acknowledge
  it rather than waiting for the controller to finalize it. If it's not ready,
  we'll simply re-enable interrupts and wait for it anyways, to be re-entered
  in sdhci_data_intr.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:44:05 
2019(r354931)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:47:55 
2019(r354932)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
rounddown(BCM_SDHCI_SLOT_LEFT(slot), BCM_SDHCI_BUFFER_SIZE))
 
 #defineDATA_PENDING_MASK   (SDHCI_INT_DATA_AVAIL | 
SDHCI_INT_SPACE_AVAIL)
+#defineDATA_XFER_MASK  (DATA_PENDING_MASK | SDHCI_INT_DATA_END)
 
 #ifdef DEBUG
 static int bcm2835_sdhci_debug = 0;
@@ -579,7 +580,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc)
if (idx == 0) {
bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op);
 
-   slot->intmask &= ~DATA_PENDING_MASK;
+   slot->intmask &= ~DATA_XFER_MASK;
bcm_sdhci_write_4(sc->sc_dev, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
}
@@ -600,7 +601,7 @@ bcm_sdhci_dma_exit(struct bcm_sdhci_softc *sc)
mtx_assert(&slot->mtx, MA_OWNED);
 
/* Re-enable interrupts */
-   slot->intmask |= DATA_PENDING_MASK;
+   slot->intmask |= DATA_XFER_MASK;
bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
 }
@@ -625,6 +626,8 @@ bcm_sdhci_dma_intr(int ch, void *arg)
goto out;
}
 
+   if (sc->dmamap_seg_count == 0)
+   return;
if ((slot->curcmd->data->flags & MMC_DATA_READ) != 0)
bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
BUS_DMASYNC_POSTREAD);
@@ -654,6 +657,12 @@ bcm_sdhci_dma_intr(int ch, void *arg)
sdhci_finish_data(slot);
bcm_sdhci_dma_exit(sc);
}
+   } else if ((reg & SDHCI_INT_DATA_END) != 0) {
+   bcm_sdhci_dma_exit(sc);
+   bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS,
+   reg);
+   slot->flags &= ~PLATFORM_DATA_STARTED;
+   sdhci_finish_data(slot);
} else {
bcm_sdhci_dma_exit(sc);
}
@@ -732,7 +741,11 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
 {
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
 
-   /* Clean up */
+   /*
+* Clean up.  Interrupts are clearly enabled, because we received an
+* SDHCI_INT_DATA_END to get this far -- just make sure we don't leave
+* anything laying around.
+*/
if (sc->dmamap_seg_count != 0) {
/*
 * Our segment math should have worked out such that we would
@@ -753,7 +766,6 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
sc->dmamap_seg_index = 0;
}
 
-   bcm_sdhci_dma_exit(sc);
sdhci_finish_data(slot);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354931 - head/sys/arm/broadcom/bcm2835

2019-11-20 Thread Kyle Evans
Author: kevans
Date: Thu Nov 21 02:44:05 2019
New Revision: 354931
URL: https://svnweb.freebsd.org/changeset/base/354931

Log:
  Revert r354930: wrong diff, right message.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:41:22 
2019(r354930)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:44:05 
2019(r354931)
@@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$");
rounddown(BCM_SDHCI_SLOT_LEFT(slot), BCM_SDHCI_BUFFER_SIZE))
 
 #defineDATA_PENDING_MASK   (SDHCI_INT_DATA_AVAIL | 
SDHCI_INT_SPACE_AVAIL)
-#defineDATA_XFER_MASK  (DATA_PENDING_MASK | SDHCI_INT_DATA_END)
 
 #ifdef DEBUG
 static int bcm2835_sdhci_debug = 0;
@@ -580,7 +579,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc)
if (idx == 0) {
bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op);
 
-   slot->intmask &= ~DATA_XFER_MASK;
+   slot->intmask &= ~DATA_PENDING_MASK;
bcm_sdhci_write_4(sc->sc_dev, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
}
@@ -601,7 +600,7 @@ bcm_sdhci_dma_exit(struct bcm_sdhci_softc *sc)
mtx_assert(&slot->mtx, MA_OWNED);
 
/* Re-enable interrupts */
-   slot->intmask |= DATA_XFER_MASK;
+   slot->intmask |= DATA_PENDING_MASK;
bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
 }
@@ -655,12 +654,6 @@ bcm_sdhci_dma_intr(int ch, void *arg)
sdhci_finish_data(slot);
bcm_sdhci_dma_exit(sc);
}
-   } else if ((reg & SDHCI_INT_DATA_END) != 0) {
-   bcm_sdhci_dma_exit(sc);
-   bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS,
-   reg);
-   slot->flags &= ~PLATFORM_DATA_STARTED;
-   sdhci_finish_data(slot);
} else {
bcm_sdhci_dma_exit(sc);
}
@@ -739,11 +732,7 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
 {
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
 
-   /*
-* Clean up.  Interrupts are clearly enabled, because we received an
-* SDHCI_INT_DATA_END to get this far -- just make sure we don't leave
-* anything laying around.
-*/
+   /* Clean up */
if (sc->dmamap_seg_count != 0) {
/*
 * Our segment math should have worked out such that we would
@@ -764,6 +753,7 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
sc->dmamap_seg_index = 0;
}
 
+   bcm_sdhci_dma_exit(sc);
sdhci_finish_data(slot);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354930 - head/sys/arm/broadcom/bcm2835

2019-11-20 Thread Kyle Evans
Author: kevans
Date: Thu Nov 21 02:41:22 2019
New Revision: 354930
URL: https://svnweb.freebsd.org/changeset/base/354930

Log:
  bcm2835_sdhci: clean up DMA segments in error handling path
  
  Later parts assume that this would've been done if interrupts are enabled,
  but this is the only case in which that wouldn't have been true. This commit
  also reorders operations such that we're done touching slot/slot->intmask
  before we call back into the SDHCI framework and exit.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 01:24:49 
2019(r354929)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Nov 21 02:41:22 
2019(r354930)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
rounddown(BCM_SDHCI_SLOT_LEFT(slot), BCM_SDHCI_BUFFER_SIZE))
 
 #defineDATA_PENDING_MASK   (SDHCI_INT_DATA_AVAIL | 
SDHCI_INT_SPACE_AVAIL)
+#defineDATA_XFER_MASK  (DATA_PENDING_MASK | SDHCI_INT_DATA_END)
 
 #ifdef DEBUG
 static int bcm2835_sdhci_debug = 0;
@@ -579,7 +580,7 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc)
if (idx == 0) {
bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op);
 
-   slot->intmask &= ~DATA_PENDING_MASK;
+   slot->intmask &= ~DATA_XFER_MASK;
bcm_sdhci_write_4(sc->sc_dev, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
}
@@ -600,7 +601,7 @@ bcm_sdhci_dma_exit(struct bcm_sdhci_softc *sc)
mtx_assert(&slot->mtx, MA_OWNED);
 
/* Re-enable interrupts */
-   slot->intmask |= DATA_PENDING_MASK;
+   slot->intmask |= DATA_XFER_MASK;
bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE,
slot->intmask);
 }
@@ -654,6 +655,12 @@ bcm_sdhci_dma_intr(int ch, void *arg)
sdhci_finish_data(slot);
bcm_sdhci_dma_exit(sc);
}
+   } else if ((reg & SDHCI_INT_DATA_END) != 0) {
+   bcm_sdhci_dma_exit(sc);
+   bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS,
+   reg);
+   slot->flags &= ~PLATFORM_DATA_STARTED;
+   sdhci_finish_data(slot);
} else {
bcm_sdhci_dma_exit(sc);
}
@@ -732,7 +739,11 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
 {
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
 
-   /* Clean up */
+   /*
+* Clean up.  Interrupts are clearly enabled, because we received an
+* SDHCI_INT_DATA_END to get this far -- just make sure we don't leave
+* anything laying around.
+*/
if (sc->dmamap_seg_count != 0) {
/*
 * Our segment math should have worked out such that we would
@@ -753,7 +764,6 @@ bcm_sdhci_finish_transfer(device_t dev, struct sdhci_s
sc->dmamap_seg_index = 0;
}
 
-   bcm_sdhci_dma_exit(sc);
sdhci_finish_data(slot);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Glen Barber
On Wed, Nov 20, 2019 at 04:44:58PM -0800, John Baldwin wrote:
> On 11/20/19 3:42 PM, Bjoern A. Zeeb wrote:
> > On 20 Nov 2019, at 23:32, John Baldwin wrote:
> > 
> > Hijacking a side-thread:
> > 
> > PreS: I think we have way too many of these options and should just 
> > remove 3/4 of them again or someone build a proper matrix documenting 
> > them all and in which case to use in the developers handbook ;-)
> > 
> >> This one also seems dubious, but in a different way:
> >>
> >> usr.bin/Makefile:
> >>
> >> # ARM64TODO gprof does not build
> >> # RISCVTODO gprof does not build
> >> .if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
> >> SUBDIR.${MK_TOOLCHAIN}+=gprof
> >> .endif
> >>
> >> Somewhat exacerbated by the whole aarch64 vs arm64 thing and probably
> >> confusion on when to use CPUARCH vs ARCH.
> > 
> > This particular case could actually be removed as I thought I made that 
> > at least compile when I was working on s390x:
> > https://svnweb.freebsd.org/base?view=revision&revision=351329
> > 
> > 
> > You can however find more of these elsewhere:
> > 
> > ../lib/libc/tests/sys/Makefile:.if ${MACHINE_CPUARCH} != "aarch64" && 
> > ${MACHINE_CPUARCH} != "riscv"
> > ../lib/libcompiler_rt/Makefile.inc:.if ${MACHINE_CPUARCH} == "aarch64" 
> > || ${MACHINE_CPUARCH} == "riscv"
> > ../stand/libsa/Makefile:.if ${MACHINE_CPUARCH} == "aarch64" || 
> > ${MACHINE_CPUARCH} == "riscv"
> > ../usr.bin/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
> > ${MACHINE_CPUARCH} != "riscv"
> > ../usr.bin/gprof/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
> > ${MACHINE_ARCH} != "riscv" && \
> 
> The tests comparing MACHINE_CPUARCH against aarch64 are confusing indeed.
> My understanding is that MACHINE_CPUARCH is arm64 for aarch64?  It's kind
> of hard to guess since arch(7) goes to great length to try to describe
> these variables but doesn't give a handy table of what they actually are
> for the various architectures.
> 

This breaks the build, regardless.

 ===> usr.sbin/jail (cleandir)
 ===> usr.bin/procstat/tests (cleandir)
 make[4]: "/releng/13-amd64-GENERIC-snap/usr/src/usr.sbin/jail/Makefile" line 
21: Malformed conditional (${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv")
 ===> usr.bin/rctl (cleandir)
 make[4]: Fatal errors encountered -- cannot continue
 make[4]: stopped in /releng/13-amd64-GENERIC-snap/usr/src/usr.sbin/jail
 --- cleandir_subdir_usr.sbin/jail ---
 *** [cleandir_subdir_usr.sbin/jail] Error code 1

Glen



signature.asc
Description: PGP signature


svn commit: r354929 - in head: sbin/comcontrol sbin/conscontrol sbin/reboot share/man/man4 share/man/man5 sys/conf sys/dev/sio sys/modules/sio usr.sbin/watch

2019-11-20 Thread Gleb Smirnoff
Author: glebius
Date: Thu Nov 21 01:24:49 2019
New Revision: 354929
URL: https://svnweb.freebsd.org/changeset/base/354929

Log:
  Remove sio(4).
  It had been disconnected from build in r181233 in 2008.
  
  Reviewed by:  imp

Deleted:
  head/share/man/man4/sio.4
  head/sys/dev/sio/
  head/sys/modules/sio/
Modified:
  head/sbin/comcontrol/comcontrol.8
  head/sbin/conscontrol/conscontrol.8
  head/sbin/reboot/boot_i386.8
  head/share/man/man4/Makefile
  head/share/man/man4/rc.4
  head/share/man/man4/snp.4
  head/share/man/man5/device.hints.5
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/usr.sbin/watch/watch.8

Modified: head/sbin/comcontrol/comcontrol.8
==
--- head/sbin/comcontrol/comcontrol.8   Thu Nov 21 00:40:12 2019
(r354928)
+++ head/sbin/comcontrol/comcontrol.8   Thu Nov 21 01:24:49 2019
(r354929)
@@ -54,7 +54,6 @@ dialout devices
 .El
 .Sh SEE ALSO
 .Xr stty 1 ,
-.Xr sio 4
 .Sh HISTORY
 Originally part of cgd's com package patches, version 0.2.1, to
 .Bx 386 0.1 .

Modified: head/sbin/conscontrol/conscontrol.8
==
--- head/sbin/conscontrol/conscontrol.8 Thu Nov 21 00:40:12 2019
(r354928)
+++ head/sbin/conscontrol/conscontrol.8 Thu Nov 21 01:24:49 2019
(r354929)
@@ -101,7 +101,6 @@ This is an interface to the tty ioctl
 .Dv TIOCCONS .
 .El
 .Sh SEE ALSO
-.Xr sio 4 ,
 .Xr syscons 4 ,
 .Xr tty 4 ,
 .Xr vt 4 ,

Modified: head/sbin/reboot/boot_i386.8
==
--- head/sbin/reboot/boot_i386.8Thu Nov 21 00:40:12 2019
(r354928)
+++ head/sbin/reboot/boot_i386.8Thu Nov 21 01:24:49 2019
(r354929)
@@ -36,7 +36,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 30, 2019
+.Dd November 19, 2019
 .Dt BOOT 8 i386
 .Os
 .Sh NAME
@@ -223,15 +223,6 @@ you can use the
 .Fl h
 option to force the kernel to use the serial port as its
 console device.
-The serial port driver
-.Xr sio 4
-(but not
-.Xr uart 4 )
-has a flag (0x20) to override this option.
-If that flag is set, the serial port will always be used as the console,
-regardless of the
-.Fl h
-option described here.
 .It Fl m
 mute the console to suppress all kernel console input and output during the
 boot.

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Nov 21 00:40:12 2019
(r354928)
+++ head/share/man/man4/MakefileThu Nov 21 01:24:49 2019
(r354929)
@@ -461,7 +461,6 @@ MAN=aac.4 \
siftr.4 \
siis.4 \
simplebus.4 \
-   sio.4 \
sis.4 \
sk.4 \
${_smartpqi.4} \

Modified: head/share/man/man4/rc.4
==
--- head/share/man/man4/rc.4Thu Nov 21 00:40:12 2019(r354928)
+++ head/share/man/man4/rc.4Thu Nov 21 01:24:49 2019(r354929)
@@ -91,7 +91,6 @@ file can be consulted for more information.
 .Sh SEE ALSO
 .Xr tty 1 ,
 .Xr ttyname 3 ,
-.Xr sio 4 ,
 .Xr tty 4 ,
 .Xr device.hints 5 ,
 .Xr comcontrol 8 ,

Modified: head/share/man/man4/snp.4
==
--- head/share/man/man4/snp.4   Thu Nov 21 00:40:12 2019(r354928)
+++ head/share/man/man4/snp.4   Thu Nov 21 01:24:49 2019(r354929)
@@ -69,7 +69,6 @@ and detached.
 .El
 .Sh SEE ALSO
 .Xr pty 4 ,
-.Xr sio 4 ,
 .Xr kldload 8 ,
 .Xr watch 8
 .Sh HISTORY

Modified: head/share/man/man5/device.hints.5
==
--- head/share/man/man5/device.hints.5  Thu Nov 21 00:40:12 2019
(r354928)
+++ head/share/man/man5/device.hints.5  Thu Nov 21 01:24:49 2019
(r354929)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 23, 2015
+.Dd November 19, 2019
 .Dt DEVICE.HINTS 5
 .Os
 .Sh NAME
@@ -138,13 +138,13 @@ Notes on the kernel configuration file and device reso
 .El
 .Sh EXAMPLES
 The following example sets up resources for the
-.Xr sio 4
+.Xr uart 4
 driver on the ISA bus:
 .Bd -literal -offset indent
-hint.sio.0.at="isa"
-hint.sio.0.port="0x3F8"
-hint.sio.0.flags="0x10"
-hint.sio.0.irq="4"
+hint.uart.0.at="isa"
+hint.uart.0.port="0x3F8"
+hint.uart.0.flags="0x10"
+hint.uart.0.irq="4"
 .Ed
 .Pp
 The following example disables the ACPI driver:

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Thu Nov 21 00:40:12 2019(r354928)
+++ head/sys/conf/files.amd64   Thu Nov 21 01:24:49 2019(r354929)
@@ -300,11 +300,6 @@ dev/sfxge/sfxge_nvram.coptionalsfxge 
pci
 dev/sfxge/sfxge_port.c optionalsfxge pci
 dev/sfxge/sfxge_rx.c   optionalsfxge pci
 dev/sfxg

Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread John Baldwin
On 11/20/19 3:42 PM, Bjoern A. Zeeb wrote:
> On 20 Nov 2019, at 23:32, John Baldwin wrote:
> 
> Hijacking a side-thread:
> 
> PreS: I think we have way too many of these options and should just 
> remove 3/4 of them again or someone build a proper matrix documenting 
> them all and in which case to use in the developers handbook ;-)
> 
>> This one also seems dubious, but in a different way:
>>
>> usr.bin/Makefile:
>>
>> # ARM64TODO gprof does not build
>> # RISCVTODO gprof does not build
>> .if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
>> SUBDIR.${MK_TOOLCHAIN}+=gprof
>> .endif
>>
>> Somewhat exacerbated by the whole aarch64 vs arm64 thing and probably
>> confusion on when to use CPUARCH vs ARCH.
> 
> This particular case could actually be removed as I thought I made that 
> at least compile when I was working on s390x:
> https://svnweb.freebsd.org/base?view=revision&revision=351329
> 
> 
> You can however find more of these elsewhere:
> 
> ../lib/libc/tests/sys/Makefile:.if ${MACHINE_CPUARCH} != "aarch64" && 
> ${MACHINE_CPUARCH} != "riscv"
> ../lib/libcompiler_rt/Makefile.inc:.if ${MACHINE_CPUARCH} == "aarch64" 
> || ${MACHINE_CPUARCH} == "riscv"
> ../stand/libsa/Makefile:.if ${MACHINE_CPUARCH} == "aarch64" || 
> ${MACHINE_CPUARCH} == "riscv"
> ../usr.bin/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
> ${MACHINE_CPUARCH} != "riscv"
> ../usr.bin/gprof/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
> ${MACHINE_ARCH} != "riscv" && \

The tests comparing MACHINE_CPUARCH against aarch64 are confusing indeed.
My understanding is that MACHINE_CPUARCH is arm64 for aarch64?  It's kind
of hard to guess since arch(7) goes to great length to try to describe
these variables but doesn't give a handy table of what they actually are
for the various architectures.

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


svn commit: r354928 - in stable/12: lib/libc/gen sys/sys

2019-11-20 Thread Brooks Davis
Author: brooks
Date: Thu Nov 21 00:40:12 2019
New Revision: 354928
URL: https://svnweb.freebsd.org/changeset/base/354928

Log:
  MFC r354694, r354699
  
  r354694:
  elf_aux_info: Add support for AT_EXECPATH.
  
  Reviewed by:  emaste, sef
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D22353
  
  r354699:
  Improve the description of AT_EXECPATH availability.
  
  Reported by:  kib
  Sponsored by: DARPA, AFRL

Modified:
  stable/12/lib/libc/gen/auxv.3
  stable/12/lib/libc/gen/auxv.c
  stable/12/sys/sys/param.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/gen/auxv.3
==
--- stable/12/lib/libc/gen/auxv.3   Thu Nov 21 00:34:39 2019
(r354927)
+++ stable/12/lib/libc/gen/auxv.3   Thu Nov 21 00:40:12 2019
(r354928)
@@ -49,6 +49,12 @@ can be requested (corresponding buffer sizes are speci
 .It AT_CANARY
 The canary value for SSP (arbitrary sized buffer, as many bytes are
 returned as it fits into it, rest is zeroed).
+.It AT_EXECPATH
+The path of executed program
+.Dv (MAXPATHLEN).
+This may not be present if the process was initialized by
+.Xr fexecve 2
+and the namecache no longer contains the file's name.
 .It AT_HWCAP
 CPU / hardware feature flags
 .Dv (sizeof(u_long)).

Modified: stable/12/lib/libc/gen/auxv.c
==
--- stable/12/lib/libc/gen/auxv.c   Thu Nov 21 00:34:39 2019
(r354927)
+++ stable/12/lib/libc/gen/auxv.c   Thu Nov 21 00:40:12 2019
(r354928)
@@ -69,7 +69,7 @@ __init_elf_aux_vector(void)
 static pthread_once_t aux_once = PTHREAD_ONCE_INIT;
 static int pagesize, osreldate, canary_len, ncpus, pagesizes_len;
 static int hwcap_present, hwcap2_present;
-static char *canary, *pagesizes;
+static char *canary, *pagesizes, *execpath;
 static void *timekeep;
 static u_long hwcap, hwcap2;
 
@@ -88,6 +88,10 @@ init_aux(void)
canary_len = aux->a_un.a_val;
break;
 
+   case AT_EXECPATH:
+   execpath = (char *)(aux->a_un.a_ptr);
+   break;
+
case AT_HWCAP:
hwcap_present = 1;
hwcap = (u_long)(aux->a_un.a_val);
@@ -146,6 +150,18 @@ _elf_aux_info(int aux, void *buf, int buflen)
res = 0;
} else
res = ENOENT;
+   break;
+   case AT_EXECPATH:
+   if (execpath == NULL)
+   res = ENOENT;
+   else if (buf == NULL)
+   res = EINVAL;
+   else {
+   if (strlcpy(buf, execpath, buflen) >= buflen)
+   res = EINVAL;
+   else
+   res = 0;
+   }
break;
case AT_HWCAP:
if (hwcap_present && buflen == sizeof(u_long)) {

Modified: stable/12/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Thu Nov 21 00:34:39 2019(r354927)
+++ stable/12/sys/sys/param.h   Thu Nov 21 00:40:12 2019(r354928)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1201502  /* Master, propagated to newvers */
+#define __FreeBSD_version 1201503  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354927 - in stable/12: share/man/man4 sys/conf sys/contrib/dev/iwm sys/dev/iwm sys/modules/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm9000fw sys/modules/iwmfw/iwm9260fw

2019-11-20 Thread Mark Johnston
Author: markj
Date: Thu Nov 21 00:34:39 2019
New Revision: 354927
URL: https://svnweb.freebsd.org/changeset/base/354927

Log:
  MFC r354201, r354276, r354492-r354517, r354562:
  Add firmware images and support for Intel 9000-series devices.

Added:
  stable/12/sys/contrib/dev/iwm/iwm-9000-34.fw.uu
 - copied unchanged from r354276, head/sys/contrib/dev/iwm/iwm-9000-34.fw.uu
  stable/12/sys/contrib/dev/iwm/iwm-9260-34.fw.uu
 - copied unchanged from r354276, head/sys/contrib/dev/iwm/iwm-9260-34.fw.uu
  stable/12/sys/dev/iwm/if_iwm_9000.c
 - copied, changed from r354504, head/sys/dev/iwm/if_iwm_9000.c
  stable/12/sys/dev/iwm/if_iwm_9260.c
 - copied, changed from r354504, head/sys/dev/iwm/if_iwm_9260.c
  stable/12/sys/modules/iwmfw/iwm9000fw/
 - copied from r354201, head/sys/modules/iwmfw/iwm9000fw/
  stable/12/sys/modules/iwmfw/iwm9260fw/
 - copied from r354201, head/sys/modules/iwmfw/iwm9260fw/
Modified:
  stable/12/share/man/man4/iwm.4
  stable/12/share/man/man4/iwmfw.4
  stable/12/sys/conf/files
  stable/12/sys/dev/iwm/if_iwm.c
  stable/12/sys/dev/iwm/if_iwm_config.h
  stable/12/sys/dev/iwm/if_iwm_pcie_trans.c
  stable/12/sys/dev/iwm/if_iwm_pcie_trans.h
  stable/12/sys/dev/iwm/if_iwm_scan.c
  stable/12/sys/dev/iwm/if_iwm_sta.c
  stable/12/sys/dev/iwm/if_iwmreg.h
  stable/12/sys/dev/iwm/if_iwmvar.h
  stable/12/sys/modules/iwm/Makefile
  stable/12/sys/modules/iwmfw/Makefile
  stable/12/sys/modules/iwmfw/iwm9000fw/Makefile
  stable/12/sys/modules/iwmfw/iwm9260fw/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/iwm.4
==
--- stable/12/share/man/man4/iwm.4  Thu Nov 21 00:17:14 2019
(r354926)
+++ stable/12/share/man/man4/iwm.4  Thu Nov 21 00:34:39 2019
(r354927)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 29, 2017
+.Dd November 7, 2019
 .Dt IWM 4
 .Os
 .Sh NAME
@@ -51,6 +51,8 @@ Choose one from:
 .Cd "device iwm7265fw"
 .Cd "device iwm8000Cfw"
 .Cd "device iwm8265fw"
+.Cd "device iwm9000fw"
+.Cd "device iwm9260fw"
 .Ed
 .Pp
 Or you can use
@@ -71,6 +73,8 @@ iwm7260fw_load="YES"
 iwm7265fw_load="YES"
 iwm8000Cfw_load="YES"
 iwm8265fw_load="YES"
+iwm9000fw_load="YES"
+iwm9260fw_load="YES"
 .Ed
 .Sh DESCRIPTION
 The
@@ -84,6 +88,10 @@ driver provides support for:
 .It Intel Dual Band Wireless AC 7260
 .It Intel Dual Band Wireless AC 7265
 .It Intel Dual Band Wireless AC 8260
+.It Intel Dual Band Wireless AC 9260
+.It Intel Dual Band Wireless AC 9270
+.It Intel Dual Band Wireless AC 946X
+.It Intel Dual Band Wireless AC 9560
 .El
 .Pp
 .Nm

Modified: stable/12/share/man/man4/iwmfw.4
==
--- stable/12/share/man/man4/iwmfw.4Thu Nov 21 00:17:14 2019
(r354926)
+++ stable/12/share/man/man4/iwmfw.4Thu Nov 21 00:34:39 2019
(r354927)
@@ -22,7 +22,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 29, 2017
+.Dd November 7, 2019
 .Dt IWMFW 4
 .Os
 .Sh NAME
@@ -48,10 +48,12 @@ of the following:
 .Cd "device iwm7265fw"
 .Cd "device iwm8000Cfw"
 .Cd "device iwm8265fw"
+.Cd "device iwm9000fw"
+.Cd "device iwm9260fw"
 .Ed
 .Pp
 Alternatively, to load the driver as a
-module at boot time, place the following line in
+module at boot time, place one of the following lines in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 iwm3160fw_load="YES"
@@ -61,13 +63,14 @@ iwm7265fw_load="YES"
 iwm7265Dfw_load="YES"
 iwm8000Cfw_load="YES"
 iwm8265fw_load="YES"
+iwm9000fw_load="YES"
+iwm9260fw_load="YES"
 .Ed
 .Sh DESCRIPTION
 This module provides access to firmware sets for the
-Intel Dual Band Wireless WiFi 3160, 3165, 3168, 7260, 7265, 8000, and 8260 
series of
-IEEE 802.11n/11ac adapters.
-It may be
-statically linked into the kernel, or loaded as a module.
+Intel Dual Band Wireless WiFi 3160, 3165, 3168, 7260, 7265, 8000, 8260,
+9000 and 9260 series of IEEE 802.11n/11ac adapters.
+It may be statically linked into the kernel, or loaded as a module.
 .Sh SEE ALSO
 .Xr iwm 4 ,
 .Xr firmware 9

Modified: stable/12/sys/conf/files
==
--- stable/12/sys/conf/filesThu Nov 21 00:17:14 2019(r354926)
+++ stable/12/sys/conf/filesThu Nov 21 00:34:39 2019(r354927)
@@ -1989,6 +1989,8 @@ iwi_monitor.fwoptional iwimonitorfw | 
iwifw   \
 dev/iwm/if_iwm.c   optional iwm
 dev/iwm/if_iwm_7000.c  optional iwm
 dev/iwm/if_iwm_8000.c  optional iwm
+dev/iwm/if_iwm_9000.c  optional iwm
+dev/iwm/if_iwm_9260.c  optional iwm
 dev/iwm/if_iwm_binding.c   optional iwm
 dev/iwm/if_iwm_fw.coptional iwm
 dev/iwm/if_iwm_led.c   optional iwm

Copied: stable/12/sys/contrib/dev/iwm/iwm-9000-34.fw.uu (from r354276, 
head/sys/contrib/dev/iwm/iwm-9000-34.fw.uu)
=

svn commit: r354926 - head/usr.sbin/rtsold

2019-11-20 Thread Mark Johnston
Author: markj
Date: Thu Nov 21 00:17:14 2019
New Revision: 354926
URL: https://svnweb.freebsd.org/changeset/base/354926

Log:
  Avoid relying on pollution from libcasper.h.
  
  Reported by:  sjg
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/rtsold/cap_llflags.c

Modified: head/usr.sbin/rtsold/cap_llflags.c
==
--- head/usr.sbin/rtsold/cap_llflags.c  Wed Nov 20 23:58:36 2019
(r354925)
+++ head/usr.sbin/rtsold/cap_llflags.c  Thu Nov 21 00:17:14 2019
(r354926)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354925 - head/usr.sbin/efibootmgr

2019-11-20 Thread Warner Losh
Author: imp
Date: Wed Nov 20 23:58:36 2019
New Revision: 354925
URL: https://svnweb.freebsd.org/changeset/base/354925

Log:
  Add --esp/-E argument to print the currently booted ESP
  
  Add code to decode the BootCurrent and Boot variable it points at
  to deduce the ESP used to boot the system. By default, it prints the
  path to that device. With --unix-path (-p) it will instead print the
  current mount point for the ESP, if any (or an error). With
  --device-path (-d) it wil print the UEFI device path for the ESP.
  
  Note: This is the best guess based on the UEFI variables. If the ESP
  is part of a gmirror, etc, that won't be reported. If by some weird
  chance there was a complicated series of chain boots, this may not be
  what you want. For setups that don't add layers on top of the raw
  devices, it is accurate.
  
  Differential Revision: https://reviews.freebsd.org/D22432

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.8
  head/usr.sbin/efibootmgr/efibootmgr.c

Modified: head/usr.sbin/efibootmgr/efibootmgr.8
==
--- head/usr.sbin/efibootmgr/efibootmgr.8   Wed Nov 20 23:56:20 2019
(r354924)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Wed Nov 20 23:58:36 2019
(r354925)
@@ -49,7 +49,12 @@
 .Op Fl b Ar bootnum
 .Op Fl k Ar kernel
 .Op Fl L Ar label
+.Op Fl e Ar env
 .Nm
+.Fl E
+.Op Fl d
+.Op Fl p
+.Nm
 .Fl n
 .Fl b Ar bootnum
 .Nm
@@ -111,6 +116,21 @@ Create a new
 variable.
 .It Fl D -dry-run
 Process but do not change any variables.
+.It Fl E -esp
+Print the
+.Fx
+path to the ESP device, derived from the EFI variables
+.Va BootCurrent
+and
+.Va Boot .
+This is the ESP partition used by UEFI to boot the current
+instance of the system.
+If
+.Fl d -device-path
+is specified, the UEFI device path to the ESP is reported instead.
+If
+.Fl p -unix-path
+is specified, the mount point of the ESP is reported instead.
 .It Fl k -kernel Ar kernel
 The path to and name of the kernel.
 .It Fl l -loader Ar loader

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Wed Nov 20 23:56:20 2019
(r354924)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Wed Nov 20 23:58:36 2019
(r354925)
@@ -81,6 +81,8 @@ typedef struct _bmgr_opts {
booldelete_bootnext;
booldel_timeout;
booldry_run;
+   booldevice_path;
+   boolesp_device;
boolhas_bootnum;
boolonce;
int cp_src;
@@ -89,6 +91,7 @@ typedef struct _bmgr_opts {
boolset_inactive;
boolset_timeout;
int timeout;
+   boolunix_path;
boolverbose;
 } bmgr_opts_t;
 
@@ -103,14 +106,17 @@ static struct option lopts[] = {
{"del-timout", no_argument, NULL, 'T'},
{"delete", no_argument, NULL, 'B'},
{"delete-bootnext", no_argument, NULL, 'N'},
+   {"device-path", no_argument, NULL, 'd'},
{"dry-run", no_argument, NULL, 'D'},
{"env", required_argument, NULL, 'e'},
+   {"esp", no_argument, NULL, 'E'},
{"help", no_argument, NULL, 'h'},
{"kernel", required_argument, NULL, 'k'},
{"label", required_argument, NULL, 'L'},
{"loader", required_argument, NULL, 'l'},
{"once", no_argument, NULL, 'O'},
{"set-timeout", required_argument, NULL, 't'},
+   {"unix-path", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 'v'},
{ NULL, 0, NULL, 0}
 };
@@ -191,7 +197,7 @@ parse_args(int argc, char *argv[])
 {
int ch;
 
-   while ((ch = getopt_long(argc, argv, "AaBb:C:cDe:hk:L:l:NnOo:Tt:v",
+   while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:Ehk:L:l:NnOo:pTt:v",
lopts, NULL)) != -1) {
switch (ch) {
case 'A':
@@ -216,10 +222,16 @@ parse_args(int argc, char *argv[])
case 'D': /* should be remove dups XXX */
opts.dry_run = true;
break;
+   case 'd':
+   opts.device_path = true;
+   break;
case 'e':
free(opts.env);
opts.env = strdup(optarg);
break;
+   case 'E':
+   opts.esp_device = true;
+   break;
case 'h':
default:
errx(1, "%s", USAGE);
@@ -250,6 +262,9 @@ parse_args(int argc, char *argv[])
free(opts.order);
opts.order = strdup(optarg);
break;
+   case 'p':
+   opts.unix_path = true;
+   break;
case 'T':
opts.del_timeout = true;
break;
@@ -906,6

svn commit: r354924 - head/contrib/openresolv

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 23:56:20 2019
New Revision: 354924
URL: https://svnweb.freebsd.org/changeset/base/354924

Log:
  MFV 354917, 354918, 354919
  openresolv: update to version 3.9.2
  
  MFC after:3 weeks

Added:
  head/contrib/openresolv/LICENSE
 - copied unchanged from r354917, vendor/openresolv/dist/LICENSE
  head/contrib/openresolv/README.md
 - copied unchanged from r354917, vendor/openresolv/dist/README.md
Deleted:
  head/contrib/openresolv/README
Modified:
  head/contrib/openresolv/Makefile
  head/contrib/openresolv/configure
  head/contrib/openresolv/dnsmasq.in
  head/contrib/openresolv/libc.in
  head/contrib/openresolv/named.in
  head/contrib/openresolv/pdns_recursor.in
  head/contrib/openresolv/pdnsd.in
  head/contrib/openresolv/resolvconf.conf
  head/contrib/openresolv/resolvconf.conf.5.in
  head/contrib/openresolv/resolvconf.in
  head/contrib/openresolv/unbound.in
Directory Properties:
  head/contrib/openresolv/   (props changed)

Copied: head/contrib/openresolv/LICENSE (from r354917, 
vendor/openresolv/dist/LICENSE)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/openresolv/LICENSE Wed Nov 20 23:56:20 2019
(r354924, copy of r354917, vendor/openresolv/dist/LICENSE)
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2019 Roy Marples 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Modified: head/contrib/openresolv/Makefile
==
--- head/contrib/openresolv/MakefileWed Nov 20 23:49:47 2019
(r354923)
+++ head/contrib/openresolv/MakefileWed Nov 20 23:56:20 2019
(r354924)
@@ -10,6 +10,7 @@ SYSCONFDIR?=  /etc
 LIBEXECDIR?=   /libexec/resolvconf
 VARDIR?=   /var/run/resolvconf
 
+ECHO?= echo
 INSTALL?=  install
 SED?=  sed
 
@@ -20,7 +21,7 @@ DOCMODE?= 0644
 MANMODE?=  0444
 
 RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
-SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
+SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
 TARGET=${RESOLVCONF} ${SUBSCRIBERS}
 SRCS=  ${TARGET:C,$,.in,} # pmake
 SRCS:= ${TARGET:=.in} # gmake
@@ -42,7 +43,7 @@ DISTINFOSIGN= ${DISTINFO}.asc
 CKSUM?=cksum -a SHA256
 PGP?=  netpgp
 
-FOSSILID?= current
+GITREF?=   HEAD
 
 .SUFFIXES: .in
 
@@ -79,15 +80,17 @@ maninstall:
 
 install: proginstall maninstall
 
-import:
+dist-git:
+   git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+   mkdir /tmp/${DISTPREFIX}
+   cp -RPp * /tmp/${DISTPREFIX}
+   (cd /tmp/${DISTPREFIX}; make clean)
+   tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
rm -rf /tmp/${DISTPREFIX}
-   ${INSTALL} -d /tmp/${DISTPREFIX}
-   cp README ${SRCS} /tmp/${DISTPREFIX}
 
-dist:
-   fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-   gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-   rm ${DISTFILEGZ}
+dist: dist-git
 
 distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
@@ -96,3 +99,20 @@ distinfo: dist
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+import: dist
+   rm -rf /tmp/${DISTPREFIX}
+   ${INSTALL} -d /tmp/${DISTPREFIX}
+   tar xvJpf ${DISTFILE} -C /tmp
+
+_import-src:
+   rm -rf ${DESTDIR}/*
+   ${INSTALL} -d ${DESTDIR}
+   cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR};
+   cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR};
+   @${ECHO}
+   @${ECHO} "="
+   @${EC

svn commit: r354923 - stable/12/sys/dev/ahci

2019-11-20 Thread Alexander Motin
Author: mav
Date: Wed Nov 20 23:49:47 2019
New Revision: 354923
URL: https://svnweb.freebsd.org/changeset/base/354923

Log:
  MFC r351589: Fix AHCI Enclosure Management, broken by r351356.
  
  ivars value of -1 was used to distinguish EM device, and r351356 left some
  wrong checks for it.  Give EM device separate flag there instead.

Modified:
  stable/12/sys/dev/ahci/ahci.c
  stable/12/sys/dev/ahci/ahci.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ahci/ahci.c
==
--- stable/12/sys/dev/ahci/ahci.c   Wed Nov 20 23:45:31 2019
(r354922)
+++ stable/12/sys/dev/ahci/ahci.c   Wed Nov 20 23:49:47 2019
(r354923)
@@ -362,7 +362,7 @@ ahci_attach(device_t dev)
if (child == NULL)
device_printf(dev, "failed to add enclosure device\n");
else
-   device_set_ivars(child, (void *)(intptr_t)-1);
+   device_set_ivars(child, (void *)(intptr_t)AHCI_EM_UNIT);
}
bus_generic_attach(dev);
return (0);
@@ -562,23 +562,25 @@ ahci_alloc_resource(device_t dev, device_t child, int 
struct resource *res;
rman_res_t st;
int offset, size, unit;
-   bool is_remapped;
+   bool is_em, is_remapped;
 
unit = (intptr_t)device_get_ivars(child);
+   is_em = is_remapped = false;
if (unit & AHCI_REMAPPED_UNIT) {
-   unit &= ~AHCI_REMAPPED_UNIT;
+   unit &= AHCI_UNIT;
unit -= ctlr->channels;
is_remapped = true;
-   } else
-   is_remapped = false;
+   } else if (unit & AHCI_EM_UNIT) {
+   unit &= AHCI_UNIT;
+   is_em = true;
+   }
res = NULL;
switch (type) {
case SYS_RES_MEMORY:
if (is_remapped) {
offset = ctlr->remap_offset + unit * ctlr->remap_size;
size = ctlr->remap_size;
-   }
-   else if (unit >= 0) {
+   } else if (!is_em) {
offset = AHCI_OFFSET + (unit << 7);
size = 128;
} else if (*rid == 0) {
@@ -639,7 +641,7 @@ ahci_setup_intr(device_t dev, device_t child, struct r
 void *argument, void **cookiep)
 {
struct ahci_controller *ctlr = device_get_softc(dev);
-   int unit = (intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT;
+   int unit = (intptr_t)device_get_ivars(child) & AHCI_UNIT;
 
if (filter != NULL) {
printf("ahci.c: we cannot use a filter here\n");
@@ -655,7 +657,7 @@ ahci_teardown_intr(device_t dev, device_t child, struc
 void *cookie)
 {
struct ahci_controller *ctlr = device_get_softc(dev);
-   int unit = (intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT;
+   int unit = (intptr_t)device_get_ivars(child) & AHCI_UNIT;
 
ctlr->interrupt[unit].function = NULL;
ctlr->interrupt[unit].argument = NULL;
@@ -665,12 +667,13 @@ ahci_teardown_intr(device_t dev, device_t child, struc
 int
 ahci_print_child(device_t dev, device_t child)
 {
-   int retval, channel;
+   intptr_t ivars;
+   int retval;
 
retval = bus_print_child_header(dev, child);
-   channel = (int)(intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT;
-   if (channel >= 0)
-   retval += printf(" at channel %d", channel);
+   ivars = (intptr_t)device_get_ivars(child);
+   if ((ivars & AHCI_EM_UNIT) == 0)
+   retval += printf(" at channel %d", (int)ivars & AHCI_UNIT);
retval += bus_print_child_footer(dev, child);
return (retval);
 }
@@ -679,11 +682,11 @@ int
 ahci_child_location_str(device_t dev, device_t child, char *buf,
 size_t buflen)
 {
-   int channel;
+   intptr_t ivars;
 
-   channel = (int)(intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT;
-   if (channel >= 0)
-   snprintf(buf, buflen, "channel=%d", channel);
+   ivars = (intptr_t)device_get_ivars(child);
+   if ((ivars & AHCI_EM_UNIT) == 0)
+   snprintf(buf, buflen, "channel=%d", (int)ivars & AHCI_UNIT);
return (0);
 }
 

Modified: stable/12/sys/dev/ahci/ahci.h
==
--- stable/12/sys/dev/ahci/ahci.h   Wed Nov 20 23:45:31 2019
(r354922)
+++ stable/12/sys/dev/ahci/ahci.h   Wed Nov 20 23:49:47 2019
(r354923)
@@ -319,9 +319,10 @@
 /* Total main work area. */
 #define AHCI_WORK_SIZE  (AHCI_CT_OFFSET + AHCI_CT_SIZE * 
ch->numslots)
 
-
-/* NVMe remapped device */
-#define AHCI_REMAPPED_UNIT (1 << 31)
+/* ivars value fields */
+#define AHCI_REMAPPED_UNIT (1 << 31)   /* NVMe remapped device. */
+#define AHCI_EM_UNIT   (1 << 30)   /* Enclosure Mgmt device. */
+#define AHCI_UNIT   

svn commit: r354922 - in head: etc libexec/rc libexec/rc/rc.d share/man/man5 sys/sys

2019-11-20 Thread Warner Losh
Author: imp
Date: Wed Nov 20 23:45:31 2019
New Revision: 354922
URL: https://svnweb.freebsd.org/changeset/base/354922

Log:
  Create /etc/os-release file.
  
  Each boot, regenerate /var/run/os-release based on the currently running
  system. Create a /etc/os-release symlink pointing to this file (so that this
  doesn't create a new reason /etc can not be mounted read-only).
  
  This is compatible with what other systems do and is what the 
sysutil/os-release
  port attempted to do, but in an incomplete way. Linux, Solaris and DragonFly 
all
  implement this natively as well. The complete standard can be found at
  https://www.freedesktop.org/software/systemd/man/os-release.html
  
  Moving this to the base solves both the non-standard location problem with the
  port, as well as the lack of update of this file on system update.
  
  Bump __FreeBSD_version to 1300060
  
  PR: 238953
  Differential Revision:  https://reviews.freebsd.org/D22271

Added:
  head/libexec/rc/rc.d/os-release   (contents, props changed)
  head/share/man/man5/os-release.5   (contents, props changed)
Modified:
  head/etc/Makefile
  head/libexec/rc/rc.conf
  head/libexec/rc/rc.d/Makefile
  head/share/man/man5/Makefile
  head/sys/sys/param.h

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Wed Nov 20 23:09:21 2019(r354921)
+++ head/etc/Makefile   Wed Nov 20 23:45:31 2019(r354922)
@@ -57,6 +57,8 @@ distribution:
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
+   ${INSTALL_SYMLINK} ../var/run/os-release \
+   ${DESTDIR}/etc/os-release
 .if ${MK_UNBOUND} != "no"
if [ ! -e ${DESTDIR}/etc/unbound ]; then \
${INSTALL_SYMLINK} -T "package=unbound" \

Modified: head/libexec/rc/rc.conf
==
--- head/libexec/rc/rc.conf Wed Nov 20 23:09:21 2019(r354921)
+++ head/libexec/rc/rc.conf Wed Nov 20 23:45:31 2019(r354922)
@@ -678,6 +678,9 @@ entropy_save_sz="4096"  # Size of the entropy cache fil
 entropy_save_num="8"   # Number of entropy cache files to save.
 harvest_mask="511" # Entropy device harvests all but the very invasive 
sources.
# (See 'sysctl kern.random.harvest' and random(4))
+osrelease_enable="YES" # Update /var/run/os-release on boot (or NO).
+osrelease_file="/var/run/os-release" # File to update for os-release.
+osrelease_perms="444"  # Default permission for os-release file.
 dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
 watchdogd_enable="NO"  # Start the software watchdog daemon
 watchdogd_flags="" # Flags to watchdogd (if enabled)

Modified: head/libexec/rc/rc.d/Makefile
==
--- head/libexec/rc/rc.d/Makefile   Wed Nov 20 23:09:21 2019
(r354921)
+++ head/libexec/rc/rc.d/Makefile   Wed Nov 20 23:45:31 2019
(r354922)
@@ -77,6 +77,7 @@ CONFS=DAEMON \
nsswitch \
ntpdate \
${_opensm} \
+   os-release \
pf \
pflog \
pfsync \

Added: head/libexec/rc/rc.d/os-release
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/libexec/rc/rc.d/os-release Wed Nov 20 23:45:31 2019
(r354922)
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: os-release
+# REQUIRE: mountcritremote FILESYSTEMS
+# BEFORE:  LOGIN
+
+. /etc/rc.subr
+
+: ${osrelease_file:=/var/run/os-release}
+: ${osrelease_perms:=444}
+name="osrelease"
+desc="Update ${osrelease_file}"
+start_cmd="osrelease_start"
+stop_cmd=":"
+
+osrelease_start()
+{
+   local _version _version_id
+
+   check_startmsgs && echo -n "Updating ${osrelease_file} "
+   _version=$(freebsd-version -u)
+   _version_id=${_version%%[^0-9.]*}
+   t=$(mktemp -t os-release)
+   cat > "$t" <<-__EOF__
+   NAME=FreeBSD
+   VERSION=$_version
+   VERSION_ID=$_version_id
+   ID=freebsd
+   ANSI_COLOR="0;31"
+   PRETTY_NAME="FreeBSD $_version"
+   CPE_NAME=cpe:/o:freebsd:freebsd:$_version_id
+   HOME_URL=https://FreeBSD.org/
+   BUG_REPORT_URL=https://bugs.FreeBSD.org/
+__EOF__
+   install -C -o root -g wheel -m ${osrelease_perms} "$t" 
"${osrelease_file}"
+   rm -f "$t"
+   check_startmsgs && echo 'done.'
+}
+
+load_rc_config $name
+run_rc_command "$1"

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileWed Nov 20 23:09:21 2019
(r354921)
+++ head/share/man/man5/MakefileWed Nov 20 23

Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Bjoern A. Zeeb

On 20 Nov 2019, at 23:32, John Baldwin wrote:

Hijacking a side-thread:

PreS: I think we have way too many of these options and should just 
remove 3/4 of them again or someone build a proper matrix documenting 
them all and in which case to use in the developers handbook ;-)



This one also seems dubious, but in a different way:

usr.bin/Makefile:

# ARM64TODO gprof does not build
# RISCVTODO gprof does not build
.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
SUBDIR.${MK_TOOLCHAIN}+=gprof
.endif

Somewhat exacerbated by the whole aarch64 vs arm64 thing and probably
confusion on when to use CPUARCH vs ARCH.


This particular case could actually be removed as I thought I made that 
at least compile when I was working on s390x:

https://svnweb.freebsd.org/base?view=revision&revision=351329


You can however find more of these elsewhere:

../lib/libc/tests/sys/Makefile:.if ${MACHINE_CPUARCH} != "aarch64" && 
${MACHINE_CPUARCH} != "riscv"
../lib/libcompiler_rt/Makefile.inc:.if ${MACHINE_CPUARCH} == "aarch64" 
|| ${MACHINE_CPUARCH} == "riscv"
../stand/libsa/Makefile:.if ${MACHINE_CPUARCH} == "aarch64" || 
${MACHINE_CPUARCH} == "riscv"
../usr.bin/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
${MACHINE_CPUARCH} != "riscv"
../usr.bin/gprof/Makefile:.if ${MACHINE_ARCH} != "aarch64" && 
${MACHINE_ARCH} != "riscv" && \

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


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread John Baldwin
On 11/20/19 3:04 PM, Warner Losh wrote:
> On Wed, Nov 20, 2019 at 3:09 PM John Baldwin  wrote:
> 
>> On 11/20/19 10:01 AM, Warner Losh wrote:
>>> On Wed, Nov 20, 2019 at 9:54 AM Li-Wen Hsu  wrote:
>>>
 Author: lwhsu
 Date: Wed Nov 20 16:54:21 2019
 New Revision: 354900
 URL: https://svnweb.freebsd.org/changeset/base/354900

 Log:
   Use the correct variable, also limit the scope to bfd

   PR:   242109
   Reported by:  jhb
   Sponsored by: The FreeBSD Foundation

 Modified:
   head/usr.sbin/jail/Makefile

 Modified: head/usr.sbin/jail/Makefile


>> ==
 --- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019
>> (r354899)
 +++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019
>> (r354900)
 @@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
  # workaround for GNU ld (GNU Binutils) 2.33.1:
  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
  # https://bugs.freebsd.org/242109
 -.if ${MACHINE_ARCH} == "riscv"
 +.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"

>>>
>>> MACHINE isn't the right thing to use here. It's never the proper thing in
>>> userland makefiles, unless they are interfacing with the kernel.
>>>
>>> MACHINE_CPUARCH is what you want here.
>>
>> Eh, that claim doesn't seem quite true.  src.opts.mk only uses MACHINE
>> and not
>> MACHINE_CPUARCH for example (to set _TT that is then used all over the
>> place in src.opts.mk).  My experience is that uses of *_CPUARCH are in
>> fact
>> pretty rare.
>>
> 
> However, __TT is used bogusly in many places in src.opts.mk. They are all
> relatively new related to llvm (and one for google test). MACHINE has
> always been for the kernel and MACHINE_ARCH for userland. MACHINE_CPUARCH
> was created for those architectures where we have a number of MACHINE_ARCH
> to make things easier to cope with.
> 
> I've done several sweeps of the tree over the years to keep this enforced,
> so I'm quite sure of the dichotomy...

Here are some to fix then: :)

sbin/reboot/Makefile:.if exists(${.CURDIR}/boot_${MACHINE}.8)
sbin/reboot/Makefile:MAN+=  boot_${MACHINE}.8
sbin/reboot/Makefile:MLINKS+= boot_${MACHINE}.8 boot.8
sbin/reboot/Makefile:.if ${MACHINE} == "amd64"
usr.sbin/bsdinstall/partedit/Makefile:PARTEDIT_ARCH= ${MACHINE}
usr.sbin/bsdinstall/partedit/Makefile:.if ${MACHINE} == "i386" || ${MACHINE} == 
"amd64"
usr.sbin/pkg/Makefile:.  if ${MACHINE} != "amd64" && ${MACHINE} != "i386"

This one also seems dubious, but in a different way:

usr.bin/Makefile:

# ARM64TODO gprof does not build
# RISCVTODO gprof does not build
.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv"
SUBDIR.${MK_TOOLCHAIN}+=gprof
.endif

Somewhat exacerbated by the whole aarch64 vs arm64 thing and probably
confusion on when to use CPUARCH vs ARCH.

BTW, MACHINE_ARCH seems to matter just as much for the kernel.  64-bit
mips runs a "mips64" kernel, not a "mips" kernel.

With PC-98 removed, I don't think we have any cases where MACHINE !=
MACHINE_CPUARCH now?

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


svn commit: r354921 - stable/12/sys/mips/mips

2019-11-20 Thread Brooks Davis
Author: brooks
Date: Wed Nov 20 23:09:21 2019
New Revision: 354921
URL: https://svnweb.freebsd.org/changeset/base/354921

Log:
  MFC r354688:
  
  Fix a typo in the PMAP_PTE_SET_CACHE_BITS macro.
  
  The second argument should have been "pa" not "ps".  It worked by
  accident because the argument was always "pa" which was an in-scope
  local variable.
  
  Submitted by: sson
  Reviewed by:  jhb, kevans
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D22338

Modified:
  stable/12/sys/mips/mips/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/mips/mips/pmap.c
==
--- stable/12/sys/mips/mips/pmap.c  Wed Nov 20 22:25:49 2019
(r354920)
+++ stable/12/sys/mips/mips/pmap.c  Wed Nov 20 23:09:21 2019
(r354921)
@@ -323,7 +323,7 @@ pmap_pte_cache_bits(vm_paddr_t pa, vm_page_t m)
ma = VM_MEMATTR_UNCACHEABLE;
return PTE_C(ma);
 }
-#define PMAP_PTE_SET_CACHE_BITS(pte, ps, m) {  \
+#define PMAP_PTE_SET_CACHE_BITS(pte, pa, m) {  \
pte &= ~PTE_C_MASK; \
pte |= pmap_pte_cache_bits(pa, m);  \
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 3:09 PM John Baldwin  wrote:

> On 11/20/19 10:01 AM, Warner Losh wrote:
> > On Wed, Nov 20, 2019 at 9:54 AM Li-Wen Hsu  wrote:
> >
> >> Author: lwhsu
> >> Date: Wed Nov 20 16:54:21 2019
> >> New Revision: 354900
> >> URL: https://svnweb.freebsd.org/changeset/base/354900
> >>
> >> Log:
> >>   Use the correct variable, also limit the scope to bfd
> >>
> >>   PR:   242109
> >>   Reported by:  jhb
> >>   Sponsored by: The FreeBSD Foundation
> >>
> >> Modified:
> >>   head/usr.sbin/jail/Makefile
> >>
> >> Modified: head/usr.sbin/jail/Makefile
> >>
> >>
> ==
> >> --- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019
> (r354899)
> >> +++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019
> (r354900)
> >> @@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
> >>  # workaround for GNU ld (GNU Binutils) 2.33.1:
> >>  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
> >>  # https://bugs.freebsd.org/242109
> >> -.if ${MACHINE_ARCH} == "riscv"
> >> +.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
> >>
> >
> > MACHINE isn't the right thing to use here. It's never the proper thing in
> > userland makefiles, unless they are interfacing with the kernel.
> >
> > MACHINE_CPUARCH is what you want here.
>
> Eh, that claim doesn't seem quite true.  src.opts.mk only uses MACHINE
> and not
> MACHINE_CPUARCH for example (to set _TT that is then used all over the
> place in src.opts.mk).  My experience is that uses of *_CPUARCH are in
> fact
> pretty rare.
>

However, __TT is used bogusly in many places in src.opts.mk. They are all
relatively new related to llvm (and one for google test). MACHINE has
always been for the kernel and MACHINE_ARCH for userland. MACHINE_CPUARCH
was created for those architectures where we have a number of MACHINE_ARCH
to make things easier to cope with.

I've done several sweeps of the tree over the years to keep this enforced,
so I'm quite sure of the dichotomy...

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


svn commit: r354920 - vendor/openresolv/3.9.2

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 22:25:49 2019
New Revision: 354920
URL: https://svnweb.freebsd.org/changeset/base/354920

Log:
  Tag openresolv 3.9.2.
  
  More information at: https://roy.marples.name/projects/openresolv

Added:
  vendor/openresolv/3.9.2/
 - copied from r354918, vendor/openresolv/dist/
  vendor/openresolv/3.9.2/LICENSE
 - copied unchanged from r354919, vendor/openresolv/dist/LICENSE
  vendor/openresolv/3.9.2/README.md
 - copied unchanged from r354919, vendor/openresolv/dist/README.md
Replaced:
  vendor/openresolv/3.9.2/Makefile
 - copied unchanged from r354919, vendor/openresolv/dist/Makefile
  vendor/openresolv/3.9.2/configure
 - copied unchanged from r354919, vendor/openresolv/dist/configure
  vendor/openresolv/3.9.2/dnsmasq.in
 - copied unchanged from r354919, vendor/openresolv/dist/dnsmasq.in
  vendor/openresolv/3.9.2/libc.in
 - copied unchanged from r354919, vendor/openresolv/dist/libc.in
  vendor/openresolv/3.9.2/named.in
 - copied unchanged from r354919, vendor/openresolv/dist/named.in
  vendor/openresolv/3.9.2/pdns_recursor.in
 - copied unchanged from r354919, vendor/openresolv/dist/pdns_recursor.in
  vendor/openresolv/3.9.2/pdnsd.in
 - copied unchanged from r354919, vendor/openresolv/dist/pdnsd.in
  vendor/openresolv/3.9.2/resolvconf.conf
 - copied unchanged from r354919, vendor/openresolv/dist/resolvconf.conf
  vendor/openresolv/3.9.2/resolvconf.conf.5.in
 - copied unchanged from r354919, 
vendor/openresolv/dist/resolvconf.conf.5.in
  vendor/openresolv/3.9.2/resolvconf.in
 - copied unchanged from r354919, vendor/openresolv/dist/resolvconf.in
  vendor/openresolv/3.9.2/unbound.in
 - copied unchanged from r354919, vendor/openresolv/dist/unbound.in
Deleted:
  vendor/openresolv/3.9.2/README

Copied: vendor/openresolv/3.9.2/LICENSE (from r354919, 
vendor/openresolv/dist/LICENSE)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/3.9.2/LICENSE Wed Nov 20 22:25:49 2019
(r354920, copy of r354919, vendor/openresolv/dist/LICENSE)
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2019 Roy Marples 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Copied: vendor/openresolv/3.9.2/Makefile (from r354919, 
vendor/openresolv/dist/Makefile)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/3.9.2/MakefileWed Nov 20 22:25:49 2019
(r354920, copy of r354919, vendor/openresolv/dist/Makefile)
@@ -0,0 +1,118 @@
+PKG=   openresolv
+
+# Nasty hack so that make clean works without configure being run
+_CONFIG_MK!=   test -e config.mk && echo config.mk || echo config-null.mk
+CONFIG_MK?=${_CONFIG_MK}
+include${CONFIG_MK}
+
+SBINDIR?=  /sbin
+SYSCONFDIR?=   /etc
+LIBEXECDIR?=   /libexec/resolvconf
+VARDIR?=   /var/run/resolvconf
+
+ECHO?= echo
+INSTALL?=  install
+SED?=  sed
+
+VERSION!=  ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in
+
+BINMODE?=  0755
+DOCMODE?=  0644
+MANMODE?=  0444
+
+RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
+SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
+TARGET=${RESOLVCONF} ${SUBSCRIBERS}
+SRCS=  ${TARGET:C,$,.in,} # pmake
+SRCS:= ${TARGET:=.in} # gmake
+
+SED_SBINDIR=   -e 's:@SBINDIR@:${SBINDIR}:g'
+SED_SYSCONFDIR=-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
+SED_LIBEXECDIR=-e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
+SED_VARDIR=-e 's:@VARDIR@:${VARDIR}:g'
+SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'

svn commit: r354919 - vendor/openresolv/dist

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 22:23:50 2019
New Revision: 354919
URL: https://svnweb.freebsd.org/changeset/base/354919

Log:
  Import openresolv 3.9.2
  
  More information at: https://roy.marples.name/projects/openresolv

Added:
  vendor/openresolv/dist/LICENSE
 - copied unchanged from r354917, vendor/openresolv/dist/LICENSE
  vendor/openresolv/dist/README.md
 - copied unchanged from r354917, vendor/openresolv/dist/README.md
Deleted:
  vendor/openresolv/dist/README
Modified:
  vendor/openresolv/dist/Makefile
  vendor/openresolv/dist/configure
  vendor/openresolv/dist/dnsmasq.in
  vendor/openresolv/dist/libc.in
  vendor/openresolv/dist/named.in
  vendor/openresolv/dist/pdns_recursor.in
  vendor/openresolv/dist/pdnsd.in
  vendor/openresolv/dist/resolvconf.conf
  vendor/openresolv/dist/resolvconf.conf.5.in
  vendor/openresolv/dist/resolvconf.in
  vendor/openresolv/dist/unbound.in

Copied: vendor/openresolv/dist/LICENSE (from r354917, 
vendor/openresolv/dist/LICENSE)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/LICENSE  Wed Nov 20 22:23:50 2019
(r354919, copy of r354917, vendor/openresolv/dist/LICENSE)
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2019 Roy Marples 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Modified: vendor/openresolv/dist/Makefile
==
--- vendor/openresolv/dist/Makefile Wed Nov 20 22:20:11 2019
(r354918)
+++ vendor/openresolv/dist/Makefile Wed Nov 20 22:23:50 2019
(r354919)
@@ -10,6 +10,7 @@ SYSCONFDIR?=  /etc
 LIBEXECDIR?=   /libexec/resolvconf
 VARDIR?=   /var/run/resolvconf
 
+ECHO?= echo
 INSTALL?=  install
 SED?=  sed
 
@@ -20,7 +21,7 @@ DOCMODE?= 0644
 MANMODE?=  0444
 
 RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
-SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
+SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
 TARGET=${RESOLVCONF} ${SUBSCRIBERS}
 SRCS=  ${TARGET:C,$,.in,} # pmake
 SRCS:= ${TARGET:=.in} # gmake
@@ -42,7 +43,7 @@ DISTINFOSIGN= ${DISTINFO}.asc
 CKSUM?=cksum -a SHA256
 PGP?=  netpgp
 
-FOSSILID?= current
+GITREF?=   HEAD
 
 .SUFFIXES: .in
 
@@ -79,15 +80,17 @@ maninstall:
 
 install: proginstall maninstall
 
-import:
+dist-git:
+   git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+   mkdir /tmp/${DISTPREFIX}
+   cp -RPp * /tmp/${DISTPREFIX}
+   (cd /tmp/${DISTPREFIX}; make clean)
+   tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
rm -rf /tmp/${DISTPREFIX}
-   ${INSTALL} -d /tmp/${DISTPREFIX}
-   cp README ${SRCS} /tmp/${DISTPREFIX}
 
-dist:
-   fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-   gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-   rm ${DISTFILEGZ}
+dist: dist-git
 
 distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
@@ -96,3 +99,20 @@ distinfo: dist
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+import: dist
+   rm -rf /tmp/${DISTPREFIX}
+   ${INSTALL} -d /tmp/${DISTPREFIX}
+   tar xvJpf ${DISTFILE} -C /tmp
+
+_import-src:
+   rm -rf ${DESTDIR}/*
+   ${INSTALL} -d ${DESTDIR}
+   cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR};
+   cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR};
+   @${ECHO}
+   @${ECHO} "="
+   @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}"
+
+import-src:
+   ${MAKE

svn commit: r354918 - vendor/openresolv/dist

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 22:20:11 2019
New Revision: 354918
URL: https://svnweb.freebsd.org/changeset/base/354918

Log:
  Undo r354917 to correct the log: it was actually version 3.9.2

Added:
  vendor/openresolv/dist/README
 - copied unchanged from r354916, vendor/openresolv/dist/README
Deleted:
  vendor/openresolv/dist/LICENSE
  vendor/openresolv/dist/README.md
Modified:
  vendor/openresolv/dist/Makefile
  vendor/openresolv/dist/configure
  vendor/openresolv/dist/dnsmasq.in
  vendor/openresolv/dist/libc.in
  vendor/openresolv/dist/named.in
  vendor/openresolv/dist/pdns_recursor.in
  vendor/openresolv/dist/pdnsd.in
  vendor/openresolv/dist/resolvconf.conf
  vendor/openresolv/dist/resolvconf.conf.5.in
  vendor/openresolv/dist/resolvconf.in
  vendor/openresolv/dist/unbound.in

Modified: vendor/openresolv/dist/Makefile
==
--- vendor/openresolv/dist/Makefile Wed Nov 20 22:13:14 2019
(r354917)
+++ vendor/openresolv/dist/Makefile Wed Nov 20 22:20:11 2019
(r354918)
@@ -10,7 +10,6 @@ SYSCONFDIR?=  /etc
 LIBEXECDIR?=   /libexec/resolvconf
 VARDIR?=   /var/run/resolvconf
 
-ECHO?= echo
 INSTALL?=  install
 SED?=  sed
 
@@ -21,7 +20,7 @@ DOCMODE?= 0644
 MANMODE?=  0444
 
 RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
-SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
+SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
 TARGET=${RESOLVCONF} ${SUBSCRIBERS}
 SRCS=  ${TARGET:C,$,.in,} # pmake
 SRCS:= ${TARGET:=.in} # gmake
@@ -43,7 +42,7 @@ DISTINFOSIGN= ${DISTINFO}.asc
 CKSUM?=cksum -a SHA256
 PGP?=  netpgp
 
-GITREF?=   HEAD
+FOSSILID?= current
 
 .SUFFIXES: .in
 
@@ -80,17 +79,15 @@ maninstall:
 
 install: proginstall maninstall
 
-dist-git:
-   git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
-
-dist-inst:
-   mkdir /tmp/${DISTPREFIX}
-   cp -RPp * /tmp/${DISTPREFIX}
-   (cd /tmp/${DISTPREFIX}; make clean)
-   tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+import:
rm -rf /tmp/${DISTPREFIX}
+   ${INSTALL} -d /tmp/${DISTPREFIX}
+   cp README ${SRCS} /tmp/${DISTPREFIX}
 
-dist: dist-git
+dist:
+   fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
+   gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
+   rm ${DISTFILEGZ}
 
 distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
@@ -99,20 +96,3 @@ distinfo: dist
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
-
-import: dist
-   rm -rf /tmp/${DISTPREFIX}
-   ${INSTALL} -d /tmp/${DISTPREFIX}
-   tar xvJpf ${DISTFILE} -C /tmp
-
-_import-src:
-   rm -rf ${DESTDIR}/*
-   ${INSTALL} -d ${DESTDIR}
-   cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR};
-   cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR};
-   @${ECHO}
-   @${ECHO} "="
-   @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}"
-
-import-src:
-   ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo 
"${DESTDIR}"; else  echo /tmp/${DISTPREFIX}; fi`

Copied: vendor/openresolv/dist/README (from r354916, 
vendor/openresolv/dist/README)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/README   Wed Nov 20 22:20:11 2019
(r354918, copy of r354916, vendor/openresolv/dist/README)
@@ -0,0 +1,11 @@
+openresolv is a resolvconf implementation which manages resolv.conf
+You can find the latest version at http://roy.marples.name/projects/openresolv
+It is written and maintained by Roy Marples 
+
+This resolvconf implementation, along with its subscribers, work with a
+POSIX compliant shell and userland utilities. It is designed to work without
+tools such as sed as it *has* to work without /usr being available.
+
+On systems where resolvconf is expected to be used before /var/run is available
+for writing, you can configure openresolv to write somewhere else, like say a
+ramdisk.

Modified: vendor/openresolv/dist/configure
==
--- vendor/openresolv/dist/configureWed Nov 20 22:13:14 2019
(r354917)
+++ vendor/openresolv/dist/configureWed Nov 20 22:20:11 2019
(r354918)
@@ -44,8 +44,42 @@ for x do
esac
 done
 
+if [ -z "$LIBEXECDIR" ]; then
+   printf "Checking for directory /libexec ... "
+   if [ -d /libexec ]; then
+   echo "yes"
+   LIBEXECDIR=$PREFIX/libexec/resolvconf
+   else
+   echo "no"
+   LIBEXECDIR=$PREFIX/lib/resolvconf
+   fi
+fi
+if [ -z "$RUNDIR" ]; then
+   printf "Checking for directory /run ... "

svn commit: r354917 - vendor/openresolv/dist

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 22:13:14 2019
New Revision: 354917
URL: https://svnweb.freebsd.org/changeset/base/354917

Log:
  Import openresolv 3.9.0
  
  More information at: https://roy.marples.name/projects/openresolv

Added:
  vendor/openresolv/dist/LICENSE
  vendor/openresolv/dist/README.md
Deleted:
  vendor/openresolv/dist/README
Modified:
  vendor/openresolv/dist/Makefile
  vendor/openresolv/dist/configure
  vendor/openresolv/dist/dnsmasq.in
  vendor/openresolv/dist/libc.in
  vendor/openresolv/dist/named.in
  vendor/openresolv/dist/pdns_recursor.in
  vendor/openresolv/dist/pdnsd.in
  vendor/openresolv/dist/resolvconf.conf
  vendor/openresolv/dist/resolvconf.conf.5.in
  vendor/openresolv/dist/resolvconf.in
  vendor/openresolv/dist/unbound.in

Added: vendor/openresolv/dist/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/LICENSE  Wed Nov 20 22:13:14 2019
(r354917)
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2019 Roy Marples 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Modified: vendor/openresolv/dist/Makefile
==
--- vendor/openresolv/dist/Makefile Wed Nov 20 21:48:27 2019
(r354916)
+++ vendor/openresolv/dist/Makefile Wed Nov 20 22:13:14 2019
(r354917)
@@ -10,6 +10,7 @@ SYSCONFDIR?=  /etc
 LIBEXECDIR?=   /libexec/resolvconf
 VARDIR?=   /var/run/resolvconf
 
+ECHO?= echo
 INSTALL?=  install
 SED?=  sed
 
@@ -20,7 +21,7 @@ DOCMODE?= 0644
 MANMODE?=  0444
 
 RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
-SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
+SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
 TARGET=${RESOLVCONF} ${SUBSCRIBERS}
 SRCS=  ${TARGET:C,$,.in,} # pmake
 SRCS:= ${TARGET:=.in} # gmake
@@ -42,7 +43,7 @@ DISTINFOSIGN= ${DISTINFO}.asc
 CKSUM?=cksum -a SHA256
 PGP?=  netpgp
 
-FOSSILID?= current
+GITREF?=   HEAD
 
 .SUFFIXES: .in
 
@@ -79,15 +80,17 @@ maninstall:
 
 install: proginstall maninstall
 
-import:
+dist-git:
+   git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+   mkdir /tmp/${DISTPREFIX}
+   cp -RPp * /tmp/${DISTPREFIX}
+   (cd /tmp/${DISTPREFIX}; make clean)
+   tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
rm -rf /tmp/${DISTPREFIX}
-   ${INSTALL} -d /tmp/${DISTPREFIX}
-   cp README ${SRCS} /tmp/${DISTPREFIX}
 
-dist:
-   fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-   gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-   rm ${DISTFILEGZ}
+dist: dist-git
 
 distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
@@ -96,3 +99,20 @@ distinfo: dist
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+import: dist
+   rm -rf /tmp/${DISTPREFIX}
+   ${INSTALL} -d /tmp/${DISTPREFIX}
+   tar xvJpf ${DISTFILE} -C /tmp
+
+_import-src:
+   rm -rf ${DESTDIR}/*
+   ${INSTALL} -d ${DESTDIR}
+   cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR};
+   cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR};
+   @${ECHO}
+   @${ECHO} "="
+   @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}"
+
+import-src:
+   ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo 
"${DESTDIR}"; else  echo /tmp/${DISTPREFIX}; fi`

Added: vendor/openresolv/dist/README.md
==
--- /dev/nu

Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread John Baldwin
On 11/20/19 10:01 AM, Warner Losh wrote:
> On Wed, Nov 20, 2019 at 9:54 AM Li-Wen Hsu  wrote:
> 
>> Author: lwhsu
>> Date: Wed Nov 20 16:54:21 2019
>> New Revision: 354900
>> URL: https://svnweb.freebsd.org/changeset/base/354900
>>
>> Log:
>>   Use the correct variable, also limit the scope to bfd
>>
>>   PR:   242109
>>   Reported by:  jhb
>>   Sponsored by: The FreeBSD Foundation
>>
>> Modified:
>>   head/usr.sbin/jail/Makefile
>>
>> Modified: head/usr.sbin/jail/Makefile
>>
>> ==
>> --- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019(r354899)
>> +++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019(r354900)
>> @@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
>>  # workaround for GNU ld (GNU Binutils) 2.33.1:
>>  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
>>  # https://bugs.freebsd.org/242109
>> -.if ${MACHINE_ARCH} == "riscv"
>> +.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
>>
> 
> MACHINE isn't the right thing to use here. It's never the proper thing in
> userland makefiles, unless they are interfacing with the kernel.
> 
> MACHINE_CPUARCH is what you want here.

Eh, that claim doesn't seem quite true.  src.opts.mk only uses MACHINE and not
MACHINE_CPUARCH for example (to set _TT that is then used all over the
place in src.opts.mk).  My experience is that uses of *_CPUARCH are in fact
pretty rare.

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


svn commit: r354916 - svnadmin/conf

2019-11-20 Thread Joseph Mingrone
Author: jrm (ports committer)
Date: Wed Nov 20 21:48:27 2019
New Revision: 354916
URL: https://svnweb.freebsd.org/changeset/base/354916

Log:
  Allow csprng group to approve PRNG code changes
  
  Approved by:  core (brooks), csprng (cem), so (emaste)
  Differential Revision:https://reviews.freebsd.org/D22468

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Wed Nov 20 21:06:29 2019(r354915)
+++ svnadmin/conf/approvers Wed Nov 20 21:48:27 2019(r354916)
@@ -34,7 +34,7 @@
 ^svnadmin/conf/approvers   (core|re)
 ^svnadmin/conf/access  core
 ^head/LOCKScore
-^head/sys/dev/random   (security-officer|so|secteam|core)
-^head/sys/libkern/arc4random.c (security-officer|so|secteam|core)
-^stable/([7-9]|1[01])/sys/dev/random   (security-officer|so|secteam|core)
-^stable/([7-9]|1[01])/sys/libkern/arc4random.c 
(security-officer|so|secteam|core)
+^head/sys/dev/random   (security-officer|so|secteam|core|csprng)
+^head/sys/libkern/arc4random.c (security-officer|so|secteam|core|csprng)
+^stable/([7-9]|1[012])/sys/dev/random  
(security-officer|so|secteam|core|csprng)
+^stable/([7-9]|1[012])/sys/libkern/arc4random.c
(security-officer|so|secteam|core|csprng)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354915 - in head: etc/mtree share/man/man7 share/mk

2019-11-20 Thread Warner Losh
Author: imp
Date: Wed Nov 20 21:06:29 2019
New Revision: 354915
URL: https://svnweb.freebsd.org/changeset/base/354915

Log:
  Standardize EFI's ESP mount point.
  
  Mount the UEFI ESP on /boot/efi. No current system uses this by default, but
  there are many ad-hoc schemes that do this in /efi or /esp or /uefi and 
adding a
  new directory at the top-level would have a much higher likelihood of
  collision. Document this in /etc/mtree/BSD.root.mtree and create EFIDIR and
  related variables in bsd.own.mk.
  
  Differential Revision: https://reviews.freebsd.org/D21344

Modified:
  head/etc/mtree/BSD.root.dist
  head/share/man/man7/hier.7
  head/share/mk/bsd.own.mk

Modified: head/etc/mtree/BSD.root.dist
==
--- head/etc/mtree/BSD.root.distWed Nov 20 20:00:03 2019
(r354914)
+++ head/etc/mtree/BSD.root.distWed Nov 20 21:06:29 2019
(r354915)
@@ -18,6 +18,8 @@
 rockchip  tags=package=runtime
 ..
 ..
+efi
+..
 firmware
 ..
 lua

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Wed Nov 20 20:00:03 2019(r354914)
+++ head/share/man/man7/hier.7  Wed Nov 20 21:06:29 2019(r354915)
@@ -53,6 +53,8 @@ Compiled flattened device tree (FDT) files; see
 .Xr fdt 4
 and
 .Xr dtc 1
+.It Pa efi/
+Mount point for EFI System Partition (ESP) on UEFI systems.
 .It Pa firmware/
 loadable kernel modules containing binary firmware for hardware that needs
 firmware downloaded to it to function

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkWed Nov 20 20:00:03 2019(r354914)
+++ head/share/mk/bsd.own.mkWed Nov 20 21:06:29 2019(r354915)
@@ -56,6 +56,15 @@
 # KMODMODE KLD mode. [${BINMODE}]
 #
 #
+# EFIDIR   Base path for the UEFI ESP [/boot/efi]
+#
+# EFIOWN   EFIDIR owner. [root]
+#
+# EFIGRP   EFIDIR group. [wheel]
+#
+# EFIMODE  EFIDIR mode. [555]
+#
+#
 # SHAREDIR Base path for architecture-independent ascii
 #  text files. [/usr/share]
 #
@@ -169,6 +178,10 @@ DTBODIR?=  /boot/dtb/overlays
 DTBOWN?=   root
 DTBGRP?=   wheel
 DTBMODE?=  444
+EFIDIR?=   /boot/efi
+EFIOWN?=   root
+EFIGRP?=   wheel
+EFIMODE?=  555
 
 # Use make.conf / environment LIBDIR as default if set...
 .if !empty(_PREMK_LIBDIR)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354914 - head/sys/cam/scsi

2019-11-20 Thread Alexander Motin
Author: mav
Date: Wed Nov 20 20:00:03 2019
New Revision: 354914
URL: https://svnweb.freebsd.org/changeset/base/354914

Log:
  Set handling for some "Logical unit not ready" errors.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

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

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cWed Nov 20 19:55:43 2019
(r354913)
+++ head/sys/cam/scsi/scsi_all.cWed Nov 20 20:00:03 2019
(r354914)
@@ -1112,7 +1112,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x08, SS_FATAL | EBUSY,
"Logical unit not ready, long write in progress") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x09, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x09, SS_FATAL | EBUSY,
"Logical unit not ready, self-test in progress") },
/* DTLPWROMAEBKVF */
{ SST(0x04, 0x0A, SS_WAIT | ENXIO,
@@ -1130,37 +1130,37 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x0E, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, security session in progress") },
/* DT  WROM  B*/
-   { SST(0x04, 0x10, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x10, SS_FATAL | ENODEV,
"Logical unit not ready, auxiliary memory not accessible") },
/* DT  WRO AEB VF */
-   { SST(0x04, 0x11, SS_WAIT | EBUSY,
+   { SST(0x04, 0x11, SS_WAIT | ENXIO,
"Logical unit not ready, notify (enable spinup) required") },
/*MV  */
-   { SST(0x04, 0x12, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x12, SS_FATAL | ENXIO,
"Logical unit not ready, offline") },
/* DT   R MAEBKV  */
-   { SST(0x04, 0x13, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x13, SS_WAIT | EBUSY,
"Logical unit not ready, SA creation in progress") },
/* D B*/
-   { SST(0x04, 0x14, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x14, SS_WAIT | ENOSPC,
"Logical unit not ready, space allocation in progress") },
/*M   */
-   { SST(0x04, 0x15, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x15, SS_FATAL | ENXIO,
"Logical unit not ready, robotics disabled") },
/*M   */
-   { SST(0x04, 0x16, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x16, SS_FATAL | ENXIO,
"Logical unit not ready, configuration required") },
/*M   */
-   { SST(0x04, 0x17, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x17, SS_FATAL | ENXIO,
"Logical unit not ready, calibration required") },
/*M   */
-   { SST(0x04, 0x18, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x18, SS_FATAL | ENXIO,
"Logical unit not ready, a door is open") },
/*M   */
-   { SST(0x04, 0x19, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x19, SS_FATAL | ENODEV,
"Logical unit not ready, operating in sequential mode") },
/* DTB*/
-   { SST(0x04, 0x1A, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1A, SS_WAIT | EBUSY,
"Logical unit not ready, START/STOP UNIT command in progress") },
/* D B*/
{ SST(0x04, 0x1B, SS_WAIT | EBUSY,
@@ -1169,7 +1169,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO,
"Logical unit not ready, additional power use not yet granted") },
/* D  */
-   { SST(0x04, 0x1D, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1D, SS_WAIT | EBUSY,
"Logical unit not ready, configuration in progress") },
/* D  */
{ SST(0x04, 0x1E, SS_FATAL | ENXIO,
@@ -1178,14 +1178,20 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1F, SS_FATAL | ENXIO,
"Logical unit not ready, microcode download required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x20, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x20, SS_FATAL | ENXIO,
"Logical unit not ready, logical unit reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x21, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x21, SS_FATAL | ENXIO,
"Logical unit not ready, hard reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x22, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x22, SS_FATAL | ENXIO,
"Logical unit not ready, power cycle required") },
+   /* D  */
+   { SST(0x04, 0x23, SS_FATAL | ENXIO,
+   "Logical unit not ready, affiliation required") },
+   /* D  */
+   { SST(0x04, 0x24, SS_FATAL | EBUSY,
+   "Depopulation in progress") },
/* DTL WROMAEBKVF */
{ SST(0x05, 0x00, SS_RDEF,
"Logical unit does not respond to selection

svn commit: r354913 - head/sys/dev/random

2019-11-20 Thread Conrad Meyer
Author: cem
Date: Wed Nov 20 19:55:43 2019
New Revision: 354913
URL: https://svnweb.freebsd.org/changeset/base/354913

Log:
  random/ivy: Trivial refactoring
  
  It is clearer to me to return success/error (true/false) instead of some
  retry count linked to the inline assembly implementation.
  
  No functional change.
  
  Approved by:  core(csprng) => csprng(markm)
  Differential Revision:https://reviews.freebsd.org/D22454

Modified:
  head/sys/dev/random/ivy.c

Modified: head/sys/dev/random/ivy.c
==
--- head/sys/dev/random/ivy.c   Wed Nov 20 19:43:34 2019(r354912)
+++ head/sys/dev/random/ivy.c   Wed Nov 20 19:55:43 2019(r354913)
@@ -59,7 +59,7 @@ static struct random_source random_ivy = {
.rs_read = random_ivy_read
 };
 
-static int
+static bool
 x86_rdrand_store(u_long *buf)
 {
u_long rndval;
@@ -75,10 +75,10 @@ x86_rdrand_store(u_long *buf)
"2:"
: "+r" (retry), "=r" (rndval) : : "cc");
*buf = rndval;
-   return (retry);
+   return (retry != 0);
 }
 
-static int
+static bool
 x86_rdseed_store(u_long *buf)
 {
u_long rndval;
@@ -94,17 +94,17 @@ x86_rdseed_store(u_long *buf)
"2:"
: "+r" (retry), "=r" (rndval) : : "cc");
*buf = rndval;
-   return (retry);
+   return (retry != 0);
 }
 
-static int
+static bool
 x86_unimpl_store(u_long *buf __unused)
 {
 
panic("%s called", __func__);
 }
 
-DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf))
+DEFINE_IFUNC(static, bool, x86_rng_store, (u_long *buf))
 {
has_rdrand = (cpu_feature2 & CPUID2_RDRAND);
has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED);
@@ -127,7 +127,7 @@ random_ivy_read(void *buf, u_int c)
KASSERT(c % sizeof(*b) == 0, ("partial read %d", c));
b = buf;
for (count = c; count > 0; count -= sizeof(*b)) {
-   if (x86_rng_store(&rndval) == 0)
+   if (!x86_rng_store(&rndval))
break;
*b++ = rndval;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354912 - in head: contrib/netbsd-tests/usr.bin/unifdef usr.bin/unifdef

2019-11-20 Thread Conrad Meyer
Author: cem
Date: Wed Nov 20 19:43:34 2019
New Revision: 354912
URL: https://svnweb.freebsd.org/changeset/base/354912

Log:
  Re-apply fixed r354847
  
  unifdef(1): Improve worst-case bound on symbol resolution
  
  Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N)
  and O(N^2).
  
  While here, remove arbitrarily limit on number of macros understood.
  
  Reverts r354877 and r354878, which disabled the (correct) test.
  
  PR:   242095
  Reported by:  lwhsu

Modified:
  head/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh
  head/usr.bin/unifdef/unifdef.c

Modified: head/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh
==
--- head/contrib/netbsd-tests/usr.bin/unifdef/t_basic.shWed Nov 20 
19:07:22 2019(r354911)
+++ head/contrib/netbsd-tests/usr.bin/unifdef/t_basic.shWed Nov 20 
19:43:34 2019(r354912)
@@ -35,9 +35,6 @@ basic_head() {
 }
 
 basic_body() {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/242095";
-   fi
 
atf_check -s ignore -o file:$(atf_get_srcdir)/d_basic.out \
-x "unifdef -U__FreeBSD__ $(atf_get_srcdir)/d_basic.in"

Modified: head/usr.bin/unifdef/unifdef.c
==
--- head/usr.bin/unifdef/unifdef.c  Wed Nov 20 19:07:22 2019
(r354911)
+++ head/usr.bin/unifdef/unifdef.c  Wed Nov 20 19:43:34 2019
(r354912)
@@ -45,8 +45,11 @@
  *   it possible to handle all "dodgy" directives correctly.
  */
 
+#include 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 #include 
@@ -149,7 +152,6 @@ static char const * const linestate_name[] = {
  */
 #defineMAXDEPTH64  /* maximum #if nesting 
*/
 #defineMAXLINE 4096/* maximum length of 
line */
-#defineMAXSYMS 16384   /* maximum number of 
symbols */
 
 /*
  * Sometimes when editing a keyword the replacement text is longer, so
@@ -158,6 +160,26 @@ static char const * const linestate_name[] = {
 #defineEDITSLOP10
 
 /*
+ * C17/18 allow 63 characters per macro name, but up to 127 arbitrarily large
+ * parameters.
+ */
+struct macro {
+   RB_ENTRY(macro) entry;
+   const char  *name;
+   const char  *value;
+   boolignore; /* -iDsym or -iUsym */
+};
+
+static int
+macro_cmp(struct macro *a, struct macro *b)
+{
+   return (strcmp(a->name, b->name));
+}
+
+static RB_HEAD(MACROMAP, macro) macro_tree = RB_INITIALIZER(¯o_tree);
+RB_GENERATE_STATIC(MACROMAP, macro, entry, macro_cmp);
+
+/*
  * Globals.
  */
 
@@ -174,11 +196,6 @@ static bool symlist;   /* -s: output 
symbol
 static bool symdepth;  /* -S: output symbol depth */
 static bool text;  /* -t: this is a text file */
 
-static const char  *symname[MAXSYMS];  /* symbol name */
-static const char  *value[MAXSYMS];/* -Dsym=value */
-static bool ignore[MAXSYMS];   /* -iDsym or -iUsym */
-static int  nsyms; /* number of symbols */
-
 static FILE*input; /* input file pointer */
 static const char  *filename;  /* input file name */
 static int  linenum;   /* current line number */
@@ -227,12 +244,12 @@ static char*astrcat(const char *, const ch
 static void cleantemp(void);
 static void closeio(void);
 static void debug(const char *, ...);
-static void debugsym(const char *, int);
+static void debugsym(const char *, const struct macro *);
 static bool defundef(void);
 static void defundefile(const char *);
 static void done(void);
 static void error(const char *);
-static int  findsym(const char **);
+static struct macro*findsym(const char **);
 static void flushline(bool);
 static void hashline(void);
 static void help(void);
@@ -807,7 +824,7 @@ static Linetype
 parseline(void)
 {
const char *cp;
-   int cursym;
+   struct macro *cursym;
Linetype retval;
Comment_state wascomment;
 
@@ -829,15 +846,15 @@ parseline(void)
if ((cp = matchsym("ifdef", keyword)) != NULL ||
(cp = matchsym("ifndef", keyword)) != NULL) {
cp = skipcomment(cp);
-   if ((cursym = findsym(&cp)) < 0)
+   if ((cursym = findsym(&cp)) == NULL)
retval = LT_IF;
else {
retval = (keyword[2] == 'n')
? LT_FALSE : LT_TRUE;
-   if (value[cursym] == NULL)
+   if (cursym

svn commit: r354911 - head/usr.bin/unifdef

2019-11-20 Thread Conrad Meyer
Author: cem
Date: Wed Nov 20 19:07:22 2019
New Revision: 354911
URL: https://svnweb.freebsd.org/changeset/base/354911

Log:
  Revert r354847 for now
  
  It was broken.
  
  PR:   242095
  Reported by:  lwhsu

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

Modified: head/usr.bin/unifdef/unifdef.c
==
--- head/usr.bin/unifdef/unifdef.c  Wed Nov 20 19:07:08 2019
(r354910)
+++ head/usr.bin/unifdef/unifdef.c  Wed Nov 20 19:07:22 2019
(r354911)
@@ -45,11 +45,8 @@
  *   it possible to handle all "dodgy" directives correctly.
  */
 
-#include 
 #include 
-#include 
 
-#include 
 #include 
 #include 
 #include 
@@ -152,6 +149,7 @@ static char const * const linestate_name[] = {
  */
 #defineMAXDEPTH64  /* maximum #if nesting 
*/
 #defineMAXLINE 4096/* maximum length of 
line */
+#defineMAXSYMS 16384   /* maximum number of 
symbols */
 
 /*
  * Sometimes when editing a keyword the replacement text is longer, so
@@ -160,26 +158,6 @@ static char const * const linestate_name[] = {
 #defineEDITSLOP10
 
 /*
- * C17/18 allow 63 characters per macro name, but up to 127 arbitrarily large
- * parameters.
- */
-struct macro {
-   RB_ENTRY(macro) entry;
-   const char  *name;
-   const char  *value;
-   boolignore; /* -iDsym or -iUsym */
-};
-
-static int
-macro_cmp(struct macro *a, struct macro *b)
-{
-   return (strcmp(a->name, b->name));
-}
-
-static RB_HEAD(macrohd, macro) macro_tree = RB_INITIALIZER(¯o_tree);
-RB_GENERATE_STATIC(macrohd, macro, entry, macro_cmp);
-
-/*
  * Globals.
  */
 
@@ -196,6 +174,11 @@ static bool symlist;   /* -s: output 
symbol
 static bool symdepth;  /* -S: output symbol depth */
 static bool text;  /* -t: this is a text file */
 
+static const char  *symname[MAXSYMS];  /* symbol name */
+static const char  *value[MAXSYMS];/* -Dsym=value */
+static bool ignore[MAXSYMS];   /* -iDsym or -iUsym */
+static int  nsyms; /* number of symbols */
+
 static FILE*input; /* input file pointer */
 static const char  *filename;  /* input file name */
 static int  linenum;   /* current line number */
@@ -244,12 +227,12 @@ static char*astrcat(const char *, const ch
 static void cleantemp(void);
 static void closeio(void);
 static void debug(const char *, ...);
-static void debugsym(const char *, const struct macro *);
+static void debugsym(const char *, int);
 static bool defundef(void);
 static void defundefile(const char *);
 static void done(void);
 static void error(const char *);
-static struct macro*findsym(const char **);
+static int  findsym(const char **);
 static void flushline(bool);
 static void hashline(void);
 static void help(void);
@@ -824,7 +807,7 @@ static Linetype
 parseline(void)
 {
const char *cp;
-   struct macro *cursym;
+   int cursym;
Linetype retval;
Comment_state wascomment;
 
@@ -846,15 +829,15 @@ parseline(void)
if ((cp = matchsym("ifdef", keyword)) != NULL ||
(cp = matchsym("ifndef", keyword)) != NULL) {
cp = skipcomment(cp);
-   if ((cursym = findsym(&cp)) == NULL)
+   if ((cursym = findsym(&cp)) < 0)
retval = LT_IF;
else {
retval = (keyword[2] == 'n')
? LT_FALSE : LT_TRUE;
-   if (cursym->value == NULL)
+   if (value[cursym] == NULL)
retval = (retval == LT_TRUE)
? LT_FALSE : LT_TRUE;
-   if (cursym->ignore)
+   if (ignore[cursym])
retval = (retval == LT_TRUE)
? LT_TRUEI : LT_FALSEI;
}
@@ -1054,7 +1037,7 @@ eval_unary(const struct ops *ops, long *valp, const ch
 {
const char *cp;
char *ep;
-   struct macro *sym;
+   int sym;
bool defparen;
Linetype lt;
 
@@ -1119,27 +1102,27 @@ eval_unary(const struct ops *ops, long *valp, const ch
debug("eval%d defined missing ')'", prec(ops));
return (LT_ERROR);
}
-   if (sym == NULL) {
+   if (sym < 0) {
debug("eval%d defined unknown", prec(ops));
lt = LT_IF;
} else {
-   debug("eval%d

svn commit: r354910 - head

2019-11-20 Thread Dimitry Andric
Author: dim
Date: Wed Nov 20 19:07:08 2019
New Revision: 354910
URL: https://svnweb.freebsd.org/changeset/base/354910

Log:
  Fix typo: deprected -> deprecated.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 20 18:36:58 2019(r354909)
+++ head/UPDATING   Wed Nov 20 19:07:08 2019(r354910)
@@ -32,7 +32,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
for automounting.
 
 20191120:
-   Defining the long deprected NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB,
+   Defining the long deprecated NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB,
NO_MAN, NO_PROFILE, and NO_WARNS variables is now an error.  Update
your Makefiles and scripts to define MK_=no instead as required.
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354909 - in head: . share/mk

2019-11-20 Thread Brooks Davis
Author: brooks
Date: Wed Nov 20 18:36:58 2019
New Revision: 354909
URL: https://svnweb.freebsd.org/changeset/base/354909

Log:
  Make the warning for deprecated NO_ variables an error.
  
  Support for NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB, NO_MAN, NO_PROFILE,
  and NO_WARNS as deprecated in 2014 with a warning added for each one
  found. Turn these into error in preperation for removal of compatability
  support before FreeBSD 13.
  
  Reviewed by:  imp
  Relnotes: yes
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D22448

Modified:
  head/UPDATING
  head/share/mk/bsd.opts.mk

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 20 18:12:01 2019(r354908)
+++ head/UPDATING   Wed Nov 20 18:36:58 2019(r354909)
@@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
removed in the future.  As of FreeBSD 10.1 the autofs(5) is available
for automounting.
 
+20191120:
+   Defining the long deprected NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB,
+   NO_MAN, NO_PROFILE, and NO_WARNS variables is now an error.  Update
+   your Makefiles and scripts to define MK_=no instead as required.
+
+   One exception to this is that program or library Makefiles should
+   define MAN to empty rather than setting MK_MAN=no.
+
 20191107:
The nctgpio and wbwd drivers have been moved to the superio bus.
If you have one of these drivers in a kernel configuration, then

Modified: head/share/mk/bsd.opts.mk
==
--- head/share/mk/bsd.opts.mk   Wed Nov 20 18:12:01 2019(r354908)
+++ head/share/mk/bsd.opts.mk   Wed Nov 20 18:36:58 2019(r354909)
@@ -100,7 +100,7 @@ __DEFAULT_DEPENDENT_OPTIONS = \
 PROFILE \
 WARNS
 .if defined(NO_${var})
-.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no 
instead."
+.error "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
 MK_${var}:=no
 .endif
 .endfor
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354908 - in head/lib/clang: libclang libllvm libllvmminimal

2019-11-20 Thread Dimitry Andric
Author: dim
Date: Wed Nov 20 18:12:01 2019
New Revision: 354908
URL: https://svnweb.freebsd.org/changeset/base/354908

Log:
  Add explanatory comments for the different SRCS_xxx variables used in
  the Makefiles for libllvm and libclang.  While here, cleanup a commented
  out SRCS entry in libllvmminimal's Makefile.
  
  MFC after:3 days

Modified:
  head/lib/clang/libclang/Makefile
  head/lib/clang/libllvm/Makefile
  head/lib/clang/libllvmminimal/Makefile

Modified: head/lib/clang/libclang/Makefile
==
--- head/lib/clang/libclang/MakefileWed Nov 20 18:00:43 2019
(r354907)
+++ head/lib/clang/libclang/MakefileWed Nov 20 18:12:01 2019
(r354908)
@@ -20,6 +20,12 @@ CXXFLAGS.Module.cpp+= -fpermissive
 
 SRCDIR=tools/clang/lib
 
+# Explanation of different SRCS variants below:
+# SRCS_MIN:always required, even for bootstrap
+# SRCS_EXT:required for MK_CLANG_EXTRAS
+# SRCS_FUL:required for MK_CLANG_FULL
+# SRCS_LDB:required for MK_LLDB
+
 SRCS_FUL+= ARCMigrate/ARCMT.cpp
 SRCS_FUL+= ARCMigrate/ARCMTActions.cpp
 SRCS_FUL+= ARCMigrate/FileRemapper.cpp

Modified: head/lib/clang/libllvm/Makefile
==
--- head/lib/clang/libllvm/Makefile Wed Nov 20 18:00:43 2019
(r354907)
+++ head/lib/clang/libllvm/Makefile Wed Nov 20 18:12:01 2019
(r354908)
@@ -26,6 +26,17 @@ CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch}
 
 SRCDIR=lib
 
+# Explanation of different SRCS variants below:
+# SRCS_MIN:always required, even for bootstrap
+# SRCS_MIW:required for world stage (after cross-tools)
+# SRCS_EXT:required for MK_CLANG_EXTRAS
+# SRCS_EXL:required for MK_CLANG_EXTRAS and MK_LLD
+# SRCS_FUL:required for MK_CLANG_FULL
+# SRCS_LLD:required for MK_LLD
+# SRCS_XDB:required for MK_CLANG_EXTRAS and MK_LLDB
+# SRCS_XDL:required for MK_CLANG_EXTRAS, MK_LLD and MK_LLDB
+# SRCS_XDW:required for MK_CLANG_EXTRAS and MK_LLDB in world stage
+
 SRCS_MIN+= Analysis/AliasAnalysis.cpp
 SRCS_MIN+= Analysis/AliasAnalysisEvaluator.cpp
 SRCS_MIN+= Analysis/AliasAnalysisSummary.cpp

Modified: head/lib/clang/libllvmminimal/Makefile
==
--- head/lib/clang/libllvmminimal/Makefile  Wed Nov 20 18:00:43 2019
(r354907)
+++ head/lib/clang/libllvmminimal/Makefile  Wed Nov 20 18:12:01 2019
(r354908)
@@ -10,7 +10,6 @@ SRCS+=Demangle/ItaniumDemangle.cpp
 SRCS+= Support/APFloat.cpp
 SRCS+= Support/APInt.cpp
 SRCS+= Support/ARMTargetParser.cpp
-#SRCS+=Support/Atomic.cpp
 SRCS+= Support/CodeGenCoverage.cpp
 SRCS+= Support/CommandLine.cpp
 SRCS+= Support/ConvertUTF.cpp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354899 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 9:58 AM Li-Wen Hsu  wrote:

> On Thu, Nov 21, 2019 at 12:42 AM John Baldwin  wrote:
> >
> > On 11/20/19 8:35 AM, Li-Wen Hsu wrote:
> > > Author: lwhsu
> > > Date: Wed Nov 20 16:35:58 2019
> > > New Revision: 354899
> > > URL: https://svnweb.freebsd.org/changeset/base/354899
> > >
> > > Log:
> > >   Limit the workaround to riscv only
> > >
> > >   PR: 242109
> > >   Sponsored by:   The FreeBSD Foundation
> > >
> > > Modified:
> > >   head/usr.sbin/jail/Makefile
> > >
> > > Modified: head/usr.sbin/jail/Makefile
> > >
> ==
> > > --- head/usr.sbin/jail/Makefile   Wed Nov 20 16:32:13 2019
> (r354898)
> > > +++ head/usr.sbin/jail/Makefile   Wed Nov 20 16:35:58 2019
> (r354899)
> > > @@ -18,7 +18,9 @@ CFLAGS+=-I. -I${.CURDIR}
> > >  # workaround for GNU ld (GNU Binutils) 2.33.1:
> > >  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
> > >  # https://bugs.freebsd.org/242109
> > > +.if ${MACHINE_ARCH} == "riscv"
> > >  CFLAGS+=-Wl,--no-relax
> > > +.endif
> >
> > Eh, will that work?  I think MACHINE and MACHINE_CPUARCH are riscv,
> > but MACHINE_ARCH is riscv64 and riscv64sf.
>
> No it doesn't. I was too lazy to do scp from test machine to commit
> machine and caused a copy-n-paste error, but ${MACHINE} should be
> better since it covers more.
>

No. MACHINE_CPUARCH is better because it is userland. This isn't a kernel
interface thing, so MACHINE is the wrong thing to use.

Warner


> > Also, it would be good to wrap this in .if ${LINKER_TYPE} == "bfd" I
> think.
>
> Also added in r354900. Thanks for the suggestion.
>
> > (I was able to build a world + kernel with lld earlier this week, though
> it
> >  doesn't yet boot)
>
> Looking forward to building world & kernel with llvm toolchain.
>
> Thanks,
> Li-Wen
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Warner Losh
On Wed, Nov 20, 2019 at 9:54 AM Li-Wen Hsu  wrote:

> Author: lwhsu
> Date: Wed Nov 20 16:54:21 2019
> New Revision: 354900
> URL: https://svnweb.freebsd.org/changeset/base/354900
>
> Log:
>   Use the correct variable, also limit the scope to bfd
>
>   PR:   242109
>   Reported by:  jhb
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/usr.sbin/jail/Makefile
>
> Modified: head/usr.sbin/jail/Makefile
>
> ==
> --- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019(r354899)
> +++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019(r354900)
> @@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
>  # workaround for GNU ld (GNU Binutils) 2.33.1:
>  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
>  # https://bugs.freebsd.org/242109
> -.if ${MACHINE_ARCH} == "riscv"
> +.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
>

MACHINE isn't the right thing to use here. It's never the proper thing in
userland makefiles, unless they are interfacing with the kernel.

MACHINE_CPUARCH is what you want here.

Warner

>  CFLAGS+=-Wl,--no-relax
>  .endif
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354907 - head/sys/vm

2019-11-20 Thread Andrew Turner
Author: andrew
Date: Wed Nov 20 18:00:43 2019
New Revision: 354907
URL: https://svnweb.freebsd.org/changeset/base/354907

Log:
  As with r354905 use uint16_t to store aflags on the stack and as function
  arguments as the aflags size in vm_page_t has increased.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Nov 20 17:57:46 2019(r354906)
+++ head/sys/vm/vm_page.c   Wed Nov 20 18:00:43 2019(r354907)
@@ -433,7 +433,7 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS)
  * Nonetheless, it write busies the page as a safety precaution.
  */
 static void
-vm_page_init_marker(vm_page_t marker, int queue, uint8_t aflags)
+vm_page_init_marker(vm_page_t marker, int queue, uint16_t aflags)
 {
 
bzero(marker, sizeof(*marker));
@@ -3175,7 +3175,7 @@ static inline void
 vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m)
 {
struct vm_domain *vmd;
-   uint8_t qflags;
+   uint16_t qflags;
 
CRITICAL_ASSERT(curthread);
vm_pagequeue_assert_locked(pq);
@@ -3421,7 +3421,7 @@ void
 vm_page_dequeue(vm_page_t m)
 {
struct vm_pagequeue *pq, *pq1;
-   uint8_t aflags;
+   uint16_t aflags;
 
KASSERT(mtx_owned(vm_page_lockptr(m)) || m->ref_count == 0,
("page %p is allocated and unlocked", m));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-11-20 Thread Ed Maste
Author: emaste
Date: Wed Nov 20 17:57:46 2019
New Revision: 354906
URL: https://svnweb.freebsd.org/changeset/base/354906

Log:
  src.conf.5: regen for several recent changes
  
  r354289 armv6: Switch to LLD by default
  r354290 Take arm.arm (armv5) out of universe
  r354348 armv6, armv7: Switch to llvm-libunwind by default
  r354660 Enable the RISC-V LLVM backend by default.
  
  as well as lib32 changes
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Nov 20 17:49:58 2019
(r354905)
+++ head/share/man/man5/src.conf.5  Wed Nov 20 17:57:46 2019
(r354906)
@@ -197,7 +197,7 @@ as part
 of the normal system build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
+amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
 .It Va WITHOUT_BINUTILS_BOOTSTRAP
 Set to not build binutils (as, ld, and objdump)
 as part of the bootstrap process.
@@ -213,7 +213,7 @@ Set build binutils (as, ld, and objdump)
 as part of the bootstrap process.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
+amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf and sparc64/sparc64.
 .It Va WITHOUT_BLACKLIST
 Set this if you do not want to build
 .Xr blacklistd 8
@@ -268,7 +268,7 @@ and
 .Pa crtend.o .
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, 
mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
+amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
 .It Va WITH_BSD_GREP
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
 .It Va WITHOUT_BSNMP
@@ -365,7 +365,7 @@ When set, it enforces these options:
 Set to not build the Clang C/C++ compiler during the regular phase of the 
build.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+sparc64/sparc64.
 When set, it enforces these options:
 .Pp
 .Bl -item -compact
@@ -400,6 +400,10 @@ is set explicitly)
 (unless
 .Va WITH_LLVM_TARGET_POWERPC
 is set explicitly)
+.It Va WITHOUT_LLVM_TARGET_RISCV
+(unless
+.Va WITH_LLVM_TARGET_RISCV
+is set explicitly)
 .It Va WITHOUT_LLVM_TARGET_SPARC
 (unless
 .Va WITH_LLVM_TARGET_SPARC
@@ -413,7 +417,7 @@ is set explicitly)
 Set to build the Clang C/C++ compiler during the normal phase of the build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
+amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
 .It Va WITHOUT_CLANG_BOOTSTRAP
 Set to not build the Clang C/C++ compiler during the bootstrap phase of
 the build.
@@ -426,7 +430,7 @@ riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, 
 Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
+amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386.
 .It Va WITH_CLANG_EXTRAS
 Set to build additional clang and llvm tools, such as bugpoint and
 clang-format.
@@ -435,13 +439,13 @@ Set to avoid building the ARCMigrate, Rewriter and Sta
 the Clang C/C++ compiler.
 .Pp
 This is a default setting on
-riscv/riscv64 and sparc64/sparc64.
+sparc64/sparc64.
 .It Va WITH_CLANG_FULL
 Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
 Clang C/C++ compiler.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf.
+amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mi

svn commit: r354905 - head/sys/vm

2019-11-20 Thread Andrew Turner
Author: andrew
Date: Wed Nov 20 17:49:58 2019
New Revision: 354905
URL: https://svnweb.freebsd.org/changeset/base/354905

Log:
  Use atomic_load_16 to load aflags as it's a uint16_t after r354820.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Nov 20 17:49:32 2019(r354904)
+++ head/sys/vm/vm_page.c   Wed Nov 20 17:49:58 2019(r354905)
@@ -3185,7 +3185,7 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa
 * the page queue lock held.  In this case it is about to free the page,
 * which must not have any queue state.
 */
-   qflags = atomic_load_8(&m->aflags);
+   qflags = atomic_load_16(&m->aflags);
KASSERT(pq == vm_page_pagequeue(m) ||
(qflags & PGA_QUEUE_STATE_MASK) == 0,
("page %p doesn't belong to queue %p but has aflags %#x",
@@ -3433,7 +3433,7 @@ vm_page_dequeue(vm_page_t m)
 * vm_page_dequeue_complete().  Ensure that all queue
 * state is cleared before we return.
 */
-   aflags = atomic_load_8(&m->aflags);
+   aflags = atomic_load_16(&m->aflags);
if ((aflags & PGA_QUEUE_STATE_MASK) == 0)
return;
KASSERT((aflags & PGA_DEQUEUE) != 0,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-11-20 Thread Ed Maste
Author: emaste
Date: Wed Nov 20 17:49:32 2019
New Revision: 354904
URL: https://svnweb.freebsd.org/changeset/base/354904

Log:
  src.conf.5: regen after r354902, WITHOUT_AMD by default

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Nov 20 17:45:31 2019
(r354903)
+++ head/share/man/man5/src.conf.5  Wed Nov 20 17:49:32 2019
(r354904)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd October 23, 2019
+.Dd November 20, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -100,8 +100,8 @@ Set to not build
 .Xr acpiconf 8 ,
 .Xr acpidump 8
 and related programs.
-.It Va WITHOUT_AMD
-Set to not build
+.It Va WITH_AMD
+Set to build
 .Xr amd 8 ,
 and related programs.
 .It Va WITHOUT_APM
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354903 - head/tools/build/options

2019-11-20 Thread Ed Maste
Author: emaste
Date: Wed Nov 20 17:45:31 2019
New Revision: 354903
URL: https://svnweb.freebsd.org/changeset/base/354903

Log:
  Add description for WITH_AMD
  
  WITHOUT_AMD is now the default as of r354902.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/tools/build/options/WITH_AMD
 - copied, changed from r354901, head/tools/build/options/WITHOUT_AMD

Copied and modified: head/tools/build/options/WITH_AMD (from r354901, 
head/tools/build/options/WITHOUT_AMD)
==
--- head/tools/build/options/WITHOUT_AMDWed Nov 20 17:24:49 2019
(r354901, copy source)
+++ head/tools/build/options/WITH_AMD   Wed Nov 20 17:45:31 2019
(r354903)
@@ -1,4 +1,4 @@
 .\" $FreeBSD$
-Set to not build
+Set to build
 .Xr amd 8 ,
 and related programs.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354902 - in head: . share/mk

2019-11-20 Thread Ed Maste
Author: emaste
Date: Wed Nov 20 17:37:45 2019
New Revision: 354902
URL: https://svnweb.freebsd.org/changeset/base/354902

Log:
  disable amd(8) by default
  
  As of FreeBSD 10.1 the autofs(5) is available for automounting, and the
  amd man page has indicated that the in-tree copy of amd is obsolete.
  Disable it by default for now, with the expectation that it will be
  removed before FreeBSD 13.0.
  
  Reviewed by:  kevans
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D22460

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

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 20 17:24:49 2019(r354901)
+++ head/UPDATING   Wed Nov 20 17:37:45 2019(r354902)
@@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20191120:
+   The amd(8) automount daemon has been disabled by default, and will be
+   removed in the future.  As of FreeBSD 10.1 the autofs(5) is available
+   for automounting.
+
 20191107:
The nctgpio and wbwd drivers have been moved to the superio bus.
If you have one of these drivers in a kernel configuration, then

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Wed Nov 20 17:24:49 2019(r354901)
+++ head/share/mk/src.opts.mk   Wed Nov 20 17:37:45 2019(r354902)
@@ -55,7 +55,6 @@ :
 __DEFAULT_YES_OPTIONS = \
 ACCT \
 ACPI \
-AMD \
 APM \
 AT \
 ATM \
@@ -193,6 +192,7 @@ __DEFAULT_YES_OPTIONS = \
 ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
+AMD \
 BEARSSL \
 BSD_GREP \
 CLANG_EXTRAS \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354901 - head/usr.bin/xinstall

2019-11-20 Thread Alex Richardson
Author: arichardson
Date: Wed Nov 20 17:24:49 2019
New Revision: 354901
URL: https://svnweb.freebsd.org/changeset/base/354901

Log:
  Allow boostrapping xinstall on Linux
  
  Linux does not have st_flags so we have to avoid using it there.
  
  Reviewed By:  emaste, imp
  Differential Revision: https://reviews.freebsd.org/D22446

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

Modified: head/usr.bin/xinstall/Makefile
==
--- head/usr.bin/xinstall/Makefile  Wed Nov 20 16:54:21 2019
(r354900)
+++ head/usr.bin/xinstall/Makefile  Wed Nov 20 17:24:49 2019
(r354901)
@@ -11,7 +11,6 @@ MAN=  install.1
 .PATH: ${SRCTOP}/contrib/mtree
 CFLAGS+=   -I${SRCTOP}/contrib/mtree
 CFLAGS+=   -I${SRCTOP}/lib/libnetbsd
-CFLAGS+=   -DHAVE_STRUCT_STAT_ST_FLAGS=1
 
 LIBADD=md
 

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cWed Nov 20 16:54:21 2019
(r354900)
+++ head/usr.bin/xinstall/xinstall.cWed Nov 20 17:24:49 2019
(r354901)
@@ -75,6 +75,17 @@ __FBSDID("$FreeBSD$");
 
 #include "mtree.h"
 
+/*
+ * We need to build xinstall during the bootstrap stage when building on a
+ * non-FreeBSD system. Linux does not have the st_flags and st_birthtime
+ * members in struct stat so we need to omit support for changing those fields.
+ */
+#ifdef UF_SETTABLE
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#else
+#define HAVE_STRUCT_STAT_ST_FLAGS 0
+#endif
+
 #define MAX_CMP_SIZE   (16 * 1024 * 1024)
 
 #defineLN_ABSOLUTE 0x01
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354899 - head/usr.sbin/jail

2019-11-20 Thread Li-Wen Hsu
On Thu, Nov 21, 2019 at 12:42 AM John Baldwin  wrote:
>
> On 11/20/19 8:35 AM, Li-Wen Hsu wrote:
> > Author: lwhsu
> > Date: Wed Nov 20 16:35:58 2019
> > New Revision: 354899
> > URL: https://svnweb.freebsd.org/changeset/base/354899
> >
> > Log:
> >   Limit the workaround to riscv only
> >
> >   PR: 242109
> >   Sponsored by:   The FreeBSD Foundation
> >
> > Modified:
> >   head/usr.sbin/jail/Makefile
> >
> > Modified: head/usr.sbin/jail/Makefile
> > ==
> > --- head/usr.sbin/jail/Makefile   Wed Nov 20 16:32:13 2019
> > (r354898)
> > +++ head/usr.sbin/jail/Makefile   Wed Nov 20 16:35:58 2019
> > (r354899)
> > @@ -18,7 +18,9 @@ CFLAGS+=-I. -I${.CURDIR}
> >  # workaround for GNU ld (GNU Binutils) 2.33.1:
> >  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
> >  # https://bugs.freebsd.org/242109
> > +.if ${MACHINE_ARCH} == "riscv"
> >  CFLAGS+=-Wl,--no-relax
> > +.endif
>
> Eh, will that work?  I think MACHINE and MACHINE_CPUARCH are riscv,
> but MACHINE_ARCH is riscv64 and riscv64sf.

No it doesn't. I was too lazy to do scp from test machine to commit
machine and caused a copy-n-paste error, but ${MACHINE} should be
better since it covers more.

> Also, it would be good to wrap this in .if ${LINKER_TYPE} == "bfd" I think.

Also added in r354900. Thanks for the suggestion.

> (I was able to build a world + kernel with lld earlier this week, though it
>  doesn't yet boot)

Looking forward to building world & kernel with llvm toolchain.

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


svn commit: r354900 - head/usr.sbin/jail

2019-11-20 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Nov 20 16:54:21 2019
New Revision: 354900
URL: https://svnweb.freebsd.org/changeset/base/354900

Log:
  Use the correct variable, also limit the scope to bfd
  
  PR:   242109
  Reported by:  jhb
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/jail/Makefile

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019(r354899)
+++ head/usr.sbin/jail/Makefile Wed Nov 20 16:54:21 2019(r354900)
@@ -18,7 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}
 # workaround for GNU ld (GNU Binutils) 2.33.1:
 #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
 # https://bugs.freebsd.org/242109
-.if ${MACHINE_ARCH} == "riscv"
+.if ${LINKER_TYPE} == "bfd" && ${MACHINE} == "riscv"
 CFLAGS+=-Wl,--no-relax
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354899 - head/usr.sbin/jail

2019-11-20 Thread John Baldwin
On 11/20/19 8:35 AM, Li-Wen Hsu wrote:
> Author: lwhsu
> Date: Wed Nov 20 16:35:58 2019
> New Revision: 354899
> URL: https://svnweb.freebsd.org/changeset/base/354899
> 
> Log:
>   Limit the workaround to riscv only
>   
>   PR: 242109
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/usr.sbin/jail/Makefile
> 
> Modified: head/usr.sbin/jail/Makefile
> ==
> --- head/usr.sbin/jail/Makefile   Wed Nov 20 16:32:13 2019
> (r354898)
> +++ head/usr.sbin/jail/Makefile   Wed Nov 20 16:35:58 2019
> (r354899)
> @@ -18,7 +18,9 @@ CFLAGS+=-I. -I${.CURDIR}
>  # workaround for GNU ld (GNU Binutils) 2.33.1:
>  #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
>  # https://bugs.freebsd.org/242109
> +.if ${MACHINE_ARCH} == "riscv"
>  CFLAGS+=-Wl,--no-relax
> +.endif

Eh, will that work?  I think MACHINE and MACHINE_CPUARCH are riscv,
but MACHINE_ARCH is riscv64 and riscv64sf.

Also, it would be good to wrap this in .if ${LINKER_TYPE} == "bfd" I think.

(I was able to build a world + kernel with lld earlier this week, though it
 doesn't yet boot)

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


svn commit: r354899 - head/usr.sbin/jail

2019-11-20 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Nov 20 16:35:58 2019
New Revision: 354899
URL: https://svnweb.freebsd.org/changeset/base/354899

Log:
  Limit the workaround to riscv only
  
  PR:   242109
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/jail/Makefile

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Wed Nov 20 16:32:13 2019(r354898)
+++ head/usr.sbin/jail/Makefile Wed Nov 20 16:35:58 2019(r354899)
@@ -18,7 +18,9 @@ CFLAGS+=-I. -I${.CURDIR}
 # workaround for GNU ld (GNU Binutils) 2.33.1:
 #   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
 # https://bugs.freebsd.org/242109
+.if ${MACHINE_ARCH} == "riscv"
 CFLAGS+=-Wl,--no-relax
+.endif
 
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-11-20 Thread Alan Cox
Author: alc
Date: Wed Nov 20 16:32:13 2019
New Revision: 354898
URL: https://svnweb.freebsd.org/changeset/base/354898

Log:
  Until every possible root cause for an "invalid ASID" assertion failure is
  resolved, assign every pmap a valid ASID when it is first initialized.

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Nov 20 16:30:37 2019(r354897)
+++ head/sys/arm64/arm64/pmap.c Wed Nov 20 16:32:13 2019(r354898)
@@ -1556,6 +1556,8 @@ pmap_pinit(pmap_t pmap)
pmap->pm_root.rt_root = 0;
bzero(&pmap->pm_stats, sizeof(pmap->pm_stats));
pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX);
+   /* XXX Temporarily disable deferred ASID allocation. */
+   pmap_alloc_asid(pmap);
 
return (1);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354897 - head/crypto/openssh

2019-11-20 Thread Ed Maste
Author: emaste
Date: Wed Nov 20 16:30:37 2019
New Revision: 354897
URL: https://svnweb.freebsd.org/changeset/base/354897

Log:
  sshd: make getpwclass wrapper MON_ISAUTH not MON_AUTH
  
  In r339216 a privsep wrapper was added for login_getpwclass to address
  PR 231172.  Unfortunately the change used the MON_AUTH flag in the
  wrapper, and MON_AUTH includes MON_AUTHDECIDE which triggers an
  auth_log() on each invocation.  getpwclass() does not participate in the
  authentication decision, so should be MON_ISAUTH instead.
  
  PR:   234793
  Submitted by: Henry Hu
  Reviewed by:  Yuichiro NAITO
  MFC after:1 week

Modified:
  head/crypto/openssh/monitor.c

Modified: head/crypto/openssh/monitor.c
==
--- head/crypto/openssh/monitor.c   Wed Nov 20 16:20:49 2019
(r354896)
+++ head/crypto/openssh/monitor.c   Wed Nov 20 16:30:37 2019
(r354897)
@@ -193,7 +193,7 @@ struct mon_table mon_dispatch_proto20[] = {
 #endif
 {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign},
 #ifdef HAVE_LOGIN_CAP
-{MONITOR_REQ_GETPWCLASS, MON_AUTH, mm_answer_login_getpwclass},
+{MONITOR_REQ_GETPWCLASS, MON_ISAUTH, mm_answer_login_getpwclass},
 #endif
 {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow},
 {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv},
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354896 - head/usr.sbin/jail

2019-11-20 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Nov 20 16:20:49 2019
New Revision: 354896
URL: https://svnweb.freebsd.org/changeset/base/354896

Log:
  Workaround riscv64 build when using binutils 2.33.1
  
  PR:   242109
  Reviewed by:  bapt
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D22457

Modified:
  head/usr.sbin/jail/Makefile

Modified: head/usr.sbin/jail/Makefile
==
--- head/usr.sbin/jail/Makefile Wed Nov 20 16:06:48 2019(r354895)
+++ head/usr.sbin/jail/Makefile Wed Nov 20 16:20:49 2019(r354896)
@@ -15,6 +15,11 @@ NO_WMISSING_VARIABLE_DECLARATIONS=
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}
 
+# workaround for GNU ld (GNU Binutils) 2.33.1:
+#   relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR2'
+# https://bugs.freebsd.org/242109
+CFLAGS+=-Wl,--no-relax
+
 .if ${MK_INET6_SUPPORT} != "no"
 CFLAGS+= -DINET6
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354895 - in head/sys: security/mac vm

2019-11-20 Thread Doug Moore
Author: dougm
Date: Wed Nov 20 16:06:48 2019
New Revision: 354895
URL: https://svnweb.freebsd.org/changeset/base/354895

Log:
  Instead of looking up a predecessor or successor to the current map
  entry, when that entry has been seen already, keep the
  already-looked-up value in a variable and use that instead of looking
  it up again.
  
  Approved by: alc, markj (earlier version), kib (earlier version)
  Differential Revision: https://reviews.freebsd.org/D22348

Modified:
  head/sys/security/mac/mac_process.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h

Modified: head/sys/security/mac/mac_process.c
==
--- head/sys/security/mac/mac_process.c Wed Nov 20 14:37:48 2019
(r354894)
+++ head/sys/security/mac/mac_process.c Wed Nov 20 16:06:48 2019
(r354895)
@@ -252,7 +252,7 @@ static void
 mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred,
 struct vm_map *map)
 {
-   vm_map_entry_t vme;
+   vm_map_entry_t prev, vme;
int result;
vm_prot_t revokeperms;
vm_object_t backing_object, object;
@@ -263,8 +263,10 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct u
if (!mac_mmap_revocation)
return;
 
+   prev = &map->header;
vm_map_lock(map);
-   VM_MAP_ENTRY_FOREACH(vme, map) {
+   for (vme = vm_map_entry_first(map); vme != &map->header;
+   prev = vme, vme = vm_map_entry_succ(prev)) {
if (vme->eflags & MAP_ENTRY_IS_SUB_MAP) {
mac_proc_vm_revoke_recurse(td, cred,
vme->object.sub_map);
@@ -363,8 +365,7 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct u
}
pmap_protect(map->pmap, vme->start, vme->end,
vme->protection & ~revokeperms);
-   vm_map_try_merge_entries(map, vm_map_entry_pred(vme),
-   vme);
+   vm_map_try_merge_entries(map, prev, vme);
}
}
vm_map_unlock(map);

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cWed Nov 20 14:37:48 2019(r354894)
+++ head/sys/vm/vm_map.cWed Nov 20 16:06:48 2019(r354895)
@@ -978,6 +978,21 @@ vm_map_entry_max_free_right(vm_map_entry_t root, vm_ma
root->right->max_free : right_ancestor->start - root->end);
 }
 
+/*
+ * vm_map_entry_{pred,succ}:
+ *
+ * Find the {predecessor, successor} of the entry by taking one step
+ * in the appropriate direction and backtracking as much as necessary.
+ */
+static inline vm_map_entry_t
+vm_map_entry_pred(vm_map_entry_t entry)
+{
+
+   return (entry->prev);
+}
+
+/* vm_map_entry_succ is defined in vm_map.h. */
+
 #define SPLAY_LEFT_STEP(root, y, rlist, test) do { \
vm_size_t max_free; \
\
@@ -1412,7 +1427,7 @@ int
 vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
 vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow)
 {
-   vm_map_entry_t new_entry, prev_entry;
+   vm_map_entry_t new_entry, next_entry, prev_entry;
struct ucred *cred;
vm_eflags_t protoeflags;
vm_inherit_t inheritance;
@@ -1443,7 +1458,8 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof
/*
 * Assert that the next entry doesn't overlap the end point.
 */
-   if (vm_map_entry_succ(prev_entry)->start < end)
+   next_entry = vm_map_entry_succ(prev_entry);
+   if (next_entry->start < end)
return (KERN_NO_SPACE);
 
if ((cow & MAP_CREATE_GUARD) != 0 && (object != NULL ||
@@ -1538,8 +1554,7 @@ charged:
map->size += end - prev_entry->end;
vm_map_entry_resize(map, prev_entry,
end - prev_entry->end);
-   vm_map_try_merge_entries(map, prev_entry,
-   vm_map_entry_succ(prev_entry));
+   vm_map_try_merge_entries(map, prev_entry, next_entry);
return (KERN_SUCCESS);
}
 
@@ -1600,7 +1615,7 @@ charged:
 * other cases, which are less common.
 */
vm_map_try_merge_entries(map, prev_entry, new_entry);
-   vm_map_try_merge_entries(map, new_entry, vm_map_entry_succ(new_entry));
+   vm_map_try_merge_entries(map, new_entry, next_entry);
 
if ((cow & (MAP_PREFAULT | MAP_PREFAULT_PARTIAL)) != 0) {
vm_map_pmap_enter(map, start, prot, object, OFF_TO_IDX(offset),
@@ -2430,7 +2445,7 @@ int
 vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end,
   vm_prot_t new_prot, boolean_t set_max)
 {
- 

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

2019-11-20 Thread Andrew Turner
Author: andrew
Date: Wed Nov 20 14:37:48 2019
New Revision: 354894
URL: https://svnweb.freebsd.org/changeset/base/354894

Log:
  Import the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime.
  
  KCSAN is a tool to find concurrent memory access that may race each other.
  After a determined number of memory accesses a cell is created, this
  describes the current access. It will then delay for a short period
  to allow other CPUs a chance to race. If another CPU performs a memory
  access to an overlapping region during this delay the race is reported.
  
  This is a straight import of the NetBSD code, it will be adapted to
  FreeBSD in a future commit.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/kern/subr_csan.c   (contents, props changed)
  head/sys/sys/csan.h   (contents, props changed)

Added: head/sys/kern/subr_csan.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/subr_csan.c   Wed Nov 20 14:37:48 2019(r354894)
@@ -0,0 +1,754 @@
+/* $NetBSD: subr_csan.c,v 1.5 2019/11/15 08:11:37 maxv Exp $   */
+
+/*
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Maxime Villard.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: subr_csan.c,v 1.5 2019/11/15 08:11:37 maxv Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef KCSAN_PANIC
+#define REPORT panic
+#else
+#define REPORT printf
+#endif
+
+typedef struct {
+   uintptr_t addr;
+   uint32_t size;
+   bool write:1;
+   bool atomic:1;
+   uintptr_t pc;
+} csan_cell_t;
+
+typedef struct {
+   bool inited;
+   uint32_t cnt;
+   csan_cell_t cell;
+} csan_cpu_t;
+
+static csan_cpu_t kcsan_cpus[MAXCPUS];
+static bool kcsan_enabled __read_mostly;
+
+#define __RET_ADDR (uintptr_t)__builtin_return_address(0)
+
+#define KCSAN_NACCESSES1024
+#define KCSAN_DELAY10  /* 10 microseconds */
+
+/* -- 
*/
+
+/* The MD code. */
+#include 
+
+/* -- 
*/
+
+void
+kcsan_init(void)
+{
+   kcsan_enabled = true;
+}
+
+void
+kcsan_cpu_init(struct cpu_info *ci)
+{
+   kcsan_cpus[cpu_index(ci)].inited = true;
+}
+
+/* -- 
*/
+
+static inline void
+kcsan_report(csan_cell_t *new, cpuid_t newcpu, csan_cell_t *old, cpuid_t 
oldcpu)
+{
+   const char *newsym, *oldsym;
+
+   if (ksyms_getname(NULL, &newsym, (vaddr_t)new->pc, KSYMS_PROC) != 0) {
+   newsym = "Unknown";
+   }
+   if (ksyms_getname(NULL, &oldsym, (vaddr_t)old->pc, KSYMS_PROC) != 0) {
+   oldsym = "Unknown";
+   }
+   REPORT("CSan: Racy Access "
+   "[Cpu%lu %s%s Addr=%p Size=%u PC=%p<%s>] "
+   "[Cpu%lu %s%s Addr=%p Size=%u PC=%p<%s>]\n",
+   newcpu,
+   (new->atomic ? "Atomic " : ""), (new->write ? "Write" : "Read"),
+   (void *)new->addr, new->size, (void *)new->pc, newsym,
+   oldcpu,
+   (old->atomic ? "Atomic " : ""), (old->write ? "Write" : "Read"),
+   (void *)old->addr, old->size, (void *)old->pc, oldsym);
+   kcsan_md_unwind();
+}
+
+static inline bool
+kcsan_access_is_atomic(csan_cell_t *new, csan_cell_t *old)
+{
+   if (new->write && !new->atomic)
+   return false;
+   if (old->write && !old->atomic)

svn commit: r354893 - head/sys/kern

2019-11-20 Thread Mateusz Guzik
Author: mjg
Date: Wed Nov 20 12:08:32 2019
New Revision: 354893
URL: https://svnweb.freebsd.org/changeset/base/354893

Log:
  cache: minor stat cleanup
  
  Remove duplicated stats and move numcachehv from debug to vfs.cache.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Wed Nov 20 12:07:54 2019(r354892)
+++ head/sys/kern/vfs_cache.c   Wed Nov 20 12:08:32 2019(r354893)
@@ -204,14 +204,8 @@ static u_long __read_mostlyncnegfactor = 5; /* 
ratio 
 SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0,
 "Ratio of negative namecache entries");
 static u_long __exclusive_cache_line   numneg; /* number of negative entries 
allocated */
-SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0,
-"Number of negative entries in namecache");
 static u_long __exclusive_cache_line   numcache;/* number of cache entries 
allocated */
-SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0,
-"Number of namecache entries");
 static u_long __exclusive_cache_line   numcachehv;/* number of cache entries 
with vnodes held */
-SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0,
-"Number of namecache entries with vnodes held");
 u_int ncsizefactor = 2;
 SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0,
 "Size factor for namecache");
@@ -356,6 +350,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 
SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 
descr);
 STATNODE_ULONG(numneg, "Number of negative cache entries");
 STATNODE_ULONG(numcache, "Number of cache entries");
+STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held");
 STATNODE_COUNTER(numcalls, "Number of cache lookups");
 STATNODE_COUNTER(dothits, "Number of '.' hits");
 STATNODE_COUNTER(dotdothits, "Number of '..' hits");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354892 - head/sys/kern

2019-11-20 Thread Mateusz Guzik
Author: mjg
Date: Wed Nov 20 12:07:54 2019
New Revision: 354892
URL: https://svnweb.freebsd.org/changeset/base/354892

Log:
  vfs: perform a more racy check in vfs_notify_upper
  
  Locking mp does not buy anything interms of correctness and only contributes 
to
  contention.

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Nov 20 12:06:29 2019(r354891)
+++ head/sys/kern/vfs_subr.cWed Nov 20 12:07:54 2019(r354892)
@@ -3526,11 +3526,9 @@ vfs_notify_upper(struct vnode *vp, int event)
mp = vp->v_mount;
if (mp == NULL)
return;
-
-   MNT_ILOCK(mp);
if (TAILQ_EMPTY(&mp->mnt_uppers))
-   goto unlock;
-   MNT_IUNLOCK(mp);
+   return;
+
mmp = malloc(sizeof(struct mount), M_TEMP, M_WAITOK | M_ZERO);
mmp->mnt_op = &vgonel_vfsops;
mmp->mnt_kern_flag |= MNTK_MARKER;
@@ -3564,7 +3562,6 @@ vfs_notify_upper(struct vnode *vp, int event)
mp->mnt_kern_flag &= ~MNTK_VGONE_WAITER;
wakeup(&mp->mnt_uppers);
}
-unlock:
MNT_IUNLOCK(mp);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354890 - in head/sys: fs/devfs kern sys

2019-11-20 Thread Mateusz Guzik
Author: mjg
Date: Wed Nov 20 12:05:59 2019
New Revision: 354890
URL: https://svnweb.freebsd.org/changeset/base/354890

Log:
  vfs: change si_usecount management to count used vnodes
  
  Currently si_usecount is effectively a sum of usecounts from all associated
  vnodes. This is maintained by special-casing for VCHR every time usecount is
  modified. Apart from complicating the code a little bit, it has a scalability
  impact since it forces a read from a cacheline shared with said count.
  
  There are no consumers of the feature in the ports tree. In head there are 
only
  2: revoke and devfs_close. Both can get away with a weaker requirement than 
the
  exact usecount, namely just the count of active vnodes. Changing the meaning 
to
  the latter means we only need to modify it on 0<->1 transitions, avoiding the
  check plenty of times (and entirely in something like vrefact).
  
  Reviewed by:  kib, jeff
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D22202

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/kern/vfs_subr.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/conf.h

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Wed Nov 20 11:12:19 2019
(r354889)
+++ head/sys/fs/devfs/devfs_vnops.c Wed Nov 20 12:05:59 2019
(r354890)
@@ -481,7 +481,7 @@ loop:
vp->v_rdev = dev;
KASSERT(vp->v_usecount == 1,
("%s %d (%d)\n", __func__, __LINE__, vp->v_usecount));
-   dev->si_usecount += vp->v_usecount;
+   dev->si_usecount++;
/* Special casing of ttys for deadfs.  Probably redundant. */
dsw = dev->si_devsw;
if (dsw != NULL && (dsw->d_flags & D_TTY) != 0)
@@ -581,7 +581,7 @@ devfs_close(struct vop_close_args *ap)
 * if the reference count is 2 (this last descriptor
 * plus the session), release the reference from the session.
 */
-   if (td != NULL) {
+   if (vp->v_usecount == 2 && td != NULL) {
p = td->td_proc;
PROC_LOCK(p);
if (vp == p->p_session->s_ttyvp) {
@@ -591,7 +591,7 @@ devfs_close(struct vop_close_args *ap)
if (vp == p->p_session->s_ttyvp) {
SESS_LOCK(p->p_session);
VI_LOCK(vp);
-   if (count_dev(dev) == 2 &&
+   if (vp->v_usecount == 2 && vcount(vp) == 1 &&
(vp->v_iflag & VI_DOOMED) == 0) {
p->p_session->s_ttyvp = NULL;
p->p_session->s_ttydp = NULL;
@@ -620,19 +620,19 @@ devfs_close(struct vop_close_args *ap)
return (ENXIO);
dflags = 0;
VI_LOCK(vp);
+   if (vp->v_usecount == 1 && vcount(vp) == 1)
+   dflags |= FLASTCLOSE;
if (vp->v_iflag & VI_DOOMED) {
/* Forced close. */
dflags |= FREVOKE | FNONBLOCK;
} else if (dsw->d_flags & D_TRACKCLOSE) {
/* Keep device updated on status. */
-   } else if (count_dev(dev) > 1) {
+   } else if ((dflags & FLASTCLOSE) == 0) {
VI_UNLOCK(vp);
dev_relthread(dev, ref);
return (0);
}
-   if (count_dev(dev) == 1)
-   dflags |= FLASTCLOSE;
-   vholdl(vp);
+   vholdnz(vp);
VI_UNLOCK(vp);
vp_locked = VOP_ISLOCKED(vp);
VOP_UNLOCK(vp, 0);
@@ -1425,7 +1425,7 @@ devfs_reclaim_vchr(struct vop_reclaim_args *ap)
dev = vp->v_rdev;
vp->v_rdev = NULL;
if (dev != NULL)
-   dev->si_usecount -= vp->v_usecount;
+   dev->si_usecount -= (vp->v_usecount > 0);
dev_unlock();
VI_UNLOCK(vp);
if (dev != NULL)

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Nov 20 11:12:19 2019(r354889)
+++ head/sys/kern/vfs_subr.cWed Nov 20 12:05:59 2019(r354890)
@@ -2714,26 +2714,11 @@ _vget_prep(struct vnode *vp, bool interlock)
 {
enum vgetstate vs;
 
-   if (__predict_true(vp->v_type != VCHR)) {
-   if (refcount_acquire_if_not_zero(&vp->v_usecount)) {
-   vs = VGET_USECOUNT;
-   } else {
-   _vhold(vp, interlock);
-   vs = VGET_HOLDCNT;
-   }
+   if (refcount_acquire_if_not_zero(&vp->v_usecount)) {
+   vs = VGET_USECOUNT;
} else {
-   if (!interlock)
-   VI_LOCK(vp);
-   if (vp->v_usecount == 0) {
-   vholdl(vp);
-   vs = VGET_HOLDCNT;
-   } else {
-

svn commit: r354891 - head/sys/compat/linux

2019-11-20 Thread Mateusz Guzik
Author: mjg
Date: Wed Nov 20 12:06:29 2019
New Revision: 354891
URL: https://svnweb.freebsd.org/changeset/base/354891

Log:
  linux: avoid overhead of P_CONTROLT checks if possible
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_file.c

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Wed Nov 20 12:05:59 2019
(r354890)
+++ head/sys/compat/linux/linux_file.c  Wed Nov 20 12:06:29 2019
(r354891)
@@ -137,6 +137,8 @@ linux_common_open(struct thread *td, int dirfd, char *
error = ELOOP;
goto done;
}
+   if (p->p_flag & P_CONTROLT)
+   goto done;
if (bsd_flags & O_NOCTTY)
goto done;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354889 - head/sys/amd64/amd64

2019-11-20 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 20 11:12:19 2019
New Revision: 354889
URL: https://svnweb.freebsd.org/changeset/base/354889

Log:
  amd64: in double fault handler, do not rely on sane gsbase value.
  
  Typical reasons for doublefault faults are either kernel stack
  overflow or bugs in the code that manipulates protection CPU state.
  The later code is the code which often has to set up gsbase for
  kernel.  Switching to explicit load of GSBASE MSR in the fault handler
  makes it more probable to output a useful information.
  
  Now all IST handlers have nmi_pcpu structure on top of their stacks.
  
  It would be even more useful to save gsbase value at the moment of the
  fault.  I did not this because I do not want to modify PCB layout now.
  
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/exception.S
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.SWed Nov 20 10:27:43 2019
(r354888)
+++ head/sys/amd64/amd64/exception.SWed Nov 20 11:12:19 2019
(r354889)
@@ -345,10 +345,11 @@ IDTVEC(dblfault)
pushfq
andq$~(PSL_D | PSL_AC),(%rsp)
popfq
-   testb   $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
-   jz  1f  /* already running with kernel GS.base 
*/
-   swapgs
-1: lfence
+   movqTF_SIZE(%rsp),%rdx
+   movl%edx,%eax
+   shrq$32,%rdx
+   movl$MSR_GSBASE,%ecx
+   wrmsr
movq%cr3,%rax
movq%rax,PCPU(SAVED_UCR3)
movqPCPU(KCR3),%rax

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Wed Nov 20 10:27:43 2019
(r354888)
+++ head/sys/amd64/amd64/machdep.c  Wed Nov 20 11:12:19 2019
(r354889)
@@ -1575,7 +1575,9 @@ amd64_bsp_ist_init(struct pcpu *pc)
tssp = &pc->pc_common_tss;
 
/* doublefault stack space, runs on ist1 */
-   tssp->tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)];
+   np = ((struct nmi_pcpu *)&dblfault_stack[sizeof(dblfault_stack)]) - 1;
+   np->np_pcpu = (register_t)pc;
+   tssp->tss_ist1 = (long)np;
 
/*
 * NMI stack, runs on ist2.  The pcpu pointer is stored just

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Wed Nov 20 10:27:43 2019
(r354888)
+++ head/sys/amd64/amd64/mp_machdep.c   Wed Nov 20 11:12:19 2019
(r354889)
@@ -314,18 +314,24 @@ init_secondary(void)
IOPERM_BITMAP_SIZE;
pc->pc_common_tss.tss_rsp0 = 0;
 
-   pc->pc_common_tss.tss_ist1 = (long)&doublefault_stack[PAGE_SIZE];
+   /* The doublefault stack runs on IST1. */
+   np = ((struct nmi_pcpu *)&doublefault_stack[PAGE_SIZE]) - 1;
+   np->np_pcpu = (register_t)pc;
+   pc->pc_common_tss.tss_ist1 = (long)np;
 
/* The NMI stack runs on IST2. */
np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1;
+   np->np_pcpu = (register_t)pc;
pc->pc_common_tss.tss_ist2 = (long)np;
 
/* The MC# stack runs on IST3. */
np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1;
+   np->np_pcpu = (register_t)pc;
pc->pc_common_tss.tss_ist3 = (long)np;
 
/* The DB# stack runs on IST4. */
np = ((struct nmi_pcpu *) &dbg_stack[PAGE_SIZE]) - 1;
+   np->np_pcpu = (register_t)pc;
pc->pc_common_tss.tss_ist4 = (long)np;
 
/* Prepare private GDT */
@@ -340,18 +346,6 @@ init_secondary(void)
ap_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1;
ap_gdt.rd_base = (u_long)gdt;
lgdt(&ap_gdt);  /* does magic intra-segment return */
-
-   /* Save the per-cpu pointer for use by the NMI handler. */
-   np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1;
-   np->np_pcpu = (register_t)pc;
-
-   /* Save the per-cpu pointer for use by the MC# handler. */
-   np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1;
-   np->np_pcpu = (register_t)pc;
-
-   /* Save the per-cpu pointer for use by the DB# handler. */
-   np = ((struct nmi_pcpu *) &dbg_stack[PAGE_SIZE]) - 1;
-   np->np_pcpu = (register_t)pc;
 
wrmsr(MSR_FSBASE, 0);   /* User value */
wrmsr(MSR_GSBASE, (u_int64_t)pc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354888 - stable/12/lib/libc/gen

2019-11-20 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 20 10:27:43 2019
New Revision: 354888
URL: https://svnweb.freebsd.org/changeset/base/354888

Log:
  MFC r354787:
  Document required size of buffer for elf_aux_info(3).

Modified:
  stable/12/lib/libc/gen/auxv.3
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/gen/auxv.3
==
--- stable/12/lib/libc/gen/auxv.3   Wed Nov 20 10:25:50 2019
(r354887)
+++ stable/12/lib/libc/gen/auxv.3   Wed Nov 20 10:27:43 2019
(r354888)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2019
+.Dd November 17, 2019
 .Dt ELF_AUX_INFO 3
 .Os
 .Sh NAME
@@ -44,24 +44,35 @@ function retrieves the auxiliary info vector requested
 The information is stored into the provided buffer if it will fit.
 The following values, defined in
 .In sys/elf_common.h
-can be requested:
+can be requested (corresponding buffer sizes are specified in parenthesis):
 .Bl -tag -width AT_OSRELDATE
 .It AT_CANARY
-The canary value for SSP.
+The canary value for SSP (arbitrary sized buffer, as many bytes are
+returned as it fits into it, rest is zeroed).
 .It AT_HWCAP
-CPU / hardware feature flags.
+CPU / hardware feature flags
+.Dv (sizeof(u_long)).
 .It AT_HWCAP2
-CPU / hardware feature flags.
+CPU / hardware feature flags
+.Dv (sizeof(u_long)).
 .It AT_NCPUS
-Number of CPUs.
+Number of CPUs
+.Dv (sizeof(int)).
 .It AT_OSRELDATE
-Kernel OSRELDATE.
+The
+.Dv OSRELDATE
+of the kernel or jail the program is running on
+.Dv (sizeof(int)).
 .It AT_PAGESIZES
-Vector of page sizes.
+Vector of page sizes (arbitrary sized buffer, as many elements of the
+.Dv pagesizes
+array are returned as it fits).
 .It AT_PAGESZ
-Page size in bytes.
+Page size in bytes
+.Dv (sizeof(int)).
 .It AT_TIMEKEEP
-Pointer to VDSO timehands (for library internal use).
+Pointer to VDSO timehands (for library internal use,
+.Dv sizeof(void *)).
 .El
 .Sh RETURN VALUES
 Returns zero on success, or an error number on failure.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354887 - stable/12/sys/amd64/amd64

2019-11-20 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 20 10:25:50 2019
New Revision: 354887
URL: https://svnweb.freebsd.org/changeset/base/354887

Log:
  MFC r354788:
  amd64 copyout: remove irrelevant comment.

Modified:
  stable/12/sys/amd64/amd64/support.S
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/support.S
==
--- stable/12/sys/amd64/amd64/support.S Wed Nov 20 08:56:01 2019
(r354886)
+++ stable/12/sys/amd64/amd64/support.S Wed Nov 20 10:25:50 2019
(r354887)
@@ -671,13 +671,7 @@ END(fillw)
movq$copy_fault,PCB_ONFAULT(%r11)
 
/*
-* Check explicitly for non-user addresses.  If 486 write protection
-* is being used, this check is essential because we are in kernel
-* mode so the h/w does not provide any protection against writing
-* kernel addresses.
-*/
-
-   /*
+* Check explicitly for non-user addresses.
 * First, prevent address wrapping.
 */
movq%rsi,%rax
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354886 - head/cddl/contrib/opensolaris/cmd/zpool

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:56:01 2019
New Revision: 354886
URL: https://svnweb.freebsd.org/changeset/base/354886

Log:
  zpool.8: remove a paragraph about quorum disks
  
  FreeBSD has no such thing.
  illumos and ZoL manuals do not talk about quorum disks either.
  Only Oracle ZFS mentions them.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Nov 20 08:49:13 
2019(r354885)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Nov 20 08:56:01 
2019(r354886)
@@ -896,10 +896,6 @@ Displays the configuration that would be used without 
 .Ar vdev Ns s.
 The actual pool creation can still fail due to insufficient privileges or 
device
 sharing.
-.Pp
-Do not add a disk that is currently configured as a quorum device to a zpool.
-After a disk is in the pool, that disk can then be configured as a quorum
-device.
 .El
 .It Xo
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354885 - head/cddl/contrib/opensolaris/cmd/zpool

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:49:13 2019
New Revision: 354885
URL: https://svnweb.freebsd.org/changeset/base/354885

Log:
  fix up r354804, resolve merge conflicts in zpool.8
  
  Somehow I managed to commit the manual page with unresolved conflicts in
  it.
  
  While here, I also replaced .sp with .Pp.
  
  MFC after:3 weeks
  X-MFC with:   r354804

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Nov 20 08:44:29 
2019(r354884)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Nov 20 08:49:13 
2019(r354885)
@@ -829,13 +829,13 @@ When a pool is determined to be active it cannot be im
 option.
 This property is intended to be used in failover configurations
 where multiple hosts have access to a pool on shared storage.
-.sp
+.Pp
 Multihost provides protection on import only.
 It does not protect against an
 individual device being used in multiple pools, regardless of the type of vdev.
 See the discussion under
 .Sy zpool create.
-.sp
+.Pp
 When this property is on, periodic writes to storage occur to show the pool is
 in use.
 See
@@ -975,9 +975,14 @@ Discards an existing checkpoint from
 .Op Ar device
 .Xc
 .Pp
-Clears device errors in a pool. If no arguments are specified, all device
-errors within the pool are cleared. If one or more devices is specified, only
-those errors associated with the specified device or devices are cleared.
+Clears device errors in a pool.
+If no arguments are specified, all device errors within the pool are cleared.
+If one or more devices is specified, only those errors associated with the
+specified device or devices are cleared.
+If multihost is enabled, and the pool has been suspended, this will not
+resume I/O.
+While the pool was suspended, it may have been imported on
+another host, and resuming I/O could result in pool damage.
 .Bl -tag -width indent
 .It Fl F
 Initiates recovery mode for an unopenable pool. Attempts to discard the last
@@ -988,22 +993,8 @@ discarded transactions is irretrievably lost.
 Used in combination with the
 .Fl F
 flag. Check whether discarding transactions would make the pool openable, but
-<<<
 do not actually discard any transactions.
 .El
-|||
-If no arguments are specified, all device errors within the pool are cleared.
-If one or more devices is specified, only those errors associated with the
-specified device or devices are cleared.
-===
-If no arguments are specified, all device errors within the pool are cleared.
-If one or more devices is specified, only those errors associated with the
-specified device or devices are cleared.
-If multihost is enabled, and the pool has been suspended, this will not
-resume I/O.
-While the pool was suspended, it may have been imported on
-another host, and resuming I/O could result in pool damage.
->>>
 .It Xo
 .Nm
 .Cm create
@@ -1028,15 +1019,6 @@ specification is described in the
 .Qq Sx Virtual Devices
 section.
 .Pp
-<<<
-The command verifies that each device specified is accessible and not currently
-|||
-The command verifies that each device specified is accessible and not currently
-in use by another subsystem.
-There are some uses, such as being currently mounted, or specified as the
-dedicated dump device, that prevents a device from ever being used by ZFS.
-Other uses, such as having a preexisting UFS file system, can be overridden 
with
-===
 The command attempts to verify that each device specified is accessible and not
 currently in use by another subsystem.
 However this check is not robust enough
@@ -1054,18 +1036,11 @@ or
 do not refer to the same device.
 Using the same device in two pools will
 result in pool corruption.
-.sp
+.Pp
 There are some uses, such as being currently mounted, or specified as the
 dedicated dump device, that prevents a device from ever being used by ZFS.
-Other uses, such as having a preexisting UFS file system, can be overridden 
with
->>>
-in use by another subsystem. There are some uses, such as being currently
-mounted, or specified as the dedicated dump device, that prevents a device from
-ever being used by
-.Tn ZFS
-Other uses, such as having a preexisting
-.Sy UFS
-file system, can be overridden with the
+Other uses, such as having a preexisting UFS file system, can be overridden
+with the
 .Fl f
 option.
 .Pp
@@ -1720,7 +1695,7 @@ devices in this pool are online and healthy before per
 Removes the specified device from the pool.
 This command currently only supports removing hot spares, cache, log
 devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz.
-.sp
+.Pp
 Removing a top-level vdev reduces the total amount of space in the storage 
pool.
 The specified device will be evacuated by copying all allocated space from it 
to
 the other devices in the pool

svn commit: r354884 - stable/12/usr.sbin/mpsutil

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:44:29 2019
New Revision: 354884
URL: https://svnweb.freebsd.org/changeset/base/354884

Log:
  MFC r351812: mpsutil slot set status
  
  It allows to set the status of an enclosure slot.  Practically, this
  means controlling whatever slot status LEDs the enclosure provides.  At
  present, the new command does not have sanity checks or any
  conveniences.  That means that it is possible to issue the command for
  an invalid slot and an enclosure.  But the worst I have seen happening
  is either the command failing or simply being ignored.  Also, at the
  moment, the status has to be specified as a numeric bit mask.  The bit
  definitions can be found in sys/dev/mps/mpi/mpi2_init.h, they are
  prefixed with MPI2_SEP_REQ_SLOTSTATUS_.  The only way to address a slot
  is by the enclosure handle and the slot number.  Both are readily
  available from mpsutil show commands.
  
  The new command is useful alternative to 'sas2ircu locate' command.
  First, sas2ircu is a proprietary blob.  Second, it supports setting only
  locate / identify status bit.

Added:
  stable/12/usr.sbin/mpsutil/mps_slot.c
 - copied unchanged from r351812, head/usr.sbin/mpsutil/mps_slot.c
Modified:
  stable/12/usr.sbin/mpsutil/Makefile
  stable/12/usr.sbin/mpsutil/mps_cmd.c
  stable/12/usr.sbin/mpsutil/mpsutil.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/mpsutil/Makefile
==
--- stable/12/usr.sbin/mpsutil/Makefile Wed Nov 20 08:41:01 2019
(r354883)
+++ stable/12/usr.sbin/mpsutil/Makefile Wed Nov 20 08:44:29 2019
(r354884)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PROG=  mpsutil
-SRCS=  mps_cmd.c mps_debug.c mps_flash.c mps_show.c mpsutil.c
+SRCS=  mps_cmd.c mps_debug.c mps_flash.c mps_show.c mps_slot.c mpsutil.c
 MAN=   mpsutil.8
 
 WARNS?= 3

Modified: stable/12/usr.sbin/mpsutil/mps_cmd.c
==
--- stable/12/usr.sbin/mpsutil/mps_cmd.cWed Nov 20 08:41:01 2019
(r354883)
+++ stable/12/usr.sbin/mpsutil/mps_cmd.cWed Nov 20 08:44:29 2019
(r354884)
@@ -283,6 +283,29 @@ mps_map_btdh(int fd, uint16_t *devhandle, uint16_t *bu
 }
 
 int
+mps_set_slot_status(int fd, U16 handle, U16 slot, U32 status)
+{
+   MPI2_SEP_REQUEST req;
+   MPI2_SEP_REPLY reply;
+
+   bzero(&req, sizeof(req));
+   req.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
+   req.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
+   req.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS;
+   req.EnclosureHandle = handle;
+   req.Slot = slot;
+   req.SlotStatus = status;
+
+   if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
+   NULL, 0, NULL, 0, 30) != 0)
+   return (errno);
+
+   if (!IOC_STATUS_SUCCESS(reply.IOCStatus))
+   return (EIO);
+   return (0);
+}
+
+int
 mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 
PageAddress,
 MPI2_CONFIG_PAGE_HEADER *header, U16 *IOCStatus)
 {

Copied: stable/12/usr.sbin/mpsutil/mps_slot.c (from r351812, 
head/usr.sbin/mpsutil/mps_slot.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/usr.sbin/mpsutil/mps_slot.c   Wed Nov 20 08:44:29 2019
(r354884, copy of r351812, head/usr.sbin/mpsutil/mps_slot.c)
@@ -0,0 +1,114 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2019 Andriy Gapon 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__RCSID("$FreeBSD$");
+
+#include 
+#include 

svn commit: r354883 - stable/12/sys/dev/nctgpio

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:41:01 2019
New Revision: 354883
URL: https://svnweb.freebsd.org/changeset/base/354883

Log:
  MFC r353887: nctgpio: improve performance (latency) of operation

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

Modified: stable/12/sys/dev/nctgpio/nctgpio.c
==
--- stable/12/sys/dev/nctgpio/nctgpio.c Wed Nov 20 08:39:21 2019
(r354882)
+++ stable/12/sys/dev/nctgpio/nctgpio.c Wed Nov 20 08:41:01 2019
(r354883)
@@ -69,21 +69,49 @@
 #define NCT_LDF_GPIO0_OUTCFG   0xe0
 #define NCT_LDF_GPIO1_OUTCFG   0xe1
 
+/* Direct I/O port access. */
+#defineNCT_IO_GSR  0
+#defineNCT_IO_IOR  1
+#defineNCT_IO_DAT  2
+#defineNCT_IO_INV  3
 
 #define NCT_MAX_PIN15
 #define NCT_IS_VALID_PIN(_p)   ((_p) >= 0 && (_p) <= NCT_MAX_PIN)
 
-#define NCT_PIN_BIT(_p) (1 << ((_p) % 8))
+#define NCT_PIN_BIT(_p) (1 << ((_p) & 7))
 
 #define NCT_GPIO_CAPS  (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \
GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL | \
GPIO_PIN_INVIN | GPIO_PIN_INVOUT)
 
+/*
+ * Note that the values are important.
+ * They match actual register offsets.
+ */
+typedef enum {
+   REG_IOR = 0,
+   REG_DAT = 1,
+   REG_INV = 2,
+} reg_t;
+
 struct nct_softc {
device_tdev;
device_tdev_f;
device_tbusdev;
struct mtx  mtx;
+   struct resource *iores;
+   int iorid;
+   int curgrp;
+   struct {
+   /* direction, 1: pin is input */
+   uint8_t ior[2];
+   /* output value */
+   uint8_t out[2];
+   /* whether out is valid */
+   uint8_t out_known[2];
+   /* inversion, 1: pin is inverted */
+   uint8_t inv[2];
+   }   cache;
struct gpio_pin pins[NCT_MAX_PIN + 1];
 };
 
@@ -113,97 +141,142 @@ struct nuvoton_vendor_device_id {
},
 };
 
-/*
- * Get the GPIO Input/Output register address
- * for a pin.
- */
+static void
+nct_io_set_group(struct nct_softc *sc, int group)
+{
+
+   GPIO_ASSERT_LOCKED(sc);
+   if (group != sc->curgrp) {
+   bus_write_1(sc->iores, NCT_IO_GSR, group);
+   sc->curgrp = group;
+   }
+}
+
 static uint8_t
-nct_ior_addr(uint32_t pin_num)
+nct_io_read(struct nct_softc *sc, int group, uint8_t reg)
 {
-   uint8_t addr;
+   nct_io_set_group(sc, group);
+   return (bus_read_1(sc->iores, reg));
+}
 
-   addr = NCT_LD7_GPIO0_IOR;
-   if (pin_num > 7)
-   addr = NCT_LD7_GPIO1_IOR;
+static void
+nct_io_write(struct nct_softc *sc, int group, uint8_t reg, uint8_t val)
+{
+   nct_io_set_group(sc, group);
+   return (bus_write_1(sc->iores, reg, val));
+}
 
-   return (addr);
+static uint8_t
+nct_get_ioreg(struct nct_softc *sc, reg_t reg, int group)
+{
+   uint8_t ioreg;
+
+   if (sc->iores != NULL)
+   ioreg = NCT_IO_IOR + reg;
+   else if (group == 0)
+   ioreg = NCT_LD7_GPIO0_IOR + reg;
+   else
+   ioreg = NCT_LD7_GPIO1_IOR + reg;
+   return (ioreg);
 }
 
-/*
- * Get the GPIO Data register address for a pin.
- */
 static uint8_t
-nct_dat_addr(uint32_t pin_num)
+nct_read_reg(struct nct_softc *sc, reg_t reg, int group)
 {
-   uint8_t addr;
+   uint8_t ioreg;
+   uint8_t val;
 
-   addr = NCT_LD7_GPIO0_DAT;
-   if (pin_num > 7)
-   addr = NCT_LD7_GPIO1_DAT;
+   ioreg = nct_get_ioreg(sc, reg, group);
+   if (sc->iores != NULL)
+   val = nct_io_read(sc, group, ioreg);
+   else
+   val = superio_read(sc->dev, ioreg);
 
-   return (addr);
+   return (val);
 }
 
-/*
- * Get the GPIO Inversion register address
- * for a pin.
- */
-static uint8_t
-nct_inv_addr(uint32_t pin_num)
+#define GET_BIT(v, b)  (((v) >> (b)) & 1)
+static bool
+nct_get_pin_reg(struct nct_softc *sc, reg_t reg, uint32_t pin_num)
 {
-   uint8_t addr;
+   uint8_t bit;
+   uint8_t group;
+   uint8_t val;
 
-   addr = NCT_LD7_GPIO0_INV;
-   if (pin_num > 7)
-   addr = NCT_LD7_GPIO1_INV;
+   KASSERT(NCT_IS_VALID_PIN(pin_num), ("%s: invalid pin number %d",
+   __func__, pin_num));
 
-   return (addr);
+   group = pin_num >> 3;
+   bit = pin_num & 7;
+   val = nct_read_reg(sc, reg, group);
+   return (GET_BIT(val, bit));
 }
 
-/*
- * Get the GPIO Output Configuration/Mode
- * register address for a pin.
- */
-static uint8_t
-nct_o

svn commit: r354882 - stable/12/sys/dev/ow

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:39:21 2019
New Revision: 354882
URL: https://svnweb.freebsd.org/changeset/base/354882

Log:
  MFC r354205: Remove redundant hw sysctl declaration.
  
  gcc CI complains, but clang doesn't.

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

Modified: stable/12/sys/dev/ow/ow.c
==
--- stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:37:22 2019(r354881)
+++ stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:39:21 2019(r354882)
@@ -159,7 +159,6 @@ static struct ow_timing timing_overdrive = {
.t_lowr = 1,/* 1 <= t < 2 */
 };
 
-SYSCTL_DECL(_hw);
 SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD, 0, "1-Wire protocol");
 SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD, 0,
 "Regular mode timings");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354881 - stable/12/sys/dev/ow

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:37:22 2019
New Revision: 354881
URL: https://svnweb.freebsd.org/changeset/base/354881

Log:
  MFC r354183: ow(4): clean up stray white space

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

Modified: stable/12/sys/dev/ow/ow.c
==
--- stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:35:54 2019(r354880)
+++ stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:37:22 2019(r354881)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
 typedef int ow_enum_fn(device_t, device_t);
 typedef int ow_found_fn(device_t, romid_t);
 
-struct ow_softc 
+struct ow_softc
 {
device_tdev;/* Newbus driver back pointer */
struct mtx  mtx;/* bus mutex */
@@ -210,7 +210,7 @@ static void
 ow_send_byte(device_t lldev, struct ow_timing *t, uint8_t byte)
 {
int i;
-   
+
for (i = 0; i < 8; i++)
if (byte & (1 << i))
OWLL_WRITE_ONE(lldev, t);
@@ -224,7 +224,7 @@ ow_read_byte(device_t lldev, struct ow_timing *t, uint
int i;
uint8_t byte = 0;
int bit;
-   
+
for (i = 0; i < 8; i++) {
OWLL_READ_DATA(lldev, t, &bit);
byte |= bit << i;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354880 - stable/12/sys/dev/ow

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:35:54 2019
New Revision: 354880
URL: https://svnweb.freebsd.org/changeset/base/354880

Log:
  MFC r354181: ow(4): protocol timings can now be changed as sysctl-s / tunables

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

Modified: stable/12/sys/dev/ow/ow.c
==
--- stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:34:24 2019(r354879)
+++ stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:35:54 2019(r354880)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -73,34 +74,137 @@ static void ow_release_bus(device_t ndev, device_t pde
 
 static MALLOC_DEFINE(M_OW, "ow", "House keeping data for 1wire bus");
 
+static const struct ow_timing timing_regular_min = {
+   .t_slot = 60,
+   .t_low0 = 60,
+   .t_low1 = 1,
+   .t_release = 0,
+   .t_rec = 1,
+   .t_rdv = 15,/* fixed */
+   .t_rstl = 480,
+   .t_rsth = 480,
+   .t_pdl = 60,
+   .t_pdh = 15,
+   .t_lowr = 1,
+};
+
+static const struct ow_timing timing_regular_max = {
+   .t_slot = 120,
+   .t_low0 = 120,
+   .t_low1 = 15,
+   .t_release = 45,
+   .t_rec = 960,   /* infinity */
+   .t_rdv = 15,/* fixed */
+   .t_rstl = 960,  /* infinity */
+   .t_rsth = 960,  /* infinity */
+   .t_pdl = 240,   /* 60us to 240us */
+   .t_pdh = 60,/* 15us to 60us */
+   .t_lowr = 15,   /* 1us */
+};
+
 static struct ow_timing timing_regular = {
-   .t_slot = 60,   /* 60 to 120 */
-   .t_low0 = 60,   /* really 60 to 120 */
-   .t_low1 = 1,/* really 1 to 15 */
-   .t_release = 45,/* <= 45us */
-   .t_rec = 15,/* at least 1us */
-   .t_rdv = 15,/* 15us */
-   .t_rstl = 480,  /* 480us or more */
-   .t_rsth = 480,  /* 480us or more */
-   .t_pdl = 60,/* 60us to 240us */
-   .t_pdh = 60,/* 15us to 60us */
-   .t_lowr = 1,/* 1us */
+   .t_slot = 60,   /*  60 <= t < 120 */
+   .t_low0 = 60,   /*  60 <= t < t_slot < 120 */
+   .t_low1 = 1,/*   1 <= t < 15 */
+   .t_release = 45,/*   0 <= t < 45 */
+   .t_rec = 15,/*   1 <= t < inf */
+   .t_rdv = 15,/* t == 15 */
+   .t_rstl = 480,  /* 480 <= t < inf */
+   .t_rsth = 480,  /* 480 <= t < inf */
+   .t_pdl = 60,/*  60 <= t < 240 */
+   .t_pdh = 60,/*  15 <= t < 60 */
+   .t_lowr = 1,/*   1 <= t < 15 */
 };
 
 /* NB: Untested */
+static const struct ow_timing timing_overdrive_min = {
+   .t_slot = 6,
+   .t_low0 = 6,
+   .t_low1 = 1,
+   .t_release = 0,
+   .t_rec = 1,
+   .t_rdv = 2, /* fixed */
+   .t_rstl = 48,
+   .t_rsth = 48,
+   .t_pdl = 8,
+   .t_pdh = 2,
+   .t_lowr = 1,
+};
+
+static const struct ow_timing timing_overdrive_max = {
+   .t_slot = 16,
+   .t_low0 = 16,
+   .t_low1 = 2,
+   .t_release = 4,
+   .t_rec = 960,   /* infinity */
+   .t_rdv = 2, /* fixed */
+   .t_rstl = 80,
+   .t_rsth = 960,  /* infinity */
+   .t_pdl = 24,
+   .t_pdh = 6,
+   .t_lowr = 2,
+};
+
 static struct ow_timing timing_overdrive = {
-   .t_slot = 11,   /* 6us to 16us */
-   .t_low0 = 6,/* really 6 to 16 */
-   .t_low1 = 1,/* really 1 to 2 */
-   .t_release = 4, /* <= 4us */
-   .t_rec = 1, /* at least 1us */
-   .t_rdv = 2, /* 2us */
-   .t_rstl = 48,   /* 48us to 80us */
-   .t_rsth = 48,   /* 48us or more  */
-   .t_pdl = 8, /* 8us to 24us */
-   .t_pdh = 2, /* 2us to 6us */
-   .t_lowr = 1,/* 1us */
+   .t_slot = 11,   /* 6 <= t < 16 */
+   .t_low0 = 6,/* 6 <= t < t_slot < 16 */
+   .t_low1 = 1,/* 1 <= t < 2 */
+   .t_release = 4, /* 0 <= t < 4 */
+   .t_rec = 1, /* 1 <= t < inf */
+   .t_rdv = 2, /* t == 2 */
+   .t_rstl = 48,   /* 48 <= t < 80 */
+   .t_rsth = 48,   /* 48 <= t < inf */
+   .t_pdl = 8, /* 8 <= t < 24 */
+   .t_pdh = 2, /* 2 <= t < 6 */
+   .t_lowr = 1,/* 1 <= t < 2 */
 };
+
+SYSCTL_DECL(_hw);
+SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD, 0, "1-Wire protocol");
+SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD, 0,
+"Regular mode timings");
+SYSCTL_NODE(_hw_ow, OID_AUTO, overdrive, CTLFLAG_RD, 0,
+"Overdrive mode timings");
+
+#define_OW_TIMING_SYSCTL(mode, param)  \
+static int \
+

svn commit: r354879 - stable/12/sys/dev/ow

2019-11-20 Thread Andriy Gapon
Author: avg
Date: Wed Nov 20 08:34:24 2019
New Revision: 354879
URL: https://svnweb.freebsd.org/changeset/base/354879

Log:
  MFC r354180: ow(4): increase regular mode recovery time, t_rec, to 15 us

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

Modified: stable/12/sys/dev/ow/ow.c
==
--- stable/12/sys/dev/ow/ow.c   Wed Nov 20 05:34:02 2019(r354878)
+++ stable/12/sys/dev/ow/ow.c   Wed Nov 20 08:34:24 2019(r354879)
@@ -78,7 +78,7 @@ static struct ow_timing timing_regular = {
.t_low0 = 60,   /* really 60 to 120 */
.t_low1 = 1,/* really 1 to 15 */
.t_release = 45,/* <= 45us */
-   .t_rec = 1, /* at least 1us */
+   .t_rec = 15,/* at least 1us */
.t_rdv = 15,/* 15us */
.t_rstl = 480,  /* 480us or more */
.t_rsth = 480,  /* 480us or more */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"