svn commit: r335884 - head/sys/conf

2018-07-02 Thread Matt Macy
Author: mmacy
Date: Tue Jul  3 05:56:23 2018
New Revision: 335884
URL: https://svnweb.freebsd.org/changeset/base/335884

Log:
  ensure that offset.inc is generated before ia32_genassym.c is compiled

Modified:
  head/sys/conf/files.amd64

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Jul  3 05:53:27 2018(r335883)
+++ head/sys/conf/files.amd64   Tue Jul  3 05:56:23 2018(r335884)
@@ -57,7 +57,7 @@ linux32_vdso.so   optionalcompat_linux32  
\
clean   "linux32_vdso.so"
 #
 ia32_genassym.ostandard
\
-   dependency  "$S/compat/ia32/ia32_genassym.c"\
+   dependency  "$S/compat/ia32/ia32_genassym.c offset.inc" 
\
compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "ia32_genassym.o"
___
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: r335883 - head/stand/common

2018-07-02 Thread Allan Jude
Author: allanjude
Date: Tue Jul  3 05:53:27 2018
New Revision: 335883
URL: https://svnweb.freebsd.org/changeset/base/335883

Log:
  stand/common/disk.c: dev->d_offset still needs to be set to 0
  
  With r335868, I thought this was no longer necessary. I was wrong.
  
  Reported by:  ian
  Sponsored by: Klara Systems

Modified:
  head/stand/common/disk.c

Modified: head/stand/common/disk.c
==
--- head/stand/common/disk.cTue Jul  3 04:02:40 2018(r335882)
+++ head/stand/common/disk.cTue Jul  3 05:53:27 2018(r335883)
@@ -244,6 +244,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
partdev.d_slice = -1;
partdev.d_partition = -1;
 
+   dev->d_offset = 0;
table = NULL;
slice = dev->d_slice;
partition = dev->d_partition;
___
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: r335879 - in head/sys: conf kern sys [ broke ci.freebsd.org's FreeBSD-head-amd64-build ]

2018-07-02 Thread Mark Millard via svn-src-head
-r335879 broke ci.freebsd.org's FreeBSD-head-amd64-build :

https://ci.freebsd.org/job/FreeBSD-head-amd64-build/

shows:

--- ia32_genassym.o ---
In file included from /usr/src/sys/compat/ia32/ia32_genassym.c:6:
In file included from /usr/src/sys/sys/systm.h:113:
/usr/src/sys/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not found
#include "offset.inc"
 ^~~~
1 error generated.
*** [ia32_genassym.o] Error code 1

Later builds ( -r335880 , -r335881 , -r335882 ) get the same.

FreeBSD-head-i386-LINT also fails for such reasons.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

___
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: r335833 - in head: share/man/man4 sys/net sys/netpfil/pf

2018-07-02 Thread Antoine Brodin
On Sun, Jul 1, 2018 at 3:16 AM, Will Andrews  wrote:
> Author: will
> Date: Sun Jul  1 01:16:03 2018
> New Revision: 335833
> URL: https://svnweb.freebsd.org/changeset/base/335833
>
> Log:
>   pf: remove unused ioctls.
>
>   Several ioctls are unused in pf, in the sense that no base utility
>   references them.  Additionally, a cursory review of pf-based ports
>   indicates they're not used elsewhere either.  Some of them have been
>   unused since the original import.  As far as I can tell, they're also
>   unused in OpenBSD.  Finally, removing this code removes the need for
>   future pf work to take them into account.
>
>   Reviewed by:  kp
>   Differential Revision:https://reviews.freebsd.org/D16076
>
> Modified:
>   head/share/man/man4/pf.4
>   head/sys/net/pfvar.h
>   head/sys/netpfil/pf/pf_ioctl.c

Hi,

This breaks some ports like net/libdnet,   please revert or fix the
ports fallout.

Antoine (with hat: portmgr)
___
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: r335882 - head/sys/sys

2018-07-02 Thread Matt Macy
Author: mmacy
Date: Tue Jul  3 04:02:40 2018
New Revision: 335882
URL: https://svnweb.freebsd.org/changeset/base/335882

Log:
  expose sched_{pin,unpin}_lite to tied modules

Modified:
  head/sys/sys/kpilite.h

Modified: head/sys/sys/kpilite.h
==
--- head/sys/sys/kpilite.h  Tue Jul  3 02:54:32 2018(r335881)
+++ head/sys/sys/kpilite.h  Tue Jul  3 04:02:40 2018(r335882)
@@ -29,7 +29,7 @@
 
 #ifndef _SYS_KPILITE_H_
 #define _SYS_KPILITE_H_
-#if !defined(GENOFFSET) && !defined(KLD_MODULE) && defined(_KERNEL)
+#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED)) && 
defined(_KERNEL)
 #include "offset.inc"
 
 static __inline 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: r335881 - head/usr.bin/top

2018-07-02 Thread Cy Schubert
Author: cy
Date: Tue Jul  3 02:54:32 2018
New Revision: 335881
URL: https://svnweb.freebsd.org/changeset/base/335881

Log:
  When toggling the display using the "m" command to toggle from 'cpu'
  mode to 'io' mode, an artifact remains because the buffer is not
  "finished" with a NULL terminator using sbuf_finish().
  
  An example of this is, when the "m" command is entered, the title line
  will contain COMMANDND instead of COMMAND. This commit fixes this.

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Tue Jul  3 02:50:07 2018(r335880)
+++ head/usr.bin/top/machine.c  Tue Jul  3 02:54:32 2018(r335881)
@@ -408,6 +408,7 @@ format_header(const char *uname_field)
ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : "",
namelength, namelength, uname_field);
sbuf_cat(header, "   VCSW  IVCSW   READ  WRITE  FAULT  TOTAL 
PERCENT COMMAND");
+   sbuf_finish(header);
break;
}
case DISP_MAX:
___
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: r335880 - in head/sys: conf kern

2018-07-02 Thread Matt Macy
Author: mmacy
Date: Tue Jul  3 02:50:07 2018
New Revision: 335880
URL: https://svnweb.freebsd.org/changeset/base/335880

Log:
  expose thread_lite definition to tied modules

Modified:
  head/sys/conf/kmod.mk
  head/sys/kern/genoffset.sh

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue Jul  3 01:55:09 2018(r335879)
+++ head/sys/conf/kmod.mk   Tue Jul  3 02:50:07 2018(r335880)
@@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS
 .endif
 
 .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc)
-CLEANFILES+=   assym.inc genassym.o
-DEPENDOBJS+=   genassym.o
+CLEANFILES+=   assym.inc genassym.o genoffset.o
+DEPENDOBJS+=   genassym.o genoffset.o
 assym.inc: genassym.o
+offset.inc: genoffset.o
 .if defined(KERNBUILDDIR)
 genassym.o: opt_global.h
 .endif
@@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 genassym.o: ${SRCS:Mopt_*.h}
${CC} -c ${CFLAGS:N-flto:N-fno-common} \
${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
+offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o
+   sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET}
+genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c
+genoffset.o: ${SRCS:Mopt_*.h}
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
+   ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c
 .endif
 
 .if defined(KERNBUILDDIR)

Modified: head/sys/kern/genoffset.sh
==
--- head/sys/kern/genoffset.sh  Tue Jul  3 01:55:09 2018(r335879)
+++ head/sys/kern/genoffset.sh  Tue Jul  3 02:50:07 2018(r335880)
@@ -39,7 +39,7 @@ work()
 {
echo "#ifndef _OFFSET_INC_"
echo "#define _OFFSET_INC_"
-   echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)"
+   echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || 
defined(KLD_TIED))"
${NM:='nm'} ${NMFLAGS} "$1" | ${AWK:='awk'} '
/ C .*_datatype_*/ {
type = substr($3, match($3, "_datatype_") + 
length("_datatype_"))
___
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: r335879 - in head/sys: conf kern sys

2018-07-02 Thread Matt Macy
Author: mmacy
Date: Tue Jul  3 01:55:09 2018
New Revision: 335879
URL: https://svnweb.freebsd.org/changeset/base/335879

Log:
  make critical_{enter, exit} inline
  
  Avoid pulling in all of the  dependencies by
  automatically generating a stripped down thread_lite exporting
  only the fields of interest. The field declarations are type checked
  against the original and the offsets of the generated result is
  automatically checked.
  
  kib has expressed disagreement and would have preferred to simply
  use genassym style offsets (which loses type check enforcement).
  jhb has expressed dislike of it due to header pollution and a
  duplicate structure. He would have preferred to just have defined
  thread in _thread.h. Nonetheless, he admits that this is the only
  viable solution at the moment.
  
  The impetus for this came from mjg's D15331:
  "Inline critical_enter/exit for amd64"
  
  Reviewed by: jeff
  Differential Revision: https://reviews.freebsd.org/D16078

Added:
  head/sys/kern/genoffset.c   (contents, props changed)
  head/sys/kern/genoffset.sh   (contents, props changed)
  head/sys/sys/kpilite.h   (contents, props changed)
Modified:
  head/sys/conf/kern.post.mk
  head/sys/conf/kern.pre.mk
  head/sys/kern/kern_switch.c
  head/sys/sys/assym.h
  head/sys/sys/systm.h

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Mon Jul  2 22:59:29 2018(r335878)
+++ head/sys/conf/kern.post.mk  Tue Jul  3 01:55:09 2018(r335879)
@@ -185,13 +185,25 @@ hack.pico: Makefile
${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico
rm -f hack.c
 
-assym.inc: $S/kern/genassym.sh genassym.o
+offset.inc: $S/kern/genoffset.sh genoffset.o
+   NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > 
${.TARGET}
+
+genoffset.o: $S/kern/genoffset.c
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c
+
+genoffset_test.c: $S/kern/genoffset.c
+   cp $S/kern/genoffset.c genoffset_test.c
+
+genoffset_test.o: genoffset_test.c offset.inc
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c
+
+assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o
NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > 
${.TARGET}
 
-genassym.o: $S/$M/$M/genassym.c
+genassym.o: $S/$M/$M/genassym.c  offset.inc
${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c
 
-${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
+${SYSTEM_OBJS} genoffset.o genassym.o vers.o: opt_global.h
 
 .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon)
 _meta_filemon= 1
@@ -213,10 +225,10 @@ _SKIP_DEPEND= 1
 .endif
 
 kernel-depend: .depend
-SRCS=  assym.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
+SRCS=  assym.inc offset.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \
${MFILES:T:S/.m$/.h/}
-DEPENDOBJS+=   ${SYSTEM_OBJS} genassym.o
+DEPENDOBJS+=   ${SYSTEM_OBJS} genassym.o genoffset.o
 DEPENDFILES=   ${DEPENDOBJS:O:u:C/^/.depend./}
 .if ${MAKE_VERSION} < 20160220
 DEPEND_MP?=-MP

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Mon Jul  2 22:59:29 2018(r335878)
+++ head/sys/conf/kern.pre.mk   Tue Jul  3 01:55:09 2018(r335879)
@@ -195,7 +195,7 @@ OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_ME
 OFED_C_NOIMP=  ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
 OFED_C=${OFED_C_NOIMP} ${.IMPSRC}
 
-GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
+GEN_CFILES= $S/$M/$M/genassym.c $S/kern/genoffset.c ${MFILES:T:S/.m$/.c/}
 SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
 SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
 SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}

Added: head/sys/kern/genoffset.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/genoffset.c   Tue Jul  3 01:55:09 2018(r335879)
@@ -0,0 +1,44 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2018, Matthew Macy 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 

svn commit: r335878 - head/tools/boot

2018-07-02 Thread Ian Lepore
Author: ian
Date: Mon Jul  2 22:59:29 2018
New Revision: 335878
URL: https://svnweb.freebsd.org/changeset/base/335878

Log:
  Doh!  Commit the proper default values, not my local tweaks.

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Mon Jul  2 22:58:04 2018(r335877)
+++ head/tools/boot/rootgen.sh  Mon Jul  2 22:59:29 2018(r335878)
@@ -2,8 +2,8 @@
 
 # $FreeBSD$
 
-passphrase=x
-iterations=5000
+passphrase=passphrase
+iterations=5
 
 do_boot1_efi=0
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335877 - head/tools/boot

2018-07-02 Thread Ian Lepore
Author: ian
Date: Mon Jul  2 22:58:04 2018
New Revision: 335877
URL: https://svnweb.freebsd.org/changeset/base/335877

Log:
  Move the passphrase and iteration count into variables.
  
  This is purely to make it easier to tweak them locally; the machine I have
  for testing takes forever to do 50,000 pw strengthening iterations, and
  we're not testing the strength of geli's anti-pw-guessing logic here
  (especially given that our test passphrase is "passphrase", except that
  I tend to tweak that also, to 'x', because typing is hard).
  
  Some day these should be settable as cmdline args.  But then, some day this
  whole script should probably get a rewrite. :)

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Mon Jul  2 22:51:48 2018(r335876)
+++ head/tools/boot/rootgen.sh  Mon Jul  2 22:58:04 2018(r335877)
@@ -2,6 +2,9 @@
 
 # $FreeBSD$
 
+passphrase=x
+iterations=5000
+
 do_boot1_efi=0
 
 #
@@ -394,8 +397,8 @@ mk_geli_gpt_ufs_legacy() {
 gpart add -t freebsd-boot -s 400k -a 4k${md}   # <= ~540k
 gpart add -t freebsd-ufs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p2
-echo passphrase | geli attach -j - ${md}p2
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p2
+echo ${passphrase} | geli attach -j - ${md}p2
 newfs /dev/${md}p2.eli
 mount /dev/${md}p2.eli ${mntpt}
 cpsys ${src} ${mntpt}
@@ -430,8 +433,8 @@ mk_geli_gpt_ufs_uefi() {
 gpart add -t efi -s 800k -a 4k ${md}
 gpart add -t freebsd-ufs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p2
-echo passphrase | geli attach -j - ${md}p2
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p2
+echo ${passphrase} | geli attach -j - ${md}p2
 newfs /dev/${md}p2.eli
 mount /dev/${md}p2.eli ${mntpt}
 cpsys ${src} ${mntpt}
@@ -467,8 +470,8 @@ mk_geli_gpt_ufs_both() {
 gpart add -t freebsd-boot -s 400k -a 4k${md}   # <= ~540k
 gpart add -t freebsd-ufs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p3
-echo passphrase | geli attach -j - ${md}p3
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p3
+echo ${passphrase} | geli attach -j - ${md}p3
 newfs /dev/${md}p3.eli
 mount /dev/${md}p3.eli ${mntpt}
 cpsys ${src} ${mntpt}
@@ -504,8 +507,8 @@ mk_geli_gpt_zfs_legacy() {
 gpart add -t freebsd-boot -s 400k -a 4k${md}   # <= ~540k
 gpart add -t freebsd-zfs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p2
-echo passphrase | geli attach -j - ${md}p2
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p2
+echo ${passphrase} | geli attach -j - ${md}p2
 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli
 zpool set bootfs=${pool} ${pool}
 zfs create -po mountpoint=/ ${pool}/ROOT/default
@@ -547,8 +550,8 @@ mk_geli_gpt_zfs_uefi() {
 gpart add -t efi -s 800k -a 4k ${md}
 gpart add -t freebsd-zfs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p2
-echo passphrase | geli attach -j - ${md}p2
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p2
+echo ${passphrase} | geli attach -j - ${md}p2
 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli
 zpool set bootfs=${pool} ${pool}
 zfs create -po mountpoint=/ ${pool}/ROOT/default
@@ -591,8 +594,8 @@ mk_geli_gpt_zfs_both() {
 gpart add -t freebsd-boot -s 400k -a 4k${md}   # <= ~540k
 gpart add -t freebsd-zfs -l root $md
 # install-boot will make this bootable
-echo passphrase | geli init -bg -e AES-XTS -i 5 -J - -l 256 -s 4096 
${md}p3
-echo passphrase | geli attach -j - ${md}p3
+echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 
-s 4096 ${md}p3
+echo ${passphrase} | geli attach -j - ${md}p3
 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli
 zpool set bootfs=${pool} ${pool}
 zfs create -po mountpoint=/ ${pool}/ROOT/default
___
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: r335876 - head/tools/boot

2018-07-02 Thread Ian Lepore
Author: ian
Date: Mon Jul  2 22:51:48 2018
New Revision: 335876
URL: https://svnweb.freebsd.org/changeset/base/335876

Log:
  Allow making just one flavor of boot-test image based on cmdline args.

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Mon Jul  2 21:20:36 2018(r335875)
+++ head/tools/boot/rootgen.sh  Mon Jul  2 22:51:48 2018(r335876)
@@ -740,6 +740,25 @@ qemu_i386_both()
 echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive 
file=${img},format=raw ${qser}" >> $sh
 }
 
+make_one_image()
+{
+local arch=${1?}
+local geli=${2?}
+local scheme=${3?}
+local fs=${4?}
+local bios=${5?}
+
+# Create sparse file and mount newly created filesystem(s) on it
+img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
+sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
+echo "vv   Creating $img  vvv"
+rm -f ${img}*
+eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} 
${scheme} ${fs} ${bios}
+eval qemu_${arch}_${bios} ${img} ${sh}
+[ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
+echo "^^   Created $img   ^^^"
+}
+
 # mips
 # qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda 
/path/to/disk.img -m 2048
 
@@ -791,6 +810,13 @@ echo "RC COMMAND RUNNING -- SUCCESS!"
 halt -p
 EOF
 
+# If we were given exactly 5 args, go make that one image.
+
+if [ $# -eq 5 ]; then
+make_one_image $*
+exit
+fi
+
 # OK. Let the games begin
 
 for arch in amd64; do
@@ -798,15 +824,7 @@ for arch in amd64; do
for scheme in gpt mbr; do
for fs in ufs zfs; do
for bios in legacy uefi both; do
-   # Create sparse file and mount newly created filesystem(s) 
on it
-   img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
-   sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
-   echo "vv   Creating $img  
vvv"
-   rm -f ${img}*
-   eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} 
${MNTPT} ${geli} ${scheme} ${fs} ${bios}
-   eval qemu_${arch}_${bios} ${img} ${sh}
-   [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
-   echo "^^   Creating $img  
^^^"
+   make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios}
done
done
done
@@ -824,15 +842,7 @@ for arch in i386; do
for scheme in gpt mbr; do
for fs in ufs zfs; do
for bios in legacy; do
-   # Create sparse file and mount newly created filesystem(s) 
on it
-   img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
-   sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
-   echo "vv   Creating $img  
vvv"
-   rm -f ${img}*
-   eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} 
${MNTPT} ${geli} ${scheme} ${fs} ${bios}
-   eval qemu_${arch}_${bios} ${img} ${sh}
-   [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
-   echo "^^   Creating $img  
^^^"
+   make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios}
done
done
done
@@ -843,15 +853,7 @@ for arch in arm aarch64; do
 for scheme in gpt mbr; do
fs=ufs
for bios in uboot efi; do
-   # Create sparse file and mount newly created filesystem(s) on it
-   img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
-   sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
-   echo "vv   Creating $img  
vvv"
-   rm -f ${img}*
-   eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} 
${geli} ${scheme} ${fs} ${bios}
-   eval qemu_${arch}_${bios} ${img} ${sh}
-   [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
-   echo "^^   Creating $img  
^^^"
+   make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios}
done
 done
 done
@@ -860,15 +862,7 @@ for arch in powerpc powerpc64; do
 for scheme in ppc-wtf; do
fs=ufs
for bios in ofw uboot chrp; do
-   # Create sparse file and mount newly created filesystem(s) on it
-   img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
-   sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
-   echo "vv   Creating $img  
vvv"
-   rm -f ${img}*

svn commit: r335874 - head/stand/zfs

2018-07-02 Thread Alexander Motin
Author: mav
Date: Mon Jul  2 20:56:17 2018
New Revision: 335874
URL: https://svnweb.freebsd.org/changeset/base/335874

Log:
  Cut currdev dev and path fields for ZFS on the last colon.
  
  Previously the code cut those fields on second colon, that prevented
  boot from boot environments with colon in their names.  This change
  moves the limitation from dev field to path, which is empty by default.
  
  Reviewed by:  allanjude, tsoome
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D16068

Modified:
  head/stand/zfs/zfs.c

Modified: head/stand/zfs/zfs.c
==
--- head/stand/zfs/zfs.cMon Jul  2 19:48:38 2018(r335873)
+++ head/stand/zfs/zfs.cMon Jul  2 20:56:17 2018(r335874)
@@ -662,7 +662,7 @@ zfs_parsedev(struct zfs_devdesc *dev, const char *devs
if (*np != ':')
return (EINVAL);
np++;
-   end = strchr(np, ':');
+   end = strrchr(np, ':');
if (end == NULL)
return (EINVAL);
sep = strchr(np, '/');
___
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: r335873 - in head: . sys/amd64/amd64 sys/amd64/include sys/conf sys/i386/i386 sys/i386/include sys/sys sys/vm

2018-07-02 Thread Matt Macy
Author: mmacy
Date: Mon Jul  2 19:48:38 2018
New Revision: 335873
URL: https://svnweb.freebsd.org/changeset/base/335873

Log:
  inline atomics and allow tied modules to inline locks
  
  - inline atomics in modules on i386 and amd64 (they were always
inline on other arches)
  - allow modules to opt in to inlining locks by specifying
MODULE_TIED=1 in the makefile
  
  Reviewed by: kib
  Sponsored by: Limelight Networks
  Differential Revision: https://reviews.freebsd.org/D16079

Deleted:
  head/sys/amd64/amd64/atomic.c
  head/sys/i386/i386/atomic.c
Modified:
  head/UPDATING
  head/sys/amd64/include/atomic.h
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/kmod.mk
  head/sys/i386/include/atomic.h
  head/sys/sys/lock.h
  head/sys/sys/module.h
  head/sys/sys/mutex.h
  head/sys/sys/param.h
  head/sys/vm/vm_map.h
  head/sys/vm/vm_page.h

Modified: head/UPDATING
==
--- head/UPDATING   Mon Jul  2 19:33:26 2018(r335872)
+++ head/UPDATING   Mon Jul  2 19:48:38 2018(r335873)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20180702:
+   On i386 and amd64 atomics are now inlined. Out of tree modules using
+   atomics will need to be rebuilt.
+
 20180701:
The '%I' format in the kern.corefile sysctl limits the number of
core files that a process can generate to the number stored in the

Modified: head/sys/amd64/include/atomic.h
==
--- head/sys/amd64/include/atomic.h Mon Jul  2 19:33:26 2018
(r335872)
+++ head/sys/amd64/include/atomic.h Mon Jul  2 19:48:38 2018
(r335873)
@@ -96,7 +96,7 @@
  * Kernel modules call real functions which are built into the kernel.
  * This allows kernel modules to be portable between UP and SMP systems.
  */
-#if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM)
+#if !defined(__GNUCLIKE_ASM)
 #defineATOMIC_ASM(NAME, TYPE, OP, CONS, V) \
 void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
 void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Mon Jul  2 19:33:26 2018(r335872)
+++ head/sys/conf/files.amd64   Mon Jul  2 19:48:38 2018(r335873)
@@ -126,7 +126,6 @@ acpi_wakedata.h optionalacpi
\
clean   "acpi_wakedata.h"
 #
 #amd64/amd64/apic_vector.S standard
-amd64/amd64/atomic.c   standard
 amd64/amd64/bios.c standard
 amd64/amd64/bpf_jit_machdep.c  optionalbpf_jitter
 amd64/amd64/cpu_switch.S   standard

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Mon Jul  2 19:33:26 2018(r335872)
+++ head/sys/conf/files.i386Mon Jul  2 19:48:38 2018(r335873)
@@ -474,8 +474,6 @@ i386/bios/smapi.c   optional smapi
 i386/bios/smapi_bios.S optional smapi
 i386/cloudabi32/cloudabi32_sysvec.coptional compat_cloudabi32
 #i386/i386/apic_vector.s   optional apic
-i386/i386/atomic.c standard\
-   compile-with"${CC} -c ${CFLAGS} 
${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
 i386/i386/bios.c   standard
 i386/i386/bioscall.s   standard
 i386/i386/bpf_jit_machdep.coptional bpf_jitter

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Mon Jul  2 19:33:26 2018(r335872)
+++ head/sys/conf/kmod.mk   Mon Jul  2 19:48:38 2018(r335873)
@@ -111,6 +111,9 @@ WERROR?=-Werror
 CFLAGS+=   ${WERROR}
 CFLAGS+=   -D_KERNEL
 CFLAGS+=   -DKLD_MODULE
+.if defined(MODULE_TIED)
+CFLAGS+=   -DKLD_TIED
+.endif
 
 # Don't use any standard or source-relative include directories.
 NOSTDINC=  -nostdinc

Modified: head/sys/i386/include/atomic.h
==
--- head/sys/i386/include/atomic.h  Mon Jul  2 19:33:26 2018
(r335872)
+++ head/sys/i386/include/atomic.h  Mon Jul  2 19:48:38 2018
(r335873)
@@ -104,7 +104,7 @@ __mbu(void)
  * Kernel modules call real functions which are built into the kernel.
  * This allows kernel modules to be portable between UP and SMP systems.
  */
-#if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM)
+#if !defined(__GNUCLIKE_ASM)
 #defineATOMIC_ASM(NAME, TYPE, OP, CONS, V) \
 void atomic_##N

svn commit: r335872 - head/usr.sbin/nfsd

2018-07-02 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  2 19:33:26 2018
New Revision: 335872
URL: https://svnweb.freebsd.org/changeset/base/335872

Log:
  Document the "#mds_path" suffix for the "-p" command line option.
  
  r335871 added support for an optional suffix of "#mds_path" that can be
  applied to each entry in the "-p" option argument. This specifies that
  the DS should be used to store files for the file system on the MDS
  at "mds_path".
  This patch documents this optional suffix.
  
  This is a content change.

Modified:
  head/usr.sbin/nfsd/nfsd.8

Modified: head/usr.sbin/nfsd/nfsd.8
==
--- head/usr.sbin/nfsd/nfsd.8   Mon Jul  2 19:26:31 2018(r335871)
+++ head/usr.sbin/nfsd/nfsd.8   Mon Jul  2 19:33:26 2018(r335872)
@@ -28,7 +28,7 @@
 .\"@(#)nfsd.8  8.4 (Berkeley) 3/29/95
 .\" $FreeBSD$
 .\"
-.Dd May 31, 2018
+.Dd June 30, 2018
 .Dt NFSD 8
 .Os
 .Sh NAME
@@ -126,21 +126,40 @@ so the
 .Dq server hostname
 must resolve to an IPv4 address and support mounts on that address.
 This needs to be extended to support IPv6 addresses in the near future.
+This can optionally be followed by a '#' and the mds_path, which is the
+directory path for an exported file system on this MDS.
+If this is specified, it means that this DS is to be used to store data
+files for this mds_path file system only.
+If this optional component does not exist, the DS will be used to store data
+files for all exported MDS file systems.
 The DS storage file systems must be mounted on this system before the
 .Nm
 is started with this option specified.
+.br
 For example:
 .sp
 nfsv4-data0:/data0,nfsv4-data1:/data1
 .sp
-Would specify two DS servers called nfsv4-data0 and nfsv4-data1 that comprise
+would specify two DS servers called nfsv4-data0 and nfsv4-data1 that comprise
 the data storage component of the pNFS service.
+These two DSs would be used to store data files for all exported file systems
+on this MDS.
 The directories
 .Dq /data0
 and
 .Dq /data1
 are where the data storage servers exported
 storage directories are mounted on this system (which will act as the MDS).
+.br
+Whereas, for the example:
+.sp
+nfsv4-data0:/data0#/export1,nfsv4-data1:/data1#/export2
+.sp
+would specify two DSs as above, however nfsv4-data0 will be used to store
+data files for
+.Dq /export1
+and nfsv4-data1 will be used to store data files for
+.Dq /export2 .
 .El
 .It Fl m Ar mirror_level
 This option is only meaningful when used with the
@@ -155,6 +174,17 @@ The
 .Dq mirror_level
 would normally be set to 2 to enable mirroring, but
 can be as high as NFSDEV_MAXMIRRORS.
+There must be at least
+.Dq mirror_level
+DSs for each exported file system on the MDS, as specified in the
+.Fl p
+option.
+This implies that, for the above example using "#/export1" and "#/export2",
+mirroring cannot be done.
+There would need to be two DS entries for each of "#/export1" and "#/export2"
+in order to support a
+.Dq mirror_level
+of two.
 .Pp
 If mirroring is enabled, the server must use the Flexible File
 layout.
___
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: r335871 - head/usr.sbin/nfsd

2018-07-02 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  2 19:26:31 2018
New Revision: 335871
URL: https://svnweb.freebsd.org/changeset/base/335871

Log:
  Add an optional feature to the pNFS server.
  
  Without this patch, the pNFS server distributes the data storage files across
  all of the specified DSs.
  A tester noted that it would be nice if a system administrator could control
  which DSs are used to store the file data for a given exported MDS file 
system.
  This patch adds an optional suffix for each entry in the "-p" option argument
  that specifies "store file data for this MDS file system" in this DS.
  The patch should only affect sites using the pNFS server (specified via the
  "-p" command line option for nfsd.
  The interface between the nfsd and the kernel has changed with this patch,
  so anyone using the "-p" option needs to rebuild their nfsd from sources
  with this patch applied to them.
  
  Discussed with:   james.r...@framestore.com

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

Modified: head/usr.sbin/nfsd/nfsd.c
==
--- head/usr.sbin/nfsd/nfsd.c   Mon Jul  2 19:21:33 2018(r335870)
+++ head/usr.sbin/nfsd/nfsd.c   Mon Jul  2 19:26:31 2018(r335871)
@@ -1180,9 +1180,11 @@ static void
 parse_dsserver(const char *optionarg, struct nfsd_nfsd_args *nfsdargp)
 {
char *ad, *cp, *cp2, *dsaddr, *dshost, *dspath, *dsvol, nfsprt[9];
+   char *mdspath, *mdsp;
int ecode;
u_int adsiz, dsaddrcnt, dshostcnt, dspathcnt, hostsiz, pathsiz;
-   size_t dsaddrsiz, dshostsiz, dspathsiz, nfsprtsiz;
+   u_int mdspathcnt;
+   size_t dsaddrsiz, dshostsiz, dspathsiz, nfsprtsiz, mdspathsiz;
struct addrinfo hints, *ai_tcp;
struct sockaddr_in sin;
 
@@ -1206,6 +1208,11 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd
dsaddr = malloc(dsaddrsiz);
if (dsaddr == NULL)
errx(1, "Out of memory");
+   mdspathsiz = 1024;
+   mdspathcnt = 0;
+   mdspath = malloc(mdspathsiz);
+   if (mdspath == NULL)
+   errx(1, "Out of memory");
 
/* Put the NFS port# in "." form. */
snprintf(nfsprt, 9, ".%d.%d", 2049 >> 8, 2049 & 0xff);
@@ -1227,6 +1234,14 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd
usage();
*dsvol++ = '\0';
 
+   /* Optional path for MDS file system to be stored on DS. */
+   mdsp = strchr(dsvol, '#');
+   if (mdsp != NULL) {
+   if (*(mdsp + 1) == '\0' || mdsp <= dsvol)
+   usage();
+   *mdsp++ = '\0';
+   }
+
/* Append this pathname to dspath. */
pathsiz = strlen(dsvol);
if (dspathcnt + pathsiz + 1 > dspathsiz) {
@@ -1238,6 +1253,23 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd
strcpy(&dspath[dspathcnt], dsvol);
dspathcnt += pathsiz + 1;
 
+   /* Append this pathname to mdspath. */
+   if (mdsp != NULL)
+   pathsiz = strlen(mdsp);
+   else
+   pathsiz = 0;
+   if (mdspathcnt + pathsiz + 1 > mdspathsiz) {
+   mdspathsiz *= 2;
+   mdspath = realloc(mdspath, mdspathsiz);
+   if (mdspath == NULL)
+   errx(1, "Out of memory");
+   }
+   if (mdsp != NULL)
+   strcpy(&mdspath[mdspathcnt], mdsp);
+   else
+   mdspath[mdspathcnt] = '\0';
+   mdspathcnt += pathsiz + 1;
+
if (ai_tcp != NULL)
freeaddrinfo(ai_tcp);
 
@@ -1290,6 +1322,8 @@ parse_dsserver(const char *optionarg, struct nfsd_nfsd
nfsdargp->dnshostlen = dshostcnt;
nfsdargp->dspath = dspath;
nfsdargp->dspathlen = dspathcnt;
+   nfsdargp->mdspath = mdspath;
+   nfsdargp->mdspathlen = mdspathcnt;
freeaddrinfo(ai_tcp);
 }
 
___
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: r335870 - in head/sys/fs: nfs nfsserver

2018-07-02 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  2 19:21:33 2018
New Revision: 335870
URL: https://svnweb.freebsd.org/changeset/base/335870

Log:
  Add an optional feature to the pNFS server.
  
  Without this patch, the pNFS server distributes the data storage files across
  all of the specified DSs.
  A tester noted that it would be nice if a system administrator could control
  which DSs are used to store the file data for a given exported MDS file 
system.
  This patch adds the kernel support to do this. It also makes a slight semantic
  change to nfsv4_findmirror(), since some uses of it no longer require that
  the DS being searched for have a current mirror.
  A patch that will be committed in a few minutes will modify the nfsd daemon
  to support this feature.
  The patch should only affect sites using the pNFS server (specified via the
  "-p" command line option for nfsd.
  
  Suggested by: james.r...@framestore.com

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfsrvstate.h
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Mon Jul  2 18:23:43 2018(r335869)
+++ head/sys/fs/nfs/nfs.h   Mon Jul  2 19:21:33 2018(r335870)
@@ -185,6 +185,8 @@ struct nfsd_nfsd_args {
int dnshostlen; /* Length of DNS names */
char*dspath;/* DS Mount path on MDS */
int dspathlen;  /* Length of DS Mount path on MDS */
+   char*mdspath;   /* MDS mount for DS path on MDS */
+   int mdspathlen; /* Length of MDS mount for DS path on MDS */
int mirrorcnt;  /* Number of mirrors to create on DSs */
 };
 

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cMon Jul  2 18:23:43 2018
(r335869)
+++ head/sys/fs/nfs/nfs_commonsubs.cMon Jul  2 19:21:33 2018
(r335870)
@@ -4692,37 +4692,26 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot)
 }
 
 /*
- * Search for a matching pnfsd mirror device structure, base on the nmp arg.
+ * Search for a matching pnfsd DS, based on the nmp arg.
  * Return one if found, NULL otherwise.
  */
 struct nfsdevice *
 nfsv4_findmirror(struct nfsmount *nmp)
 {
-   struct nfsdevice *ds, *fndds;
-   int fndmirror;
+   struct nfsdevice *ds;
 
mtx_assert(NFSDDSMUTEXPTR, MA_OWNED);
/*
 * Search the DS server list for a match with nmp.
-* Remove the DS entry if found and there is a mirror.
 */
-   fndds = NULL;
-   fndmirror = 0;
if (nfsrv_devidcnt == 0)
-   return (fndds);
+   return (NULL);
TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) {
if (ds->nfsdev_nmp == nmp) {
-   NFSCL_DEBUG(4, "fnd main ds\n");
-   fndds = ds;
-   } else if (ds->nfsdev_nmp != NULL)
-   fndmirror = 1;
-   if (fndds != NULL && fndmirror != 0)
+   NFSCL_DEBUG(4, "nfsv4_findmirror: fnd main ds\n");
break;
+   }
}
-   if (fndmirror == 0) {
-   NFSCL_DEBUG(4, "no mirror for DS\n");
-   return (NULL);
-   }
-   return (fndds);
+   return (ds);
 }
 

Modified: head/sys/fs/nfs/nfsrvstate.h
==
--- head/sys/fs/nfs/nfsrvstate.hMon Jul  2 18:23:43 2018
(r335869)
+++ head/sys/fs/nfs/nfsrvstate.hMon Jul  2 19:21:33 2018
(r335870)
@@ -345,9 +345,11 @@ struct nfsdevice {
uint16_tnfsdev_hostnamelen;
uint16_tnfsdev_fileaddrlen;
uint16_tnfsdev_flexaddrlen;
+   uint16_tnfsdev_mdsisset;
char*nfsdev_fileaddr;
char*nfsdev_flexaddr;
char*nfsdev_host;
+   fsid_t  nfsdev_mdsfsid;
uint32_tnfsdev_nextdir;
vnode_t nfsdev_dsdir[0];
 };

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon Jul  2 18:23:43 2018
(r335869)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon Jul  2 19:21:33 2018
(r335870)
@@ -3355,6 +3355,10 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap
nfsdarg.addrlen = 0;
nfsdarg.dnshost = NULL;
nfsdarg.dnshostlen = 0;
+   nfsdarg.dspath = NULL;
+   nfsdarg.dspathlen = 0;
+

Re: svn commit: r335836 - head/usr.bin/top

2018-07-02 Thread Warner Losh
Sato-san

Sorry for the top post, but your message would make an excellent intro to
i18n in one of our developer guides.

Warner

On Mon, Jul 2, 2018, 11:13 AM Hiroki Sato  wrote:

> 後藤大地  wrote
>   in <459bd898-8072-426e-a968-96c1382ac...@icloud.com>:
>
> da>
> da>
> da> > 2018/07/02 15:55、Hiroki Sato のメール:
> da> >
> da> > Eitan Adler  wrote
> da> >  in  n9zjwejh+di800k...@mail.gmail.com>:
> da> >
> da> > li> On 1 July 2018 at 10:08, Conrad Meyer  wrote:
> da> > li> > Hi Daichi,
> da> > li> >
> da> > li> >
> da> > li> >
> da> > li> > I don't think code to decode UTF-8 belongs in top(1).  I don't
> know
> da> > li> > what the goal of this routine is, but I doubt this is the
> right way to
> da> > li> > accomplish it.
> da> > li>
> da> > li> For the record, I agree. This is why I didn't click "accept" on
> the
> da> > li> revision. I don't fully oppose leaving it in top(1) for now as
> we work
> da> > li> out the API, but long term its the wrong place.
> da> > li>
> da> > li> https://reviews.freebsd.org/D16058 is the review.
> da> >
> da> > I strongly object this kind of encoding-specific routine.  Please
> da> > back out it.  The problem is that top(1) does not support multibyte
> da> > encoding in functions for printing, and using C99 wide/multibyte
> da> > character manipulation API such as iswprint(3) is the way to solve
> da> > it.  Doing getenv("LANG") and assuming an encoding based on it is a
> da> > very bad practice to internationalize software.
> da> >
> da> > -- Hiroki
> da>
> da> I respect what you mean.
> da>
> da> Once I back out, I will begin implementing it in a different way.
> da> Please advise which function should be used for implementation
> da> (iswprint (3) and what other functions should be used?)
>
>  Roughly speaking, POSIX/XPG/C99 I18N model requires the following
>  steps:
>
>  1. Call setlocale(LC_ALL, "") first.
>
>  2. Use mbs<->wcs and/or mb<->wc conversion functions in C95/C99 to
> manipulate characters and strings depending on what you want to
> do.  The printable() function should use mbtowc(3) and
> iswprint(3), for example.  And wcslen(3) should be used to
> determine the length of characters to be printed instead of
> strlen().
>
> Note that if mbs->wcs or mb->wc conversion fails with EILSEQ at
> some point, some of the character(s) are invalid for printing.
> This can happen because command-line parameters in top(1) are not
> always encoded in one specified in LC_CTYPE or LANG.  It should
> also be handled as non-printable.  However, to make matters worse,
> each process does not always use a single, same locale as top(1).
> A process invoked with LANG=ja_JP.eucJP may have EUC-JP characters
> in its ARGV array even if top(1) runs by another user whose LANG
> is en_US.UTF-8.  You have to determine which locale should be used
> before doing mb->wc conversion.  It is not so simple.
>
>  3. Print the multibyte characters by using strvisx(3) family, which
> supports multibyte character, or swprintf(3) family if you want to
> format wide characters directly.  Note that buffer length for
> strvisx(3) must be calculated by using MB_LEN_MAX.
>
>  I recommend you to learn about I18N by reading the following
>  documents since this involves an I18N programming model, not just a
>  matter of which function should be used.  While they are quite old
>  and contain system-specific topics, they are still useful to
>  understand general overview of how XPG4 and the relevant C95/C99 APIs
>  work:
>
>  [1] Developer's Guide to Internationalization (801-6660)
>  https://docs.oracle.com/cd/E19457-01/801-6660/801-6660.pdf
>
>  [2] Software Internationalization Guide (526225-002)
>
> https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c02131936
>
>  [3] ISO/IEC 9899:TC2 draft (p.204, Sec. 7.11 Localization)
>  http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
>
>  [4] Internationalization Guide, Version 2
>  ISBN: 978-0133535419
>
> -- Hiroki
>
___
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: r335869 - head/stand/uboot/common

2018-07-02 Thread Emmanuel Vadot
Author: manu
Date: Mon Jul  2 18:23:43 2018
New Revision: 335869
URL: https://svnweb.freebsd.org/changeset/base/335869

Log:
  stand: uboot: Do not panic if we can't find a boot device
  
  It is really anoying to panic when there is no boot device as you
  cannot see the availables ones.

Modified:
  head/stand/uboot/common/main.c

Modified: head/stand/uboot/common/main.c
==
--- head/stand/uboot/common/main.c  Mon Jul  2 18:19:08 2018
(r335868)
+++ head/stand/uboot/common/main.c  Mon Jul  2 18:23:43 2018
(r335869)
@@ -444,8 +444,10 @@ main(int argc, char **argv)
/*
 * Enumerate U-Boot devices
 */
-   if ((devs_no = ub_dev_enum()) == 0)
-   panic("no U-Boot devices found");
+   if ((devs_no = ub_dev_enum()) == 0) {
+   printf("no U-Boot devices found");
+   goto do_interact;
+   }
printf("Number of U-Boot devices: %d\n", devs_no);
 
get_load_device(&load_type, &load_unit, &load_slice, &load_partition);
@@ -492,6 +494,7 @@ main(int argc, char **argv)
env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
printf("Booting from %s\n", ldev);
 
+do_interact:
setenv("LINES", "24", 1);   /* optional */
setenv("prompt", "loader>", 1);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335868 - head/stand/common

2018-07-02 Thread Allan Jude
Author: allanjude
Date: Mon Jul  2 18:19:08 2018
New Revision: 335868
URL: https://svnweb.freebsd.org/changeset/base/335868

Log:
  stand/common/disk.c: Read partition table relative to the start of the disk
  
  If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh,
  when disk_open() is called on a GELI encrypted partition, attempts to read
  the partition table fail, as they pass through the decryption process which
  turns the already plaintext data into jibberish.
  
  When reading the partition table, always pass a slice and partition setting
  of -1, and an offset of 0. Setting the slice to -1 prevents a false
  positive when checking the slice against the cache of GELI encrypted
  slices.
  
  Reviewed by:  imp, ian
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15847

Modified:
  head/stand/common/disk.c

Modified: head/stand/common/disk.c
==
--- head/stand/common/disk.cMon Jul  2 17:54:33 2018(r335867)
+++ head/stand/common/disk.cMon Jul  2 18:19:08 2018(r335868)
@@ -219,20 +219,13 @@ disk_ioctl(struct disk_devdesc *dev, u_long cmd, void 
 int
 disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize)
 {
+   struct disk_devdesc partdev;
struct open_disk *od;
struct ptable *table;
struct ptable_entry part;
int rc, slice, partition;
 
rc = 0;
-   /*
-* While we are reading disk metadata, make sure we do it relative
-* to the start of the disk
-*/
-   dev->d_offset = 0;
-   table = NULL;
-   slice = dev->d_slice;
-   partition = dev->d_partition;
od = (struct open_disk *)malloc(sizeof(struct open_disk));
if (od == NULL) {
DEBUG("no memory");
@@ -242,11 +235,24 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
od->entrysize = 0;
od->mediasize = mediasize;
od->sectorsize = sectorsize;
+   /*
+* While we are reading disk metadata, make sure we do it relative
+* to the start of the disk
+*/
+   memcpy(&partdev, dev, sizeof(partdev));
+   partdev.d_offset = 0;
+   partdev.d_slice = -1;
+   partdev.d_partition = -1;
+
+   table = NULL;
+   slice = dev->d_slice;
+   partition = dev->d_partition;
+
DEBUG("%s unit %d, slice %d, partition %d => %p",
disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, 
od);
 
/* Determine disk layout. */
-   od->table = ptable_open(dev, mediasize / sectorsize, sectorsize,
+   od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize,
ptblread);
if (od->table == NULL) {
DEBUG("Can't read partition table");
___
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: r335866 - head/sys/rpc

2018-07-02 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  2 17:50:46 2018
New Revision: 335866
URL: https://svnweb.freebsd.org/changeset/base/335866

Log:
  Fix the server side krpc so that the kernel nfsd threads terminate.
  
  Occationally the kernel nfsd threads would not terminate when a SIGKILL
  was posted for the kernel process (called nfsd (slave)). When this occurred,
  the thread associated with the process (called "ismaster") had returned from
  svc_run_internal() and was sleeping waiting for the other threads to 
terminate.
  The other threads (created by kthread_start()) were still in 
svc_run_internal()
  handling NFS RPCs.
  The only way this could occur is for the "ismaster" thread to return from
  svc_run_internal() without having called svc_exit().
  There was only one place in the code where this could happen and this patch
  stops that from happening.
  Since the problem is intermittent, I cannot be sure if this has fixed the
  problem, but I have not seen an occurrence of the problem with this patch
  applied.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D16087

Modified:
  head/sys/rpc/svc.c

Modified: head/sys/rpc/svc.c
==
--- head/sys/rpc/svc.c  Mon Jul  2 17:18:46 2018(r335865)
+++ head/sys/rpc/svc.c  Mon Jul  2 17:50:46 2018(r335866)
@@ -1185,7 +1185,8 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster)
/*
 * Enforce maxthreads count.
 */
-   if (grp->sg_threadcount > grp->sg_maxthreads)
+   if (!ismaster && grp->sg_threadcount >
+   grp->sg_maxthreads)
break;
 
/*
___
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: r335865 - head/sys/vm

2018-07-02 Thread Alan Cox
Author: alc
Date: Mon Jul  2 17:18:46 2018
New Revision: 335865
URL: https://svnweb.freebsd.org/changeset/base/335865

Log:
  Introduce vm_phys_enq_range(), and call it in vm_phys_alloc_npages()
  and vm_phys_alloc_seg_contig() instead of vm_phys_free_contig().  In
  short, vm_phys_enq_range() is simpler and faster than the more general
  vm_phys_free_contig(), and in the case of vm_phys_alloc_seg_contig(),
  vm_phys_free_contig() was placing the excess physical pages at the
  wrong end of the queues.
  
  In collaboration with:Doug Moore 

Modified:
  head/sys/vm/vm_phys.c

Modified: head/sys/vm/vm_phys.c
==
--- head/sys/vm/vm_phys.c   Mon Jul  2 14:15:30 2018(r335864)
+++ head/sys/vm/vm_phys.c   Mon Jul  2 17:18:46 2018(r335865)
@@ -605,6 +605,43 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_f
 }
 
 /*
+ * Add the physical pages [m, m + npages) at the end of a power-of-two aligned
+ * and sized set to the specified free list.
+ *
+ * When this function is called by a page allocation function, the caller
+ * should request insertion at the head unless the lower-order queues are
+ * known to be empty.  The objective being to reduce the likelihood of long-
+ * term fragmentation by promoting contemporaneous allocation and (hopefully)
+ * deallocation.
+ *
+ * The physical page m's buddy must not be free.
+ */
+static void
+vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail)
+{
+   u_int n;
+   int order;
+
+   KASSERT(npages > 0, ("vm_phys_enq_range: npages is 0"));
+   KASSERT(((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) &
+   ((PAGE_SIZE << (fls(npages) - 1)) - 1)) == 0,
+   ("vm_phys_enq_range: page %p and npages %u are misaligned",
+   m, npages));
+   do {
+   KASSERT(m->order == VM_NFREEORDER,
+   ("vm_phys_enq_range: page %p has unexpected order %d",
+   m, m->order));
+   order = ffs(npages) - 1;
+   KASSERT(order < VM_NFREEORDER,
+   ("vm_phys_enq_range: order %d is out of range", order));
+   vm_freelist_add(fl, m, order, tail);
+   n = 1 << order;
+   m += n;
+   npages -= n;
+   } while (npages > 0);
+}
+
+/*
  * Tries to allocate the specified number of pages from the specified pool
  * within the specified domain.  Returns the actual number of allocated pages
  * and a pointer to each page through the array ma[].
@@ -644,7 +681,12 @@ vm_phys_alloc_npages(int domain, int pool, int npages,
for (end = i + need; i < end;)
ma[i++] = m++;
if (need < avail) {
-   vm_phys_free_contig(m, avail - need);
+   /*
+* Return excess pages to fl.  Its
+* order [0, oind) queues are empty.
+*/
+   vm_phys_enq_range(m, avail - need, fl,
+   1);
return (npages);
} else if (i == npages)
return (npages);
@@ -662,8 +704,13 @@ vm_phys_alloc_npages(int domain, int pool, int npages,
for (end = i + need; i < end;)
ma[i++] = m++;
if (need < avail) {
-   vm_phys_free_contig(m, avail -
-   need);
+   /*
+* Return excess pages to fl.
+* Its order [0, oind) queues
+* are empty.
+*/
+   vm_phys_enq_range(m, avail -
+   need, fl, 1);
return (npages);
} else if (i == npages)
return (npages);
@@ -1303,8 +1350,10 @@ done:
}
/* Return excess pages to the free lists. */
npages_end = roundup2(npages, 1 << oind);
-   if (npages < npages_end)
-   vm_phys_free_contig(&m_ret[npages], npages_end - npages);
+   if (npages < npages_end) {
+   fl = (*seg->free_queues)[VM_FREEPOOL_DEFAULT];
+   vm_phys_enq_range(&m_ret[npages], npages_end - npages, fl, 0);
+   }
return (m_ret);
 }
 
___

Re: svn commit: r335836 - head/usr.bin/top

2018-07-02 Thread Hiroki Sato
後藤大地  wrote
  in <459bd898-8072-426e-a968-96c1382ac...@icloud.com>:

da>
da>
da> > 2018/07/02 15:55、Hiroki Sato のメール:
da> >
da> > Eitan Adler  wrote
da> >  in :
da> >
da> > li> On 1 July 2018 at 10:08, Conrad Meyer  wrote:
da> > li> > Hi Daichi,
da> > li> >
da> > li> >
da> > li> >
da> > li> > I don't think code to decode UTF-8 belongs in top(1).  I don't know
da> > li> > what the goal of this routine is, but I doubt this is the right way 
to
da> > li> > accomplish it.
da> > li>
da> > li> For the record, I agree. This is why I didn't click "accept" on the
da> > li> revision. I don't fully oppose leaving it in top(1) for now as we work
da> > li> out the API, but long term its the wrong place.
da> > li>
da> > li> https://reviews.freebsd.org/D16058 is the review.
da> >
da> > I strongly object this kind of encoding-specific routine.  Please
da> > back out it.  The problem is that top(1) does not support multibyte
da> > encoding in functions for printing, and using C99 wide/multibyte
da> > character manipulation API such as iswprint(3) is the way to solve
da> > it.  Doing getenv("LANG") and assuming an encoding based on it is a
da> > very bad practice to internationalize software.
da> >
da> > -- Hiroki
da>
da> I respect what you mean.
da>
da> Once I back out, I will begin implementing it in a different way.
da> Please advise which function should be used for implementation
da> (iswprint (3) and what other functions should be used?)

 Roughly speaking, POSIX/XPG/C99 I18N model requires the following
 steps:

 1. Call setlocale(LC_ALL, "") first.

 2. Use mbs<->wcs and/or mb<->wc conversion functions in C95/C99 to
manipulate characters and strings depending on what you want to
do.  The printable() function should use mbtowc(3) and
iswprint(3), for example.  And wcslen(3) should be used to
determine the length of characters to be printed instead of
strlen().

Note that if mbs->wcs or mb->wc conversion fails with EILSEQ at
some point, some of the character(s) are invalid for printing.
This can happen because command-line parameters in top(1) are not
always encoded in one specified in LC_CTYPE or LANG.  It should
also be handled as non-printable.  However, to make matters worse,
each process does not always use a single, same locale as top(1).
A process invoked with LANG=ja_JP.eucJP may have EUC-JP characters
in its ARGV array even if top(1) runs by another user whose LANG
is en_US.UTF-8.  You have to determine which locale should be used
before doing mb->wc conversion.  It is not so simple.

 3. Print the multibyte characters by using strvisx(3) family, which
supports multibyte character, or swprintf(3) family if you want to
format wide characters directly.  Note that buffer length for
strvisx(3) must be calculated by using MB_LEN_MAX.

 I recommend you to learn about I18N by reading the following
 documents since this involves an I18N programming model, not just a
 matter of which function should be used.  While they are quite old
 and contain system-specific topics, they are still useful to
 understand general overview of how XPG4 and the relevant C95/C99 APIs
 work:

 [1] Developer's Guide to Internationalization (801-6660)
 https://docs.oracle.com/cd/E19457-01/801-6660/801-6660.pdf

 [2] Software Internationalization Guide (526225-002)
 https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c02131936

 [3] ISO/IEC 9899:TC2 draft (p.204, Sec. 7.11 Localization)
 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

 [4] Internationalization Guide, Version 2
 ISBN: 978-0133535419

-- Hiroki


pgp745pt5lXy_.pgp
Description: PGP signature


Re: svn commit: r335856 - in head/sys: netinet sys

2018-07-02 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland <
> steven.hartl...@multiplay.co.uk> wrote:
> >
> > You have M_WAITOK and a null check in this change
> 
> And, that's the same as the way it was before his commits. So, he did
> exactly what he said he was doing and reverted his commits. I don't think
> it is good practice to mix reverts with other changes.

It is a very bad practive to mix a revert with anything.

> Since you've noticed this, I think you should feel free to make the change.
> Jonathan

-- 
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: r335856 - in head/sys: netinet sys

2018-07-02 Thread Cy Schubert
In message 
, "Jonathan T. Looney" writes:
> On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland <
> steven.hartl...@multiplay.co.uk> wrote:
> >
> > You have M_WAITOK and a null check in this change
>
> And, that's the same as the way it was before his commits. So, he did
> exactly what he said he was doing and reverted his commits. I don't think
> it is good practice to mix reverts with other changes.

Yes, mixing reverts with other changes or batching changes together in 
one commit confuses history. This is my main criticism of Linux commit 
logs, IMO the worst example of commit log content. There they itemize a 
shopping list of changes or simply say, pull fixes for X from 
so-and-so, the patch passes our tests.

Five years from now or even a year from now, will anyone remember?

>
> Since you've noticed this, I think you should feel free to make the change.
>
> Jonathan


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

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


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


Re: svn commit: r335856 - in head/sys: netinet sys

2018-07-02 Thread Jonathan T. Looney
On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland <
steven.hartl...@multiplay.co.uk> wrote:
>
> You have M_WAITOK and a null check in this change

And, that's the same as the way it was before his commits. So, he did
exactly what he said he was doing and reverted his commits. I don't think
it is good practice to mix reverts with other changes.

Since you've noticed this, I think you should feel free to make the change.

Jonathan
___
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: r335856 - in head/sys: netinet sys

2018-07-02 Thread Steven Hartland
You have M_WAITOK and a null check in this change

On Mon, 2 Jul 2018 at 06:20, Matt Macy  wrote:

> Author: mmacy
> Date: Mon Jul  2 05:19:44 2018
> New Revision: 335856
> URL: https://svnweb.freebsd.org/changeset/base/335856
>
> Log:
>   inpcb: don't gratuitously defer frees
>
>   Don't defer frees in sysctl handlers. It isn't necessary
>   and it just confuses things.
>   revert: r333911, r334104, and r334125
>
>   Requested by: jtl
>
> Modified:
>   head/sys/netinet/ip_divert.c
>   head/sys/netinet/raw_ip.c
>   head/sys/netinet/tcp_subr.c
>   head/sys/netinet/udp_usrreq.c
>   head/sys/sys/malloc.h
>
> Modified: head/sys/netinet/ip_divert.c
>
> ==
> --- head/sys/netinet/ip_divert.cMon Jul  2 01:30:33 2018
> (r335855)
> +++ head/sys/netinet/ip_divert.cMon Jul  2 05:19:44 2018
> (r335856)
> @@ -552,7 +552,6 @@ div_detach(struct socket *so)
> KASSERT(inp != NULL, ("div_detach: inp == NULL"));
> INP_INFO_WLOCK(&V_divcbinfo);
> INP_WLOCK(inp);
> -   /* XXX defer destruction to epoch_call */
> in_pcbdetach(inp);
> in_pcbfree(inp);
> INP_INFO_WUNLOCK(&V_divcbinfo);
> @@ -632,7 +631,6 @@ static int
>  div_pcblist(SYSCTL_HANDLER_ARGS)
>  {
> int error, i, n;
> -   struct in_pcblist *il;
> struct inpcb *inp, **inp_list;
> inp_gen_t gencnt;
> struct xinpgen xig;
> @@ -672,8 +670,9 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
> if (error)
> return error;
>
> -   il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb
> *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS);
> -   inp_list = il->il_inp_list;
> +   inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
> +   if (inp_list == NULL)
> +   return ENOMEM;
>
> INP_INFO_RLOCK(&V_divcbinfo);
> for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp &&
> i < n;
> @@ -702,9 +701,14 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
> } else
> INP_RUNLOCK(inp);
> }
> -   il->il_count = n;
> -   il->il_pcbinfo = &V_divcbinfo;
> -   epoch_call(net_epoch_preempt, &il->il_epoch_ctx,
> in_pcblist_rele_rlocked);
> +   INP_INFO_WLOCK(&V_divcbinfo);
> +   for (i = 0; i < n; i++) {
> +   inp = inp_list[i];
> +   INP_RLOCK(inp);
> +   if (!in_pcbrele_rlocked(inp))
> +   INP_RUNLOCK(inp);
> +   }
> +   INP_INFO_WUNLOCK(&V_divcbinfo);
>
> if (!error) {
> /*
> @@ -721,6 +725,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
> INP_INFO_RUNLOCK(&V_divcbinfo);
> error = SYSCTL_OUT(req, &xig, sizeof xig);
> }
> +   free(inp_list, M_TEMP);
> return error;
>  }
>
> @@ -800,7 +805,6 @@ div_modevent(module_t mod, int type, void *unused)
> break;
> }
> ip_divert_ptr = NULL;
> -   /* XXX defer to epoch_call ? */
> err = pf_proto_unregister(PF_INET, IPPROTO_DIVERT,
> SOCK_RAW);
> INP_INFO_WUNLOCK(&V_divcbinfo);
>  #ifndef VIMAGE
>
> Modified: head/sys/netinet/raw_ip.c
>
> ==
> --- head/sys/netinet/raw_ip.c   Mon Jul  2 01:30:33 2018(r335855)
> +++ head/sys/netinet/raw_ip.c   Mon Jul  2 05:19:44 2018(r335856)
> @@ -863,7 +863,6 @@ rip_detach(struct socket *so)
> ip_rsvp_force_done(so);
> if (so == V_ip_rsvpd)
> ip_rsvp_done();
> -   /* XXX defer to epoch_call */
> in_pcbdetach(inp);
> in_pcbfree(inp);
> INP_INFO_WUNLOCK(&V_ripcbinfo);
> @@ -1033,7 +1032,6 @@ static int
>  rip_pcblist(SYSCTL_HANDLER_ARGS)
>  {
> int error, i, n;
> -   struct in_pcblist *il;
> struct inpcb *inp, **inp_list;
> inp_gen_t gencnt;
> struct xinpgen xig;
> @@ -1068,8 +1066,9 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
> if (error)
> return (error);
>
> -   il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb
> *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS);
> -   inp_list = il->il_inp_list;
> +   inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
> +   if (inp_list == NULL)
> +   return (ENOMEM);
>
> INP_INFO_RLOCK(&V_ripcbinfo);
> for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp &&
> i < n;
> @@ -1098,9 +1097,14 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
> } else
> INP_RUNLOCK(inp);
> }
> -   il->il_count = n;
> -   il->il_pcbinfo = &V_ripcbinfo;
> -   epoch_call(net_epoch_preempt, &il->il_epoch_ctx,
> in_pcblist_rele_rlocked);
> +   INP_INFO_WLOCK(&V_ripcbinfo);
> +   for (i = 0; i < n; i++) {
> +   inp = inp_list[i];
> +   INP_RLOCK(

svn commit: r335864 - head/sys/dev/acpica

2018-07-02 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jul  2 14:15:30 2018
New Revision: 335864
URL: https://svnweb.freebsd.org/changeset/base/335864

Log:
  Change the group and the permissions on /dev/acpi, to make "acpiconf"
  work when called by members of the 'operator' group. They are already
  allowed to eg power off the system (via suid shutdown(8)), so they
  might as well be permitted to suspend it.
  
  Tested by:xmj@
  Reviewed by:  delphij@
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D16062

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Jul  2 13:08:27 2018(r335863)
+++ head/sys/dev/acpica/acpi.c  Mon Jul  2 14:15:30 2018(r335864)
@@ -667,7 +667,7 @@ acpi_attach(device_t dev)
 sc->acpi_sleep_disabled = TRUE;
 
 /* Create the control device */
-sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0644,
+sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0664,
  "acpi");
 sc->acpi_dev_t->si_drv1 = sc;
 
___
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: r335862 - head/usr.sbin/syslogd

2018-07-02 Thread Ed Schouten
Author: ed
Date: Mon Jul  2 11:02:27 2018
New Revision: 335862
URL: https://svnweb.freebsd.org/changeset/base/335862

Log:
  Document that syslogd -v has no effect when RFC 5424 mode is enabled.
  
  The variable it sets, LogFacPri, is only used in the RFC 3164 formatting
  codepath.
  
  PR:   229457
  Reported by:  Andre Albsmeier
  MFC after:1 week

Modified:
  head/usr.sbin/syslogd/syslogd.8

Modified: head/usr.sbin/syslogd/syslogd.8
==
--- head/usr.sbin/syslogd/syslogd.8 Mon Jul  2 10:57:22 2018
(r335861)
+++ head/usr.sbin/syslogd/syslogd.8 Mon Jul  2 11:02:27 2018
(r335862)
@@ -28,7 +28,7 @@
 .\" @(#)syslogd.8  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd April 15, 2018
+.Dd July 2, 2018
 .Dt SYSLOGD 8
 .Os
 .Sh NAME
@@ -348,6 +348,10 @@ logged with each locally-written message.
 If specified more than once,
 the names of the facility and priority are logged with each locally-written
 message.
+.Pp
+This option only affects the formatting of RFC 3164 messages.
+Messages formatted according to RFC 5424 always include a
+facility/priority number.
 .El
 .Pp
 The
___
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: r335861 - head/usr.sbin/syslogd

2018-07-02 Thread Ed Schouten
Author: ed
Date: Mon Jul  2 10:57:22 2018
New Revision: 335861
URL: https://svnweb.freebsd.org/changeset/base/335861

Log:
  Restore the order in which RFC 3164 messages with fac/pri are formatted.
  
  The refactoring of the syslogd code to format messages using iovecs
  slightly altered the output of syslogd by placing the facility/priority
  after the hostname, as opposed to printing it right before. This change
  reverts the behaviour to be consistent with how it was before.
  
  PR:   229457
  Reported by:  Andre Albsmeier
  MFC after:1 week

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

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Mon Jul  2 09:14:00 2018
(r335860)
+++ head/usr.sbin/syslogd/syslogd.c Mon Jul  2 10:57:22 2018
(r335861)
@@ -1873,8 +1873,6 @@ fprintlog_rfc3164(struct filed *f, const char *hostnam
/* Message written to files. */
iovlist_append(&il, timebuf);
iovlist_append(&il, " ");
-   iovlist_append(&il, hostname);
-   iovlist_append(&il, " ");
 
if (LogFacPri) {
iovlist_append(&il, "<");
@@ -1918,6 +1916,9 @@ fprintlog_rfc3164(struct filed *f, const char *hostnam
 
iovlist_append(&il, "> ");
}
+
+   iovlist_append(&il, hostname);
+   iovlist_append(&il, " ");
break;
}
 
___
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: r335836 - head/usr.bin/top

2018-07-02 Thread 後藤大地


> 2018/07/02 2:08、Conrad Meyer のメール:
> 
> Hi Daichi,
> 
> On Sat, Jun 30, 2018 at 10:32 PM, Daichi GOTO  wrote:
>> Author: daichi
>> Date: Sun Jul  1 05:32:03 2018
>> New Revision: 335836
>> URL: https://svnweb.freebsd.org/changeset/base/335836
>> 
>> Log:
>>  top(1) - support UTF-8 display
>> 
>> ...
>> ==
>> --- head/usr.bin/top/display.c  Sun Jul  1 01:56:40 2018(r335835)
>> +++ head/usr.bin/top/display.c  Sun Jul  1 05:32:03 2018(r335836)
>> @@ -1258,19 +1258,43 @@ line_update(char *old, char *new, int start, int 
>> line)
>> char *
>> printable(char str[])
>> {
>> -char *ptr;
>> -char ch;
>> +   char *ptr;
>> +   char ch;
>> 
>> -ptr = str;
>> -while ((ch = *ptr) != '\0')
>> -{
>> -   if (!isprint(ch))
>> -   {
>> -   *ptr = '?';
>> +   ptr = str;
>> +   if (utf8flag) {
>> +   while ((ch = *ptr) != '\0') {
>> +   if (0x00 == (0x80 & ch)) {
>> +   if (!isprint(ch)) {
>> +   *ptr = '?';
>> +   }
>> +   ++ptr;
>> +   } else if (0xC0 == (0xE0 & ch)) {
>> +   ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   } else if (0xE0 == (0xF0 & ch)) {
>> +   ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   } else if (0xF0 == (0xF8 & ch)) {
>> +   ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   if ('\0' != *ptr) ++ptr;
>> +   } else {
>> +   *ptr = '?';
>> +   ++ptr;
>> +   }
>> +   }
>> +   } else {
>> +   while ((ch = *ptr) != '\0') {
>> +   if (!isprint(ch)) {
>> +   *ptr = '?';
>> +   }
>> +   ptr++;
>> +   }
>>}
> 
> 
> I don't think code to decode UTF-8 belongs in top(1).  I don't know
> what the goal of this routine is, but I doubt this is the right way to
> accomplish it.
> 
> For the strvisx portion it seems like support should be rolled into
> libc instead.

Hi Conrad,

The purpose is to display UTF-8 string. Certainly, you are right. 
In the end I think I should support it with libc. However, I think that 
it is a problem that UTF-8 can not be used with the top command for a long 
period of time. Although it may be transient, I think that keeping it to 
work is not that bad idea.

Best regards,
Daichi

> (Also, the patch in phabricator does not seem to match what was committed.)
> 
> Best,
> Conrad
> 

___
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: r335860 - head/sbin/kldstat

2018-07-02 Thread Michael Tuexen
Author: tuexen
Date: Mon Jul  2 09:14:00 2018
New Revision: 335860
URL: https://svnweb.freebsd.org/changeset/base/335860

Log:
  Allow three digits of module id without breaking table alignment.

Modified:
  head/sbin/kldstat/kldstat.c

Modified: head/sbin/kldstat/kldstat.c
==
--- head/sbin/kldstat/kldstat.c Mon Jul  2 09:11:30 2018(r335859)
+++ head/sbin/kldstat/kldstat.c Mon Jul  2 09:14:00 2018(r335860)
@@ -55,10 +55,10 @@ printmod(int modid)
warn("can't stat module id %d", modid);
 else
if (showdata) {
-   printf("\t\t%2d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, 
+   printf("\t\t%3d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, 
stat.data.intval, stat.data.uintval, stat.data.ulongval);
} else {
-   printf("\t\t%2d %s\n", stat.id, stat.name);
+   printf("\t\t%3d %s\n", stat.id, stat.name);
}
 }
 
@@ -90,7 +90,7 @@ printfile(int fileid, int verbose, int humanized)
 if (verbose) {
printf(" (%s)\n", stat.pathname);
printf("\tContains modules:\n");
-   printf("\t\tId Name\n");
+   printf("\t\t Id Name\n");
for (modid = kldfirstmod(fileid); modid > 0;
 modid = modfnext(modid))
printmod(modid);
___
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: r335859 - head/sbin/kldstat

2018-07-02 Thread Michael Tuexen
Author: tuexen
Date: Mon Jul  2 09:11:30 2018
New Revision: 335859
URL: https://svnweb.freebsd.org/changeset/base/335859

Log:
  Keep table aligned when address pointer is not of max length.

Modified:
  head/sbin/kldstat/kldstat.c

Modified: head/sbin/kldstat/kldstat.c
==
--- head/sbin/kldstat/kldstat.c Mon Jul  2 09:09:07 2018(r335858)
+++ head/sbin/kldstat/kldstat.c Mon Jul  2 09:11:30 2018(r335859)
@@ -77,11 +77,13 @@ printfile(int fileid, int verbose, int humanized)
humanize_number(buf, sizeof(buf), stat.size,
"", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE);
 
-   printf("%2d %4d %p %5s %s",
-   stat.id, stat.refs, stat.address, buf, stat.name);
+   printf("%2d %4d %*p %5s %s",
+   stat.id, stat.refs, POINTER_WIDTH, stat.address, buf,
+   stat.name);
} else {
-   printf("%2d %4d %p %8zx %s",
-   stat.id, stat.refs, stat.address, stat.size, stat.name);
+   printf("%2d %4d %*p %8zx %s",
+   stat.id, stat.refs, POINTER_WIDTH, stat.address, stat.size,
+   stat.name);
}
 }
 
___
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: r335858 - head/sbin/kldstat

2018-07-02 Thread Michael Tuexen
Author: tuexen
Date: Mon Jul  2 09:09:07 2018
New Revision: 335858
URL: https://svnweb.freebsd.org/changeset/base/335858

Log:
  Improve consistency of indentation. Whitespace change only.

Modified:
  head/sbin/kldstat/kldstat.c

Modified: head/sbin/kldstat/kldstat.c
==
--- head/sbin/kldstat/kldstat.c Mon Jul  2 07:58:57 2018(r335857)
+++ head/sbin/kldstat/kldstat.c Mon Jul  2 09:09:07 2018(r335858)
@@ -74,11 +74,11 @@ printfile(int fileid, int verbose, int humanized)
err(1, "can't stat file id %d", fileid);
 } else {
if (humanized) {
-  humanize_number(buf, sizeof(buf), stat.size,
-  "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE);
+   humanize_number(buf, sizeof(buf), stat.size,
+   "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE);
 
-  printf("%2d %4d %p %5s %s",
-  stat.id, stat.refs, stat.address, buf, stat.name);
+   printf("%2d %4d %p %5s %s",
+   stat.id, stat.refs, stat.address, buf, stat.name);
} else {
printf("%2d %4d %p %8zx %s",
stat.id, stat.refs, stat.address, stat.size, stat.name);
___
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: r335836 - head/usr.bin/top

2018-07-02 Thread 後藤大地


> 2018/07/02 15:55、Hiroki Sato のメール:
> 
> Eitan Adler  wrote
>  in :
> 
> li> On 1 July 2018 at 10:08, Conrad Meyer  wrote:
> li> > Hi Daichi,
> li> >
> li> >
> li> >
> li> > I don't think code to decode UTF-8 belongs in top(1).  I don't know
> li> > what the goal of this routine is, but I doubt this is the right way to
> li> > accomplish it.
> li>
> li> For the record, I agree. This is why I didn't click "accept" on the
> li> revision. I don't fully oppose leaving it in top(1) for now as we work
> li> out the API, but long term its the wrong place.
> li>
> li> https://reviews.freebsd.org/D16058 is the review.
> 
> I strongly object this kind of encoding-specific routine.  Please
> back out it.  The problem is that top(1) does not support multibyte
> encoding in functions for printing, and using C99 wide/multibyte
> character manipulation API such as iswprint(3) is the way to solve
> it.  Doing getenv("LANG") and assuming an encoding based on it is a
> very bad practice to internationalize software.
> 
> -- Hiroki

I respect what you mean.

Once I back out, I will begin implementing it in a different way.
Please advise which function should be used for implementation
(iswprint (3) and what other functions should be used?)

Best regards,
Daichi
___
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"