Re: svn commit: r326506 - in head/sys/contrib/zstd/lib: common compress

2017-12-03 Thread Bruce Evans

On Mon, 4 Dec 2017, Allan Jude wrote:


Log:
 Use __has_builtin() to ensure clz and clzll builtins are available

 The existing check of the GCC version number is not sufficient


It also checked a wrong version number, and still doesn't.


 This fixes the build on sparc64 in preparation for integrating ZSTD into
 the kernel for ZFS and Crash Dumps.


This doesn't really work.  __has_builtin() is a dummy (always 0) in
at least gcc-4.2.1 and earlier versions of gcc, and is broken as
designed in compilers that implement it.  It just tells you if the
compiler supports the builtin, but you don't want to know about the
builtin unless the builtin will generate better code for the target
arch than your alternative.  Using __has_builtin() is especially wrong
in the kernel and other pure freestanding cases.  Then the builtin
generates a libcall to nonexistent function unless the target arch
supports a better inline alternative.  Nonexistent functions are never
better alternatives than yours.


Modified: head/sys/contrib/zstd/lib/common/bitstream.h
==
--- head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:16:26 
2017(r326506)
@@ -175,7 +175,7 @@ MEM_STATIC unsigned BIT_highbit32 (register U32 val)
unsigned long r=0;
_BitScanReverse ( , val );
return (unsigned) r;
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */


This version check is very broken.  gcc-3.3.3 doesn't have __builtin_clz(),
but passes the check.


+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && __has_builtin(__builtin_clz)  
 /* Use GCC Intrinsic */


gcc-4.2.1 doesn't have __builtin_clz() on x86, but not __has_builtin().
sys/cdefs.h defines __has_builtin() as 0 unless __has_builtin is defined.

The first part of the test is now usually just an obfuscation.  It
still uses a wrong version number and a redumdant test that __GNUC__
is defined, but when (__GNUC__ < 3), __has_builtin() is usually 0
and gives the same result of 0.  It is only in the unusual (unsupported)
case where the compiler doesn't pretend to be gcc but defines __has_builtin()
that the first part of the check has an effect, and then its effect is to
break the second part.

sys/cdefs.h gives an example of a similar but presumably-correct version
check.  For using __builtin_unreachable(), it doesn't trust __has_builtin(),
but checks that the version is >= 4.6.  4.6 is fine-grained enough to have
a chance of being correct.


return 31 - __builtin_clz (val);


I think this is only for userland, so it is not broken when the builtin
reduce a libcall.  The libcall is presumably to __clzdi2().  The kernel
doesn't have this, but libgcc.a does.


#   else   /* Software version */
static const unsigned DeBruijnClz[32] = { 0,  9,  1, 10, 13, 21,  2, 29,


This is unreachable when the libcall is used.

If optimizing this is actually important, then so not is pessimizing it on
arches with the builtin implemented in hardware but __has_builtin() not
implemented.

Bruce
___
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: r326507 - head/stand/i386/zfsboot

2017-12-03 Thread Allan Jude
Author: allanjude
Date: Mon Dec  4 02:42:00 2017
New Revision: 326507
URL: https://svnweb.freebsd.org/changeset/base/326507

Log:
  increase maximum size of zfsboot
  
  Previous to the switch from sys/boot to stand/ zfsboot (used for MBR) did
  not support GELI. Now that it is compiled with GELI, it is running out of
  space.
  
  zfsldr (which loads zfsboot) was modified to load 256kb in r304321

Modified:
  head/stand/i386/zfsboot/Makefile

Modified: head/stand/i386/zfsboot/Makefile
==
--- head/stand/i386/zfsboot/MakefileMon Dec  4 01:16:26 2017
(r326506)
+++ head/stand/i386/zfsboot/MakefileMon Dec  4 02:42:00 2017
(r326507)
@@ -62,10 +62,10 @@ zfsldr.out: zfsldr.o
 CLEANFILES+=   zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o
 
-# We currently allow 128k bytes for zfsboot - in practice it could be
+# We currently allow 256k bytes for zfsboot - in practice it could be
 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
 # 
-BOOT2SIZE= 131072
+BOOT2SIZE= 262144
 
 zfsboot2: zfsboot.ld
@set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
___
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: r326506 - in head/sys/contrib/zstd/lib: common compress

2017-12-03 Thread Allan Jude
Author: allanjude
Date: Mon Dec  4 01:16:26 2017
New Revision: 326506
URL: https://svnweb.freebsd.org/changeset/base/326506

Log:
  Use __has_builtin() to ensure clz and clzll builtins are available
  
  The existing check of the GCC version number is not sufficient
  
  This fixes the build on sparc64 in preparation for integrating ZSTD into
  the kernel for ZFS and Crash Dumps.

Modified:
  head/sys/contrib/zstd/lib/common/bitstream.h
  head/sys/contrib/zstd/lib/common/zstd_internal.h
  head/sys/contrib/zstd/lib/compress/zstd_compress.h

Modified: head/sys/contrib/zstd/lib/common/bitstream.h
==
--- head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:16:26 
2017(r326506)
@@ -175,7 +175,7 @@ MEM_STATIC unsigned BIT_highbit32 (register U32 val)
 unsigned long r=0;
 _BitScanReverse ( , val );
 return (unsigned) r;
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && __has_builtin(__builtin_clz)  
 /* Use GCC Intrinsic */
 return 31 - __builtin_clz (val);
 #   else   /* Software version */
 static const unsigned DeBruijnClz[32] = { 0,  9,  1, 10, 13, 21,  2, 
29,

Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h
==
--- head/sys/contrib/zstd/lib/common/zstd_internal.hMon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/common/zstd_internal.hMon Dec  4 01:16:26 
2017(r326506)
@@ -327,7 +327,7 @@ MEM_STATIC U32 ZSTD_highbit32(U32 val)
 unsigned long r=0;
 _BitScanReverse(, val);
 return (unsigned)r;
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* GCC Intrinsic */
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && __has_builtin(__builtin_clz)  
 /* GCC Intrinsic */
 return 31 - __builtin_clz(val);
 #   else   /* Software version */
 static const int DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 
14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 
4, 31 };

Modified: head/sys/contrib/zstd/lib/compress/zstd_compress.h
==
--- head/sys/contrib/zstd/lib/compress/zstd_compress.h  Mon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/compress/zstd_compress.h  Mon Dec  4 01:16:26 
2017(r326506)
@@ -203,7 +203,7 @@ static unsigned ZSTD_NbCommonBytes (register size_t va
 unsigned long r = 0;
 _BitScanReverse64( , val );
 return (unsigned)(r>>3);
-#   elif defined(__GNUC__) && (__GNUC__ >= 4)
+#   elif defined(__GNUC__) && (__GNUC__ >= 4) && 
__has_builtin(__builtin_clzll)
 return (__builtin_clzll(val) >> 3);
 #   else
 unsigned r;
@@ -218,7 +218,7 @@ static unsigned ZSTD_NbCommonBytes (register size_t va
 unsigned long r = 0;
 _BitScanReverse( , (unsigned long)val );
 return (unsigned)(r>>3);
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && 
__has_builtin(__builtin_clz)
 return (__builtin_clz((U32)val) >> 3);
 #   else
 unsigned r;
___
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: r326505 - head/tools/boot

2017-12-03 Thread Warner Losh
Author: imp
Date: Mon Dec  4 01:14:17 2017
New Revision: 326505
URL: https://svnweb.freebsd.org/changeset/base/326505

Log:
  Remove the entire objdir tree to avoid picking up stale binaries from
  prior builds. Move GELI to building first.
  
  Sponsored by: Netflix

Modified:
  head/tools/boot/universe.sh

Modified: head/tools/boot/universe.sh
==
--- head/tools/boot/universe.sh Mon Dec  4 01:14:12 2017(r326504)
+++ head/tools/boot/universe.sh Mon Dec  4 01:14:17 2017(r326505)
@@ -26,6 +26,8 @@ dobuild()
 local opt=$3
 
 echo -n "Building $ta ${opt} ... "
+objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V .OBJDIR")
+rm -rf ${objdir}
 if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend 
cleandir obj depend"  \
 > $lf 2>&1; then
echo "Fail (cleanup)"
@@ -42,6 +44,16 @@ dobuild()
 top=$(make -V SRCTOP)
 cd $top/stand
 
+
+# Build without GELI
+for i in \
+   amd64/amd64 \
+   i386/i386 \
+   ; do
+ta=${i##*/}
+dobuild $ta _.boot.${ta}.no_geli.log "WITHOUT_LOADER_GEIL=yes"
+done
+
 # Default build for a goodly selection of architectures
 for i in \
amd64/amd64 \
@@ -73,13 +85,4 @@ for i in \
; do
 ta=${i##*/}
 dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes"
-done
-
-# Build without GELI
-for i in \
-   amd64/amd64 \
-   i386/i386 \
-   ; do
-ta=${i##*/}
-dobuild $ta _.boot.${ta}.no_geli.log "MK_LOADER_GELI=no"
 done
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r326504 - head/stand

2017-12-03 Thread Warner Losh
Author: imp
Date: Mon Dec  4 01:14:12 2017
New Revision: 326504
URL: https://svnweb.freebsd.org/changeset/base/326504

Log:
  Switch to proper MK_LOADER_GELI tests.
  
  Submitted by: peter@

Modified:
  head/stand/Makefile.amd64
  head/stand/Makefile.i386

Modified: head/stand/Makefile.amd64
==
--- head/stand/Makefile.amd64   Sun Dec  3 22:02:30 2017(r326503)
+++ head/stand/Makefile.amd64   Mon Dec  4 01:14:12 2017(r326504)
@@ -11,7 +11,7 @@ SUBDIR+=  ficl32
 SUBDIR+=   efi
 SUBDIR+=   userboot
 
-.if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
+.if ${MK_LOADER_GELI} == "yes"
 SUBDIR+=   geli
 .endif
 

Modified: head/stand/Makefile.i386
==
--- head/stand/Makefile.i386Sun Dec  3 22:02:30 2017(r326503)
+++ head/stand/Makefile.i386Mon Dec  4 01:14:12 2017(r326504)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
+.if ${MK_LOADER_GELI} == "yes"
 SUBDIR+=   geli
 .endif
 .if ${MK_ZFS} != "no"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326486 - in head/stand: ofw/libofw powerpc/boot1.chrp

2017-12-03 Thread Bruce Evans

On Sun, 3 Dec 2017, Warner Losh wrote:


On Sun, Dec 3, 2017 at 2:35 AM, Bruce Evans  wrote:


On Sun, 3 Dec 2017, Warner Losh wrote:

Log:

 Include machine/md_var to pick up __syncicache prototype.


This is nonsense.  machine/md_var.h is kernel-only, but on powerpc
it declares __syncicache() which also exists in userland.  This include
is like including the kernel-only header sys/systm.h to declare printf()
in userland.


Yea This is the sort of thing that should be defined in cpufunc.h or
similar. I didn't feel like moving it, so I made one more bad place in the
tree instead... So I agree with this feedback.


Not cpufunc.h.  I created it too (rgrimes committed it in 386BSD days).  It
is for turning CPU instructions into C functions (usually using inline asm
function wrappers of single instructions, where the function name should
be the same as the instrcution name to make it easier to rememember and
inhibit use in MI code) so that even MD code doesn't need to use any inline
asm.  It was intened to be kernel-only, but even I abused it in userland
for the inb() family of functions and later for rdtsc().

The inb() family later became a larger problem.  inb() is a special
case of bus_space_read_1() and shouldn't be used even to implement
bus-space since that gives namespace pollution.  Instead of fixing
this, the readb() family of functions was added to cpufunc.h.  readb()
is essentially bus_space_read_1() misimplemented for dev/fb.  It is
now misused in a couple of other places.

cpufunc.h is much more broken on non-x86 arches.  On arm, it has lots
of extern variables and only 2 inline asms.  1 of these is called by
many C inline non-asms that don't belong in cpufunc.h because they can be
built out of the main inline asm here and C definitions.  Putting everything
here gives namespace pollution.  Other arches have more inline asms and not
many extern variables, but have the pollution.  Some have macros instead of
inline functions.  This requires less pollution but is more fragile.

x86 has bogus non-asm wrappers only for a few functions like
intr_disable().  There is a problem making the inline functions visible
if they are in a different file.  The correct way of including
machine/cpu.h is to not explicitly include it, but depend on getting it
as standard pollution in sys/systm.h.  If the C parts were moved to
different files, then sys/systm.h would still have to include all of
the pollution for compatibility.

Bruce
___
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: r326503 - in head/sys/dev: rtwn/usb usb

2017-12-03 Thread George V. Neville-Neil
Author: gnn
Date: Sun Dec  3 22:02:30 2017
New Revision: 326503
URL: https://svnweb.freebsd.org/changeset/base/326503

Log:
  Add support for RealTek 8812 over USB
  
  Tested with ALFA AWUS036ACH
  
  MFC after:1 week

Modified:
  head/sys/dev/rtwn/usb/rtwn_usb_attach.h
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h
==
--- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Dec  3 20:36:36 2017
(r326502)
+++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Dec  3 22:02:30 2017
(r326503)
@@ -134,6 +134,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8812AU_DEV(MELCO,   WIU3866D),
RTWN_RTL8812AU_DEV(NEC, WL900U),
RTWN_RTL8812AU_DEV(PLANEX2, GW900D),
+   RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU),
RTWN_RTL8812AU_DEV(SENAO,   EUB1200AC),
RTWN_RTL8812AU_DEV(SITECOMEU,   WLA7100),
RTWN_RTL8812AU_DEV(TPLINK,  T4U),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Dec  3 20:36:36 2017(r326502)
+++ head/sys/dev/usb/usbdevsSun Dec  3 22:02:30 2017(r326503)
@@ -3886,6 +3886,7 @@ product REALTEK RTL8713   0x8713  RTL8713
 product REALTEK RTL8188CU_COMBO0x8754  RTL8188CU
 product REALTEK RTL8723BU  0xb720  RTL8723BU
 product REALTEK RTL8192SU  0xc512  RTL8192SU
+product REALTEK RTL8812AU  0x8812  RTL8812AU Wireless Adapter
 
 /* RedOctane products */
 product REDOCTANE DUMMY0x  Dummy product
___
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: r326486 - in head/stand: ofw/libofw powerpc/boot1.chrp

2017-12-03 Thread Warner Losh
On Sun, Dec 3, 2017 at 2:35 AM, Bruce Evans  wrote:

> On Sun, 3 Dec 2017, Warner Losh wrote:
>
> Log:
>>  Include machine/md_var to pick up __syncicache prototype.
>>
>
> This is nonsense.  machine/md_var.h is kernel-only, but on powerpc
> it declares __syncicache() which also exists in userland.  This include
> is like including the kernel-only header sys/systm.h to declare printf()
> in userland.
>

Yea This is the sort of thing that should be defined in cpufunc.h or
similar. I didn't feel like moving it, so I made one more bad place in the
tree instead... So I agree with this feedback.


> It is also an error to include machine/md_var.h in MI files in the
> kernel.  Approx. 72 of the 305 includes of it in -current have this
> bug.  The worst one is probably the one in altq_subr.c.  altq_subr.c
> abuses the MD variable cpu_feature to test for CPUID_TSC.  That is just
> the start of it layering violations and other bugs.


There's a number of swamps in the tree, alas. This is one of them...  I'm
draining the boot loader and associated programs swamp, which is a big
enough job as it is...

Modified: head/stand/ofw/libofw/elf_freebsd.c
>> 
>> ==
>> --- head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:49 2017
>> (r326485)
>> +++ head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:54 2017
>> (r326486)
>> @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$");
>>
>> #include 
>> #include 
>> +#if defined(__powerpc__)
>> +#include 
>> +#endif
>>
>
> Style bug (verbose spelling of 'ifdef').


Agreed. It matches the style used elsewhere, but that's a poor excuse.

Warner
___
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: r326502 - in head: . share/man/man7

2017-12-03 Thread Mark Johnston
Author: markj
Date: Sun Dec  3 20:36:36 2017
New Revision: 326502
URL: https://svnweb.freebsd.org/changeset/base/326502

Log:
  Document the sys/boot -> stand move in hier.7 and the top-level README.
  
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D13353

Modified:
  head/README
  head/README.md
  head/share/man/man7/hier.7

Modified: head/README
==
--- head/README Sun Dec  3 19:26:14 2017(r326501)
+++ head/README Sun Dec  3 20:36:36 2017(r326502)
@@ -66,6 +66,8 @@ secureCryptographic libraries and commands.
 
 share  Shared resources.
 
+stand  Boot loader sources.
+
 sysKernel sources.
 
 tests  Regression tests which can be run by Kyua.  See tests/README

Modified: head/README.md
==
--- head/README.md  Sun Dec  3 19:26:14 2017(r326501)
+++ head/README.md  Sun Dec  3 20:36:36 2017(r326502)
@@ -68,6 +68,8 @@ secureCryptographic libraries and 
commands.
 
 share  Shared resources.
 
+stand  Boot loader sources.
+
 sysKernel sources.
 
 tests  Regression tests which can be run by Kyua.  See 
tests/README

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Sun Dec  3 19:26:14 2017(r326501)
+++ head/share/man/man7/hier.7  Sun Dec  3 20:36:36 2017(r326502)
@@ -28,7 +28,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd November 16, 2017
+.Dd December 3, 2017
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -644,6 +644,8 @@ build directory for files in
 .It Pa share/
 source for files in
 .Pa /usr/share
+.It Pa stand/
+boot loader source code
 .It Pa sys/
 kernel source code
 .Bl -tag -width "opencrypto/" -compact
___
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: r326501 - head/sys/arm64/conf

2017-12-03 Thread Ed Schouten
Author: ed
Date: Sun Dec  3 19:26:14 2017
New Revision: 326501
URL: https://svnweb.freebsd.org/changeset/base/326501

Log:
  Make COMPAT_FREEBSD32 part of GENERIC on arm64.
  
  The cloudabi32.ko kernel modules can only be loaded on AMD64 and ARM64
  by kernels built with COMPAT_FREEBSD32. Even though COMPAT_FREEBSD32
  does not support the execution of native FreeBSD executables, do add it
  to GENERIC, to make cloudabi32.ko usable.
  
  According to size(1), this makes the kernel image approximately 0.7%
  larger.
  
  Reviewed by:  andrew, imp, emaste
  Differential Revision:https://reviews.freebsd.org/D13311

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Sun Dec  3 18:35:07 2017(r326500)
+++ head/sys/arm64/conf/GENERIC Sun Dec  3 19:26:14 2017(r326501)
@@ -52,6 +52,7 @@ options   PSEUDOFS# Pseudo-filesystem 
framework
 optionsGEOM_PART_GPT   # GUID Partition Tables.
 optionsGEOM_RAID   # Soft RAID functionality.
 optionsGEOM_LABEL  # Provides labelization
+optionsCOMPAT_FREEBSD32# Incomplete, but used by cloudabi32.ko.
 optionsCOMPAT_FREEBSD11# Compatible with FreeBSD11
 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
 optionsKTRACE  # ktrace(1) support
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r326497 - in head: etc/mtree tests/sys tests/sys/netipsec tests/sys/netipsec/tunnel

2017-12-03 Thread Kristof Provost
On 3 Dec 2017, at 19:20, Alan Somers wrote:
> On Sun, Dec 3, 2017 at 6:52 AM, Kristof Provost  wrote:
>
>> Author: kp
>> Date: Sun Dec  3 13:52:35 2017
>> New Revision: 326497
>> URL: https://svnweb.freebsd.org/changeset/base/326497
>>
>> Log:
>>   Add IPSec tests in tunnel mode
>>
>>   Some IPSec in tunnel mode allowing to test multiple IPSec
>>   configurations.  These tests are reusing the jail/vnet scripts from pf
>>   tests for generating complex network.
>>
>>   Submitted by: olivier@
>>   Differential Revision:https://reviews.freebsd.org/D13017
>>
> It's not ok to use kldunload during the test heads.  Everything  in the
> head methods gets executed when you do "kyua list".  Anything output gets
> interpreted by Kyua.  In this case, if kldunload outputs anything at all,
> Kyua will consider it to be a syntax error, and it will skip the entire
> file.  You should limit yourself to using just atf_set in the header.  Move
> the kld commands into the test case bodies.
>
Thanks. Done in r326500.

Regards,
Kristof
___
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: r326500 - head/tests/sys/netipsec/tunnel

2017-12-03 Thread Kristof Provost
Author: kp
Date: Sun Dec  3 18:35:07 2017
New Revision: 326500
URL: https://svnweb.freebsd.org/changeset/base/326500

Log:
  tests: ipsec: Don't load/unload aesni.ko in the test header
  
  We can't kldunload in the test head as Kyua interprets any output from
  them. This would lead to syntax errors and skipping the entire file.
  
  Move the kld commands into the test case bodies.
  
  Pointed out by: asomers@

Modified:
  head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh
  head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh
  head/tests/sys/netipsec/tunnel/aes_gcm_128.sh
  head/tests/sys/netipsec/tunnel/aes_gcm_256.sh
  head/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh
  head/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh
  head/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh
  head/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh

Modified: head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh
==
--- head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh Sun Dec  3 
16:57:28 2017(r326499)
+++ head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh Sun Dec  3 
18:35:07 2017(r326500)
@@ -7,12 +7,13 @@ v4_head()
 {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1'
atf_set require.user root
-   # Unload AESNI module if loaded
-   kldstat -q -n aesni && kldunload aesni
 }
 
 v4_body()
 {
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+
ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 
"12345678901234567890"
 }
 
@@ -26,12 +27,13 @@ v6_head()
 {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1'
atf_set require.user root
-   # Unload AESNI module if loaded
-   kldstat -q -n aesni && kldunload aesni
 }
 
 v6_body()
 {
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+
ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 
"12345678901234567890"
 }
 

Modified: head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh
==
--- head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh Sun Dec  3 
16:57:28 2017(r326499)
+++ head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh Sun Dec  3 
18:35:07 2017(r326500)
@@ -7,12 +7,13 @@ v4_head()
 {
atf_set descr 'IPSec inet4 tunnel using aes-cbc-256-hmac-sha2-256'
atf_set require.user root
-   # load AESNI module if not already
-   kldstat -q -n aesni || kldload aesni
 }
 
 v4_body()
 {
+   # load AESNI module if not already
+   kldstat -q -n aesni || kldload aesni
+
ist_test 4 rijndael-cbc "12345678901234567890123456789012" 
hmac-sha2-256 "12345678901234567890123456789012"
 }
 
@@ -26,12 +27,13 @@ v6_head()
 {
atf_set descr 'IPSec inet6 tunnel using aes-cbc-256-hmac-sha2-256'
atf_set require.user root
-   # load AESNI module if not already
-   kldstat -q -n aesni || kldload aesni
 }
 
 v6_body()
 {
+   # load AESNI module if not already
+   kldstat -q -n aesni || kldload aesni
+
ist_test 6 rijndael-cbc "12345678901234567890123456789012" 
hmac-sha2-256 "12345678901234567890123456789012"
 }
 

Modified: head/tests/sys/netipsec/tunnel/aes_gcm_128.sh
==
--- head/tests/sys/netipsec/tunnel/aes_gcm_128.sh   Sun Dec  3 16:57:28 
2017(r326499)
+++ head/tests/sys/netipsec/tunnel/aes_gcm_128.sh   Sun Dec  3 18:35:07 
2017(r326500)
@@ -7,12 +7,13 @@ v4_head()
 {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-128'
atf_set require.user root
-   # Unload AESNI module if loaded
-   kldstat -q -n aesni && kldunload aesni
 }
 
 v4_body()
 {
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+
ist_test 4 aes-gcm-16 "12345678901234567890"
 }
 
@@ -26,12 +27,13 @@ v6_head()
 {
atf_set descr 'IPSec inet6 tunnel using aes-gcm-128'
atf_set require.user root
-   # Unload AESNI module if loaded
-   kldstat -q -n aesni && kldunload aesni
 }
 
 v6_body()
 {
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+
ist_test 6 aes-gcm-16 "12345678901234567890"
 }
 

Modified: head/tests/sys/netipsec/tunnel/aes_gcm_256.sh
==
--- head/tests/sys/netipsec/tunnel/aes_gcm_256.sh   Sun Dec  3 16:57:28 
2017(r326499)
+++ head/tests/sys/netipsec/tunnel/aes_gcm_256.sh   Sun Dec  3 18:35:07 
2017(r326500)
@@ -7,12 +7,13 @@ v4_head()
 {
atf_set descr 'IPSec inet4 tunnel using aes-gcm-256'
atf_set require.user root
-   # Unload AESNI module if loaded
-   kldstat -q -n aesni && 

Re: svn commit: r326497 - in head: etc/mtree tests/sys tests/sys/netipsec tests/sys/netipsec/tunnel

2017-12-03 Thread Alan Somers
On Sun, Dec 3, 2017 at 6:52 AM, Kristof Provost  wrote:

> Author: kp
> Date: Sun Dec  3 13:52:35 2017
> New Revision: 326497
> URL: https://svnweb.freebsd.org/changeset/base/326497
>
> Log:
>   Add IPSec tests in tunnel mode
>
>   Some IPSec in tunnel mode allowing to test multiple IPSec
>   configurations.  These tests are reusing the jail/vnet scripts from pf
>   tests for generating complex network.
>
>   Submitted by: olivier@
>   Differential Revision:https://reviews.freebsd.org/D13017
>
> Added:
>   head/tests/sys/netipsec/
>   head/tests/sys/netipsec/Makefile   (contents, props changed)
>   head/tests/sys/netipsec/tunnel/
>   head/tests/sys/netipsec/tunnel/Makefile   (contents, props changed)
>   head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh   (contents,
> props changed)
>   head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh
>  (contents, props changed)
>   head/tests/sys/netipsec/tunnel/aes_gcm_128.sh   (contents, props
> changed)
>   head/tests/sys/netipsec/tunnel/aes_gcm_256.sh   (contents, props
> changed)
>   head/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh
>  (contents, props changed)
>   head/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh
>  (contents, props changed)
>   head/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh   (contents, props
> changed)
>   head/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh   (contents, props
> changed)
>   head/tests/sys/netipsec/tunnel/empty.sh   (contents, props changed)
>   head/tests/sys/netipsec/tunnel/utils.subr   (contents, props changed)
> Modified:
>   head/etc/mtree/BSD.tests.dist
>   head/tests/sys/Makefile
>
>
> Added: head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh Sun Dec
> 3 13:52:35 2017(r326497)
> @@ -0,0 +1,47 @@
> +# $FreeBSD$
> +
> +. $(atf_get_srcdir)/utils.subr
> +
> +atf_test_case "v4" "cleanup"
> +v4_head()
> +{
> +   atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1'
> +   atf_set require.user root
> +   # Unload AESNI module if loaded
> +   kldstat -q -n aesni && kldunload aesni
> +}
>
> It's not ok to use kldunload during the test heads.  Everything  in the
head methods gets executed when you do "kyua list".  Anything output gets
interpreted by Kyua.  In this case, if kldunload outputs anything at all,
Kyua will consider it to be a syntax error, and it will skip the entire
file.  You should limit yourself to using just atf_set in the header.  Move
the kld commands into the test case bodies.

-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"


svn commit: r326499 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common cddl/usr.sbin/dtrace/tests/com...

2017-12-03 Thread Mark Johnston
Author: markj
Date: Sun Dec  3 16:57:28 2017
New Revision: 326499
URL: https://svnweb.freebsd.org/changeset/base/326499

Log:
  Complete support for dtrace's -x setenv option.
  
  This allows one to override the environment for processes created with
  dtrace -c. By default, the environment is inherited.
  
  This support was originally merged from illumos in r249367 but was lost
  when the commit was later reverted and then brought back piecemeal.
  
  Reported by:  Samuel Lepetit 
  MFC after:2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d
   (contents, props changed)
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d
   (contents, props changed)
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out
   (contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h
  head/cddl/usr.sbin/dtrace/tests/common/Makefile
  head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile
  head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile
  head/etc/mtree/BSD.tests.dist

Added: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d
Sun Dec  3 16:57:28 2017(r326499)
@@ -0,0 +1,25 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#pragma D option setenv=balloon=something_bad_happens
+
+BEGIN
+{
+   exit(0);
+}

Added: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d
  Sun Dec  3 16:57:28 2017(r326499)
@@ -0,0 +1,25 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#pragma D option unsetenv=rectalexambot
+
+BEGIN
+{
+   exit(0);
+}

Added: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh
  Sun Dec  3 16:57:28 2017(r326499)
@@ -0,0 +1,33 @@
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# 

svn commit: r326498 - in head: . cddl/contrib/opensolaris/lib/libdtrace/common lib/libproc lib/libproc/tests

2017-12-03 Thread Mark Johnston
Author: markj
Date: Sun Dec  3 16:50:16 2017
New Revision: 326498
URL: https://svnweb.freebsd.org/changeset/base/326498

Log:
  Add an envp argument to proc_create().
  
  This is needed to support dtrace's -x setenv option.
  
  MFC after:2 weeks

Modified:
  head/ObsoleteFiles.inc
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
  head/lib/libproc/Makefile
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_create.c
  head/lib/libproc/tests/proc_test.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Dec  3 13:52:35 2017(r326497)
+++ head/ObsoleteFiles.inc  Sun Dec  3 16:50:16 2017(r326498)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20171203: libproc version bump
+OLD_LIBS+=usr/lib/libproc.so.4
+OLD_LIBS+=usr/lib32/libproc.so.4
 # 20171203: new clang import which bumps version from 5.0.0 to 5.0.1.
 OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/asan_interface.h

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.cSun Dec 
 3 13:52:35 2017(r326497)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.cSun Dec 
 3 16:50:16 2017(r326498)
@@ -967,7 +967,7 @@ dt_proc_create(dtrace_hdl_t *dtp, const char *file, ch
 #ifdef illumos
if ((dpr->dpr_proc = Pcreate(file, argv, , NULL, 0)) == NULL) {
 #else
-   if ((err = proc_create(file, argv, pcf, child_arg,
+   if ((err = proc_create(file, argv, NULL, pcf, child_arg,
>dpr_proc)) != 0) {
 #endif
return (dt_proc_error(dtp, dpr,

Modified: head/lib/libproc/Makefile
==
--- head/lib/libproc/Makefile   Sun Dec  3 13:52:35 2017(r326497)
+++ head/lib/libproc/Makefile   Sun Dec  3 16:50:16 2017(r326498)
@@ -37,7 +37,7 @@ CFLAGS+=  -I${SRCTOP}/cddl/contrib/opensolaris/lib/libc
 CFLAGS+=   -DNO_CTF
 .endif
 
-SHLIB_MAJOR=   4
+SHLIB_MAJOR=   5
 
 MAN=
 

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Sun Dec  3 13:52:35 2017(r326497)
+++ head/lib/libproc/libproc.h  Sun Dec  3 16:50:16 2017(r326498)
@@ -142,8 +142,8 @@ int proc_addr2sym(struct proc_handle *, uintptr_t, cha
 intproc_attach(pid_t pid, int flags, struct proc_handle **pphdl);
 intproc_continue(struct proc_handle *);
 intproc_clearflags(struct proc_handle *, int);
-intproc_create(const char *, char * const *, proc_child_func *, void *,
-   struct proc_handle **);
+intproc_create(const char *, char * const *, char * const *,
+   proc_child_func *, void *, struct proc_handle **);
 intproc_detach(struct proc_handle *, int);
 intproc_getflags(struct proc_handle *);
 intproc_name2sym(struct proc_handle *, const char *, const char *,

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Sun Dec  3 13:52:35 2017
(r326497)
+++ head/lib/libproc/proc_create.c  Sun Dec  3 16:50:16 2017
(r326498)
@@ -176,9 +176,10 @@ out:
 }
 
 int
-proc_create(const char *file, char * const *argv, proc_child_func *pcf,
-void *child_arg, struct proc_handle **pphdl)
+proc_create(const char *file, char * const *argv, char * const *envp,
+proc_child_func *pcf, void *child_arg, struct proc_handle **pphdl)
 {
+   extern char * const *environ;
struct proc_handle *phdl;
int error, status;
pid_t pid;
@@ -189,8 +190,7 @@ proc_create(const char *file, char * const *argv, proc
error = 0;
phdl = NULL;
 
-   /* Fork a new process. */
-   if ((pid = vfork()) == -1)
+   if ((pid = fork()) == -1)
error = errno;
else if (pid == 0) {
/* The child expects to be traced. */
@@ -200,18 +200,14 @@ proc_create(const char *file, char * const *argv, proc
if (pcf != NULL)
(*pcf)(child_arg);
 
-   /* Execute the specified file: */
+   if (envp != NULL)
+   environ = envp;
+
execvp(file, argv);
 
-   /* Couldn't execute the file. */
_exit(2);
/* NOTREACHED */
} else {
-   /* The parent owns the process handle. */
-   error = proc_init(pid, 0, PS_IDLE, );
-   if (error != 0)
-   goto bad;
-
/* Wait for the child process to stop. */
if (waitpid(pid, , WUNTRACED)

svn commit: r326497 - in head: etc/mtree tests/sys tests/sys/netipsec tests/sys/netipsec/tunnel

2017-12-03 Thread Kristof Provost
Author: kp
Date: Sun Dec  3 13:52:35 2017
New Revision: 326497
URL: https://svnweb.freebsd.org/changeset/base/326497

Log:
  Add IPSec tests in tunnel mode
  
  Some IPSec in tunnel mode allowing to test multiple IPSec
  configurations.  These tests are reusing the jail/vnet scripts from pf
  tests for generating complex network.
  
  Submitted by: olivier@
  Differential Revision:https://reviews.freebsd.org/D13017

Added:
  head/tests/sys/netipsec/
  head/tests/sys/netipsec/Makefile   (contents, props changed)
  head/tests/sys/netipsec/tunnel/
  head/tests/sys/netipsec/tunnel/Makefile   (contents, props changed)
  head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh   (contents, props 
changed)
  head/tests/sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256.sh   (contents, 
props changed)
  head/tests/sys/netipsec/tunnel/aes_gcm_128.sh   (contents, props changed)
  head/tests/sys/netipsec/tunnel/aes_gcm_256.sh   (contents, props changed)
  head/tests/sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1.sh   (contents, 
props changed)
  head/tests/sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256.sh   
(contents, props changed)
  head/tests/sys/netipsec/tunnel/aesni_aes_gcm_128.sh   (contents, props 
changed)
  head/tests/sys/netipsec/tunnel/aesni_aes_gcm_256.sh   (contents, props 
changed)
  head/tests/sys/netipsec/tunnel/empty.sh   (contents, props changed)
  head/tests/sys/netipsec/tunnel/utils.subr   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/tests/sys/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Sun Dec  3 12:14:34 2017
(r326496)
+++ head/etc/mtree/BSD.tests.dist   Sun Dec  3 13:52:35 2017
(r326497)
@@ -478,6 +478,10 @@
 ..
 netinet
 ..
+netipsec
+tunnel
+..
+..
 netpfil
 pf
 ..

Modified: head/tests/sys/Makefile
==
--- head/tests/sys/Makefile Sun Dec  3 12:14:34 2017(r326496)
+++ head/tests/sys/Makefile Sun Dec  3 13:52:35 2017(r326497)
@@ -13,6 +13,7 @@ TESTS_SUBDIRS+=   kqueue
 TESTS_SUBDIRS+=mac
 TESTS_SUBDIRS+=mqueue
 TESTS_SUBDIRS+=netinet
+TESTS_SUBDIRS+=netipsec
 TESTS_SUBDIRS+=netpfil
 TESTS_SUBDIRS+=opencrypto
 TESTS_SUBDIRS+=posixshm

Added: head/tests/sys/netipsec/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netipsec/MakefileSun Dec  3 13:52:35 2017
(r326497)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+TESTSDIR=  ${TESTSBASE}/sys/netipsec
+
+TESTS_SUBDIRS+=tunnel
+
+.include 

Added: head/tests/sys/netipsec/tunnel/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netipsec/tunnel/Makefile Sun Dec  3 13:52:35 2017
(r326497)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+PACKAGE=   tests
+
+TESTSDIR=   ${TESTSBASE}/sys/netipsec/tunnel
+
+ATF_TESTS_SH+= empty \
+   aes_cbc_128_hmac_sha1 \
+   aes_cbc_256_hmac_sha2_256 \
+   aes_gcm_128 \
+   aes_gcm_256 \
+   aesni_aes_cbc_128_hmac_sha1 \
+   aesni_aes_cbc_256_hmac_sha2_256 \
+   aesni_aes_gcm_128 \
+   aesni_aes_gcm_256
+
+${PACKAGE}FILES+=  utils.subr
+
+.include 

Added: head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netipsec/tunnel/aes_cbc_128_hmac_sha1.sh Sun Dec  3 
13:52:35 2017(r326497)
@@ -0,0 +1,47 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "v4" "cleanup"
+v4_head()
+{
+   atf_set descr 'IPSec inet4 tunnel using aes-cbc-128-hmac-sha1'
+   atf_set require.user root
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+}
+
+v4_body()
+{
+   ist_test 4 rijndael-cbc "1234567890123456" hmac-sha1 
"12345678901234567890"
+}
+
+v4_cleanup()
+{
+   ist_cleanup
+}
+
+atf_test_case "v6" "cleanup"
+v6_head()
+{
+   atf_set descr 'IPSec inet6 tunnel using aes-cbc-128-hmac-sha1'
+   atf_set require.user root
+   # Unload AESNI module if loaded
+   kldstat -q -n aesni && kldunload aesni
+}
+
+v6_body()
+{
+   ist_test 6 rijndael-cbc "1234567890123456" hmac-sha1 
"12345678901234567890"
+}
+
+v6_cleanup()
+{
+   ist_cleanup
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case "v4"
+   

svn commit: r326496 - in head: . contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/Support contrib/l...

2017-12-03 Thread Dimitry Andric
/etc/mtree/BSD.debug.dist
  head/etc/mtree/BSD.usr.dist
  head/lib/clang/headers/Makefile
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/clang/Config/config.h
  head/lib/clang/include/lld/Config/Version.inc
  head/lib/clang/include/llvm/Config/config.h
  head/lib/clang/include/llvm/Config/llvm-config.h
  head/lib/clang/include/llvm/Support/VCSRevision.h
  head/lib/libclang_rt/Makefile.inc
  head/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  head/contrib/compiler-rt/   (props changed)
  head/contrib/libc++/   (props changed)
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)
  head/contrib/llvm/tools/lld/   (props changed)
  head/contrib/llvm/tools/lldb/   (props changed)

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Dec  3 04:55:38 2017(r326495)
+++ head/ObsoleteFiles.inc  Sun Dec  3 12:14:34 2017(r326496)
@@ -38,6 +38,123 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20171203: new clang import which bumps version from 5.0.0 to 5.0.1.
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/allocator_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/asan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/common_interface_defs.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/coverage_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/dfsan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/esan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/linux_syscall_hooks.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/lsan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/msan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface_atomic.h
+OLD_DIRS+=usr/lib/clang/5.0.0/include/sanitizer
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_builtin_vars.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_cmath.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_complex_builtins.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_intrinsics.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_math_forward_declares.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_runtime_wrapper.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__stddef_max_align_t.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_aes.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_pclmul.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/adxintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/altivec.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/ammintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/arm_acle.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/arm_neon.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/armintr.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx2intrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512bwintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512cdintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512dqintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512erintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512fintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmaintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmavlintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512pfintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmiintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmivlintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlbwintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlcdintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vldqintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vpopcntdqintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/avxintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/bmi2intrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/bmiintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/clflushoptintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/clzerointrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/cpuid.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/emmintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/f16cintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/fma4intrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/fmaintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/fxsrintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/htmintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/htmxlintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/ia32intrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/immintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/lwpintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/lzcntintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/mm3dnow.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/mm_malloc.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/mmintrin.h
+OLD_FILES+=usr/lib/clang/5.0.0/include/module.modulemap
+OLD_FILES+=usr/lib/clang/5.0.0/include/msa.h
+OLD_FILES+=usr/lib/clang/5.0.0

Re: svn commit: r326486 - in head/stand: ofw/libofw powerpc/boot1.chrp

2017-12-03 Thread Bruce Evans

On Sat, 2 Dec 2017, Warner Losh wrote:


On Sat, Dec 2, 2017 at 7:18 PM, Eitan Adler  wrote:


I'd like to remove floppy drive support from FreeBSD:


No thanks.


- The physical media is no longer produced


Old media still exists.


There's still one company producing 3.5" floppies, though it's in super low
volume. And the media is still readily available.


Supplier #2 near here still has 2 types of floppy drives in stock: 3.5 inch
standard floppy drive and 3.5 inch USB floppy drive.

You might be right about 5.25 inch media not being produced.  On ebay the
average price seems to be higher than new even for media that is guaranteed
to have errors, so this media must be rare but needed.


- Computers produced in the last 10-15 years don't have a floppy drive
reader


More like 8 years, but regardless of the actual year, that's also a weak
argument.


No need to break the software to match.


- There are still a few open bug reports relating to floppies(!)


That would show it's still in use.


More likely that the PRs are being handled properly by not closing old
ones.


- Its several thousand lines of code that could be removed


Clang is much more than that.


Is there any reason to continue supporting floppy drives in FreeBSD 12.0+?


That's a backwards question to project.

However, to make your argument legit:

Floppy support has been decaying for years. It hasn't worked well since
FreeBSD 6, and was completely broken sometime after FreeBSD 10 was
branched. We lost support for having two floppies on the same bus around
FreeBSD 7. And using fdcontrol to set the format became tricking between
FreeBSD 8 and 9. Floppies written today contain garbage due to ISA DMA
breakages post FreeBSD 10. They simply don't work at all in 11, and nobody
has stepped up to fix them. (I tried last summer, and gave up and got a
kyroflux.com board instead). Floppies used to be important, but not any


I don't see many problems.  -current i386 built last month worked perfectly
for the following tests on hardware from 2003 with 1GB RAM (perhaps the DMA
problem only affects amd64 with RAM above 4GB?):
- compare 12 1440K floppies with their image backups
- reformat one (using FreeBSD-~5 fdformat binary -- success show that the
  formatting ioctls are not broken)
- write back original image to the reformatted one
- verify last step under FreeBSD-5.


more. We've lost the only platform that required one to boot off floppies
(pc98) and the older x86 that required it doesn't run FreeBSD anymore
anyway. We never supported fdc on non x86 platforms, so those aren't a
consideration.

We do have some floppy support in umass, but that should stay since USB
floppy drives are still a thing.

Normally, I'd argue we might want to have a release where it's deprecated,
but it already was unusable in 11, and barely usable in 10 and has been a
shadow of its former self for much longer than that.


I only noticed much breakage of special fd ioctls.  The fd driver and
utilities seem to be fully usable on some hardware in FreeBSD-current.

Bruce
___
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: r326486 - in head/stand: ofw/libofw powerpc/boot1.chrp

2017-12-03 Thread Bruce Evans

On Sun, 3 Dec 2017, Warner Losh wrote:


Log:
 Include machine/md_var to pick up __syncicache prototype.


This is nonsense.  machine/md_var.h is kernel-only, but on powerpc
it declares __syncicache() which also exists in userland.  This include
is like including the kernel-only header sys/systm.h to declare printf()
in userland.

It is also an error to include machine/md_var.h in MI files in the
kernel.  Approx. 72 of the 305 includes of it in -current have this
bug.  The worst one is probably the one in altq_subr.c.  altq_subr.c
abuses the MD variable cpu_feature to test for CPUID_TSC.  That is just
the start of it layering violations and other bugs.


Modified: head/stand/ofw/libofw/elf_freebsd.c
==
--- head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:49 2017
(r326485)
+++ head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:54 2017
(r326486)
@@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$");

#include 
#include 
+#if defined(__powerpc__)
+#include 
+#endif


Style bug (verbose spelling of 'ifdef').

Bruce
___
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"