svn commit: r319490 - in head: . lib/libc/sys

2017-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  2 03:53:34 2017
New Revision: 319490
URL: https://svnweb.freebsd.org/changeset/base/319490

Log:
  Remove stale cap_rights_get(2) manpage.
  
  The documentation moved to section 3 several years ago, but
  'man cap_rights_get' pulls up cap_rights_limit(2) (which is
  MLINKed to cap_rights_get.2) instead of cap_rights_get(3).
  
  MFC after:1 week

Modified:
  head/ObsoleteFiles.inc
  head/lib/libc/sys/Makefile.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Jun  2 03:25:59 2017(r319489)
+++ head/ObsoleteFiles.inc  Fri Jun  2 03:53:34 2017(r319490)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170601: remove stale manpage
+OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz
 # 20170601: old libifconfig and libifc
 OLD_FILES+=usr/lib/libifc.a
 OLD_FILES+=usr/lib/libifc_p.a

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Fri Jun  2 03:25:59 2017
(r319489)
+++ head/lib/libc/sys/Makefile.inc  Fri Jun  2 03:53:34 2017
(r319490)
@@ -350,7 +350,6 @@ MLINKS+=brk.2 sbrk.2
 MLINKS+=cap_enter.2 cap_getmode.2
 MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
 MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
-MLINKS+=cap_rights_limit.2 cap_rights_get.2
 MLINKS+=chdir.2 fchdir.2
 MLINKS+=chflags.2 chflagsat.2 \
chflags.2 fchflags.2 \
___
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: r319489 - head/usr.bin/diff

2017-06-01 Thread John Baldwin
Author: jhb
Date: Fri Jun  2 03:25:59 2017
New Revision: 319489
URL: https://svnweb.freebsd.org/changeset/base/319489

Log:
  Add -H as an alias for --speed-large-file to match GNU diff.
  
  This is undocumented to match GNU diff where -H is also undocumented.
  Some existing software (such as kompare) uses this option by default.
  
  Reviewed by:  emaste, rpokala
  Differential Revision:https://reviews.freebsd.org/D11022

Modified:
  head/usr.bin/diff/diff.c

Modified: head/usr.bin/diff/diff.c
==
--- head/usr.bin/diff/diff.cFri Jun  2 02:37:17 2017(r319488)
+++ head/usr.bin/diff/diff.cFri Jun  2 03:25:59 2017(r319489)
@@ -46,7 +46,7 @@ struct stat stb1, stb2;
 struct excludes *excludes_list;
 regex_t ignore_re;
 
-#defineOPTIONS "0123456789aBbC:cdD:efhI:iL:lnNPpqrS:sTtU:uwX:x:"
+#defineOPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwX:x:"
 enum {
OPT_TSIZE = CHAR_MAX + 1,
OPT_STRIPCR,
@@ -54,7 +54,6 @@ enum {
OPT_NO_IGN_FN_CASE,
OPT_NORMAL,
OPT_HORIZON_LINES,
-   OPT_SPEED_LARGE_FILES,
OPT_CHANGED_GROUP_FORMAT,
 };
 
@@ -66,6 +65,7 @@ static struct option longopts[] = {
{ "minimal",no_argument,0,  'd' },
{ "ed", no_argument,0,  'e' },
{ "forward-ed", no_argument,0,  'f' },
+   { "speed-large-files",  no_argument,NULL,   'H' },
{ "ignore-matching-lines",  required_argument,  0,  'I' },
{ "ignore-case",no_argument,0,  'i' },
{ "paginate",   no_argument,NULL,   'l' },
@@ -88,7 +88,6 @@ static struct option longopts[] = {
{ "horizon-lines",  required_argument,  NULL,   
OPT_HORIZON_LINES },
{ "no-ignore-file-name-case",   no_argument,NULL,   
OPT_NO_IGN_FN_CASE },
{ "normal", no_argument,NULL,   
OPT_NORMAL },
-   { "speed-large-files",  no_argument,NULL,   
OPT_SPEED_LARGE_FILES},
{ "strip-trailing-cr",  no_argument,NULL,   
OPT_STRIPCR },
{ "tabsize",optional_argument,  NULL,   
OPT_TSIZE },
{ "changed-group-format",   required_argument,  NULL,   
OPT_CHANGED_GROUP_FORMAT},
@@ -159,6 +158,9 @@ main(int argc, char **argv)
case 'f':
diff_format = D_REVERSE;
break;
+   case 'H':
+   /* ignore but needed for compatibility with GNU diff */
+   break;
case 'h':
/* silently ignore for backwards compatibility */
break;
@@ -252,8 +254,6 @@ main(int argc, char **argv)
usage();
}
break;
-   case OPT_SPEED_LARGE_FILES:
-   break; /* ignore but needed for compatibility with GNU 
diff */
case OPT_STRIPCR:
dflags |= D_STRIPCR;
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: r319488 - head/usr.sbin/bhyve

2017-06-01 Thread Marcelo Araujo
Author: araujo
Date: Fri Jun  2 02:37:17 2017
New Revision: 319488
URL: https://svnweb.freebsd.org/changeset/base/319488

Log:
  Bump manpage date.

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

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Fri Jun  2 02:35:16 2017(r319487)
+++ head/usr.sbin/bhyve/bhyve.8 Fri Jun  2 02:37:17 2017(r319488)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 22, 2017
+.Dd June 2, 2017
 .Dt BHYVE 8
 .Os
 .Sh 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: r319487 - head/usr.sbin/bhyve

2017-06-01 Thread Marcelo Araujo
Author: araujo
Date: Fri Jun  2 02:35:16 2017
New Revision: 319487
URL: https://svnweb.freebsd.org/changeset/base/319487

Log:
  Add VNC Authentication support based on RFC6143 section 7.2.2.
  
  Submitted by: Fabian Freyer 
  Reworked by:  myself
  Reviewed by:  grehan, rgrimes and jilles
  MFC after:1 week.
  Relnotes: Yes.
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D10818

Modified:
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/pci_fbuf.c
  head/usr.sbin/bhyve/rfb.c
  head/usr.sbin/bhyve/rfb.h

Modified: head/usr.sbin/bhyve/Makefile
==
--- head/usr.sbin/bhyve/MakefileFri Jun  2 01:00:40 2017
(r319486)
+++ head/usr.sbin/bhyve/MakefileFri Jun  2 02:35:16 2017
(r319487)
@@ -2,6 +2,8 @@
 # $FreeBSD$
 #
 
+.include 
+
 PROG=  bhyve
 PACKAGE=   bhyve
 
@@ -62,6 +64,12 @@ SRCS=\
 SRCS+= vmm_instruction_emul.c
 
 LIBADD=vmmapi md pthread z
+
+.if ${MK_OPENSSL} == "no"
+CFLAGS+=-DNO_OPENSSL
+.else
+LIBADD+=   crypto
+.endif
 
 CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000
 CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Fri Jun  2 01:00:40 2017(r319486)
+++ head/usr.sbin/bhyve/bhyve.8 Fri Jun  2 02:35:16 2017(r319487)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 3, 2017
+.Dd May 22, 2017
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -309,7 +309,7 @@ Emergency write is advertised, but no-op at present.
 .Pp
 Framebuffer devices:
 .Bl -tag -width 10n
-.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= 
Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc
+.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= 
Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= 
Ns Ar password Oc
 .Bl -tag -width 8n
 .It Ar IP:port
 An
@@ -368,6 +368,11 @@ Instruct
 to only boot upon the initiation of a VNC connection, simplifying the 
installation
 of operating systems that require immediate keyboard input.
 This can be removed for post-installation use.
+.It password
+This type of authentication is known to be cryptographically weak and is not
+intended for use on untrusted networks.
+Many implementations will want to use stronger security, such as running
+the session over an encrypted channel provided by IPsec or SSH.
 .El
 .El
 .Pp

Modified: head/usr.sbin/bhyve/pci_fbuf.c
==
--- head/usr.sbin/bhyve/pci_fbuf.c  Fri Jun  2 01:00:40 2017
(r319486)
+++ head/usr.sbin/bhyve/pci_fbuf.c  Fri Jun  2 02:35:16 2017
(r319487)
@@ -93,6 +93,7 @@ struct pci_fbuf_softc {
 
/* rfb server */
char  *rfb_host;
+   char  *rfb_password;
int   rfb_port;
int   rfb_wait;
int   vga_enabled;
@@ -285,7 +286,8 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o
goto done;
} else if (sc->memregs.height == 0)
sc->memregs.height = 1080;
-
+   } else if (!strcmp(xopts, "password")) {
+   sc->rfb_password = config;
} else {
pci_fbuf_usage(xopts);
ret = -1;
@@ -407,7 +409,7 @@ pci_fbuf_init(struct vmctx *ctx, struct pci_devinst *p
 
memset((void *)sc->fb_base, 0, FB_SIZE);
 
-   error = rfb_init(sc->rfb_host, sc->rfb_port, sc->rfb_wait);
+   error = rfb_init(sc->rfb_host, sc->rfb_port, sc->rfb_wait, 
sc->rfb_password);
 done:
if (error)
free(sc);

Modified: head/usr.sbin/bhyve/rfb.c
==
--- head/usr.sbin/bhyve/rfb.c   Fri Jun  2 01:00:40 2017(r319486)
+++ head/usr.sbin/bhyve/rfb.c   Fri Jun  2 02:35:16 2017(r319487)
@@ -60,10 +60,23 @@ __FBSDID("$FreeBSD$");
 #include "rfb.h"
 #include "sockstream.h"
 
+#ifndef NO_OPENSSL
+#include 
+#endif
+
 static int rfb_debug = 0;
 #defineDPRINTF(params) if (rfb_debug) printf params
 #defineWPRINTF(params) printf params
 
+#define AUTH_LENGTH16
+#define PASSWD_LENGTH  8
+
+#define SECURITY_TYPE_NONE 1
+#define SECURITY_TYPE_VNC_AUTH 2
+
+#define AUTH_FAILED_UNAUTH 1
+#define AUTH_FAILED_ERROR 2
+
 struct rfb_softc {
int sfd;
pthread_t   tid;
@@ -72,10 +85,12 @@ struct rfb_softc {
 
int width, height;
 
-   boolenc_raw_ok;
-   boolenc_zlib_ok;
-   boolenc_resize_ok;
+   char*password;
 
+   boolenc_raw_ok;
+   bool

Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390

2017-06-01 Thread Pedro Giffuni

Hi;

On 06/01/17 19:51, Bryan Drewery wrote:
...


Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targmatch.h
Skipping meta for .depend: no commands
Skipping meta for afterdepend: .PHONY
Skipping meta for depend: .PHONY
Skipping meta for objwarn: .PHONY
Skipping meta for beforebuild: .PHONY
Skipping meta for .WAIT_1: .PHONY
/usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o.meta: 81: file 
'/usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/./targmatch.h' is newer 
than the target...
Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targets.o

targets.o is the only relevant object file I could find in the broken
objtree given to me that was post-ino64.  It doesn't directly use any of
the changes structs that I can see, but the mixed-ABI proof is enough
for me to put the understanding of this to rest.

In case I wasn't clear, this commit is perfectly fine.  It just
triggered a META_MODE bug.


Thanks for the research.

Adding new platform support in a toolchain that is dying is indeed an 
unusual change. I won't do it again ;).


Pedro.

___
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: r319485 - head

2017-06-01 Thread Bryan Drewery
Author: bdrewery
Date: Fri Jun  2 00:57:59 2017
New Revision: 319485
URL: https://svnweb.freebsd.org/changeset/base/319485

Log:
  native-xtools: Connect lld.
  
  This will ensure that aarch64 gets a working native /usr/bin/ld rather
  than requiring the aarch64-binutils hack in Poudriere, or emulating
  the aarch64 lld.
  
  PR:   217189
  Reported by:  swills, jbeich

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Jun  2 00:29:23 2017(r319484)
+++ head/Makefile.inc1  Fri Jun  2 00:57:59 2017(r319485)
@@ -2019,6 +2019,7 @@ native-xtools: .PHONY
 ${_gcc_tools} \
 ${_clang_libs} \
 ${_clang} \
+${_lld} \
 sbin/md5 \
 sbin/sysctl \
 usr.bin/diff \
___
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: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390

2017-06-01 Thread Bryan Drewery
On 6/1/2017 5:18 PM, Bryan Drewery wrote:
> On 5/23/2017 12:00 PM, O. Hartmann wrote:
>> Am Tue, 23 May 2017 12:52:35 -0500
>> Pedro Giffuni  schrieb:
>>
>>> On 23/05/2017 12:12, O. Hartmann wrote:
 Am Tue, 23 May 2017 16:38:10 + (UTC)
 "Pedro F. Giffuni"  schrieb:
  
> Author: pfg
> Date: Tue May 23 16:38:10 2017
> New Revision: 318750
> URL: https://svnweb.freebsd.org/changeset/base/318750
>
> Log:
>Bring some rough support for FreeBSD S/390 to the GNU toolchain.
>
>This is no-op and only for reference: the S/390 port seems to be 
> elusive
>in the BSDs so it is convenient to keep some trace from past efforts.
>It is likely newer attempts will focus on a newer toolchain using clang
>instead.
>
>Obtained from: Perforce depot/projects/s390
>
> Added:
>head/contrib/binutils/ld/emulparams/elf64_s390_fbsd.sh   (contents, 
> props changed)
>head/contrib/binutils/ld/emulparams/elf_s390_fbsd.sh   (contents, 
> props changed)
>head/contrib/gcc/config/s390/freebsd.h
>   - copied, changed from r318546, head/contrib/gcc/config/s390/linux.h
> Modified:
>head/contrib/binutils/bfd/config.bfd
>head/contrib/binutils/ld/configure.tgt
>head/contrib/gcc/config.gcc  
>>> ...
> Buildworld fails on r318751 with a "Segmentation fault" error as shown 
> below:
>
> Building /usr/obj/usr/src/lib/libkiconv/_libinstall
> --- lib/libmd__L ---
> --- skein_block_asm.o ---
> Segmentation fault
> *** [skein_block_asm.o] Error code 139
>
> make[4]: stopped in /usr/src/lib/libmd
> .ERROR_TARGET='skein_block_asm.o'
> .ERROR_META_FILE='/usr/obj/usr/src/lib/libmd/skein_block_asm.o.meta'
> .MAKE.LEVEL='4'
> MAKEFILE=''
>
>
> Host is running recent CURRENT: FreeBSD 12.0-CURRENT #124 r318748: Tue 
> May 23
> 18:52:59 CEST 2017 amd64  
>>>
>>> It shouldn't be related to this change:
>>>
>>> 1) This only affects s390 configuration which is never activated
>>> 2) I did run a tinderbox build to make sure nothing was affected (the 
>>> only thing failing was an unrelated powerpc warning that was fixed).
>>>
>>> Pedro.
>>
>> Hello,
>>
>> the problem could be resolved by deleting the /usr/obj folder and start a 
>> clean build
>> again.
>>
> 
> I think this is fallout from ino64 combined with META_MODE.  META_MODE
> assumes that host tools will be ABI-compatible and generally does not
> [force] rebuild them very often.  So the act of upgrading to ino64 host
> and then doing another build, your ld and various other host tools will
> still be running pre-ino64 binaries via COMPAT_FREEBSD11.  I think the
> bug in this system is that it is possible for some of these tools to get
> mixed-ABI objects linked together resulting in differing ideas of what
> 'struct stat' is for example.  This could be possible since META_MODE
> won't force rebuild all objects for a directory/tool but it may rebuild
> 1 object for some reason or just relink the resulting binary.
> 
> Here's an example of what I'm talking about with the host ld object files:
> 
>> -rwxr-xr-x   1 root  wheel  1857312 Jun  1 12:59 ld.bfd* 
>> -rwxr-xr-x   1 root  wheel   931304 Jun  1 12:59 ld.bfd.debug*   
>> -rw-r--r--   1 root  wheel  978 Jun  1 12:59 ld.bfd.debug.meta   
>> -rwxr-xr-x   1 root  wheel  2600311 Jun  1 12:59 ld.bfd.full*
>> -rw-r--r--   1 root  wheel 3988 Jun  1 12:59 ld.bfd.full.meta
>> -rw-r--r--   1 root  wheel  999 Jun  1 12:59 ld.bfd.meta 
>> -rw-r--r--   1 root  wheel   154400 Apr 18 16:12 ldcref.o
>> -rw-r--r--   1 root  wheel 4553 Apr 18 16:12 ldcref.o.meta   
>> -rw-r--r--   1 root  wheel   137088 May 11 14:14 ldctor.o
>> -rw-r--r--   1 root  wheel 4348 May 11 14:14 ldctor.o.meta   
>> -rw-r--r--   1 root  wheel  205 Oct 11  2016 ldemul-list.h   
>> -rw-r--r--   1 root  wheel  814 Oct 11  2016 ldemul-list.h.meta  
>> -rw-r--r--   1 root  wheel   144088 Oct 13  2016 ldemul.o
>> -rw-r--r--   1 root  wheel 4374 Oct 13  2016 ldemul.o.meta   
> 
> The object files predate ino64 but the linked binaries do not.  I did
> not dig into these object files more but I suspect somewhere there are
> mixed-ABI object files hitting this bug or that just linking pre-ino64
> objects may cause a problem.  I don't think linking would be a problem
> though.

This commit did cause a mixed-ABI object issue that I predicted.

Built before, updated, built again and targets.o is rebuilt.

> Building /usr/obj/root/svn/base/gnu/usr.bin/binutils/libbfd/targmatch.h
> Skipping meta for .depend: no commands
> Skipping meta for afterdepend: .PHONY
> Skipping meta for depend: .PHONY
> Skipping meta for objwarn: .PHONY
> Skipping meta for beforebuild: .PHONY
> Skipping meta for .WAIT_1: .PHONY
> 

Re: svn commit: r318750 - in head/contrib: binutils/bfd binutils/ld binutils/ld/emulparams gcc gcc/config/s390

2017-06-01 Thread Bryan Drewery
On 5/23/2017 12:00 PM, O. Hartmann wrote:
> Am Tue, 23 May 2017 12:52:35 -0500
> Pedro Giffuni  schrieb:
> 
>> On 23/05/2017 12:12, O. Hartmann wrote:
>>> Am Tue, 23 May 2017 16:38:10 + (UTC)
>>> "Pedro F. Giffuni"  schrieb:
>>>  
 Author: pfg
 Date: Tue May 23 16:38:10 2017
 New Revision: 318750
 URL: https://svnweb.freebsd.org/changeset/base/318750

 Log:
Bring some rough support for FreeBSD S/390 to the GNU toolchain.

This is no-op and only for reference: the S/390 port seems to be elusive
in the BSDs so it is convenient to keep some trace from past efforts.
It is likely newer attempts will focus on a newer toolchain using clang
instead.

Obtained from:  Perforce depot/projects/s390

 Added:
head/contrib/binutils/ld/emulparams/elf64_s390_fbsd.sh   (contents, 
 props changed)
head/contrib/binutils/ld/emulparams/elf_s390_fbsd.sh   (contents, props 
 changed)
head/contrib/gcc/config/s390/freebsd.h
   - copied, changed from r318546, head/contrib/gcc/config/s390/linux.h
 Modified:
head/contrib/binutils/bfd/config.bfd
head/contrib/binutils/ld/configure.tgt
head/contrib/gcc/config.gcc  
>> ...
 Buildworld fails on r318751 with a "Segmentation fault" error as shown 
 below:

 Building /usr/obj/usr/src/lib/libkiconv/_libinstall
 --- lib/libmd__L ---
 --- skein_block_asm.o ---
 Segmentation fault
 *** [skein_block_asm.o] Error code 139

 make[4]: stopped in /usr/src/lib/libmd
 .ERROR_TARGET='skein_block_asm.o'
 .ERROR_META_FILE='/usr/obj/usr/src/lib/libmd/skein_block_asm.o.meta'
 .MAKE.LEVEL='4'
 MAKEFILE=''


 Host is running recent CURRENT: FreeBSD 12.0-CURRENT #124 r318748: Tue May 
 23
 18:52:59 CEST 2017 amd64  
>>
>> It shouldn't be related to this change:
>>
>> 1) This only affects s390 configuration which is never activated
>> 2) I did run a tinderbox build to make sure nothing was affected (the 
>> only thing failing was an unrelated powerpc warning that was fixed).
>>
>> Pedro.
> 
> Hello,
> 
> the problem could be resolved by deleting the /usr/obj folder and start a 
> clean build
> again.
> 

I think this is fallout from ino64 combined with META_MODE.  META_MODE
assumes that host tools will be ABI-compatible and generally does not
[force] rebuild them very often.  So the act of upgrading to ino64 host
and then doing another build, your ld and various other host tools will
still be running pre-ino64 binaries via COMPAT_FREEBSD11.  I think the
bug in this system is that it is possible for some of these tools to get
mixed-ABI objects linked together resulting in differing ideas of what
'struct stat' is for example.  This could be possible since META_MODE
won't force rebuild all objects for a directory/tool but it may rebuild
1 object for some reason or just relink the resulting binary.

Here's an example of what I'm talking about with the host ld object files:

> -rwxr-xr-x   1 root  wheel  1857312 Jun  1 12:59 ld.bfd* 
> -rwxr-xr-x   1 root  wheel   931304 Jun  1 12:59 ld.bfd.debug*   
> -rw-r--r--   1 root  wheel  978 Jun  1 12:59 ld.bfd.debug.meta   
> -rwxr-xr-x   1 root  wheel  2600311 Jun  1 12:59 ld.bfd.full*
> -rw-r--r--   1 root  wheel 3988 Jun  1 12:59 ld.bfd.full.meta
> -rw-r--r--   1 root  wheel  999 Jun  1 12:59 ld.bfd.meta 
> -rw-r--r--   1 root  wheel   154400 Apr 18 16:12 ldcref.o
> -rw-r--r--   1 root  wheel 4553 Apr 18 16:12 ldcref.o.meta   
> -rw-r--r--   1 root  wheel   137088 May 11 14:14 ldctor.o
> -rw-r--r--   1 root  wheel 4348 May 11 14:14 ldctor.o.meta   
> -rw-r--r--   1 root  wheel  205 Oct 11  2016 ldemul-list.h   
> -rw-r--r--   1 root  wheel  814 Oct 11  2016 ldemul-list.h.meta  
> -rw-r--r--   1 root  wheel   144088 Oct 13  2016 ldemul.o
> -rw-r--r--   1 root  wheel 4374 Oct 13  2016 ldemul.o.meta   

The object files predate ino64 but the linked binaries do not.  I did
not dig into these object files more but I suspect somewhere there are
mixed-ABI object files hitting this bug or that just linking pre-ino64
objects may cause a problem.  I don't think linking would be a problem
though.

Anyway the fix for this would be to either 'make cleanworld' after
upgrading to ino64, use -DNO_META_IGNORE_HOST for the first build after,
or wait for my fix.  I will commit a fix to force rebuild host tools
through known major ABI changes to avoid this problem.

For discussion of why META_MODE tries to not rebuild host tools see
r301467.  The gist is that a simple
'buildworld->installworld->buildworld' causes everything to rebuild due
to changed host file timestamps.  Really it would be better if
filemon/META_MODE used file content hashing like ccache did.  Then
timestamps wouldn't cause such 

svn commit: r319481 - head/share/mk

2017-06-01 Thread Bryan Drewery
Author: bdrewery
Date: Thu Jun  1 23:04:44 2017
New Revision: 319481
URL: https://svnweb.freebsd.org/changeset/base/319481

Log:
  META_MODE: Move ignoring of /usr/local/etc/libmap.d to proper place.
  
  This was added in r318194 but local.meta.sys.mk is only used for
  DIRDEPS_BUILD.

Modified:
  head/share/mk/local.meta.sys.mk
  head/share/mk/sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Thu Jun  1 22:59:41 2017
(r319480)
+++ head/share/mk/local.meta.sys.mk Thu Jun  1 23:04:44 2017
(r319481)
@@ -283,6 +283,3 @@ META_MODE+= missing-meta=yes
 .if empty(META_MODE:Mnofilemon)
 META_MODE+=missing-filemon=yes
 .endif
-# We do not want everything out-of-date just because
-# some unrelated shared lib updated this.
-.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkThu Jun  1 22:59:41 2017(r319480)
+++ head/share/mk/sys.mkThu Jun  1 23:04:44 2017(r319481)
@@ -91,7 +91,11 @@ META_MODE?= normal
/usr/share \
 
 .endif
-
+.if !empty(.MAKE.MODE:Mmeta)
+# We do not want everything out-of-date just because
+# some unrelated shared lib updated this.
+.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d
+.endif
 
 .if ${MK_AUTO_OBJ} == "yes"
 # This needs to be done early - before .PATH is computed
___
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: r319477 - in head: etc/rc.d usr.sbin/crashinfo

2017-06-01 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Jun  1 21:23:04 2017
New Revision: 319477
URL: https://svnweb.freebsd.org/changeset/base/319477

Log:
  crashinfo: add "batch" mode and use it during boot
  
  In batch mode, most messages go into the core.txt.N file instead of stdout.
  
  Reviewed by:  jhb
  MFC after:3 days
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D10429

Modified:
  head/etc/rc.d/savecore
  head/usr.sbin/crashinfo/crashinfo.8
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/etc/rc.d/savecore
==
--- head/etc/rc.d/savecore  Thu Jun  1 21:20:44 2017(r319476)
+++ head/etc/rc.d/savecore  Thu Jun  1 21:23:04 2017(r319477)
@@ -70,7 +70,7 @@ savecore_start()
if savecore -C "${dev}" >/dev/null; then
savecore ${savecore_flags} ${dumpdir} ${dumpdev}
if checkyesno crashinfo_enable; then
-   ${crashinfo_program} -d ${dumpdir}
+   ${crashinfo_program} -b -d ${dumpdir}
fi
sync
else

Modified: head/usr.sbin/crashinfo/crashinfo.8
==
--- head/usr.sbin/crashinfo/crashinfo.8 Thu Jun  1 21:20:44 2017
(r319476)
+++ head/usr.sbin/crashinfo/crashinfo.8 Thu Jun  1 21:23:04 2017
(r319477)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 28, 2008
+.Dd April 19, 2017
 .Dt CRASHINFO 8
 .Os
 .Sh NAME
@@ -88,6 +88,12 @@ and
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl b
+Run in batch mode.  Write most messages to the
+.Pa core.txt.XX
+file instead of the terminal.  This flag is used when
+.Nm
+is run during boot.
 .It Fl d Ar crashdir
 Specify an alternate core dump directory.
 The default crash dump directory is

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shThu Jun  1 21:20:44 2017
(r319476)
+++ head/usr.sbin/crashinfo/crashinfo.shThu Jun  1 21:23:04 2017
(r319477)
@@ -31,7 +31,8 @@
 
 usage()
 {
-   echo "usage: crashinfo [-d crashdir] [-n dumpnr] [-k kernel] [core]"
+   echo "usage: crashinfo [-b] [-d crashdir] [-n dumpnr]" \
+   "[-k kernel] [core]"
exit 1
 }
 
@@ -93,12 +94,16 @@ find_kernel()
done
 }
 
+BATCH=false
 CRASHDIR=/var/crash
 DUMPNR=
 KERNEL=
 
-while getopts "d:n:k:" opt; do
+while getopts "bd:n:k:" opt; do
case "$opt" in
+   b)
+   BATCH=true
+   ;;
d)
CRASHDIR=$OPTARG
;;
@@ -153,6 +158,11 @@ INFO=$CRASHDIR/info.$DUMPNR
 FILE=$CRASHDIR/core.txt.$DUMPNR
 HOSTNAME=`hostname`
 
+if $BATCH; then
+   echo "Writing crash summary to $FILE."
+   exec > $FILE 2>&1
+fi
+
 find_gdb
 if [ -z "$GDB" ]; then
echo "Unable to find a kernel debugger."
@@ -181,8 +191,6 @@ elif [ ! -e $KERNEL ]; then
exit 1
 fi
 
-echo "Writing crash summary to $FILE."
-
 umask 077
 
 # Simulate uname
@@ -191,7 +199,10 @@ osrelease=$(gdb_command $KERNEL 'printf "%s", osreleas
 version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' '  ')
 machine=$(gdb_command $KERNEL 'printf "%s", machine')
 
-exec > $FILE 2>&1
+if ! $BATCH; then
+   echo "Writing crash summary to $FILE."
+   exec > $FILE 2>&1
+fi
 
 echo "$HOSTNAME dumped core - see $VMCORE"
 echo
___
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: r319476 - in head/sys/dev/rtwn: rtl8192c rtl8812a

2017-06-01 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jun  1 21:20:44 2017
New Revision: 319476
URL: https://svnweb.freebsd.org/changeset/base/319476

Log:
  rtwn: drop obsolete (since r319460) code.
  
  Tested with RTL8188EU, STA mode.

Modified:
  head/sys/dev/rtwn/rtl8192c/r92c_tx.c
  head/sys/dev/rtwn/rtl8812a/r12a_tx.c

Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx.c
==
--- head/sys/dev/rtwn/rtl8192c/r92c_tx.cThu Jun  1 21:07:32 2017
(r319475)
+++ head/sys/dev/rtwn/rtl8192c/r92c_tx.cThu Jun  1 21:20:44 2017
(r319476)
@@ -331,8 +331,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80
 
if (m->m_flags & M_AMPDU_MPDU) {
seqno = ni->ni_txseqs[tid];
-   /* NB: clear Fragment Number field. */
-   *(uint16_t *)wh->i_seq = 0;
ni->ni_txseqs[tid]++;
} else
seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE;

Modified: head/sys/dev/rtwn/rtl8812a/r12a_tx.c
==
--- head/sys/dev/rtwn/rtl8812a/r12a_tx.cThu Jun  1 21:07:32 2017
(r319475)
+++ head/sys/dev/rtwn/rtl8812a/r12a_tx.cThu Jun  1 21:20:44 2017
(r319476)
@@ -338,8 +338,6 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80
 
if (m->m_flags & M_AMPDU_MPDU) {
seqno = ni->ni_txseqs[tid];
-   /* NB: clear Fragment Number field. */
-   *(uint16_t *)wh->i_seq = 0;
ni->ni_txseqs[tid]++;
} else
seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE;
___
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: r319475 - head/tools/tools/crypto

2017-06-01 Thread John Baldwin
Author: jhb
Date: Thu Jun  1 21:07:32 2017
New Revision: 319475
URL: https://svnweb.freebsd.org/changeset/base/319475

Log:
  Fix some new errors and a warning in cryptotest.
  
  - Use a new 'char *key' to allocate storage for keys and assign the
pointer to the session2_op 'const char *' members after the key is
initialized.
  - Mark the 'find' variable used in crfind() static so that crfind()
doesn't return a pointer to stack garbage.
  
  Reported by:  olivier (1)
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==
--- head/tools/tools/crypto/cryptotest.cThu Jun  1 21:07:25 2017
(r319474)
+++ head/tools/tools/crypto/cryptotest.cThu Jun  1 21:07:32 2017
(r319475)
@@ -216,7 +216,7 @@ crlookup(const char *devname)
 const char *
 crfind(int crid)
 {
-   struct crypt_find_op find;
+   static struct crypt_find_op find;
 
bzero(, sizeof(find));
find.crid = crid;
@@ -252,7 +252,7 @@ runtest(struct alg *alg, int count, int size, u_long c
 {
int i, fd = crget();
struct timeval start, stop, dt;
-   char *cleartext, *ciphertext, *originaltext;
+   char *cleartext, *ciphertext, *originaltext, *key;
struct session2_op sop;
struct crypt_op cop;
char iv[EALG_MAX_BLOCK_LEN];
@@ -260,19 +260,21 @@ runtest(struct alg *alg, int count, int size, u_long c
bzero(, sizeof(sop));
if (!alg->ishash) {
sop.keylen = (alg->minkeylen + alg->maxkeylen)/2;
-   sop.key = (char *) malloc(sop.keylen);
-   if (sop.key == NULL)
+   key = (char *) malloc(sop.keylen);
+   if (key == NULL)
err(1, "malloc (key)");
for (i = 0; i < sop.keylen; i++)
-   sop.key[i] = rdigit();
+   key[i] = rdigit();
+   sop.key = key;
sop.cipher = alg->code;
} else {
sop.mackeylen = (alg->minkeylen + alg->maxkeylen)/2;
-   sop.mackey = (char *) malloc(sop.mackeylen);
-   if (sop.mackey == NULL)
+   key = (char *) malloc(sop.mackeylen);
+   if (key == NULL)
err(1, "malloc (mac)");
for (i = 0; i < sop.mackeylen; i++)
-   sop.mackey[i] = rdigit();
+   key[i] = rdigit();
+   sop.mackey = key;
sop.mac = alg->code;
}
sop.crid = crid;
___
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: r319474 - head/share/man/man9

2017-06-01 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Jun  1 21:07:25 2017
New Revision: 319474
URL: https://svnweb.freebsd.org/changeset/base/319474

Log:
  getenv(9): rename to "kern_getenv", etc.
  
  Update the documentation to catch up with r273174, which renamed
getenv -> kern_getenv
setenv -> kern_setenv
  unsetenv -> kern_unsetenv
  
  Leave the old links in place to support finger memory.
  
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/getenv.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileThu Jun  1 21:05:56 2017
(r319473)
+++ head/share/man/man9/MakefileThu Jun  1 21:07:25 2017
(r319474)
@@ -857,6 +857,9 @@ MLINKS+=getenv.9 freeenv.9 \
getenv.9 getenv_quad.9 \
getenv.9 getenv_uint.9 \
getenv.9 getenv_ulong.9 \
+   getenv.9 kern_getenv.9 \
+   getenv.9 kern_setenv.9 \
+   getenv.9 kern_unsetenv.9 \
getenv.9 setenv.9 \
getenv.9 testenv.9 \
getenv.9 unsetenv.9

Modified: head/share/man/man9/getenv.9
==
--- head/share/man/man9/getenv.9Thu Jun  1 21:05:56 2017
(r319473)
+++ head/share/man/man9/getenv.9Thu Jun  1 21:07:25 2017
(r319474)
@@ -27,21 +27,21 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 22, 2015
+.Dd June 1, 2017
 .Dt GETENV 9
 .Os
 .Sh NAME
 .Nm freeenv ,
-.Nm getenv ,
+.Nm kern_getenv ,
 .Nm getenv_int ,
 .Nm getenv_long ,
 .Nm getenv_string ,
 .Nm getenv_quad ,
 .Nm getenv_uint ,
 .Nm getenv_ulong ,
-.Nm setenv ,
+.Nm kern_setenv ,
 .Nm testenv ,
-.Nm unsetenv
+.Nm kern_unsetenv
 .Nd kernel environment variable functions
 .Sh SYNOPSIS
 .In sys/param.h
@@ -49,7 +49,7 @@
 .Ft void
 .Fn freeenv "char *env"
 .Ft char *
-.Fn getenv "const char *name"
+.Fn kern_getenv "const char *name"
 .Ft int
 .Fn getenv_int "const char *name" "int *data"
 .Ft int
@@ -63,41 +63,41 @@
 .Ft int
 .Fn getenv_ulong "const char *name" "unsigned long *data"
 .Ft int
-.Fn setenv "const char *name" "const char *value"
+.Fn kern_setenv "const char *name" "const char *value"
 .Ft int
 .Fn testenv "const char *name"
 .Ft int
-.Fn unsetenv "const char *name"
+.Fn kern_unsetenv "const char *name"
 .Sh DESCRIPTION
 These functions set, unset, fetch, and parse variables from the kernel's
 environment.
 .Pp
 The
-.Fn getenv
+.Fn kern_getenv
 function obtains the current value of the kernel environment variable
 .Fa name
 and returns a pointer to the string value.
 The caller should not modify the string pointed to by the return value.
 The
-.Fn getenv
+.Fn kern_getenv
 function may allocate temporary storage,
 so the
 .Fn freeenv
 function must be called to release any allocated resources when the value
 returned by
-.Fn getenv
+.Fn kern_getenv
 is no longer needed.
 .Pp
 The
 .Fn freeenv
 function is used to release the resources allocated by a previous call to
-.Fn getenv .
+.Fn kern_getenv .
 The
 .Fa env
 argument passed to
 .Fn freeenv
 is the pointer returned by the earlier call to
-.Fn getenv .
+.Fn kern_getenv .
 Like
 .Xr free 3 ,
 the
@@ -107,7 +107,7 @@ argument can be
 in which case no action occurs.
 .Pp
 The
-.Fn setenv
+.Fn kern_setenv
 function inserts or resets the kernel environment variable
 .Fa name
 to
@@ -120,7 +120,7 @@ This function can fail if an internal limit on the num
 variables is exceeded.
 .Pp
 The
-.Fn unsetenv
+.Fn kern_unsetenv
 function deletes the kernel environment variable
 .Fa name .
 .Pp
@@ -196,15 +196,15 @@ characters of its value are copied to the buffer point
 followed by a null character and a non-zero value is returned.
 .Sh RETURN VALUES
 The
-.Fn getenv
+.Fn kern_getenv
 function returns a pointer to an environment variable's value on success or
 .Dv NULL
 if the variable does not exist.
 .Pp
 The
-.Fn setenv
+.Fn kern_setenv
 and
-.Fn unsetenv
+.Fn kern_unsetenv
 functions return zero on success and -1 on failure.
 .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: r319473 - head/lib/clang

2017-06-01 Thread Dimitry Andric
Author: dim
Date: Thu Jun  1 21:05:56 2017
New Revision: 319473
URL: https://svnweb.freebsd.org/changeset/base/319473

Log:
  For arm targets, place ABI at the end of the target triple
  
  For some reason, we have been inserting the ABI specification into the
  middle of the target triple, when building LLVM, like so:
  
  armv6-gnueabi-freebsd12.0
  
  This is the wrong way around.  LLVM even auto-canonicalizes it to:
  
  armv6--freebsd12.0-gnueabi
  
  Let's do this the right way in llvm.build.mk instead.  While here,
  define a proper VENDOR macro which can be overridden easily.
  
  Reviewed by:  emaste
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D10846

Modified:
  head/lib/clang/llvm.build.mk

Modified: head/lib/clang/llvm.build.mk
==
--- head/lib/clang/llvm.build.mkThu Jun  1 20:59:33 2017
(r319472)
+++ head/lib/clang/llvm.build.mkThu Jun  1 21:05:56 2017
(r319473)
@@ -25,16 +25,17 @@ BUILD_ARCH?=${MACHINE_ARCH}
 # arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
 # For all other targets, we stick with 'unknown'.
 .if ${TARGET_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
-TARGET_ABI=gnueabihf
+TARGET_ABI=-gnueabihf
 .elif ${TARGET_ARCH:Marm*}
-TARGET_ABI=gnueabi
+TARGET_ABI=-gnueabi
 .else
-TARGET_ABI=unknown
+TARGET_ABI=
 .endif
+VENDOR=unknown
 OS_VERSION=freebsd12.0
 
-TARGET_TRIPLE?=
${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${TARGET_ABI}-${OS_VERSION}
-BUILD_TRIPLE?= 
${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-unknown-${OS_VERSION}
+TARGET_TRIPLE?=
${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI}
+BUILD_TRIPLE?= 
${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}
 
 CFLAGS+=   -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\"
 CFLAGS+=   -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\"
___
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: r319460 - head/sys/net80211

2017-06-01 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Jun  1 20:46:43 2017
New Revision: 319460
URL: https://svnweb.freebsd.org/changeset/base/319460

Log:
  net80211: initialize i_seq for A-MPDU frames.
  
  Fragment number field (part of i_seq) is used for AAD calculation;
  as a result, without this patch every driver without h/w crypto support
  need to clear it before ieee80211_crypto_encap().
  
  Also fixes rtwn(4) A-MPDU Tx with dev.rtwn.%d.hwcrypto tunable
  set to 0 (h/w crypto is disabled).
  
  Tested with:
   * Intel 6205, STA mode.
   * RTL8188EU, STA mode.
  
  Differential Revision:https://reviews.freebsd.org/D10753

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cThu Jun  1 20:29:48 2017
(r319459)
+++ head/sys/net80211/ieee80211_output.cThu Jun  1 20:46:43 2017
(r319460)
@@ -779,6 +779,9 @@ ieee80211_send_setup(
tap = >ni_tx_ampdu[tid];
if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) {
m->m_flags |= M_AMPDU_MPDU;
+
+   /* NB: zero out i_seq field (for s/w encryption etc) */
+   *(uint16_t *)>i_seq[0] = 0;
} else {
if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK,
  type & IEEE80211_FC0_SUBTYPE_MASK))
@@ -1610,6 +1613,9 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8
*(uint16_t *)wh->i_seq =
htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
M_SEQNO_SET(m, seqno);
+   } else {
+   /* NB: zero out i_seq field (for s/w encryption etc) */
+   *(uint16_t *)wh->i_seq = 0;
}
} else {
/*
___
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: r319459 - head

2017-06-01 Thread Bryan Drewery
Author: bdrewery
Date: Thu Jun  1 20:29:48 2017
New Revision: 319459
URL: https://svnweb.freebsd.org/changeset/base/319459

Log:
  Revert r319457.
  
  META_MODE users actually do not need to do anything special assuming
  they have COMPAT_FREEBSD11 enabled.  The host tools in WORLDTMP will
  continue to work just fine.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jun  1 20:11:26 2017(r319458)
+++ head/UPDATING   Thu Jun  1 20:29:48 2017(r319459)
@@ -92,9 +92,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
a reboot is required after installing the new kernel before
installing world.  
 
-   Users using META_MODE to build should also use -DNO_META_IGNORE_HOST
-   to 'make' for the first build after upgrading.
-
 20170424:
The NATM framework including the en(4), fatm(4), hatm(4), and
patm(4) devices has been removed.  Consumers should plan a
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Ngie Cooper (yaneurabeya)

> On Jun 1, 2017, at 13:06, Alexey Dokuchaev  wrote:
> 
> On Thu, Jun 01, 2017 at 11:27:18AM -0700, Ngie Cooper (yaneurabeya) wrote:
>> ...
>> I vote for not checking in the SHAs. If something fails (as someone else
>> mentioned on the lists), it's really hard to debug why it failed.
> 
> Like I've said, it's not "really" hard.  Check out previous version and
> generate image with correct hash, there is no strong reason to commit the
> image other than minor usability improvement of not having to check out
> previous version.
> 
> Then again, just my $.02 -- I'm not the one doing actual work here.

That’s assuming there aren’t endianness issues, and less intuitive 
issues (take the usr.sbin/sa tests for example — BLEH). With binary files like 
this, it’s best to do an abbreviated dump of sorts.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319458 - head

2017-06-01 Thread Dimitry Andric
Author: dim
Date: Thu Jun  1 20:11:26 2017
New Revision: 319458
URL: https://svnweb.freebsd.org/changeset/base/319458

Log:
  Add a few missed files to ObsoleteFiles.inc.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Jun  1 20:03:20 2017(r319457)
+++ head/ObsoleteFiles.inc  Thu Jun  1 20:11:26 2017(r319458)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170601: old libifconfig and libifc
+OLD_FILES+=usr/lib/libifc.a
+OLD_FILES+=usr/lib/libifc_p.a
+OLD_FILES+=usr/lib/libifconfig.a
+OLD_FILES+=usr/lib/libifconfig_p.a
 # 20170529: mount.conf(8) -> mount.conf(5)
 OLD_FILES+=usr/share/man/man8/mount.conf.8.gz
 # 20170525: remove misleading template
@@ -116,6 +121,9 @@ OLD_FILES+=usr/share/doc/usd/contents.ascii.gz
 OLD_LIBS+=lib/libzfs.so.2
 OLD_LIBS+=usr/lib/libarchive.so.6
 OLD_LIBS+=usr/lib/libmilter.so.5
+OLD_LIBS+=usr/lib32/libzfs.so.2
+OLD_LIBS+=usr/lib32/libarchive.so.6
+OLD_LIBS+=usr/lib32/libmilter.so.5
 # 20170427: NATM configuration support removed
 OLD_FILES+=etc/rc.d/atm1
 OLD_FILES+=etc/rc.d/atm2
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Alexey Dokuchaev
On Thu, Jun 01, 2017 at 11:27:18AM -0700, Ngie Cooper (yaneurabeya) wrote:
> ...
> I vote for not checking in the SHAs. If something fails (as someone else
> mentioned on the lists), it's really hard to debug why it failed.

Like I've said, it's not "really" hard.  Check out previous version and
generate image with correct hash, there is no strong reason to commit the
image other than minor usability improvement of not having to check out
previous version.

Then again, just my $.02 -- I'm not the one doing actual work here.

./danfe
___
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: r319457 - head

2017-06-01 Thread Bryan Drewery
Author: bdrewery
Date: Thu Jun  1 20:03:20 2017
New Revision: 319457
URL: https://svnweb.freebsd.org/changeset/base/319457

Log:
  META_MODE users should build with -DNO_META_IGNORE_HOST once after ino64 
upgrade.
  
  See r301467 for more details.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jun  1 19:58:40 2017(r319456)
+++ head/UPDATING   Thu Jun  1 20:03:20 2017(r319457)
@@ -92,6 +92,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
a reboot is required after installing the new kernel before
installing world.  
 
+   Users using META_MODE to build should also use -DNO_META_IGNORE_HOST
+   to 'make' for the first build after upgrading.
+
 20170424:
The NATM framework including the en(4), fatm(4), hatm(4), and
patm(4) devices has been removed.  Consumers should plan a
___
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: r319456 - head/tests/sys/opencrypto

2017-06-01 Thread Ngie Cooper
Author: ngie
Date: Thu Jun  1 19:58:40 2017
New Revision: 319456
URL: https://svnweb.freebsd.org/changeset/base/319456

Log:
  tests/sys/opencrypto/runtests: apply minor polish to test script
  
  - Refactor kld loading/unloading logic:
  -- Use a loop instead of an unrolled one.
  -- Check for the module being loaded before trying to load it, to reduce
 noise when loading modules that are already loaded.
  -- Don't mute stderr from kldload -- it could be potentially useful to
 the tester.
  -- In the event that the test script was terminated early, it would leave
 the modules still attached to the system (which is undesirable).
 Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the
 system is returned to its former operating state as best possible.
 Unload the modules in reverse order, in part for consistency and/or
 dependency reasons.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/opencrypto/runtests.sh

Modified: head/tests/sys/opencrypto/runtests.sh
==
--- head/tests/sys/opencrypto/runtests.sh   Thu Jun  1 19:46:48 2017
(r319455)
+++ head/tests/sys/opencrypto/runtests.sh   Thu Jun  1 19:58:40 2017
(r319456)
@@ -29,21 +29,34 @@
 # $FreeBSD$
 #
 
-set -e
+set -ex
 
 if [ ! -d /usr/local/share/nist-kat ]; then
echo 'Skipping, nist-kat package not installed for test vectors.'
exit 0
 fi
 
-if kldload aesni 2>/dev/null; then
-   unloadaesni=1
-fi
+loaded_modules=
+cleanup_tests()
+{
+   trap - EXIT INT TERM
 
-if kldload cryptodev 2>/dev/null; then
-   unloadcdev=1
-fi
+   set +e
 
+   # Unload modules in reverse order
+   for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do
+   kldunload $loaded_module
+   done
+}
+trap cleanup_tests EXIT INT TERM
+
+for required_module in aesni cryptodev; do
+   if ! kldstat -q -m $required_module; then
+   kldload $required_module
+   loaded_modules="$loaded_modules $required_module"
+   fi
+done
+
 # Run software crypto test
 oldcdas=$(sysctl -e kern.cryptodevallowsoft)
 sysctl kern.cryptodevallowsoft=1
@@ -51,10 +64,3 @@ sysctl kern.cryptodevallowsoft=1
 python $(dirname $0)/cryptotest.py
 
 sysctl "$oldcdas"
-
-if [ x"$unloadcdev" = x"1" ]; then
-   kldunload cryptodev
-fi
-if [ x"$unloadaesni" = x"1" ]; then
-   kldunload aesni
-fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319455 - head/tests/sys/opencrypto

2017-06-01 Thread Ngie Cooper
Author: ngie
Date: Thu Jun  1 19:46:48 2017
New Revision: 319455
URL: https://svnweb.freebsd.org/changeset/base/319455

Log:
  Fix up `TEST_METADATA`
  
  - `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak
trying to run the tests on a system without python installed in $PATH.
  - The tests require root because they load aesni(4) and/or cryptodev(4) if
not already loaded.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/opencrypto/Makefile

Modified: head/tests/sys/opencrypto/Makefile
==
--- head/tests/sys/opencrypto/Makefile  Thu Jun  1 19:27:38 2017
(r319454)
+++ head/tests/sys/opencrypto/Makefile  Thu Jun  1 19:46:48 2017
(r319455)
@@ -7,7 +7,9 @@ BINDIR= ${TESTSDIR}
 
 PLAIN_TESTS_SH=runtests
 
-TEST_METADATA.foo+=required_programs="python"
+TEST_METADATA.runtests+= required_programs="python"
+TEST_METADATA.runtests+= required_user="root"
+
 PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py
 
 ${PACKAGE}FILES+=  ${PYMODULES}
___
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: r319454 - head/tests/sys/opencrypto

2017-06-01 Thread John Baldwin
Author: jhb
Date: Thu Jun  1 19:27:38 2017
New Revision: 319454
URL: https://svnweb.freebsd.org/changeset/base/319454

Log:
  Honor the requested crid when running a test.
  
  Otherwise, the kernel is free to choose an aribtrary crypto device
  rather than the requested device subverting tests that force the use
  of a specific device.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D10762

Modified:
  head/tests/sys/opencrypto/cryptodev.py

Modified: head/tests/sys/opencrypto/cryptodev.py
==
--- head/tests/sys/opencrypto/cryptodev.py  Thu Jun  1 19:21:30 2017
(r319453)
+++ head/tests/sys/opencrypto/cryptodev.py  Thu Jun  1 19:27:38 2017
(r319454)
@@ -173,10 +173,7 @@ class Crypto:
 
if not cipher and not mac:
raise ValueError('one of cipher or mac MUST be 
specified.')
-   ses.crid = CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE
-   #ses.crid = CRYPTOCAP_F_HARDWARE
-   #ses.crid = CRYPTOCAP_F_SOFTWARE
-   #ses.crid = 0
+   ses.crid = crid
#print `ses`
s = array.array('B', ses.pack_hdr())
#print `s`
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319453 - head/contrib/telnet/telnetd

2017-06-01 Thread Stephen J. Kiernan
Author: stevek
Date: Thu Jun  1 19:21:30 2017
New Revision: 319453
URL: https://svnweb.freebsd.org/changeset/base/319453

Log:
  Fix memory leak in edithost
  
  The problem is that when the parameter 'pat' is null, the function locally
  allocates a NULL string but never frees it.
  
  Instead of tracking the local alloc, it is noted that the while(*pat) never
  enters when there is a local alloc.
  So instead of doing the local alloc, check that 'pat' is null before the
  while(*pat) loop.
  
  Found using clang's static analyzer - scan-build
  
  Submitted by: Thomas Rix 
  Reviewed by:  markm
  Approved by:  sjg (mentor)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9689

Modified:
  head/contrib/telnet/telnetd/utility.c

Modified: head/contrib/telnet/telnetd/utility.c
==
--- head/contrib/telnet/telnetd/utility.c   Thu Jun  1 18:39:54 2017
(r319452)
+++ head/contrib/telnet/telnetd/utility.c   Thu Jun  1 19:21:30 2017
(r319453)
@@ -360,30 +360,30 @@ edithost(char *pat, char *host)
 {
char *res = editedhost;
 
-   if (!pat)
-   pat = strdup("");
-   while (*pat) {
-   switch (*pat) {
+   if (pat) {
+   while (*pat) {
+   switch (*pat) {
 
-   case '#':
-   if (*host)
-   host++;
-   break;
+   case '#':
+   if (*host)
+   host++;
+   break;
 
-   case '@':
-   if (*host)
-   *res++ = *host++;
-   break;
+   case '@':
+   if (*host)
+   *res++ = *host++;
+   break;
 
-   default:
-   *res++ = *pat;
-   break;
+   default:
+   *res++ = *pat;
+   break;
+   }
+   if (res == [sizeof editedhost - 1]) {
+   *res = '\0';
+   return;
+   }
+   pat++;
}
-   if (res == [sizeof editedhost - 1]) {
-   *res = '\0';
-   return;
-   }
-   pat++;
}
if (*host)
(void) strncpy(res, host,
___
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: r319450 - head/sys/vm

2017-06-01 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jun  1 18:36:52 2017
New Revision: 319450
URL: https://svnweb.freebsd.org/changeset/base/319450

Log:
  As old prophecy says, some day UMA_DEBUG printfs shall be made CTRs.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Thu Jun  1 18:35:04 2017(r319449)
+++ head/sys/vm/uma_core.c  Thu Jun  1 18:36:52 2017(r319450)
@@ -50,13 +50,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-/* I should really use ktr.. */
-/*
-#define UMA_DEBUG 1
-#define UMA_DEBUG_ALLOC 1
-#define UMA_DEBUG_ALLOC_1 1
-*/
-
 #include "opt_ddb.h"
 #include "opt_param.h"
 #include "opt_vm.h"
@@ -822,6 +815,9 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star
int i;
uint8_t flags;
 
+   CTR4(KTR_UMA, "keg_free_slab keg %s(%p) slab %p, returning %d bytes",
+   keg->uk_name, keg, slab, PAGE_SIZE * keg->uk_ppera);
+
mem = slab->us_data;
flags = slab->us_flags;
i = start;
@@ -832,10 +828,6 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star
}
if (keg->uk_flags & UMA_ZONE_OFFPAGE)
zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE);
-#ifdef UMA_DEBUG
-   printf("%s: Returning %d bytes.\n", keg->uk_name,
-   PAGE_SIZE * keg->uk_ppera);
-#endif
keg->uk_freef(mem, PAGE_SIZE * keg->uk_ppera, flags);
 }
 
@@ -858,9 +850,8 @@ keg_drain(uma_keg_t keg)
if (keg->uk_flags & UMA_ZONE_NOFREE || keg->uk_freef == NULL)
return;
 
-#ifdef UMA_DEBUG
-   printf("%s free items: %u\n", keg->uk_name, keg->uk_free);
-#endif
+   CTR3(KTR_UMA, "keg_drain %s(%p) free items: %u",
+   keg->uk_name, keg, keg->uk_free);
KEG_LOCK(keg);
if (keg->uk_free == 0)
goto finished;
@@ -950,9 +941,6 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int wai
slab = NULL;
mem = NULL;
 
-#ifdef UMA_DEBUG
-   printf("alloc_slab:  Allocating a new slab for %s\n", keg->uk_name);
-#endif
allocf = keg->uk_allocf;
KEG_UNLOCK(keg);
 
@@ -1017,6 +1005,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int wai
 out:
KEG_LOCK(keg);
 
+   CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)",
+   slab, keg->uk_name, keg);
+
if (slab != NULL) {
if (keg->uk_flags & UMA_ZONE_HASH)
UMA_HASH_INSERT(>uk_hash, slab, mem);
@@ -1274,15 +1265,13 @@ keg_small_init(uma_keg_t keg)
keg->uk_ipers = slabsize / keg->uk_rsize;
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE,
("%s: keg->uk_ipers %u", __func__, keg->uk_ipers));
-#ifdef UMA_DEBUG
-   printf("UMA decided we need offpage slab headers for "
-   "keg: %s, calculated wastedspace = %d, "
+   CTR6(KTR_UMA, "UMA decided we need offpage slab headers for "
+   "keg: %s(%p), calculated wastedspace = %d, "
"maximum wasted space allowed = %d, "
"calculated ipers = %d, "
-   "new wasted space = %d\n", keg->uk_name, wastedspace,
+   "new wasted space = %d\n", keg->uk_name, keg, wastedspace,
slabsize / UMA_MAX_WASTE, keg->uk_ipers,
slabsize - keg->uk_ipers * keg->uk_rsize);
-#endif
keg->uk_flags |= UMA_ZONE_OFFPAGE;
}
 
@@ -1492,13 +1481,10 @@ keg_ctor(void *mem, int size, void *udata, int flags)
if (keg->uk_flags & UMA_ZONE_HASH)
hash_alloc(>uk_hash);
 
-#ifdef UMA_DEBUG
-   printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free 
%d\n",
-   zone->uz_name, zone, keg->uk_size, keg->uk_rsize, keg->uk_flags,
-   keg->uk_ipers, keg->uk_ppera,
+   CTR5(KTR_UMA, "keg_ctor %p zone %s(%p) out %d free %d\n",
+   keg, zone->uz_name, zone,
(keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free,
keg->uk_free);
-#endif
 
LIST_INSERT_HEAD(>uk_zones, zone, uz_link);
 
@@ -1743,9 +1729,6 @@ uma_startup(void *mem, int npages)
 {
struct uma_zctor_args args;
 
-#ifdef UMA_DEBUG
-   printf("Creating uma keg headers zone and keg.\n");
-#endif
rw_init(_rwlock, "UMA lock");
 
/* "manually" create the initial zone */
@@ -1766,9 +1749,6 @@ uma_startup(void *mem, int npages)
bootmem = mem;
boot_pages = npages;
 
-#ifdef UMA_DEBUG
-   printf("Creating uma zone headers zone and keg.\n");
-#endif
args.name = "UMA Zones";
args.size = sizeof(struct uma_zone) +
(sizeof(struct uma_cache) * (mp_maxid + 1));
@@ -1782,10 +1762,6 @@ uma_startup(void *mem, int npages)
/* The initial zone has no Per cpu queues so it's smaller */
zone_ctor(zones, sizeof(struct uma_zone), , M_WAITOK);
 

Re: svn commit: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Ngie Cooper (yaneurabeya)

> On Jun 1, 2017, at 10:16, Alexey Dokuchaev  wrote:
> 
> On Thu, Jun 01, 2017 at 09:58:38AM -0700, Simon J. Gerraty wrote:
>> One option would be to store a sha256 hash of the result.
>> If the image generated by the test hashes to the correct value - you
>> pass.
> 
> That should be preferred.  Storing binary blobs in VCS is bad practice.
> 
>> Of course if the test fails, you are completely in the dark as to
>> how/why.
> 
> Not really: you checkout previous version (which produces correct hash)
> and store generated image for later inspection and diffing.
> 
>> Is storing img-1x1-512-mbr.vmdk.gz any more palatable?
> 
> This is barely acceptable, but only if image was zerofied/sparsed prior
> to compression.  Also, the image should be of the minimal (sufficient)
> working size.

I vote for not checking in the SHAs. If something fails (as someone 
else mentioned on the lists), it’s really hard to debug why it failed.
I think marcel@’s proposal for hexdump -C text dumps are the best way 
to handle this.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319448 - head/sys/vm

2017-06-01 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jun  1 18:26:57 2017
New Revision: 319448
URL: https://svnweb.freebsd.org/changeset/base/319448

Log:
  Simplify boot pages management in UMA.
  
  It is simply a contigous virtual memory pointer and number of pages.
  There is no need to build a linked list here.  Just increment pointer
  and decrement counter.  The only functional difference to old allocator
  is that before we gave pages from topmost and down to lowest, and now
  we give them in normal ascending order.
  
  While here remove padalign from a mutex that is unused at runtime.
  
  Reviewed by:  alc

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Thu Jun  1 17:07:13 2017(r319447)
+++ head/sys/vm/uma_core.c  Thu Jun  1 18:26:57 2017(r319448)
@@ -140,13 +140,16 @@ static LIST_HEAD(,uma_zone) uma_cachezones =
 /* This RW lock protects the keg list */
 static struct rwlock_padalign uma_rwlock;
 
-/* Linked list of boot time pages */
-static LIST_HEAD(,uma_slab) uma_boot_pages =
-LIST_HEAD_INITIALIZER(uma_boot_pages);
+/*
+ * Pointer and counter to pool of pages, that is preallocated at
+ * startup to bootstrap UMA.  Early zones continue to use the pool
+ * until it is depleted, so allocations may happen after boot, thus
+ * we need a mutex to protect it.
+ */
+static char *bootmem;
+static int boot_pages;
+static struct mtx uma_boot_pages_mtx;
 
-/* This mutex protects the boot time pages list */
-static struct mtx_padalign uma_boot_pages_mtx;
-
 static struct sx uma_drain_lock;
 
 /* Is the VM done starting up? */
@@ -1034,36 +1037,24 @@ static void *
 startup_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, int wait)
 {
uma_keg_t keg;
-   uma_slab_t tmps;
-   int pages, check_pages;
+   void *mem;
+   int pages;
 
keg = zone_first_keg(zone);
pages = howmany(bytes, PAGE_SIZE);
-   check_pages = pages - 1;
KASSERT(pages > 0, ("startup_alloc can't reserve 0 pages\n"));
 
/*
 * Check our small startup cache to see if it has pages remaining.
 */
mtx_lock(_boot_pages_mtx);
-
-   /* First check if we have enough room. */
-   tmps = LIST_FIRST(_boot_pages);
-   while (tmps != NULL && check_pages-- > 0)
-   tmps = LIST_NEXT(tmps, us_link);
-   if (tmps != NULL) {
-   /*
-* It's ok to lose tmps references.  The last one will
-* have tmps->us_data pointing to the start address of
-* "pages" contiguous pages of memory.
-*/
-   while (pages-- > 0) {
-   tmps = LIST_FIRST(_boot_pages);
-   LIST_REMOVE(tmps, us_link);
-   }
+   if (pages <= boot_pages) {
+   mem = bootmem;
+   boot_pages -= pages;
+   bootmem += pages * PAGE_SIZE;
mtx_unlock(_boot_pages_mtx);
-   *pflag = tmps->us_flags;
-   return (tmps->us_data);
+   *pflag = UMA_SLAB_BOOT;
+   return (mem);
}
mtx_unlock(_boot_pages_mtx);
if (booted < UMA_STARTUP2)
@@ -1748,11 +1739,9 @@ zone_foreach(void (*zfunc)(uma_zone_t))
 /* Public functions */
 /* See uma.h */
 void
-uma_startup(void *bootmem, int boot_pages)
+uma_startup(void *mem, int npages)
 {
struct uma_zctor_args args;
-   uma_slab_t slab;
-   int i;
 
 #ifdef UMA_DEBUG
printf("Creating uma keg headers zone and keg.\n");
@@ -1773,16 +1762,9 @@ uma_startup(void *bootmem, int boot_pages)
/* The initial zone has no Per cpu queues so it's smaller */
zone_ctor(kegs, sizeof(struct uma_zone), , M_WAITOK);
 
-#ifdef UMA_DEBUG
-   printf("Filling boot free list.\n");
-#endif
-   for (i = 0; i < boot_pages; i++) {
-   slab = (uma_slab_t)((uint8_t *)bootmem + (i * UMA_SLAB_SIZE));
-   slab->us_data = (uint8_t *)slab;
-   slab->us_flags = UMA_SLAB_BOOT;
-   LIST_INSERT_HEAD(_boot_pages, slab, us_link);
-   }
mtx_init(_boot_pages_mtx, "UMA boot pages", NULL, MTX_DEF);
+   bootmem = mem;
+   boot_pages = npages;
 
 #ifdef UMA_DEBUG
printf("Creating uma zone headers zone and keg.\n");
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Alexey Dokuchaev
On Thu, Jun 01, 2017 at 09:58:38AM -0700, Simon J. Gerraty wrote:
> One option would be to store a sha256 hash of the result.
> If the image generated by the test hashes to the correct value - you
> pass.

That should be preferred.  Storing binary blobs in VCS is bad practice.

> Of course if the test fails, you are completely in the dark as to
> how/why.

Not really: you checkout previous version (which produces correct hash)
and store generated image for later inspection and diffing.

> Is storing img-1x1-512-mbr.vmdk.gz any more palatable?

This is barely acceptable, but only if image was zerofied/sparsed prior
to compression.  Also, the image should be of the minimal (sufficient)
working size.

./danfe
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Simon J. Gerraty
Ngie Cooper (yaneurabeya)  wrote:
> > These should not be stored uuencoded.  It serves no purpose other
> > than bloating the repo and causing spammy commit mails like this one
> > where we got a huge tail of garbage output.

The tests appear to contain generated filesystem images.
eg. img-1x1-512-mbr.vmdk.gz.uu

Is storing img-1x1-512-mbr.vmdk.gz any more palatable?

One option would be to store a sha256 hash of the result.
If the image generated by the test hashes to the correct value - you
pass.

Of course if the test fails, you are completely in the dark as to
how/why.

With the current arrangment, marcel at least has something he can
examine to see where the output generation went wrong.
___
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: r319444 - in head/sys/compat/linuxkpi/common: include/linux src

2017-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun  1 16:49:48 2017
New Revision: 319444
URL: https://svnweb.freebsd.org/changeset/base/319444

Log:
  Make sure the selrecord() function is only called from within system
  polling contexts in the LinuxKPI.
  
  After the kqueue() support was added to the LinuxKPI in r319409 the
  Linux poll file operation will be used outside the system file polling
  callback function, which can cause a NULL-pointer panic inside
  selrecord() because curthread->td_sel is set to NULL. This patch moves
  the selrecord() call away from poll_wait() and to the system file poll
  callback function in the LinuxKPI, which essentially wraps the Linux
  one. This is similar to what the cuse(3) module is currently doing.
  Refer to sys/fs/cuse/*.[ch] for more details.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/poll.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h
==
--- head/sys/compat/linuxkpi/common/include/linux/poll.hThu Jun  1 
16:44:39 2017(r319443)
+++ head/sys/compat/linuxkpi/common/include/linux/poll.hThu Jun  1 
16:49:48 2017(r319444)
@@ -43,7 +43,7 @@ typedef struct poll_table_struct {
 static inline void
 poll_wait(struct linux_file *filp, wait_queue_head_t *wait_address, poll_table 
*p)
 {
-   selrecord(curthread, >f_selinfo);
+   /* NOP */
 }
 
 extern void linux_poll_wakeup(struct linux_file *);

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 16:44:39 
2017(r319443)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 16:49:48 
2017(r319444)
@@ -956,9 +956,10 @@ linux_dev_poll(struct cdev *dev, int events, struct th
file = td->td_fpop;
filp->f_flags = file->f_flag;
linux_set_current(td);
-   if (filp->f_op->poll)
+   if (filp->f_op->poll != NULL) {
+   selrecord(td, >f_selinfo);
revents = filp->f_op->poll(filp, NULL) & events;
-   else
+   } else
revents = 0;
 
return (revents);
@@ -1263,9 +1264,10 @@ linux_file_poll(struct file *file, int events, struct 
filp = (struct linux_file *)file->f_data;
filp->f_flags = file->f_flag;
linux_set_current(td);
-   if (filp->f_op->poll)
+   if (filp->f_op->poll != NULL) {
+   selrecord(td, >f_selinfo);
revents = filp->f_op->poll(filp, NULL) & events;
-   else
+   } else
revents = 0;
 
return (revents);
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Brooks Davis
On Thu, Jun 01, 2017 at 08:11:45AM -0700, Marcel Moolenaar wrote:
> 
> > On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) 
> >  wrote:
> > 
> > 
> >> On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:
> >> 
> >> On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:
> >>> Author: ngie
> >>> Date: Wed May 31 08:01:12 2017
> >>> New Revision: 319295
> >>> URL: https://svnweb.freebsd.org/changeset/base/319295
> >>> 
> >>> Log:
> >>> Update the usr.bin/mkimg golden test output files after ^/head@r319125
> >>> 
> >>> ^/head@r319125 changed the location of the backup pmbr, requiring the
> >>> output files to be regenerated, since they're binary disk dumps.
> >>> 
> >>> The output files were regenerated with "make rebase"--fixed in
> >>> ^/head@r319294.
> >> 
> >> These should not be stored uuencoded.  It serves no purpose other
> >> than bloating the repo and causing spammy commit mails like this one
> >> where we got a huge tail of garbage output.
> > 
> > Hi Brooks,
> > I???m not entirely sure why the files were uuencoded to be honest. I 
> > think that???s a good question for Marcel and some of the folks at Juniper, 
> > since they wrote the tool/tests.
> 
> Result files used to start off as binary files.  uuencoding is a given in 
> that case.  I eventually switched to using hexdump -C, because that makes it 
> easier to analyze and understand differences.  The uuencoding was kept to 
> remain independent of version control system, file attributes and end-of-line 
> characteristics of the host machine: nothing more annoying that checking out 
> textual result files and have test failures because ???\n??? was replaced by 
> ???\r\n???.
> 
> Even if the files aren???t unencoded, there???s always someone who treats it 
> as spammy and a tail of garbage. It???s just a knee-jerk reaction to seeing 
> something that isn???t understood, I think. As such, there???s no reason to 
> change ??? in fact, changing would be bloating the repo.

hexdump -C would make sense.  Direct commits of the compressed files
would also make sense.

Uuencoding gzip'd data is absurd given that we don't (and never again will)
support repositories that don't support binary data.  The diffs produced
are meaningless.

I don't advocate replacing these files agressively, but when updating
files we should be thinking about switching away from uuencoding.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Ngie Cooper

> On Jun 1, 2017, at 08:35, Marcel Moolenaar  wrote:
> 
> 
>> On Jun 1, 2017, at 8:32 AM, Alan Somers  wrote:

...

>> If the files are binary, then why not store them as binary files?
> 
> A 100MB image, committed as binary file is 100MB of data. The hexdump -C
> equivalent is often only a few hundred bytes (due to the many zeroes).
> The repo bloat argument has grounds for binary files.

hexdump still has a number of formatting bugs... I guess I should go back and 
write some tests/fix the issues, almost a decade after I tried to take them on 
originally...
Thanks!
-Ngie
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Marcel Moolenaar

> On Jun 1, 2017, at 8:32 AM, Alan Somers  wrote:
> 
> On Thu, Jun 1, 2017 at 9:11 AM, Marcel Moolenaar  wrote:
>> 
>> On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya)
>>  wrote:
>> 
>> 
>> On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:
>> 
>> On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:
>> 
>> Author: ngie
>> Date: Wed May 31 08:01:12 2017
>> New Revision: 319295
>> URL: https://svnweb.freebsd.org/changeset/base/319295
>> 
>> Log:
>> Update the usr.bin/mkimg golden test output files after ^/head@r319125
>> 
>> ^/head@r319125 changed the location of the backup pmbr, requiring the
>> output files to be regenerated, since they're binary disk dumps.
>> 
>> The output files were regenerated with "make rebase"--fixed in
>> ^/head@r319294.
>> 
>> 
>> These should not be stored uuencoded.  It serves no purpose other
>> than bloating the repo and causing spammy commit mails like this one
>> where we got a huge tail of garbage output.
>> 
>> 
>> Hi Brooks,
>> I’m not entirely sure why the files were uuencoded to be honest. I think
>> that’s a good question for Marcel and some of the folks at Juniper, since
>> they wrote the tool/tests.
>> 
>> 
>> Result files used to start off as binary files.  uuencoding is a given in
>> that case.  I eventually switched to using hexdump -C, because that makes it
>> easier to analyze and understand differences.  The uuencoding was kept to
>> remain independent of version control system, file attributes and
>> end-of-line characteristics of the host machine: nothing more annoying that
>> checking out textual result files and have test failures because ‘\n’ was
>> replaced by ‘\r\n’.
>> 
>> Even if the files aren’t unencoded, there’s always someone who treats it as
>> spammy and a tail of garbage. It’s just a knee-jerk reaction to seeing
>> something that isn’t understood, I think. As such, there’s no reason to
>> change — in fact, changing would be bloating the repo.
>> 
>> --
>> Marcel Moolenaar
>> mar...@xcllnt.net
> 
> If the files are binary, then why not store them as binary files?

A 100MB image, committed as binary file is 100MB of data. The hexdump -C
equivalent is often only a few hundred bytes (due to the many zeroes).
The repo bloat argument has grounds for binary files.

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Alan Somers
On Thu, Jun 1, 2017 at 9:11 AM, Marcel Moolenaar  wrote:
>
> On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya)
>  wrote:
>
>
> On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:
>
> On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:
>
> Author: ngie
> Date: Wed May 31 08:01:12 2017
> New Revision: 319295
> URL: https://svnweb.freebsd.org/changeset/base/319295
>
> Log:
> Update the usr.bin/mkimg golden test output files after ^/head@r319125
>
> ^/head@r319125 changed the location of the backup pmbr, requiring the
> output files to be regenerated, since they're binary disk dumps.
>
> The output files were regenerated with "make rebase"--fixed in
> ^/head@r319294.
>
>
> These should not be stored uuencoded.  It serves no purpose other
> than bloating the repo and causing spammy commit mails like this one
> where we got a huge tail of garbage output.
>
>
> Hi Brooks,
> I’m not entirely sure why the files were uuencoded to be honest. I think
> that’s a good question for Marcel and some of the folks at Juniper, since
> they wrote the tool/tests.
>
>
> Result files used to start off as binary files.  uuencoding is a given in
> that case.  I eventually switched to using hexdump -C, because that makes it
> easier to analyze and understand differences.  The uuencoding was kept to
> remain independent of version control system, file attributes and
> end-of-line characteristics of the host machine: nothing more annoying that
> checking out textual result files and have test failures because ‘\n’ was
> replaced by ‘\r\n’.
>
> Even if the files aren’t unencoded, there’s always someone who treats it as
> spammy and a tail of garbage. It’s just a knee-jerk reaction to seeing
> something that isn’t understood, I think. As such, there’s no reason to
> change — in fact, changing would be bloating the repo.
>
> --
> Marcel Moolenaar
> mar...@xcllnt.net

If the files are binary, then why not store them as binary files?
Subversion can handle that.  That way the tests won't need to decode
them, svn clients won't change their line endings, and commit mail
won't include their diffs.

-Alan
___
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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Marcel Moolenaar

> On May 31, 2017, at 11:06 PM, Ngie Cooper (yaneurabeya) 
>  wrote:
> 
> 
>> On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:
>> 
>> On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:
>>> Author: ngie
>>> Date: Wed May 31 08:01:12 2017
>>> New Revision: 319295
>>> URL: https://svnweb.freebsd.org/changeset/base/319295
>>> 
>>> Log:
>>> Update the usr.bin/mkimg golden test output files after ^/head@r319125
>>> 
>>> ^/head@r319125 changed the location of the backup pmbr, requiring the
>>> output files to be regenerated, since they're binary disk dumps.
>>> 
>>> The output files were regenerated with "make rebase"--fixed in
>>> ^/head@r319294.
>> 
>> These should not be stored uuencoded.  It serves no purpose other
>> than bloating the repo and causing spammy commit mails like this one
>> where we got a huge tail of garbage output.
> 
> Hi Brooks,
>   I’m not entirely sure why the files were uuencoded to be honest. I 
> think that’s a good question for Marcel and some of the folks at Juniper, 
> since they wrote the tool/tests.

Result files used to start off as binary files.  uuencoding is a given in that 
case.  I eventually switched to using hexdump -C, because that makes it easier 
to analyze and understand differences.  The uuencoding was kept to remain 
independent of version control system, file attributes and end-of-line 
characteristics of the host machine: nothing more annoying that checking out 
textual result files and have test failures because ‘\n’ was replaced by ‘\r\n’.

Even if the files aren’t unencoded, there’s always someone who treats it as 
spammy and a tail of garbage. It’s just a knee-jerk reaction to seeing 
something that isn’t understood, I think. As such, there’s no reason to change 
— in fact, changing would be bloating the repo.

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
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: r319433 - in head/sys/netinet: . tcp_stacks

2017-06-01 Thread Michael Tuexen
Author: tuexen
Date: Thu Jun  1 15:11:18 2017
New Revision: 319433
URL: https://svnweb.freebsd.org/changeset/base/319433

Log:
  Improve comments to describe what the code does.
  
  Reported by:  jtl
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/fastpath.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Jun  1 15:03:43 2017
(r319432)
+++ head/sys/netinet/tcp_input.cThu Jun  1 15:11:18 2017
(r319433)
@@ -2011,8 +2011,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
 
/*
 * If the state is SYN_SENT:
-*  if seg contains a RST, then drop the connection.
-*  if seg does not contain SYN, then drop it.
+*  if seg contains a RST with valid ACK (SEQ.ACK has already
+*  been verified), then drop the connection.
+*  if seg contains a RST without an ACK, drop the seg.
+*  if seg does not contain SYN, then drop the seg.
 * Otherwise this is an acceptable SYN segment
 *  initialize tp->rcv_nxt and tp->irs
 *  if seg contains ack then advance tp->snd_una

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Thu Jun  1 15:03:43 2017
(r319432)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Thu Jun  1 15:11:18 2017
(r319433)
@@ -497,8 +497,10 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, str
 
/*
 * If the state is SYN_SENT:
-*  if seg contains a RST, then drop the connection.
-*  if seg does not contain SYN, then drop it.
+*  if seg contains a RST with valid ACK (SEQ.ACK has already
+*  been verified), then drop the connection.
+*  if seg contains a RST without an ACK, drop the seg.
+*  if seg does not contain SYN, then drop the seg.
 * Otherwise this is an acceptable SYN segment
 *  initialize tp->rcv_nxt and tp->irs
 *  if seg contains ack then advance tp->snd_una
___
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: r319432 - head/usr.bin/rctl

2017-06-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Jun  1 15:03:43 2017
New Revision: 319432
URL: https://svnweb.freebsd.org/changeset/base/319432

Log:
  Use proper capitalization with .Dd.
  
  Submitted by: oshogbo
  MFC after:2 weeks

Modified:
  head/usr.bin/rctl/rctl.8

Modified: head/usr.bin/rctl/rctl.8
==
--- head/usr.bin/rctl/rctl.8Thu Jun  1 14:58:26 2017(r319431)
+++ head/usr.bin/rctl/rctl.8Thu Jun  1 15:03:43 2017(r319432)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd may 28, 2017
+.Dd May 28, 2017
 .Dt RCTL 8
 .Os
 .Sh 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: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Pedro Giffuni



On 06/01/17 01:06, Ngie Cooper (yaneurabeya) wrote:

On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:

On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:

Author: ngie
Date: Wed May 31 08:01:12 2017
New Revision: 319295
URL: https://svnweb.freebsd.org/changeset/base/319295

Log:
  Update the usr.bin/mkimg golden test output files after ^/head@r319125

  ^/head@r319125 changed the location of the backup pmbr, requiring the
  output files to be regenerated, since they're binary disk dumps.

  The output files were regenerated with "make rebase"--fixed in
  ^/head@r319294.

These should not be stored uuencoded.  It serves no purpose other
than bloating the repo and causing spammy commit mails like this one
where we got a huge tail of garbage output.

Hi Brooks,
I’m not entirely sure why the files were uuencoded to be honest. I 
think that’s a good question for Marcel and some of the folks at Juniper, since 
they wrote the tool/tests.


for the record, it used to be a common practice. I think it's legacy 
from the CVS days.


Pedro.

___
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: r319414 - head/sys/dev/mlx4/mlx4_en

2017-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun  1 10:44:48 2017
New Revision: 319414
URL: https://svnweb.freebsd.org/changeset/base/319414

Log:
  Allow communication between functions on the same host when using the
  mlx4en(4) driver in SRIOV mode.
  
  Place a copy of the destination MAC address in the send WQE only under
  SRIOV/eSwitch configuration or when the device is in selftest. This
  allows communication between functions on the same host.
  
  PR:   216493
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c  Thu Jun  1 10:39:00 2017
(r319413)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c  Thu Jun  1 10:44:48 2017
(r319414)
@@ -661,18 +661,6 @@ static void mlx4_bf_copy(void __iomem *dst, volatile u
__iowrite64_copy(dst, __DEVOLATILE(void *, src), bytecnt / 8);
 }
 
-static u64 mlx4_en_mac_to_u64(u8 *addr)
-{
-u64 mac = 0;
-int i;
-
-for (i = 0; i < ETHER_ADDR_LEN; i++) {
-mac <<= 8;
-mac |= addr[i];
-}
-return mac;
-}
-
 static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf 
**mbp)
 {
enum {
@@ -770,8 +758,18 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int
tx_desc->ctrl.ins_vlan = 0;
}
 
-   /* clear immediate field */
-   tx_desc->ctrl.imm = 0;
+   if (unlikely(mlx4_is_mfunc(priv->mdev->dev) || 
priv->validate_loopback)) {
+   /*
+* Copy destination MAC address to WQE. This allows
+* loopback in eSwitch, so that VFs and PF can
+* communicate with each other:
+*/
+   m_copydata(mb, 0, 2, __DEVOLATILE(void *, 
_desc->ctrl.srcrb_flags16[0]));
+   m_copydata(mb, 2, 4, __DEVOLATILE(void *, _desc->ctrl.imm));
+   } else {
+   /* clear immediate field */
+   tx_desc->ctrl.imm = 0;
+   }
 
/* Handle LSO (TSO) packets */
if (mb->m_pkthdr.csum_flags & CSUM_TSO) {
@@ -929,22 +927,6 @@ skip_dma:
mlx4_en_store_inline_lso_header(dseg_inline, ihs, owner_bit);
else
mlx4_en_store_inline_header(dseg_inline, ihs, owner_bit);
-
-   if (unlikely(priv->validate_loopback)) {
-   /* Copy dst mac address to wqe */
-struct ether_header *ethh;
-u64 mac;
-u32 mac_l, mac_h;
-
-ethh = mtod(mb, struct ether_header *);
-mac = mlx4_en_mac_to_u64(ethh->ether_dhost);
-if (mac) {
-mac_h = (u32) ((mac & 0xULL) >> 16);
-mac_l = (u32) (mac & 0x);
-tx_desc->ctrl.srcrb_flags |= cpu_to_be32(mac_h);
-tx_desc->ctrl.imm = cpu_to_be32(mac_l);
-}
-   }
 
/* update producer counter */
ring->prod += tx_info->nr_txbb;
___
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: r319413 - head/sys/dev/mlx4/mlx4_en

2017-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun  1 10:39:00 2017
New Revision: 319413
URL: https://svnweb.freebsd.org/changeset/base/319413

Log:
  Free hardware queue resource after port is stopped in the mlx4en(4)
  driver. Else if the port is up the resource might still be busy and
  the MTT free will fail.
  
  PR:   216493
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Thu Jun  1 10:04:12 2017
(r319412)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Thu Jun  1 10:39:00 2017
(r319413)
@@ -1731,13 +1731,12 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
mutex_unlock(>state_lock);
}
 
-   if (priv->allocated)
-   mlx4_free_hwq_res(mdev->dev, >res, MLX4_EN_PAGE_SIZE);
-
mutex_lock(>state_lock);
mlx4_en_stop_port(dev);
mutex_unlock(>state_lock);
 
+   if (priv->allocated)
+   mlx4_free_hwq_res(mdev->dev, >res, MLX4_EN_PAGE_SIZE);
 
cancel_delayed_work(>stats_task);
cancel_delayed_work(>service_task);
___
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: r319412 - head/sys/netipsec

2017-06-01 Thread Andrey V. Elsukov
Author: ae
Date: Thu Jun  1 10:04:12 2017
New Revision: 319412
URL: https://svnweb.freebsd.org/changeset/base/319412

Log:
  Build kdebug_secreplay() function only when IPSEC_DEBUG is defined.
  
  This should fix the build on sparc.
  
  Reported by:  emaste
  X-MFC with:   r319118

Modified:
  head/sys/netipsec/key_debug.c

Modified: head/sys/netipsec/key_debug.c
==
--- head/sys/netipsec/key_debug.c   Thu Jun  1 10:03:41 2017
(r319411)
+++ head/sys/netipsec/key_debug.c   Thu Jun  1 10:04:12 2017
(r319412)
@@ -77,10 +77,6 @@ static void kdebug_sadb_x_sa2(struct sadb_ext *);
 static void kdebug_sadb_x_sa_replay(struct sadb_ext *);
 static void kdebug_sadb_x_natt(struct sadb_ext *);
 
-#ifdef _KERNEL
-static void kdebug_secreplay(struct secreplay *);
-#endif
-
 #ifndef _KERNEL
 #define panic(fmt, ...){ printf(fmt, ## __VA_ARGS__); exit(-1); }
 #endif
@@ -724,6 +720,7 @@ kdebug_secash(struct secashead *sah, const char *inden
printf("}\n");
 }
 
+#ifdef IPSEC_DEBUG
 static void
 kdebug_secreplay(struct secreplay *rpl)
 {
@@ -745,6 +742,7 @@ kdebug_secreplay(struct secreplay *rpl)
}
printf("}\n");
 }
+#endif /* IPSEC_DEBUG */
 
 static void
 kdebug_secnatt(struct secnatt *natt)
___
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: r319406 - head/sbin/ipfw

2017-06-01 Thread Emmanuel Vadot
Author: manu
Date: Thu Jun  1 09:14:49 2017
New Revision: 319406
URL: https://svnweb.freebsd.org/changeset/base/319406

Log:
  ipfw.8: Note that the ipfw_nat kernel module must be loaded or that the
  IPFIREWALL_NAT options must be in the kernel config in order to use in-kernel
  nat.
  
  MFC after:3 days

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Thu Jun  1 09:14:43 2017(r319405)
+++ head/sbin/ipfw/ipfw.8   Thu Jun  1 09:14:49 2017(r319406)
@@ -2896,6 +2896,11 @@ the packets are dropped.
 .Nm
 support in-kernel NAT using the kernel version of
 .Xr libalias 3 .
+The kernel module
+.Cm ipfw_nat
+should be loaded or kernel should have
+.Cm options IPFIREWALL_NAT
+to be able use NAT.
 .Pp
 The nat configuration command is the following:
 .Bd -ragged -offset indent
___
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: r319410 - head/sys/compat/linuxkpi/common/src

2017-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun  1 09:53:55 2017
New Revision: 319410
URL: https://svnweb.freebsd.org/changeset/base/319410

Log:
  Translate the ERESTARTSYS error code into ERESTART in the LinuxKPI
  ioctl(), read() and write() system call handlers. This error code is
  internal to the kernel and should not be seen by user-space programs
  according to Linux.
  
  Submitted by: Yanko Yankulov 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 09:34:51 
2017(r319409)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 09:53:55 
2017(r319410)
@@ -854,6 +854,8 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t 
 
if (error == EWOULDBLOCK)
linux_dev_kqfilter_poll(filp);
+   else if (error == ERESTARTSYS)
+   error = ERESTART;
return (error);
 }
 
@@ -889,6 +891,8 @@ linux_dev_read(struct cdev *dev, struct uio *uio, int 
error = -bytes;
if (error == EWOULDBLOCK)
linux_dev_kqfilter_poll(filp);
+   else if (error == ERESTARTSYS)
+   error = ERESTART;
}
} else
error = ENXIO;
@@ -928,6 +932,8 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int
error = -bytes;
if (error == EWOULDBLOCK)
linux_dev_kqfilter_poll(filp);
+   else if (error == ERESTARTSYS)
+   error = ERESTART;
}
} else
error = ENXIO;
___
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: r319409 - in head/sys/compat/linuxkpi/common: include/linux src

2017-06-01 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun  1 09:34:51 2017
New Revision: 319409
URL: https://svnweb.freebsd.org/changeset/base/319409

Log:
  Add generic kqueue() and kevent() support to the LinuxKPI character
  devices. The implementation allows read and write filters to be
  created and piggybacks on the poll() file operation to determine when
  a filter should trigger. The piggyback mechanism is simply to check
  for the EWOULDBLOCK or EAGAIN return code from read(), write() or
  ioctl() system calls and then update the kqueue() polling state bits.
  The implementation is similar to the one found in the cuse(3) module.
  Refer to sys/fs/cuse/*.[ch] for more details.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/file.h
  head/sys/compat/linuxkpi/common/include/linux/fs.h
  head/sys/compat/linuxkpi/common/include/linux/poll.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/file.h
==
--- head/sys/compat/linuxkpi/common/include/linux/file.hThu Jun  1 
09:21:25 2017(r319408)
+++ head/sys/compat/linuxkpi/common/include/linux/file.hThu Jun  1 
09:34:51 2017(r319409)
@@ -151,20 +151,18 @@ get_unused_fd_flags(int flags)
return fd;
 }
 
+extern struct linux_file *linux_file_alloc(void);
+
 static inline struct linux_file *
 alloc_file(int mode, const struct file_operations *fops)
 {
struct linux_file *filp;
 
-   filp = kzalloc(sizeof(*filp), GFP_KERNEL);
-   if (filp == NULL)
-   return (NULL);
-
-   filp->f_count = 1;
+   filp = linux_file_alloc();
filp->f_op = fops;
filp->f_mode = mode;
 
-   return filp;
+   return (filp);
 }
 
 struct fd {

Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h
==
--- head/sys/compat/linuxkpi/common/include/linux/fs.h  Thu Jun  1 09:21:25 
2017(r319408)
+++ head/sys/compat/linuxkpi/common/include/linux/fs.h  Thu Jun  1 09:34:51 
2017(r319409)
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct module;
 struct kiocb;
@@ -80,6 +81,15 @@ struct linux_file {
struct sigio*f_sigio;
struct vnode*f_vnode;
volatile u_int  f_count;
+
+   /* kqfilter support */
+   int f_kqflags;
+#defineLINUX_KQ_FLAG_HAS_READ (1 << 0)
+#defineLINUX_KQ_FLAG_HAS_WRITE (1 << 1)
+#defineLINUX_KQ_FLAG_NEED_READ (1 << 2)
+#defineLINUX_KQ_FLAG_NEED_WRITE (1 << 3)
+   /* protects f_selinfo.si_note */
+   spinlock_t  f_kqlock;
 };
 
 #definefilelinux_file

Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h
==
--- head/sys/compat/linuxkpi/common/include/linux/poll.hThu Jun  1 
09:21:25 2017(r319408)
+++ head/sys/compat/linuxkpi/common/include/linux/poll.hThu Jun  1 
09:34:51 2017(r319409)
@@ -46,4 +46,6 @@ poll_wait(struct linux_file *filp, wait_queue_head_t *
selrecord(curthread, >f_selinfo);
 }
 
+extern void linux_poll_wakeup(struct linux_file *);
+
 #endif /* _LINUX_POLL_H_ */

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 09:21:25 
2017(r319408)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Jun  1 09:34:51 
2017(r319409)
@@ -402,6 +402,63 @@ linux_file_dtor(void *cdp)
kfree(filp);
 }
 
+static void
+linux_kq_lock(void *arg)
+{
+   spinlock_t *s = arg;
+
+   spin_lock(s);
+}
+static void
+linux_kq_unlock(void *arg)
+{
+   spinlock_t *s = arg;
+
+   spin_unlock(s);
+}
+
+static void
+linux_kq_lock_owned(void *arg)
+{
+#ifdef INVARIANTS
+   spinlock_t *s = arg;
+
+   mtx_assert(>m, MA_OWNED);
+#endif
+}
+
+static void
+linux_kq_lock_unowned(void *arg)
+{
+#ifdef INVARIANTS
+   spinlock_t *s = arg;
+
+   mtx_assert(>m, MA_NOTOWNED);
+#endif
+}
+
+static void
+linux_dev_kqfilter_poll(struct linux_file *);
+
+struct linux_file *
+linux_file_alloc(void)
+{
+   struct linux_file *filp;
+
+   filp = kzalloc(sizeof(*filp), GFP_KERNEL);
+
+   /* set initial refcount */
+   filp->f_count = 1;
+
+   /* setup fields needed by kqueue support */
+   spin_lock_init(>f_kqlock);
+   knlist_init(>f_selinfo.si_note, >f_kqlock,
+   linux_kq_lock, linux_kq_unlock,
+   linux_kq_lock_owned, linux_kq_lock_unowned);
+
+   return (filp);
+}
+
 void
 linux_file_free(struct linux_file *filp)
 {
@@ -592,15 +649,17 @@ linux_dev_open(struct cdev *dev, int oflags, int devty
ldev = 

Re: svn commit: r316286 - in head: lib/libprocstat sys/kern sys/sys usr.bin/gcore usr.bin/procstat

2017-06-01 Thread Ngie Cooper (yaneurabeya)

> On Mar 30, 2017, at 11:21, Tycho Nightingale  wrote:
> 
> Author: tychon
> Date: Thu Mar 30 18:21:36 2017
> New Revision: 316286
> URL: https://svnweb.freebsd.org/changeset/base/316286
> 
> Log:
>  Add support for capturing 'struct ptrace_lwpinfo' for signals
>  resulting in a process dumping core in the corefile.
> 
>  Also extend procstat to view select members of 'struct ptrace_lwpinfo'
>  from the contents of the note.
> 
>  Sponsored by:Dell EMC Isilon

Hi Tycho,
Should this be MFCed?
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319369 - in head: lib/libc/rpc lib/libc/xdr sys/rpc sys/xdr usr.sbin/rpcbind

2017-06-01 Thread Xin LI
Author: delphij
Date: Thu Jun  1 06:12:25 2017
New Revision: 319369
URL: https://svnweb.freebsd.org/changeset/base/319369

Log:
   * limit size of buffers to RPC_MAXDATASIZE
   * don't leak memory
   * be more picky about bad parameters
  
  From:
  
  
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt
  https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt
  
  via NetBSD.
  
  Reviewed by:  emaste, cem (earlier version)
  Differential Revision:https://reviews.freebsd.org/D10922
  MFC after:3 days

Modified:
  head/lib/libc/rpc/rpc_generic.c
  head/lib/libc/rpc/rpcb_prot.c
  head/lib/libc/rpc/rpcb_st_xdr.c
  head/lib/libc/xdr/xdr.c
  head/sys/rpc/rpc_generic.c
  head/sys/rpc/rpcb_clnt.c
  head/sys/rpc/rpcb_prot.c
  head/sys/xdr/xdr.c
  head/usr.sbin/rpcbind/rpcb_svc_com.c

Modified: head/lib/libc/rpc/rpc_generic.c
==
--- head/lib/libc/rpc/rpc_generic.c Thu Jun  1 02:31:14 2017
(r319368)
+++ head/lib/libc/rpc/rpc_generic.c Thu Jun  1 06:12:25 2017
(r319369)
@@ -609,6 +609,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf
 
switch (af) {
case AF_INET:
+   if (nbuf->len < sizeof(*sin))
+   return NULL;
sin = nbuf->buf;
if (inet_ntop(af, >sin_addr, namebuf, sizeof namebuf)
== NULL)
@@ -620,6 +622,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf
break;
 #ifdef INET6
case AF_INET6:
+   if (nbuf->len < sizeof(*sin6))
+   return NULL;
sin6 = nbuf->buf;
if (inet_ntop(af, >sin6_addr, namebuf6, sizeof namebuf6)
== NULL)
@@ -658,6 +662,10 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
 
port = 0;
sin = NULL;
+
+   if (uaddr == NULL)
+   return NULL;
+
addrstr = strdup(uaddr);
if (addrstr == NULL)
return NULL;

Modified: head/lib/libc/rpc/rpcb_prot.c
==
--- head/lib/libc/rpc/rpcb_prot.c   Thu Jun  1 02:31:14 2017
(r319368)
+++ head/lib/libc/rpc/rpcb_prot.c   Thu Jun  1 06:12:25 2017
(r319369)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 
 bool_t
@@ -62,13 +63,13 @@ xdr_rpcb(XDR *xdrs, RPCB *objp)
if (!xdr_rpcvers(xdrs, >r_vers)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_netid, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_netid, RPC_MAXDATASIZE)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_addr, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_addr, RPC_MAXDATASIZE)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_owner, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_owner, RPC_MAXDATASIZE)) {
return (FALSE);
}
return (TRUE);
@@ -162,19 +163,19 @@ xdr_rpcblist(XDR *xdrs, RPCBLIST **rp)
 bool_t
 xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp)
 {
-   if (!xdr_string(xdrs, >r_maddr, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_maddr, RPC_MAXDATASIZE)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_nc_netid, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_nc_netid, RPC_MAXDATASIZE)) {
return (FALSE);
}
if (!xdr_u_int32_t(xdrs, >r_nc_semantics)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_nc_protofmly, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_nc_protofmly, RPC_MAXDATASIZE)) {
return (FALSE);
}
-   if (!xdr_string(xdrs, >r_nc_proto, (u_int)~0)) {
+   if (!xdr_string(xdrs, >r_nc_proto, RPC_MAXDATASIZE)) {
return (FALSE);
}
return (TRUE);
@@ -289,7 +290,7 @@ xdr_rpcb_rmtcallres(XDR *xdrs, struct rpcb_rmtcallres 
bool_t dummy;
struct r_rpcb_rmtcallres *objp = (struct r_rpcb_rmtcallres *)(void *)p;
 
-   if (!xdr_string(xdrs, >addr, (u_int)~0)) {
+   if (!xdr_string(xdrs, >addr, RPC_MAXDATASIZE)) {
return (FALSE);
}
if (!xdr_u_int(xdrs, >results.results_len)) {

Modified: head/lib/libc/rpc/rpcb_st_xdr.c
==
--- head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun  1 02:31:14 2017
(r319368)
+++ head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun  1 06:12:25 2017
(r319369)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 #include 
+#include 
 #include "un-namespace.h"
 
 /* Link list of all the stats about getport and getaddr */
@@ -63,7 +64,7 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
if (!xdr_int(xdrs, >failure)) {
return (FALSE);
   

Re: svn commit: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Ngie Cooper (yaneurabeya)

> On May 31, 2017, at 10:03 PM, Brooks Davis  wrote:
> 
> On Wed, May 31, 2017 at 08:01:12AM +, Ngie Cooper wrote:
>> Author: ngie
>> Date: Wed May 31 08:01:12 2017
>> New Revision: 319295
>> URL: https://svnweb.freebsd.org/changeset/base/319295
>> 
>> Log:
>>  Update the usr.bin/mkimg golden test output files after ^/head@r319125
>> 
>>  ^/head@r319125 changed the location of the backup pmbr, requiring the
>>  output files to be regenerated, since they're binary disk dumps.
>> 
>>  The output files were regenerated with "make rebase"--fixed in
>>  ^/head@r319294.
> 
> These should not be stored uuencoded.  It serves no purpose other
> than bloating the repo and causing spammy commit mails like this one
> where we got a huge tail of garbage output.

Hi Brooks,
I’m not entirely sure why the files were uuencoded to be honest. I 
think that’s a good question for Marcel and some of the folks at Juniper, since 
they wrote the tool/tests.
Thanks!
-Ngie

PS I agree based on what little I know, but I don’t necessarily know what trade 
offs were made with writing these tests.


signature.asc
Description: Message signed with OpenPGP