Re: svn commit: r344562 - head/sys/ufs/ffs

2019-02-25 Thread Rodney W. Grimes
> On Mon, 25 Feb 2019, Jason Harmening wrote:
> 
> > On 2/25/19 9:46 PM, Bruce Evans wrote:
> >> 
> >> block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with 
> >> large
> >> pages.?? MINBSIZE is 4096 in ffs (except in my version, it is 512).?? The
> >> default is 32768 in newfs.?? I consider this excessive and only use it for
> >> file systems with many files larger than 1GB, but it is the most common 
> >> size.
> >> It is larger than the large page size of 8192.
> >
> > I think this is a case of filesystem logical block size vs. media sector 
> > size, right?  Here we're checking the devvp's block size, which I think 
> > should correspond to the sector size.  I'd expect cases of that being
> > greater than PAGE_SIZE to be uncommon, in fact geli warns when that is the 
> > case.   I probably should've made that clearer in the commit message.
> 
> Yes, I missed that you are checking devvp.  ffs_getpages() also checks
> devvp.
> 
> So the bug has nothing to do with file system logical (fragment) or i/o
> (block) block size's, except file systems themselves won't work unless
> their i/o size is a multiple of the underlying devices (sector) i/o size.
> 
> Are there physical disk with sector size > PAGE_SIZE now?

I have been told that there are some sd/flash devices that
have a 16k physical sector size, I have not been able to
confirm that information though.

> It is easy to
> create virtual (md) disks with sector size > PAGE_SIZE, and this may even
> be useful for avoiding the related problem of having to access large fs
> blocks to do i/o to small md sectors.  I think it is best to use PAGE_SIZE
> blocks in all layers and sometimes combine these into clusters.
> 
> Bruce
-- 
Rod Grimes rgri...@freebsd.org
___
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: r344562 - head/sys/ufs/ffs

2019-02-25 Thread Bruce Evans

On Mon, 25 Feb 2019, Jason Harmening wrote:


On 2/25/19 9:46 PM, Bruce Evans wrote:


block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with 
large

pages.?? MINBSIZE is 4096 in ffs (except in my version, it is 512).?? The
default is 32768 in newfs.?? I consider this excessive and only use it for
file systems with many files larger than 1GB, but it is the most common 
size.

It is larger than the large page size of 8192.


I think this is a case of filesystem logical block size vs. media sector 
size, right?  Here we're checking the devvp's block size, which I think 
should correspond to the sector size.  I'd expect cases of that being
greater than PAGE_SIZE to be uncommon, in fact geli warns when that is the 
case.   I probably should've made that clearer in the commit message.


Yes, I missed that you are checking devvp.  ffs_getpages() also checks
devvp.

So the bug has nothing to do with file system logical (fragment) or i/o
(block) block size's, except file systems themselves won't work unless
their i/o size is a multiple of the underlying devices (sector) i/o size.

Are there physical disk with sector size > PAGE_SIZE now?  It is easy to
create virtual (md) disks with sector size > PAGE_SIZE, and this may even
be useful for avoiding the related problem of having to access large fs
blocks to do i/o to small md sectors.  I think it is best to use PAGE_SIZE
blocks in all layers and sometimes combine these into clusters.

Bruce___
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: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-25 Thread Simon J. Gerraty via svn-src-all
Rodney W. Grimes  wrote:
> >   Differential Revision:D16575
> 
> Just a small nit, for future reference, from the template:

Oops, noted thanks.

This is all disabled by default, but I did a buildworld with it all
enabled just prior so hopefully will not impact anyone negatively and
will help those that have been playing with it.

Thanks again
--sjg


___
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: r344557 - stable/12/release/tools

2019-02-25 Thread Rodney W. Grimes
> On 2/25/19 6:20 PM, Rodney W. Grimes wrote:
> >> Author: cperciva
> >> Date: Tue Feb 26 01:29:40 2019
> >> New Revision: 344557
> >> URL: https://svnweb.freebsd.org/changeset/base/344557
> >>
> >> Log:
> >>   MFC r344315:
> >> Fix sed script to insert Amazon NTP server into ntp.conf once rather
> >> than twice.
> > 
> > Does this issue also exist in stable/11, as iirc 11.3 would be
> > the next release that is coming on the schedule.
> Fixed.  I forgot that we were expecting an 11.3.

Thanks!

-- 
Rod Grimes rgri...@freebsd.org
___
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: r344568 - in head/stand: . common ficl ficl32 i386/loader liblua libsa libsa32

2019-02-25 Thread Simon J. Gerraty
Author: sjg
Date: Tue Feb 26 06:22:10 2019
New Revision: 344568
URL: https://svnweb.freebsd.org/changeset/base/344568

Log:
  Enable veriexec for loader
  
  This relies on libbearssl and libsecureboot
  to verify files read by loader in a maner equivalent
  to how mac_veriexec
  
  Note: disabled by default.
  Use is initially expected to be by embeded vendors
  
  Reviewed by:  emaste, imp
  Sponsored by: Juniper Networks
  Differential Revision:D16336

Modified:
  head/stand/common/boot.c
  head/stand/common/bootstrap.h
  head/stand/common/interp_forth.c
  head/stand/common/interp_simple.c
  head/stand/common/load_elf.c
  head/stand/common/load_elf_obj.c
  head/stand/common/module.c
  head/stand/ficl/Makefile.depend
  head/stand/ficl/ficl.h
  head/stand/ficl/fileaccess.c
  head/stand/ficl32/Makefile.depend
  head/stand/i386/loader/Makefile.depend
  head/stand/liblua/Makefile
  head/stand/liblua/lstd.c
  head/stand/libsa/Makefile
  head/stand/libsa/Makefile.depend
  head/stand/libsa32/Makefile.depend
  head/stand/loader.mk

Modified: head/stand/common/boot.c
==
--- head/stand/common/boot.cTue Feb 26 06:17:23 2019(r344567)
+++ head/stand/common/boot.cTue Feb 26 06:22:10 2019(r344568)
@@ -106,6 +106,10 @@ command_boot(int argc, char *argv[])
if (archsw.arch_autoload() != 0)
return(CMD_ERROR);
 
+#ifdef LOADER_VERIEXEC
+   verify_pcr_export();/* for measured boot */
+#endif
+
/* Call the exec handler from the loader matching the kernel */
file_formats[fp->f_loader]->l_exec(fp);
return(CMD_ERROR);

Modified: head/stand/common/bootstrap.h
==
--- head/stand/common/bootstrap.h   Tue Feb 26 06:17:23 2019
(r344567)
+++ head/stand/common/bootstrap.h   Tue Feb 26 06:22:10 2019
(r344568)
@@ -330,6 +330,9 @@ struct arch_switch
 /* Probe ZFS pool(s), if needed. */
 void   (*arch_zfs_probe)(void);
 
+/* Return the hypervisor name/type or NULL if not virtualized. */
+const char *(*arch_hypervisor)(void);
+
 /* For kexec-type loaders, get ksegment structure */
 void   (*arch_kexec_kseg_get)(int *nseg, void **kseg);
 };
@@ -344,6 +347,10 @@ time_t time(time_t *tloc);
 
 #ifndef CTASSERT
 #defineCTASSERT(x) _Static_assert(x, "compile-time assertion 
failed")
+#endif
+
+#ifdef LOADER_VERIEXEC
+#include 
 #endif
 
 #endif /* !_BOOTSTRAP_H_ */

Modified: head/stand/common/interp_forth.c
==
--- head/stand/common/interp_forth.cTue Feb 26 06:17:23 2019
(r344567)
+++ head/stand/common/interp_forth.cTue Feb 26 06:22:10 2019
(r344568)
@@ -379,6 +379,13 @@ interp_include(const char *filename)
return(CMD_ERROR);
}
 
+#ifdef LOADER_VERIEXEC
+   if (verify_file(fd, filename, 0, VE_GUESS) < 0) {
+   close(fd);
+   sprintf(command_errbuf,"can't verify '%s'", filename);
+   return(CMD_ERROR);
+   }
+#endif
/*
 * Read the script into memory.
 */

Modified: head/stand/common/interp_simple.c
==
--- head/stand/common/interp_simple.c   Tue Feb 26 06:17:23 2019
(r344567)
+++ head/stand/common/interp_simple.c   Tue Feb 26 06:22:10 2019
(r344568)
@@ -96,6 +96,14 @@ interp_include(const char *filename)
return(CMD_ERROR);
}
 
+#ifdef LOADER_VERIEXEC
+   if (verify_file(fd, filename, 0, VE_GUESS) < 0) {
+   close(fd);
+   sprintf(command_errbuf,"can't verify '%s'", filename);
+   return(CMD_ERROR);
+   }
+#endif
+
/*
 * Read the script into memory.
 */

Modified: head/stand/common/load_elf.c
==
--- head/stand/common/load_elf.cTue Feb 26 06:17:23 2019
(r344567)
+++ head/stand/common/load_elf.cTue Feb 26 06:22:10 2019
(r344568)
@@ -245,6 +245,12 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef)
goto error;
}
 
+#ifdef LOADER_VERIEXEC
+   if (verify_file(ef->fd, filename, bytes_read, VE_MUST) < 0) {
+   err = EAUTH;
+   goto error;
+   }
+#endif
return (0);
 
 error:

Modified: head/stand/common/load_elf_obj.c
==
--- head/stand/common/load_elf_obj.cTue Feb 26 06:17:23 2019
(r344567)
+++ head/stand/common/load_elf_obj.cTue Feb 26 06:22:10 2019
(r344568)
@@ -129,6 +129,13 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest,
goto oerr;
}
 
+#ifdef LOADER_VERIEXEC
+   if (verif

Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-25 Thread Rodney W. Grimes
> Author: sjg
> Date: Tue Feb 26 06:17:23 2019
> New Revision: 344567
> URL: https://svnweb.freebsd.org/changeset/base/344567
> 
> Log:
>   Add verifying manifest loader for mac_veriexec
>   
>   This tool will verify a signed manifest and load contents into
>   mac_veriexec for storage
>   
>   Sponsored by:   Juniper Networks
>   Differential Revision:  D16575

Just a small nit, for future reference, from the template:
> Differential Revision:https://reviews.freebsd.org/D### (*full* phabric 
> URL needed).

...

-- 
Rod Grimes rgri...@freebsd.org
___
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: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-25 Thread Simon J. Gerraty
Author: sjg
Date: Tue Feb 26 06:17:23 2019
New Revision: 344567
URL: https://svnweb.freebsd.org/changeset/base/344567

Log:
  Add verifying manifest loader for mac_veriexec
  
  This tool will verify a signed manifest and load contents into
  mac_veriexec for storage
  
  Sponsored by: Juniper Networks
  Differential Revision:D16575

Added:
  head/sbin/veriexec/
  head/sbin/veriexec/Makefile   (contents, props changed)
  head/sbin/veriexec/Makefile.depend   (contents, props changed)
  head/sbin/veriexec/manifest_lexer.l   (contents, props changed)
  head/sbin/veriexec/manifest_parser.y   (contents, props changed)
  head/sbin/veriexec/veriexec.8   (contents, props changed)
  head/sbin/veriexec/veriexec.c   (contents, props changed)
  head/sbin/veriexec/veriexec.h   (contents, props changed)
Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/sbin/Makefile

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Tue Feb 26 06:11:01 2019
(r344566)
+++ head/etc/mtree/BSD.include.dist Tue Feb 26 06:17:23 2019
(r344567)
@@ -160,6 +160,8 @@
 ..
 usb
 ..
+veriexec
+..
 vkbd
 ..
 wi
@@ -353,6 +355,8 @@
 mac_mls
 ..
 mac_partition
+..
+mac_veriexec
 ..
 ..
 ssp

Modified: head/include/Makefile
==
--- head/include/Makefile   Tue Feb 26 06:11:01 2019(r344566)
+++ head/include/Makefile   Tue Feb 26 06:17:23 2019(r344567)
@@ -47,7 +47,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \
dev/hwpmc dev/hyperv \
dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \
dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
-   dev/speaker dev/tcp_log dev/vkbd dev/wi \
+   dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \
fs/procfs fs/smbfs fs/udf fs/unionfs \
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
@@ -60,6 +60,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
security/mac_mls security/mac_partition \
+   security/mac_veriexec \
sys/disk \
ufs/ffs ufs/ufs
 
@@ -157,7 +158,7 @@ copies: .PHONY .META
done; \
fi
 .endfor
-.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
 ${LSUBSUBDIRS}
+.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec}
 ${LSUBSUBDIRS}
cd ${SRCTOP}/sys; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
${SDESTDIR}${INCLUDEDIR}/$i
@@ -196,6 +197,9 @@ copies: .PHONY .META
cd ${SRCTOP}/sys/dev/pci; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
${SDESTDIR}${INCLUDEDIR}/dev/pci
+   cd ${SRCTOP}/sys/dev/veriexec; \
+   ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 veriexec_ioctl.h \
+   ${SDESTDIR}${INCLUDEDIR}/dev/veriexec
cd ${SRCTOP}/sys/fs/cd9660/; \
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${SDESTDIR}${INCLUDEDIR}/isofs/cd9660
@@ -264,7 +268,7 @@ symlinks: .PHONY .META
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h 
${SDESTDIR}${INCLUDEDIR}/$i; \
done
 .endfor
-.for i in 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
+.for i in 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec}
cd ${SRCTOP}/sys/$i; \
for h in *.h; do \
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h 
${SDESTDIR}${INCLUDEDIR}/$i; \
@@ -311,6 +315,11 @@ symlinks: .PHONY .META
for h in pcireg.h; do \
${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \
${SDESTDIR}${INCLUDEDIR}/dev/pci; \
+   done
+   cd ${SRCTOP}/sys/dev/veriexec; \
+   for h in veriexec_ioctl.h; do \
+   ln -fs ../../../../sys/dev/veriexec/$$h \
+   ${SDESTDIR}${INCLUDEDIR}/dev/veriexec; \
done
 .for i in ${LSUBSUBDIRS}
cd ${SRCTOP}/sys/$i; \

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Tue Feb 26 06:11:01 2019(r344566)
+++ head/sbin/Makefile  Tue Feb 26 06:17:23 2019(r344567)
@@ -87,6 +87,7 @@ SUBDIR.${MK_PF}+= pfctl
 SUBDIR.${MK_PF}+=  pflogd
 SUBDIR.${MK_QUOTAS}+=  quotacheck
 SUBDIR.${MK_ROUTED}+=  routed
+SUBDIR.${MK_VERIEXEC}+=veriex

Re: svn commit: r344562 - head/sys/ufs/ffs

2019-02-25 Thread Jason Harmening

On 2/25/19 9:46 PM, Bruce Evans wrote:


block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with 
large

pages.  MINBSIZE is 4096 in ffs (except in my version, it is 512).  The
default is 32768 in newfs.  I consider this excessive and only use it for
file systems with many files larger than 1GB, but it is the most common 
size.

It is larger than the large page size of 8192.


I think this is a case of filesystem logical block size vs. media sector 
size, right?  Here we're checking the devvp's block size, which I think 
should correspond to the sector size.  I'd expect cases of that being
greater than PAGE_SIZE to be uncommon, in fact geli warns when that is 
the case.   I probably should've made that clearer in the commit message.




ffs_getpages() already has an almost-never-used special case for small
block sizes.  It uses vnode_pager_generic_getpages() when !use_buf_pager
and the block_size <= PAGE_SIZE, else vfs_bio_getpages().  But
block_size <= PAGE_SIZE is unusual, and !use_buf_pager is also unusual,
and use_buf_pager is mostly a debugging sysctl, so little would be
lost but using vfs_bio_getpages() unconditionally.

Bruce

___
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: r344566 - in head: lib share/mk tools/build/options

2019-02-25 Thread Simon J. Gerraty
Author: sjg
Date: Tue Feb 26 06:11:01 2019
New Revision: 344566
URL: https://svnweb.freebsd.org/changeset/base/344566

Log:
  Enable build of libbearssl
  
  Reviewed by:  emaste
  Sponsored by: Juniper Networks
  Differential Revision:D16337

Added:
  head/tools/build/options/WITH_BEARSSL   (contents, props changed)
  head/tools/build/options/WITH_LOADER_VERIEXEC   (contents, props changed)
  head/tools/build/options/WITH_VERIEXEC   (contents, props changed)
Modified:
  head/lib/Makefile
  head/share/mk/src.libnames.mk
  head/share/mk/src.opts.mk

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Tue Feb 26 06:09:10 2019(r344565)
+++ head/lib/Makefile   Tue Feb 26 06:11:01 2019(r344566)
@@ -133,6 +133,7 @@ SUBDIR_DEPEND_libpcap= ofed
 # NB: keep these sorted by MK_* knobs
 
 SUBDIR.${MK_ATM}+= libngatm
+SUBDIR.${MK_BEARSSL}+= libbearssl libsecureboot
 SUBDIR.${MK_BLACKLIST}+=libblacklist
 SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
 SUBDIR.${MK_BSNMP}+=   libbsnmp
@@ -204,6 +205,7 @@ SUBDIR.${MK_TESTS}+=tests
 SUBDIR.${MK_UNBOUND}+= libunbound
 SUBDIR.${MK_USB}+= libusbhid libusb
 SUBDIR.${MK_OFED}+=ofed
+SUBDIR.${MK_VERIEXEC}+=libveriexec
 SUBDIR.${MK_ZFS}+= libbe
 
 .if !make(install)

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Tue Feb 26 06:09:10 2019
(r344565)
+++ head/share/mk/src.libnames.mk   Tue Feb 26 06:11:01 2019
(r344566)
@@ -210,6 +210,21 @@ _LIBRARIES+= \
osmvendor
 .endif
 
+.if ${MK_BEARSSL} == "yes"
+_INTERNALLIBS+= \
+   bearssl \
+   secureboot \
+
+LIBBEARSSL?=   ${LIBBEARSSLDIR}/libbearssl${PIE_SUFFIX}.a
+LIBSECUREBOOT?=${LIBSECUREBOOTDIR}/libsecureboot${PIE_SUFFIX}.a
+.endif
+
+.if ${MK_VERIEXEC} == "yes"
+_INTERNALLIBS+= veriexec
+
+LIBVERIEXEC?=  ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFIX}.a
+.endif
+
 # Each library's LIBADD needs to be duplicated here for static linkage of
 # 2nd+ order consumers.  Auto-generating this would be better.
 _DP_80211= sbuf bsdxml

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Tue Feb 26 06:09:10 2019(r344565)
+++ head/share/mk/src.opts.mk   Tue Feb 26 06:11:01 2019(r344566)
@@ -194,6 +194,7 @@ __DEFAULT_YES_OPTIONS = \
 ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
+BEARSSL \
 BSD_GREP \
 CLANG_EXTRAS \
 DTRACE_TESTS \
@@ -219,6 +220,8 @@ __DEFAULT_NO_OPTIONS = \
 __DEFAULT_DEPENDENT_OPTIONS= \
CLANG_FULL/CLANG \
LLVM_TARGET_ALL/CLANG \
+   LOADER_VERIEXEC/BEARSSL \
+   VERIEXEC/BEARSSL \
 
 # MK_*_SUPPORT options which default to "yes" unless their corresponding
 # MK_* variable is set to "no".

Added: head/tools/build/options/WITH_BEARSSL
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_BEARSSL   Tue Feb 26 06:11:01 2019
(r344566)
@@ -0,0 +1,11 @@
+.\" $FreeBSD$
+Build the BearSSL library.
+.Pp
+BearSSL is a tiny SSL library suitable for embedded environments.
+For details see
+.Lk http://www.BearSSL.org/
+.Pp
+This library is currently only used to perform
+signature verification and related operations
+for Verified Exec and
+.Xr loader 8 .

Added: head/tools/build/options/WITH_LOADER_VERIEXEC
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_LOADER_VERIEXEC   Tue Feb 26 06:11:01 
2019(r344566)
@@ -0,0 +1,7 @@
+.\" $FreeBSD$
+Enable building
+.Xr loader 8
+with support for verifcation similar to Verified Exec.
+.Pp
+It depends on
+.Va WITH_BEARSSL

Added: head/tools/build/options/WITH_VERIEXEC
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_VERIEXEC  Tue Feb 26 06:11:01 2019
(r344566)
@@ -0,0 +1,9 @@
+.\" $FreeBSD$
+Enable building
+.Xr veriexec 8
+which loads the contents of verified manifests into the kernel
+for use by
+.Xr mac_veriexec 4
+.Pp
+It depends on
+.Va WITH_BEARSSL
___
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: r344565 - in head/lib/libsecureboot: . h openpgp tests

2019-02-25 Thread Simon J. Gerraty
Author: sjg
Date: Tue Feb 26 06:09:10 2019
New Revision: 344565
URL: https://svnweb.freebsd.org/changeset/base/344565

Log:
  Add libsecureboot
  
  Used by loader and veriexec
  Depends on libbearssl
  
  Reviewed by:  emaste
  Sponsored by: Juniper Networks
  Differential Revision:D16335

Added:
  head/lib/libsecureboot/
  head/lib/libsecureboot/Makefile   (contents, props changed)
  head/lib/libsecureboot/Makefile.depend   (contents, props changed)
  head/lib/libsecureboot/Makefile.depend.host   (contents, props changed)
  head/lib/libsecureboot/Makefile.inc   (contents, props changed)
  head/lib/libsecureboot/Makefile.libsa.inc   (contents, props changed)
  head/lib/libsecureboot/README.rst   (contents, props changed)
  head/lib/libsecureboot/brf.c   (contents, props changed)
  head/lib/libsecureboot/h/
  head/lib/libsecureboot/h/libsecureboot.h   (contents, props changed)
  head/lib/libsecureboot/h/verify_file.h   (contents, props changed)
  head/lib/libsecureboot/libsecureboot-priv.h   (contents, props changed)
  head/lib/libsecureboot/local.trust.mk   (contents, props changed)
  head/lib/libsecureboot/openpgp/
  head/lib/libsecureboot/openpgp/Makefile.inc   (contents, props changed)
  head/lib/libsecureboot/openpgp/dearmor.c   (contents, props changed)
  head/lib/libsecureboot/openpgp/decode.c   (contents, props changed)
  head/lib/libsecureboot/openpgp/decode.h   (contents, props changed)
  head/lib/libsecureboot/openpgp/opgp_key.c   (contents, props changed)
  head/lib/libsecureboot/openpgp/opgp_sig.c   (contents, props changed)
  head/lib/libsecureboot/openpgp/packet.h   (contents, props changed)
  head/lib/libsecureboot/readfile.c   (contents, props changed)
  head/lib/libsecureboot/tests/
  head/lib/libsecureboot/tests/Makefile   (contents, props changed)
  head/lib/libsecureboot/tests/Makefile.depend.host   (contents, props changed)
  head/lib/libsecureboot/tests/tvo.c   (contents, props changed)
  head/lib/libsecureboot/vectx.c   (contents, props changed)
  head/lib/libsecureboot/veopen.c   (contents, props changed)
  head/lib/libsecureboot/vepcr.c   (contents, props changed)
  head/lib/libsecureboot/verify_file.c   (contents, props changed)
  head/lib/libsecureboot/vesigned.c   (contents, props changed)
  head/lib/libsecureboot/veta.c   (contents, props changed)
  head/lib/libsecureboot/vets.c   (contents, props changed)

Added: head/lib/libsecureboot/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libsecureboot/Makefile Tue Feb 26 06:09:10 2019
(r344565)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include 
+
+LIB= secureboot
+
+.include "Makefile.inc"
+
+INCS= h/libsecureboot.h
+
+.include 

Added: head/lib/libsecureboot/Makefile.depend
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libsecureboot/Makefile.depend  Tue Feb 26 06:09:10 2019
(r344565)
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+   gnu/lib/csu \
+   include \
+   include/xlocale \
+   lib/${CSU_DIR} \
+   lib/libc \
+   lib/libcompiler_rt \
+
+
+.include 
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif

Added: head/lib/libsecureboot/Makefile.depend.host
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libsecureboot/Makefile.depend.host Tue Feb 26 06:09:10 2019
(r344565)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+   lib/libstand \
+
+
+.include 
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif

Added: head/lib/libsecureboot/Makefile.inc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libsecureboot/Makefile.inc Tue Feb 26 06:09:10 2019
(r344565)
@@ -0,0 +1,133 @@
+# $FreeBSD$
+
+.if empty(BEARSSL)
+.include "../libbearssl/Makefile.inc"
+.endif
+
+.if !target(_${__this}_)
+_${__this}_:
+
+libsecureboot_src:= ${.PARSEDIR}
+
+CFLAGS+= -I${libsecureboot_src}/h
+
+.PATH: ${.PARSEDIR}
+
+SRCS+= \
+   readfile.c \
+   brf.c \
+   vesigned.c \
+   vets.c
+
+.if ${.CURDIR:M*libsecureboot*} != ""
+SRCS+= veta.c
+.endif
+
+CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U}
+
+# we use a couple of files from ${BEARSSL}/tools
+BRSSL_CFLAGS+= -I${BEARSSL}/tools
+BRSSL_SRCS+= \
+   ${BEARSSL}/tools/xmem.c \
+   ${BEARSSL}/tools/vector.c
+
+# we do not need/want nested objdirs
+OBJS_SRCS_FILTER = T R
+
+SRCS+= ${BRSSL_SRCS}
+
+
+# extract the last cert from a chain (should be rootCA)
+_LAST_PEM_USE: .USE
+   sed "1,`grep -n .-END ${.ALLSRC:M*.pem}

svn commit: r344564 - in head: contrib/bearssl contrib/bearssl/tools lib/libbearssl

2019-02-25 Thread Simon J. Gerraty
Author: sjg
Date: Tue Feb 26 05:59:22 2019
New Revision: 344564
URL: https://svnweb.freebsd.org/changeset/base/344564

Log:
  Add libbearssl
  
  Disabled by default, used by loader and sbin/veriexec
  
  Reviewed by:  emaste
  Sponsored by: Juniper Networks
  Differential Revision: D16334

Added:
  head/contrib/bearssl/
 - copied from r343285, vendor/bearssl/dist/
  head/lib/libbearssl/
  head/lib/libbearssl/Makefile   (contents, props changed)
  head/lib/libbearssl/Makefile.depend   (contents, props changed)
  head/lib/libbearssl/Makefile.inc   (contents, props changed)
  head/lib/libbearssl/Makefile.libsa.inc   (contents, props changed)
Modified:
  head/contrib/bearssl/tools/brssl.h
  head/contrib/bearssl/tools/xmem.c

Modified: head/contrib/bearssl/tools/brssl.h
==
--- vendor/bearssl/dist/tools/brssl.h   Mon Jan 21 20:58:33 2019
(r343285)
+++ head/contrib/bearssl/tools/brssl.h  Tue Feb 26 05:59:22 2019
(r344564)
@@ -25,10 +25,15 @@
 #ifndef BRSSL_H__
 #define BRSSL_H__
 
+#ifndef _STANDALONE
 #include 
 #include 
 #include 
 #include 
+
+#elif !defined(STAND_H) 
+#include  
+#endif 
 
 #include "bearssl.h"
 

Modified: head/contrib/bearssl/tools/xmem.c
==
--- vendor/bearssl/dist/tools/xmem.cMon Jan 21 20:58:33 2019
(r343285)
+++ head/contrib/bearssl/tools/xmem.c   Tue Feb 26 05:59:22 2019
(r344564)
@@ -35,9 +35,13 @@ xmalloc(size_t len)
}
buf = malloc(len);
if (buf == NULL) {
+#ifndef _STANDALONE
fprintf(stderr, "ERROR: could not allocate %lu byte(s)\n",
(unsigned long)len);
exit(EXIT_FAILURE);
+#else 
+; 
+#endif
}
return buf;
 }
@@ -90,9 +94,13 @@ xpkeydup(const br_x509_pkey *pk)
pk2->key.ec.qlen = pk->key.ec.qlen;
break;
default:
+#ifndef _STANDALONE
fprintf(stderr, "Unknown public key type: %u\n",
(unsigned)pk->key_type);
exit(EXIT_FAILURE);
+#else 
+; 
+#endif
}
return pk2;
 }
@@ -111,9 +119,13 @@ xfreepkey(br_x509_pkey *pk)
xfree(pk->key.ec.q);
break;
default:
+#ifndef _STANDALONE
fprintf(stderr, "Unknown public key type: %u\n",
(unsigned)pk->key_type);
exit(EXIT_FAILURE);
+#else 
+; 
+#endif
}
xfree(pk);
}

Added: head/lib/libbearssl/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libbearssl/MakefileTue Feb 26 05:59:22 2019
(r344564)
@@ -0,0 +1,277 @@
+# $FreeBSD$
+
+# This is a reach over build of BearSSL (www.BearSSL.org)
+
+.include 
+
+LIB= bearssl
+
+# pick up SRCS used by libsa
+.include "Makefile.libsa.inc"
+
+SRCS+= \
+   codec/dec16be.c \
+   codec/dec16le.c \
+   codec/dec32le.c \
+   codec/dec64le.c \
+   codec/enc16be.c \
+   codec/enc16le.c \
+   codec/enc32le.c \
+   codec/enc64le.c \
+   codec/pemenc.c \
+   ec/ec_all_m15.c \
+   ec/ec_c25519_i15.c \
+   ec/ec_c25519_i31.c \
+   ec/ec_c25519_m15.c \
+   ec/ec_curve25519.c \
+   ec/ec_keygen.c \
+   ec/ec_p256_m15.c \
+   ec/ec_prime_i15.c \
+   ec/ecdsa_default_sign_asn1.c \
+   ec/ecdsa_default_sign_raw.c \
+   ec/ecdsa_default_vrfy_raw.c \
+   ec/ecdsa_i15_bits.c \
+   ec/ecdsa_i15_sign_asn1.c \
+   ec/ecdsa_i15_sign_raw.c \
+   ec/ecdsa_i15_vrfy_asn1.c \
+   ec/ecdsa_i15_vrfy_raw.c \
+   ec/ecdsa_i31_sign_asn1.c \
+   ec/ecdsa_i31_sign_raw.c \
+   ec/ecdsa_rta.c \
+   hash/dig_oid.c \
+   hash/dig_size.c \
+   hash/ghash_ctmul.c \
+   hash/ghash_ctmul32.c \
+   hash/ghash_ctmul64.c \
+   hash/ghash_pwr8.c \
+   hash/md5.c \
+   hash/md5sha1.c \
+
+
+# this one does not compile for amd64
+# we do not need it
+#  hash/ghash_pclmul.c \
+
+SRCS+= \
+   int/i15_add.c \
+   int/i15_bitlen.c \
+   int/i15_decmod.c \
+   int/i15_decode.c \
+   int/i15_decred.c \
+   int/i15_encode.c \
+   int/i15_fmont.c \
+   int/i15_iszero.c \
+   int/i15_moddiv.c \
+   int/i15_modpow.c \
+   int/i15_modpow2.c \
+   int/i15_montmul.c \
+   int/i15_mulacc.c \
+   int/i15_muladd.c \
+   int/i15_ninv15.c \
+   int/i15_reduce.c \
+   int/i15_rshift.c \
+   int/i15_sub.c \
+   int/i15_tmont.c \
+   int/i31_decred.c \
+   int/i31_mulacc.c \
+   int/i31_reduce.c \
+   int/i32_add.c \
+   int/i32_bitlen.c \
+   int/i32_decmod.c \
+   int/i32_decode.c \
+   int/i32_decred.c \
+   int/i32_encode.c

Re: svn commit: r344562 - head/sys/ufs/ffs

2019-02-25 Thread Bruce Evans

On Tue, 26 Feb 2019, Jason A. Harmening wrote:


...
Log:
 FFS: allow sendfile(2) to work with block sizes greater than the page size

 Implement ffs_getpages_async(), which when possible calls the asynchronous
 flavor of the generic pager's getpages function. When the underlying
 block size is larger than the system page size, however, it will invoke
 the (synchronous) buffer cache pager, followed by a call to the client
 completion routine. This retains true asynchronous completion in the most
 common (block size <= page size) case, which is important for the performance
 of the new sendfile(2). The behavior in the larger block size case mirrors
 the default implementation of VOP_GETPAGES_ASYNC, which most other
 filesystems use anyway as they do not override the getpages_async method.


block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with large
pages.  MINBSIZE is 4096 in ffs (except in my version, it is 512).  The
default is 32768 in newfs.  I consider this excessive and only use it for
file systems with many files larger than 1GB, but it is the most common size.
It is larger than the large page size of 8192.

ffs_getpages() already has an almost-never-used special case for small
block sizes.  It uses vnode_pager_generic_getpages() when !use_buf_pager
and the block_size <= PAGE_SIZE, else vfs_bio_getpages().  But
block_size <= PAGE_SIZE is unusual, and !use_buf_pager is also unusual,
and use_buf_pager is mostly a debugging sysctl, so little would be
lost but using vfs_bio_getpages() unconditionally.

Bruce
___
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: r344557 - stable/12/release/tools

2019-02-25 Thread Colin Percival
On 2/25/19 6:20 PM, Rodney W. Grimes wrote:
>> Author: cperciva
>> Date: Tue Feb 26 01:29:40 2019
>> New Revision: 344557
>> URL: https://svnweb.freebsd.org/changeset/base/344557
>>
>> Log:
>>   MFC r344315:
>> Fix sed script to insert Amazon NTP server into ntp.conf once rather
>> than twice.
> 
> Does this issue also exist in stable/11, as iirc 11.3 would be
> the next release that is coming on the schedule.
Fixed.  I forgot that we were expecting an 11.3.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
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: r344563 - stable/11/release/tools

2019-02-25 Thread Colin Percival
Author: cperciva
Date: Tue Feb 26 05:37:49 2019
New Revision: 344563
URL: https://svnweb.freebsd.org/changeset/base/344563

Log:
  MFC r344315:
Fix sed script to insert Amazon NTP server into ntp.conf once rather
than twice.
  
  Reminded by:  rgrimes

Modified:
  stable/11/release/tools/ec2.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/release/tools/ec2.conf
==
--- stable/11/release/tools/ec2.confTue Feb 26 04:56:10 2019
(r344562)
+++ stable/11/release/tools/ec2.confTue Feb 26 05:37:49 2019
(r344563)
@@ -83,7 +83,7 @@ vm_extra_pre_umount() {
 
# Use the NTP service provided by Amazon
sed -i '' -e 's/^pool/#pool/' \
-   -e 's/^#server.*/server 169.254.169.123 iburst/' \
+   -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \
${DESTDIR}/etc/ntp.conf
 
# The first time the AMI boots, the installed "first boot" scripts
___
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: r344562 - head/sys/ufs/ffs

2019-02-25 Thread Jason A. Harmening
Author: jah
Date: Tue Feb 26 04:56:10 2019
New Revision: 344562
URL: https://svnweb.freebsd.org/changeset/base/344562

Log:
  FFS: allow sendfile(2) to work with block sizes greater than the page size
  
  Implement ffs_getpages_async(), which when possible calls the asynchronous
  flavor of the generic pager's getpages function. When the underlying
  block size is larger than the system page size, however, it will invoke
  the (synchronous) buffer cache pager, followed by a call to the client
  completion routine. This retains true asynchronous completion in the most
  common (block size <= page size) case, which is important for the performance
  of the new sendfile(2). The behavior in the larger block size case mirrors
  the default implementation of VOP_GETPAGES_ASYNC, which most other
  filesystems use anyway as they do not override the getpages_async method.
  
  PR:   235708
  Reported by:  pho
  Reviewed by:  kib, glebius
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D19340

Modified:
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/ufs/ffs/ffs_vnops.c
==
--- head/sys/ufs/ffs/ffs_vnops.cTue Feb 26 04:50:46 2019
(r344561)
+++ head/sys/ufs/ffs/ffs_vnops.cTue Feb 26 04:56:10 2019
(r344562)
@@ -111,6 +111,7 @@ extern int  ffs_rawread(struct vnode *vp, struct uio *u
 static vop_fdatasync_t ffs_fdatasync;
 static vop_fsync_t ffs_fsync;
 static vop_getpages_t  ffs_getpages;
+static vop_getpages_async_tffs_getpages_async;
 static vop_lock1_t ffs_lock;
 static vop_read_t  ffs_read;
 static vop_write_t ffs_write;
@@ -132,7 +133,7 @@ struct vop_vector ffs_vnodeops1 = {
.vop_fsync =ffs_fsync,
.vop_fdatasync =ffs_fdatasync,
.vop_getpages = ffs_getpages,
-   .vop_getpages_async =   vnode_pager_local_getpages_async,
+   .vop_getpages_async =   ffs_getpages_async,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -154,7 +155,7 @@ struct vop_vector ffs_vnodeops2 = {
.vop_fsync =ffs_fsync,
.vop_fdatasync =ffs_fdatasync,
.vop_getpages = ffs_getpages,
-   .vop_getpages_async =   vnode_pager_local_getpages_async,
+   .vop_getpages_async =   ffs_getpages_async,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -1742,3 +1743,25 @@ ffs_getpages(struct vop_getpages_args *ap)
return (vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind,
ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz));
 }
+
+static int
+ffs_getpages_async(struct vop_getpages_async_args *ap)
+{
+   struct vnode *vp;
+   struct ufsmount *um;
+   int error;
+
+   vp = ap->a_vp;
+   um = VFSTOUFS(vp->v_mount);
+
+   if (um->um_devvp->v_bufobj.bo_bsize <= PAGE_SIZE)
+   return (vnode_pager_generic_getpages(vp, ap->a_m, ap->a_count,
+   ap->a_rbehind, ap->a_rahead, ap->a_iodone, ap->a_arg));
+
+   error = vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind,
+   ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz);
+   ap->a_iodone(ap->a_arg, ap->a_m, ap->a_count, error);
+
+   return (error);
+}
+
___
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: r344561 - head/sys/vm

2019-02-25 Thread Jason A. Harmening
Author: jah
Date: Tue Feb 26 04:50:46 2019
New Revision: 344561
URL: https://svnweb.freebsd.org/changeset/base/344561

Log:
  Fix incorrect assertion in vnode_pager_generic_getpages()
  
  Reviewed by:  kib, glebius
  MFC after:1 week

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Tue Feb 26 03:37:12 2019(r344560)
+++ head/sys/vm/vnode_pager.c   Tue Feb 26 04:50:46 2019(r344561)
@@ -793,7 +793,7 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page
 
KASSERT(foff < object->un_pager.vnp.vnp_size,
("%s: page %p offset beyond vp %p size", __func__, m[0], vp));
-   KASSERT(count <= sizeof(bp->b_pages),
+   KASSERT(count <= nitems(bp->b_pages),
("%s: requested %d pages", __func__, count));
 
/*
___
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: r344560 - head/stand/efi/loader/arch/i386

2019-02-25 Thread Kyle Evans
Author: kevans
Date: Tue Feb 26 03:37:12 2019
New Revision: 344560
URL: https://svnweb.freebsd.org/changeset/base/344560

Log:
  stand: Remove unused i386 EFI MD bits
  
  r328169 removed the copy of bootinfo that would've made this somewhat
  functional. However, this is irrelevant- earlier work in r292338 was done to
  exit boot services in the MI bi_load() rather than having N copies of the
  GetMemoryMap/ExitBootServices dance.
  
  i386 never quite caught up to that; ldr_enter was still being called but
  the prereq for that, ldr_bootinfo, was no longer. As a consequence, this
  ExitBootServices() was being called with a mapkey=0, clearly bogus, and
  reportedly breaking the boot in some instances.
  
  Reported by:  bcran
  MFC after:1 week

Deleted:
  head/stand/efi/loader/arch/i386/efimd.c
Modified:
  head/stand/efi/loader/arch/i386/Makefile.inc
  head/stand/efi/loader/arch/i386/elf32_freebsd.c

Modified: head/stand/efi/loader/arch/i386/Makefile.inc
==
--- head/stand/efi/loader/arch/i386/Makefile.incTue Feb 26 03:34:47 
2019(r344559)
+++ head/stand/efi/loader/arch/i386/Makefile.incTue Feb 26 03:37:12 
2019(r344560)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 SRCS+= start.S \
-   efimd.c \
elf32_freebsd.c \
exec.c
 

Modified: head/stand/efi/loader/arch/i386/elf32_freebsd.c
==
--- head/stand/efi/loader/arch/i386/elf32_freebsd.c Tue Feb 26 03:34:47 
2019(r344559)
+++ head/stand/efi/loader/arch/i386/elf32_freebsd.c Tue Feb 26 03:37:12 
2019(r344560)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 
 extern void __exec(caddr_t addr, ...);
 extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
-extern int ldr_enter(const char *kernel);
 
 static int elf32_exec(struct preloaded_file *amp);
 static int elf32_obj_exec(struct preloaded_file *amp);
@@ -84,8 +83,6 @@ elf32_exec(struct preloaded_file *fp)
 entry = ehdr->e_entry & 0xff;
 
 printf("Start @ 0x%x ...\n", entry);
-
-ldr_enter(fp->f_name);
 
 dev_cleanup();
 __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, 
kernend);
___
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: r344559 - head/sbin/ifconfig

2019-02-25 Thread Alan Somers
Author: asomers
Date: Tue Feb 26 03:34:47 2019
New Revision: 344559
URL: https://svnweb.freebsd.org/changeset/base/344559

Log:
  ifconfig: eliminate trailing whitespace
  
  Eliminate trailing whitespace on inet, inet6, and groups lines. I think the
  "list txpower" command will still show some, but I'm not able to test that.
  
  PR: 153731
  Reported-by: Nikolay Denev 
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D19004

Modified:
  head/sbin/ifconfig/af_inet.c
  head/sbin/ifconfig/af_inet6.c
  head/sbin/ifconfig/ifconfig.c
  head/sbin/ifconfig/ifgroup.c

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cTue Feb 26 03:28:14 2019
(r344558)
+++ head/sbin/ifconfig/af_inet.cTue Feb 26 03:34:47 2019
(r344559)
@@ -107,16 +107,16 @@ in_status(int s __unused, const struct ifaddrs *ifa)
if (cidr == 0)
break;
}
-   printf("/%d ", cidr);
+   printf("/%d", cidr);
} else if (f_inet != NULL && strcmp(f_inet, "dotted") == 0)
-   printf(" netmask %s ", inet_ntoa(sin->sin_addr));
+   printf(" netmask %s", inet_ntoa(sin->sin_addr));
else
-   printf(" netmask 0x%lx ", (unsigned 
long)ntohl(sin->sin_addr.s_addr));
+   printf(" netmask 0x%lx", (unsigned 
long)ntohl(sin->sin_addr.s_addr));
 
if (ifa->ifa_flags & IFF_BROADCAST) {
sin = (struct sockaddr_in *)ifa->ifa_broadaddr;
if (sin != NULL && sin->sin_addr.s_addr != 0)
-   printf("broadcast %s ", inet_ntoa(sin->sin_addr));
+   printf(" broadcast %s", inet_ntoa(sin->sin_addr));
}
 
print_vhid(ifa, " ");

Modified: head/sbin/ifconfig/af_inet6.c
==
--- head/sbin/ifconfig/af_inet6.c   Tue Feb 26 03:28:14 2019
(r344558)
+++ head/sbin/ifconfig/af_inet6.c   Tue Feb 26 03:34:47 2019
(r344559)
@@ -247,49 +247,49 @@ in6_status(int s __unused, const struct ifaddrs *ifa)
if (sin == NULL)
sin = &null_sin;
if (f_inet6 != NULL && strcmp(f_inet6, "cidr") == 0)
-   printf("/%d ", prefix(&sin->sin6_addr,
+   printf("/%d", prefix(&sin->sin6_addr,
sizeof(struct in6_addr)));
else
-   printf(" prefixlen %d ", prefix(&sin->sin6_addr,
+   printf(" prefixlen %d", prefix(&sin->sin6_addr,
sizeof(struct in6_addr)));
 
if ((flags6 & IN6_IFF_ANYCAST) != 0)
-   printf("anycast ");
+   printf(" anycast");
if ((flags6 & IN6_IFF_TENTATIVE) != 0)
-   printf("tentative ");
+   printf(" tentative");
if ((flags6 & IN6_IFF_DUPLICATED) != 0)
-   printf("duplicated ");
+   printf(" duplicated");
if ((flags6 & IN6_IFF_DETACHED) != 0)
-   printf("detached ");
+   printf(" detached");
if ((flags6 & IN6_IFF_DEPRECATED) != 0)
-   printf("deprecated ");
+   printf(" deprecated");
if ((flags6 & IN6_IFF_AUTOCONF) != 0)
-   printf("autoconf ");
+   printf(" autoconf");
if ((flags6 & IN6_IFF_TEMPORARY) != 0)
-   printf("temporary ");
+   printf(" temporary");
if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0)
-   printf("prefer_source ");
+   printf(" prefer_source");
 
if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id)
-   printf("scopeid 0x%x ",
+   printf(" scopeid 0x%x",
((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id);
 
if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) {
-   printf("pltime ");
+   printf(" pltime");
if (lifetime.ia6t_preferred) {
-   printf("%s ", lifetime.ia6t_preferred < now.tv_sec
+   printf(" %s", lifetime.ia6t_preferred < now.tv_sec
? "0" :
sec2str(lifetime.ia6t_preferred - now.tv_sec));
} else
-   printf("infty ");
+   printf(" infty");
 
-   printf("vltime ");
+   printf(" vltime");
if (lifetime.ia6t_expire) {
-   printf("%s ", lifetime.ia6t_expire < now.tv_sec
+   printf(" %s", lifetime.ia6t_expire < now.tv_sec
? "0" :
sec2str(lifetime.ia6t_expire - now.tv_sec));
} else
-   printf("infty ");
+   printf(" infty");
}
 
 

Re: svn commit: r344487 - in head/sys: conf gnu/gcov

2019-02-25 Thread Rodney W. Grimes
> > The modest increase in activation energy for that task seems worth it
> > for the short-term gains of reduced integration cost (this code will
> > greatly improve our ZFS-on-Linux test coverage.)
> >
> > Rod rightly points out that we haven't accepted SPDX tags alone as
> > license statements.  The standard GPL v2.0 boiler plate should be added
> > to this file along side the tag.
> 
> I've copied the full copyright attribution that is in the
> corresponding files on Linux. Is there some reason why FreeBSD
> requires the files to be inflated with the full license text where the
> original lacks it?

I think for a few reasons, I doubt you copied the whole distribution
that this file came from, as I am sure that distribution included
a LICENSE file.  Second if you actually read the GPL v2 documentation
and follow what it says it says you must do this, just because some
one else does not follow the rules of what the GPL v2 says does not
give us to knowingling not do it.  Third this is a particular dangerious
area for BSD to be mixing a GPL code with its kernel, to my knowlege
we have never had any gpl code in the kernel, no have we ever
allowed it, but thats a seperate argument, that should be made.

> > An additional issue is that the a warning tag was not added to
> > sys/conf/files.  A warning along the lines of:
> >
> > warning "kernel contains GPLv2 licensed GCOV"
> >
> > needs to be added.
> 
> Yup.
Thanks

> >
> > This commit needed more through review.
> 
> How would this be achieved:? I had several people on the review and no
> one had substantive feedback.

I have very seriuos concerns how you can even make that comment now
given that ngie@ pointed out during the review that this GPL code
and you dismissed it as a non issue.  This shows lack of knowlege
as to the projects GPL goals, and lack of concern that you might
of wanted to ask first, rather than now have to deal with it post
commit.

When ngie@ pointed out an issue you could of posted to a list with
your review asking for more people.  Everyone should strive to find
reviewers, if the patch doesn't trigger enough herard rules (which
we should also work on, but seems the phabricator admins are deaf
or non existance as multiple requests go unanswered), it is very
easy to go drop a link to your review in an appropriate mailling
list -current being choice of last resort.

If you do that I am pretty sure you'll get plenty of feedback.
> 
> >
> > We intend to update our license policy to require core sign off for
> > new GPL code to ensure we're not adding new, tightly integrated
> > dependencies, to document that we're doing so knowingly, and
> > to make sure steps aren't missed.  The current document is at:
> > https://www.freebsd.org/internal/software-license.html

Given the high push in the last few years to be GPL free, and that
being well publically aired at conferences and in commit mail as
we try to achive that goal I can not see why here do we need to
add policy for what really should be common knowledge, yet in
areas that we clearly do not follow or have policy there seems
to be no reason what so ever to fix what we dont follow or add
what we do want.

IMHO, this commit should be a huge red flag, we seem to have
a problem Houston, in communications!

> -M
-- 
Rod Grimes rgri...@freebsd.org
___
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: r344557 - stable/12/release/tools

2019-02-25 Thread Rodney W. Grimes
> Author: cperciva
> Date: Tue Feb 26 01:29:40 2019
> New Revision: 344557
> URL: https://svnweb.freebsd.org/changeset/base/344557
> 
> Log:
>   MFC r344315:
> Fix sed script to insert Amazon NTP server into ntp.conf once rather
> than twice.
> 
> Modified:
>   stable/12/release/tools/ec2.conf
> Directory Properties:
>   stable/12/   (props changed)

Does this issue also exist in stable/11, as iirc 11.3 would be
the next release that is coming on the schedule.


> Modified: stable/12/release/tools/ec2.conf
> ==
> --- stable/12/release/tools/ec2.conf  Mon Feb 25 23:49:58 2019
> (r344556)
> +++ stable/12/release/tools/ec2.conf  Tue Feb 26 01:29:40 2019
> (r344557)
> @@ -96,7 +96,7 @@ vm_extra_pre_umount() {
>  
>   # Use the NTP service provided by Amazon
>   sed -i '' -e 's/^pool/#pool/' \
> - -e 's/^#server.*/server 169.254.169.123 iburst/' \
> + -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \
>   ${DESTDIR}/etc/ntp.conf
>  
>   # The first time the AMI boots, the installed "first boot" scripts
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r344557 - stable/12/release/tools

2019-02-25 Thread Colin Percival
Author: cperciva
Date: Tue Feb 26 01:29:40 2019
New Revision: 344557
URL: https://svnweb.freebsd.org/changeset/base/344557

Log:
  MFC r344315:
Fix sed script to insert Amazon NTP server into ntp.conf once rather
than twice.

Modified:
  stable/12/release/tools/ec2.conf
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/release/tools/ec2.conf
==
--- stable/12/release/tools/ec2.confMon Feb 25 23:49:58 2019
(r344556)
+++ stable/12/release/tools/ec2.confTue Feb 26 01:29:40 2019
(r344557)
@@ -96,7 +96,7 @@ vm_extra_pre_umount() {
 
# Use the NTP service provided by Amazon
sed -i '' -e 's/^pool/#pool/' \
-   -e 's/^#server.*/server 169.254.169.123 iburst/' \
+   -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \
${DESTDIR}/etc/ntp.conf
 
# The first time the AMI boots, the installed "first boot" scripts
___
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: r344487 - in head/sys: conf gnu/gcov

2019-02-25 Thread K. Macy
> We had a brief discussion of this commit within a subset of core.  This
> addition of GPLv2 code is fine as the code is easily removal to a module
> (per kmoore@) should the day come that we're read to evict all GPL code.

I don't execute the ctors until coverage is enabled because I have to
manually find the symbols. The linker doesn't actually generate a ctor
section for functions in text.startup in spite of what Juniper's
linker commit would lead one to believe - presumably they have a
private linker script in addition to a private gcov port.  Thus, it
really could just work fine as a module. Nonetheless, everything to be
profiled needs to be compiled with instrumentation, so separating it
out makes very little sense to me. Although, I suppose ctfconvert +
dtrace module is somewhat analogous.

> The modest increase in activation energy for that task seems worth it
> for the short-term gains of reduced integration cost (this code will
> greatly improve our ZFS-on-Linux test coverage.)
>
> Rod rightly points out that we haven't accepted SPDX tags alone as
> license statements.  The standard GPL v2.0 boiler plate should be added
> to this file along side the tag.

I've copied the full copyright attribution that is in the
corresponding files on Linux. Is there some reason why FreeBSD
requires the files to be inflated with the full license text where the
original lacks it?

>
> An additional issue is that the a warning tag was not added to
> sys/conf/files.  A warning along the lines of:
>
> warning "kernel contains GPLv2 licensed GCOV"
>
> needs to be added.

Yup.

>
> This commit needed more through review.

How would this be achieved:? I had several people on the review and no
one had substantive feedback.

>
> We intend to update our license policy to require core sign off for
> new GPL code to ensure we're not adding new, tightly integrated
> dependencies, to document that we're doing so knowingly, and
> to make sure steps aren't missed.  The current document is at:
> https://www.freebsd.org/internal/software-license.html

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


svn commit: r344556 - head/sys/dev/spibus

2019-02-25 Thread Ian Lepore
Author: ian
Date: Mon Feb 25 23:49:58 2019
New Revision: 344556
URL: https://svnweb.freebsd.org/changeset/base/344556

Log:
  Set maximum bus clock speed from hints when attaching hinted spibus(4) 
children.
  
  Some devices (such as spigen(4)) document that this works, but it appears 
that the
  code to implement it never got added.

Modified:
  head/sys/dev/spibus/spibus.c

Modified: head/sys/dev/spibus/spibus.c
==
--- head/sys/dev/spibus/spibus.cMon Feb 25 23:45:36 2019
(r344555)
+++ head/sys/dev/spibus/spibus.cMon Feb 25 23:49:58 2019
(r344556)
@@ -216,6 +216,7 @@ spibus_hinted_child(device_t bus, const char *dname, i
child = BUS_ADD_CHILD(bus, 0, dname, dunit);
devi = SPIBUS_IVAR(child);
devi->mode = SPIBUS_MODE_NONE;
+   resource_int_value(dname, dunit, "clock", &devi->clock);
resource_int_value(dname, dunit, "cs", &devi->cs);
resource_int_value(dname, dunit, "mode", &devi->mode);
 }
___
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: r344555 - head/usr.sbin/makefs

2019-02-25 Thread Maxim Sobolev
Author: sobomax
Date: Mon Feb 25 23:45:36 2019
New Revision: 344555
URL: https://svnweb.freebsd.org/changeset/base/344555

Log:
  Improve error handling: bail out if one of the files scheduled
  to go to the FS image we are making cannot be read (e.g. EPERM).
  Current behaviour when we issue waring but still proceeed and
  return success is definitely not correct: masking out error
  condition as well as making a slighly inconsistent FS where
  attempt to access the file in question ends up in EBADF. See
  linked DR for details.
  
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D18584

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Mon Feb 25 22:11:44 2019(r344554)
+++ head/usr.sbin/makefs/ffs.c  Mon Feb 25 23:45:36 2019(r344555)
@@ -932,8 +932,7 @@ ffs_write_file(union dinode *din, uint32_t ino, void *
if (isfile) {
fbuf = emalloc(ffs_opts->bsize);
if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) {
-   warn("Can't open `%s' for reading", (char *)buf);
-   goto leave_ffs_write_file;
+   err(EXIT_FAILURE, "Can't open `%s' for reading", (char 
*)buf);
}
} else {
p = buf;
@@ -987,8 +986,6 @@ ffs_write_file(union dinode *din, uint32_t ino, void *
   
  write_inode_and_leave:
ffs_write_inode(&in.i_din, in.i_number, fsopts);
-
- leave_ffs_write_file:
if (fbuf)
free(fbuf);
if (ffd != -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: r344554 - head

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 22:11:44 2019
New Revision: 344554
URL: https://svnweb.freebsd.org/changeset/base/344554

Log:
  After r344530, remove leading slashes from libprivateifconfig lines in
  ObsoleteFiles.inc.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Feb 25 21:59:01 2019(r344553)
+++ head/ObsoleteFiles.inc  Mon Feb 25 22:11:44 2019(r344554)
@@ -39,8 +39,8 @@
 # done
 
 # 20190222: libifconfig made INTERNALLIB
-OLD_FILES+=/usr/lib/libprivateifconfig.a
-OLD_FILES+=/usr/lib/libprivateifconfig_p.a
+OLD_FILES+=usr/lib/libprivateifconfig.a
+OLD_FILES+=usr/lib/libprivateifconfig_p.a
 # 20190131: pfil(9) changed
 OLD_FILES+=usr/share/man/man9/pfil_hook_get.9
 OLD_FILES+=usr/share/man/man9/pfil_rlock.9
___
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: r344553 - head/sys/dev/asmc

2019-02-25 Thread David Bright
Author: dab
Date: Mon Feb 25 21:59:01 2019
New Revision: 344553
URL: https://svnweb.freebsd.org/changeset/base/344553

Log:
  asmc: Add support for Mac mini 2,1
  
  PR:   235798
  Submitted by: Trev 
  Reported by:  Trev 
  MFC after:1 week

Modified:
  head/sys/dev/asmc/asmc.c
  head/sys/dev/asmc/asmcvar.h

Modified: head/sys/dev/asmc/asmc.c
==
--- head/sys/dev/asmc/asmc.cMon Feb 25 21:58:19 2019(r344552)
+++ head/sys/dev/asmc/asmc.cMon Feb 25 21:59:01 2019(r344553)
@@ -259,6 +259,15 @@ struct asmc_model asmc_models[] = {
  ASMC_MM_TEMPS, ASMC_MM_TEMPNAMES, ASMC_MM_TEMPDESCS
},
 
+/* The Mac Mini 2,1 has no SMS */
+{
+  "Macmini2,1", "Apple SMC Mac Mini 2,1",
+  ASMC_SMS_FUNCS_DISABLED,
+  ASMC_FAN_FUNCS,
+  ASMC_LIGHT_FUNCS_DISABLED,
+  ASMC_MM21_TEMPS, ASMC_MM21_TEMPNAMES, ASMC_MM21_TEMPDESCS
+},
+
/* The Mac Mini 3,1 has no SMS */
{
  "Macmini3,1", "Apple SMC Mac Mini 3,1",

Modified: head/sys/dev/asmc/asmcvar.h
==
--- head/sys/dev/asmc/asmcvar.h Mon Feb 25 21:58:19 2019(r344552)
+++ head/sys/dev/asmc/asmcvar.h Mon Feb 25 21:59:01 2019(r344553)
@@ -341,6 +341,24 @@ struct asmc_softc {
 #define ASMC_MM_TEMPDESCS  { "Northbridge Point 1", \
  "Northbridge Point 2" }
 
+#define ASMC_MM21_TEMPS{ "TA0P", "TC0D", \
+ "TC0H", "TC0P", \
+ "TC1P", "TN0P", \
+ "TN1P", NULL }
+
+#define ASMC_MM21_TEMPNAMES{ "ambient_air", "cpu_die", \
+ "cpu_heatsink", "cpu_proximity1", \
+ "cpu_proximity2", "northbridge_proximity1", \
+ "northbridge_proximity2", }
+
+#define ASMC_MM21_TEMPDESCS{ "Ambient Air Temperature" \
+ "CPU Die Core Temperature", \
+ "CPU Heatsink Temperature", \
+ "CPU Proximity 1 Temperature", \
+ "CPU Proximity 2 Temperature", \
+ "Northbridge Proximity 1 Temperature", \
+ "Northbridge Proximity 2 Temperature", }
+
 #define ASMC_MM31_TEMPS{ "TC0D", "TC0H", \
  "TC0P", "TH0P", \
  "TN0D", "TN0P", \
___
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: r344552 - in head: sbin/fsck_ffs sbin/fsdb sys/ufs/ffs

2019-02-25 Thread Kirk McKusick
Author: mckusick
Date: Mon Feb 25 21:58:19 2019
New Revision: 344552
URL: https://svnweb.freebsd.org/changeset/base/344552

Log:
  After a crash, a file that extends into indirect blocks may end up
  shorter than its size resulting in a hole as its final block (which
  is a violation of the invarients of the UFS filesystem).
  
  Soft updates will always ensure that the file size is correct when
  writing inodes to disk for files that contain only direct block
  pointers. However soft updates does not roll back sizes for files
  with indirect blocks that it has set to unallocated because their
  contents have not yet been written to disk. Hence, the file can
  appear to have a hole at its end because the block pointer has been
  rolled back to zero when its inode was written to disk. Thus,
  fsck_ffs calculates the last allocated block in the file. For files
  that extend into indirect blocks, fsck_ffs checks for a size past
  the last allocated block of the file and if that is found, shortens
  the file to reference the last allocated block thus avoiding having
  it reference a hole at its end.
  
  Submitted by: Chuck Silvers 
  Tested by:Chuck Silvers 
  MFC after:1 week
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/globs.c
  head/sbin/fsck_ffs/pass1.c
  head/sbin/fsck_ffs/setup.c
  head/sbin/fsdb/fsdb.c
  head/sys/ufs/ffs/ffs_alloc.c
  head/sys/ufs/ffs/fs.h

Modified: head/sbin/fsck_ffs/fsck.h
==
--- head/sbin/fsck_ffs/fsck.h   Mon Feb 25 19:47:27 2019(r344551)
+++ head/sbin/fsck_ffs/fsck.h   Mon Feb 25 21:58:19 2019(r344552)
@@ -232,6 +232,7 @@ struct inodesc {
ufs_lbn_t id_lbn;   /* logical block number of current block */
ufs2_daddr_t id_blkno;  /* current block number being examined */
int id_numfrags;/* number of frags contained in block */
+   ufs_lbn_t id_lballoc;   /* pass1: last LBN that is allocated */
off_t id_filesize;  /* for DATA nodes, the size of the directory */
ufs2_daddr_t id_entryno;/* for DATA nodes, current entry number */
int id_loc; /* for DATA nodes, current location in dir */
@@ -291,6 +292,7 @@ extern long countdirs;  /* number of 
directories we ac
 #define MIBSIZE3   /* size of fsck sysctl MIBs */
 extern int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode 
reference cnt */
 extern int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block 
count */
+extern int setsize[MIBSIZE];   /* MIB command to set inode size */
 extern int adjndir[MIBSIZE];   /* MIB command to adjust number of 
directories */
 extern int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free 
blocks */
 extern int adjnifree[MIBSIZE]; /* MIB command to adjust number of free 
inodes */

Modified: head/sbin/fsck_ffs/globs.c
==
--- head/sbin/fsck_ffs/globs.c  Mon Feb 25 19:47:27 2019(r344551)
+++ head/sbin/fsck_ffs/globs.c  Mon Feb 25 21:58:19 2019(r344552)
@@ -63,6 +63,7 @@ unsigned long  numdirs, listmax;
 long countdirs;/* number of directories we actually found */
 intadjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */
 intadjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */
+intsetsize[MIBSIZE];   /* MIB command to set inode size */
 intadjndir[MIBSIZE];   /* MIB command to adjust number of directories 
*/
 intadjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks 
*/
 intadjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes 
*/
@@ -131,6 +132,7 @@ fsckinit(void)
countdirs = 0;
bzero(adjrefcnt, sizeof(int) * MIBSIZE);
bzero(adjblkcnt, sizeof(int) * MIBSIZE);
+   bzero(setsize, sizeof(int) * MIBSIZE);
bzero(adjndir, sizeof(int) * MIBSIZE);
bzero(adjnbfree, sizeof(int) * MIBSIZE);
bzero(adjnifree, sizeof(int) * MIBSIZE);

Modified: head/sbin/fsck_ffs/pass1.c
==
--- head/sbin/fsck_ffs/pass1.c  Mon Feb 25 19:47:27 2019(r344551)
+++ head/sbin/fsck_ffs/pass1.c  Mon Feb 25 21:58:19 2019(r344552)
@@ -247,6 +247,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r
off_t kernmaxfilesize;
ufs2_daddr_t ndb;
mode_t mode;
+   uintmax_t fixsize;
int j, ret, offset;
 
if ((dp = getnextinode(inumber, rebuildcg)) == NULL)
@@ -377,6 +378,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r
idesc->id_type = SNAP;
else
idesc->id_type = ADDR;
+   idesc->id_lballoc = -1;
(void)ckinode(dp, idesc);
if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0)

svn commit: r344551 - in head/usr.bin/cmp: . tests

2019-02-25 Thread Mark Johnston
Author: markj
Date: Mon Feb 25 19:47:27 2019
New Revision: 344551
URL: https://svnweb.freebsd.org/changeset/base/344551

Log:
  Fix handling of rights on stdio streams, take two.
  
  Split the rights-limiting code into two cases: if one of the input
  files isn't a regular file, use caph_limit_stream(3) instead of
  open-coding the same logic; if both input files are regular files,
  and the initial attempts to map them succeed, we limit the rights on
  those files to CAP_MMAP_R.
  
  Add a regression test for PR 234885.
  
  PR:   234885
  Reviewed by:  delphij
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19216

Modified:
  head/usr.bin/cmp/cmp.c
  head/usr.bin/cmp/regular.c
  head/usr.bin/cmp/special.c
  head/usr.bin/cmp/tests/cmp_test2.sh

Modified: head/usr.bin/cmp/cmp.c
==
--- head/usr.bin/cmp/cmp.c  Mon Feb 25 19:22:13 2019(r344550)
+++ head/usr.bin/cmp/cmp.c  Mon Feb 25 19:47:27 2019(r344551)
@@ -45,7 +45,6 @@ static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/9
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 
 #include 
@@ -80,8 +79,6 @@ main(int argc, char *argv[])
off_t skip1, skip2;
int ch, fd1, fd2, oflag, special;
const char *file1, *file2;
-   cap_rights_t rights;
-   uint32_t fcntls;
 
oflag = O_RDONLY;
while ((ch = getopt_long(argc, argv, "+hlsxz", long_opts, NULL)) != -1)
@@ -116,14 +113,19 @@ main(int argc, char *argv[])
if (argc < 2 || argc > 4)
usage();
 
+   /* Don't limit rights on stdin since it may be one of the inputs. */
+   if (caph_limit_stream(STDOUT_FILENO, CAPH_WRITE | CAPH_IGNORE_EBADF))
+   err(ERR_EXIT, "unable to limit rights on stdout");
+   if (caph_limit_stream(STDERR_FILENO, CAPH_WRITE | CAPH_IGNORE_EBADF))
+   err(ERR_EXIT, "unable to limit rights on stderr");
+
/* Backward compatibility -- handle "-" meaning stdin. */
special = 0;
if (strcmp(file1 = argv[0], "-") == 0) {
special = 1;
-   fd1 = 0;
+   fd1 = STDIN_FILENO;
file1 = "stdin";
-   }
-   else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) {
+   } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) {
if (!sflag)
err(ERR_EXIT, "%s", file1);
else
@@ -134,10 +136,9 @@ main(int argc, char *argv[])
errx(ERR_EXIT,
"standard input may only be specified once");
special = 1;
-   fd2 = 0;
+   fd2 = STDIN_FILENO;
file2 = "stdin";
-   }
-   else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) {
+   } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) {
if (!sflag)
err(ERR_EXIT, "%s", file2);
else
@@ -162,33 +163,8 @@ main(int argc, char *argv[])
exit(ERR_EXIT);
}
 
-   cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_MMAP_R);
-   if (caph_rights_limit(fd1, &rights) < 0)
-   err(ERR_EXIT, "unable to limit rights for %s", file1);
-   if (caph_rights_limit(fd2, &rights) < 0)
-   err(ERR_EXIT, "unable to limit rights for %s", file2);
-
-   /* Required for fdopen(3). */
-   fcntls = CAP_FCNTL_GETFL;
-   if (caph_fcntls_limit(fd1, fcntls) < 0)
-   err(ERR_EXIT, "unable to limit fcntls for %s", file1);
-   if (caph_fcntls_limit(fd2, fcntls) < 0)
-   err(ERR_EXIT, "unable to limit fcntls for %s", file2);
-
-   if (!special) {
-   cap_rights_init(&rights);
-   if (caph_rights_limit(STDIN_FILENO, &rights) < 0) {
-   err(ERR_EXIT, "unable to limit stdio");
-   }
-   }
-
-   if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1)
-   err(ERR_EXIT, "unable to limit stdio");
-
+   /* FD rights are limited in c_special() and c_regular(). */
caph_cache_catpages();
-
-   if (caph_enter() < 0)
-   err(ERR_EXIT, "unable to enter capability mode");
 
if (!special) {
if (fstat(fd1, &sb1)) {

Modified: head/usr.bin/cmp/regular.c
==
--- head/usr.bin/cmp/regular.c  Mon Feb 25 19:22:13 2019(r344550)
+++ head/usr.bin/cmp/regular.c  Mon Feb 25 19:47:27 2019(r344551)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -61,12 +62,13 @@ void
 c_regular(int fd1, const char *file1, off_t skip1, off_t len1,
 int fd2, const char *file2, off_t skip2, off_t len2)
 {
+   struct sigacti

svn commit: r344550 - in head/sys: kern vm

2019-02-25 Thread Mark Johnston
Author: markj
Date: Mon Feb 25 19:22:13 2019
New Revision: 344550
URL: https://svnweb.freebsd.org/changeset/base/344550

Log:
  Improve vmem tuning for platforms without a direct map.
  
  On platforms without a direct map (i.e., platforms without
  UMA_MD_SMALL_ALLOC defined), the boundary tag allocator reserves a
  number of tags for use when allocating a new slab of boundary tags,
  as such platforms require free boundary tags in order to allocate
  boundary tags.  r327899 increased the number of boundary tags required
  for a KVA allocation in the worst case, and the aforementioned
  reservation was not updated accordingly.  In some cases, this could
  lead to a system hang.  Fix the problem by increasing this reservation.
  
  Also reduce KVA_QUANTUM on systems lacking superpage support.
  The previous import quantum (4MB with a 4KB page size) was quite large
  for systems with limited KVA, and fragmentation in kernel_arena could
  cause kernel memory allocation failures even with a substantial amount
  of free KVA.
  
  Reported and tested by:   jhibbits
  Reviewed by:  alc, kib
  No objections:jeff
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19337

Modified:
  head/sys/kern/subr_vmem.c
  head/sys/vm/vm_kern.c

Modified: head/sys/kern/subr_vmem.c
==
--- head/sys/kern/subr_vmem.c   Mon Feb 25 19:18:32 2019(r344549)
+++ head/sys/kern/subr_vmem.c   Mon Feb 25 19:22:13 2019(r344550)
@@ -689,9 +689,11 @@ vmem_startup(void)
/*
 * Reserve enough tags to allocate new tags.  We allow multiple
 * CPUs to attempt to allocate new tags concurrently to limit
-* false restarts in UMA.
+* false restarts in UMA.  vmem_bt_alloc() allocates from a per-domain
+* arena, which may involve importing a range from the kernel arena,
+* so we need to keep at least 2 * BT_MAXALLOC tags reserved.
 */
-   uma_zone_reserve(vmem_bt_zone, BT_MAXALLOC * (mp_ncpus + 1) / 2);
+   uma_zone_reserve(vmem_bt_zone, 2 * BT_MAXALLOC * mp_ncpus);
uma_zone_set_allocf(vmem_bt_zone, vmem_bt_alloc);
 #endif
 }

Modified: head/sys/vm/vm_kern.c
==
--- head/sys/vm/vm_kern.c   Mon Feb 25 19:18:32 2019(r344549)
+++ head/sys/vm/vm_kern.c   Mon Feb 25 19:22:13 2019(r344550)
@@ -124,8 +124,8 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA
 #if VM_NRESERVLEVEL > 0
 #defineKVA_QUANTUM_SHIFT   (VM_LEVEL_0_ORDER + PAGE_SHIFT)
 #else
-/* On non-superpage architectures want large import sizes. */
-#defineKVA_QUANTUM_SHIFT   (10 + PAGE_SHIFT)
+/* On non-superpage architectures we want large import sizes. */
+#defineKVA_QUANTUM_SHIFT   (8 + PAGE_SHIFT)
 #endif
 #defineKVA_QUANTUM (1 << KVA_QUANTUM_SHIFT)
 
___
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: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2019-02-25 Thread Ian Lepore
Nope, editing prior history is administratively disabled in the svn
repo. But at least the commit message did include a reference to the
review, so someone can dig up the info if they need it.

-- Ian

On Mon, 2019-02-25 at 16:10 -0300, luporl wrote:
> Sorry, I forgot to copy the summary from D19353.
> 
> Is there a way to change it now?
> 
> On Mon, Feb 25, 2019 at 3:56 PM Ian Lepore  wrote:
> > 
> > On Mon, 2019-02-25 at 18:52 +, Leandro Lupori wrote:
> > > Author: luporl
> > > Date: Mon Feb 25 18:52:47 2019
> > > New Revision: 344534
> > > URL: https://svnweb.freebsd.org/changeset/base/344534
> > > 
> > > Log:
> > >   Increase ctfconvert buffer size
> > > 
> > >   Reviewed by:markj
> > >   Differential Revision:  https://reviews.freebsd.org/D19353
> > > 
> > 
> > This is not a very good commit message. To be good, it should say
> > why
> > the size is being increased. If the commit had included the summary
> > text from D19353 it would have been perfect.
> > 
> > -- Ian
> > 
> > > Modified:
> > >   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > > 
> > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > > =
> > > 
> > > =
> > > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon
> > > Feb
> > > 25 18:41:16 2019  (r344533)
> > > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon
> > > Feb
> > > 25 18:52:47 2019  (r344534)
> > > @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die
> > > die,
> > > Dwarf_O
> > >  static intr_t *
> > >  die_base_name_parse(const char *name, char **newp)
> > >  {
> > > - char buf[100];
> > > + char buf[256];
> > >   char const *base;
> > >   char *c;
> > >   int nlong = 0, nshort = 0, nchar = 0, nint = 0;
> > > 
> 
> 

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


svn commit: r344547 - head/sys/opencrypto

2019-02-25 Thread Sean Eric Fagan
Author: sef
Date: Mon Feb 25 19:14:16 2019
New Revision: 344547
URL: https://svnweb.freebsd.org/changeset/base/344547

Log:
  Fix another bug introduced during the review process of r344140:
  the tag wasn't being computed properly due to chaning a >= comparison
  to an == comparison.
  
  Specifically:  CBC-MAC encodes the length of the authorization data
  into the the stream to be encrypted/hashed.  For short data, this is
  two bytes (big-endian 16 bit value); for larger data, it's 6 bytes
  (a prefix of 0xff, 0xfe, followed by a 32-bit big-endian length).  And
  there's a larger size, which is 10 bytes.  These extra bytes weren't
  being accounted for with the post-review code.  The other bit that then came
  into play was that OCF only calls the Update code with blksiz=16, which
  meant that I had to ignore the length variable.  (It also means that it
  can't be called with a single buffer containing the AAD and payload;
  however, OCF doesn't do this for the software-only algorithsm.)
  
  I tested with this script:
  
  ALG=aes-ccm
  DEV=soft
  
  for aad in 0 1 2 3 4 14 16 24 30 32 34 36 1020
  do
  for dln in 16 32 1024 2048 10240
  do
  echo "Testing AAD length ${aad} data length ${dln}"
  /root/cryptocheck -A ${aad} -a ${ALG} -d ${DEV} ${dln}
  done
  done
  
  Reviewed by:  cem
  Sponsored by: iXsystems Inc.

Modified:
  head/sys/opencrypto/cbc_mac.c

Modified: head/sys/opencrypto/cbc_mac.c
==
--- head/sys/opencrypto/cbc_mac.c   Mon Feb 25 19:07:52 2019
(r344546)
+++ head/sys/opencrypto/cbc_mac.c   Mon Feb 25 19:14:16 2019
(r344547)
@@ -124,23 +124,31 @@ AES_CBC_MAC_Reinit(struct aes_cbc_mac_ctx *ctx, const 
rijndaelEncrypt(ctx->keysched, ctx->rounds, b0, ctx->block);
/* If there is auth data, we need to set up the staging block */
if (ctx->authDataLength) {
+   size_t addLength;
if (ctx->authDataLength < ((1<<16) - (1<<8))) {
uint16_t sizeVal = htobe16(ctx->authDataLength);
bcopy(&sizeVal, ctx->staging_block, sizeof(sizeVal));
-   ctx->blockIndex = sizeof(sizeVal);
+   addLength = sizeof(sizeVal);
} else if (ctx->authDataLength < (1ULL<<32)) {
uint32_t sizeVal = htobe32(ctx->authDataLength);
ctx->staging_block[0] = 0xff;
ctx->staging_block[1] = 0xfe;
bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal));
-   ctx->blockIndex = 2 + sizeof(sizeVal);
+   addLength = 2 + sizeof(sizeVal);
} else {
uint64_t sizeVal = htobe64(ctx->authDataLength);
ctx->staging_block[0] = 0xff;
ctx->staging_block[1] = 0xff;
bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal));
-   ctx->blockIndex = 2 + sizeof(sizeVal);
+   addLength = 2 + sizeof(sizeVal);
}
+   ctx->blockIndex = addLength;
+   /*
+* The length descriptor goes into the AAD buffer, so we
+* need to account for it.
+*/
+   ctx->authDataLength += addLength;
+   ctx->authDataCount = addLength;
}
 }
 
@@ -181,10 +189,9 @@ AES_CBC_MAC_Update(struct aes_cbc_mac_ctx *ctx, const 
ctx->authDataCount += copy_amt;
ctx->blockIndex += copy_amt;
ctx->blockIndex %= sizeof(ctx->staging_block);
-   if (ctx->authDataCount == ctx->authDataLength)
-   length = 0;
+
if (ctx->blockIndex == 0 ||
-   ctx->authDataCount >= ctx->authDataLength) {
+   ctx->authDataCount == ctx->authDataLength) {
/*
 * We're done with this block, so we
 * xor staging_block with block, and then
@@ -193,8 +200,17 @@ AES_CBC_MAC_Update(struct aes_cbc_mac_ctx *ctx, const 
xor_and_encrypt(ctx, ctx->staging_block, 
ctx->block);
bzero(ctx->staging_block, 
sizeof(ctx->staging_block));
ctx->blockIndex = 0;
+   if (ctx->authDataCount >= ctx->authDataLength)
+   break;
}
}
+   /*
+* We'd like to be able to check length == 0 and return
+* here, but the way OCF calls us, length is always
+* blksize (16, in this case).  So we have to count on
+* the

Re: svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2019-02-25 Thread luporl
Sorry, I forgot to copy the summary from D19353.

Is there a way to change it now?

On Mon, Feb 25, 2019 at 3:56 PM Ian Lepore  wrote:
>
> On Mon, 2019-02-25 at 18:52 +, Leandro Lupori wrote:
> > Author: luporl
> > Date: Mon Feb 25 18:52:47 2019
> > New Revision: 344534
> > URL: https://svnweb.freebsd.org/changeset/base/344534
> >
> > Log:
> >   Increase ctfconvert buffer size
> >
> >   Reviewed by:markj
> >   Differential Revision:  https://reviews.freebsd.org/D19353
> >
>
> This is not a very good commit message. To be good, it should say why
> the size is being increased. If the commit had included the summary
> text from D19353 it would have been perfect.
>
> -- Ian
>
> > Modified:
> >   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> >
> > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> > =
> > =
> > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon Feb
> > 25 18:41:16 2019  (r344533)
> > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon Feb
> > 25 18:52:47 2019  (r344534)
> > @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die,
> > Dwarf_O
> >  static intr_t *
> >  die_base_name_parse(const char *name, char **newp)
> >  {
> > - char buf[100];
> > + char buf[256];
> >   char const *base;
> >   char *c;
> >   int nlong = 0, nshort = 0, nchar = 0, nint = 0;
> >
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344546 - vendor/lldb/lldb-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:52 2019
New Revision: 344546
URL: https://svnweb.freebsd.org/changeset/base/344546

Log:
  Tag lldb release_80 branch r354799.

Added:
  vendor/lldb/lldb-release_80-r354799/
 - copied from r344545, vendor/lldb/dist-release_80/
___
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: r344544 - vendor/lld/lld-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:45 2019
New Revision: 344544
URL: https://svnweb.freebsd.org/changeset/base/344544

Log:
  Tag lld release_80 branch r354799.

Added:
  vendor/lld/lld-release_80-r354799/
 - copied from r344543, vendor/lld/dist-release_80/
___
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: r344545 - in vendor/lldb/dist-release_80: source/Host/common source/Host/openbsd unittests/Host

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:48 2019
New Revision: 344545
URL: https://svnweb.freebsd.org/changeset/base/344545

Log:
  Vendor import of lldb release_80 branch r354799:
  https://llvm.org/svn/llvm-project/lldb/branches/release_80@354799

Modified:
  vendor/lldb/dist-release_80/source/Host/common/MainLoop.cpp
  vendor/lldb/dist-release_80/source/Host/openbsd/Host.cpp
  vendor/lldb/dist-release_80/unittests/Host/MainLoopTest.cpp

Modified: vendor/lldb/dist-release_80/source/Host/common/MainLoop.cpp
==
--- vendor/lldb/dist-release_80/source/Host/common/MainLoop.cpp Mon Feb 25 
19:07:45 2019(r344544)
+++ vendor/lldb/dist-release_80/source/Host/common/MainLoop.cpp Mon Feb 25 
19:07:48 2019(r344545)
@@ -108,8 +108,14 @@ Status MainLoop::RunImpl::Poll() {
   num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(),
   out_events, llvm::array_lengthof(out_events), nullptr);
 
-  if (num_events < 0)
-return Status("kevent() failed with error %d\n", num_events);
+  if (num_events < 0) {
+if (errno == EINTR) {
+  // in case of EINTR, let the main loop run one iteration
+  // we need to zero num_events to avoid assertions failing
+  num_events = 0;
+} else
+  return Status(errno, eErrorTypePOSIX);
+  }
   return Status();
 }
 

Modified: vendor/lldb/dist-release_80/source/Host/openbsd/Host.cpp
==
--- vendor/lldb/dist-release_80/source/Host/openbsd/Host.cppMon Feb 25 
19:07:45 2019(r344544)
+++ vendor/lldb/dist-release_80/source/Host/openbsd/Host.cppMon Feb 25 
19:07:48 2019(r344545)
@@ -68,8 +68,7 @@ GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *
 
   cstr = data.GetCStr(&offset);
   if (cstr) {
-process_info.GetExecutableFile().SetFile(cstr, false,
- FileSpec::Style::native);
+process_info.GetExecutableFile().SetFile(cstr, 
FileSpec::Style::native);
 
 if (!(match_info_ptr == NULL ||
   NameMatches(

Modified: vendor/lldb/dist-release_80/unittests/Host/MainLoopTest.cpp
==
--- vendor/lldb/dist-release_80/unittests/Host/MainLoopTest.cpp Mon Feb 25 
19:07:45 2019(r344544)
+++ vendor/lldb/dist-release_80/unittests/Host/MainLoopTest.cpp Mon Feb 25 
19:07:48 2019(r344545)
@@ -137,4 +137,28 @@ TEST_F(MainLoopTest, Signal) {
   ASSERT_TRUE(loop.Run().Success());
   ASSERT_EQ(1u, callback_count);
 }
+
+// Test that a signal which is not monitored by the MainLoop does not
+// cause a premature exit.
+TEST_F(MainLoopTest, UnmonitoredSignal) {
+  MainLoop loop;
+  Status error;
+  struct sigaction sa;
+  sa.sa_sigaction = [](int, siginfo_t *, void *) { };
+  sa.sa_flags = SA_SIGINFO; // important: no SA_RESTART
+  sigemptyset(&sa.sa_mask);
+  ASSERT_EQ(0, sigaction(SIGUSR2, &sa, nullptr));
+
+  auto handle = loop.RegisterSignal(SIGUSR1, make_callback(), error);
+  ASSERT_TRUE(error.Success());
+  std::thread killer([]() {
+sleep(1);
+kill(getpid(), SIGUSR2);
+sleep(1);
+kill(getpid(), SIGUSR1);
+  });
+  ASSERT_TRUE(loop.Run().Success());
+  killer.join();
+  ASSERT_EQ(1u, callback_count);
+}
 #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: r344543 - in vendor/lld/dist-release_80: ELF docs

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:43 2019
New Revision: 344543
URL: https://svnweb.freebsd.org/changeset/base/344543

Log:
  Vendor import of lld release_80 branch r354799:
  https://llvm.org/svn/llvm-project/lld/branches/release_80@354799

Modified:
  vendor/lld/dist-release_80/ELF/Options.td
  vendor/lld/dist-release_80/docs/ReleaseNotes.rst

Modified: vendor/lld/dist-release_80/ELF/Options.td
==
--- vendor/lld/dist-release_80/ELF/Options.td   Mon Feb 25 19:07:40 2019
(r344542)
+++ vendor/lld/dist-release_80/ELF/Options.td   Mon Feb 25 19:07:43 2019
(r344543)
@@ -30,7 +30,7 @@ def Bstatic: F<"Bstatic">, HelpText<"Do not link again
 def build_id: F<"build-id">, HelpText<"Alias for --build-id=fast">;
 
 def build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">,
-  MetaVarName<"[fast,md5,sha,uuid,0x]">;
+  MetaVarName<"[fast,md5,sha1,uuid,0x]">;
 
 defm check_sections: B<"check-sections",
 "Check section addresses for overlaps (default)",

Modified: vendor/lld/dist-release_80/docs/ReleaseNotes.rst
==
--- vendor/lld/dist-release_80/docs/ReleaseNotes.rstMon Feb 25 19:07:40 
2019(r344542)
+++ vendor/lld/dist-release_80/docs/ReleaseNotes.rstMon Feb 25 19:07:43 
2019(r344543)
@@ -5,11 +5,6 @@ lld 8.0.0 Release Notes
 .. contents::
 :local:
 
-.. warning::
-   These are in-progress notes for the upcoming LLVM 8.0.0 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
 Introduction
 
 
@@ -18,7 +13,7 @@ Mach-O (macOS), MinGW and WebAssembly. lld is command-
 GNU linkers and Microsoft link.exe and is significantly faster than the
 system default linkers.
 
-nlld 8.0.0 has lots of feature improvements and bug fixes.
+lld 8.0.0 has lots of feature improvements and bug fixes.
 
 Non-comprehensive list of changes in this release
 =
___
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: r344533 - in head/contrib/openpam: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 misc modules modules/pam_deny modules/pam_per

2019-02-25 Thread Conrad Meyer
On Mon, Feb 25, 2019 at 10:41 AM Dag-Erling Smørgrav  wrote:
>
> Author: des
> Date: Mon Feb 25 18:41:16 2019
> New Revision: 344533
> URL: https://svnweb.freebsd.org/changeset/base/344533
>
> Log:
>   Upgrade to OpenPAM Tabebuia.

PR: 235903
___
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: r344540 - vendor/compiler-rt/compiler-rt-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:35 2019
New Revision: 344540
URL: https://svnweb.freebsd.org/changeset/base/344540

Log:
  Tag compiler-rt release_80 branch r354799.

Added:
  vendor/compiler-rt/compiler-rt-release_80-r354799/
 - copied from r344539, vendor/compiler-rt/dist-release_80/
___
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: r344538 - vendor/clang/clang-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:29 2019
New Revision: 344538
URL: https://svnweb.freebsd.org/changeset/base/344538

Log:
  Tag clang release_80 branch r354799.

Added:
  vendor/clang/clang-release_80-r354799/
 - copied from r344537, vendor/clang/dist-release_80/
___
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: r344542 - vendor/libc++/libc++-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:40 2019
New Revision: 344542
URL: https://svnweb.freebsd.org/changeset/base/344542

Log:
  Tag libc++ release_80 branch r354799.

Added:
  vendor/libc++/libc++-release_80-r354799/
 - copied from r344541, vendor/libc++/dist-release_80/
___
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: r344537 - in vendor/clang/dist-release_80: docs include/clang/AST lib/CodeGen lib/Frontend lib/Sema test/CodeGenCXX test/Misc test/Sema

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:25 2019
New Revision: 344537
URL: https://svnweb.freebsd.org/changeset/base/344537

Log:
  Vendor import of clang release_80 branch r354799:
  https://llvm.org/svn/llvm-project/cfe/branches/release_80@354799

Modified:
  vendor/clang/dist-release_80/docs/ReleaseNotes.rst
  vendor/clang/dist-release_80/docs/UsersManual.rst
  vendor/clang/dist-release_80/include/clang/AST/Expr.h
  vendor/clang/dist-release_80/lib/CodeGen/CGDecl.cpp
  vendor/clang/dist-release_80/lib/Frontend/TextDiagnostic.cpp
  vendor/clang/dist-release_80/lib/Sema/SemaExpr.cpp
  vendor/clang/dist-release_80/test/CodeGenCXX/trivial-auto-var-init.cpp
  vendor/clang/dist-release_80/test/Misc/diag-format.c
  vendor/clang/dist-release_80/test/Sema/typo-correction.c

Modified: vendor/clang/dist-release_80/docs/ReleaseNotes.rst
==
--- vendor/clang/dist-release_80/docs/ReleaseNotes.rst  Mon Feb 25 19:07:21 
2019(r344536)
+++ vendor/clang/dist-release_80/docs/ReleaseNotes.rst  Mon Feb 25 19:07:25 
2019(r344537)
@@ -1,6 +1,6 @@
-===
-Clang 8.0.0 (In-Progress) Release Notes
-===
+=
+Clang 8.0.0 Release Notes
+=
 
 .. contents::
:local:
@@ -8,16 +8,10 @@ Clang 8.0.0 (In-Progress) Release Notes
 
 Written by the `LLVM Team `_
 
-.. warning::
-
-   These are in-progress notes for the upcoming Clang 8 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
 Introduction
 
 
-This document contains the release notes for the Clang C/C++/Objective-C
+This document contains the release notes for the Clang C/C++/Objective-C/OpenCL
 frontend, part of the LLVM Compiler Infrastructure, release 8.0.0. Here we
 describe the status of Clang in some detail, including major
 improvements from the previous release and new feature work. For the
@@ -30,11 +24,6 @@ For more information about Clang or LLVM, including in
 latest release, please see the `Clang Web Site `_ or 
the
 `LLVM Web Site `_.
 
-Note that if you are reading this file from a Subversion checkout or the
-main Clang web page, this document applies to the *next* release, not
-the current one. To see the release notes for a specific release, please
-see the `releases page `_.
-
 What's New in Clang 8.0.0?
 ==
 
@@ -50,8 +39,37 @@ Major New Features
   profile data captured for one version of a program to be applied
   when building another version where symbols have changed (for
   example, due to renaming a class or namespace).
-  See the :doc:`UsersManual` for details.
+  See the :ref:`UsersManual ` for details.
 
+- Clang has new options to initialize automatic variables with a pattern. The 
default is still that automatic variables are uninitialized. This isn't meant 
to change the semantics of C and C++. Rather, it's meant to be a last resort 
when programmers inadvertently have some undefined behavior in their code. 
These options aim to make undefined behavior hurt less, which security-minded 
people will be very happy about. Notably, this means that there's no 
inadvertent information leak when:
+
+* The compiler re-uses stack slots, and a value is used uninitialized.
+
+* The compiler re-uses a register, and a value is used uninitialized.
+
+* Stack structs / arrays / unions with padding are copied.
+
+  These options only address stack and register information leaks.
+
+  Caveats:
+
+* Variables declared in unreachable code and used later aren't 
initialized. This affects goto statements, Duff's device, and other 
objectionable uses of switch statements. This should instead be a hard-error in 
any serious codebase.
+
+* These options don't affect volatile stack variables.
+
+* Padding isn't fully handled yet.
+
+  How to use it on the command line:
+
+* ``-ftrivial-auto-var-init=uninitialized`` (the default)
+
+* ``-ftrivial-auto-var-init=pattern``
+
+  There is also a new attribute to request a variable to not be initialized, 
mainly to disable initialization of large stack arrays when deemed too 
expensive:
+
+* ``int dont_initialize_me __attribute((uninitialized));``
+
+
 Improvements to Clang's diagnostics
 ^^^
 
@@ -131,14 +149,24 @@ Non-comprehensive list of changes in this release
 
 - Improved support for MIPS N32 ABI and MIPS R6 target triples.
 
+- Clang now includes builtin functions for bitwise rotation of common value
+  sizes, such as: `__builtin_rotateleft32
+  `_
+
+- Improved optimization for the corresponding MSVC compatibility builtins such
+  as ``_rotl()``.
+
 New Compiler Flags
 --
 
+- ``-mspeculative-load-hardening`` Clang now has an option to 

svn commit: r344541 - vendor/libc++/dist-release_80/docs

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:37 2019
New Revision: 344541
URL: https://svnweb.freebsd.org/changeset/base/344541

Log:
  Vendor import of libc++ release_80 branch r354799:
  https://llvm.org/svn/llvm-project/libcxx/branches/release_80@354799

Modified:
  vendor/libc++/dist-release_80/docs/ReleaseNotes.rst

Modified: vendor/libc++/dist-release_80/docs/ReleaseNotes.rst
==
--- vendor/libc++/dist-release_80/docs/ReleaseNotes.rst Mon Feb 25 19:07:35 
2019(r344540)
+++ vendor/libc++/dist-release_80/docs/ReleaseNotes.rst Mon Feb 25 19:07:37 
2019(r344541)
@@ -1,6 +1,6 @@
-
-Libc++ 8.0.0 (In-Progress) Release Notes
-
+==
+Libc++ 8.0.0 Release Notes
+==
 
 .. contents::
:local:
@@ -8,12 +8,6 @@ Libc++ 8.0.0 (In-Progress) Release Notes
 
 Written by the `Libc++ Team `_
 
-.. warning::
-
-   These are in-progress notes for the upcoming libc++ 8 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
 Introduction
 
 
@@ -26,11 +20,6 @@ be downloaded from the `LLVM releases web site https://libcxx.llvm.org>`_ or the `LLVM Web Site `_.
-
-Note that if you are reading this file from a Subversion checkout or the
-main Libc++ web page, this document applies to the *next* release, not
-the current one. To see the release notes for a specific release, please
-see the `releases page `_.
 
 What's New in Libc++ 8.0.0?
 ===
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344536 - vendor/llvm/llvm-release_80-r354799

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:21 2019
New Revision: 344536
URL: https://svnweb.freebsd.org/changeset/base/344536

Log:
  Tag llvm release_80 branch r354799.

Added:
  vendor/llvm/llvm-release_80-r354799/
 - copied from r344535, vendor/llvm/dist-release_80/
___
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: r344535 - in vendor/llvm/dist-release_80: docs lib/MC lib/Target/X86 lib/Transforms/InstCombine lib/Transforms/Scalar test/CodeGen/AArch64 test/CodeGen/X86 test/MC/ELF test/Transforms/I...

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:16 2019
New Revision: 344535
URL: https://svnweb.freebsd.org/changeset/base/344535

Log:
  Vendor import of llvm release_80 branch r354799:
  https://llvm.org/svn/llvm-project/llvm/branches/release_80@354799

Added:
  vendor/llvm/dist-release_80/test/CodeGen/X86/pr40730.ll
Modified:
  vendor/llvm/dist-release_80/docs/ReleaseNotes.rst
  vendor/llvm/dist-release_80/docs/index.rst
  vendor/llvm/dist-release_80/lib/MC/ELFObjectWriter.cpp
  vendor/llvm/dist-release_80/lib/Target/X86/X86ISelLowering.cpp
  
vendor/llvm/dist-release_80/lib/Transforms/InstCombine/InstructionCombining.cpp
  vendor/llvm/dist-release_80/lib/Transforms/Scalar/MergeICmps.cpp
  vendor/llvm/dist-release_80/test/CodeGen/AArch64/machine-outliner-bad-adrp.mir
  vendor/llvm/dist-release_80/test/MC/ELF/invalid-symver.s
  vendor/llvm/dist-release_80/test/MC/ELF/multiple-different-symver.s
  vendor/llvm/dist-release_80/test/Transforms/InstCombine/vec_shuffle.ll

Modified: vendor/llvm/dist-release_80/docs/ReleaseNotes.rst
==
--- vendor/llvm/dist-release_80/docs/ReleaseNotes.rst   Mon Feb 25 18:52:47 
2019(r344534)
+++ vendor/llvm/dist-release_80/docs/ReleaseNotes.rst   Mon Feb 25 19:07:16 
2019(r344535)
@@ -5,12 +5,6 @@ LLVM 8.0.0 Release Notes
 .. contents::
 :local:
 
-.. warning::
-   These are in-progress notes for the upcoming LLVM 8 release.
-   Release notes for previous releases can be found on
-   `the Download Page `_.
-
-
 Introduction
 
 
@@ -26,11 +20,25 @@ have questions or comments, the `LLVM Developer's Mail
 `_ is a good place to send
 them.
 
-Note that if you are reading this file from a Subversion checkout or the main
-LLVM web page, this document applies to the *next* release, not the current
-one.  To see the release notes for a specific release, please see the `releases
-page `_.
+Minimum Required Compiler Version
+=
+As `discussed on the mailing list
+`_,
+building LLVM will soon require more recent toolchains as follows:
 
+= 
+Clang 3.5
+Apple Clang   6.0
+GCC   5.1
+Visual Studio 2017
+= 
+
+A new CMake check when configuring LLVM provides a soft-error if your
+toolchain will become unsupported soon. You can opt out of the soft-error by
+setting the ``LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN`` CMake variable to
+``ON``.
+
+
 Non-comprehensive list of changes in this release
 =
 .. NOTE
@@ -40,27 +48,11 @@ Non-comprehensive list of changes in this release
functionality, or simply have a lot to talk about), see the `NOTE` below
for adding a new subsection.
 
-* As `discussed on the mailing list
-  `_,
-  building LLVM will soon require more recent toolchains as follows:
-
-  = 
-  Clang 3.5
-  Apple Clang   6.0
-  GCC   5.1
-  Visual Studio 2017
-  = 
-
-  A new CMake check when configuring LLVM provides a soft-error if your
-  toolchain will become unsupported soon. You can opt out of the soft-error by
-  setting the ``LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN`` CMake variable to
-  ``ON``.
-
 * The **llvm-cov** tool can now export lcov trace files using the
   `-format=lcov` option of the `export` command.
 
-* The add_llvm_loadable_module CMake macro has been removed.  The
-  add_llvm_library macro with the MODULE argument now provides the same
+* The ``add_llvm_loadable_module`` CMake macro has been removed.  The
+  ``add_llvm_library`` macro with the ``MODULE`` argument now provides the same
   functionality.  See `Writing an LLVM Pass
   `_.
 
@@ -70,6 +62,24 @@ Non-comprehensive list of changes in this release
 
 * Added support for labels as offsets in ``.reloc`` directive.
 
+* Support for precise identification of X86 instructions with memory operands,
+  by using debug information. This supports profile-driven cache prefetching.
+  It is enabled with the ``-x86-discriminate-memops`` LLVM Flag.
+
+* Support for profile-driven software cache prefetching on X86. This is part of
+  a larger system, consisting of: an offline cache prefetches recommender,
+  AutoFDO tooling, and LLVM. In this system, a binary compiled with
+  ``-x86-discriminate-memops`` is run under the observation of the recommender.
+  The recommender identifies certain memory access instructions by their binary
+  file address, and recommends a prefetch of a specific type (NTA, T0, etc) be
+  performed at a specified fixed offset from such an instruction's memory
+  operand. Next, this information needs to be converted to the AutoFDO syntax
+  and the resulting profile may be passed b

svn commit: r344539 - vendor/compiler-rt/dist-release_80/test/msan/Linux

2019-02-25 Thread Dimitry Andric
Author: dim
Date: Mon Feb 25 19:07:32 2019
New Revision: 344539
URL: https://svnweb.freebsd.org/changeset/base/344539

Log:
  Vendor import of compiler-rt release_80 branch r354799:
  https://llvm.org/svn/llvm-project/compiler-rt/branches/release_80@354799

Modified:
  vendor/compiler-rt/dist-release_80/test/msan/Linux/name_to_handle_at.cc

Modified: 
vendor/compiler-rt/dist-release_80/test/msan/Linux/name_to_handle_at.cc
==
--- vendor/compiler-rt/dist-release_80/test/msan/Linux/name_to_handle_at.cc 
Mon Feb 25 19:07:29 2019(r344538)
+++ vendor/compiler-rt/dist-release_80/test/msan/Linux/name_to_handle_at.cc 
Mon Feb 25 19:07:32 2019(r344539)
@@ -14,7 +14,7 @@ int main(void) {
   handle->handle_bytes = MAX_HANDLE_SZ;
 
   int mount_id;
-  int res = name_to_handle_at(AT_FDCWD, "/bin/cat", handle, &mount_id, 0);
+  int res = name_to_handle_at(AT_FDCWD, "/dev/null", handle, &mount_id, 0);
   assert(!res);
   __msan_check_mem_is_initialized(&mount_id, sizeof(mount_id));
   __msan_check_mem_is_initialized(&handle->handle_bytes,
___
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: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2019-02-25 Thread Ian Lepore
On Mon, 2019-02-25 at 18:52 +, Leandro Lupori wrote:
> Author: luporl
> Date: Mon Feb 25 18:52:47 2019
> New Revision: 344534
> URL: https://svnweb.freebsd.org/changeset/base/344534
> 
> Log:
>   Increase ctfconvert buffer size
>   
>   Reviewed by:markj
>   Differential Revision:  https://reviews.freebsd.org/D19353
> 

This is not a very good commit message. To be good, it should say why
the size is being increased. If the commit had included the summary
text from D19353 it would have been perfect.

-- Ian

> Modified:
>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> 
> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
> =
> =
> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon Feb
> 25 18:41:16 2019  (r344533)
> +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c   Mon Feb
> 25 18:52:47 2019  (r344534)
> @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die,
> Dwarf_O
>  static intr_t *
>  die_base_name_parse(const char *name, char **newp)
>  {
> - char buf[100];
> + char buf[256];
>   char const *base;
>   char *c;
>   int nlong = 0, nshort = 0, nchar = 0, nint = 0;
> 

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


svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2019-02-25 Thread Leandro Lupori
Author: luporl
Date: Mon Feb 25 18:52:47 2019
New Revision: 344534
URL: https://svnweb.freebsd.org/changeset/base/344534

Log:
  Increase ctfconvert buffer size
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D19353

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb 25 18:41:16 
2019(r344533)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb 25 18:52:47 
2019(r344534)
@@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die, Dwarf_O
 static intr_t *
 die_base_name_parse(const char *name, char **newp)
 {
-   char buf[100];
+   char buf[256];
char const *base;
char *c;
int nlong = 0, nshort = 0, nchar = 0, nint = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344533 - in head/contrib/openpam: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 misc modules modules/pam_deny modules/pam_perm...

2019-02-25 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Feb 25 18:41:16 2019
New Revision: 344533
URL: https://svnweb.freebsd.org/changeset/base/344533

Log:
  Upgrade to OpenPAM Tabebuia.

Added:
  head/contrib/openpam/m4/ax_pkg_config.m4
 - copied unchanged from r344500, vendor/openpam/dist/m4/ax_pkg_config.m4
  head/contrib/openpam/t/t_pam_env.c
 - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_env.c
  head/contrib/openpam/t/t_pam_err.c
 - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_err.c
  head/contrib/openpam/t/t_pam_err.h
 - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_err.h
Modified:
  head/contrib/openpam/CREDITS
  head/contrib/openpam/HISTORY
  head/contrib/openpam/LICENSE
  head/contrib/openpam/Makefile.in
  head/contrib/openpam/RELNOTES
  head/contrib/openpam/aclocal.m4
  head/contrib/openpam/bin/Makefile.in
  head/contrib/openpam/bin/openpam_dump_policy/Makefile.in
  head/contrib/openpam/bin/pamtest/Makefile.in
  head/contrib/openpam/bin/pamtest/pamtest.1
  head/contrib/openpam/bin/su/Makefile.in
  head/contrib/openpam/bin/su/su.1
  head/contrib/openpam/compile
  head/contrib/openpam/config.h.in
  head/contrib/openpam/config.sub
  head/contrib/openpam/configure
  head/contrib/openpam/configure.ac
  head/contrib/openpam/depcomp
  head/contrib/openpam/doc/Makefile.in
  head/contrib/openpam/doc/man/Makefile.in
  head/contrib/openpam/doc/man/openpam.3
  head/contrib/openpam/doc/man/openpam_borrow_cred.3
  head/contrib/openpam/doc/man/openpam_free_data.3
  head/contrib/openpam/doc/man/openpam_free_envlist.3
  head/contrib/openpam/doc/man/openpam_get_feature.3
  head/contrib/openpam/doc/man/openpam_get_option.3
  head/contrib/openpam/doc/man/openpam_log.3
  head/contrib/openpam/doc/man/openpam_nullconv.3
  head/contrib/openpam/doc/man/openpam_readline.3
  head/contrib/openpam/doc/man/openpam_readlinev.3
  head/contrib/openpam/doc/man/openpam_readword.3
  head/contrib/openpam/doc/man/openpam_restore_cred.3
  head/contrib/openpam/doc/man/openpam_set_feature.3
  head/contrib/openpam/doc/man/openpam_set_option.3
  head/contrib/openpam/doc/man/openpam_straddch.3
  head/contrib/openpam/doc/man/openpam_subst.3
  head/contrib/openpam/doc/man/openpam_ttyconv.3
  head/contrib/openpam/doc/man/pam.3
  head/contrib/openpam/doc/man/pam.conf.5
  head/contrib/openpam/doc/man/pam_acct_mgmt.3
  head/contrib/openpam/doc/man/pam_authenticate.3
  head/contrib/openpam/doc/man/pam_chauthtok.3
  head/contrib/openpam/doc/man/pam_close_session.3
  head/contrib/openpam/doc/man/pam_conv.3
  head/contrib/openpam/doc/man/pam_end.3
  head/contrib/openpam/doc/man/pam_error.3
  head/contrib/openpam/doc/man/pam_get_authtok.3
  head/contrib/openpam/doc/man/pam_get_data.3
  head/contrib/openpam/doc/man/pam_get_item.3
  head/contrib/openpam/doc/man/pam_get_user.3
  head/contrib/openpam/doc/man/pam_getenv.3
  head/contrib/openpam/doc/man/pam_getenvlist.3
  head/contrib/openpam/doc/man/pam_info.3
  head/contrib/openpam/doc/man/pam_open_session.3
  head/contrib/openpam/doc/man/pam_prompt.3
  head/contrib/openpam/doc/man/pam_putenv.3
  head/contrib/openpam/doc/man/pam_set_data.3
  head/contrib/openpam/doc/man/pam_set_item.3
  head/contrib/openpam/doc/man/pam_setcred.3
  head/contrib/openpam/doc/man/pam_setenv.3
  head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3
  head/contrib/openpam/doc/man/pam_sm_authenticate.3
  head/contrib/openpam/doc/man/pam_sm_chauthtok.3
  head/contrib/openpam/doc/man/pam_sm_close_session.3
  head/contrib/openpam/doc/man/pam_sm_open_session.3
  head/contrib/openpam/doc/man/pam_sm_setcred.3
  head/contrib/openpam/doc/man/pam_start.3
  head/contrib/openpam/doc/man/pam_strerror.3
  head/contrib/openpam/doc/man/pam_verror.3
  head/contrib/openpam/doc/man/pam_vinfo.3
  head/contrib/openpam/doc/man/pam_vprompt.3
  head/contrib/openpam/include/Makefile.in
  head/contrib/openpam/include/security/Makefile.in
  head/contrib/openpam/include/security/openpam_version.h
  head/contrib/openpam/install-sh
  head/contrib/openpam/lib/Makefile.in
  head/contrib/openpam/lib/libpam/Makefile.in
  head/contrib/openpam/lib/libpam/pam_getenv.c
  head/contrib/openpam/misc/Makefile.in
  head/contrib/openpam/missing
  head/contrib/openpam/modules/Makefile.in
  head/contrib/openpam/modules/pam_deny/Makefile.in
  head/contrib/openpam/modules/pam_permit/Makefile.in
  head/contrib/openpam/modules/pam_return/Makefile.in
  head/contrib/openpam/modules/pam_unix/Makefile.in
  head/contrib/openpam/t/Makefile.am
  head/contrib/openpam/t/Makefile.in
  head/contrib/openpam/test-driver
Directory Properties:
  head/contrib/openpam/   (props changed)

Modified: head/contrib/openpam/CREDITS
==
--- head/contrib/openpam/CREDITSMon Feb 25 18:27:19 2019
(r344532)
+++ head/contrib/openpam/CREDITSMon Feb 25 18:41:16 2019
(r344533)
@@ -49,5 +49,6 @@ ideas:
Sebastian Krahmer 
Solar Designer 
Takanori Saneto 
+  

svn commit: r344532 - head/usr.sbin/wlandebug

2019-02-25 Thread Ed Maste
Author: emaste
Date: Mon Feb 25 18:27:19 2019
New Revision: 344532
URL: https://svnweb.freebsd.org/changeset/base/344532

Log:
  Revert r344211: wlandebug: disable PIE to fix build failure
  
  As of r344530 libifconfig is built as a standard INTERNALLIB and the
  wlandebug PIE workaround from r344211 can be removed.

Modified:
  head/usr.sbin/wlandebug/Makefile

Modified: head/usr.sbin/wlandebug/Makefile
==
--- head/usr.sbin/wlandebug/MakefileMon Feb 25 18:25:53 2019
(r344531)
+++ head/usr.sbin/wlandebug/MakefileMon Feb 25 18:27:19 2019
(r344532)
@@ -2,7 +2,6 @@
 
 PROG=  wlandebug
 MAN=   wlandebug.8
-MK_PIE:=   no
 
 LIBADD+=   ifconfig
 
___
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: r344531 - head/sys/sys

2019-02-25 Thread Ed Maste
Author: emaste
Date: Mon Feb 25 18:25:53 2019
New Revision: 344531
URL: https://svnweb.freebsd.org/changeset/base/344531

Log:
  Remove unintend change to capability.h from r344530
  
  I expect to remove capability.h in the near future, but it should not
  have been part of this commit.

Modified:
  head/sys/sys/capability.h

Modified: head/sys/sys/capability.h
==
--- head/sys/sys/capability.h   Mon Feb 25 18:22:20 2019(r344530)
+++ head/sys/sys/capability.h   Mon Feb 25 18:25:53 2019(r344531)
@@ -35,13 +35,13 @@
  * Historically, the key userspace and kernel Capsicum definitions were found
  * in this file.  However, it conflicted with POSIX.1e's capability.h, so has
  * been renamed capsicum.h.  The file remains for backwards compatibility
- * reasons as a nested include.  It will be removed on March 31, 2019 and will
- * not be in FreeBSD 13.
+ * reasons as a nested include.  It is expected to be removed before
+ * FreeBSD 13.
  */
 #ifndef _SYS_CAPABILITY_H_
 #define_SYS_CAPABILITY_H_
 
-#warning this file includes , to be removed on March 31, 
2019.
+#warning this file includes  which is deprecated
 #include 
 
 #endif /* !_SYS_CAPABILITY_H_ */
___
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: r344530 - in head: . lib/libifconfig share/mk sys/sys

2019-02-25 Thread Ed Maste
Author: emaste
Date: Mon Feb 25 18:22:20 2019
New Revision: 344530
URL: https://svnweb.freebsd.org/changeset/base/344530

Log:
  Make libifconfig INTERNALLIB
  
  Instead of PRIVATELIB + NO_PIC.  This avoids the need for the wlandebug
  PIE special case added in r344211, and provides a stronger guarantee
  against 3rd party software coming to depend on the API or ABI.
  
  If / when we declare the API/ABI to be stable we can make it a normal
  library.
  
  Discussed with:   bapt
  Sponsored by: The FreeBSD Foundation

Modified:
  head/ObsoleteFiles.inc
  head/lib/libifconfig/Makefile
  head/share/mk/bsd.libnames.mk
  head/share/mk/src.libnames.mk
  head/sys/sys/capability.h

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Feb 25 18:11:59 2019(r344529)
+++ head/ObsoleteFiles.inc  Mon Feb 25 18:22:20 2019(r344530)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190222: libifconfig made INTERNALLIB
+OLD_FILES+=/usr/lib/libprivateifconfig.a
+OLD_FILES+=/usr/lib/libprivateifconfig_p.a
 # 20190131: pfil(9) changed
 OLD_FILES+=usr/share/man/man9/pfil_hook_get.9
 OLD_FILES+=usr/share/man/man9/pfil_rlock.9

Modified: head/lib/libifconfig/Makefile
==
--- head/lib/libifconfig/Makefile   Mon Feb 25 18:11:59 2019
(r344529)
+++ head/lib/libifconfig/Makefile   Mon Feb 25 18:22:20 2019
(r344530)
@@ -2,9 +2,7 @@
 
 PACKAGE=   lib${LIB}
 LIB=   ifconfig
-PRIVATELIB=true
-# Don't build shared library, for now.
-NO_PIC= 
+INTERNALLIB=   true
 
 SHLIBDIR?= /lib
 SHLIB_MAJOR=   1

Modified: head/share/mk/bsd.libnames.mk
==
--- head/share/mk/bsd.libnames.mk   Mon Feb 25 18:11:59 2019
(r344529)
+++ head/share/mk/bsd.libnames.mk   Mon Feb 25 18:22:20 2019
(r344530)
@@ -80,7 +80,6 @@ LIBIBMAD?=${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a
 LIBIBNETDISC?= ${LIBDESTDIR}${LIBDIR_BASE}/libibnetdisc.a
 LIBIBUMAD?=${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a
 LIBIBVERBS?=   ${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a
-LIBIFCONFIG?=  ${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a
 LIBIPSEC?= ${LIBDESTDIR}${LIBDIR_BASE}/libipsec.a
 LIBIPT?=   ${LIBDESTDIR}${LIBDIR_BASE}/libipt.a
 LIBJAIL?=  ${LIBDESTDIR}${LIBDIR_BASE}/libjail.a

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Mon Feb 25 18:11:59 2019
(r344529)
+++ head/share/mk/src.libnames.mk   Mon Feb 25 18:22:20 2019
(r344530)
@@ -20,7 +20,6 @@ _PRIVATELIBS= \
event \
heimipcc \
heimipcs \
-   ifconfig \
ldns \
sqlite3 \
ssh \
@@ -35,6 +34,7 @@ _INTERNALLIBS=\
cron \
elftc \
fifolog \
+   ifconfig \
ipf \
lpr \
netbsd \
@@ -449,6 +449,9 @@ LIBVERS?=   ${LIBVERSDIR}/libvers${PIE_SUFFIX}.a
 
 LIBSLDIR=  ${OBJTOP}/kerberos5/lib/libsl
 LIBSL?=${LIBSLDIR}/libsl${PIE_SUFFIX}.a
+
+LIBIFCONFIGDIR=${OBJTOP}/lib/libifconfig
+LIBIFCONFIG?=  ${LIBIFCONFIGDIR}/libifconfig${PIE_SUFFIX}.a
 
 LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf
 LIBIPF?=   ${LIBIPFDIR}/libipf${PIE_SUFFIX}.a

Modified: head/sys/sys/capability.h
==
--- head/sys/sys/capability.h   Mon Feb 25 18:11:59 2019(r344529)
+++ head/sys/sys/capability.h   Mon Feb 25 18:22:20 2019(r344530)
@@ -35,13 +35,13 @@
  * Historically, the key userspace and kernel Capsicum definitions were found
  * in this file.  However, it conflicted with POSIX.1e's capability.h, so has
  * been renamed capsicum.h.  The file remains for backwards compatibility
- * reasons as a nested include.  It is expected to be removed before
- * FreeBSD 13.
+ * reasons as a nested include.  It will be removed on March 31, 2019 and will
+ * not be in FreeBSD 13.
  */
 #ifndef _SYS_CAPABILITY_H_
 #define_SYS_CAPABILITY_H_
 
-#warning this file includes  which is deprecated
+#warning this file includes , to be removed on March 31, 
2019.
 #include 
 
 #endif /* !_SYS_CAPABILITY_H_ */
___
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: r344529 - head/sys/dev/flash

2019-02-25 Thread Ian Lepore
Author: ian
Date: Mon Feb 25 18:11:59 2019
New Revision: 344529
URL: https://svnweb.freebsd.org/changeset/base/344529

Log:
  Fix a paste-o that broke the build on all arches.
  
  Reported by:  many
  Pointy hat:   ian@

Modified:
  head/sys/dev/flash/at45d.c

Modified: head/sys/dev/flash/at45d.c
==
--- head/sys/dev/flash/at45d.c  Mon Feb 25 18:00:14 2019(r344528)
+++ head/sys/dev/flash/at45d.c  Mon Feb 25 18:11:59 2019(r344529)
@@ -345,7 +345,7 @@ at45d_delayed_attach(void *xsc)
sc->disk->d_mediasize = pagesize * ident->pagecount;
sc->disk->d_unit = device_get_unit(sc->dev);
disk_create(sc->disk, DISK_VERSION);
-   disk_add_alias(sc->sc_disk, "flash/spi");
+   disk_add_alias(sc->disk, "flash/spi");
bioq_init(&sc->bio_queue);
kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash");
sc->taskstate = TSTATE_RUNNING;
___
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: r344487 - in head/sys: conf gnu/gcov

2019-02-25 Thread Cy Schubert
On February 25, 2019 9:58:09 AM PST, Brooks Davis  wrote:
>On Sat, Feb 23, 2019 at 09:14:00PM +, Matt Macy wrote:
>> Author: mmacy
>> Date: Sat Feb 23 21:14:00 2019
>> New Revision: 344487
>> URL: https://svnweb.freebsd.org/changeset/base/344487
>> 
>> Log:
>>   gcov support
>>   
>>   add gcov support and export results as files in debugfs
>
>We had a brief discussion of this commit within a subset of core.  This
>addition of GPLv2 code is fine as the code is easily removal to a
>module
>(per kmoore@) should the day come that we're read to evict all GPL
>code.
>The modest increase in activation energy for that task seems worth it
>for the short-term gains of reduced integration cost (this code will
>greatly improve our ZFS-on-Linux test coverage.)
>
>Rod rightly points out that we haven't accepted SPDX tags alone as
>license statements.  The standard GPL v2.0 boiler plate should be added
>to this file along side the tag.
>
>An additional issue is that the a warning tag was not added to
>sys/conf/files.  A warning along the lines of:
>
>   warning "kernel contains GPLv2 licensed GCOV"
>
>needs to be added.
>
>This commit needed more through review.
>
>
>We intend to update our license policy to require core sign off for
>new GPL code to ensure we're not adding new, tightly integrated
>dependencies, to document that we're doing so knowingly, and
>to make sure steps aren't missed.  The current document is at:
>https://www.freebsd.org/internal/software-license.html
>
>-- Brooks

That's a  excellent idea. I was thinking about suggesting that over the weekend 
(actually a committee,  but core is better).

-- 
Pardon the typos and autocorrect, small keyboard in use.
Cheers,
Cy Schubert 
FreeBSD UNIX:  Web: http://www.FreeBSD.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: r344487 - in head/sys: conf gnu/gcov

2019-02-25 Thread Brooks Davis
On Sat, Feb 23, 2019 at 09:14:00PM +, Matt Macy wrote:
> Author: mmacy
> Date: Sat Feb 23 21:14:00 2019
> New Revision: 344487
> URL: https://svnweb.freebsd.org/changeset/base/344487
> 
> Log:
>   gcov support
>   
>   add gcov support and export results as files in debugfs

We had a brief discussion of this commit within a subset of core.  This
addition of GPLv2 code is fine as the code is easily removal to a module
(per kmoore@) should the day come that we're read to evict all GPL code.
The modest increase in activation energy for that task seems worth it
for the short-term gains of reduced integration cost (this code will
greatly improve our ZFS-on-Linux test coverage.)

Rod rightly points out that we haven't accepted SPDX tags alone as
license statements.  The standard GPL v2.0 boiler plate should be added
to this file along side the tag.

An additional issue is that the a warning tag was not added to
sys/conf/files.  A warning along the lines of:

warning "kernel contains GPLv2 licensed GCOV"

needs to be added.

This commit needed more through review.


We intend to update our license policy to require core sign off for
new GPL code to ensure we're not adding new, tightly integrated
dependencies, to document that we're doing so knowingly, and
to make sure steps aren't missed.  The current document is at:
https://www.freebsd.org/internal/software-license.html

-- Brooks


signature.asc
Description: PGP signature


svn commit: r344527 - head/sys/arm64/rockchip/clk

2019-02-25 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb 25 17:40:00 2019
New Revision: 344527
URL: https://svnweb.freebsd.org/changeset/base/344527

Log:
  arm64: rockchip: clk: Set the write mask when setting the clock mux
  
  RockChip clocks have a write mask in the upper 16bits of the mux register
  which wasn't set in the set_mux function.
  Also the wrong parent was tested instead of the real current one, when
  switch parent, test with the current one before.
  
  Pointy Hat:manu
  MFC after:1 week

Modified:
  head/sys/arm64/rockchip/clk/rk_clk_composite.c

Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c
==
--- head/sys/arm64/rockchip/clk/rk_clk_composite.c  Mon Feb 25 17:30:01 
2019(r344526)
+++ head/sys/arm64/rockchip/clk/rk_clk_composite.c  Mon Feb 25 17:40:00 
2019(r344527)
@@ -128,7 +128,7 @@ rk_clk_composite_set_mux(struct clknode *clk, int inde
READ4(clk, sc->muxdiv_offset, &val);
val &= ~sc->mux_mask;
val |= index << sc->mux_shift;
-   WRITE4(clk, sc->muxdiv_offset, val);
+   WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_COMPOSITE_MASK);
DEVICE_UNLOCK(clk);
 
return (0);
@@ -222,6 +222,7 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_
return (0);
}
 
+   p_idx = clknode_get_parent_idx(clk);
if (p_idx != best_parent)
clknode_set_parent_by_idx(clk, best_parent);
 
___
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: r344526 - head/sys/dev/flash

2019-02-25 Thread Ian Lepore
Author: ian
Date: Mon Feb 25 17:30:01 2019
New Revision: 344526
URL: https://svnweb.freebsd.org/changeset/base/344526

Log:
  Resolve a name conflict when both SpiFlash and DataFlash devices are present.
  
  Both SpiFlash (mx25l) and DataFlash (at45d) drivers create a disk device
  with a name of /dev/flash/spiN where N is the driver's unit number.  If
  both types of devices are present in the same system, this creates a fatal
  conflict that prevents attachment of whichever device attaches second
  (because mx25l0 and at45d0 both try to create a spi0).
  
  This gives each type of device a unique name (mx25lN or at45dN respectively)
  and also adds an alias of spiN for compatibility.  When both device types
  appear in the same system, only the first to attach gets the spiN alias.
  When the second device attaches there is a non-fatal warning that the alias
  can't be created, but both devices are still accessible via their primary
  names (and there is no need for the spiN name to work for backwards
  compatibility on such a system, because it has never been possible to use
  the spiN names when both devices exist).

Modified:
  head/sys/dev/flash/at45d.c
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/at45d.c
==
--- head/sys/dev/flash/at45d.c  Mon Feb 25 16:40:10 2019(r344525)
+++ head/sys/dev/flash/at45d.c  Mon Feb 25 17:30:01 2019(r344526)
@@ -338,13 +338,14 @@ at45d_delayed_attach(void *xsc)
sc->disk->d_open = at45d_open;
sc->disk->d_close = at45d_close;
sc->disk->d_strategy = at45d_strategy;
-   sc->disk->d_name = "flash/spi";
+   sc->disk->d_name = "flash/at45d";
sc->disk->d_drv1 = sc;
sc->disk->d_maxsize = DFLTPHYS;
sc->disk->d_sectorsize = pagesize;
sc->disk->d_mediasize = pagesize * ident->pagecount;
sc->disk->d_unit = device_get_unit(sc->dev);
disk_create(sc->disk, DISK_VERSION);
+   disk_add_alias(sc->sc_disk, "flash/spi");
bioq_init(&sc->bio_queue);
kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash");
sc->taskstate = TSTATE_RUNNING;

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Mon Feb 25 16:40:10 2019(r344525)
+++ head/sys/dev/flash/mx25l.c  Mon Feb 25 17:30:01 2019(r344526)
@@ -510,7 +510,7 @@ mx25l_attach(device_t dev)
sc->sc_disk->d_strategy = mx25l_strategy;
sc->sc_disk->d_getattr = mx25l_getattr;
sc->sc_disk->d_ioctl = mx25l_ioctl;
-   sc->sc_disk->d_name = "flash/spi";
+   sc->sc_disk->d_name = "flash/mx25l";
sc->sc_disk->d_drv1 = sc;
sc->sc_disk->d_maxsize = DFLTPHYS;
sc->sc_disk->d_sectorsize = MX25L_SECTORSIZE;
@@ -522,6 +522,7 @@ mx25l_attach(device_t dev)
sizeof(sc->sc_disk->d_descr));
 
disk_create(sc->sc_disk, DISK_VERSION);
+   disk_add_alias(sc->sc_disk, "flash/spi");
bioq_init(&sc->sc_bio_queue);
 
kproc_create(&mx25l_task, sc, &sc->sc_p, 0, 0, "task: mx25l flash");
___
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: r344525 - head/sys/dev/flash

2019-02-25 Thread Ian Lepore
Author: ian
Date: Mon Feb 25 16:40:10 2019
New Revision: 344525
URL: https://svnweb.freebsd.org/changeset/base/344525

Log:
  Add a metadata entry for the AT45DB641E chip.  This chip has the same 3-byte
  jedec ID as its older cousin the AT45DB642D, but uses a different page size.
  The only way to distinguish between the two chips is that the 2D chip has
  0 bytes of extended ID info and the new 1E has 1 byte of extended ID.  The
  actual value of the extended ID byte is all zeroes.  In other words, it's
  the presence of the extended info that identifies this chip. (Presumably
  a future upgrade might define non-zero values for the extended ID byte.)

Modified:
  head/sys/dev/flash/at45d.c

Modified: head/sys/dev/flash/at45d.c
==
--- head/sys/dev/flash/at45d.c  Mon Feb 25 16:28:13 2019(r344524)
+++ head/sys/dev/flash/at45d.c  Mon Feb 25 16:40:10 2019(r344525)
@@ -157,6 +157,7 @@ static const struct at45d_flash_ident at45d_flash_devi
{ "AT45DB161x", 0x1f26, 0x, 0x,  4096, 10,  528,  512 },
{ "AT45DB321x", 0x1f27, 0x, 0x,  8192, 10,  528,0 },
{ "AT45DB321x", 0x1f270100, 0x, 0x,  8192, 10,  528,  512 },
+   { "AT45DB641E", 0x1f280001, 0x, 0xff00, 32768,  9,  264,  256 },
{ "AT45DB642x", 0x1f28, 0x, 0x,  8192, 11, 1056, 1024 },
 };
 
___
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: r344524 - head/sys/dev/cxgbe/firmware

2019-02-25 Thread Navdeep Parhar
Author: np
Date: Mon Feb 25 16:28:13 2019
New Revision: 344524
URL: https://svnweb.freebsd.org/changeset/base/344524

Log:
  cxgbe(4): Updates to the default and hashfilter configurations.
  
  - Do not use nvf = 4 as it is not really supported by the firmware.
Firmwares 1.23.3.0 and above will ignore it silently.
  - Increase PF4's share of the VIs and let it use all of the RSS table.
  
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/firmware/t4fw_cfg.txt
  head/sys/dev/cxgbe/firmware/t5fw_cfg.txt
  head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt
  head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt

Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt
==
--- head/sys/dev/cxgbe/firmware/t4fw_cfg.txtMon Feb 25 16:20:58 2019
(r344523)
+++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txtMon Feb 25 16:28:13 2019
(r344524)
@@ -46,54 +46,50 @@
 # PFs 0-3.  These get 8 MSI/8 MSI-X vectors each.  VFs are supported by
 # these 4 PFs only.
 [function "0"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x1
 
 [function "1"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x2
 
 [function "2"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x4
 
 [function "3"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x8
 
@@ -103,7 +99,7 @@
wx_caps = all
r_caps = all
nvi = 32
-   rssnvi = 8
+   rssnvi = 16
niqflint = 512
nethctrl = 1024
neq = 2048
@@ -166,7 +162,7 @@
wx_caps = 0x82
r_caps = 0x86
nvi = 1
-   rssnvi = 1
+   rssnvi = 0
niqflint = 2
nethctrl = 2
neq = 4
@@ -178,7 +174,7 @@
wx_caps = 0x82
r_caps = 0x86
nvi = 1
-   rssnvi = 1
+   rssnvi = 0
niqflint = 2
nethctrl = 2
neq = 4
@@ -190,7 +186,7 @@
wx_caps = 0x82
r_caps = 0x86
nvi = 1
-   rssnvi = 1
+   rssnvi = 0
niqflint = 2
nethctrl = 2
neq = 4
@@ -202,7 +198,7 @@
wx_caps = 0x82
r_caps = 0x86
nvi = 1
-   rssnvi = 1
+   rssnvi = 0
niqflint = 2
nethctrl = 2
neq = 4
@@ -246,7 +242,7 @@
 
 [fini]
version = 0x1
-   checksum = 0x159b9295
+   checksum = 0x3ecbe8a0
 #
 # $FreeBSD$
 #

Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt
==
--- head/sys/dev/cxgbe/firmware/t5fw_cfg.txtMon Feb 25 16:20:58 2019
(r344523)
+++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txtMon Feb 25 16:28:13 2019
(r344524)
@@ -90,54 +90,50 @@
 # PFs 0-3.  These get 8 MSI/8 MSI-X vectors each.  VFs are supported by
 # these 4 PFs only.
 [function "0"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x1
 
 [function "1"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x2
 
 [function "2"]
-   nvf = 4
wx_caps = all
r_caps = all
-   nvi = 2
-   rssnvi = 2
-   niqflint = 4
-   nethctrl = 4
-   neq = 8
-   nexactf = 4
+   nvi = 1
+   rssnvi = 0
+   niqflint = 2
+   nethctrl = 2
+   neq = 4
+   nexactf = 2
cmask = all
pmask = 0x4
 
 [function "3"

svn commit: r344523 - head/sys/dev/flash

2019-02-25 Thread Ian Lepore
Author: ian
Date: Mon Feb 25 16:20:58 2019
New Revision: 344523
URL: https://svnweb.freebsd.org/changeset/base/344523

Log:
  Include the jedec "extended device information string" in the criteria used
  to match a chip to our table of metadata describing the chips. At least one
  new DataFlash chip has a 3-byte jedec ID identical to its predecessors and
  differs only in the extended info, and it has different metadata requiring a
  unique entry in the table.  This paves the way for supporting such chips.
  
  The metadata table now includes two new fields, extmask and extid.  The two
  bytes of extended info obtained from the chip are ANDed with extmask then
  compared to extid, so it's possible to use only a subset of the extended
  info in the matching.
  
  We now always read 6 bytes of jedec ID info. Most chips don't return any
  extended info, and the values read back for those two bytes may be
  indeterminate, but such chips have extmask and extid values of 0x in the
  table, so the extid effectively doesn't participate in the matching on those
  chips and it doesn't matter what they return in the extended info bytes.

Modified:
  head/sys/dev/flash/at45d.c

Modified: head/sys/dev/flash/at45d.c
==
--- head/sys/dev/flash/at45d.c  Mon Feb 25 15:51:31 2019(r344522)
+++ head/sys/dev/flash/at45d.c  Mon Feb 25 16:20:58 2019(r344523)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -62,10 +63,22 @@ static struct ofw_compat_data compat_data[] = {
 SPIBUS_PNP_INFO(compat_data);
 #endif
 
+/* This is the information returned by the MANUFACTURER_ID command. */
+struct at45d_mfg_info {
+   uint32_tjedec_id; /* Mfg ID, DevId1, DevId2, ExtLen */
+   uint16_text_id;   /* ExtId1, ExtId2 */
+};
+
+/*
+ * This is an entry in our table of metadata describing the chips.  We match on
+ * both jedec id and extended id info returned by the MANUFACTURER_ID command.
+ */
 struct at45d_flash_ident
 {
const char  *name;
uint32_tjedec;
+   uint16_textid;
+   uint16_textmask;
uint16_tpagecount;
uint16_tpageoffset;
uint16_tpagesize;
@@ -111,7 +124,7 @@ static void at45d_task(void *arg);
 
 /* helper routines */
 static void at45d_delayed_attach(void *xsc);
-static int at45d_get_mfg_info(device_t dev, uint8_t *resp);
+static int at45d_get_mfg_info(device_t dev, struct at45d_mfg_info *resp);
 static int at45d_get_status(device_t dev, uint8_t *status);
 static int at45d_wait_ready(device_t dev, uint8_t *status);
 
@@ -123,19 +136,28 @@ static int at45d_wait_ready(device_t dev, uint8_t *sta
 #defineCONTINUOUS_ARRAY_READ   0xe8
 
 /*
+ * Metadata for supported chips.
+ *
+ * The jedec id in this table includes the extended id length byte.  A match is
+ * based on both jedec id and extended id matching.  The chip's extended id 
(not
+ * present in most chips) is ANDed with ExtMask and the result is compared to
+ * ExtId.  If a chip only returns 1 ext id byte it will be in the upper 8 bits
+ * of ExtId in this table.
+ *
  * A sectorsize2n != 0 is used to indicate that a device optionally supports
  * 2^N byte pages.  If support for the latter is enabled, the sector offset
  * has to be reduced by one.
  */
 static const struct at45d_flash_ident at45d_flash_devices[] = {
-   { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 },
-   { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 },
-   { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 },
-   { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 },
-   { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 },
-   { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 },
-   { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 },
-   { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 }
+   /* Part NameJedec IDExtId   ExtMask PgCnt Offs PgSz PgSz2n */
+   { "AT45DB011B", 0x1f22, 0x, 0x,   512,  9,  264,  256 },
+   { "AT45DB021B", 0x1f23, 0x, 0x,  1024,  9,  264,  256 },
+   { "AT45DB041x", 0x1f24, 0x, 0x,  2028,  9,  264,  256 },
+   { "AT45DB081B", 0x1f25, 0x, 0x,  4096,  9,  264,  256 },
+   { "AT45DB161x", 0x1f26, 0x, 0x,  4096, 10,  528,  512 },
+   { "AT45DB321x", 0x1f27, 0x, 0x,  8192, 10,  528,0 },
+   { "AT45DB321x", 0x1f270100, 0x, 0x,  8192, 10,  528,  512 },
+   { "AT45DB642x", 0x1f28, 0x, 0x,  8192, 11, 1056, 1024 },
 };
 
 static int
@@ -159,7 +181,7 @@ at45d_get_status(device_t dev, uint8_t *status)
 }
 
 static int
-at45d_get_mfg_info(device_t dev, uint8_t *resp)
+at45d_get_mfg_info(device_t dev, struct at45d_mfg_info *resp)
 {
uint8_t rxBuf[8], txBuf[8];
struct spi_command cmd;
@@ -172,11 +194,14 @@ at45d_get_mfg_info(device_t dev, uint8_t *resp

svn commit: r344522 - stable/12/sys/kern

2019-02-25 Thread Mark Johnston
Author: markj
Date: Mon Feb 25 15:51:31 2019
New Revision: 344522
URL: https://svnweb.freebsd.org/changeset/base/344522

Log:
  MFC r344369:
  Remove an obsolete comment.

Modified:
  stable/12/sys/kern/kern_descrip.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_descrip.c
==
--- stable/12/sys/kern/kern_descrip.c   Mon Feb 25 15:50:59 2019
(r344521)
+++ stable/12/sys/kern/kern_descrip.c   Mon Feb 25 15:51:31 2019
(r344522)
@@ -2456,9 +2456,6 @@ fdcheckstd(struct thread *td)
  * Internal form of close.  Decrement reference count on file structure.
  * Note: td may be NULL when closing a file that was being passed in a
  * message.
- *
- * XXXRW: Giant is not required for the caller, but often will be held; this
- * makes it moderately likely the Giant will be recursed in the VFS case.
  */
 int
 closef(struct file *fp, struct thread *td)
___
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: r344521 - stable/12/sys/amd64/sgx

2019-02-25 Thread Mark Johnston
Author: markj
Date: Mon Feb 25 15:50:59 2019
New Revision: 344521
URL: https://svnweb.freebsd.org/changeset/base/344521

Log:
  MFC r344232:
  Fix refcount leaks in the SGX Linux compat ioctl handler.

Modified:
  stable/12/sys/amd64/sgx/sgx_linux.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/sgx/sgx_linux.c
==
--- stable/12/sys/amd64/sgx/sgx_linux.c Mon Feb 25 15:50:28 2019
(r344520)
+++ stable/12/sys/amd64/sgx/sgx_linux.c Mon Feb 25 15:50:59 2019
(r344521)
@@ -70,30 +70,26 @@ sgx_linux_ioctl(struct thread *td, struct linux_ioctl_
cmd = args->cmd;
 
args->cmd &= ~(LINUX_IOC_IN | LINUX_IOC_OUT);
-   if (cmd & LINUX_IOC_IN)
+   if ((cmd & LINUX_IOC_IN) != 0)
args->cmd |= IOC_IN;
-   if (cmd & LINUX_IOC_OUT)
+   if ((cmd & LINUX_IOC_OUT) != 0)
args->cmd |= IOC_OUT;
 
len = IOCPARM_LEN(cmd);
if (len > SGX_IOCTL_MAX_DATA_LEN) {
-   printf("%s: Can't copy data: cmd len is too big %d\n",
-   __func__, len);
-   return (EINVAL);
+   error = EINVAL;
+   goto out;
}
 
-   if (cmd & LINUX_IOC_IN) {
+   if ((cmd & LINUX_IOC_IN) != 0) {
error = copyin((void *)args->arg, data, len);
-   if (error) {
-   printf("%s: Can't copy data, error %d\n",
-   __func__, error);
-   return (EINVAL);
-   }
+   if (error != 0)
+   goto out;
}
 
-   error = (fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td));
+   error = fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td);
+out:
fdrop(fp, td);
-
return (error);
 }
 
___
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: r344520 - stable/12/sys/vm

2019-02-25 Thread Mark Johnston
Author: markj
Date: Mon Feb 25 15:50:28 2019
New Revision: 344520
URL: https://svnweb.freebsd.org/changeset/base/344520

Log:
  MFC r344231, r30:
  Remove a redundant flag variable.

Modified:
  stable/12/sys/vm/vm_pageout.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_pageout.c
==
--- stable/12/sys/vm/vm_pageout.c   Mon Feb 25 15:47:22 2019
(r344519)
+++ stable/12/sys/vm/vm_pageout.c   Mon Feb 25 15:50:28 2019
(r344520)
@@ -695,10 +695,9 @@ vm_pageout_launder(struct vm_domain *vmd, int launder,
vm_page_t m, marker;
int act_delta, error, numpagedout, queue, starting_target;
int vnodes_skipped;
-   bool obj_locked, pageout_ok;
+   bool pageout_ok;
 
mtx = NULL;
-   obj_locked = false;
object = NULL;
starting_target = launder;
vnodes_skipped = 0;
@@ -760,22 +759,16 @@ recheck:
}
 
if (object != m->object) {
-   if (obj_locked) {
+   if (object != NULL)
VM_OBJECT_WUNLOCK(object);
-   obj_locked = false;
-   }
object = m->object;
-   }
-   if (!obj_locked) {
if (!VM_OBJECT_TRYWLOCK(object)) {
mtx_unlock(mtx);
/* Depends on type-stability. */
VM_OBJECT_WLOCK(object);
-   obj_locked = true;
mtx_lock(mtx);
goto recheck;
-   } else
-   obj_locked = true;
+   }
}
 
if (vm_page_busied(m))
@@ -897,16 +890,16 @@ free_page:
vnodes_skipped++;
}
mtx = NULL;
-   obj_locked = false;
+   object = NULL;
}
}
if (mtx != NULL) {
mtx_unlock(mtx);
mtx = NULL;
}
-   if (obj_locked) {
+   if (object != NULL) {
VM_OBJECT_WUNLOCK(object);
-   obj_locked = false;
+   object = NULL;
}
vm_pagequeue_lock(pq);
vm_pageout_end_scan(&ss);
@@ -1368,7 +1361,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh
vm_object_t object;
int act_delta, addl_page_shortage, deficit, page_shortage;
int starting_page_shortage;
-   bool obj_locked;
 
/*
 * The addl_page_shortage is an estimate of the number of temporarily
@@ -1388,7 +1380,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh
starting_page_shortage = page_shortage = shortage + deficit;
 
mtx = NULL;
-   obj_locked = false;
object = NULL;
vm_batchqueue_init(&rq);
 
@@ -1446,22 +1437,16 @@ recheck:
}
 
if (object != m->object) {
-   if (obj_locked) {
+   if (object != NULL)
VM_OBJECT_WUNLOCK(object);
-   obj_locked = false;
-   }
object = m->object;
-   }
-   if (!obj_locked) {
if (!VM_OBJECT_TRYWLOCK(object)) {
mtx_unlock(mtx);
/* Depends on type-stability. */
VM_OBJECT_WLOCK(object);
-   obj_locked = true;
mtx_lock(mtx);
goto recheck;
-   } else
-   obj_locked = true;
+   }
}
 
if (vm_page_busied(m)) {
@@ -1563,14 +1548,10 @@ free_page:
 reinsert:
vm_pageout_reinsert_inactive(&ss, &rq, m);
}
-   if (mtx != NULL) {
+   if (mtx != NULL)
mtx_unlock(mtx);
-   mtx = NULL;
-   }
-   if (obj_locked) {
+   if (object != NULL)
VM_OBJECT_WUNLOCK(object);
-   obj_locked = false;
-   }
vm_pageout_reinsert_inactive(&ss, &rq, NULL);
vm_pageout_reinsert_inactive(&ss, &ss.bq, NULL);
vm_pagequeue_lock(pq);
___
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: r344519 - head/sys/dev/cxgbe/common

2019-02-25 Thread Navdeep Parhar
Author: np
Date: Mon Feb 25 15:47:22 2019
New Revision: 344519
URL: https://svnweb.freebsd.org/changeset/base/344519

Log:
  cxgbe(4): Use correct port_info in the call to is_bt().
  
  This fixes a panic during configuration if the tx channel of a port
  isn't the same as its port id.
  
  Reported by:  Fabrice Bruel
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 25 15:03:50 2019
(r344518)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 25 15:47:22 2019
(r344519)
@@ -3894,7 +3894,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m
speed = fwcap_top_speed(lc->supported);
 
/* Force AN on for BT cards. */
-   if (is_bt(adap->port[port]))
+   if (is_bt(adap->port[adap->chan_map[port]]))
aneg = lc->supported & FW_PORT_CAP32_ANEG;
 
rcap = aneg | speed | fc | fec;
___
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: r344518 - head/share/man/man9

2019-02-25 Thread Enji Cooper


> On Feb 25, 2019, at 07:03, Mateusz Piotrowski <0...@freebsd.org> wrote:
> 
> Author: 0mp (ports committer)
> Date: Mon Feb 25 15:03:50 2019
> New Revision: 344518
> URL: https://svnweb.freebsd.org/changeset/base/344518
> 
> Log:
>  Add missing types to the sysctl(9) manual page
> 
>  Update the diff to include other missing sysctl types found in sysctl.h.
> 
>  Some of these sysctls are already documented in other pages (e.g counter(9)
>  and ZONE(9)), but they should at least be mentioned here for completeness.
> 
>  This patch now documents all of the following:
>  - SYSCTL_BOOL/SYSCTL_ADD_BOOL
>  - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64
>  - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY
>  - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC
>  - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC
>  - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR
>  - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX
> 
>  Submitted by:mhorne063_gmail.com
>  Reviewed by:bcr, hselasky
>  Approved by:bcr (doc), hselasky (src)
>  Approved by:krion (mentor, implicit), mat (mentor, implicit)
>  Differential Revision:https://reviews.freebsd.org/D19272
> 
> Modified:
>  head/share/man/man9/sysctl.9

...

> @@ -52,10 +57,15 @@
> .Nm SYSCTL_ADD_UINT ,
> .Nm SYSCTL_ADD_ULONG ,
> .Nm SYSCTL_ADD_UQUAD ,
> +.Nm SYSCTL_ADD_UMA_CUR ,
> +.Nm SYSCTL_ADD_UMA_MAX ,

Same as my comment below.

> .Nm SYSCTL_CHILDREN ,
> .Nm SYSCTL_STATIC_CHILDREN ,
> .Nm SYSCTL_NODE_CHILDREN ,
> .Nm SYSCTL_PARENT ,
> +.Nm SYSCTL_BOOL ,
> +.Nm SYSCTL_COUNTER_U64 ,
> +.Nm SYSCTL_COUNTER_U64_ARRAY ,
> .Nm SYSCTL_INT ,
> .Nm SYSCTL_INT_WITH_LABEL ,
> .Nm SYSCTL_LONG ,
> @@ -69,6 +79,8 @@
> .Nm SYSCTL_S16 ,
> .Nm SYSCTL_S32 ,
> .Nm SYSCTL_S64 ,
> +.Nm SYSCTL_SBINTIME_MSEC ,
> +.Nm SYSCTL_SBINTIME_USEC ,
> .Nm SYSCTL_STRING ,
> .Nm SYSCTL_STRUCT ,
> .Nm SYSCTL_U8 ,
> @@ -77,13 +89,47 @@
> .Nm SYSCTL_U64 ,
> .Nm SYSCTL_UINT ,
> .Nm SYSCTL_ULONG ,
> -.Nm SYSCTL_UQUAD
> +.Nm SYSCTL_UQUAD ,
> +.Nm SYSCTL_UMA_CUR ,
> +.Nm SYSCTL_UMA_MAX

Quick nit: UMA sorts before UQUAD.

Also, these APIs deserve manpage links via MLINKS.

Cheers!
-Enji
___
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: r344518 - head/share/man/man9

2019-02-25 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Mon Feb 25 15:03:50 2019
New Revision: 344518
URL: https://svnweb.freebsd.org/changeset/base/344518

Log:
  Add missing types to the sysctl(9) manual page
  
  Update the diff to include other missing sysctl types found in sysctl.h.
  
  Some of these sysctls are already documented in other pages (e.g counter(9)
  and ZONE(9)), but they should at least be mentioned here for completeness.
  
  This patch now documents all of the following:
  - SYSCTL_BOOL/SYSCTL_ADD_BOOL
  - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64
  - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY
  - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC
  - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC
  - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR
  - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX
  
  Submitted by: mhorne063_gmail.com
  Reviewed by:  bcr, hselasky
  Approved by:  bcr (doc), hselasky (src)
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D19272

Modified:
  head/share/man/man9/sysctl.9

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Mon Feb 25 13:15:34 2019
(r344517)
+++ head/share/man/man9/sysctl.9Mon Feb 25 15:03:50 2019
(r344518)
@@ -25,11 +25,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 1, 2018
+.Dd February 25, 2019
 .Dt SYSCTL 9
 .Os
 .Sh NAME
 .Nm SYSCTL_DECL ,
+.Nm SYSCTL_ADD_BOOL ,
+.Nm SYSCTL_ADD_COUNTER_U64 ,
+.Nm SYSCTL_ADD_COUNTER_U64_ARRAY ,
 .Nm SYSCTL_ADD_INT ,
 .Nm SYSCTL_ADD_LONG ,
 .Nm SYSCTL_ADD_NODE ,
@@ -42,6 +45,8 @@
 .Nm SYSCTL_ADD_S16 ,
 .Nm SYSCTL_ADD_S32 ,
 .Nm SYSCTL_ADD_S64 ,
+.Nm SYSCTL_ADD_SBINTIME_MSEC ,
+.Nm SYSCTL_ADD_SBINTIME_USEC ,
 .Nm SYSCTL_ADD_STRING ,
 .Nm SYSCTL_ADD_STRUCT ,
 .Nm SYSCTL_ADD_U8 ,
@@ -52,10 +57,15 @@
 .Nm SYSCTL_ADD_UINT ,
 .Nm SYSCTL_ADD_ULONG ,
 .Nm SYSCTL_ADD_UQUAD ,
+.Nm SYSCTL_ADD_UMA_CUR ,
+.Nm SYSCTL_ADD_UMA_MAX ,
 .Nm SYSCTL_CHILDREN ,
 .Nm SYSCTL_STATIC_CHILDREN ,
 .Nm SYSCTL_NODE_CHILDREN ,
 .Nm SYSCTL_PARENT ,
+.Nm SYSCTL_BOOL ,
+.Nm SYSCTL_COUNTER_U64 ,
+.Nm SYSCTL_COUNTER_U64_ARRAY ,
 .Nm SYSCTL_INT ,
 .Nm SYSCTL_INT_WITH_LABEL ,
 .Nm SYSCTL_LONG ,
@@ -69,6 +79,8 @@
 .Nm SYSCTL_S16 ,
 .Nm SYSCTL_S32 ,
 .Nm SYSCTL_S64 ,
+.Nm SYSCTL_SBINTIME_MSEC ,
+.Nm SYSCTL_SBINTIME_USEC ,
 .Nm SYSCTL_STRING ,
 .Nm SYSCTL_STRUCT ,
 .Nm SYSCTL_U8 ,
@@ -77,13 +89,47 @@
 .Nm SYSCTL_U64 ,
 .Nm SYSCTL_UINT ,
 .Nm SYSCTL_ULONG ,
-.Nm SYSCTL_UQUAD
+.Nm SYSCTL_UQUAD ,
+.Nm SYSCTL_UMA_CUR ,
+.Nm SYSCTL_UMA_MAX
 .Nd Dynamic and static sysctl MIB creation functions
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/sysctl.h
 .Fn SYSCTL_DECL name
 .Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_BOOL
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "bool *ptr"
+.Fa "uint8_t val"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_COUNTER_U64
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "counter_u64_t *ptr"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_COUNTER_U64_ARRAY
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "counter_u64_t *ptr"
+.Fa "intmax_t len"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
 .Fo SYSCTL_ADD_INT
 .Fa "struct sysctl_ctx_list *ctx"
 .Fa "struct sysctl_oid_list *parent"
@@ -214,6 +260,26 @@
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_SBINTIME_MSEC
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "sbintime_t *ptr"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_SBINTIME_USEC
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "sbintime_t *ptr"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
 .Fo SYSCTL_ADD_STRING
 .Fa "struct sysctl_ctx_list *ctx"
 .Fa "struct sysctl_oid_list *parent"
@@ -311,6 +377,27 @@
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_UMA_CUR
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "uma_zone_t ptr"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_UMA_MAX
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "uma_zone_t ptr"
+.Fa "const char *descr"
+.Fc
+.Fa "const char *descr"
+.Ft struct sysctl_oid *
 .Fo SYSCTL_ADD_UAUTO
 .Fa "struct sysctl_ctx_list *ctx"
 .Fa "struct sysctl_oid_list *parent"
@@ -337,6 +424,9 @@
 .Fo SYSCTL_PARENT
 .Fa "struct sysctl_oid *oi

svn commit: r344517 - head/sys/kern

2019-02-25 Thread Andrew Turner
Author: andrew
Date: Mon Feb 25 13:15:34 2019
New Revision: 344517
URL: https://svnweb.freebsd.org/changeset/base/344517

Log:
  Check the index hasn't changed after writing the cmp entry.
  
  If an interrupt fires while writing the cmp entry we may have a partial
  entry. Work around this by using atomic_cmpset to set the new index. If it
  fails we need to set the previous index value and try again as the entry
  may be in an inconsistent state.
  
  This fixes messages similar to the following from syzkaller:
  bad comp 224 type 2163727253
  
  Reviewed by:  tuexen
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D19287

Modified:
  head/sys/kern/kern_kcov.c

Modified: head/sys/kern/kern_kcov.c
==
--- head/sys/kern/kern_kcov.c   Mon Feb 25 12:35:52 2019(r344516)
+++ head/sys/kern/kern_kcov.c   Mon Feb 25 13:15:34 2019(r344517)
@@ -247,11 +247,16 @@ trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2,
if (index * 4 + 4 + 1 > info->entries)
return (false);
 
-   buf[index * 4 + 1] = type;
-   buf[index * 4 + 2] = arg1;
-   buf[index * 4 + 3] = arg2;
-   buf[index * 4 + 4] = ret;
-   buf[0] = index + 1;
+   while (1) {
+   buf[index * 4 + 1] = type;
+   buf[index * 4 + 2] = arg1;
+   buf[index * 4 + 3] = arg2;
+   buf[index * 4 + 4] = ret;
+
+   if (atomic_cmpset_64(&buf[0], index, index + 1))
+   break;
+   buf[0] = index;
+   }
 
return (true);
 }
___
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: r344516 - stable/12/sys/netinet

2019-02-25 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 25 12:35:52 2019
New Revision: 344516
URL: https://svnweb.freebsd.org/changeset/base/344516

Log:
  MFC r344428:
  
  This patch addresses an issue brought up by bz@ in D18968:
  When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen,
  if user data was received during the TCP handshake and BB logging is used.
  
  A KASSERT is also added to detect tcp_reass() calls with illegal parameter
  combinations.
  
  Reported by:  bz@
  Reviewed by:  rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D19254

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

Modified: stable/12/sys/netinet/tcp_reass.c
==
--- stable/12/sys/netinet/tcp_reass.c   Mon Feb 25 12:33:11 2019
(r344515)
+++ stable/12/sys/netinet/tcp_reass.c   Mon Feb 25 12:35:52 2019
(r344516)
@@ -542,6 +542,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq
 * and should be rewritten (see NetBSD for optimizations).
 */
 
+   KASSERT(th == NULL || (seq_start != NULL && tlenp != NULL),
+   ("tcp_reass called with illegal parameter combination "
+"(tp=%p, th=%p, seq_start=%p, tlenp=%p, m=%p)",
+tp, th, seq_start, tlenp, m));
/*
 * Call with th==NULL after become established to
 * force pre-ESTABLISHED data up to user socket.
@@ -1062,12 +1066,20 @@ present:
} else {
 #ifdef TCP_REASS_LOGGING
tcp_reass_log_new_in(tp, q->tqe_start, q->tqe_len, 
q->tqe_m, TCP_R_LOG_READ, q);
-   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 1);
+   if (th != NULL) {
+   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 1);
+   } else {
+   tcp_log_reassm(tp, q, NULL, 0, 0, 
TCP_R_LOG_READ, 1);
+   }
 #endif
sbappendstream_locked(&so->so_rcv, q->tqe_m, 0);
}
 #ifdef TCP_REASS_LOGGING
-   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 
2);
+   if (th != NULL) {
+   tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_READ, 2);
+   } else {
+   tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 2);
+   }
 #endif
KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt,
("tp:%p seg queue goes negative", tp));
@@ -1083,7 +1095,11 @@ present:
  tp, &tp->t_segq, tp->t_segqmbuflen);
 #else
 #ifdef TCP_REASS_LOGGING
-   tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_ZERO, 0);
+   if (th != NULL) {
+   tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, 
TCP_R_LOG_ZERO, 0);
+   } else {
+   tcp_log_reassm(tp, NULL, NULL, 0, 0, TCP_R_LOG_ZERO, 0);
+   }
 #endif
tp->t_segqmbuflen = 0;
 #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: r344515 - stable/12/sys/netinet

2019-02-25 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 25 12:33:11 2019
New Revision: 344515
URL: https://svnweb.freebsd.org/changeset/base/344515

Log:
  MFC r343439:
  
  Don't include two header files when not needed.
  
  This allows the part of the rewrite of TCP reassembly in this
  files to be MFCed to stable/11 with manual change.
  
  Sponsored by: Netflix, Inc.

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

Modified: stable/12/sys/netinet/tcp_reass.c
==
--- stable/12/sys/netinet/tcp_reass.c   Mon Feb 25 12:25:44 2019
(r344514)
+++ stable/12/sys/netinet/tcp_reass.c   Mon Feb 25 12:33:11 2019
(r344515)
@@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_tcpdebug.h"
 
+/* For debugging we want counters and BB logging */
+/* #define TCP_REASS_COUNTERS 1 */
+/* #define TCP_REASS_LOGGING 1 */
+
 #include 
 #include 
 #include 
@@ -72,8 +76,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef TCP_REASS_LOGGING
 #include 
 #include 
+#endif
 #include 
 #include 
 #ifdef TCPDEBUG
@@ -91,10 +97,6 @@ __FBSDID("$FreeBSD$");
 #define TCP_R_LOG_ZERO 9
 #define TCP_R_LOG_DUMP 10
 #define TCP_R_LOG_TRIM 11
-
-/* For debugging we want counters and BB logging */
-/* #define TCP_REASS_COUNTERS 1 */
-/* #define TCP_REASS_LOGGING 1 */
 
 static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
 "TCP Segment Reassembly Queue");
___
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: r344514 - stable/12/sys/netinet/cc

2019-02-25 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 25 12:25:44 2019
New Revision: 344514
URL: https://svnweb.freebsd.org/changeset/base/344514

Log:
  MFC r343920:
  
  Ensure that when using the TCP CDG congestion control and setting the
  sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing
  is disabled. Without this patch, a division by zero orrurs.
  
  PR:   193762
  Reviewed by:  lstewart@, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D19071

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

Modified: stable/12/sys/netinet/cc/cc_cdg.c
==
--- stable/12/sys/netinet/cc/cc_cdg.c   Mon Feb 25 11:59:29 2019
(r344513)
+++ stable/12/sys/netinet/cc/cc_cdg.c   Mon Feb 25 12:25:44 2019
(r344514)
@@ -592,7 +592,11 @@ cdg_ack_received(struct cc_var *ccv, uint16_t ack_type
qdiff_min = ((long)(cdg_data->minrtt_in_rtt -
cdg_data->minrtt_in_prevrtt) << D_P_E );
 
-   calc_moving_average(cdg_data, qdiff_max, qdiff_min);
+   if (cdg_data->sample_q_size == 0) {
+   cdg_data->max_qtrend = qdiff_max;
+   cdg_data->min_qtrend = qdiff_min;
+   } else
+   calc_moving_average(cdg_data, qdiff_max, 
qdiff_min);
 
/* Probabilistic backoff with respect to gradient. */
if (slowstart && qdiff_min > 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344512 - stable/11/sys/netinet/cc

2019-02-25 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 25 10:51:21 2019
New Revision: 344512
URL: https://svnweb.freebsd.org/changeset/base/344512

Log:
  MFC r343920:
  
  Ensure that when using the TCP CDG congestion control and setting the
  sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing
  is disabled. Without this patch, a division by zero orrurs.
  
  Reviewed by:  lstewart@, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D19071

Modified:
  stable/11/sys/netinet/cc/cc_cdg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/cc/cc_cdg.c
==
--- stable/11/sys/netinet/cc/cc_cdg.c   Mon Feb 25 10:38:37 2019
(r344511)
+++ stable/11/sys/netinet/cc/cc_cdg.c   Mon Feb 25 10:51:21 2019
(r344512)
@@ -590,7 +590,11 @@ cdg_ack_received(struct cc_var *ccv, uint16_t ack_type
qdiff_min = ((long)(cdg_data->minrtt_in_rtt -
cdg_data->minrtt_in_prevrtt) << D_P_E );
 
-   calc_moving_average(cdg_data, qdiff_max, qdiff_min);
+   if (cdg_data->sample_q_size == 0) {
+   cdg_data->max_qtrend = qdiff_max;
+   cdg_data->min_qtrend = qdiff_min;
+   } else
+   calc_moving_average(cdg_data, qdiff_max, 
qdiff_min);
 
/* Probabilistic backoff with respect to gradient. */
if (slowstart && qdiff_min > 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r344511 - in stable/11/sys: netinet netinet/tcp_stacks sys

2019-02-25 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 25 10:38:37 2019
New Revision: 344511
URL: https://svnweb.freebsd.org/changeset/base/344511

Log:
  Backport the new TCP reassembly code from head to stable/11.
  
  In particular:
  
  * Cherry pick the changes in sys/queue.h from r334804.
  
  * MFC r338102 with manually removing changes to file not existent in
stable/11 and resolve conflicts in tcp_var.h.
This change represents a substantial restructure of the way we
reassembly inbound tcp segments. The old algorithm just blindly
dropped in segments without coalescing. This meant that every
segment could take up greater and greater room on the linked list
of segments. This of course is now subject to a tighter limit (100)
of segments which in a high BDP situation will cause us to be a
lot more in-efficent as we drop segments beyond 100 entries that
we receive. What this restructure does is cause the reassembly
buffer to coalesce segments putting an emphasis on the two
common cases (which avoid walking the list of segments) i.e.
where we add to the back of the queue of segments and where we
add to the front. We also have the reassembly buffer supporting
a couple of debug options (black box logging as well as counters
for code coverage). These are compiled out by default but can
be added by uncommenting the defines.
  
  * Manually fix tcp_stacks/fastopen.c, since it does not exist anymore
in head.
  
  * MFC r342280:
Fix a regression in the TCP handling of received segments.
When receiving TCP segments the stack protects itself by limiting
the resources allocated for a TCP connections. This patch adds
an exception to these limitations for the TCP segement which is the next
expected in-sequence segment. Without this patch, TCP connections
may stall and finally fail in some cases of packet loss.
  
  * MFC r343439:
Don't include two header files when not needed.
This allows the part of the rewrite of TCP reassembly in this
files to be MFCed to stable/11 with manual change.
  
  * MFC r344428:
This patch addresses an issue brought up by bz@ in D18968:
When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen,
if user data was received during the TCP handshake and BB logging is used.
A KASSERT is also added to detect tcp_reass() calls with illegal parameter
combinations.
  
  Reviewed by:  bz@, jtl, rrs@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D18960

Modified:
  stable/11/sys/netinet/tcp_input.c
  stable/11/sys/netinet/tcp_reass.c
  stable/11/sys/netinet/tcp_stacks/fastpath.c
  stable/11/sys/netinet/tcp_subr.c
  stable/11/sys/netinet/tcp_usrreq.c
  stable/11/sys/netinet/tcp_var.h
  stable/11/sys/sys/queue.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_input.c
==
--- stable/11/sys/netinet/tcp_input.c   Mon Feb 25 09:57:06 2019
(r344510)
+++ stable/11/sys/netinet/tcp_input.c   Mon Feb 25 10:38:37 2019
(r344511)
@@ -1760,7 +1760,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
tp->snd_nxt == tp->snd_max &&
tiwin && tiwin == tp->snd_wnd && 
((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) &&
-   LIST_EMPTY(&tp->t_segq) &&
+   SEGQ_EMPTY(tp) &&
((to.to_flags & TOF_TS) == 0 ||
 TSTMP_GEQ(to.to_tsval, tp->ts_recent)) ) {
 
@@ -2473,7 +2473,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 * later; if not, do so now to pass queued data to user.
 */
if (tlen == 0 && (thflags & TH_FIN) == 0)
-   (void) tcp_reass(tp, (struct tcphdr *)0, 0,
+   (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0,
(struct mbuf *)0);
tp->snd_wl1 = th->th_seq - 1;
/* FALLTHROUGH */
@@ -3044,7 +3044,7 @@ dodata:   
/* XXX */
 * fast retransmit can work).
 */
if (th->th_seq == tp->rcv_nxt &&
-   LIST_EMPTY(&tp->t_segq) &&
+   SEGQ_EMPTY(tp) &&
(TCPS_HAVEESTABLISHED(tp->t_state) ||
 tfo_syn)) {
if (DELAY_ACK(tp, tlen) || tfo_syn)
@@ -3069,7 +3069,7 @@ dodata:   
/* XXX */
 * m_adj() doesn't actually frees any mbufs
 * when trimming from the head.
 */
-   thflags = tcp_reass(tp, th, &tlen, m);
+   thflags = tcp_reass(tp, th, &save_start, &tlen, m);
tp->t_flags |= TF_ACKNOW;
}
if (tlen > 0 &

svn commit: r344510 - head/sys/dev/netmap

2019-02-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Feb 25 09:57:06 2019
New Revision: 344510
URL: https://svnweb.freebsd.org/changeset/base/344510

Log:
  netmap: remove redundant call to nm_set_native_flags()
  
  This redundant call was introduced by mistake in r343772.
  
  MFC after:3 days
  Sponsored by: Sunny Valley Networks

Modified:
  head/sys/dev/netmap/if_vtnet_netmap.h

Modified: head/sys/dev/netmap/if_vtnet_netmap.h
==
--- head/sys/dev/netmap/if_vtnet_netmap.h   Mon Feb 25 09:13:33 2019
(r344509)
+++ head/sys/dev/netmap/if_vtnet_netmap.h   Mon Feb 25 09:57:06 2019
(r344510)
@@ -132,7 +132,6 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state)
 
if (state) {
netmap_krings_mode_commit(na, state);
-   nm_set_native_flags(na);
} else {
nm_clear_native_flags(na);
netmap_krings_mode_commit(na, state);
___
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: r344509 - stable/11/sys/dev/netmap

2019-02-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Feb 25 09:13:33 2019
New Revision: 344509
URL: https://svnweb.freebsd.org/changeset/base/344509

Log:
  MFC r343579, r344253
  
  netmap: fix lock order reversal related to kqueue usage
  
  When using poll(), select() or kevent() on netmap file descriptors,
  netmap executes the equivalent of NIOCTXSYNC and NIOCRXSYNC commands,
  before collecting the events that are ready. In other words, the
  poll/kevent callback has side effects. This is done to avoid the
  overhead of two system call per iteration (e.g., poll() + ioctl(NIOC*XSYNC)).
  
  When the kqueue subsystem invokes the kqueue(9) f_event callback
  (netmap_knrw), it holds the lock of the struct knlist object associated
  to the netmap port (the lock is provided at initialization, by calling
  knlist_init_mtx).
  However, netmap_knrw() may need to wake up another netmap port (or even
  the same one), which means that it may need to call knote().
  Since knote() needs the lock of the struct knlist object associated to
  the to-be-wake-up netmap port, it is possible to have a lock order reversal
  problem (AB/BA deadlock).
  
  This change prevents the deadlock by executing the knote() call in a
  per-selinfo taskqueue, where it is possible to hold a mutex.
  The change also adds a counter (kqueue_users) to keep track of how many
  kqueue users are referencing a given struct nm_selinfo.
  In this way, nm_os_selwakeup() can schedule the kevent notification
  task only when kqueue is actually being used.
  This is important to avoid wasting CPU in the common case where
  kqueue is not used.
  
  Reviewed by:aleksandr.fedorov_itglobal.com
  Differential Revision:  https://reviews.freebsd.org/D18956

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

Modified: stable/11/sys/dev/netmap/netmap.c
==
--- stable/11/sys/dev/netmap/netmap.c   Mon Feb 25 08:50:25 2019
(r344508)
+++ stable/11/sys/dev/netmap/netmap.c   Mon Feb 25 09:13:33 2019
(r344509)
@@ -831,6 +831,7 @@ netmap_krings_create(struct netmap_adapter *na, u_int 
struct netmap_kring *kring;
u_int n[NR_TXRX];
enum txrx t;
+   int err = 0;
 
if (na->tx_rings != NULL) {
if (netmap_debug & NM_DEBUG_ON)
@@ -870,7 +871,6 @@ netmap_krings_create(struct netmap_adapter *na, u_int 
for (i = 0; i < n[t]; i++) {
kring = NMR(na, t)[i];
bzero(kring, sizeof(*kring));
-   kring->na = na;
kring->notify_na = na;
kring->ring_id = i;
kring->tx = t;
@@ -896,13 +896,21 @@ netmap_krings_create(struct netmap_adapter *na, u_int 
nm_txrx2str(t), i);
nm_prdis("ktx %s h %d c %d t %d",
kring->name, kring->rhead, kring->rcur, 
kring->rtail);
+   err = nm_os_selinfo_init(&kring->si, kring->name);
+   if (err) {
+   netmap_krings_delete(na);
+   return err;
+   }
mtx_init(&kring->q_lock, (t == NR_TX ? "nm_txq_lock" : 
"nm_rxq_lock"), NULL, MTX_DEF);
-   nm_os_selinfo_init(&kring->si);
+   kring->na = na; /* setting this field marks the mutex 
as initialized */
}
-   nm_os_selinfo_init(&na->si[t]);
+   err = nm_os_selinfo_init(&na->si[t], na->name);
+   if (err) {
+   netmap_krings_delete(na);
+   return err;
+   }
}
 
-
return 0;
 }
 
@@ -926,7 +934,8 @@ netmap_krings_delete(struct netmap_adapter *na)
 
/* we rely on the krings layout described above */
for ( ; kring != na->tailroom; kring++) {
-   mtx_destroy(&(*kring)->q_lock);
+   if ((*kring)->na != NULL)
+   mtx_destroy(&(*kring)->q_lock);
nm_os_selinfo_uninit(&(*kring)->si);
}
nm_os_free(na->tx_rings);

Modified: stable/11/sys/dev/netmap/netmap_freebsd.c
==
--- stable/11/sys/dev/netmap/netmap_freebsd.c   Mon Feb 25 08:50:25 2019
(r344508)
+++ stable/11/sys/dev/netmap/netmap_freebsd.c   Mon Feb 25 09:13:33 2019
(r344509)
@@ -56,6 +56,7 @@
 #include  /* RFNOWAIT */
 #include  /* sched_bind() */
 #include  /* mp_maxid */
+#include  /* taskqueue_enqueue(), taskqueue_create(), ... */
 #include 
 #include 
 #include  /* IFT_ETHER */
@@ -73,16 +74,49 @@
 
 /*  FREEBSD-SPECIFIC ROUTINES == */
 
-void nm_os_selinfo_in

svn commit: r344508 - stable/12/sys/dev/netmap

2019-02-25 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Feb 25 08:50:25 2019
New Revision: 344508
URL: https://svnweb.freebsd.org/changeset/base/344508

Log:
  MFC r344253
  
  netmap: don't schedule kqueue notify task when kqueue is not used
  
  This change adds a counter (kqueue_users) to keep track of how many
  kqueue users are referencing a given struct nm_selinfo.
  In this way, nm_os_selwakeup() can schedule the kevent notification
  task only when kqueue is actually being used.
  This is important to avoid wasting CPU in the common case where
  kqueue is not used.
  
  Reviewed by:Aleksandr Fedorov 
  Differential Revision:  https://reviews.freebsd.org/D19177

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

Modified: stable/12/sys/dev/netmap/netmap_freebsd.c
==
--- stable/12/sys/dev/netmap/netmap_freebsd.c   Mon Feb 25 03:29:12 2019
(r344507)
+++ stable/12/sys/dev/netmap/netmap_freebsd.c   Mon Feb 25 08:50:25 2019
(r344508)
@@ -105,6 +105,7 @@ int nm_os_selinfo_init(NM_SELINFO_T *si, const char *n
snprintf(si->mtxname, sizeof(si->mtxname), "nmkl%s", name);
mtx_init(&si->m, si->mtxname, NULL, MTX_DEF);
knlist_init_mtx(&si->si.si_note, &si->m);
+   si->kqueue_users = 0;
 
return (0);
 }
@@ -1351,7 +1352,9 @@ void
 nm_os_selwakeup(struct nm_selinfo *si)
 {
selwakeuppri(&si->si, PI_NET);
-   taskqueue_enqueue(si->ntfytq, &si->ntfytask);
+   if (si->kqueue_users > 0) {
+   taskqueue_enqueue(si->ntfytq, &si->ntfytask);
+   }
 }
 
 void
@@ -1364,20 +1367,28 @@ static void
 netmap_knrdetach(struct knote *kn)
 {
struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook;
-   struct selinfo *si = &priv->np_si[NR_RX]->si;
+   struct nm_selinfo *si = priv->np_si[NR_RX];
 
-   nm_prinf("remove selinfo %p", si);
-   knlist_remove(&si->si_note, kn, /*islocked=*/0);
+   knlist_remove(&si->si.si_note, kn, /*islocked=*/0);
+   NMG_LOCK();
+   KASSERT(si->kqueue_users > 0, ("kqueue_user underflow on %s",
+   si->mtxname));
+   si->kqueue_users--;
+   nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users);
+   NMG_UNLOCK();
 }
 
 static void
 netmap_knwdetach(struct knote *kn)
 {
struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook;
-   struct selinfo *si = &priv->np_si[NR_TX]->si;
+   struct nm_selinfo *si = priv->np_si[NR_TX];
 
-   nm_prinf("remove selinfo %p", si);
-   knlist_remove(&si->si_note, kn, /*islocked=*/0);
+   knlist_remove(&si->si.si_note, kn, /*islocked=*/0);
+   NMG_LOCK();
+   si->kqueue_users--;
+   nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users);
+   NMG_UNLOCK();
 }
 
 /*
@@ -1465,6 +1476,10 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn)
kn->kn_fop = (ev == EVFILT_WRITE) ?
&netmap_wfiltops : &netmap_rfiltops;
kn->kn_hook = priv;
+   NMG_LOCK();
+   si->kqueue_users++;
+   nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users);
+   NMG_UNLOCK();
knlist_add(&si->si.si_note, kn, /*islocked=*/0);
 
return 0;

Modified: stable/12/sys/dev/netmap/netmap_kern.h
==
--- stable/12/sys/dev/netmap/netmap_kern.h  Mon Feb 25 03:29:12 2019
(r344507)
+++ stable/12/sys/dev/netmap/netmap_kern.h  Mon Feb 25 08:50:25 2019
(r344508)
@@ -132,11 +132,14 @@ struct netmap_adapter *netmap_getna(if_t ifp);
 #define MBUF_QUEUED(m) 1
 
 struct nm_selinfo {
+   /* Support for select(2) and poll(2). */
struct selinfo si;
+   /* Support for kqueue(9). See comments in netmap_freebsd.c */
struct taskqueue *ntfytq;
struct task ntfytask;
struct mtx m;
char mtxname[32];
+   int kqueue_users;
 };
 
 
___
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"