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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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

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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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 

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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"