svn commit: r366658 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 02:36:16 2020
New Revision: 366658
URL: https://svnweb.freebsd.org/changeset/base/366658

Log:
  Turn off zstd on aarch64
  
  loader support for zstd and zfs doesn't work for aarch64. Disable it
  to unbreak the build.

Modified:
  head/stand/libsa/zfs/Makefile.inc
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfssubr.c

Modified: head/stand/libsa/zfs/Makefile.inc
==
--- head/stand/libsa/zfs/Makefile.inc   Mon Oct 12 22:19:07 2020
(r366657)
+++ head/stand/libsa/zfs/Makefile.inc   Tue Oct 13 02:36:16 2020
(r366658)
@@ -4,7 +4,11 @@
 .PATH: ${SYSDIR}/crypto/skein
 .PATH: ${ZFSOSSRC}/spl
 .PATH: ${OZFS}/module/zstd/lib
-ZFSSRC=zfs.c nvlist.c skein.c skein_block.c list.c zstd_shim.c 
zstd.c
+ZFSSRC=zfs.c nvlist.c skein.c skein_block.c list.c
+.if ${MACHINE_ARCH} != aarch64
+ZFSSRC+=   zstd_shim.c zstd.c
+CFLAGS+=   -DHAS_ZSTD_ZFS
+.endif
 SRCS+= ${ZFSSRC}
 
 CFLAGS+=   -I${LDRSRC}

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.c  Mon Oct 12 22:19:07 2020
(r366657)
+++ head/stand/libsa/zfs/zfsimpl.c  Tue Oct 13 02:36:16 2020
(r366658)
@@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$");
 #include "zfsimpl.h"
 #include "zfssubr.c"
 
+#ifdef HAS_ZSTD_ZFS
 extern int zstd_init(void);
+#endif
 
 struct zfsmount {
const spa_t *spa;
@@ -130,7 +132,9 @@ static const char *features_for_read[] = {
"com.delphix:device_removal",
"com.delphix:obsolete_counts",
"com.intel:allocation_classes",
+#ifdef HAS_ZSTD_ZFS
"org.freebsd:zstd_compress",
+#endif
NULL
 };
 
@@ -171,7 +175,9 @@ zfs_init(void)
dnode_cache_buf = malloc(SPA_MAXBLOCKSIZE);
 
zfs_init_crc();
+#ifdef HAS_ZSTD_ZFS
zstd_init();
+#endif
 }
 
 static int

Modified: head/sys/cddl/boot/zfs/zfssubr.c
==
--- head/sys/cddl/boot/zfs/zfssubr.cMon Oct 12 22:19:07 2020
(r366657)
+++ head/sys/cddl/boot/zfs/zfssubr.cTue Oct 13 02:36:16 2020
(r366658)
@@ -105,10 +105,11 @@ typedef struct zio_checksum_info {
 #include "sha256.c"
 #include "skein_zfs.c"
 
+#ifdef HAS_ZSTD_ZFS
 extern int zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len,
 size_t d_len, int n);
+#endif
 
-
 static zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = {
{{NULL, NULL}, NULL, NULL, 0, "inherit"},
{{NULL, NULL}, NULL, NULL, 0, "on"},
@@ -183,7 +184,9 @@ static zio_compress_info_t zio_compress_table[ZIO_COMP
{NULL,  NULL,   9,  "gzip-9"},
{NULL,  zle_decompress, 64, "zle"},
{NULL,  lz4_decompress, 0,  "lz4"},
+#ifdef HAS_ZSTD_ZFS
{NULL,  zfs_zstd_decompress, ZIO_ZSTD_LEVEL_DEFAULT, 
"zstd"}
+#endif
 };
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366659 - head/stand/libsa/zfs

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 03:49:12 2020
New Revision: 366659
URL: https://svnweb.freebsd.org/changeset/base/366659

Log:
  Add back org.freebsd:zstd_compress to features_for_read
  
  This list is the of features that are allowed on the whole pool,
  not the list of features that are implemented.

Modified:
  head/stand/libsa/zfs/zfsimpl.c

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.c  Tue Oct 13 02:36:16 2020
(r366658)
+++ head/stand/libsa/zfs/zfsimpl.c  Tue Oct 13 03:49:12 2020
(r366659)
@@ -132,9 +132,7 @@ static const char *features_for_read[] = {
"com.delphix:device_removal",
"com.delphix:obsolete_counts",
"com.intel:allocation_classes",
-#ifdef HAS_ZSTD_ZFS
"org.freebsd:zstd_compress",
-#endif
NULL
 };
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366660 - head/stand/libsa/zfs

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 04:37:57 2020
New Revision: 30
URL: https://svnweb.freebsd.org/changeset/base/30

Log:
  Force __BMI__ experimental instructions off.
  
  The OpenZFS code that uses the BMI instructions is broken. Forcibly
  disable them to prevent their use. When enabled, the build breaks.
  This fixes the build when compiled for a core with BMI instructions.
  This is the same fix committed in r364777, for the same issue.
  
  Submitted by: Jung-uk Kim

Modified:
  head/stand/libsa/zfs/Makefile.inc

Modified: head/stand/libsa/zfs/Makefile.inc
==
--- head/stand/libsa/zfs/Makefile.inc   Tue Oct 13 03:49:12 2020
(r366659)
+++ head/stand/libsa/zfs/Makefile.inc   Tue Oct 13 04:37:57 2020
(r30)
@@ -31,6 +31,7 @@ CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY}
 CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl
 CFLAGS.zfs.c+= -I${ZFSOSINC}/spl   \
-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+CFLAGS.zstd.c+=-U__BMI__
 CFLAGS.zstd_shim.c+= -DIN_BASE -I${OZFS}/include
 
 # Do not unroll skein loops, reduce code size
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366661 - head/sbin/devd

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 05:19:00 2020
New Revision: 31
URL: https://svnweb.freebsd.org/changeset/base/31

Log:
  Document the rather suprising behavior with ' inside action rules.
  
  To prevent issues with odd shell characters appearing in, a surprising
  shell feature is used. Document it and a workaround for it.
  
  Differential Revision: https://reviews.freebsd.org/D26723

Modified:
  head/sbin/devd/devd.conf.5

Modified: head/sbin/devd/devd.conf.5
==
--- head/sbin/devd/devd.conf.5  Tue Oct 13 04:37:57 2020(r30)
+++ head/sbin/devd/devd.conf.5  Tue Oct 13 05:19:00 2020(r31)
@@ -40,7 +40,7 @@
 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 .\" SOFTWARE.
 .\"
-.Dd August 18, 2020
+.Dd October 12, 2020
 .Dt DEVD.CONF 5
 .Os
 .Sh NAME
@@ -662,6 +662,59 @@ For example:
 // is a new comment, even though it is logically
 // part of the previous comment.
 .Ed
+.Ss Notes on Variable Expansion
+To prevent issues with special shell characters, the following happens for each
+variable
+.Ic $foo .
+.Bl -enum
+.It
+The characters
+.Dq $'
+are inserted.
+.It
+The string
+.Dq $foo
+is removed.
+.It
+The value of the
+.Ic foo
+variable is inserted into the buffer with all single quote characters
+prefixed by a backslash.
+.El
+.Pp
+See
+.Xr sh 1
+for what this construct means.
+It is safe in all context, except one: inside single quotes.
+If foo=meta and bar=var, then a rule like the following:
+.Bd -literal -offset indent -compact
+action "echo '$foo $bar'";
+.Ed
+will be presented to the shell via
+.Xr system 3
+as
+.Bd -literal -offset indent -compact
+echo '$'meta' $'var''
+.Ed
+which produces the following output:
+.Bd -literal -offset indent -compact
+$meta $var
+.Ed
+as its output.
+This is an unanticipated result.
+A future version of this software will change this behavior.
+Users are discouraged from using single quotes inside
+.Ic action
+value without due care.
+.Pp
+The above should be written as
+.Bd -literal -offset indent -compact
+action "echo $foo' '$bar"
+.Ed
+to produce a single argument to echo.
+Given the above expansion, juxtaposing bare variables with
+single quote expressions will produce the right output,
+regardless of the value of the variable.
 .Sh FILES
 .Bl -tag -width ".Pa /etc/devd.conf" -compact
 .It Pa /etc/devd.conf
@@ -733,6 +786,9 @@ detach 0 {
 The installed
 .Pa /etc/devd.conf
 has many additional examples.
+.Sh BUGS
+The variable expansion's interaction with single quotes is
+suboptimal and surprising.
 .Sh SEE ALSO
 .Xr cam 4 ,
 .Xr coretemp 4 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366662 - head/sbin/devmatch

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 05:32:00 2020
New Revision: 32
URL: https://svnweb.freebsd.org/changeset/base/32

Log:
  devmatch: First appeared in 12.0
  
  Document that devmatch first appeared in FreeBSD 12.0. Also can't -> can not. 
But
  it doesn't help the sentence much.
  
  MFC After: 3 days

Modified:
  head/sbin/devmatch/devmatch.8

Modified: head/sbin/devmatch/devmatch.8
==
--- head/sbin/devmatch/devmatch.8   Tue Oct 13 05:19:00 2020
(r31)
+++ head/sbin/devmatch/devmatch.8   Tue Oct 13 05:32:00 2020
(r32)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 16, 2018
+.Dd October 12, 2020
 .Dt DEVMATCH 8
 .Os
 .Sh NAME
@@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from
 for matching instead of searching the device tree.
 .It Fl u Fl -unbound
 Attempt to produce a list of those drivers with PNP info whose driver
-tables with that PNP info can't be found.
+tables with that PNP info can not be found.
 .It Fl v Fl -verbose
 Produce more verbose output.
 .El
@@ -94,3 +94,7 @@ logical equivalent in USB, PCI, and others.
 .Pp
 Many drivers currently lack proper PNP table decorations and need to
 be updated.
+.Sh HISTORY
+.Nm
+first appeared in
+.Fx 12.0 .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2020-10-12 Thread Warner Losh
Author: imp
Date: Tue Oct 13 05:39:43 2020
New Revision: 33
URL: https://svnweb.freebsd.org/changeset/base/33

Log:
  Document /boot/config as well as /boot.config
  
  Add a note about /boot/config being an alternative location for this
  information. Correct description of -P.

Modified:
  head/share/man/man5/boot.config.5

Modified: head/share/man/man5/boot.config.5
==
--- head/share/man/man5/boot.config.5   Tue Oct 13 05:32:00 2020
(r32)
+++ head/share/man/man5/boot.config.5   Tue Oct 13 05:39:43 2020
(r33)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd May 13, 2007
+.Dd October 12, 2020
 .Dt BOOT.CONFIG 5
 .Os
 .Sh NAME
@@ -68,6 +68,8 @@ manual page.
 .Bl -tag -width /boot.config -compact
 .It Pa /boot.config
 parameters for the boot blocks (optional)
+.It Pa /boot/config
+Altnerate location for boot config information
 .El
 .Sh EXAMPLES
 The command:
@@ -76,7 +78,8 @@ The command:
 .Ed
 .Pp
 will activate the serial console of
-.Fx .
+.Fx
+if no keyboard is present, otherwise video console will be used.
 .Pp
 The command:
 .Bd -literal -offset indent
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366662 - head/sbin/devmatch

2020-10-12 Thread Alexey Dokuchaev
On Tue, Oct 13, 2020 at 05:32:00AM +, Warner Losh wrote:
> New Revision: 32
> URL: https://svnweb.freebsd.org/changeset/base/32
> 
> Log:
>   devmatch: First appeared in 12.0
>   
>   Document that devmatch first appeared in FreeBSD 12.0.
>   Also can't -> can not. But it doesn't help the sentence much.
>   
> ...
> @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from
>  for matching instead of searching the device tree.
>  .It Fl u Fl -unbound
>  Attempt to produce a list of those drivers with PNP info whose driver
> -tables with that PNP info can't be found.
> +tables with that PNP info can not be found.

Are you sure you've really meant "can not" and not "cannot" here?

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


Re: svn commit: r366662 - head/sbin/devmatch

2020-10-12 Thread Warner Losh
On Mon, Oct 12, 2020, 11:50 PM Alexey Dokuchaev  wrote:

> On Tue, Oct 13, 2020 at 05:32:00AM +, Warner Losh wrote:
> > New Revision: 32
> > URL: https://svnweb.freebsd.org/changeset/base/32
> >
> > Log:
> >   devmatch: First appeared in 12.0
> >
> >   Document that devmatch first appeared in FreeBSD 12.0.
> >   Also can't -> can not. But it doesn't help the sentence much.
> >
> > ...
> > @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from
> >  for matching instead of searching the device tree.
> >  .It Fl u Fl -unbound
> >  Attempt to produce a list of those drivers with PNP info whose driver
> > -tables with that PNP info can't be found.
> > +tables with that PNP info can not be found.
>
> Are you sure you've really meant "can not" and not "cannot" here?
>

They are variants of the same word (though it seems the one word
variationis more common here) the whole sentence is a trainwreck,
though, and I should have just completely rewritten it.

Warner

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


Re: svn commit: r366662 - head/sbin/devmatch

2020-10-12 Thread Alexey Dokuchaev
On Tue, Oct 13, 2020 at 12:16:23AM -0600, Warner Losh wrote:
> On Mon, Oct 12, 2020, 11:50 PM Alexey Dokuchaev wrote:
> > On Tue, Oct 13, 2020 at 05:32:00AM +, Warner Losh wrote:
> > > New Revision: 32
> > > URL: https://svnweb.freebsd.org/changeset/base/32
> > >
> > > Log:
> > >   devmatch: First appeared in 12.0
> > >
> > >   Document that devmatch first appeared in FreeBSD 12.0.
> > >   Also can't -> can not. But it doesn't help the sentence much.
> > >
> > > ...
> > > @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from
> > >  for matching instead of searching the device tree.
> > >  .It Fl u Fl -unbound
> > >  Attempt to produce a list of those drivers with PNP info whose driver
> > > -tables with that PNP info can't be found.
> > > +tables with that PNP info can not be found.
> >
> > Are you sure you've really meant "can not" and not "cannot" here?
> 
> They are variants of the same word (though it seems the one word
> variationis more common here)

No, they're not*, examples of "can not" usage:

- We can not only build the house, we can also sell it for a profit.
- Maybe I can not worry about this for a few days.

> the whole sentence is a trainwreck, though, and I should have just
> completely rewritten it.

I do agree. :-)

./danfe

*) 
https://grammar.yourdictionary.com/vs/cannot-vs-can-not-vs-cant-differences-explained.html
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366631 - head/stand/i386/common

2020-10-12 Thread Toomas Soome
Author: tsoome
Date: Mon Oct 12 09:34:50 2020
New Revision: 366631
URL: https://svnweb.freebsd.org/changeset/base/366631

Log:
  loader: edd_device_path_v3 is too small
  
  The EDD v3[1], see table 13, page 33, does define device path as double
  qword, that is, 16 bytes, we have only qword.
  
  Also remove edd_device_path_v4 and edd_params_v4 because those are not used,
  and there is no size difference in v3 versus v4.
  
  [1] http://www.t13.org/documents/UploadedDocuments/docs2004/d1572r3-EDD3.pdf
  
  MFC after:2 weeks

Modified:
  head/stand/i386/common/edd.h

Modified: head/stand/i386/common/edd.h
==
--- head/stand/i386/common/edd.hMon Oct 12 08:43:21 2020
(r366630)
+++ head/stand/i386/common/edd.hMon Oct 12 09:34:50 2020
(r366631)
@@ -71,7 +71,7 @@ struct edd_device_path_v3 {
charhost_bus[4];
charinterface[8];
uint64_tinterface_path;
-   uint64_tdevice_path;
+   uint64_tdevice_path[2];
uint8_t reserved2[1];
uint8_t checksum;
 } __packed;
@@ -79,23 +79,6 @@ struct edd_device_path_v3 {
 struct edd_params_v3 {
struct edd_params params;
struct edd_device_path_v3 device_path;
-} __packed;
-
-struct edd_device_path_v4 {
-   uint16_tkey;
-   uint8_t len;
-   uint8_t reserved[3];
-   charhost_bus[4];
-   charinterface[8];
-   uint64_tinterface_path;
-   uint64_tdevice_path[2];
-   uint8_t reserved2[1];
-   uint8_t checksum;
-} __packed;
-
-struct edd_params_v4 {
-   struct edd_params params;
-   struct edd_device_path_v4 device_path;
 } __packed;
 
 #defineEDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366626 - head/sbin/reboot

2020-10-12 Thread Eugene Grosbein
12.10.2020 10:33, Alexey Dokuchaev wrote:

> On Sun, Oct 11, 2020 at 09:17:42PM -0600, Warner Losh wrote:
>> On Sun, Oct 11, 2020, 8:13 PM Alexey Dokuchaev wrote:
>>> ...
>>> I still don't understand how could rm be better than graceful disabling
>>> alternative configuration with nextboot_enable="NO".  I most certainly
>>> do *not* like when my custom config files are being removed, especially
>>> silently.  When I see nextboot_enable="NO" I know that the file
>>> had been processed, and processed by the machine, not me (since I would
>>> never add trailing space).  When I don't see the file, I'd be questioning
>>> myself if I've ever added it here, or maybe I put in the wrong location.
>>
>> Nextboot.conf is special. It will be deleted. It doesn't belong to you, it
>> belongs to nextboot(8).
> 
> OK, I see your point.
> 
>>> Personally I find them quite useful, except when they contradict the
>>> reality (like this time).  In these cases, I'd fix them.
>>
>> For now, it's fine.

Note that testing kernel sometimes *requires* additional set of loader settings
like kernel parameter tuning and/or set of kernel modules loaded including NICs 
or GEOMs like gjournal/graid
that may affect boot process. And our loader does apply such settings when 
processing nextboot.conf.

Maybe this is the reason nextboot.conf should be removed after it fired once.
I personally edit it manually every time I use this feature and I keep a copy 
of the file with distinct name
to restore it for another run.





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


svn commit: r366635 - head

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 10:42:28 2020
New Revision: 366635
URL: https://svnweb.freebsd.org/changeset/base/366635

Log:
  Fix build with -DBOOTSTRAP_ALL_TOOLS
  
  sbin/sysctl can no longer be bootstrapped on FreeBSD 12 after r366465,
  so create a symlink to the host tool instead of trying to build it.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Oct 12 10:42:24 2020(r366634)
+++ head/Makefile.inc1  Mon Oct 12 10:42:28 2020(r366635)
@@ -2330,7 +2330,10 @@ _basic_bootstrap_tools+=usr.bin/ldd
 .endif
 # sysctl/chflags are required for installkernel:
 .if !defined(CROSSBUILD_HOST)
-_basic_bootstrap_tools+=sbin/sysctl bin/chflags
+_basic_bootstrap_tools+=bin/chflags
+# Note: sysctl does not bootstrap on FreeBSD < 13 anymore, but that doesn't
+# matter since we don't need any of the new features for the build.
+_bootstrap_tools_links+=sysctl
 .else
 # When building on non-FreeBSD, install a fake chflags instead since the
 # version from the source tree cannot work. We also don't need sysctl since we
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366633 - head/share/mk

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 10:42:19 2020
New Revision: 366633
URL: https://svnweb.freebsd.org/changeset/base/366633

Log:
  Don't use install(1) for the library symlinks in the build directory
  
  It appears this was changed from ln to use install in rS245752. I noticed
  this because my buildenv was setting INSTALL=install -U -M //METALOG
  and then these links fail to be created with the following error:
  install: open //METALOG: Permission denied
  
  Reviewed By:  brooks
  Differential Revision: https://reviews.freebsd.org/D26618

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkMon Oct 12 10:42:14 2020(r366632)
+++ head/share/mk/bsd.lib.mkMon Oct 12 10:42:19 2020(r366633)
@@ -312,7 +312,8 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
@${ECHO} building shared library ${SHLIB_NAME}
@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
 .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} 
== "no"
-   @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} 
${SHLIB_LINK}
+   # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in 
OBJDIR
+   @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK}
 .endif
${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} ${SOBJS} ${LDADD}
@@ -326,7 +327,8 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \
${SHLIB_NAME_FULL} ${.TARGET}
 .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld)
-   @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} 
${SHLIB_LINK}
+   # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in 
OBJDIR
+   @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK}
 .endif
 
 ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 10:42:14 2020
New Revision: 366632
URL: https://svnweb.freebsd.org/changeset/base/366632

Log:
  Fix building on Linux/macOS after r366622
  
  We have to bootstrap arc4random.c, so guard the FenestrasX code to avoid
  using it on Linux/macOS.
  
  Reviewed By:  cem
  Differential Revision: https://reviews.freebsd.org/D26738

Modified:
  head/lib/libc/gen/arc4random.c
  head/lib/libc/gen/arc4random.h

Modified: head/lib/libc/gen/arc4random.c
==
--- head/lib/libc/gen/arc4random.c  Mon Oct 12 09:34:50 2020
(r366631)
+++ head/lib/libc/gen/arc4random.c  Mon Oct 12 10:42:14 2020
(r366632)
@@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$");
 
 #define CHACHA_EMBED
 #define KEYSTREAM_ONLY
+#if defined(__FreeBSD__)
+#define ARC4RANDOM_FXRNG 1
+#else
+#define ARC4RANDOM_FXRNG 0
+#endif
 #include "chacha.c"
 
 #define minimum(a, b) ((a) < (b) ? (a) : (b))

Modified: head/lib/libc/gen/arc4random.h
==
--- head/lib/libc/gen/arc4random.h  Mon Oct 12 09:34:50 2020
(r366631)
+++ head/lib/libc/gen/arc4random.h  Mon Oct 12 10:42:14 2020
(r366632)
@@ -27,9 +27,11 @@
 #include 
 #include 
 #include 
+#if ARC4RANDOM_FXRNG != 0
 #include   /* for sys/vdso.h only. */
 #include 
 #include 
+#endif
 
 #include 
 #include 
@@ -37,6 +39,7 @@
 #include 
 #include 
 
+#if ARC4RANDOM_FXRNG != 0
 /*
  * The kernel root seed version is a 64-bit counter, but we truncate it to a
  * 32-bit value in userspace for the convenience of 32-bit platforms.  32-bit
@@ -51,6 +54,7 @@
  */
 #definefxrng_load_acq_generation(x)atomic_load_acq_32(x)
 static struct vdso_fxrng_generation_1 *vdso_fxrngp;
+#endif
 
 static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
 #define_ARC4_LOCK()\
@@ -74,6 +78,7 @@ _getentropy_fail(void)
 static inline void
 _rs_initialize_fxrng(void)
 {
+#if ARC4RANDOM_FXRNG != 0
struct vdso_fxrng_generation_1 *fxrngp;
int error;
 
@@ -91,6 +96,7 @@ _rs_initialize_fxrng(void)
return;
 
vdso_fxrngp = fxrngp;
+#endif
 }
 
 static inline int
@@ -131,13 +137,14 @@ _rs_forkdetect(void)
/* Detect fork (minherit(2) INHERIT_ZERO). */
if (__predict_false(rs == NULL || rsx == NULL))
return;
+#if ARC4RANDOM_FXRNG != 0
/* If present, detect kernel FenestrasX seed version change. */
if (vdso_fxrngp == NULL)
return;
if (__predict_true(rsx->rs_seed_generation ==
fxrng_load_acq_generation(&vdso_fxrngp->fx_generation32)))
return;
-
+#endif
/* Invalidate rs_buf to force "stir" (reseed). */
memset(rs, 0, sizeof(*rs));
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366636 - head/lib/libclang_rt

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 10:42:33 2020
New Revision: 366636
URL: https://svnweb.freebsd.org/changeset/base/366636

Log:
  Enable SUBDIR_PARELLEL in lib/libclang_rt
  
  I noticed that this part of the build was taking much longer than
  expected. Turns out it's due to not running the subdirs in parallel.
  Reduces `make all` inside lib/libclang_rt time from 63s to 20s with -j32.
  
  Reviewed By:  dim
  Differential Revision: https://reviews.freebsd.org/D26623

Modified:
  head/lib/libclang_rt/Makefile

Modified: head/lib/libclang_rt/Makefile
==
--- head/lib/libclang_rt/Makefile   Mon Oct 12 10:42:28 2020
(r366635)
+++ head/lib/libclang_rt/Makefile   Mon Oct 12 10:42:33 2020
(r366636)
@@ -32,4 +32,6 @@ SUBDIR+=  xray-profiling
 
 SUBDIR+=   profile
 
+SUBDIR_PARALLEL=
+
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366634 - head/contrib/nvi/common

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 10:42:24 2020
New Revision: 366634
URL: https://svnweb.freebsd.org/changeset/base/366634

Log:
  Fix buildworld on Linux/macOS after nvi update
  
  This re-applies r365941 which was lost in the nvi update.

Modified:
  head/contrib/nvi/common/common.h

Modified: head/contrib/nvi/common/common.h
==
--- head/contrib/nvi/common/common.hMon Oct 12 10:42:19 2020
(r366633)
+++ head/contrib/nvi/common/common.hMon Oct 12 10:42:24 2020
(r366634)
@@ -14,7 +14,7 @@
 #ifdef __linux__
 #include "/usr/include/db1/db.h"   /* Only include db1. */
 #else
-#include "/usr/include/db.h"   /* Only include db1. */
+#include /* Only include db1. */
 #endif
 #include  /* May refer to the bundled regex. */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366644 - in head/stand/efi: boot1 loader

2020-10-12 Thread Alex Richardson
Author: arichardson
Date: Mon Oct 12 11:27:08 2020
New Revision: 366644
URL: https://svnweb.freebsd.org/changeset/base/366644

Log:
  Link efi programs with -pie rather than -shared
  
  This was causing build failures in CheriBSD where we were passing -pie
  already by default.
  
  Reviewed By:  andrew
  Differential Revision: https://reviews.freebsd.org/D24787

Modified:
  head/stand/efi/boot1/Makefile
  head/stand/efi/loader/Makefile

Modified: head/stand/efi/boot1/Makefile
==
--- head/stand/efi/boot1/Makefile   Mon Oct 12 11:04:52 2020
(r366643)
+++ head/stand/efi/boot1/Makefile   Mon Oct 12 11:27:08 2020
(r366644)
@@ -63,7 +63,7 @@ FILES=${BOOT1}.efi
 FILESMODE_${BOOT1}.efi=${BINMODE}
 
 LDSCRIPT=  ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE}
-LDFLAGS+=  -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
+LDFLAGS+=  -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
 
 .if ${MACHINE_CPUARCH} == "aarch64"
 CFLAGS+=   -mgeneral-regs-only

Modified: head/stand/efi/loader/Makefile
==
--- head/stand/efi/loader/Makefile  Mon Oct 12 11:04:52 2020
(r366643)
+++ head/stand/efi/loader/Makefile  Mon Oct 12 11:27:08 2020
(r366644)
@@ -82,7 +82,7 @@ LINKS+=   ${BINDIR}/${LOADER}.efi 
${BINDIR}/loader.efi
 .endif
 
 LDSCRIPT=  ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE}
-LDFLAGS+=  -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
+LDFLAGS+=  -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie
 
 CLEANFILES+=   loader.efi
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366647 - head/sys/netpfil/pf

2020-10-12 Thread Kristof Provost
Author: kp
Date: Mon Oct 12 12:39:37 2020
New Revision: 366647
URL: https://svnweb.freebsd.org/changeset/base/366647

Log:
  pf: create a kif for flags
  
  If userspace tries to set flags (e.g. 'set skip on ') and 
  doesn't exist we should create a kif so that we apply the flags when the
   does turn up.
  
  Otherwise we'd end up in surprising situations where the rules say the
  interface should be skipped, but it's not until the rules get re-applied.
  
  Reviewed by:  Lutz Donnerhacke 
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D26742

Modified:
  head/sys/netpfil/pf/pf_if.c

Modified: head/sys/netpfil/pf/pf_if.c
==
--- head/sys/netpfil/pf/pf_if.c Mon Oct 12 11:40:43 2020(r366646)
+++ head/sys/netpfil/pf/pf_if.c Mon Oct 12 12:39:37 2020(r366647)
@@ -801,9 +801,16 @@ int
 pfi_set_flags(const char *name, int flags)
 {
struct epoch_tracker et;
-   struct pfi_kif  *p;
+   struct pfi_kif  *p, *kif;
 
+   kif = malloc(sizeof(*kif), PFI_MTYPE, M_NOWAIT);
+   if (kif == NULL)
+   return (ENOMEM);
+
NET_EPOCH_ENTER(et);
+
+   kif = pfi_kif_attach(kif, name);
+
RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) {
if (pfi_skip_if(name, p))
continue;
@@ -817,13 +824,20 @@ int
 pfi_clear_flags(const char *name, int flags)
 {
struct epoch_tracker et;
-   struct pfi_kif  *p;
+   struct pfi_kif *p, *tmp;
 
NET_EPOCH_ENTER(et);
-   RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) {
+   RB_FOREACH_SAFE(p, pfi_ifhead, &V_pfi_ifs, tmp) {
if (pfi_skip_if(name, p))
continue;
p->pfik_flags &= ~flags;
+
+   if (p->pfik_ifp == NULL && p->pfik_group == NULL &&
+   p->pfik_flags == 0) {
+   /* Delete this kif. */
+   RB_REMOVE(pfi_ifhead, &V_pfi_ifs, p);
+   free(p, PFI_MTYPE);
+   }
}
NET_EPOCH_EXIT(et);
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366648 - head/tests/sys/netpfil/pf

2020-10-12 Thread Kristof Provost
Author: kp
Date: Mon Oct 12 12:41:10 2020
New Revision: 366648
URL: https://svnweb.freebsd.org/changeset/base/366648

Log:
  pf tests: Test that 'set skip on ' works on new group members
  
  There's a know issue where new group members don't get the 'set skip on'
  applied until the rules are re-loaded.
  
  Do this by setting rules that block all traffic, but skip members of the
  'epair' group. If we can communicate over the epair interface we know the set
  skip rule took effect, even if the rule was set before the interface was
  created.
  
  MFC after:2 weeks

Modified:
  head/tests/sys/netpfil/pf/set_skip.sh

Modified: head/tests/sys/netpfil/pf/set_skip.sh
==
--- head/tests/sys/netpfil/pf/set_skip.sh   Mon Oct 12 12:39:37 2020
(r366647)
+++ head/tests/sys/netpfil/pf/set_skip.sh   Mon Oct 12 12:41:10 2020
(r366648)
@@ -85,8 +85,41 @@ set_skip_group_lo_cleanup()
pft_cleanup
 }
 
+atf_test_case "set_skip_dynamic" "cleanup"
+set_skip_dynamic_head()
+{
+   atf_set descr "Cope with group changes"
+   atf_set require.user root
+}
+
+set_skip_dynamic_body()
+{
+   pft_init
+
+   set -x
+
+   vnet_mkjail alcatraz
+   jexec alcatraz pfctl -e
+   pft_set_rules alcatraz "set skip on epair" \
+   "block"
+
+   epair=$(vnet_mkepair)
+   ifconfig ${epair}a 192.0.2.2/24 up
+   ifconfig ${epair}b vnet alcatraz
+
+   jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
+
+   atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 192.0.2.2
+}
+
+set_skip_dynamic_cleanup()
+{
+   pft_cleanup
+}
+
 atf_init_test_cases()
 {
atf_add_test_case "set_skip_group"
atf_add_test_case "set_skip_group_lo"
+   atf_add_test_case "set_skip_dynamic"
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366634 - head/contrib/nvi/common

2020-10-12 Thread Jessica Clarke
On 12 Oct 2020, at 11:42, Alex Richardson  wrote:
> --- head/contrib/nvi/common/common.h  Mon Oct 12 10:42:19 2020
> (r366633)
> +++ head/contrib/nvi/common/common.h  Mon Oct 12 10:42:24 2020
> (r366634)
> @@ -14,7 +14,7 @@
> #ifdef __linux__
> #include "/usr/include/db1/db.h"  /* Only include db1. */
> #else
> -#include "/usr/include/db.h" /* Only include db1. */
> +#include   /* Only include db1. */
> #endif

Can this not be expressed more nicely as the following?

/* Only include db1 */
#if __has_include()
#include 
#else
#include 
#endif

Jess

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


Re: svn commit: r366634 - head/contrib/nvi/common

2020-10-12 Thread Alexander Richardson
On Mon, 12 Oct 2020 at 14:55, Jessica Clarke  wrote:
>
> On 12 Oct 2020, at 11:42, Alex Richardson  wrote:
> > --- head/contrib/nvi/common/common.h  Mon Oct 12 10:42:19 2020
> > (r366633)
> > +++ head/contrib/nvi/common/common.h  Mon Oct 12 10:42:24 2020
> > (r366634)
> > @@ -14,7 +14,7 @@
> > #ifdef __linux__
> > #include "/usr/include/db1/db.h"  /* Only include db1. */
> > #else
> > -#include "/usr/include/db.h" /* Only include db1. */
> > +#include   /* Only include db1. */
> > #endif
>
> Can this not be expressed more nicely as the following?
>
> /* Only include db1 */
> #if __has_include()
> #include 
> #else
> #include 
> #endif
>
> Jess
>

Yes it could, but I'd prefer it if upstream fixes it instead so we can
drop this diff. See also https://github.com/lichray/nvi2/issues/69.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366652 - head/sys/dev/iicbus

2020-10-12 Thread Ian Lepore
Author: ian
Date: Mon Oct 12 18:02:51 2020
New Revision: 366652
URL: https://svnweb.freebsd.org/changeset/base/366652

Log:
  Bug fixes for the ads111x driver... make configurable gain and sample rate
  hints work on per-channel basis as documented, rather than chip-wide.  Also,
  when configured via hints, return BUS_PROBE_NOWILDCARD on successful hints
  match, so that the hints don't bogusly match other types of i2c chips.

Modified:
  head/sys/dev/iicbus/ads111x.c

Modified: head/sys/dev/iicbus/ads111x.c
==
--- head/sys/dev/iicbus/ads111x.c   Mon Oct 12 17:43:38 2020
(r366651)
+++ head/sys/dev/iicbus/ads111x.c   Mon Oct 12 18:02:51 2020
(r366652)
@@ -456,12 +456,15 @@ ads111x_add_channels(struct ads111x_softc *sc)
name = device_get_name(sc->dev);
unit = device_get_unit(sc->dev);
for (chan = 0; chan < sc->chipinfo->numchan; ++chan) {
+   char resname[16];
found = false;
gainidx = DEFAULT_GAINIDX;
rateidx = DEFAULT_RATEIDX;
-   if (resource_int_value(name, unit, "gain_index", &gainidx) == 0)
+   snprintf(resname, sizeof(resname), "%d.gain_index", chan);
+   if (resource_int_value(name, unit, resname, &gainidx) == 0)
found = true;
-   if (resource_int_value(name, unit, "rate_index", &gainidx) == 0)
+   snprintf(resname, sizeof(resname), "%d.rate_index", chan);
+   if (resource_int_value(name, unit, resname, &rateidx) == 0)
found = true;
if (found) {
ads111x_setup_channel(sc, chan, gainidx, rateidx);
@@ -522,7 +525,11 @@ ads111x_probe(device_t dev)
info = ads111x_find_chipinfo(dev);
if (info != NULL) {
device_set_desc(dev, info->name);
+#ifdef FDT
return (BUS_PROBE_DEFAULT);
+#else
+   return (BUS_PROBE_NOWILDCARD);
+#endif
}
 
return (ENXIO);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366655 - in head: contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/clang/lib/Driver/ToolChains contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-project/llvm/lib/C...

2020-10-12 Thread Dimitry Andric
Author: dim
Date: Mon Oct 12 21:35:29 2020
New Revision: 366655
URL: https://svnweb.freebsd.org/changeset/base/366655

Log:
  Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
  release/11.x llvmorg-11.0.0-0-g176249bd673 (aka 11.0.0 release).
  
  MFC after:4 weeks
  X-MFC-With:   r364284

Modified:
  head/contrib/llvm-project/clang/include/clang/Driver/Options.td
  head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
  head/lib/clang/include/VCSVersion.inc
  head/lib/clang/include/llvm/Support/VCSRevision.h
Directory Properties:
  head/contrib/llvm-project/   (props changed)
  head/contrib/llvm-project/clang/   (props changed)
  head/contrib/llvm-project/llvm/   (props changed)

Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td
==
--- head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Oct 
12 21:31:49 2020(r366654)
+++ head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Oct 
12 21:35:29 2020(r366655)
@@ -1435,11 +1435,11 @@ def fno_pch_validate_input_files_content:
   Group, Flags<[DriverOption]>;
 def fpch_instantiate_templates:
   Flag <["-"], "fpch-instantiate-templates">,
-  Group, Flags<[CC1Option]>,
+  Group, Flags<[CC1Option, CoreOption]>,
   HelpText<"Instantiate templates already while building a PCH">;
 def fno_pch_instantiate_templates:
   Flag <["-"], "fno-pch-instantiate-templates">,
-  Group, Flags<[CC1Option]>;
+  Group, Flags<[CC1Option, CoreOption]>;
 defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ",
   "code for uses of this PCH that assumes an explicit object file will be 
built for the PCH">;
 defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate 
",

Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp
==
--- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Oct 
12 21:31:49 2020(r366654)
+++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Oct 
12 21:35:29 2020(r366655)
@@ -1197,7 +1197,11 @@ void Clang::AddPreprocessingOptions(Compilation &C, co
 if (YcArg && JA.getKind() >= Action::PrecompileJobClass &&
 JA.getKind() <= Action::AssembleJobClass) {
   CmdArgs.push_back(Args.MakeArgString("-building-pch-with-obj"));
-  CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates"));
+  // -fpch-instantiate-templates is the default when creating
+  // precomp using /Yc
+  if (Args.hasFlag(options::OPT_fpch_instantiate_templates,
+   options::OPT_fno_pch_instantiate_templates, true))
+CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates"));
 }
 if (YcArg || YuArg) {
   StringRef ThroughHeader = YcArg ? YcArg->getValue() : YuArg->getValue();

Modified: 
head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
==
--- head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp  
Mon Oct 12 21:31:49 2020(r366654)
+++ head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp  
Mon Oct 12 21:35:29 2020(r366655)
@@ -5751,10 +5751,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O
 
 // If we already have the use of the negated floating constant, it is free
 // to negate it even it has multiple uses.
-if (!Op.hasOneUse() && CFP.use_empty()) {
-  RemoveDeadNode(CFP);
+if (!Op.hasOneUse() && CFP.use_empty())
   break;
-}
 Cost = NegatibleCost::Neutral;
 return CFP;
   }

Modified: head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
==
--- head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp   Mon Oct 
12 21:31:49 2020(r366654)
+++ head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp   Mon Oct 
12 21:35:29 2020(r366655)
@@ -627,6 +627,14 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple
 if (PreRegAlloc && MI.isCall())
   return false;
 
+// TailDuplicator::appendCopies will erroneously place COPYs after
+// INLINEASM_BR instructions after 4b0aa5724fea, which demonstrates the 
same
+// bug that was fixed in f7a53d82c090.
+// FIXME: Use findPHICopyInsertPoint() to find the correct insertion point
+//for the COPY when replacing PHIs.
+if (MI.getOpcode() == TargetOpcode::INLINEASM_BR)
+  return false;
+
 if (MI.isBundle())
   InstrCount += MI.getBundleSize();
 else if (!MI.isPHI() && !MI.isMetaInstruction(

svn commit: r366656 - head/sys/kern

2020-10-12 Thread Warner Losh
Author: imp
Date: Mon Oct 12 22:07:44 2020
New Revision: 366656
URL: https://svnweb.freebsd.org/changeset/base/366656

Log:
  newbus: use ssize_t to match sb's len and size, fix ordering of space check
  
  Both s_len and s_size are ssize_t, so their differece is also more
  properly a ssize_t not a size_t. Also, assert that len is <= size when
  we enter. This should always be the case. Ensure that we have that one
  byte that we write to the end of the buffer before we do so, though
  the error should already be set on the buffer if not, and the only
  times we supply 'partial' buffers they should be plenty large.
  
  Reviewed by: cem, jhb (prior version, I did cem's suggestion)
  Differential Revsion: https://reviews.freebsd.org/D26752

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cMon Oct 12 21:35:29 2020(r366655)
+++ head/sys/kern/subr_bus.cMon Oct 12 22:07:44 2020(r366656)
@@ -4956,18 +4956,19 @@ static int
 bus_child_pnpinfo_sb(device_t dev, struct sbuf *sb)
 {
char *p;
-   size_t space;
+   ssize_t space;
 
MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0);
+   MPASS(sb->s_size >= sb->s_len);
if (sb->s_error != 0)
return (-1);
-   p = EOB(sb);
-   *p = '\0';  /* sbuf buffer isn't NUL terminated until sbuf_finish() 
*/
space = SPACE(sb);
if (space <= 1) {
sb->s_error = ENOMEM;
return (-1);
}
+   p = EOB(sb);
+   *p = '\0';  /* sbuf buffer isn't NUL terminated until sbuf_finish() 
*/
bus_child_pnpinfo_str(dev, p, space);
sb->s_len += strlen(p);
return (0);
@@ -4985,18 +4986,19 @@ static int
 bus_child_location_sb(device_t dev, struct sbuf *sb)
 {
char *p;
-   size_t space;
+   ssize_t space;
 
MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0);
+   MPASS(sb->s_size >= sb->s_len);
if (sb->s_error != 0)
return (-1);
-   p = EOB(sb);
-   *p = '\0';  /* sbuf buffer isn't NUL terminated until sbuf_finish() 
*/
space = SPACE(sb);
if (space <= 1) {
sb->s_error = ENOMEM;
return (-1);
}
+   p = EOB(sb);
+   *p = '\0';  /* sbuf buffer isn't NUL terminated until sbuf_finish() 
*/
bus_child_location_str(dev, p, space);
sb->s_len += strlen(p);
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366657 - in head: stand/efi/boot1 stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts/common/os sys/contrib/openzfs/include/os/freebsd/linux sys/contrib/openzfs/include/...

2020-10-12 Thread Warner Losh
Author: imp
Date: Mon Oct 12 22:19:07 2020
New Revision: 366657
URL: https://svnweb.freebsd.org/changeset/base/366657

Log:
  Add zstd support to the boot loader.
  
  Add support to the _STANDALONE environment enough bits of the kernel
  that we can compile it. We still have a small zstd_shim.c since there
  were 3 items that were a bit hard to nail down and may be cleaned up
  in the future. These go hand in hand with a number of commits to
  sys/sys in the past weeks, should this need be MFCd.
  
  Discussed with: mmacy (in review and on IRC/Slack)
  Reviewed by: freqlabs (on openzfs repo)
  Differential Revision: https://reviews.freebsd.org/D26218

Added:
  head/stand/libsa/zfs/zstd_shim.c   (contents, props changed)
 - copied, changed from r366656, 
head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h
Deleted:
  head/sys/cddl/contrib/opensolaris/uts/common/os/list.c
Modified:
  head/stand/efi/boot1/Makefile
  head/stand/libsa/zfs/Makefile.inc
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/sys/cddl/boot/zfs/zfssubr.c
  head/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/rpc/xdr.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/byteorder.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sig.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/taskq.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h
  head/sys/contrib/openzfs/include/sys/nvpair.h
  head/sys/contrib/openzfs/include/sys/zfs_context.h
  head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/param.h
  head/sys/contrib/openzfs/module/os/freebsd/spl/list.c

Modified: head/stand/efi/boot1/Makefile
==
--- head/stand/efi/boot1/Makefile   Mon Oct 12 22:07:44 2020
(r366656)
+++ head/stand/efi/boot1/Makefile   Mon Oct 12 22:19:07 2020
(r366657)
@@ -40,6 +40,7 @@ CFLAGS.zfs_module.c+= -I${SYSDIR}/contrib/openzfs/incl
 CFLAGS.zfs_module.c+=  -I${SYSDIR}/contrib/openzfs/include/os/freebsd/spl
 CFLAGS.zfs_module.c+=  -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
 CFLAGS.zfs_module.c+=  -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4
+CFLAGS.zfs_module.c+=  -include ${ZFSOSINC}/spl/sys/ccompile.h
 
 CFLAGS+=   -DEFI_ZFS_BOOT
 .endif

Modified: head/stand/libsa/zfs/Makefile.inc
==
--- head/stand/libsa/zfs/Makefile.inc   Mon Oct 12 22:07:44 2020
(r366656)
+++ head/stand/libsa/zfs/Makefile.inc   Mon Oct 12 22:19:07 2020
(r366657)
@@ -1,17 +1,37 @@
 # $FreeBSD$
 
 .PATH: ${ZFSSRC}
-SRCS+= zfs.c nvlist.c skein.c skein_block.c list.c
 .PATH: ${SYSDIR}/crypto/skein
-.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os
+.PATH: ${ZFSOSSRC}/spl
+.PATH: ${OZFS}/module/zstd/lib
+ZFSSRC=zfs.c nvlist.c skein.c skein_block.c list.c zstd_shim.c 
zstd.c
+SRCS+= ${ZFSSRC}
 
 CFLAGS+=   -I${LDRSRC}
 CFLAGS+=   -I${SYSDIR}/cddl/boot/zfs
-CFLAGS+=   -I${SYSDIR}/cddl/contrib/opensolaris/uts/common
 CFLAGS+=   -I${SYSDIR}/crypto/skein
 
+ZFS_EARLY= -I${ZFSOSINC}   \
+   -I${ZFSOSINC}/spl   \
+   -I${ZFSOSINC}/zfs
+
+.for i in ${ZFSSRC}
+CFLAGS.$i+=-include ${ZFSOSINC}/spl/sys/ccompile.h
+.endfor
+
+CFLAGS_EARLY.list.c+= ${ZFS_EARLY}
+CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY}
+
+# Can't use the early flags because there's two conflicting definitions of 
boolean_t in
+# the zfs code that need to be unified.
+CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl
+CFLAGS.zfs.c+= -I${ZFSOSINC}/spl   \
+   -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+CFLAGS.zstd_shim.c+= -DIN_BASE -I${OZFS}/include
+
 # Do not unroll skein loops, reduce code size
 CFLAGS.skein_block.c+= -DSKEIN_LOOP=111
+
 CFLAGS+=   -I${SYSDIR}/contrib/openzfs/include
 CFLAGS+=   -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
 CFLAGS.zfs.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.