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

2017-10-22 Thread Ngie Cooper (yaneurabeya)

> On Oct 22, 2017, at 18:00, Mateusz Guzik  wrote:
> 
> Author: mjg
> Date: Mon Oct 23 01:00:35 2017
> New Revision: 324890
> URL: https://svnweb.freebsd.org/changeset/base/324890
> 
> Log:
>  Bump WITNESS_PENDLIST to accomodate sleepq chain bump.
> 
>  Reported by: ngie

*crosses fingers and waits for next Jenkins run*


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r324890 - head/sys/kern

2017-10-22 Thread Mateusz Guzik
Author: mjg
Date: Mon Oct 23 01:00:35 2017
New Revision: 324890
URL: https://svnweb.freebsd.org/changeset/base/324890

Log:
  Bump WITNESS_PENDLIST to accomodate sleepq chain bump.
  
  Reported by:  ngie

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cMon Oct 23 00:56:59 2017
(r324889)
+++ head/sys/kern/subr_witness.cMon Oct 23 01:00:35 2017
(r324890)
@@ -137,7 +137,7 @@ __FBSDID("$FreeBSD$");
 #defineWITNESS_COUNT   1536
 #endif
 #defineWITNESS_HASH_SIZE   251 /* Prime, gives load factor < 2 
*/
-#defineWITNESS_PENDLIST(1024 + MAXCPU)
+#defineWITNESS_PENDLIST(2048 + MAXCPU)
 
 /* Allocate 256 KB of stack data space */
 #defineWITNESS_LO_DATA_COUNT   2048
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r324870 - in head/sys: amd64/include kern

2017-10-22 Thread Ngie Cooper (yaneurabeya)

> On Oct 22, 2017, at 13:43, Mateusz Guzik  wrote:
> 
> Author: mjg
> Date: Sun Oct 22 20:43:50 2017
> New Revision: 324870
> URL: https://svnweb.freebsd.org/changeset/base/324870
> 
> Log:
>  Make the sleepq chain hash size configurable per-arch and bump on amd64.
> 
>  While here cache-align chains.
> 
>  This shortens longest found chain during poudriere -j 80 from 32 to 16.
> 
>  Pushing this higher up will probably require allocation on boot.

Hi Mateusz,
This change causes the Jenkins VMs to panic at boot with "panic: 
witness_init: pending locks list is too small, increase WITNESS_PENDLIST” when 
WITNESS is enabled: 
https://ci.freebsd.org/job/FreeBSD-head-amd64-test/4781/console .
Please fix or revert.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r324883 - head/sys/boot/fdt

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:52:27 2017
New Revision: 324883
URL: https://svnweb.freebsd.org/changeset/base/324883

Log:
  Use preferred defined paths, rather than relative paths in fdt.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/fdt/Makefile

Modified: head/sys/boot/fdt/Makefile
==
--- head/sys/boot/fdt/Makefile  Sun Oct 22 22:52:23 2017(r324882)
+++ head/sys/boot/fdt/Makefile  Sun Oct 22 22:52:27 2017(r324883)
@@ -1,7 +1,9 @@
 # $FreeBSD$
 
-.PATH: ${.CURDIR}/../../contrib/libfdt/
+.include 
 
+.PATH: ${SYSDIR}/contrib/libfdt/
+
 LIB=   fdt
 INTERNALLIB=
 
@@ -12,7 +14,7 @@ SRCS+=fdt.c fdt_ro.c fdt_wip.c fdt_sw.c 
fdt_rw.c fdt
 # Loader's fdt commands extension sources.
 SRCS+= fdt_loader_cmd.c fdt_overlay.c
 
-CFLAGS+=   -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/
+CFLAGS+=   -I${SYSDIR}/contrib/libfdt/ -I${BOOTSRC}/common/
 
 CFLAGS+=   -ffreestanding
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324882 - head/tools/boot

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:52:23 2017
New Revision: 324882
URL: https://svnweb.freebsd.org/changeset/base/324882

Log:
  Create a shell script to build sys/boot on all the architectures.
  
  One could run this from any directory, but it's designed to do
  regression testing on sys/boot (it only tests on a subset of
  architectures since all of them would take a lot longer and not help).
  This will also ensure that future commits to sys/boot compile
  everywhere.
  
  Sponsored by: Netflix

Added:
  head/tools/boot/
  head/tools/boot/universe.sh   (contents, props changed)

Added: head/tools/boot/universe.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/boot/universe.sh Sun Oct 22 22:52:23 2017(r324882)
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+#
+# Full list of all arches, but we only build a subset. All different mips add 
any
+# value, and there's a few others we just don't support.
+#
+#  mips/mipsel mips/mips mips/mips64el mips/mips64 mips/mipsn32 \
+#  mips/mipselhf mips/mipshf mips/mips64elhf mips/mips64hf \
+#  powerpc/powerpc powerpc/powerpc64 powerpc/powerpcspe \
+#  riscv/riscv64 riscv/riscv64sf
+#
+# This script is expected to be run in sys/boot (though you could run it 
anywhere
+# in the tree). It does a full clean build. For sys/boot you can do all the 
archs in
+# about a minute or two on a fast machine. It's also possible that you need a 
full
+# make universe for this to work completely.
+#
+# Output is put into _.boot.$TARGET_ARCH.log in sys.boot.
+#
+
+for i in \
+   amd64/amd64 \
+   arm/arm arm/armeb arm/armv7 \
+   arm64/aarch64 \
+   i386/i386 \
+   mips/mips mips/mips64 \
+   powerpc/powerpc powerpc/powerpc64 \
+   sparc64/sparc64 \
+   ; do
+ta=${i##*/}
+echo -n "Building $ta..."
+( ( make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 clean 
cleandepend cleandir obj depend all" \
+> _.boot.${ta}.log 2>&1 ) && echo Success ) || echo Fail
+done
+
+
+
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324878 - head/sys/boot/arm/at91/boot2

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:50:15 2017
New Revision: 324878
URL: https://svnweb.freebsd.org/changeset/base/324878

Log:
  Make at91 boot loader compile again.
  
  No clue if it actually still works, but it might.

Modified:
  head/sys/boot/arm/at91/boot2/boot2.c

Modified: head/sys/boot/arm/at91/boot2/boot2.c
==
--- head/sys/boot/arm/at91/boot2/boot2.cSun Oct 22 22:50:08 2017
(r324877)
+++ head/sys/boot/arm/at91/boot2/boot2.cSun Oct 22 22:50:15 2017
(r324878)
@@ -54,7 +54,7 @@ unsigned board_id; /* board type to pass to kernel, if
 unsigned dsk_start;
 static char cmd[512];
 static char kname[1024];
-static uint32_t opts;
+uint32_t opts;
 static uint8_t dsk_meta;
 
 int main(void);
@@ -359,3 +359,10 @@ fixup_boot_drv(caddr_t addr, int klen, int bs, int bp)
DPRINTF("Changed boot device to %s\n", ps);
 }
 #endif
+
+/* Arm EABIs */
+void __aeabi_unwind_cpp_pr0(void);
+void
+__aeabi_unwind_cpp_pr0(void)
+{
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324881 - in head/sys/boot: geli libsa uboot/lib

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:50:28 2017
New Revision: 324881
URL: https://svnweb.freebsd.org/changeset/base/324881

Log:
  Use SYSDIR instead of ${.CURDIR}/../../sys.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/geli/Makefile
  head/sys/boot/libsa/Makefile
  head/sys/boot/uboot/lib/Makefile

Modified: head/sys/boot/geli/Makefile
==
--- head/sys/boot/geli/Makefile Sun Oct 22 22:50:23 2017(r324880)
+++ head/sys/boot/geli/Makefile Sun Oct 22 22:50:28 2017(r324881)
@@ -5,6 +5,7 @@ MAN=
 
 .include 
 MK_SSP=no
+.include 
 
 LIB=   geliboot
 INTERNALLIB=
@@ -28,7 +29,7 @@ SRCS+=  bcmp.c bcopy.c bzero.c
 SRCS+=  pwgets.c
 
 # sha256 and sha512 from sys/crypto
-.PATH: ${SRCTOP}/sys/crypto/sha2
+.PATH: ${SYSDIR}/crypto/sha2
 CFLAGS+=   -DWEAK_REFS
 SRCS+= sha256c.c sha512c.c
 
@@ -37,15 +38,15 @@ SRCS+=  sha256c.c sha512c.c
 SRCS+= md5c.c
 
 # AES implementation from sys/crypto
-.PATH: ${SRCTOP}/sys/crypto/rijndael
-CFLAGS+=   -I${.CURDIR}/../../
+.PATH: ${SYSDIR}/crypto/rijndael
+CFLAGS+=   -I${SYSDIR}
 CFLAGS+=   -I${.CURDIR}/../common/
 # Remove asserts
 CFLAGS+=   -DNDEBUG
 SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c
 
 # local GELI Implementation
-.PATH: ${SRCTOP}/sys/geom/eli
+.PATH: ${SYSDIR}/geom/eli
 CFLAGS+=   -D_STAND
 SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c 
pkcs5v2.c
 

Modified: head/sys/boot/libsa/Makefile
==
--- head/sys/boot/libsa/MakefileSun Oct 22 22:50:23 2017
(r324880)
+++ head/sys/boot/libsa/MakefileSun Oct 22 22:50:28 2017
(r324881)
@@ -154,7 +154,7 @@ SRCS+=  nandfs.c
 .endif
 
 # explicit_bzero
-.PATH: ${SRCTOP}/sys/libkern
+.PATH: ${SYSDIR}/libkern
 SRCS+=  explicit_bzero.c
 
 .include 

Modified: head/sys/boot/uboot/lib/Makefile
==
--- head/sys/boot/uboot/lib/MakefileSun Oct 22 22:50:23 2017
(r324880)
+++ head/sys/boot/uboot/lib/MakefileSun Oct 22 22:50:28 2017
(r324881)
@@ -28,7 +28,7 @@ CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt
 .endif
 
 # Pick up FDT includes
-CFLAGS+=   -I${.CURDIR}/../../../../sys/contrib/libfdt/
+CFLAGS+=   -I${SYSDIR}/contrib/libfdt/
 
 # Pick up the bootstrap header for some interface items
 CFLAGS+=   -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324877 - in head/sys/boot: . arm/uboot ficl i386/gptboot i386/gptzfsboot i386/libi386 i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc6...

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:50:08 2017
New Revision: 324877
URL: https://svnweb.freebsd.org/changeset/base/324877

Log:
  End source directories with SRC rather than a hodgepodge of names
  
  BOOTDIR->BOOTSRC
  FICLDIR->FICLSRC
  LDR_MI->LDRSRC
  
  This matches the patterns used in the rest of the system a bit vetter.
  
  Suggested by: rgrimes@
  Sponsored by: Netflix

Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/defs.mk
  head/sys/boot/ficl.mk
  head/sys/boot/ficl/Makefile
  head/sys/boot/i386/gptboot/Makefile
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/libi386/Makefile
  head/sys/boot/i386/loader/Makefile
  head/sys/boot/loader.mk
  head/sys/boot/mips/beri/loader/Makefile
  head/sys/boot/mips/uboot/Makefile
  head/sys/boot/powerpc/kboot/Makefile
  head/sys/boot/powerpc/ofw/Makefile
  head/sys/boot/powerpc/ps3/Makefile
  head/sys/boot/powerpc/uboot/Makefile
  head/sys/boot/sparc64/loader/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileSun Oct 22 22:49:51 2017
(r324876)
+++ head/sys/boot/arm/uboot/MakefileSun Oct 22 22:50:08 2017
(r324877)
@@ -53,7 +53,7 @@ OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 
 loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt
cat ${.ALLSRC} | \
-   awk -f ${LDR_MI}/merge_help.awk > ${.TARGET}
+   awk -f ${LDRSRC}/merge_help.awk > ${.TARGET}
 
 ldscript.abs:
echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}

Modified: head/sys/boot/defs.mk
==
--- head/sys/boot/defs.mk   Sun Oct 22 22:49:51 2017(r324876)
+++ head/sys/boot/defs.mk   Sun Oct 22 22:50:08 2017(r324877)
@@ -5,13 +5,13 @@
 .if !defined(__BOOT_DEFS_MK__)
 __BOOT_DEFS_MK__=${MFILE}
 
-BOOTDIR=   ${SRCTOP}/sys/boot
-FICLDIR=   ${BOOTDIR}/ficl
-LDR_MI=${BOOTDIR}/common
-SASRC= ${BOOTDIR}/libsa
+BOOTSRC=   ${SRCTOP}/sys/boot
+FDTSRC=${BOOTSRC}/fdt
+FICLSRC=   ${BOOTSRC}/ficl
+LDRSRC=${BOOTSRC}/common
+SASRC= ${BOOTSRC}/libsa
 SYSDIR=${SRCTOP}/sys
-FDTSRC=${BOOTDIR}/fdt
-UBOOTSRC=  ${BOOTDIR}/uboot
+UBOOTSRC=  ${BOOTSRC}/uboot
 
 BOOTOBJ=   ${OBJTOP}/sys/boot
 

Modified: head/sys/boot/ficl.mk
==
--- head/sys/boot/ficl.mk   Sun Oct 22 22:49:51 2017(r324876)
+++ head/sys/boot/ficl.mk   Sun Oct 22 22:50:08 2017(r324877)
@@ -12,7 +12,7 @@ FICL_CPUARCH= mips64
 FICL_CPUARCH=  ${MACHINE_CPUARCH}
 .endif
 
-.PATH: ${FICLDIR} ${FICLDIR}/${FICL_CPUARCH}
+.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH}
 
 .if ${MACHINE_CPUARCH} == "amd64"
 .if defined(FICL32)
@@ -26,7 +26,7 @@ CFLAGS+=  -fPIC
 CFLAGS+=   -m32 -mcpu=powerpc -I.
 .endif
 
-CFLAGS+=   -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${LDR_MI}
+CFLAGS+=   -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
 CFLAGS+=   -DBOOT_FORTH
 CFLAGS+=   -DBF_DICTSIZE=15000
 

Modified: head/sys/boot/ficl/Makefile
==
--- head/sys/boot/ficl/Makefile Sun Oct 22 22:49:51 2017(r324876)
+++ head/sys/boot/ficl/Makefile Sun Oct 22 22:50:08 2017(r324877)
@@ -28,12 +28,12 @@ INTERNALLIB=
 .endif
 
 # Standard softwords
-.PATH: ${FICLDIR}/softwords
+.PATH: ${FICLSRC}/softwords
 SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
ifbrack.fr
 # Optional OO extension softwords
 #SOFTWORDS+=   oo.fr classes.fr
 
 softcore.c: ${SOFTWORDS} softcore.awk
-   (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \
+   (cd ${FICLSRC}/softwords; cat ${SOFTWORDS} \
| awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}

Modified: head/sys/boot/i386/gptboot/Makefile
==
--- head/sys/boot/i386/gptboot/Makefile Sun Oct 22 22:49:51 2017
(r324876)
+++ head/sys/boot/i386/gptboot/Makefile Sun Oct 22 22:50:08 2017
(r324877)
@@ -43,7 +43,7 @@ CFLAGS.gcc+=  --param max-inline-insns-single=100
 
 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
 CFLAGS+=   -DLOADER_GELI_SUPPORT
-CFLAGS+=   -I${BOOTDIR}/geli
+CFLAGS+=   -I${BOOTSRC}/geli
 CFLAGS+=   -I${.CURDIR}/../../..
 LIBGELIBOOT=   ${BOOTOBJ}/geli/libgeliboot.a
 .PATH: ${.CURDIR}/../../../opencrypto

Modified: head/sys/boot/i386/gptzfsboot/Makefile
==
--- head/sys/boot/i386/gptzfsboot/Makefile  Sun Oct 22 22:49:51 2017
(r324876)
+++ head/sys/boot/i386/gptzfsboot/Makefile  Sun Oct 22 22:50:08 2017
(r324877)
@@ -50,7 +50,7 @@ CFLAGS+=  -DSKEIN_LOOP=111

svn commit: r324876 - in head/sys/boot: . arm/uboot mips/uboot powerpc/uboot uboot/common

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:49:51 2017
New Revision: 324876
URL: https://svnweb.freebsd.org/changeset/base/324876

Log:
  Move fdt and uboot defines into common uboot.mk.
  
  Sponsored by: Netflix

Added:
  head/sys/boot/uboot.mk   (contents, props changed)
Deleted:
  head/sys/boot/uboot/common/Makefile.inc
Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/defs.mk
  head/sys/boot/mips/uboot/Makefile
  head/sys/boot/powerpc/uboot/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileSun Oct 22 22:05:37 2017
(r324875)
+++ head/sys/boot/arm/uboot/MakefileSun Oct 22 22:49:51 2017
(r324876)
@@ -30,14 +30,6 @@ LOADER_GZIP_SUPPORT?=no
 LOADER_BZIP2_SUPPORT?= no
 LOADER_FDT_SUPPORT=${MK_FDT}
 
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+=   -I${.CURDIR}/../../fdt
-CFLAGS+=   -I${.OBJDIR}/../../fdt
-CFLAGS+=   -DLOADER_FDT_SUPPORT
-LIBUBOOT_FDT=  ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
-LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
-.endif
-
 # Always add MI sources
 .include   "../../loader.mk"
 CFLAGS+=   -I.
@@ -50,19 +42,9 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MA
 LDFLAGS+=  -Wl,-znotext
 
 # Pull in common loader code
-.PATH: ${.CURDIR}/../../uboot/common
-.include   "${.CURDIR}/../../uboot/common/Makefile.inc"
-CFLAGS+=   -I${.CURDIR}/../../uboot/common
+.include   "../../uboot.mk"
 
-# U-Boot standalone support library
-LIBUBOOT=  ${.OBJDIR}/../../uboot/lib/libuboot.a
-CFLAGS+=   -I${.CURDIR}/../../uboot/lib
-CFLAGS+=   -I${.OBJDIR}/../../uboot/lib
-
 CFLAGS+=   -fPIC
-
-# clang doesn't understand %D as a specifier to printf
-NO_WERROR.clang=
 
 DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
 LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}

Modified: head/sys/boot/defs.mk
==
--- head/sys/boot/defs.mk   Sun Oct 22 22:05:37 2017(r324875)
+++ head/sys/boot/defs.mk   Sun Oct 22 22:49:51 2017(r324876)
@@ -10,6 +10,8 @@ FICLDIR=  ${BOOTDIR}/ficl
 LDR_MI=${BOOTDIR}/common
 SASRC= ${BOOTDIR}/libsa
 SYSDIR=${SRCTOP}/sys
+FDTSRC=${BOOTDIR}/fdt
+UBOOTSRC=  ${BOOTDIR}/uboot
 
 BOOTOBJ=   ${OBJTOP}/sys/boot
 

Modified: head/sys/boot/mips/uboot/Makefile
==
--- head/sys/boot/mips/uboot/Makefile   Sun Oct 22 22:05:37 2017
(r324875)
+++ head/sys/boot/mips/uboot/Makefile   Sun Oct 22 22:49:51 2017
(r324876)
@@ -26,14 +26,6 @@ LOADER_GZIP_SUPPORT?=no
 LOADER_BZIP2_SUPPORT?= no
 LOADER_FDT_SUPPORT=${MK_FDT}
 
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+=   -I${.CURDIR}/../../fdt
-CFLAGS+=   -I${.OBJDIR}/../../fdt
-CFLAGS+=   -DLOADER_FDT_SUPPORT
-LIBUBOOT_FDT=  ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
-LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
-.endif
-
 # Always add MI sources
 .include   "../../loader.mk"
 CFLAGS+=   -I.
@@ -44,19 +36,7 @@ CFLAGS+= -ffreestanding -msoft-float -g
 
 LDFLAGS=   -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
 
-# Pull in common loader code
-.PATH: ${.CURDIR}/../../uboot/common
-.include   "${.CURDIR}/../../uboot/common/Makefile.inc"
-CFLAGS+=   -I${.CURDIR}/../../uboot/common
-
-# U-Boot standalone support library
-LIBUBOOT=  ${.OBJDIR}/../../uboot/lib/libuboot.a
-CFLAGS+=   -I${.CURDIR}/../../uboot/lib
-CFLAGS+=   -I${.OBJDIR}/../../uboot/lib
-
-# clang doesn't understand %D as a specifier to printf
-#NO_WERROR.clang=
-#NO_WERROR=
+.include   "../../uboot.mk"
 
 DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
 LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}

Modified: head/sys/boot/powerpc/uboot/Makefile
==
--- head/sys/boot/powerpc/uboot/MakefileSun Oct 22 22:05:37 2017
(r324875)
+++ head/sys/boot/powerpc/uboot/MakefileSun Oct 22 22:49:51 2017
(r324876)
@@ -22,14 +22,6 @@ LOADER_GZIP_SUPPORT?=no
 LOADER_BZIP2_SUPPORT?= no
 LOADER_FDT_SUPPORT=${MK_FDT}
 
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+=   -I${.CURDIR}/../../fdt
-CFLAGS+=   -I${.OBJDIR}/../../fdt
-CFLAGS+=   -DLOADER_FDT_SUPPORT
-LIBUBOOT_FDT=  ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
-LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
-.endif
-
 # Always add MI sources
 .include   "../../loader.mk"
 .PATH: ${.CURDIR}/../../../libkern
@@ -42,15 +34,7 @@ CFLAGS+= -ffreestanding
 
 LDFLAGS=   -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
 
-# Pull in common loader code
-.PATH:  

svn commit: r324880 - head/sys/boot/i386

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:50:23 2017
New Revision: 324880
URL: https://svnweb.freebsd.org/changeset/base/324880

Log:
  Use BOOTSRC here.
  
  sponsored by: Netflix

Modified:
  head/sys/boot/i386/Makefile.inc

Modified: head/sys/boot/i386/Makefile.inc
==
--- head/sys/boot/i386/Makefile.inc Sun Oct 22 22:50:19 2017
(r324879)
+++ head/sys/boot/i386/Makefile.inc Sun Oct 22 22:50:23 2017
(r324880)
@@ -29,7 +29,7 @@ BTXKERN=  ${BTXDIR}/btx/btx
 BTXCRT=${BTXDIR}/lib/crt0.o
 
 # compact binary with no padding between text, data, bss
-LDSCRIPT=  ${SRCTOP}/sys/boot/i386/boot.ldscript
+LDSCRIPT=  ${BOOTSRC}/i386/boot.ldscript
 # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
 # LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
 LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324879 - in head/sys/boot: geli powerpc/boot1.chrp

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 22:50:19 2017
New Revision: 324879
URL: https://svnweb.freebsd.org/changeset/base/324879

Log:
  Prefer SRCTOP paths for bits we're grabbing from libc.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/geli/Makefile
  head/sys/boot/powerpc/boot1.chrp/Makefile

Modified: head/sys/boot/geli/Makefile
==
--- head/sys/boot/geli/Makefile Sun Oct 22 22:50:15 2017(r324878)
+++ head/sys/boot/geli/Makefile Sun Oct 22 22:50:19 2017(r324879)
@@ -21,7 +21,7 @@ CFLAGS+=-m32
 WARNS?=0
 
 # string functions from libc
-.PATH: ${.CURDIR}/../../../lib/libc/string
+.PATH: ${SRCTOP}/lib/libc/string
 SRCS+=  bcmp.c bcopy.c bzero.c
 
 # Our password input method

Modified: head/sys/boot/powerpc/boot1.chrp/Makefile
==
--- head/sys/boot/powerpc/boot1.chrp/Makefile   Sun Oct 22 22:50:15 2017
(r324878)
+++ head/sys/boot/powerpc/boot1.chrp/Makefile   Sun Oct 22 22:50:19 2017
(r324879)
@@ -19,7 +19,7 @@ LDFLAGS=-nostdlib -static -Wl,-N
 
 .include "../Makefile.inc"
 
-.PATH:  ${.CURDIR}/../../../libkern 
${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR}
+.PATH:  ${.CURDIR}/../../../libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}
 
 # The following inserts out objects into a template HFS 
 # created by generate-hfs.sh
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Ngie Cooper (yaneurabeya)

> On Oct 22, 2017, at 06:42, Mateusz Guzik  wrote:
> 
> Author: mjg
> Date: Sun Oct 22 13:42:56 2017
> New Revision: 324863
> URL: https://svnweb.freebsd.org/changeset/base/324863
> 
> Log:
>  Change kdb_active type to u_char.
> 
>  Fixes warnings from gcc and keeps the small size. Perhaps nesting should be 
> moved
>  to another variablle.
> 
>  Reported by: ngie

Thank you for fixing this.

Question though — since u_char is unsigned, are you concerned about underflow 
(-1 -> 255)?

Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r324870 - in head/sys: amd64/include kern

2017-10-22 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 22 20:43:50 2017
New Revision: 324870
URL: https://svnweb.freebsd.org/changeset/base/324870

Log:
  Make the sleepq chain hash size configurable per-arch and bump on amd64.
  
  While here cache-align chains.
  
  This shortens longest found chain during poudriere -j 80 from 32 to 16.
  
  Pushing this higher up will probably require allocation on boot.

Modified:
  head/sys/amd64/include/param.h
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/amd64/include/param.h
==
--- head/sys/amd64/include/param.h  Sun Oct 22 20:22:23 2017
(r324869)
+++ head/sys/amd64/include/param.h  Sun Oct 22 20:43:50 2017
(r324870)
@@ -152,4 +152,8 @@
 #defineINKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < 
DMAP_MAX_ADDRESS) \
 || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
 
+#ifdef SMP
+#define SC_TABLESIZE1024 /* Must be power of 2. */
+#endif
+
 #endif /* !_AMD64_INCLUDE_PARAM_H_ */

Modified: head/sys/kern/subr_sleepqueue.c
==
--- head/sys/kern/subr_sleepqueue.c Sun Oct 22 20:22:23 2017
(r324869)
+++ head/sys/kern/subr_sleepqueue.c Sun Oct 22 20:43:50 2017
(r324870)
@@ -93,7 +93,10 @@ __FBSDID("$FreeBSD$");
  * Constants for the hash table of sleep queue chains.
  * SC_TABLESIZE must be a power of two for SC_MASK to work properly.
  */
-#defineSC_TABLESIZE256 /* Must be power of 2. 
*/
+#ifndef SC_TABLESIZE
+#defineSC_TABLESIZE256
+#endif
+CTASSERT(powerof2(SC_TABLESIZE));
 #defineSC_MASK (SC_TABLESIZE - 1)
 #defineSC_SHIFT8
 #defineSC_HASH(wc) uintptr_t)(wc) >> SC_SHIFT) ^ 
(uintptr_t)(wc)) & \
@@ -137,7 +140,7 @@ struct sleepqueue_chain {
u_int   sc_depth;   /* Length of sc_queues. */
u_int   sc_max_depth;   /* Max length of sc_queues. */
 #endif
-};
+} __aligned(CACHE_LINE_SIZE);
 
 #ifdef SLEEPQUEUE_PROFILING
 u_int sleepq_max_depth;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324868 - head/sys/fs/pseudofs

2017-10-22 Thread Mark Johnston
Author: markj
Date: Sun Oct 22 20:22:11 2017
New Revision: 324868
URL: https://svnweb.freebsd.org/changeset/base/324868

Log:
  Delete declarations of struct pfs_bitmap, removed in r143841.
  
  MFC after:1 week

Modified:
  head/sys/fs/pseudofs/pseudofs.h

Modified: head/sys/fs/pseudofs/pseudofs.h
==
--- head/sys/fs/pseudofs/pseudofs.h Sun Oct 22 20:14:48 2017
(r324867)
+++ head/sys/fs/pseudofs/pseudofs.h Sun Oct 22 20:22:11 2017
(r324868)
@@ -81,7 +81,6 @@ typedef enum {
  */
 struct pfs_info;
 struct pfs_node;
-struct pfs_bitmap;
 
 /*
  * Init / uninit callback
@@ -120,8 +119,6 @@ struct vattr;
 #define PFS_ATTR_PROTO(name) \
int name(PFS_ATTR_ARGS);
 typedef int (*pfs_attr_t)(PFS_ATTR_ARGS);
-
-struct pfs_bitmap; /* opaque */
 
 /*
  * Visibility callback
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324869 - in head/sys: cddl/dev/sdt kern sys

2017-10-22 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 22 20:22:23 2017
New Revision: 324869
URL: https://svnweb.freebsd.org/changeset/base/324869

Log:
  sdt: make all sdt probe sites test one variable
  
  This saves on cache misses at the expense of a slight grow of .text.
  
  Note this is a bandaid for lack of hotpatching.
  
  Discussed with:   markj

Modified:
  head/sys/cddl/dev/sdt/sdt.c
  head/sys/kern/kern_sdt.c
  head/sys/sys/sdt.h

Modified: head/sys/cddl/dev/sdt/sdt.c
==
--- head/sys/cddl/dev/sdt/sdt.c Sun Oct 22 20:22:11 2017(r324868)
+++ head/sys/cddl/dev/sdt/sdt.c Sun Oct 22 20:22:23 2017(r324869)
@@ -76,6 +76,8 @@ static void   sdt_kld_unload_try(void *, struct linker_f
 
 static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers");
 
+static int sdt_probes_enabled_count;
+
 static dtrace_pattr_t sdt_attr = {
 { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON },
 { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
@@ -208,6 +210,9 @@ sdt_enable(void *arg __unused, dtrace_id_t id, void *p
probe->sdtp_lf->nenabled++;
if (strcmp(probe->prov->name, "lockstat") == 0)
lockstat_enabled++;
+   sdt_probes_enabled_count++;
+   if (sdt_probes_enabled_count == 1)
+   sdt_probes_enabled = true;
 }
 
 static void
@@ -217,6 +222,9 @@ sdt_disable(void *arg __unused, dtrace_id_t id, void *
 
KASSERT(probe->sdtp_lf->nenabled > 0, ("no probes enabled"));
 
+   sdt_probes_enabled_count--;
+   if (sdt_probes_enabled_count == 0)
+   sdt_probes_enabled = false;
if (strcmp(probe->prov->name, "lockstat") == 0)
lockstat_enabled--;
probe->id = 0;

Modified: head/sys/kern/kern_sdt.c
==
--- head/sys/kern/kern_sdt.cSun Oct 22 20:22:11 2017(r324868)
+++ head/sys/kern/kern_sdt.cSun Oct 22 20:22:23 2017(r324869)
@@ -37,6 +37,7 @@ SDT_PROVIDER_DEFINE(sdt);
  * dtrace_probe() when it loads.
  */
 sdt_probe_func_t sdt_probe_func = sdt_probe_stub;
+volatile bool __read_frequently sdt_probes_enabled;
 
 /*
  * This is a stub for probe calls in case kernel DTrace support isn't

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Sun Oct 22 20:22:11 2017(r324868)
+++ head/sys/sys/sdt.h  Sun Oct 22 20:22:23 2017(r324869)
@@ -80,6 +80,8 @@
 #include 
 #include 
 
+extern volatile bool sdt_probes_enabled;
+
 #ifndef KDTRACE_HOOKS
 
 #define SDT_PROVIDER_DEFINE(prov)
@@ -161,10 +163,12 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);
extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1]
 
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do {
\
-   if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))  
\
+   if (__predict_false(sdt_probes_enabled)) {  
\
+   if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))  
\
(*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, 
\
(uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2,   
\
(uintptr_t) arg3, (uintptr_t) arg4);
\
+   } \
 } while (0)
 
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) 
\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324867 - head/sys/sys

2017-10-22 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 22 20:14:48 2017
New Revision: 324867
URL: https://svnweb.freebsd.org/changeset/base/324867

Log:
  sdt: whack unused SDT_PROBE_ENABLED

Modified:
  head/sys/sys/sdt.h

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Sun Oct 22 20:01:07 2017(r324866)
+++ head/sys/sys/sdt.h  Sun Oct 22 20:14:48 2017(r324867)
@@ -86,7 +86,6 @@
 #define SDT_PROVIDER_DECLARE(prov)
 #define SDT_PROBE_DEFINE(prov, mod, func, name)
 #define SDT_PROBE_DECLARE(prov, mod, func, name)
-#define SDT_PROBE_ENABLED(prov, mod, func, name)   0
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)
 
@@ -160,9 +159,6 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);
 
 #define SDT_PROBE_DECLARE(prov, mod, func, name)   
\
extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1]
-
-#define SDT_PROBE_ENABLED(prov, mod, func, name)   
\
-   __predict_false((sdt_##prov##_##mod##_##func##_##name->id))
 
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do {
\
if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))  
\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324866 - head/include

2017-10-22 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 22 20:01:07 2017
New Revision: 324866
URL: https://svnweb.freebsd.org/changeset/base/324866

Log:
  libc: Do not refer to _DefaultRuneLocale in ctype inlines
  
  Referring to _DefaultRuneLocale causes this >4KB structure to be copied to
  all executables that use  inlines (except PIE executables).
  
  This only affects the case where thread local storage is available.
  
  _CurrentRuneLocale cannot be NULL, so the check can be removed entirely.
  
  _DefaultRuneLocale needs to remain available for now since libc++ uses it.
  The __isctype inline in include/_ctype.h also refers to _DefaultRuneLocale
  and remains available because it may still be used by third party software.
  
  Reviewed by:  bdrewery, theraven
  Differential Revision:https://reviews.freebsd.org/D10363

Modified:
  head/include/runetype.h

Modified: head/include/runetype.h
==
--- head/include/runetype.h Sun Oct 22 19:17:25 2017(r324865)
+++ head/include/runetype.h Sun Oct 22 20:01:07 2017(r324866)
@@ -95,9 +95,7 @@ static __inline const _RuneLocale *__getCurrentRuneLoc
 
if (_ThreadRuneLocale) 
return _ThreadRuneLocale;
-   if (_CurrentRuneLocale) 
-   return _CurrentRuneLocale;
-   return &_DefaultRuneLocale;
+   return _CurrentRuneLocale;
 }
 #endif /* __NO_TLS || __RUNETYPE_INTERNAL */
 #define _CurrentRuneLocale (__getCurrentRuneLocale())
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324865 - head/cddl/contrib/opensolaris/lib/libctf/common

2017-10-22 Thread Mark Johnston
Author: markj
Date: Sun Oct 22 19:17:25 2017
New Revision: 324865
URL: https://svnweb.freebsd.org/changeset/base/324865

Log:
  Address some miscellaneous issues in the CTF man page.
  
  - Fix a number of typos.
  - Replace some illumos-specific references.
  - Note that a type definition of kind CTF_K_FUNCTION may be followed by
a null type identifier in order to provide 4-byte alignment for the
next type definition.
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5

Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5
==
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5   Sun Oct 22 
18:32:28 2017(r324864)
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5   Sun Oct 22 
19:17:25 2017(r324865)
@@ -52,17 +52,15 @@ file itself, it may also be referred to as a
 .Nm
 .Sy container .
 .Lp
-On illumos systems,
+On
+.Fx
+systems,
 .Nm
-data is consumed by multiple programs.
-It can be used by the modular debugger,
-.Xr mdb 1 ,
-as well as by
+data is consumed by
 .Xr dtrace 1 .
 Programmatic access to
 .Nm
-data can be obtained through
-.Xr libctf 3LIB .
+data can be obtained through libctf.
 .Lp
 The
 .Nm
@@ -73,7 +71,7 @@ and
 .Sy header ,
 which describes the version of the
 .Nm
-file, links it has to other
+file, the links it has to other
 .Nm
 files, and the sizes of the other sections.
 The next section is the
@@ -84,7 +82,7 @@ which provides a way of identifying similar groups of
 data across multiple files.
 This is followed by the
 .Sy object
-information section, which describes the type of global
+information section, which describes the types of global
 symbols.
 The subsequent section is the
 .Sy function
@@ -137,7 +135,9 @@ This documents version
 of the
 .Nm
 file format.
-All applications and tools currently produce and operate on this version.
+All applications and tools on
+.Fx
+currently produce and operate on this version.
 .Lp
 The file format can be summarized with the following image, the
 following sections will cover this in more detail.
@@ -300,13 +300,13 @@ In version two of the
 .Nm
 file format, the
 .Sy header
-denotes whether whether or not this
+denotes whether or not this
 .Nm
 file is the child of another
 .Nm
 file and also indicates the size of the remaining sections.
 The structure for the
-.Sy header ,
+.Sy header
 logically contains a copy of the
 .Sy preamble
 and the two have a combined size of 36 bytes.
@@ -534,7 +534,7 @@ files that corresponds with the particular build.
 This ensures that if files on the system were to become mixed up from multiple
 releases, that they are not used together by tools, particularly when a child
 needs to refer to a type in the parent.
-Because they are linked used the type identifiers, if the wrong parent is used
+Because they are linked using the type identifiers, if the wrong parent is used
 then the wrong type will be encountered.
 .Lp
 Each label is encoded in the file format using the following eight byte
@@ -561,7 +561,7 @@ file.
 Labels only refer to types in the current file, if the
 .Nm
 file is a child, then it will have the same label as its parent;
-however, its label will only refer to its types, not its parents.
+however, its label will only refer to its types, not its parent's.
 .Lp
 It is also possible, though rather uncommon, for a
 .Nm
@@ -585,8 +585,8 @@ in the ELF object that contains the
 .Nm
 data.
 Not every object is included in this section.
-Specifically, when walking the symbol table.
-An entry is skipped if it matches any of the following conditions:
+Specifically, when walking the symbol table, an entry is skipped if it matches
+any of the following conditions:
 .Lp
 .Bl -bullet -offset indent -compact
 .It
@@ -657,7 +657,7 @@ walk_symbols(uint16_t *objtoff, Elf_Data *symdata, Elf
 The function section of the
 .Nm
 file encodes the types of both the function's arguments and the function's
-return type.
+return value.
 Similar to
 .Sx The Object Section ,
 the function section encodes information for all symbols of type
@@ -790,14 +790,14 @@ is encoded as described in the section
 The string that it points to is the name of the type.
 If the identifier points to an empty string (one that consists solely of a null
 terminator) then the type does not have a name, this is common with anonymous
-structures and unions that only have a typedef to name them, as well as,
+structures and unions that only have a typedef to name them, as well as
 pointers and qualifiers.
 .Lp
 The next member, the
 .Em ctt_info ,
 is encoded as described in the section
 .Sx Type Encoding .
-The types kind tells us how to interpret the remaining data in the
+The type's kind tells us how to interpret the remaining data in the
 .Sy ctf_type_t
 and any variable length data that may exist.
 The rest of this section will be broken down into the interpretation of the

svn commit: r324864 - head/cddl/contrib/opensolaris/lib/libctf/common

2017-10-22 Thread Mark Johnston
Author: markj
Date: Sun Oct 22 18:32:28 2017
New Revision: 324864
URL: https://svnweb.freebsd.org/changeset/base/324864

Log:
  MFV r323105 (partial): 8300 fix man page issues found by mandoc 1.14.1
  
  illumos/illumos-gate@72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2
  
https://github.com/illumos/illumos-gate/commit/72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2
  
  https://www.illumos.org/issues/8300
Prior to integrating the mdocml update to 1.14.1, fix issues found by
new version, especially the "new sentence, new line" style rule.
  
  FreeBSD note: this revision merges only the changes to the CTF manual
  page. The changes to the ZFS pages cannot be applied directly.
  
  Reviewed by: Robert Mustacchi 
  Reviewed by: Toomas Soome 
  Approved by: Gordon Ross 
  Author: Yuri Pankov 
  
  Discussed with:   avg
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5
==
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5   Sun Oct 22 
13:42:56 2017(r324863)
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf.5   Sun Oct 22 
18:32:28 2017(r324864)
@@ -39,7 +39,8 @@ data contained in each file has information about the 
 sizes of C types, including intrinsic types, enumerations, structures,
 typedefs, and unions, that are used by the corresponding
 .Sy ELF
-object. The
+object.
+The
 .Nm
 data may also include information about the types of global objects and
 the return type and arguments of functions in the symbol table.
@@ -53,11 +54,11 @@ file itself, it may also be referred to as a
 .Lp
 On illumos systems,
 .Nm
-data is consumed by multiple programs. It can be used by the modular
-debugger,
+data is consumed by multiple programs.
+It can be used by the modular debugger,
 .Xr mdb 1 ,
 as well as by
-.Xr dtrace 1M .
+.Xr dtrace 1 .
 Programmatic access to
 .Nm
 data can be obtained through
@@ -65,8 +66,8 @@ data can be obtained through
 .Lp
 The
 .Nm
-file format is broken down into seven different sections. The first
-section is the
+file format is broken down into seven different sections.
+The first section is the
 .Sy preamble
 and
 .Sy header ,
@@ -74,18 +75,22 @@ which describes the version of the
 .Nm
 file, links it has to other
 .Nm
-files, and the sizes of the other sections. The next section is the
+files, and the sizes of the other sections.
+The next section is the
 .Sy label
 section,
 which provides a way of identifying similar groups of
 .Nm
-data across multiple files. This is followed by the
+data across multiple files.
+This is followed by the
 .Sy object
 information section, which describes the type of global
-symbols. The subsequent section is the
+symbols.
+The subsequent section is the
 .Sy function
 information section, which describes the return
-types and arguments of functions. The next section is the
+types and arguments of functions.
+The next section is the
 .Sy type
 information section, which describes
 the format and layout of the C types themselves, and finally the last
@@ -106,29 +111,33 @@ A
 file may contain all of the type information that it requires, or it
 may optionally refer to another
 .Nm
-file which holds the remaining types. When a
+file which holds the remaining types.
+When a
 .Nm
 file refers to another file, it is called the
 .Sy child
 and the file it refers to is called the
 .Sy parent .
-A given file may only refer to one parent. This process is called
+A given file may only refer to one parent.
+This process is called
 .Em uniquification
 because it ensures each child only has type information that is
-unique to it. A common example of this is that most kernel modules in
-illumos are uniquified against the kernel module
+unique to it.
+A common example of this is that most kernel modules in illumos are uniquified
+against the kernel module
 .Sy genunix
 and the type information that comes from the
 .Sy IP
-module. This means that a module only has types that are unique to
-itself and the most common types in the kernel are not duplicated.
+module.
+This means that a module only has types that are unique to itself and the most
+common types in the kernel are not duplicated.
 .Sh FILE FORMAT
 This documents version
 .Em two
 of the
 .Nm
-file format. All applications and tools currently produce and operate on
-this version.
+file format.
+All applications and tools currently produce and operate on this version.
 .Lp
 The file format can be summarized with the following image, the
 following sections will cover this in more detail.
@@ -235,26 +244,31 @@ This
 .Sy preamble
 defines the version of the
 .Nm
-file which defines the format of the rest of the header. While the
-header may change in 

Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Hans Petter Selasky

On 10/22/17 19:37, Mateusz Guzik wrote:

On Sun, Oct 22, 2017 at 6:59 PM, Hans Petter Selasky 
wrote:


On 10/22/17 16:50, Mateusz Guzik wrote:


On Sun, Oct 22, 2017 at 04:24:41PM +0200, Hans Petter Selasky wrote:


On 10/22/17 15:42, Mateusz Guzik wrote:


Author: mjg
Date: Sun Oct 22 13:42:56 2017
New Revision: 324863
URL: https://svnweb.freebsd.org/changeset/base/324863

Log:
 Change kdb_active type to u_char.
 Fixes warnings from gcc and keeps the small size. Perhaps nesting


should be moved



 to another variablle.

 Reported by:ngie

Modified:
 head/sys/kern/subr_kdb.c
 head/sys/sys/kdb.h

Modified: head/sys/kern/subr_kdb.c



==


--- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)

+++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include 
#endif
-bool __read_frequently kdb_active = 0;
+u_char __read_frequently kdb_active = 0;
static void *kdb_jmpbufp = NULL;
struct kdb_dbbe *kdb_dbbe = NULL;
static struct pcb kdb_pcb;

Modified: head/sys/sys/kdb.h



==


--- head/sys/sys/kdb.hSun Oct 22 12:12:52 2017(r324862)

+++ head/sys/sys/kdb.hSun Oct 22 13:42:56 2017(r324863)
@@ -59,7 +59,7 @@ struct kdb_dbbe {
};\
DATA_SET(kdb_dbbe_set, name##_dbbe)
-extern bool kdb_active;/* Non-zero while in debugger. */
+extern u_char kdb_active;/* Non-zero while in debugger. */
extern int debugger_on_panic;/* enter the debugger on panic.


*/



extern struct kdb_dbbe *kdb_dbbe;/* Default debugger backend or



NULL. */



extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */





Should we add __aligned(8) to this definition?

./systm.h:#define__read_frequently


__section(".data.read_frequently")



It will prevent commonly read variables from residing in two different
cache-lines on x86 and amd64 at least???



I don't follow. This would *increase* alignemnt requirement and in
particular prevent bool variables from being put in consecutive bytes.

To answer the question from your other e-mail, the bigger the type the
worse it is as it takes more space. The idea is to change all frequently
read and effectively bool variables from int to bool so that more of
them fit in one cacheline.

Right now there is nothing to nicely sort them to get rid of holes, but
I'm tinkering with automagic size addition to section name.



Hi,

The point is that for x86 there is no alignment so the variables get
packed back to back, and then you sometimes get not so smart layouts, like
that an integer crosses a cache line.



They are aligned to their size and this creates holes, like here:

8112873c D kdb_active

81128740 D audit_enabled

Regarding automation: Maybe the idea behind sysinit can be used:

sys/boot/usb/tools/sysinit.c



I don't know how this can be plugged here. Would this require defining
variables elsewhere?

Preferably they would be sorted by the linker.



Hi,

If the linker supports this, that's the best. Else you'll need a custom 
tool. sysinit.c might give you some ideas how to implement it in a 
cross-OS way.


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


Re: svn commit: r324836 - in head/sys: kern sys

2017-10-22 Thread hiren panchasara
On 10/21/17 at 10:40P, Mateusz Guzik wrote:
> Author: mjg
> Date: Sat Oct 21 22:40:09 2017
> New Revision: 324836
> URL: https://svnweb.freebsd.org/changeset/base/324836
> 
> Log:
>   mtx: implement thread lock fastpath

Hi,
Can you please elaborate this commit-log message a little more? what is
the fastpath here and what scenarios would benefit from this change?

This would help novice like myself. :-)

Cheers,
Hiren


pgpWCFEEFUsZ2.pgp
Description: PGP signature


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Mateusz Guzik
On Sun, Oct 22, 2017 at 6:59 PM, Hans Petter Selasky 
wrote:

> On 10/22/17 16:50, Mateusz Guzik wrote:
>
>> On Sun, Oct 22, 2017 at 04:24:41PM +0200, Hans Petter Selasky wrote:
>>
>>> On 10/22/17 15:42, Mateusz Guzik wrote:
>>>
 Author: mjg
 Date: Sun Oct 22 13:42:56 2017
 New Revision: 324863
 URL: https://svnweb.freebsd.org/changeset/base/324863

 Log:
 Change kdb_active type to u_char.
 Fixes warnings from gcc and keeps the small size. Perhaps nesting

>>> should be moved
>>
>>> to another variablle.
 Reported by:ngie

 Modified:
 head/sys/kern/subr_kdb.c
 head/sys/sys/kdb.h

 Modified: head/sys/kern/subr_kdb.c

 
>> ==
>>
>>> --- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
 +++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
 @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include 
#endif
 -bool __read_frequently kdb_active = 0;
 +u_char __read_frequently kdb_active = 0;
static void *kdb_jmpbufp = NULL;
struct kdb_dbbe *kdb_dbbe = NULL;
static struct pcb kdb_pcb;

 Modified: head/sys/sys/kdb.h

 
>> ==
>>
>>> --- head/sys/sys/kdb.hSun Oct 22 12:12:52 2017(r324862)
 +++ head/sys/sys/kdb.hSun Oct 22 13:42:56 2017(r324863)
 @@ -59,7 +59,7 @@ struct kdb_dbbe {
};\
DATA_SET(kdb_dbbe_set, name##_dbbe)
 -extern bool kdb_active;/* Non-zero while in debugger. */
 +extern u_char kdb_active;/* Non-zero while in debugger. */
extern int debugger_on_panic;/* enter the debugger on panic.

>>> */
>>
>>>extern struct kdb_dbbe *kdb_dbbe;/* Default debugger backend or

>>> NULL. */
>>
>>>extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */



>>> Should we add __aligned(8) to this definition?
>>>
>>> ./systm.h:#define__read_frequently
>>>
>> __section(".data.read_frequently")
>>
>>>
>>> It will prevent commonly read variables from residing in two different
>>> cache-lines on x86 and amd64 at least???
>>>
>>>
>> I don't follow. This would *increase* alignemnt requirement and in
>> particular prevent bool variables from being put in consecutive bytes.
>>
>> To answer the question from your other e-mail, the bigger the type the
>> worse it is as it takes more space. The idea is to change all frequently
>> read and effectively bool variables from int to bool so that more of
>> them fit in one cacheline.
>>
>> Right now there is nothing to nicely sort them to get rid of holes, but
>> I'm tinkering with automagic size addition to section name.
>>
>>
> Hi,
>
> The point is that for x86 there is no alignment so the variables get
> packed back to back, and then you sometimes get not so smart layouts, like
> that an integer crosses a cache line.
>
>
They are aligned to their size and this creates holes, like here:

8112873c D kdb_active

81128740 D audit_enabled

Regarding automation: Maybe the idea behind sysinit can be used:
> sys/boot/usb/tools/sysinit.c
>

I don't know how this can be plugged here. Would this require defining
variables elsewhere?

Preferably they would be sorted by the linker.

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


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Hans Petter Selasky

On 10/22/17 16:50, Mateusz Guzik wrote:

On Sun, Oct 22, 2017 at 04:24:41PM +0200, Hans Petter Selasky wrote:

On 10/22/17 15:42, Mateusz Guzik wrote:

Author: mjg
Date: Sun Oct 22 13:42:56 2017
New Revision: 324863
URL: https://svnweb.freebsd.org/changeset/base/324863

Log:
Change kdb_active type to u_char.
Fixes warnings from gcc and keeps the small size. Perhaps nesting

should be moved

to another variablle.
Reported by:ngie

Modified:
head/sys/kern/subr_kdb.c
head/sys/sys/kdb.h

Modified: head/sys/kern/subr_kdb.c


==

--- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
+++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
   #include 
   #endif
-bool __read_frequently kdb_active = 0;
+u_char __read_frequently kdb_active = 0;
   static void *kdb_jmpbufp = NULL;
   struct kdb_dbbe *kdb_dbbe = NULL;
   static struct pcb kdb_pcb;

Modified: head/sys/sys/kdb.h


==

--- head/sys/sys/kdb.hSun Oct 22 12:12:52 2017(r324862)
+++ head/sys/sys/kdb.hSun Oct 22 13:42:56 2017(r324863)
@@ -59,7 +59,7 @@ struct kdb_dbbe {
   };\
   DATA_SET(kdb_dbbe_set, name##_dbbe)
-extern bool kdb_active;/* Non-zero while in debugger. */
+extern u_char kdb_active;/* Non-zero while in debugger. */
   extern int debugger_on_panic;/* enter the debugger on panic.

*/

   extern struct kdb_dbbe *kdb_dbbe;/* Default debugger backend or

NULL. */

   extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */




Should we add __aligned(8) to this definition?

./systm.h:#define__read_frequently

__section(".data.read_frequently")


It will prevent commonly read variables from residing in two different
cache-lines on x86 and amd64 at least???



I don't follow. This would *increase* alignemnt requirement and in
particular prevent bool variables from being put in consecutive bytes.

To answer the question from your other e-mail, the bigger the type the
worse it is as it takes more space. The idea is to change all frequently
read and effectively bool variables from int to bool so that more of
them fit in one cacheline.

Right now there is nothing to nicely sort them to get rid of holes, but
I'm tinkering with automagic size addition to section name.



Hi,

The point is that for x86 there is no alignment so the variables get 
packed back to back, and then you sometimes get not so smart layouts, 
like that an integer crosses a cache line.


Regarding automation: Maybe the idea behind sysinit can be used:
sys/boot/usb/tools/sysinit.c

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


Re: svn commit: r324853 - in head/sys: kern sys

2017-10-22 Thread Conrad Meyer
Thanks!

For other users that managed to create such files: fsck will clean them up.

Best,
Conrad

On Sun, Oct 22, 2017 at 1:11 AM, Konstantin Belousov  wrote:
> Author: kib
> Date: Sun Oct 22 08:11:45 2017
> New Revision: 324853
> URL: https://svnweb.freebsd.org/changeset/base/324853
>
> Log:
>   Remove the support for mknod(S_IFMT), which created dummy vnodes with
>   VBAD type.
>
>   FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not
>   check for the type and their behaviour is really undefined.  The
>   comment claims that this support was done for 'badsect' to flag bad
>   sectors, we do not have such facility in kernel anyway.
>
>   Reported by:  Dmitry Vyukov 
>   Sponsored by: The FreeBSD Foundation
>   MFC after:1 week
>
> Modified:
>   head/sys/kern/vfs_syscalls.c
>   head/sys/sys/priv.h
>
> Modified: head/sys/kern/vfs_syscalls.c
> ==
> --- head/sys/kern/vfs_syscalls.cSun Oct 22 07:58:28 2017
> (r324852)
> +++ head/sys/kern/vfs_syscalls.cSun Oct 22 08:11:45 2017
> (r324853)
> @@ -1248,9 +1248,6 @@ kern_mknodat(struct thread *td, int fd, char *path, en
> if (error == 0 && dev == VNOVAL)
> error = EINVAL;
> break;
> -   case S_IFMT:
> -   error = priv_check(td, PRIV_VFS_MKNOD_BAD);
> -   break;
> case S_IFWHT:
> error = priv_check(td, PRIV_VFS_MKNOD_WHT);
> break;
> @@ -1288,9 +1285,6 @@ restart:
> whiteout = 0;
>
> switch (mode & S_IFMT) {
> -   case S_IFMT:/* used by badsect to flag bad sectors */
> -   vattr.va_type = VBAD;
> -   break;
> case S_IFCHR:
> vattr.va_type = VCHR;
> break;
>
> Modified: head/sys/sys/priv.h
> ==
> --- head/sys/sys/priv.h Sun Oct 22 07:58:28 2017(r324852)
> +++ head/sys/sys/priv.h Sun Oct 22 08:11:45 2017(r324853)
> @@ -266,7 +266,7 @@
>  #definePRIV_VFS_GETFH  327 /* Can retrieve file handles. 
> */
>  #definePRIV_VFS_GETQUOTA   328 /* getquota(). */
>  #definePRIV_VFS_LINK   329 /* bsd.hardlink_check_uid */
> -#definePRIV_VFS_MKNOD_BAD  330 /* Can mknod() to mark bad 
> inodes. */
> +#definePRIV_VFS_MKNOD_BAD  330 /* Was: mknod() can mark bad 
> inodes. */
>  #definePRIV_VFS_MKNOD_DEV  331 /* Can mknod() to create dev 
> nodes. */
>  #definePRIV_VFS_MKNOD_WHT  332 /* Can mknod() to create 
> whiteout. */
>  #definePRIV_VFS_MOUNT  333 /* Can mount(). */
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r324841 - head/sys/boot

2017-10-22 Thread Warner Losh
On Sun, Oct 22, 2017 at 9:32 AM, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> [ Charset UTF-8 unsupported, converting... ]
> > Author: imp
> > Date: Sun Oct 22 03:52:03 2017
> > New Revision: 324841
> > URL: https://svnweb.freebsd.org/changeset/base/324841
> >
> > Log:
> >   Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot.
> >
> >   Sponsored By: Netflix
>
> Shouldn't these be BOOTSRC so BOOTDIR can be /boot as BINDIR is /bin?


There's currently no BOOTDIR, so there's no conflict. However, as a design
point, that may be desirable.

Warner


> > Modified:
> >   head/sys/boot/defs.mk
> >
> > Modified: head/sys/boot/defs.mk
> > 
> ==
> > --- head/sys/boot/defs.mk Sun Oct 22 00:10:18 2017(r324840)
> > +++ head/sys/boot/defs.mk Sun Oct 22 03:52:03 2017(r324841)
> > @@ -6,9 +6,9 @@
> >  __BOOT_DEFS_MK__=${MFILE}
> >
> >  BOOTDIR= ${SRCTOP}/sys/boot
> > -FICLDIR= ${SRCTOP}/sys/boot/ficl
> > +FICLDIR= ${BOOTDIR}/ficl
> >  LDR_MI=  ${BOOTDIR}/common
> > -SASRC=   ${SRCTOP}/sys/boot/libsa
> > +SASRC=   ${BOOTDIR}/libsa
> >  SYSDIR=  ${SRCTOP}/sys
> >
> >  # NB: The makefiles depend on these being empty when we don't build
> forth.
> >
> >
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r324841 - head/sys/boot

2017-10-22 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: imp
> Date: Sun Oct 22 03:52:03 2017
> New Revision: 324841
> URL: https://svnweb.freebsd.org/changeset/base/324841
> 
> Log:
>   Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot.
>   
>   Sponsored By: Netflix

Shouldn't these be BOOTSRC so BOOTDIR can be /boot as BINDIR is /bin?

> Modified:
>   head/sys/boot/defs.mk
> 
> Modified: head/sys/boot/defs.mk
> ==
> --- head/sys/boot/defs.mk Sun Oct 22 00:10:18 2017(r324840)
> +++ head/sys/boot/defs.mk Sun Oct 22 03:52:03 2017(r324841)
> @@ -6,9 +6,9 @@
>  __BOOT_DEFS_MK__=${MFILE}
>  
>  BOOTDIR= ${SRCTOP}/sys/boot
> -FICLDIR= ${SRCTOP}/sys/boot/ficl
> +FICLDIR= ${BOOTDIR}/ficl
>  LDR_MI=  ${BOOTDIR}/common
> -SASRC=   ${SRCTOP}/sys/boot/libsa
> +SASRC=   ${BOOTDIR}/libsa
>  SYSDIR=  ${SRCTOP}/sys
>  
>  # NB: The makefiles depend on these being empty when we don't build forth.
> 
> 

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


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Mateusz Guzik
On Sun, Oct 22, 2017 at 04:24:41PM +0200, Hans Petter Selasky wrote:
> On 10/22/17 15:42, Mateusz Guzik wrote:
> > Author: mjg
> > Date: Sun Oct 22 13:42:56 2017
> > New Revision: 324863
> > URL: https://svnweb.freebsd.org/changeset/base/324863
> >
> > Log:
> >Change kdb_active type to u_char.
> >Fixes warnings from gcc and keeps the small size. Perhaps nesting
should be moved
> >to another variablle.
> >Reported by:ngie
> >
> > Modified:
> >head/sys/kern/subr_kdb.c
> >head/sys/sys/kdb.h
> >
> > Modified: head/sys/kern/subr_kdb.c
> >
==
> > --- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
> > +++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
> > @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
> >   #include 
> >   #endif
> > -bool __read_frequently kdb_active = 0;
> > +u_char __read_frequently kdb_active = 0;
> >   static void *kdb_jmpbufp = NULL;
> >   struct kdb_dbbe *kdb_dbbe = NULL;
> >   static struct pcb kdb_pcb;
> >
> > Modified: head/sys/sys/kdb.h
> >
==
> > --- head/sys/sys/kdb.hSun Oct 22 12:12:52 2017(r324862)
> > +++ head/sys/sys/kdb.hSun Oct 22 13:42:56 2017(r324863)
> > @@ -59,7 +59,7 @@ struct kdb_dbbe {
> >   };\
> >   DATA_SET(kdb_dbbe_set, name##_dbbe)
> > -extern bool kdb_active;/* Non-zero while in debugger. */
> > +extern u_char kdb_active;/* Non-zero while in debugger. */
> >   extern int debugger_on_panic;/* enter the debugger on panic.
*/
> >   extern struct kdb_dbbe *kdb_dbbe;/* Default debugger backend or
NULL. */
> >   extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */
> >
> >
>
> Should we add __aligned(8) to this definition?
>
> ./systm.h:#define__read_frequently
__section(".data.read_frequently")
>
> It will prevent commonly read variables from residing in two different
> cache-lines on x86 and amd64 at least???
>

I don't follow. This would *increase* alignemnt requirement and in
particular prevent bool variables from being put in consecutive bytes.

To answer the question from your other e-mail, the bigger the type the
worse it is as it takes more space. The idea is to change all frequently
read and effectively bool variables from int to bool so that more of
them fit in one cacheline.

Right now there is nothing to nicely sort them to get rid of holes, but
I'm tinkering with automagic size addition to section name.

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


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Hans Petter Selasky

On 10/22/17 15:42, Mateusz Guzik wrote:

Author: mjg
Date: Sun Oct 22 13:42:56 2017
New Revision: 324863
URL: https://svnweb.freebsd.org/changeset/base/324863

Log:
   Change kdb_active type to u_char.
   
   Fixes warnings from gcc and keeps the small size. Perhaps nesting should be moved

   to another variablle.
   
   Reported by:	ngie


Modified:
   head/sys/kern/subr_kdb.c
   head/sys/sys/kdb.h

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
+++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
  #include 
  #endif
  
-bool __read_frequently kdb_active = 0;

+u_char __read_frequently kdb_active = 0;
  static void *kdb_jmpbufp = NULL;
  struct kdb_dbbe *kdb_dbbe = NULL;
  static struct pcb kdb_pcb;

Modified: head/sys/sys/kdb.h
==
--- head/sys/sys/kdb.h  Sun Oct 22 12:12:52 2017(r324862)
+++ head/sys/sys/kdb.h  Sun Oct 22 13:42:56 2017(r324863)
@@ -59,7 +59,7 @@ struct kdb_dbbe {
};  \
DATA_SET(kdb_dbbe_set, name##_dbbe)
  
-extern bool kdb_active;			/* Non-zero while in debugger. */

+extern u_char kdb_active;  /* Non-zero while in debugger. */
  extern int debugger_on_panic; /* enter the debugger on panic. */
  extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */
  extern struct trapframe *kdb_frame;   /* Frame to kdb_trap(). */




Should we add __aligned(8) to this definition?

./systm.h:#define   __read_frequently   
__section(".data.read_frequently")

It will prevent commonly read variables from residing in two different 
cache-lines on x86 and amd64 at least???



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


Re: svn commit: r324863 - in head/sys: kern sys

2017-10-22 Thread Hans Petter Selasky

On 10/22/17 15:42, Mateusz Guzik wrote:

Author: mjg
Date: Sun Oct 22 13:42:56 2017
New Revision: 324863
URL: https://svnweb.freebsd.org/changeset/base/324863

Log:
   Change kdb_active type to u_char.
   
   Fixes warnings from gcc and keeps the small size. Perhaps nesting should be moved

   to another variablle.
   
   Reported by:	ngie


Modified:
   head/sys/kern/subr_kdb.c
   head/sys/sys/kdb.h

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
+++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
  #include 
  #endif
  
-bool __read_frequently kdb_active = 0;

+u_char __read_frequently kdb_active = 0;
  static void *kdb_jmpbufp = NULL;
  struct kdb_dbbe *kdb_dbbe = NULL;
  static struct pcb kdb_pcb;

Modified: head/sys/sys/kdb.h
==
--- head/sys/sys/kdb.h  Sun Oct 22 12:12:52 2017(r324862)
+++ head/sys/sys/kdb.h  Sun Oct 22 13:42:56 2017(r324863)
@@ -59,7 +59,7 @@ struct kdb_dbbe {
};  \
DATA_SET(kdb_dbbe_set, name##_dbbe)
  
-extern bool kdb_active;			/* Non-zero while in debugger. */

+extern u_char kdb_active;  /* Non-zero while in debugger. */
  extern int debugger_on_panic; /* enter the debugger on panic. */
  extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */
  extern struct trapframe *kdb_frame;   /* Frame to kdb_trap(). */




Hi,

Sorry for nitpicking. I believe this variable is better suited as "int"? 
Or am I wrong? What does the resulting assembly code look like?


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


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

2017-10-22 Thread Mateusz Guzik
Author: mjg
Date: Sun Oct 22 13:42:56 2017
New Revision: 324863
URL: https://svnweb.freebsd.org/changeset/base/324863

Log:
  Change kdb_active type to u_char.
  
  Fixes warnings from gcc and keeps the small size. Perhaps nesting should be 
moved
  to another variablle.
  
  Reported by:  ngie

Modified:
  head/sys/kern/subr_kdb.c
  head/sys/sys/kdb.h

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
+++ head/sys/kern/subr_kdb.cSun Oct 22 13:42:56 2017(r324863)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-bool __read_frequently kdb_active = 0;
+u_char __read_frequently kdb_active = 0;
 static void *kdb_jmpbufp = NULL;
 struct kdb_dbbe *kdb_dbbe = NULL;
 static struct pcb kdb_pcb;

Modified: head/sys/sys/kdb.h
==
--- head/sys/sys/kdb.h  Sun Oct 22 12:12:52 2017(r324862)
+++ head/sys/sys/kdb.h  Sun Oct 22 13:42:56 2017(r324863)
@@ -59,7 +59,7 @@ struct kdb_dbbe {
};  \
DATA_SET(kdb_dbbe_set, name##_dbbe)
 
-extern bool kdb_active;/* Non-zero while in debugger. 
*/
+extern u_char kdb_active;  /* Non-zero while in debugger. */
 extern int debugger_on_panic;  /* enter the debugger on panic. */
 extern struct kdb_dbbe *kdb_dbbe;  /* Default debugger backend or NULL. */
 extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324862 - head/sys/kern

2017-10-22 Thread Ngie Cooper
Author: ngie
Date: Sun Oct 22 12:12:52 2017
New Revision: 324862
URL: https://svnweb.freebsd.org/changeset/base/324862

Log:
  Clean up trailing whitespace in kdb_thr_ctx(..)
  
  MFC after:1 week

Modified:
  head/sys/kern/subr_kdb.c

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cSun Oct 22 11:45:51 2017(r324861)
+++ head/sys/kern/subr_kdb.cSun Oct 22 12:12:52 2017(r324862)
@@ -513,12 +513,12 @@ kdb_reenter(void)
 
 struct pcb *
 kdb_thr_ctx(struct thread *thr)
-{  
+{
 #if defined(SMP) && defined(KDB_STOPPEDPCB)
struct pcpu *pc;
 #endif
- 
-   if (thr == curthread) 
+
+   if (thr == curthread)
return (_pcb);
 
 #if defined(SMP) && defined(KDB_STOPPEDPCB)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r324789 - in head/sys: kern sys

2017-10-22 Thread Ngie Cooper (yaneurabeya)

> On Oct 19, 2017, at 21:02, Mateusz Guzik  wrote:
> 
> Author: mjg
> Date: Fri Oct 20 04:02:53 2017
> New Revision: 324789
> URL: https://svnweb.freebsd.org/changeset/base/324789
> 
> Log:
>  Mark kdb_active as __read_frequently and switch to bool to eat less space.
> 
> Modified:
>  head/sys/kern/subr_kdb.c
>  head/sys/sys/kdb.h
> 
> Modified: head/sys/kern/subr_kdb.c
> ==
> --- head/sys/kern/subr_kdb.c  Fri Oct 20 03:38:58 2017(r324788)
> +++ head/sys/kern/subr_kdb.c  Fri Oct 20 04:02:53 2017(r324789)
> @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
> #include 
> #endif
> 
> -int kdb_active = 0;
> +bool __read_frequently kdb_active = 0;
> static void *kdb_jmpbufp = NULL;
> struct kdb_dbbe *kdb_dbbe = NULL;
> static struct pcb kdb_pcb;
> 
> Modified: head/sys/sys/kdb.h
> ==
> --- head/sys/sys/kdb.hFri Oct 20 03:38:58 2017(r324788)
> +++ head/sys/sys/kdb.hFri Oct 20 04:02:53 2017(r324789)
> @@ -59,7 +59,7 @@ struct kdb_dbbe {
>   };  \
>   DATA_SET(kdb_dbbe_set, name##_dbbe)
> 
> -extern int kdb_active;   /* Non-zero while in debugger. 
> */
> +extern bool kdb_active;  /* Non-zero while in debugger. 
> */
> extern int debugger_on_panic; /* enter the debugger on panic. */
> extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */
> extern struct trapframe *kdb_frame;   /* Frame to kdb_trap(). */

This broke `kdb_active` use in `kdb_trap`. It’s noticed by gcc on 
riscv64: https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/4356/console .
Please fix or revert.
Thanks,
-Ngie



signature.asc
Description: Message signed with OpenPGP using GPGMail


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

2017-10-22 Thread Bruce M Simpson
Author: bms
Date: Sun Oct 22 11:40:55 2017
New Revision: 324860
URL: https://svnweb.freebsd.org/changeset/base/324860

Log:
  Modernise this man page somewhat.
  
  1. Add a reference to a good 3rd party list of compatible cables, but
  provide suggestions for 'known good' vendors.
  
  2. Change IP-based USB host-host example to a modern Ethernet one which
  works 'out of box' with current Linux systems.
  
  3. Explain that USB 3.0 is host-host, even though point-to-point soft
  Ethernet can be achieved.
  
  MFC after:3 weeks

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

Modified: head/share/man/man4/udbp.4
==
--- head/share/man/man4/udbp.4  Sun Oct 22 11:21:31 2017(r324859)
+++ head/share/man/man4/udbp.4  Sun Oct 22 11:40:55 2017(r324860)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 22, 2006
+.Dd October 20, 2017
 .Dt UDBP 4
 .Os
 .Sh NAME
@@ -48,9 +48,14 @@ udbp_load="YES"
 The
 .Nm
 driver provides support for host-to-host cables
-that contain at least two bulk pipes (one for each direction),
-for example
-the EzLink cable and the NetChip 1080 chip.
+that contain at least two bulk pipes (one for each direction).
+This typically includes cables branded for use with
+.Sy Windows USB Easy Transfer ,
+and many cables based on the Prolific PL2xx1 series of USB bridge chips.
+A useful (but non-comprehensive) list of compatible USB host cables
+is listed in the
+.Sx SEE ALSO
+section below.
 .Pp
 .\" XXXThe description of how to add netgraph to the kernel
 .\"is out of place here.  It should be limited to the
@@ -86,30 +91,64 @@ module and then the
 .Nm
 driver.
 .Pp
-.Dl ngctl mkpeer udbp0: iface data inet
-.Dl ifconfig ng0 10.0.0.1 10.0.0.2
+.Dl ngctl mkpeer udbp0: eiface data ether
+.Dl ifconfig ngeth0 ether aa:dd:xx:xx:xx
+.Dl ifconfig ngeth0 inet 169.254.x.x/16
 .Pp
-Create a new network interface node
-and connect its inet hook to the data hook of the
+Create a new Ethernet network interface node
+and connect its ether hook to the data hook of the
 .Nm
-node.
-.Xr ifconfig 8
-configures the resulting network interface ng0 with a local
-IP address of 10.0.0.1 and a remote IP address of 10.0.0.2.
-On the remote host, the two
-IP addresses should of course be reversed.
+driver.
+.Pp
+This enables FreeBSD to communicate with a Linux peer (e.g. using the
+.Sy plusb
+driver).
+The Linux node should be configured to prefer link-local IPv4 addresses
+(e.g. using Network Manager in Debian and Red Hat derived distributions).
+.Pp
+Whilst both FreeBSD and Linux are able to interoperate by
+loosely following CDC EEM 1.0 in their behaviour, neither implementation
+has been expressly designed to follow its specification.
 .Sh SEE ALSO
 .Xr netgraph 4 ,
-.Xr ng_iface 4 ,
+.Xr ng_eiface 4 ,
 .Xr ohci 4 ,
 .Xr uhci 4 ,
 .Xr usb 4 ,
 .Xr ngctl 8
+.\"
+.Rs
+.%B Universal Serial Bus: Communications Class Subclass Specification for 
Ethernet Emulation Model Devices 
+.%N Revision 1.0
+.%D February 2, 2005
+.%I USB Implementers Forum, Inc.
+.%U http://www.usb.org/developers/docs/devclass_docs/CDC_EEM10.pdf
+.Re
+.\"
+.Rs
+.%B Total Commander: Supported cables for USB cable connection
+.%I Ghisler Software GmbH.
+.%U https://www.ghisler.com/cables/index.htm
+.Re
+.Sh CAVEATS
+The point-to-point nature and additional latency of USB host-host links
+makes them unsuitable as a "drop-in" replacement for an Ethernet LAN;
+for a USB 3.0 SuperSpeed cable, latency is comparable to 100BaseTX Ethernet
+(but often worse), with throughput comparable to 2.5GBASE-T.
+.Pp
+However, their energy efficiency makes them attractive for embedded
+applications. A Plugable PL27A1 cable claims 24mA of USB3 bus power,
+as compared to 150mA for a typical USB 3.0 to Gigabit Ethernet interface.
 .Sh HISTORY
 The
 .Nm
 driver first appeared in
 .Fx 5.0 .
+.Sh BUGS
+The
+.Nm
+driver does not support the special packets described in section 5.1
+of the CDC EEM specification.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -121,4 +160,6 @@ and
 .An Nick Hibma Aq Mt n_hi...@freebsd.org .
 .Pp
 This manual page was written by
-.An Nick Hibma Aq Mt n_hi...@freebsd.org .
+.An Nick Hibma Aq Mt n_hi...@freebsd.org 
+and updated by
+.An Bruce Simpson Aq Mt b...@freebsd.org .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324858 - in head/sys/dev/usb: . misc

2017-10-22 Thread Bruce M Simpson
Author: bms
Date: Sun Oct 22 11:15:58 2017
New Revision: 324858
URL: https://svnweb.freebsd.org/changeset/base/324858

Log:
  Add Prolific PL27A1 USB 3.0 Host-Host device to udbp(4).
  
  Tested with a Plugable cable in VirtualBox against Linux 4.11.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/usb/misc/udbp.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/misc/udbp.c
==
--- head/sys/dev/usb/misc/udbp.cSun Oct 22 10:35:29 2017
(r324857)
+++ head/sys/dev/usb/misc/udbp.cSun Oct 22 11:15:58 2017
(r324858)
@@ -264,6 +264,7 @@ static const STRUCT_USB_HOST_ID udbp_devs[] = {
{USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)},
{USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)},
{USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)},
+   {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL27A1, 0)},
{USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)},
{USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)},
 };

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Oct 22 10:35:29 2017(r324857)
+++ head/sys/dev/usb/usbdevsSun Oct 22 11:15:58 2017(r324858)
@@ -3679,6 +3679,7 @@ product PROLIFIC PL2305   0x2305  Parallel printer
 product PROLIFIC ATAPI40x2307  ATAPI-4 Controller
 product PROLIFIC PL25010x2501  PL2501 Host-Host interface
 product PROLIFIC PL25060x2506  PL2506 USB to IDE Bridge
+product PROLIFIC PL27A10x27A1  PL27A1 USB 3.0 Host-Host 
interface
 product PROLIFIC HCR3310x331a  HCR331 Hybrid Card Reader
 product PROLIFIC PHAROS0xaaa0  Prolific Pharos
 product PROLIFIC RSAQ3 0xaaa2  PL2303 Serial Adapter (IODATA USB-RSAQ3)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324857 - in head: lib/libc/gen sys/vm

2017-10-22 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 22 10:35:29 2017
New Revision: 324857
URL: https://svnweb.freebsd.org/changeset/base/324857

Log:
  Add OID for the vm.overcommit sysctl. This makes it possible to remove
  one call to sysctl(2) from jemalloc startup code. (That also requires
  changes to jemalloc, but I plan to push those to upstream first.)
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D12745

Modified:
  head/lib/libc/gen/sysctl.3
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_param.h

Modified: head/lib/libc/gen/sysctl.3
==
--- head/lib/libc/gen/sysctl.3  Sun Oct 22 10:32:40 2017(r324856)
+++ head/lib/libc/gen/sysctl.3  Sun Oct 22 10:35:29 2017(r324857)
@@ -28,7 +28,7 @@
 .\"@(#)sysctl.38.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd September 10, 2015
+.Dd October 22, 2017
 .Dt SYSCTL 3
 .Os
 .Sh NAME
@@ -741,6 +741,7 @@ privilege may change the value.
 .It Dv VM_V_FREE_TARGET Ta integer Ta yes
 .It Dv VM_V_INACTIVE_TARGET Ta integer Ta yes
 .It Dv VM_V_PAGEOUT_FREE_MIN Ta integer Ta yes
+.It Dv VM_OVERCOMMIT Ta integer Ta yes
 .El
 .Bl -tag -width 6n
 .It Li VM_LOADAVG
@@ -773,6 +774,9 @@ process address space when needed.
 .It Li VM_V_PAGEOUT_FREE_MIN
 If the amount of free and cache memory falls below this value, the
 pageout daemon will enter "memory conserving mode" to avoid deadlock.
+.It Li VM_OVERCOMMIT
+Overcommit behaviour, as described in
+.Xr tuning 7 .
 .El
 .Sh RETURN VALUES
 .Rv -std

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cSun Oct 22 10:32:40 2017(r324856)
+++ head/sys/vm/swap_pager.cSun Oct 22 10:35:29 2017(r324857)
@@ -157,7 +157,7 @@ static vm_ooffset_t swap_reserved;
 SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, _reserved, 0,
 "Amount of swap storage needed to back all allocated anonymous memory.");
 static int overcommit = 0;
-SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, , 0,
+SYSCTL_INT(_vm, VM_OVERCOMMIT, overcommit, CTLFLAG_RW, , 0,
 "Configure virtual memory overcommit behavior. See tuning(7) "
 "for details.");
 static unsigned long swzone;

Modified: head/sys/vm/vm_param.h
==
--- head/sys/vm/vm_param.h  Sun Oct 22 10:32:40 2017(r324856)
+++ head/sys/vm/vm_param.h  Sun Oct 22 10:35:29 2017(r324857)
@@ -84,7 +84,8 @@
 #define VM_V_PAGEOUT_FREE_MIN  9   /* vm_cnt.v_pageout_free_min */
 #defineVM_OBSOLETE_10  10  /* pageout algorithm */
 #define VM_SWAPPING_ENABLED11  /* swapping enabled */
-#defineVM_MAXID12  /* number of valid vm ids */
+#define VM_OVERCOMMIT  12  /* vm.overcommit */
+#defineVM_MAXID13  /* number of valid vm ids */
 
 /*
  * Structure for swap device statistics
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324856 - head/libexec/rtld-elf

2017-10-22 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 22 10:32:40 2017
New Revision: 324856
URL: https://svnweb.freebsd.org/changeset/base/324856

Log:
  Don't call realpath(3) from libmap rtld code. This gets rid of a few calls
  to fstatat(2) at binary startup; the difference looks like this:
  
  --- przed   2017-10-14 13:55:49.983528000 +0100
  +++ po  2017-10-14 14:10:39.134343000 +0100
  @@ -1,15 +1,10 @@
   mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 
34366173184 (0x800623000)
   issetugid() = 0 (0x0)
  -fstatat(AT_FDCWD,"/etc",{ mode=drwxr-xr-x 
,inode=1364352,size=2560,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
  -fstatat(AT_FDCWD,"/etc/libmap.conf",{ mode=-rw-r--r-- 
,inode=1373288,size=102,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
   openat(AT_FDCWD,"/etc/libmap.conf",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
   fstat(3,{ mode=-rw-r--r-- ,inode=1373288,size=102,blksize=32768 }) = 0 (0x0)
   mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0)   = 34366205952 (0x80062b000)
   close(3)= 0 (0x0)
  -fstatat(AT_FDCWD,"/usr",{ mode=drwxr-xr-x 
,inode=561792,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
  -fstatat(AT_FDCWD,"/usr/local",{ mode=drwxr-xr-x 
,inode=561800,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
  -fstatat(AT_FDCWD,"/usr/local/etc",{ mode=drwxr-xr-x 
,inode=653279,size=1536,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
  
-fstatat(AT_FDCWD,"/usr/local/etc/libmap.d",0x7fffcf50,AT_SYMLINK_NOFOLLOW) 
ERR#2 'No such file or directory'
  
+open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) 
ERR#2 'No such file or directory'
   munmap(0x80062b000,102) = 0 (0x0)
   openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
   read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D12741

Modified:
  head/libexec/rtld-elf/libmap.c

Modified: head/libexec/rtld-elf/libmap.c
==
--- head/libexec/rtld-elf/libmap.c  Sun Oct 22 08:47:13 2017
(r324855)
+++ head/libexec/rtld-elf/libmap.c  Sun Oct 22 10:32:40 2017
(r324856)
@@ -36,6 +36,8 @@ struct lmp {
 static TAILQ_HEAD(lmc_list, lmc) lmc_head = TAILQ_HEAD_INITIALIZER(lmc_head);
 struct lmc {
char *path;
+   dev_t dev;
+   ino_t ino;
TAILQ_ENTRY(lmc) next;
 };
 
@@ -99,45 +101,45 @@ lmc_parse_file(char *path)
struct lmc *p;
struct stat st;
int fd;
-   char *rpath;
char *lm_map;
 
-   rpath = realpath(path, NULL);
-   if (rpath == NULL)
-   return;
-
TAILQ_FOREACH(p, _head, next) {
-   if (strcmp(p->path, rpath) == 0) {
-   free(rpath);
+   if (strcmp(p->path, path) == 0)
return;
-   }
}
 
-   fd = open(rpath, O_RDONLY | O_CLOEXEC);
+   fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
-   dbg("lm_parse_file: open(\"%s\") failed, %s", rpath,
+   dbg("lm_parse_file: open(\"%s\") failed, %s", path,
rtld_strerror(errno));
-   free(rpath);
return;
}
if (fstat(fd, ) == -1) {
close(fd);
-   dbg("lm_parse_file: fstat(\"%s\") failed, %s", rpath,
+   dbg("lm_parse_file: fstat(\"%s\") failed, %s", path,
rtld_strerror(errno));
-   free(rpath);
return;
}
+
+   TAILQ_FOREACH(p, _head, next) {
+   if (p->dev == st.st_dev && p->ino == st.st_ino) {
+   close(fd);
+   return;
+   }
+   }
+
lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (lm_map == (const char *)MAP_FAILED) {
close(fd);
-   dbg("lm_parse_file: mmap(\"%s\") failed, %s", rpath,
+   dbg("lm_parse_file: mmap(\"%s\") failed, %s", path,
rtld_strerror(errno));
-   free(rpath);
return;
}
close(fd);
p = xmalloc(sizeof(struct lmc));
-   p->path = rpath;
+   p->path = xstrdup(path);
+   p->dev = st.st_dev;
+   p->ino = st.st_ino;
TAILQ_INSERT_HEAD(_head, p, next);
lmc_parse(lm_map, st.st_size);
munmap(lm_map, st.st_size);
@@ -151,26 +153,19 @@ lmc_parse_dir(char *idir)
struct lmc *p;
char conffile[MAXPATHLEN];
char *ext;
-   char *rpath;
 
-   rpath = realpath(idir, NULL);
-   if (rpath == NULL)
-   return;
-
TAILQ_FOREACH(p, _head, next) {
-   if (strcmp(p->path, rpath) == 0) {
-   

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

2017-10-22 Thread Konstantin Belousov
Author: kib
Date: Sun Oct 22 08:11:45 2017
New Revision: 324853
URL: https://svnweb.freebsd.org/changeset/base/324853

Log:
  Remove the support for mknod(S_IFMT), which created dummy vnodes with
  VBAD type.
  
  FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not
  check for the type and their behaviour is really undefined.  The
  comment claims that this support was done for 'badsect' to flag bad
  sectors, we do not have such facility in kernel anyway.
  
  Reported by:  Dmitry Vyukov 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/priv.h

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cSun Oct 22 07:58:28 2017
(r324852)
+++ head/sys/kern/vfs_syscalls.cSun Oct 22 08:11:45 2017
(r324853)
@@ -1248,9 +1248,6 @@ kern_mknodat(struct thread *td, int fd, char *path, en
if (error == 0 && dev == VNOVAL)
error = EINVAL;
break;
-   case S_IFMT:
-   error = priv_check(td, PRIV_VFS_MKNOD_BAD);
-   break;
case S_IFWHT:
error = priv_check(td, PRIV_VFS_MKNOD_WHT);
break;
@@ -1288,9 +1285,6 @@ restart:
whiteout = 0;
 
switch (mode & S_IFMT) {
-   case S_IFMT:/* used by badsect to flag bad sectors */
-   vattr.va_type = VBAD;
-   break;
case S_IFCHR:
vattr.va_type = VCHR;
break;

Modified: head/sys/sys/priv.h
==
--- head/sys/sys/priv.h Sun Oct 22 07:58:28 2017(r324852)
+++ head/sys/sys/priv.h Sun Oct 22 08:11:45 2017(r324853)
@@ -266,7 +266,7 @@
 #definePRIV_VFS_GETFH  327 /* Can retrieve file handles. */
 #definePRIV_VFS_GETQUOTA   328 /* getquota(). */
 #definePRIV_VFS_LINK   329 /* bsd.hardlink_check_uid */
-#definePRIV_VFS_MKNOD_BAD  330 /* Can mknod() to mark bad 
inodes. */
+#definePRIV_VFS_MKNOD_BAD  330 /* Was: mknod() can mark bad 
inodes. */
 #definePRIV_VFS_MKNOD_DEV  331 /* Can mknod() to create dev 
nodes. */
 #definePRIV_VFS_MKNOD_WHT  332 /* Can mknod() to create 
whiteout. */
 #definePRIV_VFS_MOUNT  333 /* Can mount(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-10-22 Thread Ngie Cooper
Author: ngie
Date: Sun Oct 22 07:36:28 2017
New Revision: 324851
URL: https://svnweb.freebsd.org/changeset/base/324851

Log:
  Regenerate src.conf(5) after r324340 (armv7 addition)

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sun Oct 22 07:25:28 2017
(r324850)
+++ head/share/man/man5/src.conf.5  Sun Oct 22 07:36:28 2017
(r324851)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd October 06, 2017
+.Dd October 10, 2017
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -162,7 +162,7 @@ Set to build and install binutils (as, ld, objcopy, an
 of the normal system build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, 
mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, 
mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
 .It Va WITHOUT_BINUTILS_BOOTSTRAP
 Set to not build binutils (as, ld, objcopy and objdump)
 as part of the bootstrap process.
@@ -178,7 +178,7 @@ Set build binutils (as, ld, objcopy and objdump)
 as part of the bootstrap process.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, 
mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, 
mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64.
 .It Va WITHOUT_BLACKLIST
 Set this if you do not want to build
 .Xr blacklistd 8
@@ -220,11 +220,6 @@ Set to not build the BSD licensed version of cpio base
 .Xr libarchive 3 .
 .It Va WITH_BSD_GREP
 Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
-.It Va WITHOUT_BSD_GREP_FASTMATCH
-Set this option to exclude the fastmatch implementation from
-.Xr bsdgrep 1 ,
-instead using only
-.Xr regex 3 .
 .It Va WITHOUT_BSNMP
 Set to not build or install
 .Xr bsnmpd 1
@@ -325,7 +320,7 @@ When set, it enforces these options:
 Set to build the Clang C/C++ compiler during the normal phase of the build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, 
i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
 .It Va WITHOUT_CLANG_BOOTSTRAP
 Set to not build the Clang C/C++ compiler during the bootstrap phase of
 the build.
@@ -338,7 +333,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi
 Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and 
i386/i386.
 .It Va WITH_CLANG_EXTRAS
 Set to build additional clang and llvm tools, such as bugpoint.
 .It Va WITHOUT_CLANG_FULL
@@ -352,7 +347,7 @@ Set to build the ARCMigrate, Rewriter and StaticAnalyz
 Clang C/C++ compiler.
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, 
i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64 and powerpc/powerpcspe.
 .It Va WITHOUT_CLANG_IS_CC
 Set to install the GCC compiler as
 .Pa /usr/bin/cc ,
@@ -370,7 +365,7 @@ and
 .Pa /usr/bin/cpp .
 .Pp
 This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and 
i386/i386.
 .It Va WITHOUT_CPP
 Set to not build
 .Xr cpp 1 .
@@ -437,7 +432,7 @@ Set to not build
 .Xr 

svn commit: r324850 - head/sys/boot

2017-10-22 Thread Warner Losh
Author: imp
Date: Sun Oct 22 07:25:28 2017
New Revision: 324850
URL: https://svnweb.freebsd.org/changeset/base/324850

Log:
  Define LIBSA32 to LIBSA on i386 to fix build.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/defs.mk

Modified: head/sys/boot/defs.mk
==
--- head/sys/boot/defs.mk   Sun Oct 22 07:20:11 2017(r324849)
+++ head/sys/boot/defs.mk   Sun Oct 22 07:25:28 2017(r324850)
@@ -19,7 +19,11 @@ LIBFICL= ${BOOTOBJ}/ficl/libficl.a
 LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a
 .endif
 LIBSA= ${BOOTOBJ}/libsa/libsa.a
+.if ${MACHINE} == "i386"
+LIBSA32=   ${LIBSA}
+.else
 LIBSA32=   ${BOOTOBJ}/libsa32/libsa32.a
+.endif
 
 # Standard options:
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"