Re: svn commit: r364746 - in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cm

2020-08-25 Thread Alexey Dokuchaev
On Tue, Aug 25, 2020 at 02:21:27AM +, Matt Macy wrote:
> New Revision: 364746
> URL: https://svnweb.freebsd.org/changeset/base/364746
> 
> Log:
>   Merge OpenZFS support in to HEAD.
>   
>   The primary benefit is maintaining a completely shared
>   code base with the community allowing FreeBSD to receive
>   new features sooner and with less effort.

This commit raises several questions.  To start, I see a lot of things
checked in under `sys/contrib/openzfs' which do not belong to the kernel
(e.g. userland programs, libraries, manpages, bash completions, test
suite, etc/sudoers.d) or FreeBSD at all (init.d, initramfs, systemd).
Why those bits were not cleaned up, or at least kept on the vendor
branch only?

>   Improvements include:
> project quotas, encrypted datasets,
> allocation classes, vectorized raidz,
> vectorized checksums, various command line
> improvements, zstd compression.

And what about regressions?  Would illumos (opensolaris) ZFS be also
offered, maybe from ports, for those of us who prefer stable and highly
reliable implementation?

> Added: head/cddl/lib/libicp/Makefile
> ...
> +core/kcf_prov_lib.c \
> +core/kcf_callprov.c \
> +core/kcf_mech_tabs.c \
> +core/kcf_prov_tabs.c \
> +$(ASM_SOURCES_C)
> +
> +
> +
> +
> +
> +
> +SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)

There are many excessive whitespace bugs, this is the most prominent.
How did they pass the review?

./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: r364781 - in head/sys: conf modules/zfs

2020-08-25 Thread Warner Losh
Got diffs?

Warner

On Tue, Aug 25, 2020, 2:17 PM Brooks Davis  wrote:

> On Tue, Aug 25, 2020 at 07:04:54PM +, Brandon Bergren wrote:
> > Author: bdragon
> > Date: Tue Aug 25 19:04:54 2020
> > New Revision: 364781
> > URL: https://svnweb.freebsd.org/changeset/base/364781
> >
> > Log:
> >   [PowerPC] More preemptive powerpcspe ZFS build fixes
> >
> >   I went through the merge and found the rest of the instances where
> >   ${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and
> adjusted
> >   the rest of the instances to also check for powerpcspe.
> >
> >   mips32* will probably want to do the same.
> >
> >   Sponsored by:   Tag1 Consulting, Inc.
> >
> > Modified:
> >   head/sys/conf/kern.pre.mk
> >   head/sys/modules/zfs/Makefile
> >
> > Modified: head/sys/conf/kern.pre.mk
> >
> ==
> > --- head/sys/conf/kern.pre.mk Tue Aug 25 18:54:10 2020(r364780)
> > +++ head/sys/conf/kern.pre.mk Tue Aug 25 19:04:54 2020(r364781)
> > @@ -257,7 +257,7 @@ ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64
> -DHAVE_
> >  .endif
> >
> >  .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
> > - ${MACHINE_ARCH} == "arm"
> > + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
> >  ZFS_CFLAGS+= -DBITS_PER_LONG=32
> >  .else
> >  ZFS_CFLAGS+= -DBITS_PER_LONG=64
>
> In CheriBSD we've added a MACHINE_ABI variable that could be used to
> simplify this mess of checks.
>
>
> https://github.com/CTSRD-CHERI/cheribsd/blob/5ee735e5f8ef7268731359a2d8a9a8218df2d23f/share/mk/bsd.cpu.mk#L478
>
> As currently implemented you'd use:
>
> .if ${MACHINE_ABI:Mptr64}
>
> There's be a argument for adding long32 and long64 for to avoid
> conflating long and pointer size.
>
> -- Brooks
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364746 - in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cm

2020-08-25 Thread Cy Schubert
In message <202008250221.07p2lrst044...@repo.freebsd.org>, Matt Macy writes:
> Author: mmacy
> Date: Tue Aug 25 02:21:27 2020
> New Revision: 364746
> URL: https://svnweb.freebsd.org/changeset/base/364746
>
> Log:
>   Merge OpenZFS support in to HEAD.
>   
>   The primary benefit is maintaining a completely shared
>   code base with the community allowing FreeBSD to receive
>   new features sooner and with less effort.
>   
>   I would advise against doing 'zpool upgrade'
>   or creating indispensable pools using new
>   features until this change has had a month+
>   to soak.
>   
>   Work on merging FreeBSD support in to what was
>   at the time "ZFS on Linux" began in August 2018.
>   I first publicly proposed transitioning FreeBSD
>   to (new) OpenZFS on December 18th, 2018. FreeBSD
>   support in OpenZFS was finally completed in December
>   2019. A CFT for downstreaming OpenZFS support in
>   to FreeBSD was first issued on July 8th. All issues
>   that were reported have been addressed or, for
>   a couple of less critical matters there are
>   pull requests in progress with OpenZFS. iXsystems
>   has tested and dogfooded extensively internally.
>   The TrueNAS 12 release is based on OpenZFS with
>   some additional features that have not yet made
>   it upstream.
>   
>   Improvements include:
> project quotas, encrypted datasets,
> allocation classes, vectorized raidz,
> vectorized checksums, various command line
> improvements, zstd compression.
>   
>   Thanks to those who have helped along the way:
>   Ryan Moeller, Allan Jude, Zack Welch, and many
>   others.
>   
>   Sponsored by:   iXsystems, Inc.
>   Differential Revision:  https://reviews.freebsd.org/D25872
>

Relnotes?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.


___
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: r364802 - head/tools/build

2020-08-25 Thread Ed Maste
Author: emaste
Date: Wed Aug 26 04:01:06 2020
New Revision: 364802
URL: https://svnweb.freebsd.org/changeset/base/364802

Log:
  Apply a big hammer for stale pre-OpenZFS files
  
  -DNO_CLEAN builds have had trouble across the OpenZFS import.  It's not
  worth the effort to try to address this with any granularity; instead,
  just trigger on a .depend file indicating a tree from before the import,
  and remove the whole cddl object tree.
  
  Reviewed by:  mmacy, kevans
  Differential Revision:https://reviews.freebsd.org/D26189

Modified:
  head/tools/build/depend-cleanup.sh

Modified: head/tools/build/depend-cleanup.sh
==
--- head/tools/build/depend-cleanup.sh  Wed Aug 26 03:41:29 2020
(r364801)
+++ head/tools/build/depend-cleanup.sh  Wed Aug 26 04:01:06 2020
(r364802)
@@ -43,3 +43,11 @@ clean_dep lib/libc   shm_open S
 clean_dep lib/libomp ittnotify_static c
 # 20200414  r359930  closefrom
 clean_dep lib/libc   closefrom S
+
+# 20200826  r364746  OpenZFS merge, apply a big hammer (remove whole tree)
+if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \
+egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" 
\
+"$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
+   echo "Removing old ZFS tree"
+   rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl
+fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364801 - head/tools/build

2020-08-25 Thread Ed Maste
Author: emaste
Date: Wed Aug 26 03:41:29 2020
New Revision: 364801
URL: https://svnweb.freebsd.org/changeset/base/364801

Log:
  depend-cleanup.sh: add a note about removing old entries

Modified:
  head/tools/build/depend-cleanup.sh

Modified: head/tools/build/depend-cleanup.sh
==
--- head/tools/build/depend-cleanup.sh  Wed Aug 26 02:44:35 2020
(r364800)
+++ head/tools/build/depend-cleanup.sh  Wed Aug 26 03:41:29 2020
(r364801)
@@ -11,6 +11,11 @@
 # We handle those cases here in an ad-hoc fashion by looking for the known-
 # bad case in the main .depend file, and if found deleting all of the related
 # .depend files (including for example the lib32 version).
+#
+# These tests increase the build time (albeit by a small amount), so they
+# should be removed once enough time has passed and it is extremely unlikely
+# anyone would try a NO_CLEAN build against an object tree from before the
+# related change.  One year should be sufficient.
 
 OBJTOP=$1
 if [ ! -d "$OBJTOP" ]; then
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364800 - head/sys/geom/eli

2020-08-25 Thread Alan Somers
Author: asomers
Date: Wed Aug 26 02:44:35 2020
New Revision: 364800
URL: https://svnweb.freebsd.org/changeset/base/364800

Log:
  geli: use unmapped I/O
  
  Use unmapped I/O for geli. Unlike most geom providers, geli needs to
  manipulate data on every read or write. Previously it would always map bios.
  
  On my 16-core, dual socket server using geli atop md(4) devices, with 512B
  sectors, this change increases geli IOPs by about 3x.
  
  Note that geli still can't use unmapped I/O when data integrity verification
  is enabled (but it could, with a little more work).  And it can't use
  unmapped I/O in combination with ZFS, because ZFS uses mapped bios.
  
  Reviewed by:  markj, kib, jhb, mjg, mat, bcr (manpages)
  MFC after:1 week
  Sponsored by: Axcient
  Differential Revision:https://reviews.freebsd.org/D25671

Modified:
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli_privacy.c

Modified: head/sys/geom/eli/g_eli.c
==
--- head/sys/geom/eli/g_eli.c   Wed Aug 26 02:37:42 2020(r364799)
+++ head/sys/geom/eli/g_eli.c   Wed Aug 26 02:44:35 2020(r364800)
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include 
@@ -972,6 +974,15 @@ g_eli_create(struct gctl_req *req, struct g_class *mp,
 */
pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX);
pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE;
+   if (CRYPTO_HAS_VMPAGE) {
+   /*
+* On DMAP architectures we can use unmapped I/O.  But don't
+* use it with data integrity verification.  That code hasn't
+* been written yet.
+*/
+if ((sc->sc_flags & G_ELI_FLAG_AUTH) == 0)
+   pp->flags |= G_PF_ACCEPT_UNMAPPED;
+   }
pp->mediasize = sc->sc_mediasize;
pp->sectorsize = sc->sc_sectorsize;
LIST_FOREACH(gap, >aliases, ga_next)

Modified: head/sys/geom/eli/g_eli_privacy.c
==
--- head/sys/geom/eli/g_eli_privacy.c   Wed Aug 26 02:37:42 2020
(r364799)
+++ head/sys/geom/eli/g_eli_privacy.c   Wed Aug 26 02:44:35 2020
(r364800)
@@ -63,6 +63,28 @@ __FBSDID("$FreeBSD$");
 MALLOC_DECLARE(M_ELI);
 
 /*
+ * Copy data from a (potentially unmapped) bio to a kernelspace buffer.
+ *
+ * The buffer must have at least as much room as bp->bio_length.
+ */
+static void
+g_eli_bio_copyin(struct bio *bp, void *kaddr)
+{
+   struct uio uio;
+   struct iovec iov[1];
+
+   iov[0].iov_base = kaddr;
+   iov[0].iov_len = bp->bio_length;
+   uio.uio_iov = iov;
+   uio.uio_iovcnt = 1;
+   uio.uio_offset = 0;
+   uio.uio_resid = bp->bio_length;
+   uio.uio_segflg = UIO_SYSSPACE;
+   uio.uio_rw = UIO_READ;
+   uiomove_fromphys(bp->bio_ma, bp->bio_ma_offset, bp->bio_length, );
+}
+
+/*
  * The function is called after we read and decrypt data.
  *
  * g_eli_start -> g_eli_crypto_read -> g_io_request -> g_eli_read_done -> 
g_eli_crypto_run -> G_ELI_CRYPTO_READ_DONE -> g_io_deliver
@@ -98,8 +120,7 @@ g_eli_crypto_read_done(struct cryptop *crp)
 */
if (bp->bio_inbed < bp->bio_children)
return (0);
-   free(bp->bio_driver2, M_ELI);
-   bp->bio_driver2 = NULL;
+
if (bp->bio_error != 0) {
G_ELI_LOGREQ(0, bp, "Crypto READ request failed (error=%d).",
bp->bio_error);
@@ -167,6 +188,11 @@ g_eli_crypto_write_done(struct cryptop *crp)
return (0);
}
cbp->bio_data = bp->bio_driver2;
+   /* 
+* Clear BIO_UNMAPPED, which was inherited from where we cloned the bio
+* in g_eli_start, because we manually set bio_data
+*/
+   cbp->bio_flags &= ~BIO_UNMAPPED;
cbp->bio_done = g_eli_write_done;
cp = LIST_FIRST(>consumer);
cbp->bio_to = cp->provider;
@@ -236,10 +262,12 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *
 {
struct g_eli_softc *sc;
struct cryptop *crp;
+   vm_page_t *pages;
u_int i, nsec, secsize;
off_t dstoff;
-   u_char *data;
+   u_char *data = NULL;
int error;
+   int pages_offset;
 
G_ELI_LOGREQ(3, bp, "%s", __func__);
 
@@ -258,16 +286,37 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *
if (bp->bio_cmd == BIO_WRITE) {
data = malloc(bp->bio_length, M_ELI, M_WAITOK);
bp->bio_driver2 = data;
-   bcopy(bp->bio_data, data, bp->bio_length);
-   } else
-   data = bp->bio_data;
+   /* 
+* This copy could be eliminated by using crypto's output
+* buffer, instead of using a single overwriting buffer.
+*/
+   if ((bp->bio_flags & BIO_UNMAPPED) != 0)
+   

svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto

2020-08-25 Thread Alan Somers
Author: asomers
Date: Wed Aug 26 02:37:42 2020
New Revision: 364799
URL: https://svnweb.freebsd.org/changeset/base/364799

Log:
  crypto(9): add CRYPTO_BUF_VMPAGE
  
  crypto(9) functions can now be used on buffers composed of an array of
  vm_page_t structures, such as those stored in an unmapped struct bio.  It
  requires the running to kernel to support the direct memory map, so not all
  architectures can use it.
  
  Reviewed by:  markj, kib, jhb, mjg, mat, bcr (manpages)
  MFC after:1 week
  Sponsored by: Axcient
  Differential Revision:https://reviews.freebsd.org/D25671

Modified:
  head/share/man/man9/crypto_buffer.9
  head/share/man/man9/crypto_request.9
  head/sys/crypto/ccp/ccp.c
  head/sys/dev/cxgbe/crypto/t4_crypto.c
  head/sys/dev/sec/sec.c
  head/sys/kern/subr_bus_dma.c
  head/sys/opencrypto/criov.c
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptodev.h
  head/sys/opencrypto/cryptosoft.c

Modified: head/share/man/man9/crypto_buffer.9
==
--- head/share/man/man9/crypto_buffer.9 Wed Aug 26 02:13:27 2020
(r364798)
+++ head/share/man/man9/crypto_buffer.9 Wed Aug 26 02:37:42 2020
(r364799)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2020
+.Dd August 12, 2020
 .Dt CRYPTO_BUFFER 9
 .Os
 .Sh NAME
@@ -197,10 +197,17 @@ A scatter/gather list of kernel buffers as described i
 .It Dv CRYPTO_BUF_MBUF
 A network memory buffer as described in
 .Xr mbuf 9 .
+.It Dv CRYPTO_BUF_VMPAGE
+A scatter/gather list of 
+.Vt vm_page_t
+structures describing pages in the kernel's address space.
+This buffer type is only available if
+.Dv CRYPTO_HAS_VMPAGE
+is true.
 .El
 .Pp
 The structure also contains the following type-specific fields:
-.Bl -tag -width "  cb_buf_len"
+.Bl -tag -width "  cb_vm_page_offset"
 .It Fa cb_buf
 A pointer to the start of a
 .Dv CRYPTO_BUF_CONTIG
@@ -219,6 +226,19 @@ A pointer to a
 .Vt struct uio
 for
 .Dv CRYPTO_BUF_UIO .
+.It Fa cb_vm_page
+A pointer to an array of
+.Vt struct vm_page
+for
+.Dv CRYPTO_BUF_VMPAGE .
+.It Fa cb_vm_page_len
+The total amount of data included in the
+.Fa cb_vm_page
+array, in bytes.
+.It Fa cb_vm_page_offset
+Offset in bytes in the first page of
+.Fa cb_vm_page
+where valid data begins.
 .El
 .Ss Cursors
 Cursors provide a mechanism for iterating over a data buffer.

Modified: head/share/man/man9/crypto_request.9
==
--- head/share/man/man9/crypto_request.9Wed Aug 26 02:13:27 2020
(r364798)
+++ head/share/man/man9/crypto_request.9Wed Aug 26 02:37:42 2020
(r364799)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 16, 2020
+.Dd August 12, 2020
 .Dt CRYPTO_REQUEST 9
 .Os
 .Sh NAME
@@ -55,11 +55,15 @@
 .Ft void
 .Fn crypto_use_uio "struct cryptop *crp" "struct uio *uio"
 .Ft void
+.Fn crypto_use_vmpage "struct cryptop *crp" "vm_page_t *pages" "int len" "int 
offset"
+.Ft void
 .Fn crypto_use_output_buf "struct cryptop *crp" "void *buf" "int len"
 .Ft void
 .Fn crypto_use_output_mbuf "struct cryptop *crp" "struct mbuf *m"
 .Ft void
 .Fn crypto_use_output_uio "struct cryptop *crp" "struct uio *uio"
+.Ft void
+.Fn crypto_use_output_vmpage "struct cryptop *crp" "vm_page_t *pages" "int 
len" "int offset"
 .Sh DESCRIPTION
 Each symmetric cryptographic operation in the kernel is described by
 an instance of
@@ -141,7 +145,7 @@ mode requests.
 All requests must have a valid
 .Fa crp_buf
 initialized by one of the following functions:
-.Bl -tag -width "Fn crypto_use_mbuf"
+.Bl -tag -width "Fn crypto_use_vmpage"
 .It Fn crypto_use_buf
 Uses an array of
 .Fa len
@@ -156,12 +160,16 @@ as the data buffer.
 Uses the scatter/gather list
 .Fa uio
 as the data buffer.
+.It Fn crypto_use_vmpage
+Uses the array of
+.Vt vm_page_t
+structures as the data buffer.
 .El
 .Pp
 One of the following functions should be used to initialize
 .Fa crp_obuf
 for requests that use separate input and output buffers:
-.Bl -tag -width "Fn crypto_use_output_mbuf"
+.Bl -tag -width "Fn crypto_use_output_vmpage"
 .It Fn crypto_use_output_buf
 Uses an array of
 .Fa len
@@ -176,6 +184,10 @@ as the output buffer.
 Uses the scatter/gather list
 .Fa uio
 as the output buffer.
+.It Fn crypto_use_output_vmpage
+Uses the array of
+.Vt vm_page_t
+structures as the output buffer.
 .El
 .Ss Request Regions
 Each request describes one or more regions in the data buffers.

Modified: head/sys/crypto/ccp/ccp.c
==
--- head/sys/crypto/ccp/ccp.c   Wed Aug 26 02:13:27 2020(r364798)
+++ head/sys/crypto/ccp/ccp.c   Wed Aug 26 02:37:42 2020(r364799)
@@ -107,6 +107,10 @@ ccp_populate_sglist(struct sglist *sg, struct crypto_b
case CRYPTO_BUF_CONTIG:
error = sglist_append(sg, cb->cb_buf, cb->cb_buf_len);
break;
+   case CRYPTO_BUF_VMPAGE:
+   error = 

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

2020-08-25 Thread D Scott Phillips
Author: scottph
Date: Wed Aug 26 02:13:27 2020
New Revision: 364798
URL: https://svnweb.freebsd.org/changeset/base/364798

Log:
  arm64: Increase dmap size to 95 TiB
  
  The Ampere Altra has physical memory populated sparsely within the
  physical address space. Increase the size of the dmap to cover all
  physical memory.
  
  Reviewed by:  andrew
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26134

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

Modified: head/sys/arm64/include/vmparam.h
==
--- head/sys/arm64/include/vmparam.hWed Aug 26 02:12:15 2020
(r364797)
+++ head/sys/arm64/include/vmparam.hWed Aug 26 02:13:27 2020
(r364798)
@@ -156,8 +156,8 @@
 #defineVM_MIN_KERNEL_ADDRESS   (0xUL)
 #defineVM_MAX_KERNEL_ADDRESS   (0x0080UL)
 
-/* 2 TiB maximum for the direct map region */
-#defineDMAP_MIN_ADDRESS(0xfd00UL)
+/* 95 TiB maximum for the direct map region */
+#defineDMAP_MIN_ADDRESS(0xa000UL)
 #defineDMAP_MAX_ADDRESS(0xff00UL)
 
 #defineDMAP_MIN_PHYSADDR   (dmap_phys_base)
___
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: r364797 - in head/sys/arm64: acpica arm64

2020-08-25 Thread D Scott Phillips
Author: scottph
Date: Wed Aug 26 02:12:15 2020
New Revision: 364797
URL: https://svnweb.freebsd.org/changeset/base/364797

Log:
  arm64/acpi: Give the real PA limit to ACPI
  
  Read PA bits from ID_AA64MMFR0_EL1.PARange.
  
  Reviewed by:  andrew, markj
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26133

Modified:
  head/sys/arm64/acpica/acpi_machdep.c
  head/sys/arm64/arm64/identcpu.c

Modified: head/sys/arm64/acpica/acpi_machdep.c
==
--- head/sys/arm64/acpica/acpi_machdep.cWed Aug 26 02:07:46 2020
(r364796)
+++ head/sys/arm64/acpica/acpi_machdep.cWed Aug 26 02:12:15 2020
(r364797)
@@ -232,12 +232,47 @@ acpi_map_addr(struct acpi_generic_address *addr, bus_s
 static void
 parse_pxm_tables(void *dummy)
 {
+   uint64_t mmfr0, parange;
 
/* Only parse ACPI tables when booting via ACPI */
if (arm64_bus_method != ARM64_BUS_ACPI)
return;
 
-   acpi_pxm_init(MAXCPU, (vm_paddr_t)1 << 40);
+   if (!get_kernel_reg(ID_AA64MMFR0_EL1, )) {
+   /* chosen arbitrarily */
+   mmfr0 = ID_AA64MMFR0_PARange_1T;
+   }
+
+   switch (ID_AA64MMFR0_PARange_VAL(mmfr0)) {
+   case ID_AA64MMFR0_PARange_4G:
+   parange = (vm_paddr_t)4 << 30 /* GiB */;
+   break;
+   case ID_AA64MMFR0_PARange_64G:
+   parange = (vm_paddr_t)64 << 30 /* GiB */;
+   break;
+   case ID_AA64MMFR0_PARange_1T:
+   parange = (vm_paddr_t)1 << 40 /* TiB */;
+   break;
+   case ID_AA64MMFR0_PARange_4T:
+   parange = (vm_paddr_t)4 << 40 /* TiB */;
+   break;
+   case ID_AA64MMFR0_PARange_16T:
+   parange = (vm_paddr_t)16 << 40 /* TiB */;
+   break;
+   case ID_AA64MMFR0_PARange_256T:
+   parange = (vm_paddr_t)256 << 40 /* TiB */;
+   break;
+   case ID_AA64MMFR0_PARange_4P:
+   parange = (vm_paddr_t)4 << 50 /* PiB */;
+   break;
+   default:
+   /* chosen arbitrarily */
+   parange = (vm_paddr_t)1 << 40 /* TiB */;
+   printf("Unknown value for PARange in mmfr0 (%#lx)\n", mmfr0);
+   break;
+   }
+
+   acpi_pxm_init(MAXCPU, parange);
acpi_pxm_parse_tables();
acpi_pxm_set_mem_locality();
 }

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Wed Aug 26 02:07:46 2020
(r364796)
+++ head/sys/arm64/arm64/identcpu.c Wed Aug 26 02:12:15 2020
(r364797)
@@ -916,6 +916,13 @@ static struct mrs_user_reg user_regs[] = {
.offset = __offsetof(struct cpu_desc, id_aa64dfr0),
.fields = id_aa64dfr0_fields,
},
+   {   /* id_aa64mmfr0_el1 */
+   .reg = ID_AA64MMFR0_EL1,
+   .CRm = 7,
+   .Op2 = 0,
+   .offset = __offsetof(struct cpu_desc, id_aa64mmfr0),
+   .fields = id_aa64mmfr0_fields,
+   },
 };
 
 #defineCPU_DESC_FIELD(desc, idx)   
\
___
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: r364796 - in head: share/man/man9 sys/sys

2020-08-25 Thread D Scott Phillips
Author: scottph
Date: Wed Aug 26 02:07:46 2020
New Revision: 364796
URL: https://svnweb.freebsd.org/changeset/base/364796

Log:
  bitset: add BIT_FFS_AT() for finding the first bit set greater than a start 
bit
  
  Reviewed by:  kib
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D26128

Modified:
  head/share/man/man9/bitset.9
  head/sys/sys/bitset.h

Modified: head/share/man/man9/bitset.9
==
--- head/share/man/man9/bitset.9Wed Aug 26 02:05:58 2020
(r364795)
+++ head/share/man/man9/bitset.9Wed Aug 26 02:07:46 2020
(r364796)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 12, 2019
+.Dd August 25, 2020
 .Dt BITSET 9
 .Os
 .Sh NAME
@@ -43,6 +43,7 @@
 .Nm BIT_EMPTY ,
 .Nm BIT_ISFULLSET ,
 .Nm BIT_FFS ,
+.Nm BIT_FFS_AT ,
 .Nm BIT_FLS ,
 .Nm BIT_COUNT ,
 .Nm BIT_SUBSET ,
@@ -86,6 +87,8 @@
 .Ft int
 .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset"
 .Ft int
+.Fn BIT_FFS_AT "const SETSIZE" "struct STRUCTNAME *bitset" "int start"
+.Ft int
 .Fn BIT_FLS "const SETSIZE" "struct STRUCTNAME *bitset"
 .Ft int
 .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset"
@@ -285,6 +288,18 @@ index parameter to any other
 macro, you must subtract one from the result.
 .Pp
 The
+.Fn BIT_FFS_AT
+macro returns the 1-index of the first (lowest) set bit in
+.Fa bitset ,
+which is greater than the given 1-indexed
+.Fa start ,
+or zero if no bits in
+.Fa bitset
+greater than
+.Fa start
+are set.
+.Pp
+The
 .Fn BIT_FLS
 macro returns the 1-index of the last (highest) set bit in
 .Fa bitset ,
@@ -518,7 +533,8 @@ argument to all of these macros must match the value g
 .Fn BITSET_DEFINE .
 .Pp
 Unlike every other reference to individual set members, which are zero-indexed,
-.Fn BIT_FFS
+.Fn BIT_FFS ,
+.Fn BIT_FFS_AT
 and
 .Fn BIT_FLS
 return a one-indexed result (or zero if the set is empty).

Modified: head/sys/sys/bitset.h
==
--- head/sys/sys/bitset.h   Wed Aug 26 02:05:58 2020(r364795)
+++ head/sys/sys/bitset.h   Wed Aug 26 02:07:46 2020(r364796)
@@ -207,20 +207,31 @@
(f)->__bits[__i]);  \
 } while (0)
 
-#defineBIT_FFS(_s, p) __extension__ ({ 
\
+/*
+ * Note that `start` and the returned value from BIT_FFS_AT are
+ * 1-based bit indices.
+ */
+#defineBIT_FFS_AT(_s, p, start) __extension__ ({   
\
__size_t __i;   \
+   long __mask;\
int __bit;  \
\
+   __mask = ~0UL << ((start) % _BITSET_BITS);  \
__bit = 0;  \
-   for (__i = 0; __i < __bitset_words((_s)); __i++) {  \
-   if ((p)->__bits[__i] != 0) {\
-   __bit = ffsl((p)->__bits[__i]); \
+   for (__i = __bitset_word((_s), (start));\
+   __i < __bitset_words((_s)); \
+   __i++) {\
+   if (((p)->__bits[__i] & __mask) != 0) { \
+   __bit = ffsl((p)->__bits[__i] & __mask);\
__bit += __i * _BITSET_BITS;\
break;  \
}   \
+   __mask = ~0UL;  \
}   \
__bit;  \
 })
+
+#defineBIT_FFS(_s, p) BIT_FFS_AT((_s), (p), 0)
 
 #defineBIT_FLS(_s, p) __extension__ ({ 
\
__size_t __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: r364795 - head/usr.sbin/efibootmgr

2020-08-25 Thread D Scott Phillips
Author: scottph
Date: Wed Aug 26 02:05:58 2020
New Revision: 364795
URL: https://svnweb.freebsd.org/changeset/base/364795

Log:
  efibootmgr: Add option to request booting to the firmware user interface
  
  The OsIndications UEFI variable can request the firware to stop at
  its UI instead of continuing with boot. Add flags for setting and
  clearing this request.
  
  Reviewed by:  manu, bcr (manpages)
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D25839

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 Aug 26 02:04:04 2020
(r364794)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Wed Aug 26 02:05:58 2020
(r364795)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 23, 2020
+.Dd August 25, 2020
 .Dt EFIBOOTMGR 8
 .Os
 .Sh NAME
@@ -55,6 +55,10 @@
 .Op Fl d
 .Op Fl p
 .Nm
+.Fl F
+.Nm
+.Fl f
+.Nm
 .Fl n
 .Fl b Ar bootnum
 .Nm
@@ -137,6 +141,9 @@ is specified, the UEFI device path to the ESP is repor
 If
 .Fl p -unix-path
 is specified, the mount point of the ESP is reported instead.
+.It Fl f -fw-ui , Fl F -no-fw-ui
+Set or clear the request to the system firmware to stop in its user
+interface on the next boot.
 .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 Aug 26 02:04:04 2020
(r364794)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Wed Aug 26 02:05:58 2020
(r364795)
@@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$");
 
 #define BAD_LENGTH ((size_t)-1)
 
+#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0001
+
 typedef struct _bmgr_opts {
char*env;
char*loader;
@@ -83,6 +85,8 @@ typedef struct _bmgr_opts {
booldry_run;
booldevice_path;
boolesp_device;
+   boolfw_ui;
+   boolno_fw_ui;
boolhas_bootnum;
boolonce;
int cp_src;
@@ -110,6 +114,8 @@ static struct option lopts[] = {
{"dry-run", no_argument, NULL, 'D'},
{"env", required_argument, NULL, 'e'},
{"esp", no_argument, NULL, 'E'},
+   {"fw-ui", no_argument, NULL, 'f'},
+   {"no-fw-ui", no_argument, NULL, 'F'},
{"help", no_argument, NULL, 'h'},
{"kernel", required_argument, NULL, 'k'},
{"label", required_argument, NULL, 'L'},
@@ -197,7 +203,7 @@ parse_args(int argc, char *argv[])
 {
int ch;
 
-   while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:Ehk:L:l:NnOo:pTt:v",
+   while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:v",
lopts, NULL)) != -1) {
switch (ch) {
case 'A':
@@ -232,6 +238,12 @@ parse_args(int argc, char *argv[])
case 'E':
opts.esp_device = true;
break;
+   case 'F':
+   opts.no_fw_ui = true;
+   break;
+   case 'f':
+   opts.fw_ui = true;
+   break;
case 'h':
default:
errx(1, "%s", USAGE);
@@ -825,6 +837,45 @@ print_boot_var(const char *name, bool verbose, bool cu
 }
 
 
+static bool
+os_indication_supported(uint64_t indication)
+{
+   uint8_t *data;
+   size_t size;
+   uint32_t attrs;
+   int ret;
+
+   ret = efi_get_variable(EFI_GLOBAL_GUID, "OsIndicationsSupported", ,
+   , );
+   if (ret < 0)
+   return false;
+   return (le64dec(data) & indication) == indication;
+}
+
+static uint64_t
+os_indications(void)
+{
+   uint8_t *data;
+   size_t size;
+   uint32_t attrs;
+   int ret;
+
+   ret = efi_get_variable(EFI_GLOBAL_GUID, "OsIndications", , ,
+   );
+   if (ret < 0)
+   return 0;
+   return le64dec(data);
+}
+
+static int
+os_indications_set(uint64_t mask, uint64_t val)
+{
+   uint8_t new[sizeof(uint64_t)];
+
+   le64enc(, (os_indications() & ~mask) | (val & mask));
+   return set_bootvar("OsIndications", new, sizeof(new));
+}
+
 /* Cmd epilogue, or just the default with no args.
  * The order is [bootnext] bootcurrent, timeout, order, and the bootvars [-v]
  */
@@ -841,7 +892,15 @@ print_boot_vars(bool verbose)
uint32_t attrs;
int ret, bolen;
uint16_t *boot_order = NULL, current;
+   bool boot_to_fw_ui;
 
+   if (os_indication_supported(EFI_OS_INDICATIONS_BOOT_TO_FW_UI)) {
+   boot_to_fw_ui =
+   (os_indications() & 

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

2020-08-25 Thread D Scott Phillips
Author: scottph
Date: Wed Aug 26 02:04:04 2020
New Revision: 364794
URL: https://svnweb.freebsd.org/changeset/base/364794

Log:
  arm64: Make local stores observable before sending IPIs
  
  Add a synchronizing instruction to flush and wait until the local
  CPU's writes are observable to other CPUs before sending IPIs.
  
  This fixes an issue where recipient CPUs doing a rendezvous could
  enter the rendezvous handling code before the initiator's writes
  to the smp_rv_* variables were visible. This manifested as a
  system hang, where a single CPU's increment of smp_rv_waiters[0]
  actually happened "before" the initiator's zeroing of that field,
  so all CPUs were stuck with the field appearing to be at
  ncpus - 1.
  
  Reviewed by:  andrew, markj
  Approved by:  scottl (implicit)
  MFC after:1 week
  Sponsored by: Ampere Computing, Inc.
  Differential Revision:https://reviews.freebsd.org/D25798

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

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Wed Aug 26 01:55:37 2020
(r364793)
+++ head/sys/arm64/arm64/mp_machdep.c   Wed Aug 26 02:04:04 2020
(r364794)
@@ -304,6 +304,13 @@ pic_ipi_send(void *arg, cpuset_t cpus, u_int ipi)
 {
 
KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__));
+
+   /*
+* Ensure that this CPU's stores will be visible to IPI
+* recipients before starting to send the interrupts.
+*/
+   dsb(ishst);
+
PIC_IPI_SEND(intr_irq_root_dev, arg, cpus, ipi);
 }
 
___
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: r364793 - in stable/11/secure/caroot: blacklisted trusted

2020-08-25 Thread Kyle Evans
Author: kevans
Date: Wed Aug 26 01:55:37 2020
New Revision: 364793
URL: https://svnweb.freebsd.org/changeset/base/364793

Log:
  Partial revert of r364792: caroot: switch to using echo+shell glob
  
  On stable/11, I mistakenly only tested installation of trusted certs.
  When the dir is empty, the glob remains unexpanded when it gets added to
  FILES.
  
  On stable/11 (but not 12 or head), this ends up being erroneous; it kind of
  looks like the glob is being expanded to a single-word empty string rather
  than leaving us with an empty FILES. Regardless, this isn't worth fixing on
  stable/11, so back it out.

Modified:
  stable/11/secure/caroot/blacklisted/Makefile
  stable/11/secure/caroot/trusted/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/secure/caroot/blacklisted/Makefile
==
--- stable/11/secure/caroot/blacklisted/MakefileWed Aug 26 00:50:27 
2020(r364792)
+++ stable/11/secure/caroot/blacklisted/MakefileWed Aug 26 01:55:37 
2020(r364793)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/blacklisted
 
-BLACKLISTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
+BLACKLISTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${BLACKLISTED_CERTS}
 

Modified: stable/11/secure/caroot/trusted/Makefile
==
--- stable/11/secure/caroot/trusted/MakefileWed Aug 26 00:50:27 2020
(r364792)
+++ stable/11/secure/caroot/trusted/MakefileWed Aug 26 01:55:37 2020
(r364793)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/trusted
 
-TRUSTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
+TRUSTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${TRUSTED_CERTS}
 
___
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: r364792 - in stable: 11/secure/caroot/blacklisted 11/secure/caroot/trusted 12/secure/caroot/blacklisted 12/secure/caroot/trusted

2020-08-25 Thread Kyle Evans
Author: kevans
Date: Wed Aug 26 00:50:27 2020
New Revision: 364792
URL: https://svnweb.freebsd.org/changeset/base/364792

Log:
  MFC r364600: caroot: switch to using echo+shell glob to enumerate certs
  
  This solves an issue on stable/12 that causes certs to not get installed.
  ls is apparently not in PATH during installworld, so TRUSTED_CERTS ends up
  blank and nothing gets installed. We don't really require anything
  ls-specific, though, so let's just simplify it.

Modified:
  stable/11/secure/caroot/blacklisted/Makefile
  stable/11/secure/caroot/trusted/Makefile
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/secure/caroot/blacklisted/Makefile
  stable/12/secure/caroot/trusted/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/secure/caroot/blacklisted/Makefile
==
--- stable/11/secure/caroot/blacklisted/MakefileWed Aug 26 00:42:59 
2020(r364791)
+++ stable/11/secure/caroot/blacklisted/MakefileWed Aug 26 00:50:27 
2020(r364792)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/blacklisted
 
-BLACKLISTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
+BLACKLISTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${BLACKLISTED_CERTS}
 

Modified: stable/11/secure/caroot/trusted/Makefile
==
--- stable/11/secure/caroot/trusted/MakefileWed Aug 26 00:42:59 2020
(r364791)
+++ stable/11/secure/caroot/trusted/MakefileWed Aug 26 00:50:27 2020
(r364792)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/trusted
 
-TRUSTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
+TRUSTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${TRUSTED_CERTS}
 
___
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: r364792 - in stable: 11/secure/caroot/blacklisted 11/secure/caroot/trusted 12/secure/caroot/blacklisted 12/secure/caroot/trusted

2020-08-25 Thread Kyle Evans
Author: kevans
Date: Wed Aug 26 00:50:27 2020
New Revision: 364792
URL: https://svnweb.freebsd.org/changeset/base/364792

Log:
  MFC r364600: caroot: switch to using echo+shell glob to enumerate certs
  
  This solves an issue on stable/12 that causes certs to not get installed.
  ls is apparently not in PATH during installworld, so TRUSTED_CERTS ends up
  blank and nothing gets installed. We don't really require anything
  ls-specific, though, so let's just simplify it.

Modified:
  stable/12/secure/caroot/blacklisted/Makefile
  stable/12/secure/caroot/trusted/Makefile
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/secure/caroot/blacklisted/Makefile
  stable/11/secure/caroot/trusted/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/secure/caroot/blacklisted/Makefile
==
--- stable/12/secure/caroot/blacklisted/MakefileWed Aug 26 00:42:59 
2020(r364791)
+++ stable/12/secure/caroot/blacklisted/MakefileWed Aug 26 00:50:27 
2020(r364792)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/blacklisted
 
-BLACKLISTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
+BLACKLISTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${BLACKLISTED_CERTS}
 

Modified: stable/12/secure/caroot/trusted/Makefile
==
--- stable/12/secure/caroot/trusted/MakefileWed Aug 26 00:42:59 2020
(r364791)
+++ stable/12/secure/caroot/trusted/MakefileWed Aug 26 00:50:27 2020
(r364792)
@@ -2,7 +2,7 @@
 
 BINDIR=/usr/share/certs/trusted
 
-TRUSTED_CERTS!=ls ${.CURDIR}/*.pem 2> /dev/null || true
+TRUSTED_CERTS!=echo ${.CURDIR}/*.pem 2> /dev/null || true
 
 FILES+= ${TRUSTED_CERTS}
 
___
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: r364791 - head/usr.sbin/jail

2020-08-25 Thread Jamie Gritton
Author: jamie
Date: Wed Aug 26 00:42:59 2020
New Revision: 364791
URL: https://svnweb.freebsd.org/changeset/base/364791

Log:
  Handle jail.conf variables that have the same names as parameters.
  
  PR:   248444
  Submitted by: Akos Somfai
  Reported by:  Markus Stoff

Modified:
  head/usr.sbin/jail/config.c

Modified: head/usr.sbin/jail/config.c
==
--- head/usr.sbin/jail/config.c Wed Aug 26 00:31:59 2020(r364790)
+++ head/usr.sbin/jail/config.c Wed Aug 26 00:42:59 2020(r364791)
@@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e
else
for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++)
if (!(intparams[ipnum].flags & PF_CONV) &&
-   equalopts(name, intparams[ipnum].name)) {
+   equalopts(name, intparams[ipnum].name) &&
+   !(p->flags & PF_VAR)) {
j->intparams[ipnum] = np;
np->flags |= intparams[ipnum].flags;
break;
___
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: r364790 - head/bin/date

2020-08-25 Thread Ed Maste
Author: emaste
Date: Wed Aug 26 00:31:59 2020
New Revision: 364790
URL: https://svnweb.freebsd.org/changeset/base/364790

Log:
  date.1: note possibly surprising behaviour of -j -f
  
  PR:   248918
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/date/date.1

Modified: head/bin/date/date.1
==
--- head/bin/date/date.1Wed Aug 26 00:28:28 2020(r364789)
+++ head/bin/date/date.1Wed Aug 26 00:31:59 2020(r364790)
@@ -32,7 +32,7 @@
 .\" @(#)date.1 8.3 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd April 23, 2019
+.Dd August 25, 2020
 .Dt DATE 1
 .Os
 .Sh NAME
@@ -142,6 +142,9 @@ This allows you to use the
 flag in addition to the
 .Cm +
 option to convert one date format to another.
+Note that any date or time components unspecified by the
+.Fl f
+format string take their values from the current time.
 .It Fl n
 Obsolete flag, accepted and ignored for compatibility.
 .It Fl R
___
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: r364789 - in stable/12/sys: amd64/acpica arm64/acpica i386/acpica

2020-08-25 Thread Alexander Motin
Author: mav
Date: Wed Aug 26 00:28:28 2020
New Revision: 364789
URL: https://svnweb.freebsd.org/changeset/base/364789

Log:
  MFC r364399: Remove some noisy ACPI tables messages from verbose dmesg.
  
  Those messages were printed hundreds of times during boot, often multiple
  times for each table.  We already print information about the tables in
  more organized form once to not duplicate it when random ACPI drivers are
  attaching.

Modified:
  stable/12/sys/amd64/acpica/acpi_machdep.c
  stable/12/sys/arm64/acpica/acpi_machdep.c
  stable/12/sys/i386/acpica/acpi_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/acpica/acpi_machdep.c
==
--- stable/12/sys/amd64/acpica/acpi_machdep.c   Tue Aug 25 23:35:55 2020
(r364788)
+++ stable/12/sys/amd64/acpica/acpi_machdep.c   Wed Aug 26 00:28:28 2020
(r364789)
@@ -132,9 +132,6 @@ probe_table(vm_paddr_t address, const char *sig)
 
table = pmap_mapbios(address, sizeof(ACPI_TABLE_HEADER));
ret = strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) == 0;
-   if (bootverbose)
-   printf("Table '%.4s' at 0x%jx\n", table->Signature,
-   (uintmax_t)address);
pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER));
return (ret);
 }
@@ -239,13 +236,8 @@ acpi_find_table(const char *sig)
acpi_unmap_table(rsdt);
}
pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP));
-   if (addr == 0) {
-   if (bootverbose)
-   printf("ACPI: No %s table found\n", sig);
+   if (addr == 0)
return (0);
-   }
-   if (bootverbose)
-   printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr);
 
/*
 * Verify that we can map the full table and that its checksum is

Modified: stable/12/sys/arm64/acpica/acpi_machdep.c
==
--- stable/12/sys/arm64/acpica/acpi_machdep.c   Tue Aug 25 23:35:55 2020
(r364788)
+++ stable/12/sys/arm64/acpica/acpi_machdep.c   Wed Aug 26 00:28:28 2020
(r364789)
@@ -103,9 +103,6 @@ probe_table(vm_paddr_t address, const char *sig)
(uintmax_t)address);
return (0);
}
-   if (bootverbose)
-   printf("Table '%.4s' at 0x%jx\n", table->Signature,
-   (uintmax_t)address);
 
if (strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) != 0) {
pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER));
@@ -198,13 +195,8 @@ acpi_find_table(const char *sig)
}
pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP));
 
-   if (addr == 0) {
-   if (bootverbose)
-   printf("ACPI: No %s table found\n", sig);
+   if (addr == 0)
return (0);
-   }
-   if (bootverbose)
-   printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr);
 
/*
 * Verify that we can map the full table and that its checksum is

Modified: stable/12/sys/i386/acpica/acpi_machdep.c
==
--- stable/12/sys/i386/acpica/acpi_machdep.cTue Aug 25 23:35:55 2020
(r364788)
+++ stable/12/sys/i386/acpica/acpi_machdep.cWed Aug 26 00:28:28 2020
(r364789)
@@ -149,9 +149,6 @@ probe_table(vm_paddr_t address, const char *sig)
int ret;
 
table = pmap_mapbios(address, sizeof(ACPI_TABLE_HEADER));
-   if (bootverbose)
-   printf("Table '%.4s' at 0x%jx\n", table->Signature,
-   (uintmax_t)address);
ret = strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) == 0;
pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER));
return (ret);
@@ -257,13 +254,8 @@ acpi_find_table(const char *sig)
acpi_unmap_table(rsdt);
}
pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP));
-   if (addr == 0) {
-   if (bootverbose)
-   printf("ACPI: No %s table found\n", sig);
+   if (addr == 0)
return (0);
-   }
-   if (bootverbose)
-   printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr);
 
/*
 * Verify that we can map the full table and that its checksum is
___
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: r364788 - head/sys/cddl/contrib/opensolaris/common/lz4

2020-08-25 Thread Matt Macy
Author: mmacy
Date: Tue Aug 25 23:35:55 2020
New Revision: 364788
URL: https://svnweb.freebsd.org/changeset/base/364788

Log:
  ZFS:  band-aid for -DNO_CLEAN
  
  Submitted by: Neal Chauhan
  Approved by:  imp@
  Differential Revision:https://reviews.freebsd.org/D26183

Modified:
  head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c

Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c
==
--- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c  Tue Aug 25 23:26:52 
2020(r364787)
+++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c  Tue Aug 25 23:35:55 
2020(r364788)
@@ -44,6 +44,7 @@
 #include 
 #include 
 
+#undef ASSERT
 #defineASSERT  assert
 #else
 #include 
@@ -52,9 +53,10 @@
 #include 
 #include 
 
+#undef ASSERT
 #defineASSERT  assert
 #endif
-#include 
+#include "lz4.h"
 
 static int real_LZ4_compress(const char *source, char *dest, int isize,
 int osize);
___
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: r364787 - head/stand/libsa/zfs

2020-08-25 Thread Matt Macy
Author: mmacy
Date: Tue Aug 25 23:26:52 2020
New Revision: 364787
URL: https://svnweb.freebsd.org/changeset/base/364787

Log:
  ZFS: whitelist zstd and encryption in the loader
  
  Please note that neither zstd nor encryption is
  supported by the loader at this instant. This
  change makes it safe to use those features in
  one's root pool, but not in one's root dataset.

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

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.c  Tue Aug 25 21:36:56 2020
(r364786)
+++ head/stand/libsa/zfs/zfsimpl.c  Tue Aug 25 23:26:52 2020
(r364787)
@@ -127,6 +127,8 @@ static const char *features_for_read[] = {
"com.delphix:device_removal",
"com.delphix:obsolete_counts",
"com.intel:allocation_classes",
+   "org.freebsd:zstd_compress",
+   "com.datto:encryption",
NULL
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364786 - head/sys/vm

2020-08-25 Thread Conrad Meyer
Author: cem
Date: Tue Aug 25 21:36:56 2020
New Revision: 364786
URL: https://svnweb.freebsd.org/changeset/base/364786

Log:
  vm_pageout: Scale worker threads with CPUs
  
  Autoscale vm_pageout worker threads from r364129 with CPU count.  The
  default is arbitrarily chosen to be 16 CPUs per worker thread, but can
  be adjusted with the vm.pageout_cpus_per_thread tunable.
  
  There will never be less than 1 thread per populated NUMA domain, and
  the previous arbitrary upper limit (at most ncpus/2 threads per NUMA
  domain) is preserved.
  
  Care is taken to gracefully handle asymmetric NUMA nodes, such as empty
  node systems (e.g., AMD 2990WX) and systems with nodes of varying size
  (e.g., some larger >20 core Intel Haswell/Broadwell Xeon).
  
  Reviewed by:  kib, markj
  Sponsored by: Isilon
  Differential Revision:https://reviews.freebsd.org/D26152

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cTue Aug 25 21:07:27 2020(r364785)
+++ head/sys/vm/vm_pageout.cTue Aug 25 21:36:56 2020(r364786)
@@ -165,11 +165,10 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update_period,
CTLFLAG_RWTUN, _pageout_update_period, 0,
"Maximum active LRU update period");
 
-/* Access with get_pageout_threads_per_domain(). */
-static int pageout_threads_per_domain = 1;
-SYSCTL_INT(_vm, OID_AUTO, pageout_threads_per_domain, CTLFLAG_RDTUN,
-_threads_per_domain, 0,
-"Number of worker threads comprising each per-domain pagedaemon");
+static int pageout_cpus_per_thread = 16;
+SYSCTL_INT(_vm, OID_AUTO, pageout_cpus_per_thread, CTLFLAG_RDTUN,
+_cpus_per_thread, 0,
+"Number of CPUs per pagedaemon worker thread");
   
 SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RWTUN, _period, 0,
"Low memory callback period");
@@ -2200,38 +2199,38 @@ vm_pageout_helper(void *arg)
 }
 
 static int
-get_pageout_threads_per_domain(void)
+get_pageout_threads_per_domain(const struct vm_domain *vmd)
 {
-   static bool resolved = false;
-   int half_cpus_per_dom;
+   unsigned total_pageout_threads, eligible_cpus, domain_cpus;
 
-   /*
-* This is serialized externally by the sorted autoconfig portion of
-* boot.
-*/
-   if (__predict_true(resolved))
-   return (pageout_threads_per_domain);
+   if (VM_DOMAIN_EMPTY(vmd->vmd_domain))
+   return (0);
 
/*
 * Semi-arbitrarily constrain pagedaemon threads to less than half the
-* total number of threads in the system as an insane upper limit.
+* total number of CPUs in the system as an upper limit.
 */
-   half_cpus_per_dom = howmany(mp_ncpus / vm_ndomains, 2);
+   if (pageout_cpus_per_thread < 2)
+   pageout_cpus_per_thread = 2;
+   else if (pageout_cpus_per_thread > mp_ncpus)
+   pageout_cpus_per_thread = mp_ncpus;
 
-   if (pageout_threads_per_domain < 1) {
-   printf("Invalid tuneable vm.pageout_threads_per_domain value: "
-   "%d out of valid range: [1-%d]; clamping to 1\n",
-   pageout_threads_per_domain, half_cpus_per_dom);
-   pageout_threads_per_domain = 1;
-   } else if (pageout_threads_per_domain > half_cpus_per_dom) {
-   printf("Invalid tuneable vm.pageout_threads_per_domain value: "
-   "%d out of valid range: [1-%d]; clamping to %d\n",
-   pageout_threads_per_domain, half_cpus_per_dom,
-   half_cpus_per_dom);
-   pageout_threads_per_domain = half_cpus_per_dom;
-   }
-   resolved = true;
-   return (pageout_threads_per_domain);
+   total_pageout_threads = howmany(mp_ncpus, pageout_cpus_per_thread);
+   domain_cpus = CPU_COUNT(_domain[vmd->vmd_domain]);
+
+   /* Pagedaemons are not run in empty domains. */
+   eligible_cpus = mp_ncpus;
+   for (unsigned i = 0; i < vm_ndomains; i++)
+   if (VM_DOMAIN_EMPTY(i))
+   eligible_cpus -= CPU_COUNT(_domain[i]);
+
+   /*
+* Assign a portion of the total pageout threads to this domain
+* corresponding to the fraction of pagedaemon-eligible CPUs in the
+* domain.  In asymmetric NUMA systems, domains with more CPUs may be
+* allocated more threads than domains with fewer CPUs.
+*/
+   return (howmany(total_pageout_threads * domain_cpus, eligible_cpus));
 }
 
 /*
@@ -2288,7 +2287,7 @@ vm_pageout_init_domain(int domain)
"pidctrl", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
pidctrl_init_sysctl(>vmd_pid, SYSCTL_CHILDREN(oid));
 
-   vmd->vmd_inactive_threads = get_pageout_threads_per_domain();
+   vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd);
 }
 
 static void
@@ -2343,7 +2342,6 @@ vm_pageout(void)
 
p = curproc;
td = 

svn commit: r364785 - head/usr.sbin/bsdinstall/scripts

2020-08-25 Thread Ryan Moeller
Author: freqlabs
Date: Tue Aug 25 21:07:27 2020
New Revision: 364785
URL: https://svnweb.freebsd.org/changeset/base/364785

Log:
  bsdinstall: Update loader.conf for new OpenZFS deps
  
  zfs.ko now includes the SPL but relies on cryptodev instead.
  
  Reported by:  D Scott Phillips
  Sponsored by: iXsystems, Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/config

Modified: head/usr.sbin/bsdinstall/scripts/config
==
--- head/usr.sbin/bsdinstall/scripts/config Tue Aug 25 20:07:11 2020
(r364784)
+++ head/usr.sbin/bsdinstall/scripts/config Tue Aug 25 21:07:27 2020
(r364785)
@@ -44,9 +44,9 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc
 
 cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf
 rm $BSDINSTALL_TMPBOOT/loader.conf.*
-# The 'opensolaris_load' line is a workaround for arm64, which does not
-# automatically load opensolaris.ko with zfs.ko.
-df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> 
$BSDINSTALL_TMPBOOT/loader.conf
+# The 'cryptodev_load' line is a workaround for arm64, which does not
+# automatically load cryptodev.ko with zfs.ko.
+df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "cryptodev_load=\"YES\"" >> 
$BSDINSTALL_TMPBOOT/loader.conf
 df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> 
$BSDINSTALL_TMPBOOT/loader.conf
 
 cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364781 - in head/sys: conf modules/zfs

2020-08-25 Thread Brooks Davis
On Tue, Aug 25, 2020 at 07:04:54PM +, Brandon Bergren wrote:
> Author: bdragon
> Date: Tue Aug 25 19:04:54 2020
> New Revision: 364781
> URL: https://svnweb.freebsd.org/changeset/base/364781
> 
> Log:
>   [PowerPC] More preemptive powerpcspe ZFS build fixes
>   
>   I went through the merge and found the rest of the instances where
>   ${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and adjusted
>   the rest of the instances to also check for powerpcspe.
>   
>   mips32* will probably want to do the same.
>   
>   Sponsored by:   Tag1 Consulting, Inc.
> 
> Modified:
>   head/sys/conf/kern.pre.mk
>   head/sys/modules/zfs/Makefile
> 
> Modified: head/sys/conf/kern.pre.mk
> ==
> --- head/sys/conf/kern.pre.mk Tue Aug 25 18:54:10 2020(r364780)
> +++ head/sys/conf/kern.pre.mk Tue Aug 25 19:04:54 2020(r364781)
> @@ -257,7 +257,7 @@ ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_
>  .endif
>  
>  .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
> - ${MACHINE_ARCH} == "arm"
> + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
>  ZFS_CFLAGS+= -DBITS_PER_LONG=32
>  .else
>  ZFS_CFLAGS+= -DBITS_PER_LONG=64

In CheriBSD we've added a MACHINE_ABI variable that could be used to
simplify this mess of checks.

https://github.com/CTSRD-CHERI/cheribsd/blob/5ee735e5f8ef7268731359a2d8a9a8218df2d23f/share/mk/bsd.cpu.mk#L478

As currently implemented you'd use:

.if ${MACHINE_ABI:Mptr64}

There's be a argument for adding long32 and long64 for to avoid
conflating long and pointer size.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r364782 - head/lib/libcompiler_rt

2020-08-25 Thread Dimitry Andric
On 25 Aug 2020, at 21:57, Dimitry Andric  wrote:
> 
> Author: dim
> Date: Tue Aug 25 19:57:11 2020
> New Revision: 364782
> URL: https://svnweb.freebsd.org/changeset/base/364782
> 
> Log:
>  After r364753, there should be no need to suppress -Watomic-alignment
>  warnings anymore for compiler-rt's atomic.c. This occurred because the
>  IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
>  caused the compiler to emit a runtime call to __atomic_is_lock_free(),
>  and that triggers the warning.
> 
>  MFC after:   2 weeks
>  X-MFC-With:  r364753

Forgot to mention, Noticed by: arichardson. :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r364784 - head/lib/libgcc_eh

2020-08-25 Thread Dimitry Andric
Author: dim
Date: Tue Aug 25 20:07:11 2020
New Revision: 364784
URL: https://svnweb.freebsd.org/changeset/base/364784

Log:
  After r364423, which ensures the callbacks that dl_iterate_phdr(3)
  performs are protected by an exclusive lock, even for statically linked
  programs, it is safe to re-enable libunwind's FrameHeaderCache, which I
  temporarily disabled in r364263.
  
  Meanwhile upstream has also used the _LIBUNWIND_USE_FRAME_HEADER_CACHE
  for this purpose, so the only thing needed is to add this as a
  compile-time command line flag.
  
  While here, reformat the CFLAGS lines a little bit.
  
  MFC after:6 weeks
  X-MFC-With:   r364284, r364423

Modified:
  head/lib/libgcc_eh/Makefile.inc

Modified: head/lib/libgcc_eh/Makefile.inc
==
--- head/lib/libgcc_eh/Makefile.inc Tue Aug 25 20:04:35 2020
(r364783)
+++ head/lib/libgcc_eh/Makefile.inc Tue Aug 25 20:07:11 2020
(r364784)
@@ -25,7 +25,10 @@ CFLAGS.${file}+= -fno-exceptions -funwind-tables
 CXXFLAGS.${file}+= -fno-exceptions -funwind-tables
 .endfor
 
-CFLAGS+=   -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY
+CFLAGS+=   -I${UNWINDINCDIR}
+CFLAGS+=   -I${.CURDIR}
+CFLAGS+=   -D_LIBUNWIND_IS_NATIVE_ONLY
+CFLAGS+=   -D_LIBUNWIND_USE_FRAME_HEADER_CACHE
 CXXFLAGS+= -fno-rtti
 CXXSTD?=   c++11
 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
___
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: r364783 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear

2020-08-25 Thread Ryan Moeller
Author: freqlabs
Date: Tue Aug 25 20:04:35 2020
New Revision: 364783
URL: https://svnweb.freebsd.org/changeset/base/364783

Log:
  Skip zpool_clear_005_pos test until bug fixed
  
  Messing with gnop devices under a zpool fails in this test, causing
  the pool to be suspended and eventually the system to deadlock.
  
  Skip the test for now until the issue is resolved.
  
  PR:   tests/248910
  Discussed with:   lwhsu
  Sponsored by: iXsystems, Inc.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh  
Tue Aug 25 19:57:11 2020(r364782)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh  
Tue Aug 25 20:04:35 2020(r364783)
@@ -124,6 +124,7 @@ zpool_clear_005_pos_head()
 }
 zpool_clear_005_pos_body()
 {
+   atf_skip "Fails on OpenZFS, causing eventual deadlock. PR tests/248910"
. $(atf_get_srcdir)/../../../include/default.cfg
. $(atf_get_srcdir)/zpool_clear.cfg
 
___
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: r364782 - head/lib/libcompiler_rt

2020-08-25 Thread Dimitry Andric
Author: dim
Date: Tue Aug 25 19:57:11 2020
New Revision: 364782
URL: https://svnweb.freebsd.org/changeset/base/364782

Log:
  After r364753, there should be no need to suppress -Watomic-alignment
  warnings anymore for compiler-rt's atomic.c. This occurred because the
  IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
  caused the compiler to emit a runtime call to __atomic_is_lock_free(),
  and that triggers the warning.
  
  MFC after:2 weeks
  X-MFC-With:   r364753

Modified:
  head/lib/libcompiler_rt/Makefile.inc

Modified: head/lib/libcompiler_rt/Makefile.inc
==
--- head/lib/libcompiler_rt/Makefile.incTue Aug 25 19:04:54 2020
(r364781)
+++ head/lib/libcompiler_rt/Makefile.incTue Aug 25 19:57:11 2020
(r364782)
@@ -1,7 +1,5 @@
 # $FreeBSD$
 
-.include 
-
 CRTARCH=   ${MACHINE_CPUARCH:C/amd64/x86_64/}
 
 CRTSRC=${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins
@@ -124,10 +122,6 @@ SRCF+= udivti3
 SRCF+= umoddi3
 SRCF+= umodsi3
 SRCF+= umodti3
-
-.if "${COMPILER_TYPE}" == "clang"
-CFLAGS.atomic.c+=  -Wno-atomic-alignment
-.endif
 
 # Avoid using SSE2 instructions on i386, if unsupported.
 .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
___
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: r364781 - in head/sys: conf modules/zfs

2020-08-25 Thread Brandon Bergren
Author: bdragon
Date: Tue Aug 25 19:04:54 2020
New Revision: 364781
URL: https://svnweb.freebsd.org/changeset/base/364781

Log:
  [PowerPC] More preemptive powerpcspe ZFS build fixes
  
  I went through the merge and found the rest of the instances where
  ${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and adjusted
  the rest of the instances to also check for powerpcspe.
  
  mips32* will probably want to do the same.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/modules/zfs/Makefile

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Tue Aug 25 18:54:10 2020(r364780)
+++ head/sys/conf/kern.pre.mk   Tue Aug 25 19:04:54 2020(r364781)
@@ -257,7 +257,7 @@ ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_
 .endif
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
-   ${MACHINE_ARCH} == "arm"
+   ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
 ZFS_CFLAGS+= -DBITS_PER_LONG=32
 .else
 ZFS_CFLAGS+= -DBITS_PER_LONG=64

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Tue Aug 25 18:54:10 2020
(r364780)
+++ head/sys/modules/zfs/Makefile   Tue Aug 25 19:04:54 2020
(r364781)
@@ -47,7 +47,7 @@ CFLAGS+=   -fprofile-arcs -ftest-coverage
 DEBUG_FLAGS=-g
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
-   ${MACHINE_ARCH} == "arm"
+   ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
 CFLAGS+= -DBITS_PER_LONG=32
 .else
 CFLAGS+= -DBITS_PER_LONG=64
@@ -117,7 +117,7 @@ SRCS+=  acl_common.c \
 
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
-   ${MACHINE_ARCH} == "arm"
+   ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
 SRCS+= spl_atomic.c
 .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: r364780 - head/cddl/lib/libzpool

2020-08-25 Thread Brandon Bergren
Author: bdragon
Date: Tue Aug 25 18:54:10 2020
New Revision: 364780
URL: https://svnweb.freebsd.org/changeset/base/364780

Log:
  [PowerPC] Apply the ppc32 GOT overflow fix to powerpcspe
  
  powerpcspe is also a 32 bit ppc platform, and also needs to be -fPIC to
  avoid overflowing the GOT.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/cddl/lib/libzpool/Makefile

Modified: head/cddl/lib/libzpool/Makefile
==
--- head/cddl/lib/libzpool/Makefile Tue Aug 25 18:32:43 2020
(r364779)
+++ head/cddl/lib/libzpool/Makefile Tue Aug 25 18:54:10 2020
(r364780)
@@ -21,7 +21,7 @@ ACFLAGS+= -Wa,--noexecstack
 ATOMIC_SRCS=   opensolaris_atomic.c
 .endif
 
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe"
 # Don't waste GOT entries on small data.
 PICFLAG=   -fPIC
 .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: r364779 - in head: share/man/man4 sys/dev/sdhci

2020-08-25 Thread Mark Johnston
Author: markj
Date: Tue Aug 25 18:32:43 2020
New Revision: 364779
URL: https://svnweb.freebsd.org/changeset/base/364779

Log:
  sdhci(4): Recognize the Texas Instruments PCIxx12 card reader.
  
  PR:   248650
  Submitted by: Lars Herschke 
  MFC after:1 week

Modified:
  head/share/man/man4/sdhci.4
  head/sys/dev/sdhci/sdhci_pci.c

Modified: head/share/man/man4/sdhci.4
==
--- head/share/man/man4/sdhci.4 Tue Aug 25 18:30:12 2020(r364778)
+++ head/share/man/man4/sdhci.4 Tue Aug 25 18:32:43 2020(r364779)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 9, 2012
+.Dd August 25, 2020
 .Dt SDHCI 4
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@ RICOH R5C822
 .It
 RICOH R5CE823
 .It
-TI PCIXX21/XX11
+TI PCIXX21/XX11/XX12
 .El
 .Sh SEE ALSO
 .Xr mmc 4 ,

Modified: head/sys/dev/sdhci/sdhci_pci.c
==
--- head/sys/dev/sdhci/sdhci_pci.c  Tue Aug 25 18:30:12 2020
(r364778)
+++ head/sys/dev/sdhci/sdhci_pci.c  Tue Aug 25 18:32:43 2020
(r364779)
@@ -90,6 +90,9 @@ static const struct sdhci_device {
SDHCI_QUIRK_LOWER_FREQUENCY },
{ 0x8034104c,   0x, "TI XX21/XX11 SD",
SDHCI_QUIRK_FORCE_DMA },
+   { 0x803c104c,   0x, "TI XX12 SD",
+   SDHCI_QUIRK_FORCE_DMA |
+   SDHCI_QUIRK_WAITFOR_RESET_ASSERTED },
{ 0x05501524,   0x, "ENE CB712 SD",
SDHCI_QUIRK_BROKEN_TIMINGS },
{ 0x05511524,   0x, "ENE CB712 SD 2",
___
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: r364777 - head/sys/modules/zfs

2020-08-25 Thread Ryan Moeller
Author: freqlabs
Date: Tue Aug 25 18:22:30 2020
New Revision: 364777
URL: https://svnweb.freebsd.org/changeset/base/364777

Log:
  Fix zstd in OpenZFS module with CPUTYPE?=
  
  The build breaks when something adds -march= to the
  compiler flags, for example CPUTYPE?=native.  When the arch supports BMI,
  __BMI__ is defined and zstd.c tries to include immintrin.h, which is not
  present when building the kernel.
  
  Disable experimental BMI intrinsics in zstd in the OpenZFS kernel module
  by explicitly undefining __BMI__ for zstd.c.
  
  A similar fix was needed for the original zstd import, done in r327738.
  
  Reported by:  Jakob Alvermark
  Discussed with:   mmacy
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/modules/zfs/Makefile

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Tue Aug 25 18:21:13 2020
(r364776)
+++ head/sys/modules/zfs/Makefile   Tue Aug 25 18:22:30 2020
(r364777)
@@ -338,7 +338,7 @@ CFLAGS.zil.c= -Wno-cast-qual
 CFLAGS.zio.c= -Wno-cast-qual
 CFLAGS.zrlock.c= -Wno-cast-qual
 CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith
-CFLAGS.zstd.c= -fno-tree-vectorize
+CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize
 .if ${MACHINE_CPUARCH} == "aarch64"
 CFLAGS.zstd.c+= -include ${SRCDIR}/zstd/include/aarch64_compat.h
 .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: r364776 - in stable/12/sys/dev/cxgbe: common cudbg

2020-08-25 Thread Navdeep Parhar
Author: np
Date: Tue Aug 25 18:21:13 2020
New Revision: 364776
URL: https://svnweb.freebsd.org/changeset/base/364776

Log:
  MFC r363498:
  cxgbe(4): Some updates to the common code.

Modified:
  stable/12/sys/dev/cxgbe/common/common.h
  stable/12/sys/dev/cxgbe/common/t4_hw.c
  stable/12/sys/dev/cxgbe/common/t4_hw.h
  stable/12/sys/dev/cxgbe/cudbg/cudbg_lib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/common/common.h
==
--- stable/12/sys/dev/cxgbe/common/common.h Tue Aug 25 18:16:40 2020
(r364775)
+++ stable/12/sys/dev/cxgbe/common/common.h Tue Aug 25 18:21:13 2020
(r364776)
@@ -301,6 +301,7 @@ struct chip_params {
u16 vfcount;
u32 sge_fl_db;
u16 mps_tcam_size;
+   u16 rss_nentries;
 };
 
 /* VF-only parameters. */
@@ -379,6 +380,7 @@ struct adapter_params {
unsigned int hash_filter:1;
unsigned int filter2_wr_support:1;
unsigned int port_caps32:1;
+   unsigned int smac_add_support:1;
 
unsigned int ofldq_wr_cred;
unsigned int eo_wr_cred;
@@ -784,8 +786,27 @@ int t4_set_rxmode(struct adapter *adap, unsigned int m
 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, unsigned int 
viid,
  bool free, unsigned int naddr, const u8 **addr, u16 *idx,
  u64 *hash, bool sleep_ok);
+int t4_free_mac_filt(struct adapter *adap, unsigned int mbox,
+ unsigned int viid, unsigned int naddr,
+ const u8 **addr, bool sleep_ok);
+int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
+  int idx, bool sleep_ok);
+int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid,
+const u8 *addr, const u8 *mask, unsigned int idx,
+u8 lookup_type, u8 port_id, bool sleep_ok);
+int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid,
+ const u8 *addr, const u8 *mask, unsigned int idx,
+ u8 lookup_type, u8 port_id, bool sleep_ok);
+int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
+   const u8 *addr, const u8 *mask, unsigned int vni,
+   unsigned int vni_mask, u8 dip_hit, u8 lookup_type,
+   bool sleep_ok);
 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
  int idx, const u8 *addr, bool persist, uint16_t *smt_idx);
+int t4_del_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
+  const u8 *addr, bool smac);
+int t4_add_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
+  int idx, const u8 *addr, bool persist, u8 *smt_idx, bool smac);
 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int 
viid,
 bool ucast, u64 vec, bool sleep_ok);
 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
@@ -798,6 +819,10 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox
   unsigned int mmd, unsigned int reg, unsigned int *valp);
 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
   unsigned int mmd, unsigned int reg, unsigned int val);
+int t4_i2c_io(struct adapter *adap, unsigned int mbox,
+ int port, unsigned int devid,
+ unsigned int offset, unsigned int len,
+ u8 *buf, bool write);
 int t4_i2c_rd(struct adapter *adap, unsigned int mbox,
  int port, unsigned int devid,
  unsigned int offset, unsigned int len,
@@ -822,7 +847,7 @@ int t4_sge_ctxt_rd(struct adapter *adap, unsigned int 
   enum ctxt_type ctype, u32 *data);
 int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type 
ctype,
  u32 *data);
-int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox);
+int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type);
 const char *t4_link_down_rc_str(unsigned char link_down_rc);
 int t4_update_port_info(struct port_info *pi);
 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
@@ -855,6 +880,10 @@ void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff
   u32 start_index, bool sleep_ok);
 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs,
u32 start_index, bool sleep_ok);
+int t4_configure_ringbb(struct adapter *adap);
+int t4_configure_add_smac(struct adapter *adap);
+int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf,
+   u16 vlan);
 
 static inline int t4vf_query_params(struct adapter *adapter,
unsigned int nparams, const u32 *params,

Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c

svn commit: r364775 - head/lib/libbe

2020-08-25 Thread Kyle Evans
Author: kevans
Date: Tue Aug 25 18:16:40 2020
New Revision: 364775
URL: https://svnweb.freebsd.org/changeset/base/364775

Log:
  libbe: lift the WARNS post-OpenZFS merge
  
  sys/ccompile.h no longer uses #pragma ident, so we no longer need to worry
  about unknown pragmas.
  
  I fixed one WARNS issue in r363409 by annotating be_is_auto_snapshot_name's
  lbh parameter __unused, then upstreamed the following changes to OpenZFS
  that rode in with the merge:
  - zfs_path_to_zhandle now takes a const char *path rather than a char *path,
since it won't be mutating the string it receives and I had no reason to
believe it will need to in the future. [OpenZFS PR #10605]
  - Annotated some unused parameters on definitions inlined into headers as
such. [OpenZFS PR #10606]

Modified:
  head/lib/libbe/Makefile

Modified: head/lib/libbe/Makefile
==
--- head/lib/libbe/Makefile Tue Aug 25 18:11:45 2020(r364774)
+++ head/lib/libbe/Makefile Tue Aug 25 18:16:40 2020(r364775)
@@ -12,9 +12,6 @@ SRCS= be.c be_access.c be_error.c be_info.c
 INCS=  be.h
 MAN=   libbe.3
 
-WARNS?=2
-IGNORE_PRAGMA= yes
-
 LIBADD+= zfs
 LIBADD+= nvpair spl
 
___
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: r364774 - stable/12/sys/dev/cxgbe/cxgbei

2020-08-25 Thread Navdeep Parhar
Author: np
Date: Tue Aug 25 18:11:45 2020
New Revision: 364774
URL: https://svnweb.freebsd.org/changeset/base/364774

Log:
  MFC r36:
  cxgbei: destroy the worker threads' CV and mutex in stop_worker_threads.

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

Modified: stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c
==
--- stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Aug 25 17:23:33 2020
(r364773)
+++ stable/12/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Aug 25 18:11:45 2020
(r364774)
@@ -714,6 +714,8 @@ stop_worker_threads(void)
cv_wait(>cwt_cv, >cwt_lock);
} while (cwt->cwt_state != CWT_STOPPED);
mtx_unlock(>cwt_lock);
+   mtx_destroy(>cwt_lock);
+   cv_destroy(>cwt_cv);
}
free(cwt_softc, M_CXGBE);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364773 - head/stand/userboot/userboot

2020-08-25 Thread Matt Macy
Author: mmacy
Date: Tue Aug 25 17:23:33 2020
New Revision: 364773
URL: https://svnweb.freebsd.org/changeset/base/364773

Log:
  Fix userboot after r364355
  
  r364355 replaced init_zfs_bootenv with init_zfs_boot_options and
  neglected to update userboot in the process.

Modified:
  head/stand/userboot/userboot/main.c

Modified: head/stand/userboot/userboot/main.c
==
--- head/stand/userboot/userboot/main.c Tue Aug 25 17:19:15 2020
(r364772)
+++ head/stand/userboot/userboot/main.c Tue Aug 25 17:23:33 2020
(r364773)
@@ -232,7 +232,7 @@ extract_currdev(void)
bzero(, sizeof(zdev));
zdev.dd.d_dev = _dev;

-   init_zfs_bootenv(zfs_fmtdev());
+   init_zfs_boot_options(zfs_fmtdev());
dd = 
} else
 #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: r364772 - head

2020-08-25 Thread Matt Macy
Author: mmacy
Date: Tue Aug 25 17:19:15 2020
New Revision: 364772
URL: https://svnweb.freebsd.org/changeset/base/364772

Log:
  Give stronger guidance with regards to upgrading root pools

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Aug 25 16:09:23 2020(r364771)
+++ head/UPDATING   Tue Aug 25 17:19:15 2020(r364772)
@@ -27,9 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20200824:
-   OpenZFS support has been integrated. We caution against 'zpool upgrade'
-   for the next few weeks. The change should be transparent unless you 
-   want to use new features.
+   OpenZFS support has been integrated. Do not upgrade root pools until
+   the loader is updated to support zstd. Furthermore, we caution against
+   'zpool upgrade' for the next few weeks. The change should be transparent
+   unless you  want to use new features.
 
 
The resume code now notifies devd with the 'kernel' system
___
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: r364771 - head/usr.sbin/rtsold

2020-08-25 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Aug 25 16:09:23 2020
New Revision: 364771
URL: https://svnweb.freebsd.org/changeset/base/364771

Log:
  rtsol(d): add script for "M bit"
  
  While we do support the "O bit" running a script (usually to start a
  dhcpv6 client) we have no options for setups which set the "M bit" for,
  e.g., static address assignment as in EC2.
  
  Duplicate most of the "O bit" logic to also start a script for the
  "M bit" with the one difference: if the "M bit" is set we will not
  start the script for the "O bit" as well (per RFC 4861, Section 4.2).
  
  Reviewed by:  hrs, markj
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D26099

Modified:
  head/usr.sbin/rtsold/dump.c
  head/usr.sbin/rtsold/rtsol.c
  head/usr.sbin/rtsold/rtsold.8
  head/usr.sbin/rtsold/rtsold.c
  head/usr.sbin/rtsold/rtsold.h

Modified: head/usr.sbin/rtsold/dump.c
==
--- head/usr.sbin/rtsold/dump.c Tue Aug 25 15:19:45 2020(r364770)
+++ head/usr.sbin/rtsold/dump.c Tue Aug 25 16:09:23 2020(r364771)
@@ -84,6 +84,8 @@ rtsold_dump(FILE *fp)
}
fprintf(fp, "  interface status: %s\n",
ifi->active > 0 ? "active" : "inactive");
+   fprintf(fp, "  managed config: %s\n",
+   ifi->managedconfig ? "on" : "off");
fprintf(fp, "  other config: %s\n",
ifi->otherconfig ? "on" : "off");
fprintf(fp, "  rtsold status: %s\n", ifstatstr[ifi->state]);

Modified: head/usr.sbin/rtsold/rtsol.c
==
--- head/usr.sbin/rtsold/rtsol.cTue Aug 25 15:19:45 2020
(r364770)
+++ head/usr.sbin/rtsold/rtsol.cTue Aug 25 16:09:23 2020
(r364771)
@@ -79,6 +79,7 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, stru
 struct script_msg_head_t *, struct script_msg_head_t *);
 static char *make_rsid(const char *, const char *, struct rainfo *);
 
+#define_ARGS_MANAGED   managedconf_script, ifi->ifname
 #define_ARGS_OTHER otherconf_script, ifi->ifname
 #define_ARGS_RESADDresolvconf_script, "-a", rsid
 #define_ARGS_RESDELresolvconf_script, "-d", rsid
@@ -291,18 +292,36 @@ rtsol_input(int sock)
nd_ra = (struct nd_router_advert *)icp;
 
/*
+* Process the "M bit."
+* If the value of ManagedConfigFlag changes from FALSE to TRUE, the
+* host should invoke the stateful autoconfiguration protocol,
+* requesting information.
+* [RFC 4861 Section 4.2]
+* XXX ??? [draft-ietf-v6ops-dhcpv6-slaac-problem-07]
+*/
+   if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) &&
+   !ifi->managedconfig) {
+   warnmsg(LOG_DEBUG, __func__,
+   "ManagedConfigFlag on %s is turned on", ifi->ifname);
+   ifi->managedconfig = 1;
+   CALL_SCRIPT(MANAGED, NULL);
+   }
+
+   /*
 * Process the "O bit."
 * If the value of OtherConfigFlag changes from FALSE to TRUE, the
 * host should invoke the stateful autoconfiguration protocol,
-* requesting information.
-* [RFC 2462 Section 5.5.3]
+* requesting information unless the "M bit" was set as well in
+* which case the "O bit" is redundant.
+* [RFC 4861 Section 4.2]
 */
if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) &&
!ifi->otherconfig) {
warnmsg(LOG_DEBUG, __func__,
"OtherConfigFlag on %s is turned on", ifi->ifname);
ifi->otherconfig = 1;
-   CALL_SCRIPT(OTHER, NULL);
+   if (!ifi->managedconfig)
+   CALL_SCRIPT(OTHER, NULL);
}
clock_gettime(CLOCK_MONOTONIC_FAST, );
newent_rai = 0;

Modified: head/usr.sbin/rtsold/rtsold.8
==
--- head/usr.sbin/rtsold/rtsold.8   Tue Aug 25 15:19:45 2020
(r364770)
+++ head/usr.sbin/rtsold/rtsold.8   Tue Aug 25 16:09:23 2020
(r364771)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2011
+.Dd August 19, 2020
 .Dt RTSOLD 8
 .Os
 .\"
@@ -40,23 +40,27 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl dDfFmu1
+.Op Fl M Ar script-name
 .Op Fl O Ar script-name
 .Op Fl p Ar pidfile
 .Op Fl R Ar script-name
 .Ar interface ...
 .Nm
 .Op Fl dDfFmu1
+.Op Fl M Ar script-name
 .Op Fl O Ar script-name
 .Op Fl p Ar pidfile
 .Op Fl R Ar script-name
 .Fl a
 .Nm rtsol
 .Op Fl dDu
+.Op Fl M Ar script-name
 .Op Fl O Ar script-name
 .Op Fl R Ar script-name
 .Ar interface ...
 .Nm rtsol
 .Op Fl dDu
+.Op Fl M Ar script-name
 .Op Fl O Ar script-name
 .Op Fl R Ar script-name
 .Fl a
@@ -208,6 +212,20 @@ Transmit Router Solicitation packets until at least on
 Advertisement packet has arrived on each
 

svn commit: r364770 - head/sys/net

2020-08-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Aug 25 15:19:45 2020
New Revision: 364770
URL: https://svnweb.freebsd.org/changeset/base/364770

Log:
  iflib: netmap: publish all the receive buffer
  
  At initialization time, the netmap RX refill function used to
  prepare the NIC RX ring with N-1 buffers rather than N (with
  N equal to the number of descriptors in the NIC RX ring).
  This is not how netmap is supposed to work, as it would keep
  kring->nr_hwcur not in sync with the NIC "next index to refill"
  (i.e., fl->ifl_pidx). Instead we prepare N buffers, although we
  still publish (with isc_rxd_flush()) only the first N-1 buffers,
  to avoid the NIC producer pointer to overrun the NIC consumer
  pointer (for NICs where this is a real issue, e.g. Intel ones).
  
  MFC after:2 weeks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Aug 25 14:18:50 2020(r364769)
+++ head/sys/net/iflib.cTue Aug 25 15:19:45 2020(r364770)
@@ -832,7 +832,6 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring 
 {
struct netmap_adapter *na = kring->na;
u_int const lim = kring->nkr_num_slots - 1;
-   u_int head = kring->rhead;
u_int nm_i = kring->nr_hwcur;
struct netmap_ring *ring = kring->ring;
bus_dmamap_t *map;
@@ -840,39 +839,46 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring 
if_ctx_t ctx = rxq->ifr_ctx;
iflib_fl_t fl = >ifr_fl[0];
u_int nic_i_first, nic_i;
-   int i;
+   int i, n;
 #if IFLIB_DEBUG_COUNTERS
int rf_count = 0;
 #endif
 
/*
-* Netmap requires that we leave (at least) one free slot
-* in the ring, so that it can distinguish between an empty
-* ring (nr_hwcur == nr_hwtail, i.e. all the buffers owned by the
-* user) and a full ring (nr_hwtail == (nr_hwcur - 1) mod N, i.e.
-* all the buffers owned by the kernel).
-* We thus set head (the refill limit) to nr_hwcur - 1
-* at initialization. The rest of the code will then make sure
-* than nr_hwtail never overcomes nr_hwcur.
+* This function is used both at initialization and in rxsync.
+* At initialization we need to prepare (with isc_rxd_refill())
+* all the (N) netmap buffers in the ring, in such a way to keep
+* fl->ifl_pidx and kring->nr_hwcur in sync (except for
+* kring->nkr_hwofs); at rxsync time, both indexes point to the
+* next buffer to be refilled.
+* In any case we publish (with isc_rxd_flush()) up to
+* (fl->ifl_pidx - 1) % N (included), to avoid the NIC tail/prod
+* pointer to overrun the head/cons pointer, although this is
+* not necessary for some NICs (e.g. vmx).
 */
-   if (__predict_false(init)) {
-   head = nm_prev(nm_i, lim);
-   } else if (nm_i == head) {
-   /* Nothing to do. We can leave early. */
-   return (0);
+   if (__predict_false(init))
+   n = kring->nkr_num_slots;
+   else {
+   n = kring->rhead - nm_i;
+   if (n == 0)
+   return (0); /* Nothing to do. */
+   if (n < 0)
+   n += kring->nkr_num_slots;
}
 
+   /* Start to refill from nr_hwcur, publishing n buffers. */
iru_init(, rxq, 0 /* flid */);
map = fl->ifl_sds.ifsd_map;
-   nic_i = netmap_idx_k2n(kring, nm_i);
+   nic_i = fl->ifl_pidx;
+   MPASS(nic_i == netmap_idx_k2n(kring, nm_i));
DBG_COUNTER_INC(fl_refills);
-   while (nm_i != head) {
+   while (n > 0) {
 #if IFLIB_DEBUG_COUNTERS
if (++rf_count == 9)
DBG_COUNTER_INC(fl_refills_large);
 #endif
nic_i_first = nic_i;
-   for (i = 0; i < IFLIB_MAX_RX_REFRESH && nm_i != head; i++) {
+   for (i = 0; n > 0 && i < IFLIB_MAX_RX_REFRESH; n--, i++) {
struct netmap_slot *slot = >slot[nm_i];
void *addr = PNMB(na, slot, >ifl_bus_addrs[i]);
 
@@ -903,11 +909,11 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring 
iru.iru_count = i;
ctx->isc_rxd_refill(ctx->ifc_softc, );
}
-   kring->nr_hwcur = head;
+   fl->ifl_pidx = nic_i;
+   MPASS(!init || nm_i == 0);
+   MPASS(nm_i == kring->rhead);
+   kring->nr_hwcur = nm_i;
 
-   /* The pidx argument of isc_rxd_flush() is the index of the last valid
-* slot in the free list ring. We need therefore to decrement nic_i,
-* similarly to what happens in iflib_fl_refill() for ifl_pidx. */
bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id,

Re: svn commit: r364449 - head/bin/ls

2020-08-25 Thread Hiroki Sato
Gordon Bergling  wrote
  in <20200824085223.ga28...@lion.0xfce3.net>:

gb> thanks for your feedback. I can only define POSIX.1-200{1,8} or -susv4. So 
what
gb> do you think about the following STANDARDS section?
gb> 
gb> For the options that are non-existing I could correct them to -2001 and 
mention
gb> also -susv4.
gb> 
gb> STANDARDS
gb>  With the exception of options -g, -n and -o, the ls utility conforms to
gb>  IEEE Std 1003.1-2001 (“POSIX.1”) and Version 4 of the Single UNIX
gb>  Specification (“SUSv4”).  The options -B, -D, -G, -I, -T, -U, -W, -Z, 
-b,
gb>  -h, -w, -y and -, are compatible extensions not defined in IEEE Std
gb>  1003.1-2001 (“POSIX.1”).

 It might be a bit tedious, but just adding -2008 looks good to me
 like the following:

 |.St -p1003.1-2001
 |and
 |.St -p1003.1-2008 .

 p1003.1-2004 is a subset of SUSv3 (and -2008 is one of SUSv4), so
 using p1003.1- consistently sounds less confusing when describing
 the conformance within the subsets.

 Regarding the non-standard extensions, I am not sure what
 "compatible" means.  Some of them are extensions commonly seen on
 other BSD-derived OSes, some are available only on FreeBSD, and some
 have the same names with GNU's counterpart but different meanings.
 Is just mentioning "...are non-standard extensions" with no
 specification name sufficient and easier?  I have no strong opinion
 on that part, but this is just my two cents.

-- Hiroki


pgpiGvHKetuv1.pgp
Description: PGP signature


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

2020-08-25 Thread Mateusz Guzik
Author: mjg
Date: Tue Aug 25 14:18:50 2020
New Revision: 364769
URL: https://svnweb.freebsd.org/changeset/base/364769

Log:
  vfs: respect PRIV_VFS_LOOKUP in vaccess_smr
  
  Reported by:  novel

Modified:
  head/sys/kern/kern_jail.c
  head/sys/kern/kern_priv.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/priv.h

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Tue Aug 25 13:45:06 2020(r364768)
+++ head/sys/kern/kern_jail.c   Tue Aug 25 14:18:50 2020(r364769)
@@ -3049,6 +3049,7 @@ prison_priv_check(struct ucred *cred, int priv)
 * called for them. See priv_check_cred().
 */
switch (priv) {
+   case PRIV_VFS_LOOKUP:
case PRIV_VFS_GENERATION:
KASSERT(0, ("prison_priv_check instead of a custom handler "
"called for %d\n", priv));
@@ -3277,7 +3278,6 @@ prison_priv_check(struct ucred *cred, int priv)
case PRIV_VFS_WRITE:
case PRIV_VFS_ADMIN:
case PRIV_VFS_EXEC:
-   case PRIV_VFS_LOOKUP:
case PRIV_VFS_BLOCKRESERVE: /* XXXRW: Slightly surprising. */
case PRIV_VFS_CHFLAGS_DEV:
case PRIV_VFS_CHOWN:

Modified: head/sys/kern/kern_priv.c
==
--- head/sys/kern/kern_priv.c   Tue Aug 25 13:45:06 2020(r364768)
+++ head/sys/kern/kern_priv.c   Tue Aug 25 14:18:50 2020(r364769)
@@ -129,6 +129,8 @@ priv_check_cred(struct ucred *cred, int priv)
priv));
 
switch (priv) {
+   case PRIV_VFS_LOOKUP:
+   return (priv_check_cred_vfs_lookup(cred));
case PRIV_VFS_GENERATION:
return (priv_check_cred_vfs_generation(cred));
}
@@ -245,6 +247,56 @@ priv_check(struct thread *td, int priv)
KASSERT(td == curthread, ("priv_check: td != curthread"));
 
return (priv_check_cred(td->td_ucred, priv));
+}
+
+static int __noinline
+priv_check_cred_vfs_lookup_slow(struct ucred *cred)
+{
+   int error;
+
+   error = priv_check_cred_pre(cred, PRIV_VFS_LOOKUP);
+   if (error)
+   goto out;
+
+   if (cred->cr_uid == 0 && suser_enabled) {
+   error = 0;
+   goto out;
+   }
+
+   return (priv_check_cred_post(cred, PRIV_VFS_LOOKUP, error, false));
+out:
+   return (priv_check_cred_post(cred, PRIV_VFS_LOOKUP, error, true));
+
+}
+
+int
+priv_check_cred_vfs_lookup(struct ucred *cred)
+{
+   int error;
+
+   if (__predict_false(mac_priv_check_fp_flag ||
+   mac_priv_grant_fp_flag || SDT_PROBES_ENABLED()))
+   return (priv_check_cred_vfs_lookup_slow(cred));
+
+   error = EPERM;
+   if (cred->cr_uid == 0 && suser_enabled)
+   error = 0;
+   return (error);
+}
+
+int
+priv_check_cred_vfs_lookup_nomac(struct ucred *cred)
+{
+   int error;
+
+   if (__predict_false(mac_priv_check_fp_flag ||
+   mac_priv_grant_fp_flag || SDT_PROBES_ENABLED()))
+   return (EAGAIN);
+
+   error = EPERM;
+   if (cred->cr_uid == 0 && suser_enabled)
+   error = 0;
+   return (error);
 }
 
 static int __noinline

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cTue Aug 25 13:45:06 2020(r364768)
+++ head/sys/kern/vfs_subr.cTue Aug 25 14:18:50 2020(r364769)
@@ -5045,6 +5045,7 @@ vn_isdisk(struct vnode *vp)
 int
 vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct 
ucred *cred)
 {
+   int error;
 
VFS_SMR_ASSERT_ENTERED();
 
@@ -5067,7 +5068,9 @@ vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gi
return (0);
 out_error:
/*
-* Permission check failed.
+* Permission check failed, but it is possible denial will get 
overwritten
+* (e.g., when root is traversing through a 700 directory owned by 
someone
+* else).
 *
 * vaccess() calls priv_check_cred which in turn can descent into MAC
 * modules overriding this result. It's quite unclear what semantics
@@ -5075,9 +5078,20 @@ out_error:
 * from within the SMR section. This also means if any such modules
 * are present, we have to let the regular lookup decide.
 */
-   if (__predict_false(mac_priv_check_fp_flag || mac_priv_grant_fp_flag))
+   error = priv_check_cred_vfs_lookup_nomac(cred);
+   switch (error) {
+   case 0:
+   return (0);
+   case EAGAIN:
+   /*
+* MAC modules present.
+*/
return (EAGAIN);
-   return (EACCES);
+   case EPERM:
+   return (EACCES);
+   default:
+   return (error);
+   }
 }
 
 /*

Modified: head/sys/sys/priv.h

svn commit: r364768 - head/sys/vm

2020-08-25 Thread Mark Johnston
Author: markj
Date: Tue Aug 25 13:45:06 2020
New Revision: 364768
URL: https://svnweb.freebsd.org/changeset/base/364768

Log:
  Permit vm_page_wire() to be called on pages not belonging to an object.
  
  For such pages ref_count is effectively a consumer-managed field, but
  there is no harm in calling vm_page_wire() on them.
  vm_page_unwire_noq() handles them as well.  Relax the vm_page_wire()
  assertions to permit this case which is triggered by some out-of-tree
  code. [1]
  
  Also guard a conditional assertion with INVARIANTS.  Otherwise the
  conditions are evaluated even though the result is unused. [2]
  
  Reported by:  bz, cem [1], kib [2]
  Reviewed by:  dougm, kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26173

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Tue Aug 25 13:30:34 2020(r364767)
+++ head/sys/vm/vm_page.c   Tue Aug 25 13:45:06 2020(r364768)
@@ -3854,18 +3854,19 @@ vm_page_free_pages_toq(struct spglist *free, bool upda
 }
 
 /*
- * Mark this page as wired down, preventing reclamation by the page daemon
- * or when the containing object is destroyed.
+ * Mark this page as wired down.  For managed pages, this prevents reclamation
+ * by the page daemon, or when the containing object, if any, is destroyed.
  */
 void
 vm_page_wire(vm_page_t m)
 {
u_int old;
 
-   KASSERT(m->object != NULL,
-   ("vm_page_wire: page %p does not belong to an object", m));
-   if (!vm_page_busied(m) && !vm_object_busied(m->object))
+#ifdef INVARIANTS
+   if (m->object != NULL && !vm_page_busied(m) &&
+   !vm_object_busied(m->object))
VM_OBJECT_ASSERT_LOCKED(m->object);
+#endif
KASSERT((m->flags & PG_FICTITIOUS) == 0 ||
VPRC_WIRE_COUNT(m->ref_count) >= 1,
("vm_page_wire: fictitious page %p has zero wirings", 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: r364766 - head/share/man/man5

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:29 2020
New Revision: 364766
URL: https://svnweb.freebsd.org/changeset/base/364766

Log:
  style.Makefile: list CSTD between WARNS and CFLAGS
  
  This was suggested by emaste in https://reviews.freebsd.org/D25928 and
  matches most uses in the tree.

Modified:
  head/share/man/man5/style.Makefile.5

Modified: head/share/man/man5/style.Makefile.5
==
--- head/share/man/man5/style.Makefile.5Tue Aug 25 13:30:24 2020
(r364765)
+++ head/share/man/man5/style.Makefile.5Tue Aug 25 13:30:29 2020
(r364766)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 21, 2015
+.Dd August 25, 2020
 .Dt STYLE.MAKEFILE 5
 .Os
 .Sh NAME
@@ -78,6 +78,7 @@ order is:
 .Va INCS
 .Va SRCS
 .Va WARNS
+.Va CSTD
 .Va CFLAGS
 .Va DPADD
 .Va LDADD .
@@ -87,6 +88,7 @@ order is:
 .Va PROG Ns / Ns Oo Va SH Oc Ns Va LIB Ns / Ns Va SCRIPTS
 .Va SRCS
 .Va WARNS
+.Va CSTD
 .Va CFLAGS
 .Va DPADD
 .Va LDADD
___
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: r364765 - in head: sbin/newfs_msdos usr.sbin/makefs

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:24 2020
New Revision: 364765
URL: https://svnweb.freebsd.org/changeset/base/364765

Log:
  Fix makefs bootstrap on macOS after D25563
  
  The macOS assert.h header does not define static_assert when compiling in
  C99 mode. To fix this compile with -std=c11.
  
  Reviewed By:  emaste
  Differential Revision: https://reviews.freebsd.org/D25928

Modified:
  head/sbin/newfs_msdos/Makefile
  head/usr.sbin/makefs/Makefile

Modified: head/sbin/newfs_msdos/Makefile
==
--- head/sbin/newfs_msdos/Makefile  Tue Aug 25 13:30:19 2020
(r364764)
+++ head/sbin/newfs_msdos/Makefile  Tue Aug 25 13:30:24 2020
(r364765)
@@ -9,5 +9,6 @@ SRCS=   newfs_msdos.c mkfs_msdos.c
 .if ${MACHINE_CPUARCH} == "arm"
 WARNS?= 3
 .endif
+CSTD=  c11
 
 .include 

Modified: head/usr.sbin/makefs/Makefile
==
--- head/usr.sbin/makefs/Makefile   Tue Aug 25 13:30:19 2020
(r364764)
+++ head/usr.sbin/makefs/Makefile   Tue Aug 25 13:30:24 2020
(r364765)
@@ -17,6 +17,7 @@ SRCS= cd9660.c \
 MAN=   makefs.8
 
 WARNS?=2
+CSTD=  c11
 
 .include "${SRCDIR}/cd9660/Makefile.inc"
 .include "${SRCDIR}/ffs/Makefile.inc"
___
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: r364767 - in head: contrib/lua/src lib/liblua

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:34 2020
New Revision: 364767
URL: https://svnweb.freebsd.org/changeset/base/364767

Log:
  Fix -Wundef warnings when building liblua
  
  We need to define the LUA_FLOAT_INT64 macro even if we don't use it (copied
  from stand/luaconf.h). While touching luaconf.h.dist also sync it with the
  the 5.3.5 release version (matches the one in lib/liblua).
  
  Reviewed By:  kevans
  Differential Revision: https://reviews.freebsd.org/D25977

Modified:
  head/contrib/lua/src/luaconf.h.dist
  head/lib/liblua/luaconf.h

Modified: head/contrib/lua/src/luaconf.h.dist
==
--- head/contrib/lua/src/luaconf.h.dist Tue Aug 25 13:30:29 2020
(r364766)
+++ head/contrib/lua/src/luaconf.h.dist Tue Aug 25 13:30:34 2020
(r364767)
@@ -1,5 +1,5 @@
 /*
-** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $
+** $Id: luaconf.h,v 1.259.1.1 2017/04/19 17:29:57 roberto Exp $
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 */
@@ -114,6 +114,7 @@
 #define LUA_FLOAT_FLOAT1
 #define LUA_FLOAT_DOUBLE   2
 #define LUA_FLOAT_LONGDOUBLE   3
+#define LUA_FLOAT_INT644
 
 #if defined(LUA_32BITS)/* { */
 /*
@@ -618,6 +619,13 @@
 #if !defined(LUA_USE_C89)
 #define lua_strx2number(s,p)   lua_str2number(s,p)
 #endif
+
+
+/*
+@@ lua_pointer2str converts a pointer to a readable string in a
+** non-specified way.
+*/
+#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p)
 
 
 /*

Modified: head/lib/liblua/luaconf.h
==
--- head/lib/liblua/luaconf.h   Tue Aug 25 13:30:29 2020(r364766)
+++ head/lib/liblua/luaconf.h   Tue Aug 25 13:30:34 2020(r364767)
@@ -122,6 +122,7 @@
 #define LUA_FLOAT_FLOAT1
 #define LUA_FLOAT_DOUBLE   2
 #define LUA_FLOAT_LONGDOUBLE   3
+#define LUA_FLOAT_INT644
 
 #if defined(LUA_32BITS)/* { */
 /*
___
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: r364761 - in head: share/mk sys/conf sys/modules/cloudabi32 sys/modules/cloudabi64 sys/modules/linux sys/modules/linux64

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:03 2020
New Revision: 364761
URL: https://svnweb.freebsd.org/changeset/base/364761

Log:
  Pass -fuse-ld=/path/to/ld if ${LD} != "ld"
  
  This is needed so that setting LD/XLD is not ignored when linking with $CC
  instead of directly using $LD. Currently only clang accepts an absolute
  path for -fuse-ld= (Clang 12+ will add a new --ld-path flag), so we now
  warn when building with GCC and $LD != "ld" since that might result in the
  wrong linker being used.
  
  We have been setting XLD=/path/to/cheri/ld.lld in CheriBSD for a long time and
  used a similar version of this patch to avoid linking with /usr/bin/ld.
  This change is also required when building FreeBSD on an Ubuntu with Clang:
  In that case we set XCC=/usr/lib/llvm-10/bin/clang and since
  /usr/lib/llvm-10/bin/ does not contain a "ld" binary the build fails with
  `clang: error: unable to execute command: Executable "ld" doesn't exist!`
  unless we pass -fuse-ld=/usr/lib/llvm-10/bin/ld.lld.
  
  This change passes -fuse-ld instead of copying ${XLD} to WOLRDTMP/bin/ld
  since then we would have to ensure that this file does not exist while
  building the bootstrap tools. The cross-linker might not be compatible with
  the host linker (e.g. when building on macos: host-linker= Mach-O /usr/bin/ld,
  cross-linker=LLVM ld.lld).
  
  Reviewed By:  brooks, emaste
  Differential Revision: https://reviews.freebsd.org/D26055

Modified:
  head/share/mk/bsd.sys.mk
  head/sys/conf/kern.mk
  head/sys/conf/kern.post.mk
  head/sys/modules/cloudabi32/Makefile
  head/sys/modules/cloudabi64/Makefile
  head/sys/modules/linux/Makefile
  head/sys/modules/linux64/Makefile

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkTue Aug 25 13:29:57 2020(r364760)
+++ head/share/mk/bsd.sys.mkTue Aug 25 13:30:03 2020(r364761)
@@ -284,6 +284,19 @@ CFLAGS+=   ERROR-tried-to-rebuild-during-make-install
 .endif
 .endif
 
+# Please keep this if in sync with kern.mk
+.if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld")
+# Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld".
+# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=.
+.if ${COMPILER_TYPE} == "clang"
+LDFLAGS+=  -fuse-ld=${LD:[1]}
+.else
+# GCC does not support an absolute path for -fuse-ld so we just print this
+# warning instead and let the user add the required symlinks.
+.warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not 
supported
+.endif
+.endif
+
 # Tell bmake not to mistake standard targets for things to be searched for
 # or expect to ever be up-to-date.
 PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend 
beforeinstall \

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Tue Aug 25 13:29:57 2020(r364760)
+++ head/sys/conf/kern.mk   Tue Aug 25 13:30:03 2020(r364761)
@@ -270,6 +270,22 @@ CFLAGS+=-std=iso9899:1999
 CFLAGS+=-std=${CSTD}
 .endif # CSTD
 
+# Please keep this if in sync with bsd.sys.mk
+.if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld")
+# Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld".
+# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=.
+.if ${COMPILER_TYPE} == "clang"
+# Note: unlike bsd.sys.mk we can't use LDFLAGS here since that is used for the
+# flags required when linking the kernel. We don't need those flags when
+# building the vdsos. However, we do need -fuse-ld, so use ${CCLDFLAGS} 
instead.
+CCLDFLAGS+=-fuse-ld=${LD:[1]}
+.else
+# GCC does not support an absolute path for -fuse-ld so we just print this
+# warning instead and let the user add the required symlinks.
+.warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not 
supported
+.endif
+.endif
+
 # Set target-specific linker emulation name.
 LD_EMULATION_aarch64=aarch64elf
 LD_EMULATION_amd64=elf_x86_64_fbsd

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue Aug 25 13:29:57 2020(r364760)
+++ head/sys/conf/kern.post.mk  Tue Aug 25 13:30:03 2020(r364761)
@@ -228,7 +228,7 @@ kernel-clean:
 # in the a.out ld.  For now, this works.
 hack.pico: Makefile
:> hack.c
-   ${CC} -shared ${CFLAGS} -nostdlib hack.c -o hack.pico
+   ${CC} ${CCLDFLAGS} -shared ${CFLAGS} -nostdlib hack.c -o hack.pico
rm -f hack.c
 
 offset.inc: $S/kern/genoffset.sh genoffset.o

Modified: head/sys/modules/cloudabi32/Makefile
==
--- head/sys/modules/cloudabi32/MakefileTue Aug 25 13:29:57 2020
(r364760)
+++ head/sys/modules/cloudabi32/MakefileTue Aug 25 13:30:03 2020
(r364761)

svn commit: r364764 - head

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:19 2020
New Revision: 364764
URL: https://svnweb.freebsd.org/changeset/base/364764

Log:
  Fix typo in r364325 that broke tinderbox with -DBUILD_WITH_STRICT_TMPPATH
  
  ${TARGET_ARCH} is empty here which results in empy MAKE_PARAMS being
  passed to the buildkernel phase. This breaks the build when using the
  strict TMPPATH since cc will not be included in $PATH.
  
  Reviewed By:  jhb

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Tue Aug 25 13:30:14 2020(r364763)
+++ head/Makefile   Tue Aug 25 13:30:19 2020(r364764)
@@ -734,7 +734,7 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE
${SUB_MAKE} ${JFLAG} buildkernel \
TARGET=${TARGET} \
TARGET_ARCH=${TARGET_ARCH_${kernel}} \
-   ${MAKE_PARAMS_${TARGET_ARCH}} \
+   ${MAKE_PARAMS_${TARGET_ARCH_${kernel}}} \
KERNCONF=${kernel} \
> _.${TARGET}.${kernel} 2>&1 || \
(echo "${TARGET} ${kernel} kernel failed," \
___
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: r364760 - in head: . sys/conf tools/build tools/build/bootstrap-m4 tools/build/cross-build/fake_chflags usr.bin/m4

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:29:57 2020
New Revision: 364760
URL: https://svnweb.freebsd.org/changeset/base/364760

Log:
  Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD
  
  The most awkward bit in this patch is the bootstrapping of m4:
  We can't simply use the host version of m4 since that is not compatible
  with the flags passed by lex (at least on macOS, possibly also on Linux).
  Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also
  depends on lex (which needs m4 to generate any files). To work around this
  cyclic dependency we can build a bootstrap version of m4 (with pre-generated
  files) then use that to build the real m4.
  
  This patch also changes the xz/unxz/dd tools to always use the host version
  since the version in the source tree cannot easily be bootstrapped on macOS
  or Linux.
  
  Reviewed By:  brooks, imp (earlier version)
  Differential Revision: https://reviews.freebsd.org/D25992

Added:
  head/tools/build/bootstrap-m4/
  head/tools/build/bootstrap-m4/Makefile   (contents, props changed)
  head/tools/build/bootstrap-m4/inittokenizer.c   (contents, props changed)
  head/tools/build/cross-build/fake_chflags/
  head/tools/build/cross-build/fake_chflags/Makefile   (contents, props changed)
  head/tools/build/cross-build/fake_chflags/chflags   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/sys/conf/kern.post.mk
  head/tools/build/Makefile
  head/usr.bin/m4/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Aug 25 13:23:31 2020(r364759)
+++ head/Makefile.inc1  Tue Aug 25 13:29:57 2020(r364760)
@@ -167,6 +167,19 @@ _t=${TARGET_ARCH}/${TARGET}
 .endif
 .endfor
 
+.if ${.MAKE.OS} != "FreeBSD"
+CROSSBUILD_HOST=${.MAKE.OS}
+.if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin"
+.warning "Unsupported crossbuild system: ${.MAKE.OS}. Build will probably 
fail!"
+.endif
+# We need to force NO_ROOT/DB_FROM_SRC builds when building on other operating
+# systems since the BSD.foo.dist specs contain users and groups that do not
+# exist by default on a Linux/MacOS system.
+NO_ROOT:=  1
+DB_FROM_SRC:=  1
+.export NO_ROOT
+.endif
+
 # If all targets are disabled for system llvm then don't expect it to work
 # for cross-builds.
 .if !defined(TOOLS_PREFIX) && ${MK_LLVM_TARGET_ALL} == "no" && \
@@ -568,13 +581,16 @@ _CPUTYPE!=MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} 
${MAK
 .endif
 .if make(buildworld)
 BUILD_ARCH!=   uname -p
-.if ${MACHINE_ARCH} != ${BUILD_ARCH}
+# On some Linux systems uname -p returns "unknown" so skip this check there.
+# This check only exists to tell people to use TARGET_ARCH instead of
+# MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine.
+.if ${MACHINE_ARCH} != ${BUILD_ARCH} && ${.MAKE.OS} == "FreeBSD"
 .error To cross-build, set TARGET_ARCH.
 .endif
 .endif
 WORLDTMP?= ${OBJTOP}/tmp
 BPATH= 
${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec
-XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
+XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
 
 # When building we want to find the cross tools before the host tools in 
${BPATH}.
 # We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared
@@ -589,6 +605,13 @@ STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_
 # USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER. Once these issues have been
 # resolved it will be turned on by default.
 BUILD_WITH_STRICT_TMPPATH?=0
+.if defined(CROSSBUILD_HOST)
+# When building on non-FreeBSD we can't rely on the tools in /usr/bin being 
compatible
+# with what FreeBSD expects. Therefore we only use tools from STRICTTMPPATH
+# during the world build stage. We build most tools during the bootstrap-tools
+# phase but symlink host tools that are known to work instead of building them
+BUILD_WITH_STRICT_TMPPATH:=1
+.endif
 .if ${BUILD_WITH_STRICT_TMPPATH} != 0
 TMPPATH=   ${STRICTTMPPATH}
 .else
@@ -724,7 +747,9 @@ XMAKE=  ${BMAKE} \
 # kernel-tools stage
 KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${BPATH}:${PATH} \
-   WORLDTMP=${WORLDTMP}
+   WORLDTMP=${WORLDTMP} \
+   MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
+
 KTMAKE=\
TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
@@ -845,7 +870,13 @@ NO_META_IGNORE_HOST_HEADERS=   1
 # allows tracking the oldest osreldate to force rebuilds via
 # META_MODE_BADABI_REVS above.
 host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here
+.if !defined(CROSSBUILD_HOST)
@cp -f /usr/include/osreldate.h ${.TARGET}
+.else
+   @echo "#ifndef __FreeBSD_version" > ${.TARGET}
+  

svn commit: r364762 - head

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:09 2020
New Revision: 364762
URL: https://svnweb.freebsd.org/changeset/base/364762

Log:
  Fix running the builddtb target on a noexec file system
  
  Obtained from:CheriBSD

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Aug 25 13:30:03 2020(r364761)
+++ head/Makefile.inc1  Tue Aug 25 13:30:09 2020(r364762)
@@ -3260,7 +3260,7 @@ DTBOUTPUTPATH= ${.CURDIR}
 #
 builddtb: .PHONY
@PATH=${TMPPATH} MACHINE=${TARGET} \
-   ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
+   sh ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
"${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
 
 ###
___
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: r364763 - head

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:30:14 2020
New Revision: 364763
URL: https://svnweb.freebsd.org/changeset/base/364763

Log:
  Use bootstrapped install(1) install of tools/install.sh in world stage
  
  This should be noticeably faster due to fewer processes being forked and
  also handles other flags such as -S or writing to METALOG.
  
  Reviewed By:  brooks
  Differential Revision: https://reviews.freebsd.org/D26039

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Aug 25 13:30:09 2020(r364762)
+++ head/Makefile.inc1  Tue Aug 25 13:30:14 2020(r364763)
@@ -765,7 +765,7 @@ KTMAKE= \
 
 # world stage
 WMAKEENV=  ${CROSSENV} \
-   INSTALL="sh ${.CURDIR}/tools/install.sh" \
+   INSTALL="${INSTALL_CMD} -U" \
PATH=${TMPPATH} \
SYSROOT=${WORLDTMP}
 
___
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: r364759 - in head: lib/libc/gen lib/libcapsicum tools/build tools/build/cross-build tools/build/libc-bootstrap tools/build/mk

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:23:31 2020
New Revision: 364759
URL: https://svnweb.freebsd.org/changeset/base/364759

Log:
  Add missing FreeBSD functions to -legacy when building on macOS/Linux
  
  In most cases this simply builds the file from lib/libc for missing
  functions (e.g. strlcpy on Linux etc.). In cases where this is not possible
  I've added an implementation to tools/build/cross-build.
  
  The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from
  https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes
  sense to import it into to contrib just for these three bootstrap files.
  
  Reviewed By:  brooks
  Differential Revision: https://reviews.freebsd.org/D25978

Added:
  head/tools/build/cross-build/capsicum_stubs.c   (contents, props changed)
  head/tools/build/cross-build/closefrom.c   (contents, props changed)
  head/tools/build/cross-build/fake_sysctl.c   (contents, props changed)
  head/tools/build/cross-build/fgetln_fallback.c   (contents, props changed)
  head/tools/build/cross-build/fgetwln_fallback.c   (contents, props changed)
  head/tools/build/cross-build/local-link.h   (contents, props changed)
  head/tools/build/cross-build/progname.c   (contents, props changed)
  head/tools/build/libc-bootstrap/
  head/tools/build/libc-bootstrap/libc_private.h   (contents, props changed)
  head/tools/build/libc-bootstrap/namespace.h   (contents, props changed)
  head/tools/build/libc-bootstrap/un-namespace.h   (contents, props changed)
  head/tools/build/mk/Makefile.boot.pre   (contents, props changed)
Modified:
  head/lib/libc/gen/arc4random.h
  head/lib/libcapsicum/capsicum_helpers.h
  head/tools/build/Makefile
  head/tools/build/mk/Makefile.boot
  head/tools/build/mk/bsd.lib.mk
  head/tools/build/mk/bsd.prog.mk

Modified: head/lib/libc/gen/arc4random.h
==
--- head/lib/libc/gen/arc4random.h  Tue Aug 25 13:21:49 2020
(r364758)
+++ head/lib/libc/gen/arc4random.h  Tue Aug 25 13:23:31 2020
(r364759)
@@ -58,11 +58,13 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
if ((p = mmap(NULL, sizeof(*p), PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
return (-1);
+   /* Allow bootstrapping arc4random.c on Linux/macOS */
+#ifdef INHERIT_ZERO
if (minherit(p, sizeof(*p), INHERIT_ZERO) == -1) {
munmap(p, sizeof(*p));
return (-1);
}
-
+#endif
*rsp = >rs;
*rsxp = >rsx;
return (0);

Modified: head/lib/libcapsicum/capsicum_helpers.h
==
--- head/lib/libcapsicum/capsicum_helpers.h Tue Aug 25 13:21:49 2020
(r364758)
+++ head/lib/libcapsicum/capsicum_helpers.h Tue Aug 25 13:23:31 2020
(r364759)
@@ -49,7 +49,17 @@
 __BEGIN_DECLS
 
 static const unsigned long caph_stream_cmds[] =
-   { TIOCGETA, TIOCGWINSZ, FIODTYPE };
+{
+#ifdef TIOCGETA
+   TIOCGETA,
+#endif
+#ifdef TIOCGWINSZ
+   TIOCGWINSZ,
+#endif
+#ifdef FIODTYPE
+   FIODTYPE,
+#endif
+};
 static const uint32_t caph_stream_fcntls = CAP_FCNTL_GETFL;
 
 static __inline void

Modified: head/tools/build/Makefile
==
--- head/tools/build/Makefile   Tue Aug 25 13:21:49 2020(r364758)
+++ head/tools/build/Makefile   Tue Aug 25 13:23:31 2020(r364759)
@@ -5,6 +5,7 @@
 LIB=   egacy
 SRC=
 INCSGROUPS=INCS SYSINCS CASPERINC UFSINCS FFSINCS MSDOSFSINCS DISKINCS
+INCSGROUPS+=   MACHINESYSINCS RPCINCS
 INCS=
 
 SYSINCSDIR=${INCLUDEDIR}/sys
@@ -14,49 +15,83 @@ UFSINCSDIR= ${INCLUDEDIR}/ufs/ufs
 FFSINCSDIR=${INCLUDEDIR}/ufs/ffs
 MSDOSFSINCSDIR=${INCLUDEDIR}/fs/msdosfs
 DISKINCSDIR=   ${INCLUDEDIR}/sys/disk
+MACHINESYSINCSDIR= ${INCLUDEDIR}/machine
+RPCINCSDIR=${INCLUDEDIR}/rpc
 
 BOOTSTRAPPING?=0
 
-_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/grp.h || true
+
+.if ${.MAKE.OS} == "Darwin"
+_XCODE_ROOT!=xcode-select -p
+# since macOS 10.14 C headers are no longer installed in /usr but only
+# provided via the SDK
+.if ${_XCODE_ROOT} == "/Library/Developer/CommandLineTools"
+# Only command line tools installed -> host headers are in the SDKs directory
+_MACOS_SDK_DIR=${_XCODE_ROOT}/SDKs/MacOSX.sdk/
+.else
+# Full XCode installed -> host headers are below Platforms/MacOSX.platform
+_MACOS_SDK_DIR=${_XCODE_ROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+.endif
+HOST_INCLUDE_ROOT=${_MACOS_SDK_DIR}/usr/include
+.if !exists(${HOST_INCLUDE_ROOT}/stdio.h)
+.error "You must install the macOS SDK (try xcode-select --install)"
+.endif
+.else
+HOST_INCLUDE_ROOT=/usr/include
+.endif
+
+# Allow building libc-internal files (also on non-FreeBSD hosts)
+CFLAGS+=   -I${.CURDIR}/libc-bootstrap
+# Symbol versioning is not required for -legacy (and 

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

2020-08-25 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Aug 25 13:21:49 2020
New Revision: 364758
URL: https://svnweb.freebsd.org/changeset/base/364758

Log:
  Add mlx5en(4) to the list of supported netdump network drivers.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

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

Modified: head/share/man/man4/netdump.4
==
--- head/share/man/man4/netdump.4   Tue Aug 25 13:18:53 2020
(r364757)
+++ head/share/man/man4/netdump.4   Tue Aug 25 13:21:49 2020
(r364758)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2019
+.Dd August 25, 2020
 .Dt NETDUMP 4
 .Os
 .Sh NAME
@@ -110,6 +110,7 @@ The following network drivers support netdump:
 .Xr ix 4 ,
 .Xr ixl 4 ,
 .Xr mlx4en 4 ,
+.Xr mlx5en 4 ,
 .Xr re 4 ,
 .Xr vtnet 4 .
 .Sh SYSCTL VARIABLES
___
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: r364757 - in head/tools/build/cross-build/include: . common common/machine common/sys linux linux/sys mac mac/sys

2020-08-25 Thread Alex Richardson
Author: arichardson
Date: Tue Aug 25 13:18:53 2020
New Revision: 364757
URL: https://svnweb.freebsd.org/changeset/base/364757

Log:
  Add Linux/macOS compatibility system headers to tools/build/cross-build
  
  These headers are required in order to build the bootstrap tools on macOS
  and Linux. A follow-up commit will add implementations of functions that
  don't exist on those operating systems to -legacy when bootstrapping.
  
  Reviewed By:  brooks
  Differential Revision: https://reviews.freebsd.org/D14316

Added:
  head/tools/build/cross-build/include/
  head/tools/build/cross-build/include/common/
  head/tools/build/cross-build/include/common/db.h   (contents, props changed)
  head/tools/build/cross-build/include/common/getopt.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/grp.h   (contents, props changed)
  head/tools/build/cross-build/include/common/libcasper.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/libelf.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/libutil.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/machine/
  head/tools/build/cross-build/include/common/machine/endian.h   (contents, 
props changed)
  head/tools/build/cross-build/include/common/netconfig.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/netdb.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/osreldate.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/pwd.h   (contents, props changed)
  head/tools/build/cross-build/include/common/string.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/
  head/tools/build/cross-build/include/common/sys/_iovec.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/_null.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/_types.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/cdefs.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/ctype.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/limits.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/mman.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/param.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/stdint.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/sysctl.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/types.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/sys/uio.h   (contents, props 
changed)
  head/tools/build/cross-build/include/common/unistd.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/
  head/tools/build/cross-build/include/linux/__unused_workaround_end.h   
(contents, props changed)
  head/tools/build/cross-build/include/linux/__unused_workaround_start.h   
(contents, props changed)
  head/tools/build/cross-build/include/linux/ctype.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/endian.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/errno.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/fcntl.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/libutil.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/limits.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/nbtool_config.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/netdb.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/regex.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/resolv.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/signal.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/stdio.h   (contents, props changed)
  head/tools/build/cross-build/include/linux/stdlib.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/string.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/
  head/tools/build/cross-build/include/linux/sys/disk.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/endian.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/filio.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/ioccom.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/mount.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/param.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/stat.h   (contents, props 
changed)
  head/tools/build/cross-build/include/linux/sys/sysctl.h   (contents, props 

svn commit: r364756 - stable/11/sys/dev/netmap

2020-08-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Aug 25 11:12:30 2020
New Revision: 364756
URL: https://svnweb.freebsd.org/changeset/base/364756

Log:
  MFC r364341
  
  netmap: fix parsing of legacy nmr->nr_ringid
  
  Code was checking for NETMAP_{SW,HW}_RING in req->nr_ringid which
  had already been masked by NETMAP_RING_MASK. Therefore, the comparisons
  always failed and set NR_REG_ALL_NIC. Check against the original nmr
  structure.
  
  Submitted by:   bpo...@packetforensics.com
  Reported by:bpo...@packetforensics.com
  Reviewed by:giuseppe.letti...@unipi.it
  Approved by:vmaffione

Modified:
  stable/11/sys/dev/netmap/netmap_legacy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/netmap/netmap_legacy.c
==
--- stable/11/sys/dev/netmap/netmap_legacy.cTue Aug 25 11:10:37 2020
(r364755)
+++ stable/11/sys/dev/netmap/netmap_legacy.cTue Aug 25 11:12:30 2020
(r364756)
@@ -71,9 +71,9 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n
/* Convert the older nmr->nr_ringid (original
 * netmap control API) to nmr->nr_flags. */
u_int regmode = NR_REG_DEFAULT;
-   if (req->nr_ringid & NETMAP_SW_RING) {
+   if (nmr->nr_ringid & NETMAP_SW_RING) {
regmode = NR_REG_SW;
-   } else if (req->nr_ringid & NETMAP_HW_RING) {
+   } else if (nmr->nr_ringid & NETMAP_HW_RING) {
regmode = NR_REG_ONE_NIC;
} else {
regmode = NR_REG_ALL_NIC;
___
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: r364755 - stable/12/sys/dev/netmap

2020-08-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Tue Aug 25 11:10:37 2020
New Revision: 364755
URL: https://svnweb.freebsd.org/changeset/base/364755

Log:
  MFC r364341
  
  netmap: fix parsing of legacy nmr->nr_ringid
  
  Code was checking for NETMAP_{SW,HW}_RING in req->nr_ringid which
  had already been masked by NETMAP_RING_MASK. Therefore, the comparisons
  always failed and set NR_REG_ALL_NIC. Check against the original nmr
  structure.
  
  Submitted by:   bpo...@packetforensics.com
  Reported by:bpo...@packetforensics.com
  Reviewed by:giuseppe.letti...@unipi.it
  Approved by:vmaffione
  
  This line, and those below, will be ignored--
  > Description of fields to fill in above: 76 columns --|
  > PR:   If and which Problem Report is related.
  > Submitted by: If someone else sent in the change.
  > Reported by:  If someone else reported the issue.
  > Reviewed by:  If someone else reviewed your modification.
  > Approved by:  If you needed approval for this commit.
  > Obtained from:If the change is from a third party.
  > MFC after:N [day[s]|week[s]|month[s]].  Request a reminder 
email.
  > MFH:  Ports tree branch name.  Request approval for 
merge.
  > Relnotes: Set to 'yes' for mention in release notes.
  > Security: Vulnerability reference (one per line) or 
description.
  > Sponsored by: If the change was sponsored by an organization.
  > Pull Request: https://github.com/freebsd/freebsd/pull/### 
(*full* GitHub URL needed).
  > Differential Revision:https://reviews.freebsd.org/D### (*full* phabric 
URL needed).
  > Empty fields above will be automatically removed.
  
  _M   .
  Msys/dev/netmap/netmap_legacy.c

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

Modified: stable/12/sys/dev/netmap/netmap_legacy.c
==
--- stable/12/sys/dev/netmap/netmap_legacy.cTue Aug 25 09:42:03 2020
(r364754)
+++ stable/12/sys/dev/netmap/netmap_legacy.cTue Aug 25 11:10:37 2020
(r364755)
@@ -76,9 +76,9 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n
/* Convert the older nmr->nr_ringid (original
 * netmap control API) to nmr->nr_flags. */
u_int regmode = NR_REG_DEFAULT;
-   if (req->nr_ringid & NETMAP_SW_RING) {
+   if (nmr->nr_ringid & NETMAP_SW_RING) {
regmode = NR_REG_SW;
-   } else if (req->nr_ringid & NETMAP_HW_RING) {
+   } else if (nmr->nr_ringid & NETMAP_HW_RING) {
regmode = NR_REG_ONE_NIC;
} else {
regmode = NR_REG_ALL_NIC;
___
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: r364754 - in head/sys/netinet: . tcp_stacks

2020-08-25 Thread Michael Tuexen
Author: tuexen
Date: Tue Aug 25 09:42:03 2020
New Revision: 364754
URL: https://svnweb.freebsd.org/changeset/base/364754

Log:
  RFC 3465 defines a limit L used in TCP slow start for limiting the number
  of acked bytes as described in Section 2.2 of that document.
  This patch ensures that this limit is not also applied in congestion
  avoidance. Applying this limit also in congestion avoidance can result in
  using less bandwidth than allowed.
  
  Reported by:  l.tian.em...@gmail.com
  Reviewed by:  rrs, rscheff
  MFC after:3 days
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D26120

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Aug 25 06:49:10 2020
(r364753)
+++ head/sys/netinet/tcp_input.cTue Aug 25 09:42:03 2020
(r364754)
@@ -349,8 +349,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, u
}
 #endif /* STATS */
if (tp->snd_cwnd > tp->snd_ssthresh) {
-   tp->t_bytes_acked += min(tp->ccv->bytes_this_ack,
-nsegs * V_tcp_abc_l_var * tcp_maxseg(tp));
+   tp->t_bytes_acked += tp->ccv->bytes_this_ack;
if (tp->t_bytes_acked >= tp->snd_cwnd) {
tp->t_bytes_acked -= tp->snd_cwnd;
tp->ccv->flags |= CCF_ABC_SENTAWND;

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Tue Aug 25 06:49:10 2020
(r364753)
+++ head/sys/netinet/tcp_stacks/rack.c  Tue Aug 25 09:42:03 2020
(r364754)
@@ -3911,8 +3911,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r
 #endif
}
if (rack->r_ctl.cwnd_to_use > tp->snd_ssthresh) {
-   tp->t_bytes_acked += min(tp->ccv->bytes_this_ack,
-nsegs * V_tcp_abc_l_var * ctf_fixed_maxseg(tp));
+   tp->t_bytes_acked += tp->ccv->bytes_this_ack;
if (tp->t_bytes_acked >= rack->r_ctl.cwnd_to_use) {
tp->t_bytes_acked -= rack->r_ctl.cwnd_to_use;
tp->ccv->flags |= CCF_ABC_SENTAWND;
___
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: vos projet de renovation

2020-08-25 Thread Alpes Plafond
[  ]( # )   [  ]( # )   [  ]( # )
[  ]( # )

[  ]( 
http://www.alpesplafond.sitew.fr/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )

[  ]( # )  
RENOVER SON PLAFOND    
[  ]( # )  
en 1 journée seulement     
[  ]( # )  
sans déménager les meubles, sans poussière, sans peinture garantie 10 ans    
[  ]( # )  
à un PRIX ABORDABLE    
[  ]( # )  
C'EST POSSIBLE !    
[  ]( # )    [ En savoir + ]( 
http://www.alpesplafond.sitew.fr/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )   
[  ]( # )  
  [ Cliquez pour voir nos réalisations : ]( 
http://www.alpesplafond.sitew.fr/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )    
[  ]( # )

[  ]( 
http://www.alpesplafond.sitew.fr/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )

[  ]( # ) Spécialiste depuis + de 15 ans dans la
pose de plafond tendu
Isère, Savoie, Haute Savoie
[  ]( # )  
[ Consultez les avis de nos clients ]( 
https://www.societe-des-avis-garantis.fr/alpes-plafond-com/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )    
[  ]( # )


 
 
Alpes Plafond                       04.76.00.93.06
19, boulevard des Alpes      [ alpesplaf...@orange.fr ]( 
mailto:alpesplaf...@orange.fr )
38240 MEYLAN                   [ www.alpes-plafond.com ]( 
http://www.alpes-plafond.com/?utm_source=sendinblue_campaign=SAVOIE_RE_votre_projet__medium=email
 )
[  ]( # )  

[ Se désinscrire ]( 
http://r.email.alpes-plafond.com/mk/un/ct0SEEnxyZDPd-NDwXacllBrLvh_USbV-qREwZSn6Pj4zCgj1iQJ8eA84QvJ_Nj7K6uCIChSDq4RKkp1oNioGvZWkyrAJ-NEYVG_IaxonmpbNUM8FI3uSZuEKW40zT-7TRocX8qy6LJnXmlUp2wO00yEvQ
 )   

___
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: r364753 - in head: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt sys/sys

2020-08-25 Thread Dimitry Andric
Author: dim
Date: Tue Aug 25 06:49:10 2020
New Revision: 364753
URL: https://svnweb.freebsd.org/changeset/base/364753

Log:
  Add atomic and bswap functions to libcompiler_rt
  
  There have been several mentions on our mailing lists about missing
  atomic functions in our system libraries (e.g. __atomic_load_8 and
  friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.
  
  To address this, add implementations for the functions from compiler-rt
  to the system compiler support libraries, e.g. libcompiler_rt.a and and
  libgcc_s.so.
  
  This also needs a small fixup in compiler-rt's atomic.c, to ensure that
  32-bit mips can build correctly.
  
  Bump __FreeBSD_version to make it easier for port maintainers to detect
  when these functions were added.
  
  MFC after:2 weeks
  Differential Revision: https://reviews.freebsd.org/D26159

Modified:
  head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
  head/lib/libcompiler_rt/Makefile.inc
  head/sys/sys/param.h

Modified: head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c
==
--- head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Aug 25 
05:15:40 2020(r364752)
+++ head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Aug 25 
06:49:10 2020(r364753)
@@ -125,8 +125,8 @@ static __inline Lock *lock_for_pointer(void *ptr) {
 #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2)
 #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4)
 
-/// 32 bit PowerPC doesn't support 8-byte lock_free atomics
-#if !defined(__powerpc64__) && defined(__powerpc__)
+/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics
+#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__))
 #define IS_LOCK_FREE_8 0
 #else
 #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8)

Modified: head/lib/libcompiler_rt/Makefile.inc
==
--- head/lib/libcompiler_rt/Makefile.incTue Aug 25 05:15:40 2020
(r364752)
+++ head/lib/libcompiler_rt/Makefile.incTue Aug 25 06:49:10 2020
(r364753)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 CRTARCH=   ${MACHINE_CPUARCH:C/amd64/x86_64/}
 
 CRTSRC=${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins
@@ -18,6 +20,9 @@ SRCF+=ashldi3
 SRCF+= ashlti3
 SRCF+= ashrdi3
 SRCF+= ashrti3
+SRCF+= atomic
+SRCF+= bswapdi2
+SRCF+= bswapsi2
 SRCF+= clear_cache
 SRCF+= clzdi2
 SRCF+= clzsi2
@@ -120,6 +125,10 @@ SRCF+= umoddi3
 SRCF+= umodsi3
 SRCF+= umodti3
 
+.if "${COMPILER_TYPE}" == "clang"
+CFLAGS.atomic.c+=  -Wno-atomic-alignment
+.endif
+
 # Avoid using SSE2 instructions on i386, if unsupported.
 .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
 SRCS+= floatdidf.c
@@ -212,12 +221,6 @@ CFLAGS+=   -DEMIT_SYNC_ATOMICS
 SRCF+= stdatomic
 .endif
 
-.if "${COMPILER_TYPE}" == "clang" && \
-(${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe")
-SRCS+=  atomic.c
-CFLAGS.atomic.c+=  -Wno-atomic-alignment
-.endif
-
 .for file in ${SRCF}
 .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == 
"") \
 && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
@@ -239,19 +242,11 @@ SRCS+=aeabi_memmove.S
 SRCS+= aeabi_memset.S
 SRCS+= aeabi_uidivmod.S
 SRCS+= aeabi_uldivmod.S
-SRCS+= bswapdi2.S
-SRCS+= bswapsi2.S
 SRCS+= switch16.S
 SRCS+= switch32.S
 SRCS+= switch8.S
 SRCS+= switchu8.S
 SRCS+= sync_synchronize.S
-.endif
-
-# On some archs GCC-6.3 requires bswap32 built-in.
-.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv"
-SRCS+= bswapdi2.c
-SRCS+= bswapsi2.c
 .endif
 
 .if ${MACHINE_ARCH:Mriscv*sf}

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Aug 25 05:15:40 2020(r364752)
+++ head/sys/sys/param.hTue Aug 25 06:49:10 2020(r364753)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300112  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300113  /* 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"