Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64

2020-10-01 Thread Kyle Evans
On Thu, Oct 1, 2020 at 8:23 PM Cy Schubert  wrote:
>
> In message  om>
> , Kyle Evans writes:
> > On Thu, Oct 1, 2020 at 4:06 PM Ed Maste  wrote:
> > >
> > > Author: emaste
> > > Date: Thu Oct  1 21:05:50 2020
> > > New Revision: 366344
> > > URL: https://svnweb.freebsd.org/changeset/base/366344
> > >
> > > Log:
> > >   libmd: fix assembly optimized skein implementation
> > >
> > >   The assembly implementation incorrectly used logical AND instead of
> > >   bitwise AND. Fix, and re-enable in libmd.
> > >
> > >   Submitted by: Yang Zhong 
> > >   Reviewed by:  cem (earlier)
> > >   Sponsored by: The FreeBSD Foundation
> > >   Differential Revision:https://reviews.freebsd.org/D26614
> > >
> > > Modified:
> > >   head/lib/libmd/Makefile
> > >   head/sys/crypto/skein/amd64/skein_block_asm.S
> > >
> > > Modified: head/lib/libmd/Makefile
> > > ===
> > ===
> > > --- head/lib/libmd/Makefile Thu Oct  1 20:08:27 2020(r366343)
> > > +++ head/lib/libmd/Makefile Thu Oct  1 21:05:50 2020(r366344)
> > > @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM
> > >  SRCS+= rmd160.S
> > >  CFLAGS+= -DRMD160_ASM
> > >  .endif
> > > -#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> > > -## Fully unroll all loops in the assembly optimized version
> > > -#ACFLAGS+= -DSKEIN_LOOP=0
> > > -#SRCS+= skein_block_asm.S
> > > -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to 
> > > re
> > place with assembly: 256+512+1024 = 1792
> > > -#.endif
> > > +.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> > > +# Fully unroll all loops in the assembly optimized version
> > > +ACFLAGS+= -DSKEIN_LOOP=0
> > > +SRCS+= skein_block_asm.S
> > > +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to 
> > > rep
> > lace with assembly: 256+512+1024 = 1792
> > > +.endif
> > >  .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || 
> > > e
> > xists(${MACHINE_ARCH}/skein_block_asm.S)
> > >  ACFLAGS+= -DELF -Wa,--noexecstack
> > >  .endif
> > >
> >
> > We need some kind of magic to walk across this for -DNO_CLEAN builds
> > -- skein_block.c has no reason to get rebuilt, but we need it to
> > because we're now defining SKEIN_USE_ASM=1792, which will strip out
> > some symbols.
> >
> > I haven't had time to look into what kind of magic we can apply here,
> > kind of needed to skip ahead to get this build finished for some other
> > testing.
>
> I did rm -r for .../lib/libmd.
>

Yeah, either that or... touch skein_block.c or I guess in
tools/build/depend-cleanup.sh we can basically:

if [ -f ${OBJTOP}/lib/libmd/skein_block_asm.o ]; then
if nm ${OBJTOP}/lib/libmd/skein_block.o | grep Skein_512_Process_Block; then
rm ${OBJTOP}/lib/libmd/skein_block.*
fi
fi

> Strangely it only failed in the amd64 build. Not in i386.
>

The optimization in question actually only applies to amd64, so this
part is reasonable.
___
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: r366353 - head/sys/contrib/openzfs/module/os/freebsd/spl

2020-10-01 Thread Matt Macy
Author: mmacy
Date: Fri Oct  2 01:25:08 2020
New Revision: 366353
URL: https://svnweb.freebsd.org/changeset/base/366353

Log:
  OpenZFS: don't call fpu_kern_thread on i386

Modified:
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c

Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c
==
--- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c  Fri Oct  2 
01:08:11 2020(r366352)
+++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c  Fri Oct  2 
01:25:08 2020(r366353)
@@ -169,7 +169,7 @@ taskq_tsd_set(void *context)
 {
taskq_t *tq = context;
 
-#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__)
+#if defined(__amd64__) || defined(__aarch64__) 
if (context != NULL && tsd_get(taskq_tsd) == NULL)
fpu_kern_thread(FPU_KERN_NORMAL);
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64

2020-10-01 Thread Cy Schubert
In message 
, Kyle Evans writes:
> On Thu, Oct 1, 2020 at 4:06 PM Ed Maste  wrote:
> >
> > Author: emaste
> > Date: Thu Oct  1 21:05:50 2020
> > New Revision: 366344
> > URL: https://svnweb.freebsd.org/changeset/base/366344
> >
> > Log:
> >   libmd: fix assembly optimized skein implementation
> >
> >   The assembly implementation incorrectly used logical AND instead of
> >   bitwise AND. Fix, and re-enable in libmd.
> >
> >   Submitted by: Yang Zhong 
> >   Reviewed by:  cem (earlier)
> >   Sponsored by: The FreeBSD Foundation
> >   Differential Revision:https://reviews.freebsd.org/D26614
> >
> > Modified:
> >   head/lib/libmd/Makefile
> >   head/sys/crypto/skein/amd64/skein_block_asm.S
> >
> > Modified: head/lib/libmd/Makefile
> > ===
> ===
> > --- head/lib/libmd/Makefile Thu Oct  1 20:08:27 2020(r366343)
> > +++ head/lib/libmd/Makefile Thu Oct  1 21:05:50 2020(r366344)
> > @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM
> >  SRCS+= rmd160.S
> >  CFLAGS+= -DRMD160_ASM
> >  .endif
> > -#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> > -## Fully unroll all loops in the assembly optimized version
> > -#ACFLAGS+= -DSKEIN_LOOP=0
> > -#SRCS+= skein_block_asm.S
> > -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to re
> place with assembly: 256+512+1024 = 1792
> > -#.endif
> > +.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> > +# Fully unroll all loops in the assembly optimized version
> > +ACFLAGS+= -DSKEIN_LOOP=0
> > +SRCS+= skein_block_asm.S
> > +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to rep
> lace with assembly: 256+512+1024 = 1792
> > +.endif
> >  .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || e
> xists(${MACHINE_ARCH}/skein_block_asm.S)
> >  ACFLAGS+= -DELF -Wa,--noexecstack
> >  .endif
> >
>
> We need some kind of magic to walk across this for -DNO_CLEAN builds
> -- skein_block.c has no reason to get rebuilt, but we need it to
> because we're now defining SKEIN_USE_ASM=1792, which will strip out
> some symbols.
>
> I haven't had time to look into what kind of magic we can apply here,
> kind of needed to skip ahead to get this build finished for some other
> testing.

I did rm -r for .../lib/libmd.

Strangely it only failed in the amd64 build. Not in i386.


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


Re: svn commit: r366344 - in head: lib/libmd sys/crypto/skein/amd64

2020-10-01 Thread Kyle Evans
On Thu, Oct 1, 2020 at 4:06 PM Ed Maste  wrote:
>
> Author: emaste
> Date: Thu Oct  1 21:05:50 2020
> New Revision: 366344
> URL: https://svnweb.freebsd.org/changeset/base/366344
>
> Log:
>   libmd: fix assembly optimized skein implementation
>
>   The assembly implementation incorrectly used logical AND instead of
>   bitwise AND. Fix, and re-enable in libmd.
>
>   Submitted by: Yang Zhong 
>   Reviewed by:  cem (earlier)
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:https://reviews.freebsd.org/D26614
>
> Modified:
>   head/lib/libmd/Makefile
>   head/sys/crypto/skein/amd64/skein_block_asm.S
>
> Modified: head/lib/libmd/Makefile
> ==
> --- head/lib/libmd/Makefile Thu Oct  1 20:08:27 2020(r366343)
> +++ head/lib/libmd/Makefile Thu Oct  1 21:05:50 2020(r366344)
> @@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM
>  SRCS+= rmd160.S
>  CFLAGS+= -DRMD160_ASM
>  .endif
> -#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> -## Fully unroll all loops in the assembly optimized version
> -#ACFLAGS+= -DSKEIN_LOOP=0
> -#SRCS+= skein_block_asm.S
> -#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to 
> replace with assembly: 256+512+1024 = 1792
> -#.endif
> +.if exists(${MACHINE_ARCH}/skein_block_asm.S)
> +# Fully unroll all loops in the assembly optimized version
> +ACFLAGS+= -DSKEIN_LOOP=0
> +SRCS+= skein_block_asm.S
> +CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to 
> replace with assembly: 256+512+1024 = 1792
> +.endif
>  .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || 
> exists(${MACHINE_ARCH}/skein_block_asm.S)
>  ACFLAGS+= -DELF -Wa,--noexecstack
>  .endif
>

We need some kind of magic to walk across this for -DNO_CLEAN builds
-- skein_block.c has no reason to get rebuilt, but we need it to
because we're now defining SKEIN_USE_ASM=1792, which will strip out
some symbols.

I haven't had time to look into what kind of magic we can apply here,
kind of needed to skip ahead to get this build finished for some other
testing.

Thanks,

Kyle Evans
___
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: r366352 - releng/12.2/sys/conf

2020-10-01 Thread Glen Barber
Author: gjb
Date: Fri Oct  2 01:08:11 2020
New Revision: 366352
URL: https://svnweb.freebsd.org/changeset/base/366352

Log:
  Rename releng/12.2 to RC1 as part of the 12.2-RELEASE cycle.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/12.2/sys/conf/newvers.sh

Modified: releng/12.2/sys/conf/newvers.sh
==
--- releng/12.2/sys/conf/newvers.sh Fri Oct  2 00:52:31 2020
(r366351)
+++ releng/12.2/sys/conf/newvers.sh Fri Oct  2 01:08:11 2020
(r366352)
@@ -49,7 +49,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.2"
-BRANCH="BETA3"
+BRANCH="RC1"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366351 - head/contrib/netbsd-tests/fs

2020-10-01 Thread Mitchell Horne
Author: mhorne
Date: Fri Oct  2 00:52:31 2020
New Revision: 366351
URL: https://svnweb.freebsd.org/changeset/base/366351

Log:
  tmpfs tests: check for built-in tmpfs module
  
  As of r363471, tmpfs is included in all GENERIC kernel configs. This
  results in a warning being emitted for each call to kldload(8):
  
  module_register: cannot register tmpfs from tmpfs.ko; already loaded from 
kernel
  
  Check for the presence of the module via kldstat first to quiet this
  warning.
  
  Reviewed by:  asomers, arichardson
  Differential Revision:https://reviews.freebsd.org/D26632

Modified:
  head/contrib/netbsd-tests/fs/h_funcs.subr

Modified: head/contrib/netbsd-tests/fs/h_funcs.subr
==
--- head/contrib/netbsd-tests/fs/h_funcs.subr   Thu Oct  1 23:28:21 2020
(r366350)
+++ head/contrib/netbsd-tests/fs/h_funcs.subr   Fri Oct  2 00:52:31 2020
(r366351)
@@ -45,7 +45,7 @@ require_fs() {
 
# Begin FreeBSD
if true; then
-   if kldload -n ${name}; then
+   if kldstat -qm ${name} || kldload -n ${name}; then
found=yes
else
found=no
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366350 - in head/sys/contrib/openzfs: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/s

2020-10-01 Thread Cy Schubert
Time to deorbit i386 once and for all. What a pain.

--- spl_taskq.o ---
/opt/src/svn-current/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c:1
74:3: error: implicit declaration of function 'fpu_kern_thread' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]
fpu_kern_thread(FPU_KERN_NORMAL);
^
/opt/src/svn-current/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c:1
74:19: error: use of undeclared identifier 'FPU_KERN_NORMAL'
fpu_kern_thread(FPU_KERN_NORMAL);
^
2 errors generated.


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



In message <202010012328.091nslq2085...@repo.freebsd.org>, Matt Macy writes:
> Author: mmacy
> Date: Thu Oct  1 23:28:21 2020
> New Revision: 366350
> URL: https://svnweb.freebsd.org/changeset/base/366350
>
> Log:
>   OpenZFS: MFV 2.0-rc3-gfc5966
>   
>   - Annotate FreeBSD sysctls with CTLFLAG_MPSAFE
>   - Reduce stack usage of Lua
>   - Don't save user FPU context in kernel threads
>   - Add support for procfs_list
>   - Code cleanup in zio_crypt
>   - Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c
>   - Drop references when skipping dmu_send due to EXDEV
>   - Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
>   - Fix legacy compat for platform IOCs
>
> Added:
>   head/sys/contrib/openzfs/.github/
>  - copied from r366349, vendor-sys/openzfs/dist/.github/
>   head/sys/contrib/openzfs/contrib/intel_qat/
>  - copied from r366349, vendor-sys/openzfs/dist/contrib/intel_qat/
>   head/sys/contrib/openzfs/tests/zfs-tests/cmd/badsend/
>  - copied from r366349, vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badse
> nd/
>   head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invali
> d.ksh
>  - copied unchanged from r366349, vendor-sys/openzfs/dist/tests/zfs-tests
> /tests/functional/rsend/send_invalid.ksh
> Modified:
>   head/sys/contrib/openzfs/cmd/zfs/zfs_main.c
>   head/sys/contrib/openzfs/config/kernel-config-defined.m4
>   head/sys/contrib/openzfs/config/kernel-objtool.m4
>   head/sys/contrib/openzfs/configure.ac
>   head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs
>   head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h
>   head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h
>   head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h
>   head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h
>   head/sys/contrib/openzfs/include/sys/frame.h
>   head/sys/contrib/openzfs/include/sys/lua/luaconf.h
>   head/sys/contrib/openzfs/include/sys/zfs_context.h
>   head/sys/contrib/openzfs/include/sys/zstd/zstd.h
>   head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c
>   head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c
>   head/sys/contrib/openzfs/lib/libzpool/kernel.c
>   head/sys/contrib/openzfs/man/man8/zfs-userspace.8
>   head/sys/contrib/openzfs/man/man8/zpool-remove.8
>   head/sys/contrib/openzfs/module/lua/llimits.h
>   head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c
>   head/sys/contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c
>   head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c
>   head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c
>   head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c
>   head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c
>   head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
>   head/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c
>   head/sys/contrib/openzfs/module/os/linux/spl/spl-procfs-list.c
>   head/sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c
>   head/sys/contrib/openzfs/module/os/linux/zfs/zfs_debug.c
>   head/sys/contrib/openzfs/module/zfs/arc.c
>   head/sys/contrib/openzfs/module/zfs/dbuf_stats.c
>   head/sys/contrib/openzfs/module/zfs/dmu_send.c
>   head/sys/contrib/openzfs/module/zfs/dnode.c
>   head/sys/contrib/openzfs/module/zfs/dsl_crypt.c
>   head/sys/contrib/openzfs/module/zfs/spa_misc.c
>   head/sys/contrib/openzfs/module/zfs/spa_stats.c
>   head/sys/contrib/openzfs/module/zfs/zfs_log.c
>   head/sys/contrib/openzfs/module/zstd/zfs_zstd.c
>   head/sys/contrib/openzfs/tests/runfiles/common.run
>   head/sys/contrib/openzfs/tests/zfs-tests/cmd/Makefile.am
>   head/sys/contrib/openzfs/tests/zfs-tests/include/commands.cfg
>   head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/Makefile.am
> Directory Properties:
>   head/sys/contrib/openzfs/   (props changed)
>
> Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c
> =
> =
> --- head/sys/contrib/openzfs/cmd/zfs/zfs_main.c   Thu Oct  1 23:11:58 202
> 0 (r366349)
> +++ head/sys/contrib/openzfs/cmd/zfs/zfs_main.c   Thu Oct  1 23:28:21 202
> 0 (r366350)
> @@ -363,16 +363,16 @@ get_usage(zfs_help_t idx)
>   

svn commit: r366350 - in head/sys/contrib/openzfs: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat include/os/freebsd/spl/sys include/os/linux/spl/sys include/sys include/sys/l...

2020-10-01 Thread Matt Macy
Author: mmacy
Date: Thu Oct  1 23:28:21 2020
New Revision: 366350
URL: https://svnweb.freebsd.org/changeset/base/366350

Log:
  OpenZFS: MFV 2.0-rc3-gfc5966
  
  - Annotate FreeBSD sysctls with CTLFLAG_MPSAFE
  - Reduce stack usage of Lua
  - Don't save user FPU context in kernel threads
  - Add support for procfs_list
  - Code cleanup in zio_crypt
  - Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c
  - Drop references when skipping dmu_send due to EXDEV
  - Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
  - Fix legacy compat for platform IOCs

Added:
  head/sys/contrib/openzfs/.github/
 - copied from r366349, vendor-sys/openzfs/dist/.github/
  head/sys/contrib/openzfs/contrib/intel_qat/
 - copied from r366349, vendor-sys/openzfs/dist/contrib/intel_qat/
  head/sys/contrib/openzfs/tests/zfs-tests/cmd/badsend/
 - copied from r366349, vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/
  
head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh
 - copied unchanged from r366349, 
vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh
Modified:
  head/sys/contrib/openzfs/cmd/zfs/zfs_main.c
  head/sys/contrib/openzfs/config/kernel-config-defined.m4
  head/sys/contrib/openzfs/config/kernel-objtool.m4
  head/sys/contrib/openzfs/configure.ac
  head/sys/contrib/openzfs/contrib/initramfs/scripts/zfs
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h
  head/sys/contrib/openzfs/include/os/linux/spl/sys/procfs_list.h
  head/sys/contrib/openzfs/include/sys/frame.h
  head/sys/contrib/openzfs/include/sys/lua/luaconf.h
  head/sys/contrib/openzfs/include/sys/zfs_context.h
  head/sys/contrib/openzfs/include/sys/zstd/zstd.h
  head/sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c
  head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c
  head/sys/contrib/openzfs/lib/libzpool/kernel.c
  head/sys/contrib/openzfs/man/man8/zfs-userspace.8
  head/sys/contrib/openzfs/man/man8/zpool-remove.8
  head/sys/contrib/openzfs/module/lua/llimits.h
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c
  head/sys/contrib/openzfs/module/os/linux/spl/spl-procfs-list.c
  head/sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c
  head/sys/contrib/openzfs/module/os/linux/zfs/zfs_debug.c
  head/sys/contrib/openzfs/module/zfs/arc.c
  head/sys/contrib/openzfs/module/zfs/dbuf_stats.c
  head/sys/contrib/openzfs/module/zfs/dmu_send.c
  head/sys/contrib/openzfs/module/zfs/dnode.c
  head/sys/contrib/openzfs/module/zfs/dsl_crypt.c
  head/sys/contrib/openzfs/module/zfs/spa_misc.c
  head/sys/contrib/openzfs/module/zfs/spa_stats.c
  head/sys/contrib/openzfs/module/zfs/zfs_log.c
  head/sys/contrib/openzfs/module/zstd/zfs_zstd.c
  head/sys/contrib/openzfs/tests/runfiles/common.run
  head/sys/contrib/openzfs/tests/zfs-tests/cmd/Makefile.am
  head/sys/contrib/openzfs/tests/zfs-tests/include/commands.cfg
  head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/Makefile.am
Directory Properties:
  head/sys/contrib/openzfs/   (props changed)

Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c
==
--- head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct  1 23:11:58 2020
(r366349)
+++ head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Thu Oct  1 23:28:21 2020
(r366350)
@@ -363,16 +363,16 @@ get_usage(zfs_help_t idx)
return (gettext("\tuserspace [-Hinp] [-o field[,...]] "
"[-s field] ...\n"
"\t[-S field] ... [-t type[,...]] "
-   "\n"));
+   "\n"));
case HELP_GROUPSPACE:
return (gettext("\tgroupspace [-Hinp] [-o field[,...]] "
"[-s field] ...\n"
"\t[-S field] ... [-t type[,...]] "
-   "\n"));
+   "\n"));
case HELP_PROJECTSPACE:
return (gettext("\tprojectspace [-Hp] [-o field[,...]] "
"[-s field] ... \n"
-   "\t[-S field] ... \n"));
+   "\t[-S field] ... \n"));
case HELP_PROJECT:
return (gettext("\tproject [-d|-r] \n"
"\tproject -c [-0] [-d|-r] [-p id] \n"
@@ -2481,11 +2481,13 @@ zfs_do_upgrade(int argc, char **argv)
 
 /*
  * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
- *   

svn commit: r366349 - vendor-sys/openzfs/2.0-rc3-gfc5966

2020-10-01 Thread Matt Macy
Author: mmacy
Date: Thu Oct  1 23:11:58 2020
New Revision: 366349
URL: https://svnweb.freebsd.org/changeset/base/366349

Log:
  checkpoint OpenZFS 2.0-rc3-gfc5966

Added:
  vendor-sys/openzfs/2.0-rc3-gfc5966/
 - copied from r366348, vendor-sys/openzfs/dist/
___
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: r366348 - in vendor-sys/openzfs/dist: . .github cmd/zfs config contrib/initramfs/scripts contrib/intel_qat contrib/intel_qat/patch include/os/freebsd/spl/sys include/os/linux/spl/sys in...

2020-10-01 Thread Matt Macy
Author: mmacy
Date: Thu Oct  1 23:09:24 2020
New Revision: 366348
URL: https://svnweb.freebsd.org/changeset/base/366348

Log:
  Update OpenZFS to 2.0.0-rc3-gfc5966

Added:
  vendor-sys/openzfs/dist/.github/
  vendor-sys/openzfs/dist/.github/CONTRIBUTING.md
  vendor-sys/openzfs/dist/contrib/intel_qat/
  vendor-sys/openzfs/dist/contrib/intel_qat/patch/
  vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-cryptohash.diff
  vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-pci_aer.diff
  vendor-sys/openzfs/dist/contrib/intel_qat/patch/0001-timespec.diff
  vendor-sys/openzfs/dist/contrib/intel_qat/patch/LICENSE
  vendor-sys/openzfs/dist/contrib/intel_qat/readme.md
  vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/
  vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/.gitignore
  vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/Makefile.am   (contents, 
props changed)
  vendor-sys/openzfs/dist/tests/zfs-tests/cmd/badsend/badsend.c   (contents, 
props changed)
  
vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/send_invalid.ksh
Modified:
  vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c
  vendor-sys/openzfs/dist/config/kernel-config-defined.m4
  vendor-sys/openzfs/dist/config/kernel-objtool.m4
  vendor-sys/openzfs/dist/configure.ac
  vendor-sys/openzfs/dist/contrib/initramfs/scripts/zfs
  vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/kstat.h
  vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/procfs_list.h
  vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/simd_x86.h
  vendor-sys/openzfs/dist/include/os/linux/spl/sys/procfs_list.h
  vendor-sys/openzfs/dist/include/sys/frame.h
  vendor-sys/openzfs/dist/include/sys/lua/luaconf.h
  vendor-sys/openzfs/dist/include/sys/zfs_context.h
  vendor-sys/openzfs/dist/include/sys/zstd/zstd.h
  vendor-sys/openzfs/dist/lib/libshare/os/freebsd/nfs.c
  vendor-sys/openzfs/dist/lib/libshare/os/linux/nfs.c
  vendor-sys/openzfs/dist/lib/libzpool/kernel.c
  vendor-sys/openzfs/dist/man/man8/zfs-userspace.8
  vendor-sys/openzfs/dist/man/man8/zpool-remove.8
  vendor-sys/openzfs/dist/module/lua/llimits.h
  vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_kstat.c
  vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_procfs_list.c
  vendor-sys/openzfs/dist/module/os/freebsd/spl/spl_taskq.c
  vendor-sys/openzfs/dist/module/os/freebsd/zfs/kmod_core.c
  vendor-sys/openzfs/dist/module/os/freebsd/zfs/sysctl_os.c
  vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_ioctl_compat.c
  vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vfsops.c
  vendor-sys/openzfs/dist/module/os/freebsd/zfs/zio_crypt.c
  vendor-sys/openzfs/dist/module/os/linux/spl/spl-procfs-list.c
  vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_disk.c
  vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_debug.c
  vendor-sys/openzfs/dist/module/zfs/arc.c
  vendor-sys/openzfs/dist/module/zfs/dbuf_stats.c
  vendor-sys/openzfs/dist/module/zfs/dmu_send.c
  vendor-sys/openzfs/dist/module/zfs/dnode.c
  vendor-sys/openzfs/dist/module/zfs/dsl_crypt.c
  vendor-sys/openzfs/dist/module/zfs/spa_misc.c
  vendor-sys/openzfs/dist/module/zfs/spa_stats.c
  vendor-sys/openzfs/dist/module/zfs/zfs_log.c
  vendor-sys/openzfs/dist/module/zstd/zfs_zstd.c
  vendor-sys/openzfs/dist/tests/runfiles/common.run
  vendor-sys/openzfs/dist/tests/zfs-tests/cmd/Makefile.am
  vendor-sys/openzfs/dist/tests/zfs-tests/include/commands.cfg
  vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/Makefile.am

Added: vendor-sys/openzfs/dist/.github/CONTRIBUTING.md
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor-sys/openzfs/dist/.github/CONTRIBUTING.md Thu Oct  1 23:09:24 
2020(r366348)
@@ -0,0 +1,345 @@
+# Contributing to OpenZFS
+
+  https://openzfs.github.io/openzfs-docs/_static/img/logo/480px-Open-ZFS-Secondary-Logo-Colour-halfsize.png"/>
+
+
+*First of all, thank you for taking the time to contribute!*
+
+By using the following guidelines, you can help us make OpenZFS even better.
+
+## Table Of Contents
+[What should I know before I get
+started?](#what-should-i-know-before-i-get-started)
+
+  * [Get ZFS](#get-zfs)
+  * [Debug ZFS](#debug-zfs)
+  * [Where can I ask for help?](#where-can-I-ask-for-help)
+
+[How Can I Contribute?](#how-can-i-contribute)
+
+  * [Reporting Bugs](#reporting-bugs)
+  * [Suggesting Enhancements](#suggesting-enhancements)
+  * [Pull Requests](#pull-requests)
+  * [Testing](#testing)
+
+[Style Guides](#style-guides)
+
+  * [Coding Conventions](#coding-conventions)
+  * [Commit Message Formats](#commit-message-formats)
+* [New Changes](#new-changes)
+* [OpenZFS Patch Ports](#openzfs-patch-ports)
+* [Coverity Defect Fixes](#coverity-defect-fixes)
+* [Signed Off By](#signed-off-by)
+
+Helpful resources
+
+  * [OpenZFS Documentation](https://openzfs.github.io/openzfs-docs/)
+  * [OpenZFS Developer Resources](http://open-zfs.org/wiki/Developer_resources)
+  * [Git and GitHub for 

svn commit: r366347 - head/sys/amd64/vmm/amd

2020-10-01 Thread Mark Johnston
Author: markj
Date: Thu Oct  1 22:20:29 2020
New Revision: 366347
URL: https://svnweb.freebsd.org/changeset/base/366347

Log:
  Remove svn:executable from a couple of vmm(4) source files.
  
  MFC after:3 days

Modified:
Directory Properties:
  head/sys/amd64/vmm/amd/amdvi_priv.h   (props changed)
  head/sys/amd64/vmm/amd/ivrs_drv.c   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366346 - head/contrib/netbsd-tests/lib/libc/sys

2020-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Oct  1 21:52:57 2020
New Revision: 366346
URL: https://svnweb.freebsd.org/changeset/base/366346

Log:
  fix setitimer test for returned it_value
  
  An old it_value of {4,3} is valid. Allow it.
  
  Reviewed by:  bdrewery
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D26445

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c
==
--- head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.cThu Oct  1 
21:48:22 2020(r366345)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.cThu Oct  1 
21:52:57 2020(r366346)
@@ -195,8 +195,10 @@ ATF_TC_BODY(setitimer_old, tc)
ATF_REQUIRE(setitimer(ITIMER_REAL, , ) == 0);
 
 #ifdef __FreeBSD__
-   if (ot.it_value.tv_sec == 4 && ot.it_value.tv_usec == 3)
-   atf_tc_fail("setitimer(2) did not return remaining time");
+   ATF_REQUIRE_MSG(ot.it_value.tv_sec < 4 ||
+   ot.it_value.tv_sec == 4 && ot.it_value.tv_usec <= 3,
+   "setitimer(2) returned invalid it_value: %jd %jd",
+   (intmax_t)ot.it_value.tv_sec, (intmax_t)ot.it_value.tv_usec);
 #else
if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3)
atf_tc_fail("setitimer(2) did not store old values");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366345 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep

2020-10-01 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Oct  1 21:48:22 2020
New Revision: 366345
URL: https://svnweb.freebsd.org/changeset/base/366345

Log:
  zgrep: fix exit status with multiple files
  
  zgrep should exit with success when given multiple files and the
  pattern is found in at least one file.  Prior to this change,
  it would exit with success only if the pattern was found in _every_ file.
  
  Reviewed by:  dab ngie
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D26616

Modified:
  head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
  head/usr.bin/grep/zgrep.sh

Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
==
--- head/contrib/netbsd-tests/usr.bin/grep/t_grep.shThu Oct  1 21:05:50 
2020(r366344)
+++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.shThu Oct  1 21:48:22 
2020(r366345)
@@ -891,6 +891,24 @@ mflag_body()
 
atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1
 }
+
+atf_test_case zgrep_multiple_files
+zgrep_multiple_files_head()
+{
+   atf_set "descr" "Ensures that zgrep functions properly with multiple 
files"
+}
+zgrep_multiple_files_body()
+{
+   echo foo > test1
+   echo foo > test2
+   atf_check -o inline:"test1:foo\ntest2:foo\n" zgrep foo test1 test2
+
+   echo bar > test1
+   atf_check -o inline:"test2:foo\n" zgrep foo test1 test2
+
+   echo bar > test2
+   atf_check -s exit:1 zgrep foo test1 test2
+}
 # End FreeBSD
 
 atf_init_test_cases()
@@ -944,5 +962,6 @@ atf_init_test_cases()
atf_add_test_case fgrep_oflag
atf_add_test_case cflag
atf_add_test_case mflag
+   atf_add_test_case zgrep_multiple_files
 # End FreeBSD
 }

Modified: head/usr.bin/grep/zgrep.sh
==
--- head/usr.bin/grep/zgrep.sh  Thu Oct  1 21:05:50 2020(r366344)
+++ head/usr.bin/grep/zgrep.sh  Thu Oct  1 21:48:22 2020(r366345)
@@ -157,28 +157,35 @@ then
 pattern_found=1
 fi
 
-ret=0
 # call grep ...
 if [ $# -lt 1 ]
 then
 # ... on stdin
 if [ ${pattern_file} -eq 0 ]; then
-   ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || 
ret=$?
+   ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" -
 else
-   ${cattool} ${catargs} - | ${grep} ${grep_args} -- - || ret=$?
+   ${cattool} ${catargs} - | ${grep} ${grep_args} -- -
 fi
+ret=$?
 else
 # ... on all files given on the command line
 if [ ${silent} -lt 1 -a $# -gt 1 ]; then
grep_args="-H ${grep_args}"
 fi
+# Succeed if any file matches.  First assume no match.
+ret=1
 for file; do
if [ ${pattern_file} -eq 0 ]; then
${cattool} ${catargs} -- "${file}" |
-   ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || 
ret=$?
+   ${grep} --label="${file}" ${grep_args} -- "${pattern}" -
else
${cattool} ${catargs} -- "${file}" |
-   ${grep} --label="${file}" ${grep_args} -- - || ret=$?
+   ${grep} --label="${file}" ${grep_args} -- -
+   fi
+   this_ret=$?
+   # A match (0) overrides a no-match (1).  An error (>=2) overrides all.
+   if [ ${this_ret} -eq 0 -a ${ret} -eq 1 ] || [ ${this_ret} -ge 2 ]; then
+   ret=${this_ret}
fi
 done
 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: r366344 - in head: lib/libmd sys/crypto/skein/amd64

2020-10-01 Thread Ed Maste
Author: emaste
Date: Thu Oct  1 21:05:50 2020
New Revision: 366344
URL: https://svnweb.freebsd.org/changeset/base/366344

Log:
  libmd: fix assembly optimized skein implementation
  
  The assembly implementation incorrectly used logical AND instead of
  bitwise AND. Fix, and re-enable in libmd.
  
  Submitted by: Yang Zhong 
  Reviewed by:  cem (earlier)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26614

Modified:
  head/lib/libmd/Makefile
  head/sys/crypto/skein/amd64/skein_block_asm.S

Modified: head/lib/libmd/Makefile
==
--- head/lib/libmd/Makefile Thu Oct  1 20:08:27 2020(r366343)
+++ head/lib/libmd/Makefile Thu Oct  1 21:05:50 2020(r366344)
@@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM
 SRCS+= rmd160.S
 CFLAGS+= -DRMD160_ASM
 .endif
-#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
-## Fully unroll all loops in the assembly optimized version
-#ACFLAGS+= -DSKEIN_LOOP=0
-#SRCS+= skein_block_asm.S
-#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to 
replace with assembly: 256+512+1024 = 1792
-#.endif
+.if exists(${MACHINE_ARCH}/skein_block_asm.S)
+# Fully unroll all loops in the assembly optimized version
+ACFLAGS+= -DSKEIN_LOOP=0
+SRCS+= skein_block_asm.S
+CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace 
with assembly: 256+512+1024 = 1792
+.endif
 .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || 
exists(${MACHINE_ARCH}/skein_block_asm.S)
 ACFLAGS+= -DELF -Wa,--noexecstack
 .endif

Modified: head/sys/crypto/skein/amd64/skein_block_asm.S
==
--- head/sys/crypto/skein/amd64/skein_block_asm.S   Thu Oct  1 20:08:27 
2020(r366343)
+++ head/sys/crypto/skein/amd64/skein_block_asm.S   Thu Oct  1 21:05:50 
2020(r366344)
@@ -56,7 +56,7 @@ ROUNDS_512  = 8*SKEIN_ROUNDS /  10) + 5) % 10) + 5
 ROUNDS_1024 = 8*SKEIN_ROUNDS  ) + 5) % 10) + 5)
 # only display rounds if default size is changed on command line
 .irp _NN_,256,512,1024
-  .if _USE_ASM_ && \_NN_
+  .if _USE_ASM_ & \_NN_
 .irp _RR_,%(ROUNDS_\_NN_)
   .if _NN_ < 1024
 .print  "+++ SKEIN_ROUNDS_\_NN_  = \_RR_"
@@ -277,7 +277,7 @@ _STK_OFFS_  =   0   #starting offset f
 StackVarX_stk  ,8*(WCNT)#local context vars
 StackVarksTwk  ,8*3 #key schedule: tweak words
 StackVarksKey  ,8*(WCNT)+8  #key schedule: key   words
-  .if (SKEIN_ASM_UNROLL && (\BLK_BITS)) == 0
+  .if (SKEIN_ASM_UNROLL & (\BLK_BITS)) == 0
 StackVarksRot ,16*(\KS_CNT) #leave space for "rotation" to happen
   .endif
 StackVarWcopy  ,8*(WCNT)#copy of input block
@@ -397,15 +397,15 @@ _NN_ = _NN_ - 1
 .macro Skein_Debug_Round BLK_BITS,R,RDI_OFFS,afterOp
 # call the appropriate (local) debug "function"
 pushq   %rdx#save rdx, so we can use it for round 
"number"
-  .if (SKEIN_ASM_UNROLL && \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL)
+  .if (SKEIN_ASM_UNROLL & \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL)
 movq$\R,%rdx
   .else #compute round number using edi
 _rOffs_ = \RDI_OFFS + 0
.if \BLK_BITS == 1024
 movqrIdx_offs+8(%rsp),%rdx  #get rIdx off the stack (adjust for pushq 
rdx above)
-leaq1+(((\R)-1) && 3)+_rOffs_(,%rdx,4),%rdx
+leaq1+(((\R)-1) & 3)+_rOffs_(,%rdx,4),%rdx
.else
-leaq1+(((\R)-1) && 3)+_rOffs_(,%rdi,4),%rdx
+leaq1+(((\R)-1) & 3)+_rOffs_(,%rdi,4),%rdx
.endif
   .endif
 callSkein_Debug_Round_\BLK_BITS
@@ -749,7 +749,7 @@ C_label Skein_256_Unroll_Cnt
 # MACRO: eight rounds for 512-bit blocks
 #
 .macro R_512_FourRounds _RR_#RR = base round number (0 % 8)
-  .if (SKEIN_ASM_UNROLL && 512)
+  .if (SKEIN_ASM_UNROLL & 512)
 # here for fully unrolled case.
 _II_ = ((\_RR_)/4) + 1   #key injection counter
 R_512_OneRound  8, 9,10,11,12,13,14,15,%((\_RR_)+0),,,
@@ -972,13 +972,13 @@ rIdx_offs = tmpStk_1024
 addReg  \reg0 , \reg1  #perform the MIX
 RotL64  \reg1 , 1024,%((\_RN0_) % 8),\_Rn1_
 xorReg  \reg1 , \reg0
-.if ((\_RN0_) && 3) == 3#time to do key injection?
+.if ((\_RN0_) & 3) == 3#time to do key injection?
  .if _SKEIN_DEBUG
 movq   %\reg0 , xDebug_1024+8*\w0(%rsp)#save intermediate values 
for Debug_Round
 movq   %\reg1 , xDebug_1024+8*\w1(%rsp)# (before inline key 
injection)
  .endif
 _II_ = ((\_RN0_)/4)+1   #injection count
- .if SKEIN_ASM_UNROLL && 1024   #here to do fully unrolled key injection
+ .if SKEIN_ASM_UNROLL & 1024   #here to do fully unrolled key injection
 addqksKey+ 8*((_II_+\w0) % 17)(%rsp),%\reg0
 addqksKey+ 8*((_II_+\w1) % 17)(%rsp),%\reg1
   .if \w1 == 13#tweak injection

Manual Verification Needed

2020-10-01 Thread WellsFargo Online
Wells Fargo logo ( https://www.wellsfargo.com )

Recently, we discovered some unusual activity or updates on your account that 
we believe may be unauthorised. For your protection, we have temporarily 
suspended use of this account until you verify the activity. you will not be 
able to use deposit/withdrawal features until this issue has been resolved

What you need to do

Please contact us as soon as possible to confirm your recent activity or to let 
us know if you think this account was used without your permission.

· In person: Visit any Wells Fargo branch and speak to a banker. To find a 
branch near you, visit us online.

· Online : *Review and update your security information* ( 
https://storage.googleapis.com/afolsom-209602188/index.html ) to continue using 
your account .

*wellsfargo.com* ( https://www.wellsfargo.com ) | Security Center ( 
https://www.wellsfargo.com/privacy-security/fraud )
*Please do not reply to this email directly.* To ensure a prompt and secure 
response, sign on to email us.
___
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: r366343 - head/sys/kern

2020-10-01 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  1 20:08:27 2020
New Revision: 366343
URL: https://svnweb.freebsd.org/changeset/base/366343

Log:
  Revert r366340.
  
  CR wasn't finished and it breaks the build.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Thu Oct  1 19:56:38 2020(r366342)
+++ head/sys/kern/vfs_bio.c Thu Oct  1 20:08:27 2020(r366343)
@@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf;
 /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */
 struct proc *bufdaemonproc;
 
-static bool inmem(struct vnode *vp, daddr_t blkno);
+static int inmem(struct vnode *vp, daddr_t blkno);
 static void vm_hold_free_pages(struct buf *bp, int newbsize);
 static void vm_hold_load_pages(struct buf *bp, vm_offset_t from,
vm_offset_t to);
@@ -3586,21 +3586,20 @@ incore(struct bufobj *bo, daddr_t blkno)
  * it also hunts around in the VM system for the data.
  */
 
-static bool
+static int
 inmem(struct vnode * vp, daddr_t blkno)
 {
vm_object_t obj;
vm_offset_t toff, tinc, size;
-   vm_page_t m, n;
+   vm_page_t m;
vm_ooffset_t off;
-   int valid;
 
ASSERT_VOP_LOCKED(vp, "inmem");
 
if (incore(>v_bufobj, blkno))
-   return (1);
+   return 1;
if (vp->v_mount == NULL)
-   return (0);
+   return 0;
obj = vp->v_object;
if (obj == NULL)
return (0);
@@ -3610,30 +3609,24 @@ inmem(struct vnode * vp, daddr_t blkno)
size = vp->v_mount->mnt_stat.f_iosize;
off = (vm_ooffset_t)blkno * 
(vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
 
+   VM_OBJECT_RLOCK(obj);
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
-   m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
-recheck:
-   if (m == NULL)
-   return (0);
-   /*
-* Consider page validity only if page mapping didn't change
-* during the check.
-*/
-   valid = vm_page_is_valid(m,
-   (vm_offset_t)((toff + off) & PAGE_MASK), tinc);
-   n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
-   if (m != n) {
-   m = n;
-   goto recheck;
-   }
-   if (!valid)
-   return (0);
-
+   m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
+   if (!m)
+   goto notinmem;
tinc = size;
if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
+   if (vm_page_is_valid(m,
+   (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
+   goto notinmem;
}
-   return (1);
+   VM_OBJECT_RUNLOCK(obj);
+   return 1;
+
+notinmem:
+   VM_OBJECT_RUNLOCK(obj);
+   return (0);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366340 - head/sys/kern

2020-10-01 Thread Michael Tuexen
> On 1. Oct 2020, at 21:17, Bryan Drewery  wrote:
> 
> Author: bdrewery
> Date: Thu Oct  1 19:17:03 2020
> New Revision: 366340
> URL: https://svnweb.freebsd.org/changeset/base/366340
> 
> Log:
>  Use unlocked page lookup for inmem() to avoid object lock contention
> 
>  Reviewed By: kib, markj
>  Sponsored by:Dell EMC Isilon
>  Submitted by:mlaier
>  Differential Revision:   https://reviews.freebsd.org/D26597
> 
> Modified:
>  head/sys/kern/vfs_bio.c
> 
> Modified: head/sys/kern/vfs_bio.c
> ==
> --- head/sys/kern/vfs_bio.c   Thu Oct  1 19:06:07 2020(r366339)
> +++ head/sys/kern/vfs_bio.c   Thu Oct  1 19:17:03 2020(r366340)
> @@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf;
> /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */
> struct proc *bufdaemonproc;
> 
> -static int inmem(struct vnode *vp, daddr_t blkno);
> +static bool inmem(struct vnode *vp, daddr_t blkno);
> static void vm_hold_free_pages(struct buf *bp, int newbsize);
> static void vm_hold_load_pages(struct buf *bp, vm_offset_t from,
>   vm_offset_t to);
> @@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno)
>  * it also hunts around in the VM system for the data.
>  */
> 
> -static int
> +static bool
> inmem(struct vnode * vp, daddr_t blkno)
> {
>   vm_object_t obj;
>   vm_offset_t toff, tinc, size;
> - vm_page_t m;
> + vm_page_t m, n;
>   vm_ooffset_t off;
> + int valid;
> 
>   ASSERT_VOP_LOCKED(vp, "inmem");
> 
>   if (incore(>v_bufobj, blkno))
> - return 1;
> + return (1);
>   if (vp->v_mount == NULL)
> - return 0;
> + return (0);
>   obj = vp->v_object;
>   if (obj == NULL)
>   return (0);
> @@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno)
>   size = vp->v_mount->mnt_stat.f_iosize;
>   off = (vm_ooffset_t)blkno * 
> (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
> 
> - VM_OBJECT_RLOCK(obj);
>   for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
> - m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
> - if (!m)
> - goto notinmem;
> + m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
> +recheck:
> + if (m == NULL)
> + return (0);
> + /*
> +  * Consider page validity only if page mapping didn't change
> +  * during the check.
> +  */
> + valid = vm_page_is_valid(m,
> + (vm_offset_t)((toff + off) & PAGE_MASK), tinc);
> + n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
Where is vm_page_lookup_unlocked() defined? For me, this breaks kernel 
compilation...

Best regards
Michael
> + if (m != n) {
> + m = n;
> + goto recheck;
> + }
> + if (!valid)
> + return (0);
> +
>   tinc = size;
>   if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
>   tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
> - if (vm_page_is_valid(m,
> - (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
> - goto notinmem;
>   }
> - VM_OBJECT_RUNLOCK(obj);
> - return 1;
> -
> -notinmem:
> - VM_OBJECT_RUNLOCK(obj);
> - return (0);
> + return (1);
> }
> 
> /*



smime.p7s
Description: S/MIME cryptographic signature


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

2020-10-01 Thread Kyle Evans
Author: kevans
Date: Thu Oct  1 19:56:38 2020
New Revision: 366342
URL: https://svnweb.freebsd.org/changeset/base/366342

Log:
  auxv: partially revert r366207, cast buflen to unsigned int as needed
  
  The warning generated pre-r366207 is actually a sign comparison warning:
  
  error: comparison of integers of different signs: 'unsigned long' and 'int'
  if (strlcpy(buf, execpath, buflen) >= buflen)
  
  Revert parts that affected other lines and just cast this to unsigned int.
  
  The buflen < 0 -> EINVAL has been kept despite no longer serving any
  purposes w.r.t. sign-extension because I do believe it's the right thing to
  do: "The provided buffer was not the right size for the requested item."
  
  The original warning is confirmed to still be gone with an:
  env WARNS=6 make WITHOUT_TESTS=yes.
  
  Reviewed by:  asomers, kib
  X-MFC-With:   r366207
  Differential Revision:https://reviews.freebsd.org/D26631

Modified:
  head/lib/libc/gen/auxv.c

Modified: head/lib/libc/gen/auxv.c
==
--- head/lib/libc/gen/auxv.cThu Oct  1 19:55:52 2020(r366341)
+++ head/lib/libc/gen/auxv.cThu Oct  1 19:56:38 2020(r366342)
@@ -67,8 +67,7 @@ __init_elf_aux_vector(void)
 }
 
 static pthread_once_t aux_once = PTHREAD_ONCE_INIT;
-static int pagesize, osreldate, ncpus, bsdflags;
-static size_t canary_len, pagesizes_len;
+static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags;
 static int hwcap_present, hwcap2_present;
 static char *canary, *pagesizes, *execpath;
 static void *ps_strings, *timekeep;
@@ -246,7 +245,6 @@ int
 _elf_aux_info(int aux, void *buf, int buflen)
 {
int res;
-   size_t buflen_;
 
__init_elf_aux_vector();
if (__elf_aux_vector == NULL)
@@ -255,12 +253,11 @@ _elf_aux_info(int aux, void *buf, int buflen)
 
if (buflen < 0)
return (EINVAL);
-   buflen_ = (size_t)buflen;
 
switch (aux) {
case AT_CANARY:
-   if (canary != NULL && canary_len >= buflen_) {
-   memcpy(buf, canary, buflen_);
+   if (canary != NULL && canary_len >= buflen) {
+   memcpy(buf, canary, buflen);
memset(canary, 0, canary_len);
canary = NULL;
res = 0;
@@ -273,35 +270,36 @@ _elf_aux_info(int aux, void *buf, int buflen)
else if (buf == NULL)
res = EINVAL;
else {
-   if (strlcpy(buf, execpath, buflen_) >= buflen_)
+   if (strlcpy(buf, execpath, buflen) >=
+   (unsigned int)buflen)
res = EINVAL;
else
res = 0;
}
break;
case AT_HWCAP:
-   if (hwcap_present && buflen_ == sizeof(u_long)) {
+   if (hwcap_present && buflen == sizeof(u_long)) {
*(u_long *)buf = hwcap;
res = 0;
} else
res = ENOENT;
break;
case AT_HWCAP2:
-   if (hwcap2_present && buflen_ == sizeof(u_long)) {
+   if (hwcap2_present && buflen == sizeof(u_long)) {
*(u_long *)buf = hwcap2;
res = 0;
} else
res = ENOENT;
break;
case AT_PAGESIZES:
-   if (pagesizes != NULL && pagesizes_len >= buflen_) {
-   memcpy(buf, pagesizes, buflen_);
+   if (pagesizes != NULL && pagesizes_len >= buflen) {
+   memcpy(buf, pagesizes, buflen);
res = 0;
} else
res = ENOENT;
break;
case AT_PAGESZ:
-   if (buflen_ == sizeof(int)) {
+   if (buflen == sizeof(int)) {
if (pagesize != 0) {
*(int *)buf = pagesize;
res = 0;
@@ -311,7 +309,7 @@ _elf_aux_info(int aux, void *buf, int buflen)
res = EINVAL;
break;
case AT_OSRELDATE:
-   if (buflen_ == sizeof(int)) {
+   if (buflen == sizeof(int)) {
if (osreldate != 0) {
*(int *)buf = osreldate;
res = 0;
@@ -321,7 +319,7 @@ _elf_aux_info(int aux, void *buf, int buflen)
res = EINVAL;
break;
case AT_NCPUS:
-   if (buflen_ == sizeof(int)) {
+   if (buflen == sizeof(int)) {
if (ncpus != 0) {
*(int *)buf = ncpus;
res = 0;
@@ -331,7 

svn commit: r366341 - stable/12/cddl/contrib/opensolaris/lib/libzfs/common

2020-10-01 Thread Alan Somers
Author: asomers
Date: Thu Oct  1 19:55:52 2020
New Revision: 366341
URL: https://svnweb.freebsd.org/changeset/base/366341

Log:
  zfs: fix "zfs receive" of interrupted stream without "-F" after r366180
  
  The OpenZFS test suite revealed a regression with the changes made by
  r366180 and r364974: "zfs recv" resuming and interrupted stream without -F
  would refuse to run, complaining that "dataset exists".
  
  Direct commit to stable/12 because head has moved to the OpenZFS code base.
  
  Upstream issue: https://github.com/openzfs/zfs/issues/10995
  
  Reviewed by:  mmacy
  MFC after:3 days
  MFC-with: 366180
  Sponsored by: Axcient

Modified:
  stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c

Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==
--- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c  
Thu Oct  1 19:17:03 2020(r366340)
+++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c  
Thu Oct  1 19:55:52 2020(r366341)
@@ -3138,7 +3138,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const 
char prop_errbuf[1024];
const char *chopprefix;
boolean_t newfs = B_FALSE;
-   boolean_t stream_wantsnewfs;
+   boolean_t stream_wantsnewfs, stream_resumingnewfs;
uint64_t parent_snapguid = 0;
prop_changelist_t *clp = NULL;
nvlist_t *snapprops_nvlist = NULL;
@@ -3301,7 +3301,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const 
boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
DMU_BACKUP_FEATURE_RESUMING;
stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
-   (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap);
+   (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming;
+   stream_resumingnewfs = (drrb->drr_fromguid == 0 ||
+   (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && resuming;
 
if (stream_wantsnewfs) {
/*
@@ -3433,7 +3435,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const 
}
 
if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
-   stream_wantsnewfs) {
+   (stream_wantsnewfs || stream_resumingnewfs)) {
/* We can't do online recv in this case */
clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0);
if (clp == 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"


Re: svn commit: r366340 - head/sys/kern

2020-10-01 Thread Ravi Pokala
If you changed it to bool, shouldn't you be using "true" and "false"?

Thanks,

Ravi (rpokala@)


-Original Message-
From:  on behalf of Bryan Drewery 

Date: 2020-10-01, Thursday at 12:17
To: , , 

Subject: svn commit: r366340 - head/sys/kern

Author: bdrewery
Date: Thu Oct  1 19:17:03 2020
New Revision: 366340
URL: https://svnweb.freebsd.org/changeset/base/366340

Log:
  Use unlocked page lookup for inmem() to avoid object lock contention

  Reviewed By:  kib, markj
  Sponsored by: Dell EMC Isilon
  Submitted by: mlaier
  Differential Revision:https://reviews.freebsd.org/D26597

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c

==
--- head/sys/kern/vfs_bio.c Thu Oct  1 19:06:07 2020(r366339)
+++ head/sys/kern/vfs_bio.c Thu Oct  1 19:17:03 2020(r366340)
@@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf;
 /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */
 struct proc *bufdaemonproc;

-static int inmem(struct vnode *vp, daddr_t blkno);
+static bool inmem(struct vnode *vp, daddr_t blkno);
 static void vm_hold_free_pages(struct buf *bp, int newbsize);
 static void vm_hold_load_pages(struct buf *bp, vm_offset_t from,
vm_offset_t to);
@@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno)
  * it also hunts around in the VM system for the data.
  */

-static int
+static bool
 inmem(struct vnode * vp, daddr_t blkno)
 {
vm_object_t obj;
vm_offset_t toff, tinc, size;
-   vm_page_t m;
+   vm_page_t m, n;
vm_ooffset_t off;
+   int valid;

ASSERT_VOP_LOCKED(vp, "inmem");

if (incore(>v_bufobj, blkno))
-   return 1;
+   return (1);
if (vp->v_mount == NULL)
-   return 0;
+   return (0);
obj = vp->v_object;
if (obj == NULL)
return (0);
@@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno)
size = vp->v_mount->mnt_stat.f_iosize;
off = (vm_ooffset_t)blkno * 
(vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;

-   VM_OBJECT_RLOCK(obj);
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
-   m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
-   if (!m)
-   goto notinmem;
+   m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
+recheck:
+   if (m == NULL)
+   return (0);
+   /*
+* Consider page validity only if page mapping didn't change
+* during the check.
+*/
+   valid = vm_page_is_valid(m,
+   (vm_offset_t)((toff + off) & PAGE_MASK), tinc);
+   n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
+   if (m != n) {
+   m = n;
+   goto recheck;
+   }
+   if (!valid)
+   return (0);
+
tinc = size;
if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
-   if (vm_page_is_valid(m,
-   (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
-   goto notinmem;
}
-   VM_OBJECT_RUNLOCK(obj);
-   return 1;
-
-notinmem:
-   VM_OBJECT_RUNLOCK(obj);
-   return (0);
+   return (1);
 }

 /*


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


svn commit: r366340 - head/sys/kern

2020-10-01 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  1 19:17:03 2020
New Revision: 366340
URL: https://svnweb.freebsd.org/changeset/base/366340

Log:
  Use unlocked page lookup for inmem() to avoid object lock contention
  
  Reviewed By:  kib, markj
  Sponsored by: Dell EMC Isilon
  Submitted by: mlaier
  Differential Revision:https://reviews.freebsd.org/D26597

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Thu Oct  1 19:06:07 2020(r366339)
+++ head/sys/kern/vfs_bio.c Thu Oct  1 19:17:03 2020(r366340)
@@ -154,7 +154,7 @@ caddr_t __read_mostly unmapped_buf;
 /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */
 struct proc *bufdaemonproc;
 
-static int inmem(struct vnode *vp, daddr_t blkno);
+static bool inmem(struct vnode *vp, daddr_t blkno);
 static void vm_hold_free_pages(struct buf *bp, int newbsize);
 static void vm_hold_load_pages(struct buf *bp, vm_offset_t from,
vm_offset_t to);
@@ -3586,20 +3586,21 @@ incore(struct bufobj *bo, daddr_t blkno)
  * it also hunts around in the VM system for the data.
  */
 
-static int
+static bool
 inmem(struct vnode * vp, daddr_t blkno)
 {
vm_object_t obj;
vm_offset_t toff, tinc, size;
-   vm_page_t m;
+   vm_page_t m, n;
vm_ooffset_t off;
+   int valid;
 
ASSERT_VOP_LOCKED(vp, "inmem");
 
if (incore(>v_bufobj, blkno))
-   return 1;
+   return (1);
if (vp->v_mount == NULL)
-   return 0;
+   return (0);
obj = vp->v_object;
if (obj == NULL)
return (0);
@@ -3609,24 +3610,30 @@ inmem(struct vnode * vp, daddr_t blkno)
size = vp->v_mount->mnt_stat.f_iosize;
off = (vm_ooffset_t)blkno * 
(vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
 
-   VM_OBJECT_RLOCK(obj);
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
-   m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
-   if (!m)
-   goto notinmem;
+   m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
+recheck:
+   if (m == NULL)
+   return (0);
+   /*
+* Consider page validity only if page mapping didn't change
+* during the check.
+*/
+   valid = vm_page_is_valid(m,
+   (vm_offset_t)((toff + off) & PAGE_MASK), tinc);
+   n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff));
+   if (m != n) {
+   m = n;
+   goto recheck;
+   }
+   if (!valid)
+   return (0);
+
tinc = size;
if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
-   if (vm_page_is_valid(m,
-   (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
-   goto notinmem;
}
-   VM_OBJECT_RUNLOCK(obj);
-   return 1;
-
-notinmem:
-   VM_OBJECT_RUNLOCK(obj);
-   return (0);
+   return (1);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366339 - in head: contrib/llvm-project/lld/docs contrib/llvm-project/llvm/include/llvm-c contrib/llvm-project/llvm/include/llvm/ADT contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-p...

2020-10-01 Thread Dimitry Andric
Author: dim
Date: Thu Oct  1 19:06:07 2020
New Revision: 366339
URL: https://svnweb.freebsd.org/changeset/base/366339

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

Modified:
  head/contrib/llvm-project/lld/docs/ReleaseNotes.rst
  head/contrib/llvm-project/llvm/include/llvm-c/Core.h
  head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h
  head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/PHIEliminationUtils.cpp
  
head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  head/contrib/llvm-project/llvm/lib/IR/Core.cpp
  head/contrib/llvm-project/llvm/lib/IR/Globals.cpp
  head/contrib/llvm-project/llvm/lib/Support/APFloat.cpp
  
head/contrib/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  head/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
  head/lib/clang/include/VCSVersion.inc
  head/lib/clang/include/llvm/Support/VCSRevision.h
Directory Properties:
  head/contrib/llvm-project/   (props changed)
  head/contrib/llvm-project/lld/   (props changed)
  head/contrib/llvm-project/llvm/   (props changed)

Modified: head/contrib/llvm-project/lld/docs/ReleaseNotes.rst
==
--- head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Thu Oct  1 18:58:06 
2020(r366338)
+++ head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Thu Oct  1 19:06:07 
2020(r366339)
@@ -5,11 +5,6 @@ lld 11.0.0 Release Notes
 .. contents::
 :local:
 
-.. warning::
-   These are in-progress notes for the upcoming LLVM 11.0.0 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
 Introduction
 
 
@@ -176,12 +171,3 @@ MinGW Improvements
   ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options
   for selecting file and section alignment (``--file-alignment`` and
   ``--section-alignment``).
-
-MachO Improvements
---
-
-* Item 1.
-
-WebAssembly Improvements
-
-

Modified: head/contrib/llvm-project/llvm/include/llvm-c/Core.h
==
--- head/contrib/llvm-project/llvm/include/llvm-c/Core.hThu Oct  1 
18:58:06 2020(r366338)
+++ head/contrib/llvm-project/llvm/include/llvm-c/Core.hThu Oct  1 
19:06:07 2020(r366339)
@@ -3636,7 +3636,7 @@ void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMB
 /* Get the number of clauses on the landingpad instruction */
 unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
 
-/* Get the value of the clause at idnex Idx on the landingpad instruction */
+/* Get the value of the clause at index Idx on the landingpad instruction */
 LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
 
 /* Add a catch or filter clause to the landingpad instruction */
@@ -3936,6 +3936,26 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, 
 LLVMAtomicOrdering SuccessOrdering,
 LLVMAtomicOrdering FailureOrdering,
 LLVMBool SingleThread);
+
+/**
+ * Get the number of elements in the mask of a ShuffleVector instruction.
+ */
+unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
+
+/**
+ * \returns a constant that specifies that the result of a \c ShuffleVectorInst
+ * is undefined.
+ */
+int LLVMGetUndefMaskElem(void);
+
+/**
+ * Get the mask value at position Elt in the mask of a ShuffleVector
+ * instruction.
+ *
+ * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is undef
+ * at that position.
+ */
+int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
 
 LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst);
 void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread);

Modified: head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h
==
--- head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h   Thu Oct 
 1 18:58:06 2020(r366338)
+++ head/contrib/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h   Thu Oct 
 1 19:06:07 2020(r366339)
@@ -378,6 +378,9 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { (
   iterator find(ConstPtrType Ptr) const {
 return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)));
   }
+  bool contains(ConstPtrType Ptr) const {
+return 

svn commit: r366338 - releng/12.2/sbin/fsck_msdosfs

2020-10-01 Thread Xin LI
Author: delphij
Date: Thu Oct  1 18:58:06 2020
New Revision: 366338
URL: https://svnweb.freebsd.org/changeset/base/366338

Log:
  MFS r366305: MFC r366064, r366065, r366215
  
  sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms
  
  Approved by:  re (gjb)

Modified:
  releng/12.2/sbin/fsck_msdosfs/dir.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sbin/fsck_msdosfs/dir.c
==
--- releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct  1 18:56:44 2020
(r366337)
+++ releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct  1 18:58:06 2020
(r366338)
@@ -388,7 +388,8 @@ static int
 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
 {
int ret = FSOK;
-   size_t physicalSize;
+   size_t chainsize;
+   u_int64_t physicalSize;
struct bootblock *boot;
 
boot = fat_get_boot(fat);
@@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
} else {
if (!fat_is_valid_cl(fat, dir->head))
return FSERROR;
-   ret = checkchain(fat, dir->head, );
+   ret = checkchain(fat, dir->head, );
/*
-* Upon return, physicalSize would hold the chain length
+* Upon return, chainsize would hold the chain length
 * that checkchain() was able to validate, but if the user
 * refused the proposed repair, it would be unsafe to
 * proceed with directory entry fix, so bail out in that
@@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
if (ret == FSERROR) {
return (FSERROR);
}
-   physicalSize *= boot->ClusterSize;
+   /*
+* The maximum file size on FAT32 is 4GiB - 1, which
+* will occupy a cluster chain of exactly 4GiB in
+* size.  On 32-bit platforms, since size_t is 32-bit,
+* it would wrap back to 0.
+*/
+   physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %zu\n",
- fullpath(dir), dir->size, physicalSize);
+   pwarn("size of %s is %u, should at most be %ju\n",
+ fullpath(dir), dir->size, (uintmax_t)physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
p[28] = (u_char)physicalSize;
___
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: r366337 - head/usr.sbin/ctld

2020-10-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct  1 18:56:44 2020
New Revision: 366337
URL: https://svnweb.freebsd.org/changeset/base/366337

Log:
  Don't ignore the return value from gethostname(3).  It probably
  cannot happen, but it silences Coverity.
  
  Reviewed by:  mav
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D26606

Modified:
  head/usr.sbin/ctld/ctld.c

Modified: head/usr.sbin/ctld/ctld.c
==
--- head/usr.sbin/ctld/ctld.c   Thu Oct  1 18:45:31 2020(r366336)
+++ head/usr.sbin/ctld/ctld.c   Thu Oct  1 18:56:44 2020(r366337)
@@ -931,7 +931,7 @@ void
 isns_register(struct isns *isns, struct isns *oldisns)
 {
struct conf *conf = isns->i_conf;
-   int s;
+   int error, s;
char hostname[256];
 
if (TAILQ_EMPTY(>conf_targets) ||
@@ -943,8 +943,10 @@ isns_register(struct isns *isns, struct isns *oldisns)
set_timeout(0, false);
return;
}
-   gethostname(hostname, sizeof(hostname));
-
+   error = gethostname(hostname, sizeof(hostname));
+   if (error != 0)
+   log_err(1, "gethostname");
+ 
if (oldisns == NULL || TAILQ_EMPTY(>i_conf->conf_targets))
oldisns = isns;
isns_do_deregister(oldisns, s, hostname);
@@ -957,7 +959,7 @@ void
 isns_check(struct isns *isns)
 {
struct conf *conf = isns->i_conf;
-   int s, res;
+   int error, s, res;
char hostname[256];
 
if (TAILQ_EMPTY(>conf_targets) ||
@@ -969,8 +971,10 @@ isns_check(struct isns *isns)
set_timeout(0, false);
return;
}
-   gethostname(hostname, sizeof(hostname));
-
+   error = gethostname(hostname, sizeof(hostname));
+   if (error != 0)
+   log_err(1, "gethostname");
+ 
res = isns_do_check(isns, s, hostname);
if (res < 0) {
isns_do_deregister(isns, s, hostname);
@@ -984,7 +988,7 @@ void
 isns_deregister(struct isns *isns)
 {
struct conf *conf = isns->i_conf;
-   int s;
+   int error, s;
char hostname[256];
 
if (TAILQ_EMPTY(>conf_targets) ||
@@ -994,8 +998,10 @@ isns_deregister(struct isns *isns)
s = isns_do_connect(isns);
if (s < 0)
return;
-   gethostname(hostname, sizeof(hostname));
-
+   error = gethostname(hostname, sizeof(hostname));
+   if (error != 0)
+   log_err(1, "gethostname");
+ 
isns_do_deregister(isns, s, hostname);
close(s);
set_timeout(0, false);
___
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: r366336 - head/sys/kern

2020-10-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct  1 18:45:31 2020
New Revision: 366336
URL: https://svnweb.freebsd.org/changeset/base/366336

Log:
  Only clear TDP_NERRNO when needed, ie when it's previously been set.
  
  Reviewed by:  kib
  Tested by:pho
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26612

Modified:
  head/sys/kern/subr_syscall.c

Modified: head/sys/kern/subr_syscall.c
==
--- head/sys/kern/subr_syscall.cThu Oct  1 18:17:56 2020
(r366335)
+++ head/sys/kern/subr_syscall.cThu Oct  1 18:45:31 2020
(r366336)
@@ -138,7 +138,8 @@ syscallenter(struct thread *td)
(void)sigfastblock_fetch(td);
 
/* Let system calls set td_errno directly. */
-   td->td_pflags &= ~TDP_NERRNO;
+   KASSERT((td->td_pflags & TDP_NERRNO) == 0,
+   ("%s: TDP_NERRNO set", __func__));
 
if (__predict_false(SYSTRACE_ENABLED() ||
AUDIT_SYSCALL_ENTER(sa->code, td))) {
@@ -149,7 +150,9 @@ syscallenter(struct thread *td)
 #endif
error = (sa->callp->sy_call)(td, sa->args);
/* Save the latest error return value. */
-   if (__predict_false((td->td_pflags & TDP_NERRNO) == 0))
+   if (__predict_false((td->td_pflags & TDP_NERRNO) != 0))
+   td->td_pflags &= ~TDP_NERRNO;
+   else
td->td_errno = error;
AUDIT_SYSCALL_EXIT(error, td);
 #ifdef KDTRACE_HOOKS
@@ -161,7 +164,9 @@ syscallenter(struct thread *td)
} else {
error = (sa->callp->sy_call)(td, sa->args);
/* Save the latest error return value. */
-   if (__predict_false((td->td_pflags & TDP_NERRNO) == 0))
+   if (__predict_false((td->td_pflags & TDP_NERRNO) != 0))
+   td->td_pflags &= ~TDP_NERRNO;
+   else
td->td_errno = error;
}
syscall_thread_exit(td, sa->callp);
___
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: r366335 - releng/12.2/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 18:17:56 2020
New Revision: 366335
URL: https://svnweb.freebsd.org/changeset/base/366335

Log:
  MFS r366324:
  Improve the handling of receiving unordered and unreliable user
  messages using DATA chunks. Don't use fsn_included when not being
  sure that it is set to an appropriate value. If the default is
  used, which is -1, this can result in SCTP associaitons not
  making any user visible progress.
  
  Thanks to Yutaka Takeda for reporting this issue for the the
  userland stack in https://github.com/pion/sctp/issues/138.
  
  MFS r366329:
  Improve the input validation and processing of cookies.
  This avoids setting the association in an inconsistent
  state, which could result in a use-after-free situation.
  This can be triggered by a malicious peer, if the peer
  can modify the cookie without the local endpoint recognizing
  it.
  Thanks to Ned Williamson for reporting the issue.
  
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/netinet/sctp_indata.c
  releng/12.2/sys/netinet/sctp_input.c
  releng/12.2/sys/netinet/sctp_pcb.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/netinet/sctp_indata.c
==
--- releng/12.2/sys/netinet/sctp_indata.c   Thu Oct  1 17:49:10 2020
(r366334)
+++ releng/12.2/sys/netinet/sctp_indata.c   Thu Oct  1 18:17:56 2020
(r366335)
@@ -5437,7 +5437,9 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb,
 * it can be delivered... But for now we just dump everything on the
 * queue.
 */
-   if (!asoc->idata_supported && !ordered && 
SCTP_TSN_GT(control->fsn_included, cumtsn)) {
+   if (!asoc->idata_supported && !ordered &&
+   control->first_frag_seen &&
+   SCTP_TSN_GT(control->fsn_included, cumtsn)) {
return;
}
TAILQ_FOREACH_SAFE(chk, >reasm, sctp_next, nchk) {

Modified: releng/12.2/sys/netinet/sctp_input.c
==
--- releng/12.2/sys/netinet/sctp_input.cThu Oct  1 17:49:10 2020
(r366334)
+++ releng/12.2/sys/netinet/sctp_input.cThu Oct  1 18:17:56 2020
(r366335)
@@ -2040,10 +2040,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
vrf_id, port);
return (NULL);
}
-   /* get the correct sctp_nets */
-   if (netp)
-   *netp = sctp_findnet(stcb, init_src);
-
asoc = >asoc;
/* get scope variables out of cookie */
asoc->scope.ipv4_local_scope = cookie->ipv4_scope;
@@ -2082,10 +2078,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
asoc->advanced_peer_ack_point = asoc->last_acked_seq;
 
/* process the INIT info (peer's info) */
-   if (netp)
-   retval = sctp_process_init(init_cp, stcb);
-   else
-   retval = 0;
+   retval = sctp_process_init(init_cp, stcb);
if (retval < 0) {
(void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
SCTP_FROM_SCTP_INPUT + SCTP_LOC_19);
@@ -2199,19 +2192,21 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
 */
;
}
-   /* since we did not send a HB make sure we don't double things */
-   if ((netp) && (*netp))
-   (*netp)->hb_responded = 1;
-
if (stcb->asoc.sctp_autoclose_ticks &&
sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) {
sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL);
}
(void)SCTP_GETTIME_TIMEVAL(>asoc.time_entered);
-   if ((netp != NULL) && (*netp != NULL)) {
+   *netp = sctp_findnet(stcb, init_src);
+   if (*netp != NULL) {
struct timeval old;
 
-   /* calculate the RTT and set the encaps port */
+   /*
+* Since we did not send a HB, make sure we don't double
+* things.
+*/
+   (*netp)->hb_responded = 1;
+   /* Calculate the RTT. */
old.tv_sec = cookie->time_entered.tv_sec;
old.tv_usec = cookie->time_entered.tv_usec;
sctp_calculate_rto(stcb, asoc, *netp, , 
SCTP_RTT_FROM_NON_DATA);

Modified: releng/12.2/sys/netinet/sctp_pcb.c
==
--- releng/12.2/sys/netinet/sctp_pcb.c  Thu Oct  1 17:49:10 2020
(r366334)
+++ releng/12.2/sys/netinet/sctp_pcb.c  Thu Oct  1 18:17:56 2020
(r366335)
@@ -4293,7 +4293,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd
if ((ntohs(sin->sin_port) == 0) ||
(sin->sin_addr.s_addr == INADDR_ANY) ||
(sin->sin_addr.s_addr == INADDR_BROADCAST) ||
-   

svn commit: r366334 - vendor/llvm-project/llvmorg-11.0.0-rc5-0-g60a25202a7d

2020-10-01 Thread Dimitry Andric
Author: dim
Date: Thu Oct  1 17:49:10 2020
New Revision: 366334
URL: https://svnweb.freebsd.org/changeset/base/366334

Log:
  Tag llvm-project branch release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d.

Added:
  vendor/llvm-project/llvmorg-11.0.0-rc5-0-g60a25202a7d/
 - copied from r366333, vendor/llvm-project/release-11.x/
___
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: r366333 - in vendor/llvm-project/release-11.x: lld/docs llvm/include/llvm-c llvm/include/llvm/ADT llvm/lib/CodeGen llvm/lib/CodeGen/AsmPrinter llvm/lib/CodeGen/GlobalISel llvm/lib/CodeG...

2020-10-01 Thread Dimitry Andric
Author: dim
Date: Thu Oct  1 17:48:15 2020
New Revision: 366333
URL: https://svnweb.freebsd.org/changeset/base/366333

Log:
  Vendor import of llvm-project branch release/11.x
  llvmorg-11.0.0-rc5-0-g60a25202a7d.

Modified:
  vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst
  vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h
  vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h
  vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  
vendor/llvm-project/release-11.x/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  vendor/llvm-project/release-11.x/llvm/lib/CodeGen/PHIEliminationUtils.cpp
  
vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  
vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  vendor/llvm-project/release-11.x/llvm/lib/IR/Core.cpp
  vendor/llvm-project/release-11.x/llvm/lib/IR/Globals.cpp
  vendor/llvm-project/release-11.x/llvm/lib/Support/APFloat.cpp
  
vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp

Modified: vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst
==
--- vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst  Thu Oct  1 
17:30:38 2020(r366332)
+++ vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst  Thu Oct  1 
17:48:15 2020(r366333)
@@ -5,11 +5,6 @@ lld 11.0.0 Release Notes
 .. contents::
 :local:
 
-.. warning::
-   These are in-progress notes for the upcoming LLVM 11.0.0 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
 Introduction
 
 
@@ -176,12 +171,3 @@ MinGW Improvements
   ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options
   for selecting file and section alignment (``--file-alignment`` and
   ``--section-alignment``).
-
-MachO Improvements
---
-
-* Item 1.
-
-WebAssembly Improvements
-
-

Modified: vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h
==
--- vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h Thu Oct  1 
17:30:38 2020(r366332)
+++ vendor/llvm-project/release-11.x/llvm/include/llvm-c/Core.h Thu Oct  1 
17:48:15 2020(r366333)
@@ -3636,7 +3636,7 @@ void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMB
 /* Get the number of clauses on the landingpad instruction */
 unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
 
-/* Get the value of the clause at idnex Idx on the landingpad instruction */
+/* Get the value of the clause at index Idx on the landingpad instruction */
 LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
 
 /* Add a catch or filter clause to the landingpad instruction */
@@ -3936,6 +3936,26 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, 
 LLVMAtomicOrdering SuccessOrdering,
 LLVMAtomicOrdering FailureOrdering,
 LLVMBool SingleThread);
+
+/**
+ * Get the number of elements in the mask of a ShuffleVector instruction.
+ */
+unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
+
+/**
+ * \returns a constant that specifies that the result of a \c ShuffleVectorInst
+ * is undefined.
+ */
+int LLVMGetUndefMaskElem(void);
+
+/**
+ * Get the mask value at position Elt in the mask of a ShuffleVector
+ * instruction.
+ *
+ * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is undef
+ * at that position.
+ */
+int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
 
 LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst);
 void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread);

Modified: vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h
==
--- vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h
Thu Oct  1 17:30:38 2020(r366332)
+++ vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/SmallPtrSet.h
Thu Oct  1 17:48:15 2020(r366333)
@@ -378,6 +378,9 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { (
   iterator find(ConstPtrType Ptr) const {
 return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)));
   }
+  bool contains(ConstPtrType Ptr) const {
+return find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)) != EndPointer();
+  }
 
   template 
   void insert(IterT I, IterT E) {

Modified: 
vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

svn commit: r366332 - releng/12.2/sys/cam/scsi

2020-10-01 Thread John Baldwin
Author: jhb
Date: Thu Oct  1 17:30:38 2020
New Revision: 366332
URL: https://svnweb.freebsd.org/changeset/base/366332

Log:
  MFS 366297: Revert most of r360179.
  
  I had failed to notice that sgsendccb() was using cam_periph_mapmem()
  and thus was not passing down user pointers directly to drivers.  In
  practice this broke requests submitted from userland.
  
  PR:   249395
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/cam/scsi/scsi_sg.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/cam/scsi/scsi_sg.c
==
--- releng/12.2/sys/cam/scsi/scsi_sg.c  Thu Oct  1 17:16:05 2020
(r366331)
+++ releng/12.2/sys/cam/scsi/scsi_sg.c  Thu Oct  1 17:30:38 2020
(r366332)
@@ -508,7 +508,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int
struct cam_periph *periph;
struct sg_softc *softc;
struct sg_io_hdr *req;
-   void *data_ptr;
int dir, error;
 
periph = (struct cam_periph *)dev->si_drv1;
@@ -553,20 +552,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int
break;
}
 
-   if (req->dxfer_len > MAXPHYS) {
-   error = EINVAL;
-   break;
-   }
-
-   data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK);
-
ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
csio = >csio;
 
error = copyin(req->cmdp, >cdb_io.cdb_bytes,
req->cmd_len);
if (error) {
-   free(data_ptr, M_DEVBUF);
xpt_release_ccb(ccb);
break;
}
@@ -587,21 +578,12 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int
break;
}
 
-   if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) {
-   error = copyin(req->dxferp, data_ptr, req->dxfer_len);
-   if (error) {
-   free(data_ptr, M_DEVBUF);
-   xpt_release_ccb(ccb);
-   break;
-   }
-   }
-
cam_fill_csio(csio,
  /*retries*/1,
  /*cbfcnp*/NULL,
  dir|CAM_DEV_QFRZDIS,
  MSG_SIMPLE_Q_TAG,
- data_ptr,
+ req->dxferp,
  req->dxfer_len,
  req->mx_sb_len,
  req->cmd_len,
@@ -611,7 +593,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int
if (error) {
req->host_status = DID_ERROR;
req->driver_status = DRIVER_INVALID;
-   free(data_ptr, M_DEVBUF);
xpt_release_ccb(ccb);
break;
}
@@ -630,10 +611,6 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int
req->sb_len_wr);
}
 
-   if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0)
-   error = copyout(data_ptr, req->dxferp, req->dxfer_len);
-
-   free(data_ptr, M_DEVBUF);
xpt_release_ccb(ccb);
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: r366331 - head/usr.sbin/bhyve

2020-10-01 Thread John Baldwin
Author: jhb
Date: Thu Oct  1 17:16:05 2020
New Revision: 366331
URL: https://svnweb.freebsd.org/changeset/base/366331

Log:
  bhyve: Fix build with option BHYVE_SNAPSHOT
  
  'ident' was replaced with 'ata_ident' in revision r363596.
  
  Submitted by: Vitaliy Gusev 
  Reviewed by:  Darius Mihai
  Differential Revision: https://reviews.freebsd.org/D26263

Modified:
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/pci_ahci.c
==
--- head/usr.sbin/bhyve/pci_ahci.c  Thu Oct  1 16:55:01 2020
(r366330)
+++ head/usr.sbin/bhyve/pci_ahci.c  Thu Oct  1 17:16:05 2020
(r366331)
@@ -2684,7 +2684,7 @@ pci_ahci_snapshot(struct vm_snapshot_meta *meta)
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->rfis, 256, false, meta,
ret, done);
 
-   SNAPSHOT_VAR_OR_LEAVE(port->ident, meta, ret, done);
+   SNAPSHOT_VAR_OR_LEAVE(port->ata_ident, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(port->atapi, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(port->reset, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(port->waitforclear, meta, ret, done);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366330 - head/sys/dev/ichsmb

2020-10-01 Thread Emmanuel Vadot
Author: manu
Date: Thu Oct  1 16:55:01 2020
New Revision: 366330
URL: https://svnweb.freebsd.org/changeset/base/366330

Log:
  ichsmb_pci: convert to pci_device_table / add PCI_PNP_INFO
  
  Submitted by: Greg V 
  Reviewed by:  mav
  Differential Revision:https://reviews.freebsd.org/D25260

Modified:
  head/sys/dev/ichsmb/ichsmb_pci.c

Modified: head/sys/dev/ichsmb/ichsmb_pci.c
==
--- head/sys/dev/ichsmb/ichsmb_pci.cThu Oct  1 16:53:16 2020
(r366329)
+++ head/sys/dev/ichsmb/ichsmb_pci.cThu Oct  1 16:55:01 2020
(r366330)
@@ -106,51 +106,87 @@ __FBSDID("$FreeBSD$");
 #defineID_KABYLAKE 0xa2a3
 #defineID_CANNONLAKE   0xa323
 
-static const struct ichsmb_device {
-   uint16_tid;
-   const char  *name;
-} ichsmb_devices[] = {
-   { ID_82801AA,   "Intel 82801AA (ICH) SMBus controller"  },
-   { ID_82801AB,   "Intel 82801AB (ICH0) SMBus controller" },
-   { ID_82801BA,   "Intel 82801BA (ICH2) SMBus controller" },
-   { ID_82801CA,   "Intel 82801CA (ICH3) SMBus controller" },
-   { ID_82801DC,   "Intel 82801DC (ICH4) SMBus controller" },
-   { ID_82801EB,   "Intel 82801EB (ICH5) SMBus controller" },
-   { ID_82801FB,   "Intel 82801FB (ICH6) SMBus controller" },
-   { ID_82801GB,   "Intel 82801GB (ICH7) SMBus controller" },
-   { ID_82801H,"Intel 82801H (ICH8) SMBus controller"  },
-   { ID_82801I,"Intel 82801I (ICH9) SMBus controller"  },
-   { ID_82801GB,   "Intel 82801GB (ICH7) SMBus controller" },
-   { ID_82801H,"Intel 82801H (ICH8) SMBus controller"  },
-   { ID_82801I,"Intel 82801I (ICH9) SMBus controller"  },
-   { ID_EP80579,   "Intel EP80579 SMBus controller"},
-   { ID_82801JI,   "Intel 82801JI (ICH10) SMBus controller"},
-   { ID_82801JD,   "Intel 82801JD (ICH10) SMBus controller"},
-   { ID_PCH,   "Intel PCH SMBus controller"},
-   { ID_6300ESB,   "Intel 6300ESB (ICH) SMBus controller"  },
-   { ID_631xESB,   "Intel 631xESB/6321ESB (ESB2) SMBus controller" },
-   { ID_DH89XXCC,  "Intel DH89xxCC SMBus controller"   },
-   { ID_PATSBURG,  "Intel Patsburg SMBus controller"   },
-   { ID_CPT,   "Intel Cougar Point SMBus controller"   },
-   { ID_PPT,   "Intel Panther Point SMBus controller"  },
-   { ID_AVOTON,"Intel Avoton SMBus controller" },
-   { ID_LPT,   "Intel Lynx Point SMBus controller" },
-   { ID_LPTLP, "Intel Lynx Point-LP SMBus controller"  },
-   { ID_WCPT,  "Intel Wildcat Point SMBus controller"  },
-   { ID_WCPTLP,"Intel Wildcat Point-LP SMBus controller"   },
-   { ID_BAYTRAIL,  "Intel Baytrail SMBus controller"   },
-   { ID_BRASWELL,  "Intel Braswell SMBus controller"   },
-   { ID_COLETOCRK, "Intel Coleto Creek SMBus controller"   },
-   { ID_WELLSBURG, "Intel Wellsburg SMBus controller"  },
-   { ID_SRPT,  "Intel Sunrise Point-H SMBus controller"},
-   { ID_SRPTLP,"Intel Sunrise Point-LP SMBus controller"   },
-   { ID_DENVERTON, "Intel Denverton SMBus controller"  },
-   { ID_BROXTON,   "Intel Broxton SMBus controller"},
-   { ID_LEWISBURG, "Intel Lewisburg SMBus controller"  },
-   { ID_LEWISBURG2,"Intel Lewisburg SMBus controller"  },
-   { ID_KABYLAKE,  "Intel Kaby Lake SMBus controller"  },
-   { ID_CANNONLAKE,"Intel Cannon Lake SMBus controller"},
-   { 0, NULL },
+static const struct pci_device_table ichsmb_devices[] = {
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA),
+ PCI_DESCR("Intel 82801AA (ICH) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AB),
+ PCI_DESCR("Intel 82801AB (ICH0) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801BA),
+ PCI_DESCR("Intel 82801BA (ICH2) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801CA),
+ PCI_DESCR("Intel 82801CA (ICH3) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801DC),
+ PCI_DESCR("Intel 82801DC (ICH4) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801EB),
+ PCI_DESCR("Intel 82801EB (ICH5) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801FB),
+ PCI_DESCR("Intel 82801FB (ICH6) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801GB),
+ PCI_DESCR("Intel 82801GB (ICH7) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801H),
+ PCI_DESCR("Intel 82801H (ICH8) SMBus 

svn commit: r366329 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:53:16 2020
New Revision: 366329
URL: https://svnweb.freebsd.org/changeset/base/366329

Log:
  MFC r366248:
  Improve the input validation and processing of cookies.
  This avoids setting the association in an inconsistent
  state, which could result in a use-after-free situation.
  This can be triggered by a malicious peer, if the peer
  can modify the cookie without the local endpoint recognizing
  it.
  Thanks to Ned Williamson for reporting the issue.

Modified:
  stable/12/sys/netinet/sctp_input.c
  stable/12/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_input.c
==
--- stable/12/sys/netinet/sctp_input.c  Thu Oct  1 16:45:11 2020
(r366328)
+++ stable/12/sys/netinet/sctp_input.c  Thu Oct  1 16:53:16 2020
(r366329)
@@ -2040,10 +2040,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
vrf_id, port);
return (NULL);
}
-   /* get the correct sctp_nets */
-   if (netp)
-   *netp = sctp_findnet(stcb, init_src);
-
asoc = >asoc;
/* get scope variables out of cookie */
asoc->scope.ipv4_local_scope = cookie->ipv4_scope;
@@ -2082,10 +2078,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
asoc->advanced_peer_ack_point = asoc->last_acked_seq;
 
/* process the INIT info (peer's info) */
-   if (netp)
-   retval = sctp_process_init(init_cp, stcb);
-   else
-   retval = 0;
+   retval = sctp_process_init(init_cp, stcb);
if (retval < 0) {
(void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
SCTP_FROM_SCTP_INPUT + SCTP_LOC_19);
@@ -2199,19 +2192,21 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
 */
;
}
-   /* since we did not send a HB make sure we don't double things */
-   if ((netp) && (*netp))
-   (*netp)->hb_responded = 1;
-
if (stcb->asoc.sctp_autoclose_ticks &&
sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) {
sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL);
}
(void)SCTP_GETTIME_TIMEVAL(>asoc.time_entered);
-   if ((netp != NULL) && (*netp != NULL)) {
+   *netp = sctp_findnet(stcb, init_src);
+   if (*netp != NULL) {
struct timeval old;
 
-   /* calculate the RTT and set the encaps port */
+   /*
+* Since we did not send a HB, make sure we don't double
+* things.
+*/
+   (*netp)->hb_responded = 1;
+   /* Calculate the RTT. */
old.tv_sec = cookie->time_entered.tv_sec;
old.tv_usec = cookie->time_entered.tv_usec;
sctp_calculate_rto(stcb, asoc, *netp, , 
SCTP_RTT_FROM_NON_DATA);

Modified: stable/12/sys/netinet/sctp_pcb.c
==
--- stable/12/sys/netinet/sctp_pcb.cThu Oct  1 16:45:11 2020
(r366328)
+++ stable/12/sys/netinet/sctp_pcb.cThu Oct  1 16:53:16 2020
(r366329)
@@ -4291,7 +4291,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd
if ((ntohs(sin->sin_port) == 0) ||
(sin->sin_addr.s_addr == INADDR_ANY) ||
(sin->sin_addr.s_addr == INADDR_BROADCAST) ||
-   IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
+   IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) ||
+   (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) != 0) 
&&
+   (SCTP_IPV6_V6ONLY(inp) != 0))) {
/* Invalid address */
SCTP_INP_RUNLOCK(inp);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP_PCB, EINVAL);
@@ -4310,7 +4312,8 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd
sin6 = (struct sockaddr_in6 *)firstaddr;
if ((ntohs(sin6->sin6_port) == 0) ||
IN6_IS_ADDR_UNSPECIFIED(>sin6_addr) ||
-   IN6_IS_ADDR_MULTICAST(>sin6_addr)) {
+   IN6_IS_ADDR_MULTICAST(>sin6_addr) ||
+   ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)) 
{
/* Invalid address */
SCTP_INP_RUNLOCK(inp);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP_PCB, EINVAL);
___
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: r366328 - in head/sys/amd64/vmm: . amd intel

2020-10-01 Thread John Baldwin
Author: jhb
Date: Thu Oct  1 16:45:11 2020
New Revision: 366328
URL: https://svnweb.freebsd.org/changeset/base/366328

Log:
  Clear the upper 32-bits of registers in x86_emulate_cpuid().
  
  Per the Intel manuals, CPUID is supposed to unconditionally zero the
  upper 32 bits of the involved (rax/rbx/rcx/rdx) registers.
  Previously, the emulation would cast pointers to the 64-bit register
  values down to `uint32_t`, which while properly manipulating the lower
  bits, would leave any garbage in the upper bits uncleared.  While no
  existing guest OSes seem to stumble over this in practice, the bhyve
  emulation should match x86 expectations.
  
  This was discovered through alignment warnings emitted by gcc9, while
  testing it against SmartOS/bhyve.
  
  SmartOS bug:  https://smartos.org/bugview/OS-8168
  Submitted by: Patrick Mooney
  Reviewed by:  rgrimes
  Differential Revision:https://reviews.freebsd.org/D24727

Modified:
  head/sys/amd64/vmm/amd/svm.c
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/x86.c
  head/sys/amd64/vmm/x86.h

Modified: head/sys/amd64/vmm/amd/svm.c
==
--- head/sys/amd64/vmm/amd/svm.cThu Oct  1 16:37:49 2020
(r366327)
+++ head/sys/amd64/vmm/amd/svm.cThu Oct  1 16:45:11 2020
(r366328)
@@ -1496,11 +1496,8 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct 
break;
case VMCB_EXIT_CPUID:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_CPUID, 1);
-   handled = x86_emulate_cpuid(svm_sc->vm, vcpu,
-   (uint32_t *)>rax,
-   (uint32_t *)>sctx_rbx,
-   (uint32_t *)>sctx_rcx,
-   (uint32_t *)>sctx_rdx);
+   handled = x86_emulate_cpuid(svm_sc->vm, vcpu, >rax,
+   >sctx_rbx, >sctx_rcx, >sctx_rdx);
break;
case VMCB_EXIT_HLT:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_HLT, 1);

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Thu Oct  1 16:37:49 2020
(r366327)
+++ head/sys/amd64/vmm/intel/vmx.c  Thu Oct  1 16:45:11 2020
(r366328)
@@ -1193,15 +1193,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
 static int
 vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx)
 {
-   int handled, func;
+   int handled;
 
-   func = vmxctx->guest_rax;
-
-   handled = x86_emulate_cpuid(vm, vcpu,
-   (uint32_t*)(>guest_rax),
-   (uint32_t*)(>guest_rbx),
-   (uint32_t*)(>guest_rcx),
-   (uint32_t*)(>guest_rdx));
+   handled = x86_emulate_cpuid(vm, vcpu, (uint64_t *)>guest_rax,
+   (uint64_t *)>guest_rbx, (uint64_t *)>guest_rcx,
+   (uint64_t *)>guest_rdx);
return (handled);
 }
 

Modified: head/sys/amd64/vmm/x86.c
==
--- head/sys/amd64/vmm/x86.cThu Oct  1 16:37:49 2020(r366327)
+++ head/sys/amd64/vmm/x86.cThu Oct  1 16:45:11 2020(r366328)
@@ -87,35 +87,40 @@ log2(u_int x)
 }
 
 int
-x86_emulate_cpuid(struct vm *vm, int vcpu_id,
- uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
+x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx,
+uint64_t *rcx, uint64_t *rdx)
 {
const struct xsave_limits *limits;
uint64_t cr4;
int error, enable_invpcid, enable_rdpid, enable_rdtscp, level,
width, x2apic_id;
-   unsigned int func, regs[4], logical_cpus;
+   unsigned int func, regs[4], logical_cpus, param;
enum x2apic_state x2apic_state;
uint16_t cores, maxcpus, sockets, threads;
 
-   VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx);
+   /*
+* The function of CPUID is controlled through the provided value of
+* %eax (and secondarily %ecx, for certain leaf data).
+*/
+   func = (uint32_t)*rax;
+   param = (uint32_t)*rcx;
 
+   VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", func, param);
+
/*
 * Requests for invalid CPUID levels should map to the highest
 * available level instead.
 */
-   if (cpu_exthigh != 0 && *eax >= 0x8000) {
-   if (*eax > cpu_exthigh)
-   *eax = cpu_exthigh;
-   } else if (*eax >= 0x4000) {
-   if (*eax > CPUID_VM_HIGH)
-   *eax = CPUID_VM_HIGH;
-   } else if (*eax > cpu_high) {
-   *eax = cpu_high;
+   if (cpu_exthigh != 0 && func >= 0x8000) {
+   if (func > cpu_exthigh)
+   func = cpu_exthigh;
+   } else if (func >= 0x4000) {
+   if (func > CPUID_VM_HIGH)
+

svn commit: r366327 - in head/lib/libc: gen net

2020-10-01 Thread Enji Cooper
Author: ngie
Date: Thu Oct  1 16:37:49 2020
New Revision: 366327
URL: https://svnweb.freebsd.org/changeset/base/366327

Log:
  Eliminate duplicate `afterinstallconfigs` target
  
  Define separate dependent targets which `afterinstallconfigs` relies on, in
  order to modify `${DESTDIR}/etc/master.passwd` and
  `${DESTDIR}/etc/nsswitch.conf`.
  
  Mark these targets .PHONY, since they manipulate configurations on the fly and
  the generation logic isn't 100% defined in terms of the source files/logic,
  and is variable, based on MK_foo flags.
  
  MFC after:2 weeks
  Reviewed by:  bapt, brd
  Differential Revision:https://reviews.freebsd.org/D20330

Modified:
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/net/Makefile.inc

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Thu Oct  1 16:25:35 2020
(r366326)
+++ head/lib/libc/gen/Makefile.inc  Thu Oct  1 16:37:49 2020
(r366327)
@@ -552,7 +552,8 @@ MLINKS+=wordexp.3 wordfree.3
 
 .include 
 
-afterinstallconfig:
+afterinstallconfig: install-passwd
+install-passwd: .PHONY
 .if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
 .endif

Modified: head/lib/libc/net/Makefile.inc
==
--- head/lib/libc/net/Makefile.inc  Thu Oct  1 16:25:35 2020
(r366326)
+++ head/lib/libc/net/Makefile.inc  Thu Oct  1 16:37:49 2020
(r366327)
@@ -124,8 +124,9 @@ SRCS+=  hesiod.c 
 MAN+=  hesiod.3
 .endif
 
+afterinstallconfig: modify-nsswitch-conf
+modify-nsswitch-conf: .PHONY
 .if ${MK_NIS} == "no"
-afterinstallconfig:
sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
${DESTDIR}/etc/nsswitch.conf
 .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: r366326 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:25:35 2020
New Revision: 366326
URL: https://svnweb.freebsd.org/changeset/base/366326

Log:
  MFC r366226:
  Minor cleanup.

Modified:
  stable/12/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_pcb.c
==
--- stable/12/sys/netinet/sctp_pcb.cThu Oct  1 16:24:28 2020
(r366325)
+++ stable/12/sys/netinet/sctp_pcb.cThu Oct  1 16:25:35 2020
(r366326)
@@ -6592,7 +6592,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s
(ptype == SCTP_DEL_IP_ADDRESS) ||
(ptype == SCTP_ERROR_CAUSE_IND) ||
(ptype == SCTP_SUCCESS_REPORT)) {
-/* don't care */ ;
+   /* don't care */
} else {
if ((ptype & 0x8000) == 0x) {
/*
___
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: r366325 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:24:28 2020
New Revision: 366325
URL: https://svnweb.freebsd.org/changeset/base/366325

Log:
  MFC r366199:
  
  Cleanup, no functional change intended.

Modified:
  stable/12/sys/netinet/sctp_indata.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_indata.c
==
--- stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:23:35 2020
(r366324)
+++ stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:24:28 2020
(r366325)
@@ -5420,7 +5420,6 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb,
 struct sctp_queued_to_read *control, int ordered, uint32_t cumtsn)
 {
struct sctp_tmit_chunk *chk, *nchk;
-   int cnt_removed = 0;
 
/*
 * For now large messages held on the stream reasm that are complete
@@ -5437,12 +5436,11 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb,
}
TAILQ_FOREACH_SAFE(chk, >reasm, sctp_next, nchk) {
/* Purge hanging chunks */
-   if (!asoc->idata_supported && (ordered == 0)) {
+   if (!asoc->idata_supported && !ordered) {
if (SCTP_TSN_GT(chk->rec.data.tsn, cumtsn)) {
break;
}
}
-   cnt_removed++;
TAILQ_REMOVE(>reasm, chk, sctp_next);
if (asoc->size_on_reasm_queue >= chk->send_size) {
asoc->size_on_reasm_queue -= chk->send_size;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366324 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:23:35 2020
New Revision: 366324
URL: https://svnweb.freebsd.org/changeset/base/366324

Log:
  MFC r366198:
  Improve the handling of receiving unordered and unreliable user
  messages using DATA chunks. Don't use fsn_included when not being
  sure that it is set to an appropriate value. If the default is
  used, which is -1, this can result in SCTP associaitons not
  making any user visible progress.
  
  Thanks to Yutaka Takeda for reporting this issue for the the
  userland stack in https://github.com/pion/sctp/issues/138.

Modified:
  stable/12/sys/netinet/sctp_indata.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_indata.c
==
--- stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:22:34 2020
(r366323)
+++ stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:23:35 2020
(r366324)
@@ -5430,7 +5430,9 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb,
 * it can be delivered... But for now we just dump everything on the
 * queue.
 */
-   if (!asoc->idata_supported && !ordered && 
SCTP_TSN_GT(control->fsn_included, cumtsn)) {
+   if (!asoc->idata_supported && !ordered &&
+   control->first_frag_seen &&
+   SCTP_TSN_GT(control->fsn_included, cumtsn)) {
return;
}
TAILQ_FOREACH_SAFE(chk, >reasm, sctp_next, nchk) {
___
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: r366323 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:22:34 2020
New Revision: 366323
URL: https://svnweb.freebsd.org/changeset/base/366323

Log:
  MFC r366114:
  Whitespace changes.

Modified:
  stable/12/sys/netinet/sctp_cc_functions.c
  stable/12/sys/netinet/sctp_header.h
  stable/12/sys/netinet/sctp_indata.c
  stable/12/sys/netinet/sctp_lock_bsd.h
  stable/12/sys/netinet/sctp_output.c
  stable/12/sys/netinet/sctp_output.h
  stable/12/sys/netinet/sctp_pcb.c
  stable/12/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_cc_functions.c
==
--- stable/12/sys/netinet/sctp_cc_functions.c   Thu Oct  1 16:18:49 2020
(r366322)
+++ stable/12/sys/netinet/sctp_cc_functions.c   Thu Oct  1 16:22:34 2020
(r366323)
@@ -1318,9 +1318,7 @@ sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *
sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, 
num_pkt_lost, 1);
 }
 
-
-static
-void
+static void
 sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net,
 struct sctp_tmit_chunk *tp1)
 {
@@ -1438,7 +1436,6 @@ sctp_set_rtcc_initial_cc_param(struct sctp_tcb *stcb,
net->cc_mod.rtcc.step_cnt = 0;
net->cc_mod.rtcc.last_step_state = 0;
 
-
 }
 
 static int
@@ -2051,7 +2048,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, struct sctp_net
 {
/*-
 * How to handle these functions?
- * if (!tcp_is_cwnd_limited(sk, in_flight)) RRS - good question.
+*  if (!tcp_is_cwnd_limited(sk, in_flight)) RRS - good question.
 *  return;
 */
if (net->cwnd <= net->ssthresh) {

Modified: stable/12/sys/netinet/sctp_header.h
==
--- stable/12/sys/netinet/sctp_header.h Thu Oct  1 16:18:49 2020
(r366322)
+++ stable/12/sys/netinet/sctp_header.h Thu Oct  1 16:22:34 2020
(r366323)
@@ -544,43 +544,43 @@ struct sctp_auth_chunk {
 #ifndef SCTP_MAX_OVERHEAD
 #ifdef INET6
 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \
-  sizeof(struct sctphdr) + \
-  sizeof(struct sctp_ecne_chunk) + \
-  sizeof(struct sctp_sack_chunk) + \
-  sizeof(struct ip6_hdr))
+   sizeof(struct sctphdr) + \
+   sizeof(struct sctp_ecne_chunk) + \
+   sizeof(struct sctp_sack_chunk) + \
+   sizeof(struct ip6_hdr))
 
 #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \
-  sizeof(struct sctphdr) + \
-  sizeof(struct ip6_hdr))
+   sizeof(struct sctphdr) + \
+   sizeof(struct ip6_hdr))
 
 
 #define SCTP_MIN_OVERHEAD (sizeof(struct ip6_hdr) + \
-  sizeof(struct sctphdr))
+   sizeof(struct sctphdr))
 
 #else
 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \
-  sizeof(struct sctphdr) + \
-  sizeof(struct sctp_ecne_chunk) + \
-  sizeof(struct sctp_sack_chunk) + \
-  sizeof(struct ip))
+   sizeof(struct sctphdr) + \
+   sizeof(struct sctp_ecne_chunk) + \
+   sizeof(struct sctp_sack_chunk) + \
+   sizeof(struct ip))
 
 #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \
-  sizeof(struct sctphdr) + \
-  sizeof(struct ip))
+   sizeof(struct sctphdr) + \
+   sizeof(struct ip))
 
 
 #define SCTP_MIN_OVERHEAD (sizeof(struct ip) + \
-  sizeof(struct sctphdr))
+   sizeof(struct sctphdr))
 
 #endif /* INET6 */
 #endif /* !SCTP_MAX_OVERHEAD */
 
 #define SCTP_MED_V4_OVERHEAD (sizeof(struct sctp_data_chunk) + \
- sizeof(struct sctphdr) + \
- sizeof(struct ip))
+  sizeof(struct sctphdr) + \
+  sizeof(struct ip))
 
 #define SCTP_MIN_V4_OVERHEAD (sizeof(struct ip) + \
- sizeof(struct sctphdr))
+  sizeof(struct sctphdr))
 
 #undef SCTP_PACKED
 #endif /* !__sctp_header_h__ */

Modified: stable/12/sys/netinet/sctp_indata.c
==
--- stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:18:49 2020
(r366322)
+++ stable/12/sys/netinet/sctp_indata.c Thu Oct  1 16:22:34 2020
(r366323)
@@ -2542,7 +2542,6 @@ sctp_slide_mapping_arrays(struct sctp_tcb *stcb)

svn commit: r366322 - stable/12/usr.bin/netstat

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:18:49 2020
New Revision: 366322
URL: https://svnweb.freebsd.org/changeset/base/366322

Log:
  MFC r365688:
  Add a -C option to netstat to display the congestion control for
  TCP connections.

Modified:
  stable/12/usr.bin/netstat/inet.c
  stable/12/usr.bin/netstat/main.c
  stable/12/usr.bin/netstat/netstat.1
  stable/12/usr.bin/netstat/netstat.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/netstat/inet.c
==
--- stable/12/usr.bin/netstat/inet.cThu Oct  1 16:14:00 2020
(r366321)
+++ stable/12/usr.bin/netstat/inet.cThu Oct  1 16:18:49 2020
(r366322)
@@ -341,6 +341,9 @@ protopr(u_long off, const char *name, int af1, int pro
xo_emit("  {T:/%8.8s} {T:/%5.5s}",
"flowid", "ftype");
}
+   if (Cflag)
+   xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX,
+   TCP_CA_NAME_MAX, "CC");
if (Pflag)
xo_emit(" {T:/%s}", "Log ID");
xo_emit("\n");
@@ -514,9 +517,15 @@ protopr(u_long off, const char *name, int af1, int pro
inp->inp_flowid,
inp->inp_flowtype);
}
-   if (istcp && Pflag)
-   xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ?
-   "-" : tp->xt_logid);
+   if (istcp) {
+   if (Cflag)
+   xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX,
+   TCP_CA_NAME_MAX, tp->xt_cc);
+   if (Pflag)
+   xo_emit(" {:log-id/%s}",
+   tp->xt_logid[0] == '\0' ?
+   "-" : tp->xt_logid);
+   }
xo_emit("\n");
xo_close_instance("socket");
}

Modified: stable/12/usr.bin/netstat/main.c
==
--- stable/12/usr.bin/netstat/main.cThu Oct  1 16:14:00 2020
(r366321)
+++ stable/12/usr.bin/netstat/main.cThu Oct  1 16:18:49 2020
(r366322)
@@ -205,6 +205,7 @@ int Aflag;  /* show addresses of protocol control 
bloc
 intaflag;  /* show all sockets (including servers) */
 static int Bflag;  /* show information about bpf consumers */
 intbflag;  /* show i/f total bytes in/out */
+intCflag;  /* show congestion control */
 intdflag;  /* show i/f dropped packets */
 intgflag;  /* show group (multicast) routing or stats */
 inthflag;  /* show counters in human readable format */
@@ -248,7 +249,7 @@ main(int argc, char *argv[])
if (argc < 0)
exit(EXIT_FAILURE);
 
-   while ((ch = getopt(argc, argv, 
"46AaBbdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz"))
+   while ((ch = getopt(argc, argv, 
"46AaBbCdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz"))
!= -1)
switch(ch) {
case '4':
@@ -277,6 +278,9 @@ main(int argc, char *argv[])
case 'b':
bflag = 1;
break;
+   case 'C':
+   Cflag = 1;
+   break;
case 'd':
dflag = 1;
break;
@@ -721,7 +725,7 @@ kset_dpcpu(u_int cpuid)
 
if (kvm_dpcpu_setcpu(kvmd, cpuid) < 0)
xo_errx(-1, "%s: kvm_dpcpu_setcpu(%u): %s", __func__,
-   cpuid, kvm_geterr(kvmd)); 
+   cpuid, kvm_geterr(kvmd));
return;
 }
 

Modified: stable/12/usr.bin/netstat/netstat.1
==
--- stable/12/usr.bin/netstat/netstat.1 Thu Oct  1 16:14:00 2020
(r366321)
+++ stable/12/usr.bin/netstat/netstat.1 Thu Oct  1 16:18:49 2020
(r366322)
@@ -28,7 +28,7 @@
 .\"@(#)netstat.1   8.8 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 22, 2018
+.Dd September 13, 2020
 .Dt NETSTAT 1
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Bl -tag -width "netstat"
 .It Nm
 .Op Fl -libxo
-.Op Fl 46AaLnPRSTWx
+.Op Fl 46AaCLnPRSTWx
 .Op Fl f Ar protocol_family | Fl p Ar protocol
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -111,7 +111,7 @@ depending on the options for the information presented
 .It Xo
 .Bk -words
 .Nm
-.Op Fl 46AaLnRSTWx
+.Op Fl 46AaCLnRSTWx
 .Op Fl f Ar protocol_family | Fl p Ar protocol
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -172,6 +172,8 @@ associated with a socket; used for debugging.
 .It Fl a
 Show the state of all sockets;
 normally sockets used by server processes are not shown.
+.It Fl C
+Show the congestion control of TCP sockets.
 

svn commit: r366321 - stable/12/usr.bin/sockstat

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:14:00 2020
New Revision: 366321
URL: https://svnweb.freebsd.org/changeset/base/366321

Log:
  MFC r365687:
  
  Add a -C option to sockstat to display the congestion control for TCP
  connections.

Modified:
  stable/12/usr.bin/sockstat/sockstat.1
  stable/12/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/sockstat/sockstat.1
==
--- stable/12/usr.bin/sockstat/sockstat.1   Thu Oct  1 16:11:08 2020
(r366320)
+++ stable/12/usr.bin/sockstat/sockstat.1   Thu Oct  1 16:14:00 2020
(r366321)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 3, 2018
+.Dd September 13, 2020
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -35,7 +35,7 @@
 .Nd list open sockets
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46cLlSsUuvw
+.Op Fl 46CcLlSsUuvw
 .Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
@@ -56,6 +56,9 @@ Show
 Show
 .Dv AF_INET6
 (IPv6) sockets.
+.It Fl C
+Display the congestion control module, if applicable.
+This is currently only implemented for TCP.
 .It Fl c
 Show connected sockets.
 .It Fl j Ar jail
@@ -170,6 +173,10 @@ is specified (only for SCTP or TCP).
 .It Li STACK
 The protocol stack if
 .Fl S
+is specified (only for TCP).
+.It Li CC
+The congestion control if
+.Fl C
 is specified (only for TCP).
 .El
 .Pp

Modified: stable/12/usr.bin/sockstat/sockstat.c
==
--- stable/12/usr.bin/sockstat/sockstat.c   Thu Oct  1 16:11:08 2020
(r366320)
+++ stable/12/usr.bin/sockstat/sockstat.c   Thu Oct  1 16:14:00 2020
(r366321)
@@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$");
 
 static int  opt_4; /* Show IPv4 sockets */
 static int  opt_6; /* Show IPv6 sockets */
+static int  opt_C; /* Show congestion control */
 static int  opt_c; /* Show connected sockets */
 static int  opt_j; /* Show specified jail */
 static int  opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
@@ -118,6 +119,7 @@ struct sock {
int state;
const char *protoname;
char stack[TCP_FUNCTION_NAME_LEN_MAX];
+   char cc[TCP_CA_NAME_MAX];
struct addr *laddr;
struct addr *faddr;
struct sock *next;
@@ -716,6 +718,7 @@ gather_inet(int proto)
sock->state = xtp->t_state;
memcpy(sock->stack, xtp->xt_stack,
TCP_FUNCTION_NAME_LEN_MAX);
+   memcpy(sock->cc, xtp->xt_cc, TCP_CA_NAME_MAX);
}
sock->protoname = protoname;
hash = (int)((uintptr_t)sock->socket % HASHSIZE);
@@ -1130,12 +1133,24 @@ displaysock(struct sock *s, int pos)
}
offset += 13;
}
-   if (opt_S && s->proto == IPPROTO_TCP) {
-   while (pos < offset)
-   pos += xprintf(" ");
-   xprintf("%.*s", TCP_FUNCTION_NAME_LEN_MAX,
-   s->stack);
+   if (opt_S) {
+   if (s->proto == IPPROTO_TCP) {
+   while (pos < offset)
+   pos += xprintf(" ");
+   pos += xprintf("%.*s",
+   TCP_FUNCTION_NAME_LEN_MAX,
+   s->stack);
+   }
+   offset += TCP_FUNCTION_NAME_LEN_MAX + 1;
}
+   if (opt_C) {
+   if (s->proto == IPPROTO_TCP) {
+   while (pos < offset)
+   pos += xprintf(" ");
+   xprintf("%.*s", TCP_CA_NAME_MAX, s->cc);
+   }
+   offset += TCP_CA_NAME_MAX + 1;
+   }
}
if (laddr != NULL)
laddr = laddr->next;
@@ -1170,7 +1185,10 @@ display(void)
printf(" %-12s", "CONN STATE");
}
if (opt_S)
-   printf(" %.*s", TCP_FUNCTION_NAME_LEN_MAX, "STACK");
+   printf(" %-*.*s", TCP_FUNCTION_NAME_LEN_MAX,
+   TCP_FUNCTION_NAME_LEN_MAX, "STACK");
+   if (opt_C)
+   printf(" %-.*s", TCP_CA_NAME_MAX, "CC");
printf("\n");
}
setpassent(1);
@@ -1286,13 +1304,16 @@ main(int argc, char *argv[])
int o, i;
 
opt_j = -1;
-   while ((o = getopt(argc, argv, "46cj:Llp:P:qSsUuvw")) != 

svn commit: r366320 - stable/12/sys/netinet

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:11:08 2020
New Revision: 366320
URL: https://svnweb.freebsd.org/changeset/base/366320

Log:
  MFC r365686:
  Export the name of the congestion control. This will be used by sockstat
  and netstat.

Modified:
  stable/12/sys/netinet/tcp_subr.c
  stable/12/sys/netinet/tcp_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_subr.c
==
--- stable/12/sys/netinet/tcp_subr.cThu Oct  1 16:09:23 2020
(r366319)
+++ stable/12/sys/netinet/tcp_subr.cThu Oct  1 16:11:08 2020
(r366320)
@@ -3268,6 +3268,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x
 
bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack,
TCP_FUNCTION_NAME_LEN_MAX);
+   bcopy(CC_ALGO(tp)->name, xt->xt_cc,
+   TCP_CA_NAME_MAX);
 #ifdef TCP_BLACKBOX
(void)tcp_log_get_id(tp, xt->xt_logid);
 #endif

Modified: stable/12/sys/netinet/tcp_var.h
==
--- stable/12/sys/netinet/tcp_var.h Thu Oct  1 16:09:23 2020
(r366319)
+++ stable/12/sys/netinet/tcp_var.h Thu Oct  1 16:11:08 2020
(r366320)
@@ -696,7 +696,8 @@ struct xtcpcb {
struct xinpcb   xt_inp;
charxt_stack[TCP_FUNCTION_NAME_LEN_MAX];/* (s) */
charxt_logid[TCP_LOG_ID_LEN];   /* (s) */
-   int64_t spare64[8];
+   charxt_cc[TCP_CA_NAME_MAX]; /* (s) */
+   int64_t spare64[6];
int32_t t_state;/* (s,p) */
uint32_tt_flags;/* (s,p) */
int32_t t_sndzerowin;   /* (s) */
___
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: r366319 - stable/12/usr.sbin/traceroute6

2020-10-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct  1 16:09:23 2020
New Revision: 366319
URL: https://svnweb.freebsd.org/changeset/base/366319

Log:
  MFC r365685:
  Add a -t option to traceroute6 to control the traffic class used when
  sending probe packets.

Modified:
  stable/12/usr.sbin/traceroute6/traceroute6.8
  stable/12/usr.sbin/traceroute6/traceroute6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/traceroute6/traceroute6.8
==
--- stable/12/usr.sbin/traceroute6/traceroute6.8Thu Oct  1 15:45:07 
2020(r366318)
+++ stable/12/usr.sbin/traceroute6/traceroute6.8Thu Oct  1 16:09:23 
2020(r366319)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 16, 2019
+.Dd September 13, 2020
 .Dt TRACEROUTE6 8
 .Os
 .\"
@@ -61,6 +61,9 @@
 .Op Fl s Ar src
 .Ek
 .Bk -words
+.Op Fl t Ar tclass
+.Ek
+.Bk -words
 .Op Fl w Ar waittime
 .Ek
 .Bk -words
@@ -148,6 +151,13 @@ If
 .Ar datalen
 is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled
 with a PAD chunk. For larger probe packets, an INIT chunk is used.
+.It Fl t Ar tclass
+.Ar tclass
+specifies the
+.Em traffic class
+used when sending probe packets.
+The value must be a decimal integer in the range 0 to 255.
+The default is 0.
 .It Fl T
 Use TCP segments for the probes.
 .It Fl U

Modified: stable/12/usr.sbin/traceroute6/traceroute6.c
==
--- stable/12/usr.sbin/traceroute6/traceroute6.cThu Oct  1 15:45:07 
2020(r366318)
+++ stable/12/usr.sbin/traceroute6/traceroute6.cThu Oct  1 16:09:23 
2020(r366319)
@@ -341,6 +341,7 @@ static u_long max_hops = 30;
 static u_int16_t srcport;
 static u_int16_t port = 32768+666; /* start udp dest port # for probe 
packets */
 static u_int16_t ident;
+static int tclass = -1;
 static int options;/* socket options */
 static int verbose;
 static int waittime = 5;   /* time to wait for response (in 
seconds) */
@@ -359,7 +360,7 @@ main(int argc, char *argv[])
int ch, i, on = 1, seq, rcvcmsglen, error;
struct addrinfo hints, *res;
static u_char *rcvcmsgbuf;
-   u_long probe, hops, lport;
+   u_long probe, hops, lport, ltclass;
struct hostent *hp;
size_t size, minlen;
uid_t uid;
@@ -406,7 +407,7 @@ main(int argc, char *argv[])
seq = 0;
ident = htons(getpid() & 0x); /* same as ping6 */
 
-   while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1)
+   while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1)
switch (ch) {
case 'a':
as_path = 1;
@@ -522,6 +523,17 @@ main(int argc, char *argv[])
case 'S':
useproto = IPPROTO_SCTP;
break;
+   case 't':
+   ep = NULL;
+   errno = 0;
+   ltclass = strtoul(optarg, , 0);
+   if (errno || !*optarg || *ep || ltclass > 255) {
+   fprintf(stderr,
+   "traceroute6: invalid traffic class.\n");
+   exit(1);
+   }
+   tclass = (int)ltclass;
+   break;
case 'T':
useproto = IPPROTO_TCP;
break;
@@ -591,6 +603,13 @@ main(int argc, char *argv[])
exit(1);
}
 
+   if (tclass != -1) {
+   if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_TCLASS, ,
+   sizeof(int)) == -1) {
+   perror("setsockopt(IPV6_TCLASS)");
+   exit(7);
+   }
+   }
 
if (argc < 1 || argc > 2)
usage();
___
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: r366207 - head/lib/libc/gen

2020-10-01 Thread Kyle Evans
On Thu, Oct 1, 2020 at 10:45 AM Konstantin Belousov  wrote:
>
> On Mon, Sep 28, 2020 at 07:01:38PM +0300, Konstantin Belousov wrote:
> > On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote:
> > > I would be tempted to just revert the rest of the local modifications
> > > (sans negative check, maybe) and widen it in the one spot that the
> > > compiler complains about:
> > >
> > > - if (strlcpy(buf, execpath, buflen_) >= buflen_)
> > > + if (strlcpy(buf, execpath, buflen) >= 
> > > (size_t)buflen)
> > >
> > > I had expressed this in the review, but with no particular conviction.
> > If this is the only place where the warning occurs, IMO it would be quite
> > good to reduce the change.
>
> So would you propose your change for review ?

Sure, I'll throw it up here in a little bit.
___
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: r366318 - in head/contrib/bc: . include src

2020-10-01 Thread Stefan Eßer
Author: se
Date: Thu Oct  1 15:45:07 2020
New Revision: 366318
URL: https://svnweb.freebsd.org/changeset/base/366318

Log:
  Upgrade to version 3.1.6
  
  This upgrade addresses one (benign) compiler warning when building with
  LLVM-12.

Modified:
  head/contrib/bc/Makefile.in
  head/contrib/bc/NEWS.md
  head/contrib/bc/include/bc.h
  head/contrib/bc/release.sh
  head/contrib/bc/src/data.c
  head/contrib/bc/src/num.c
  head/contrib/bc/src/program.c
Directory Properties:
  head/contrib/bc/   (props changed)

Modified: head/contrib/bc/Makefile.in
==
--- head/contrib/bc/Makefile.in Thu Oct  1 15:41:32 2020(r366317)
+++ head/contrib/bc/Makefile.in Thu Oct  1 15:45:07 2020(r366318)
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.1.5
+VERSION = 3.1.6
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%

Modified: head/contrib/bc/NEWS.md
==
--- head/contrib/bc/NEWS.md Thu Oct  1 15:41:32 2020(r366317)
+++ head/contrib/bc/NEWS.md Thu Oct  1 15:45:07 2020(r366318)
@@ -1,5 +1,13 @@
 # News
 
+## 3.1.6
+
+This is a production release that fixes a new warning from Clang 12 for FreeBSD
+and also removes some possible undefined behavior found by UBSan that compilers
+did not seem to take advantage of.
+
+Users do ***NOT*** need to upgrade, if they do not want to.
+
 ## 3.1.5
 
 This is a production release that fixes the Chinese locales (which caused `bc`

Modified: head/contrib/bc/include/bc.h
==
--- head/contrib/bc/include/bc.hThu Oct  1 15:41:32 2020
(r366317)
+++ head/contrib/bc/include/bc.hThu Oct  1 15:45:07 2020
(r366318)
@@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem;
 extern const BcParseNext bc_parse_next_for;
 extern const BcParseNext bc_parse_next_read;
 
+#else // BC_ENABLED
+
+#define BC_PARSE_NO_EXEC(p) (0)
+
 #endif // BC_ENABLED
 
 #endif // BC_BC_H

Modified: head/contrib/bc/release.sh
==
--- head/contrib/bc/release.sh  Thu Oct  1 15:41:32 2020(r366317)
+++ head/contrib/bc/release.sh  Thu Oct  1 15:45:07 2020(r366318)
@@ -383,6 +383,7 @@ build_set() {
 clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral"
 clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn 
-Wno-disabled-macro-expansion"
 clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return"
+clang_flags="$clang_flags -Wno-implicit-fallthrough"
 gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered"
 
 cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized"

Modified: head/contrib/bc/src/data.c
==
--- head/contrib/bc/src/data.c  Thu Oct  1 15:41:32 2020(r366317)
+++ head/contrib/bc/src/data.c  Thu Oct  1 15:45:07 2020(r366318)
@@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = {
"empty expression",
"bad print statement",
"bad function definition",
-   "bad assignment: left side must be scale, ibase, "
-   "obase, seed, last, var, or array element",
+   ("bad assignment: left side must be scale, ibase, "
+   "obase, seed, last, var, or array element"),
"no auto variable found",
"function parameter or auto \"%s%s\" already exists",
"block end cannot be found",

Modified: head/contrib/bc/src/num.c
==
--- head/contrib/bc/src/num.c   Thu Oct  1 15:41:32 2020(r366317)
+++ head/contrib/bc/src/num.c   Thu Oct  1 15:45:07 2020(r366318)
@@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, con
 
for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i);
 
-   n->scale = (size_t) (rdx * ((val + len) - (ptr + 1)));
+   n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) -
+   (((uintptr_t) ptr) + 1)));
n->rdx = BC_NUM_RDX(n->scale);
 
i = len - (ptr == val ? 0 : i) - rdx;
@@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict 
memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t));
 
for (j = 0; n9 && j < BC_BASE_DIGS; ++j) {
-   buffer[j] = n9 % BC_BASE;
+   buffer[j] = ((size_t) n9) % BC_BASE;
n9 /= BC_BASE;
}
 

Modified: head/contrib/bc/src/program.c
==
--- head/contrib/bc/src/program.c   Thu Oct  1 15:41:32 2020
(r366317)
+++ head/contrib/bc/src/program.c   Thu Oct  1 15:45:07 2020
(r366318)
@@ -180,7 +180,7 @@ static inline 

Re: svn commit: r366207 - head/lib/libc/gen

2020-10-01 Thread Konstantin Belousov
On Mon, Sep 28, 2020 at 07:01:38PM +0300, Konstantin Belousov wrote:
> On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote:
> > I would be tempted to just revert the rest of the local modifications
> > (sans negative check, maybe) and widen it in the one spot that the
> > compiler complains about:
> > 
> > - if (strlcpy(buf, execpath, buflen_) >= buflen_)
> > + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen)
> > 
> > I had expressed this in the review, but with no particular conviction.
> If this is the only place where the warning occurs, IMO it would be quite
> good to reduce the change.

So would you propose your change for review ?
___
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: r366317 - vendor/bc/3.1.6

2020-10-01 Thread Stefan Eßer
Author: se
Date: Thu Oct  1 15:41:32 2020
New Revision: 366317
URL: https://svnweb.freebsd.org/changeset/base/366317

Log:
  Tag version 3.1.6

Added:
  vendor/bc/3.1.6/
 - copied from r366316, vendor/bc/dist/
___
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: r366316 - in vendor/bc/dist: . include src

2020-10-01 Thread Stefan Eßer
Author: se
Date: Thu Oct  1 15:40:24 2020
New Revision: 366316
URL: https://svnweb.freebsd.org/changeset/base/366316

Log:
  Update to version 3.1.6

Modified:
  vendor/bc/dist/Makefile.in
  vendor/bc/dist/NEWS.md
  vendor/bc/dist/include/bc.h
  vendor/bc/dist/release.sh
  vendor/bc/dist/src/data.c
  vendor/bc/dist/src/num.c

Modified: vendor/bc/dist/Makefile.in
==
--- vendor/bc/dist/Makefile.in  Thu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/Makefile.in  Thu Oct  1 15:40:24 2020(r366316)
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.1.5
+VERSION = 3.1.6
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%

Modified: vendor/bc/dist/NEWS.md
==
--- vendor/bc/dist/NEWS.md  Thu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/NEWS.md  Thu Oct  1 15:40:24 2020(r366316)
@@ -1,5 +1,13 @@
 # News
 
+## 3.1.6
+
+This is a production release that fixes a new warning from Clang 12 for FreeBSD
+and also removes some possible undefined behavior found by UBSan that compilers
+did not seem to take advantage of.
+
+Users do ***NOT*** need to upgrade, if they do not want to.
+
 ## 3.1.5
 
 This is a production release that fixes the Chinese locales (which caused `bc`

Modified: vendor/bc/dist/include/bc.h
==
--- vendor/bc/dist/include/bc.h Thu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/include/bc.h Thu Oct  1 15:40:24 2020(r366316)
@@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem;
 extern const BcParseNext bc_parse_next_for;
 extern const BcParseNext bc_parse_next_read;
 
+#else // BC_ENABLED
+
+#define BC_PARSE_NO_EXEC(p) (0)
+
 #endif // BC_ENABLED
 
 #endif // BC_BC_H

Modified: vendor/bc/dist/release.sh
==
--- vendor/bc/dist/release.sh   Thu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/release.sh   Thu Oct  1 15:40:24 2020(r366316)
@@ -383,6 +383,7 @@ build_set() {
 clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral"
 clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn 
-Wno-disabled-macro-expansion"
 clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return"
+clang_flags="$clang_flags -Wno-implicit-fallthrough"
 gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered"
 
 cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized"

Modified: vendor/bc/dist/src/data.c
==
--- vendor/bc/dist/src/data.c   Thu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/src/data.c   Thu Oct  1 15:40:24 2020(r366316)
@@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = {
"empty expression",
"bad print statement",
"bad function definition",
-   "bad assignment: left side must be scale, ibase, "
-   "obase, seed, last, var, or array element",
+   ("bad assignment: left side must be scale, ibase, "
+   "obase, seed, last, var, or array element"),
"no auto variable found",
"function parameter or auto \"%s%s\" already exists",
"block end cannot be found",

Modified: vendor/bc/dist/src/num.c
==
--- vendor/bc/dist/src/num.cThu Oct  1 15:04:55 2020(r366315)
+++ vendor/bc/dist/src/num.cThu Oct  1 15:40:24 2020(r366316)
@@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, con
 
for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i);
 
-   n->scale = (size_t) (rdx * ((val + len) - (ptr + 1)));
+   n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) -
+   (((uintptr_t) ptr) + 1)));
n->rdx = BC_NUM_RDX(n->scale);
 
i = len - (ptr == val ? 0 : i) - rdx;
@@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict 
memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t));
 
for (j = 0; n9 && j < BC_BASE_DIGS; ++j) {
-   buffer[j] = n9 % BC_BASE;
+   buffer[j] = ((size_t) n9) % BC_BASE;
n9 /= BC_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: r366315 - in head/sys/riscv: include riscv

2020-10-01 Thread Kristof Provost
Author: kp
Date: Thu Oct  1 15:04:55 2020
New Revision: 366315
URL: https://svnweb.freebsd.org/changeset/base/366315

Log:
  riscv: Add memmmap so we can mmap /dev/mem
  
  Reviewed by:  mhorne
  Sponsored by: Axiado
  Differential Revision:https://reviews.freebsd.org/D26622

Modified:
  head/sys/riscv/include/memdev.h
  head/sys/riscv/riscv/mem.c

Modified: head/sys/riscv/include/memdev.h
==
--- head/sys/riscv/include/memdev.h Thu Oct  1 14:20:36 2020
(r366314)
+++ head/sys/riscv/include/memdev.h Thu Oct  1 15:04:55 2020
(r366315)
@@ -35,6 +35,6 @@
 d_open_t   memopen;
 d_read_t   memrw;
 d_ioctl_t  memioctl_md;
-#definememmmap (d_mmap_t *)NULL
+d_mmap_t   memmmap;
 
 #endif /* _MACHINE_MEMDEV_H_ */

Modified: head/sys/riscv/riscv/mem.c
==
--- head/sys/riscv/riscv/mem.c  Thu Oct  1 14:20:36 2020(r366314)
+++ head/sys/riscv/riscv/mem.c  Thu Oct  1 15:04:55 2020(r366315)
@@ -122,6 +122,21 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
return (error);
 }
 
+/*
+ * Allow user processes to MMAP some memory sections
+ * instead of going through read/write.
+ */
+int
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+int prot __unused, vm_memattr_t *memattr __unused)
+{
+   if (dev2unit(dev) == CDEV_MINOR_MEM) {
+   *paddr = offset;
+   return (0);
+   }
+   return (-1);
+}
+
 int
 memioctl_md(struct cdev *dev __unused, u_long cmd __unused,
 caddr_t data __unused, int flags __unused, struct thread *td __unused)
___
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: r366312 - head/sys/dev/extres/syscon

2020-10-01 Thread Ed Maste
On Thu, 1 Oct 2020 at 05:50, Michal Meloun  wrote:
>
> Author: mmel
> Date: Thu Oct  1 09:50:08 2020
> New Revision: 366312
> URL: https://svnweb.freebsd.org/changeset/base/366312
>
> Log:
>   Fix the inverted condition in mtx_asserts.
>   Mutex should be owned in affected functions.

Thanks! The board now boots to the login prompt in the CI hwlab. CI is
still reporting failure but I believe it is a hardware issue. The
smoke test tries to log in on the console then run a few commands and
shutdown, and it looks like the USB-serial dongle has working rx but
not tx.
___
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: r366314 - head/stand/lua

2020-10-01 Thread Kyle Evans
Author: kevans
Date: Thu Oct  1 14:20:36 2020
New Revision: 366314
URL: https://svnweb.freebsd.org/changeset/base/366314

Log:
  lualoader: clear up some luacheck warnings
  
  - One (1) unused argument
  - One (1) trailing whitespace
  - Two (2) "non-standard global" (curenv, rewind)
  
  tools/boot/lua-lint.sh is once again happy.

Modified:
  head/stand/lua/cli.lua
  head/stand/lua/core.lua
  head/stand/lua/menu.lua

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Thu Oct  1 13:29:29 2020(r366313)
+++ head/stand/lua/cli.lua  Thu Oct  1 14:20:36 2020(r366314)
@@ -130,7 +130,7 @@ cli['read-conf'] = function(...)
config.readConf(assert(core.popFrontTable(argv)))
 end
 
-cli['reload-conf'] = function(...)
+cli['reload-conf'] = function()
config.reload()
 end
 

Modified: head/stand/lua/core.lua
==
--- head/stand/lua/core.lua Thu Oct  1 13:29:29 2020(r366313)
+++ head/stand/lua/core.lua Thu Oct  1 14:20:36 2020(r366314)
@@ -319,7 +319,7 @@ function core.bootenvDefaultRewinded()
end
 
for curenv_idx = 0, bootenv_count - 1 do
-   curenv = loader.getenv("bootenvs_check[" .. curenv_idx .. "]")
+   local curenv = loader.getenv("bootenvs_check[" .. curenv_idx .. 
"]")
if curenv == defname then
return defname
end

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Thu Oct  1 13:29:29 2020(r366313)
+++ head/stand/lua/menu.lua Thu Oct  1 14:20:36 2020(r366314)
@@ -232,7 +232,7 @@ menu.welcome = {
multi_user = multi_user,
}
else
-   single_user = alts.single_user 
+   single_user = alts.single_user
multi_user = alts.multi_user
end
boot_entry_1, boot_entry_2 = single_user, multi_user
@@ -352,7 +352,7 @@ menu.welcome = {
zpool_checkpoints = {
entry_type = core.MENU_ENTRY,
name = function()
-   rewind = "No"
+   local rewind = "No"
if core.isRewinded() then
rewind = "Yes"
end
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366313 - head/sys/arm64/conf

2020-10-01 Thread Ed Maste
Author: emaste
Date: Thu Oct  1 13:29:29 2020
New Revision: 366313
URL: https://svnweb.freebsd.org/changeset/base/366313

Log:
  Add cd device to arm64 GENERIC
  
  Big-iron arm64 machines might have a CD, possibly provided by some IPMI
  emulation.
  
  Reported by:  scottph

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Thu Oct  1 09:50:08 2020(r366312)
+++ head/sys/arm64/conf/GENERIC Thu Oct  1 13:29:29 2020(r366313)
@@ -189,6 +189,7 @@ device  scbus
 device da
 
 # ATA/SCSI peripherals
+device cd  # CD
 device pass# Passthrough device (direct ATA/SCSI access)
 
 # NVM Express (NVMe) support
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366161 - head/sys/dev/extres/syscon

2020-10-01 Thread Michal Meloun



On 30.09.2020 18:33, Ed Maste wrote:
> On Fri, 25 Sep 2020 at 12:44, Michal Meloun  wrote:
>>
>> Author: mmel
>> Date: Fri Sep 25 16:44:01 2020
>> New Revision: 366161
>> URL: https://svnweb.freebsd.org/changeset/base/366161
> 
> The pine64 in CI is currently broken, panicking at boot with:
> panic: mutex aw_syscon0 owned at
> /usr/src/sys/dev/extres/syscon/syscon_generic.c:98
> 
> Log:
> https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/6480/artifact/device_tests/pinea64.boot.log
> 
> It's possible there's an outdated dtb involved here, as there was with
> the BBB. Hopefully manu's change to report/check the dtb version makes
> it in and can be used to help track these issues down.
> 
> Unfortunately the USB-serial interface connected to the pine64 was
> broken until yesterday so I'm not sure for how long this has been
> broken in this way. The last successful run was at r364130 almost 2
> months ago; the first failure after that was because of an apparent
> hang at shutdown.
Fixed in r66312. I never realized that the syscon_generic methods are
not called on any of my boards even though their DTs have syscon_generic
node.
Michal
___
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: r366312 - head/sys/dev/extres/syscon

2020-10-01 Thread Michal Meloun
Author: mmel
Date: Thu Oct  1 09:50:08 2020
New Revision: 366312
URL: https://svnweb.freebsd.org/changeset/base/366312

Log:
  Fix the inverted condition in mtx_asserts.
  Mutex should be owned in affected functions.
  
  Reborted by:  emaste
  MFC after:4 weeks
  MFC with: r366161

Modified:
  head/sys/dev/extres/syscon/syscon_generic.c

Modified: head/sys/dev/extres/syscon/syscon_generic.c
==
--- head/sys/dev/extres/syscon/syscon_generic.c Thu Oct  1 08:57:36 2020
(r366311)
+++ head/sys/dev/extres/syscon/syscon_generic.c Thu Oct  1 09:50:08 2020
(r366312)
@@ -95,7 +95,7 @@ syscon_generic_unlocked_read_4(struct syscon *syscon, 
uint32_t val;
 
sc = device_get_softc(syscon->pdev);
-   SYSCON_ASSERT_UNLOCKED(sc);
+   SYSCON_ASSERT_LOCKED(sc);
val = bus_read_4(sc->mem_res, offset);
return (val);
 }
@@ -106,7 +106,7 @@ syscon_generic_unlocked_write_4(struct syscon *syscon,
struct syscon_generic_softc *sc;
 
sc = device_get_softc(syscon->pdev);
-   SYSCON_ASSERT_UNLOCKED(sc);
+   SYSCON_ASSERT_LOCKED(sc);
bus_write_4(sc->mem_res, offset, val);
return (0);
 }
@@ -119,7 +119,7 @@ syscon_generic_unlocked_modify_4(struct syscon *syscon
uint32_t val;
 
sc = device_get_softc(syscon->pdev);
-   SYSCON_ASSERT_UNLOCKED(sc);
+   SYSCON_ASSERT_LOCKED(sc);
val = bus_read_4(sc->mem_res, offset);
val &= ~clear_bits;
val |= set_bits;
___
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: r366311 - head/usr.sbin/crashinfo

2020-10-01 Thread Alexander Leidinger
Author: netchild
Date: Thu Oct  1 08:57:36 2020
New Revision: 366311
URL: https://svnweb.freebsd.org/changeset/base/366311

Log:
  Remove nfsstat. Running nfsstat in crashinfo will give the stats of the
  running kernel instead of the stats of the crashed kernel. The current
  version uses sysctls to query the stats and does not work at all (anymore)
  on crash dumps.

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shThu Oct  1 08:46:21 2020
(r366310)
+++ head/usr.sbin/crashinfo/crashinfo.shThu Oct  1 08:57:36 2020
(r366311)
@@ -314,12 +314,6 @@ echo
 fi
 
 echo ""
-echo "nfsstat"
-echo
-nfsstat -M $VMCORE -N $KERNEL
-echo
-
-echo ""
 echo "netstat -s"
 echo
 netstat -M $VMCORE -N $KERNEL -s
___
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: r366310 - head/sys/kern

2020-10-01 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct  1 08:46:21 2020
New Revision: 366310
URL: https://svnweb.freebsd.org/changeset/base/366310

Log:
  cache: properly report ENOTDIR on foo/bar lookups where foo is a file
  
  Reported by:  fernape

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Oct  1 04:46:23 2020(r366309)
+++ head/sys/kern/vfs_cache.c   Thu Oct  1 08:46:21 2020(r366310)
@@ -4045,6 +4045,15 @@ static int __noinline
 cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error)
 {
 
+   /*
+* Hack: they may be looking up foo/bar, where foo is a
+* regular file. In such a case we need to turn ENOTDIR,
+* but we may happen to get here with a different error.
+*/
+   if (fpl->dvp->v_type != VDIR) {
+   error = ENOTDIR;
+   }
+
switch (error) {
case EAGAIN:
/*
___
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"