Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Bruce Evans

On Mon, 30 Jan 2017, Conrad Meyer wrote:


On Mon, Jan 30, 2017 at 9:26 PM, Bruce Evans  wrote:

On Tue, 31 Jan 2017, Conrad E. Meyer wrote:


Log:
 calculate_crc32c: Add SSE4.2 implementation on x86


This breaks building with gcc-4.2.1,


gcc-4.2.1 is an ancient compiler.  Good riddance.


I prefer it.


Added: head/sys/libkern/x86/crc32_sse42.c

==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/libkern/x86/crc32_sse42.c  Tue Jan 31 03:26:32 2017
(r313006)
+
+#include 


...

Inline asm is much less unportable than intrinsics.  kib used the correct
method of .byte's in asms to avoid depending on assembler support for newer
instructions.  .byte is still used for clflush on amd64 and i386.  It
used to be used for invpcid on amd64.  I can't find where it is or was
used for xsave stuff.


Konstantin predicted this complaint in code review (phabricator).
Unfortunately, Clang does not automatically unroll asms, even with the
correct mnemonic.  Unrolling is essential to performance below the
by-3 block size (768 bytes in this implementation).  Hand unrolling in
C seems to generate less efficient assembly than the compiler's
unrolling.


Unorolling is almost completely useless if the instruction takes 3 cycles
like you said it does.  The loop calculations run much faster than that,
so they can run in parallel.  However, clang generates horrible code for
inline asms instead of intrinsics.

Simple asms can be compiled even by gcc (apparently old binutils supports
SSE4):

X Index: crc32_sse42.c
X ===
X --- crc32_sse42.c (revision 313007)
X +++ crc32_sse42.c (working copy)
X @@ -38,8 +38,29 @@
X  #include 
X  #endif
X 
X -#include 

X +static __inline uint32_t
X +_mm_crc32_u8(uint32_t x, uint8_t y)
X +{
X + __asm("crc32b %1,%0" : "+r" (x) : "rm" (y));
X + return (x);
X +}
X 
X +static __inline uint32_t __unused

X +_mm_crc32_u32(uint32_t x, int32_t y)
X +{
X + __asm("crc32l %1,%0" : "+r" (x) : "rm" (y));
X + return (x);
X +}
X +
X +#ifdef __amd64__
X +static __inline uint64_t
X +_mm_crc32_u64(uint64_t x, int64_t y)
X +{
X + __asm("crc32q %1,%0" : "+r" (x) : "rm" (y));
X + return (x);
X +}
X +#endif
X +
X  /* CRC-32C (iSCSI) polynomial in reversed bit order. */
X  #define POLY 0x82f63b78

I only tested this at compile time.  clang generates horrible code.
Starting with y in an array in memory, it always copies y to the
stack and does a memory access there.  There is nothing special about
these inline asms, so I think clang does the same pessimizations for
most asms in cpufunc.h.  jkim got annoyed by this for something like
rdtsc() and changed too much to reduce the problem for just one case.
The differences in the generated code look like:

intrinsincs (old <) vs inline asm (new >):
28,29c29,33
This Inner Loop Header: Depth=1


svn commit: r313010 - in vendor-crypto/openssh/dist: . contrib contrib/cygwin contrib/redhat contrib/suse openbsd-compat openbsd-compat/regress regress regress/misc regress/misc/kexfuzz regress/uni...

2017-01-31 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Jan 31 12:29:48 2017
New Revision: 313010
URL: https://svnweb.freebsd.org/changeset/base/313010

Log:
  Vendor import of OpenSSH 7.3p1.

Added:
  vendor-crypto/openssh/dist/.skipped-commit-ids
  vendor-crypto/openssh/dist/openbsd-compat/bsd-err.c
  vendor-crypto/openssh/dist/platform-tracing.c
  vendor-crypto/openssh/dist/regress/cfginclude.sh
  vendor-crypto/openssh/dist/regress/misc/
  vendor-crypto/openssh/dist/regress/misc/Makefile
  vendor-crypto/openssh/dist/regress/misc/kexfuzz/
  vendor-crypto/openssh/dist/regress/misc/kexfuzz/Makefile
  vendor-crypto/openssh/dist/regress/misc/kexfuzz/README
  vendor-crypto/openssh/dist/regress/misc/kexfuzz/kexfuzz.c
  vendor-crypto/openssh/dist/regress/sshcfgparse.sh
  vendor-crypto/openssh/dist/regress/unittests/utf8/
  vendor-crypto/openssh/dist/regress/unittests/utf8/Makefile
  vendor-crypto/openssh/dist/regress/unittests/utf8/tests.c
  vendor-crypto/openssh/dist/utf8.c
  vendor-crypto/openssh/dist/utf8.h
Deleted:
  vendor-crypto/openssh/dist/.cvsignore
  vendor-crypto/openssh/dist/openbsd-compat/.cvsignore
  vendor-crypto/openssh/dist/openbsd-compat/regress/.cvsignore
  vendor-crypto/openssh/dist/regress/.cvsignore
  vendor-crypto/openssh/dist/roaming.h
  vendor-crypto/openssh/dist/scard/
Modified:
  vendor-crypto/openssh/dist/ChangeLog
  vendor-crypto/openssh/dist/INSTALL
  vendor-crypto/openssh/dist/Makefile.in
  vendor-crypto/openssh/dist/PROTOCOL
  vendor-crypto/openssh/dist/PROTOCOL.agent
  vendor-crypto/openssh/dist/PROTOCOL.certkeys
  vendor-crypto/openssh/dist/PROTOCOL.chacha20poly1305
  vendor-crypto/openssh/dist/README
  vendor-crypto/openssh/dist/audit-linux.c
  vendor-crypto/openssh/dist/auth-krb5.c
  vendor-crypto/openssh/dist/auth-options.c
  vendor-crypto/openssh/dist/auth-pam.c
  vendor-crypto/openssh/dist/auth-pam.h
  vendor-crypto/openssh/dist/auth-passwd.c
  vendor-crypto/openssh/dist/auth-rh-rsa.c
  vendor-crypto/openssh/dist/auth-rhosts.c
  vendor-crypto/openssh/dist/auth.c
  vendor-crypto/openssh/dist/auth.h
  vendor-crypto/openssh/dist/auth2-chall.c
  vendor-crypto/openssh/dist/auth2-hostbased.c
  vendor-crypto/openssh/dist/auth2.c
  vendor-crypto/openssh/dist/authfile.c
  vendor-crypto/openssh/dist/canohost.c
  vendor-crypto/openssh/dist/canohost.h
  vendor-crypto/openssh/dist/channels.c
  vendor-crypto/openssh/dist/cipher-bf1.c
  vendor-crypto/openssh/dist/cipher.c
  vendor-crypto/openssh/dist/clientloop.c
  vendor-crypto/openssh/dist/compat.c
  vendor-crypto/openssh/dist/config.h.in
  vendor-crypto/openssh/dist/configure
  vendor-crypto/openssh/dist/configure.ac
  vendor-crypto/openssh/dist/contrib/cygwin/README
  vendor-crypto/openssh/dist/contrib/redhat/openssh.spec
  vendor-crypto/openssh/dist/contrib/ssh-copy-id
  vendor-crypto/openssh/dist/contrib/suse/openssh.spec
  vendor-crypto/openssh/dist/defines.h
  vendor-crypto/openssh/dist/dh.c
  vendor-crypto/openssh/dist/dh.h
  vendor-crypto/openssh/dist/kex.c
  vendor-crypto/openssh/dist/kex.h
  vendor-crypto/openssh/dist/kexc25519.c
  vendor-crypto/openssh/dist/kexdh.c
  vendor-crypto/openssh/dist/kexdhc.c
  vendor-crypto/openssh/dist/kexdhs.c
  vendor-crypto/openssh/dist/kexgexs.c
  vendor-crypto/openssh/dist/key.c
  vendor-crypto/openssh/dist/log.c
  vendor-crypto/openssh/dist/log.h
  vendor-crypto/openssh/dist/mac.c
  vendor-crypto/openssh/dist/mac.h
  vendor-crypto/openssh/dist/misc.c
  vendor-crypto/openssh/dist/misc.h
  vendor-crypto/openssh/dist/moduli
  vendor-crypto/openssh/dist/moduli.0
  vendor-crypto/openssh/dist/monitor.c
  vendor-crypto/openssh/dist/monitor_fdpass.c
  vendor-crypto/openssh/dist/monitor_wrap.c
  vendor-crypto/openssh/dist/monitor_wrap.h
  vendor-crypto/openssh/dist/mux.c
  vendor-crypto/openssh/dist/myproposal.h
  vendor-crypto/openssh/dist/opacket.h
  vendor-crypto/openssh/dist/openbsd-compat/Makefile.in
  vendor-crypto/openssh/dist/openbsd-compat/arc4random.c
  vendor-crypto/openssh/dist/openbsd-compat/bindresvport.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-asprintf.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-snprintf.c
  vendor-crypto/openssh/dist/openbsd-compat/inet_aton.c
  vendor-crypto/openssh/dist/openbsd-compat/openbsd-compat.h
  vendor-crypto/openssh/dist/openbsd-compat/port-solaris.h
  vendor-crypto/openssh/dist/openbsd-compat/vis.c
  vendor-crypto/openssh/dist/openbsd-compat/vis.h
  vendor-crypto/openssh/dist/openbsd-compat/xcrypt.c
  vendor-crypto/openssh/dist/packet.c
  vendor-crypto/openssh/dist/packet.h
  vendor-crypto/openssh/dist/pathnames.h
  vendor-crypto/openssh/dist/platform.c
  vendor-crypto/openssh/dist/platform.h
  vendor-crypto/openssh/dist/progressmeter.c
  vendor-crypto/openssh/dist/readconf.c
  vendor-crypto/openssh/dist/readconf.h
  vendor-crypto/openssh/dist/regress/Makefile
  vendor-crypto/openssh/dist/regress/agent-getpeereid.sh
  vendor-crypto/openssh/dist/regress/cert-hostkey.s

svn commit: r313011 - vendor-crypto/openssh/7.3p1

2017-01-31 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Jan 31 12:31:38 2017
New Revision: 313011
URL: https://svnweb.freebsd.org/changeset/base/313011

Log:
  Tag OpenSSH 7.3p1.

Added:
  vendor-crypto/openssh/7.3p1/
 - copied from r313010, vendor-crypto/openssh/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313012 - in vendor-crypto/openssh/dist: . contrib contrib/redhat contrib/suse openbsd-compat regress regress/misc/kexfuzz regress/unittests regress/unittests/bitmap regress/unittests/h...

2017-01-31 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Jan 31 12:33:47 2017
New Revision: 313012
URL: https://svnweb.freebsd.org/changeset/base/313012

Log:
  Vendor import of OpenSSH 7.4p1.

Added:
  vendor-crypto/openssh/dist/openbsd-compat/strcasestr.c
  vendor-crypto/openssh/dist/regress/allow-deny-users.sh
  vendor-crypto/openssh/dist/regress/keygen-moduli.sh
  vendor-crypto/openssh/dist/regress/moduli.in
  vendor-crypto/openssh/dist/regress/unittests/match/
  vendor-crypto/openssh/dist/regress/unittests/match/Makefile
  vendor-crypto/openssh/dist/regress/unittests/match/tests.c
Deleted:
  vendor-crypto/openssh/dist/auth-chall.c
  vendor-crypto/openssh/dist/auth-rh-rsa.c
  vendor-crypto/openssh/dist/auth-rsa.c
  vendor-crypto/openssh/dist/auth1.c
  vendor-crypto/openssh/dist/monitor_mm.c
  vendor-crypto/openssh/dist/monitor_mm.h
  vendor-crypto/openssh/dist/openbsd-compat/xmmap.c
Modified:
  vendor-crypto/openssh/dist/.skipped-commit-ids
  vendor-crypto/openssh/dist/CREDITS
  vendor-crypto/openssh/dist/ChangeLog
  vendor-crypto/openssh/dist/INSTALL
  vendor-crypto/openssh/dist/Makefile.in
  vendor-crypto/openssh/dist/PROTOCOL
  vendor-crypto/openssh/dist/README
  vendor-crypto/openssh/dist/README.platform
  vendor-crypto/openssh/dist/README.privsep
  vendor-crypto/openssh/dist/TODO
  vendor-crypto/openssh/dist/aclocal.m4
  vendor-crypto/openssh/dist/addrmatch.c
  vendor-crypto/openssh/dist/atomicio.c
  vendor-crypto/openssh/dist/audit-bsm.c
  vendor-crypto/openssh/dist/audit-linux.c
  vendor-crypto/openssh/dist/audit.c
  vendor-crypto/openssh/dist/audit.h
  vendor-crypto/openssh/dist/auth-options.c
  vendor-crypto/openssh/dist/auth-options.h
  vendor-crypto/openssh/dist/auth-pam.c
  vendor-crypto/openssh/dist/auth-pam.h
  vendor-crypto/openssh/dist/auth-rhosts.c
  vendor-crypto/openssh/dist/auth.c
  vendor-crypto/openssh/dist/auth.h
  vendor-crypto/openssh/dist/auth2-pubkey.c
  vendor-crypto/openssh/dist/authfile.c
  vendor-crypto/openssh/dist/buildpkg.sh.in
  vendor-crypto/openssh/dist/chacha.h
  vendor-crypto/openssh/dist/channels.c
  vendor-crypto/openssh/dist/channels.h
  vendor-crypto/openssh/dist/cipher-3des1.c
  vendor-crypto/openssh/dist/cipher-bf1.c
  vendor-crypto/openssh/dist/cipher-chachapoly.c
  vendor-crypto/openssh/dist/cipher.c
  vendor-crypto/openssh/dist/cipher.h
  vendor-crypto/openssh/dist/clientloop.c
  vendor-crypto/openssh/dist/clientloop.h
  vendor-crypto/openssh/dist/config.guess
  vendor-crypto/openssh/dist/config.h.in
  vendor-crypto/openssh/dist/config.sub
  vendor-crypto/openssh/dist/configure
  vendor-crypto/openssh/dist/configure.ac
  vendor-crypto/openssh/dist/contrib/Makefile
  vendor-crypto/openssh/dist/contrib/gnome-ssh-askpass2.c
  vendor-crypto/openssh/dist/contrib/redhat/openssh.spec
  vendor-crypto/openssh/dist/contrib/suse/openssh.spec
  vendor-crypto/openssh/dist/defines.h
  vendor-crypto/openssh/dist/dh.c
  vendor-crypto/openssh/dist/entropy.h
  vendor-crypto/openssh/dist/gss-genr.c
  vendor-crypto/openssh/dist/hostfile.c
  vendor-crypto/openssh/dist/kex.c
  vendor-crypto/openssh/dist/kex.h
  vendor-crypto/openssh/dist/kexgexc.c
  vendor-crypto/openssh/dist/kexgexs.c
  vendor-crypto/openssh/dist/key.h
  vendor-crypto/openssh/dist/krl.c
  vendor-crypto/openssh/dist/mac.c
  vendor-crypto/openssh/dist/match.c
  vendor-crypto/openssh/dist/md5crypt.h
  vendor-crypto/openssh/dist/mdoc2man.awk
  vendor-crypto/openssh/dist/misc.c
  vendor-crypto/openssh/dist/misc.h
  vendor-crypto/openssh/dist/moduli
  vendor-crypto/openssh/dist/moduli.c
  vendor-crypto/openssh/dist/monitor.c
  vendor-crypto/openssh/dist/monitor.h
  vendor-crypto/openssh/dist/monitor_wrap.c
  vendor-crypto/openssh/dist/monitor_wrap.h
  vendor-crypto/openssh/dist/mux.c
  vendor-crypto/openssh/dist/myproposal.h
  vendor-crypto/openssh/dist/opacket.h
  vendor-crypto/openssh/dist/openbsd-compat/Makefile.in
  vendor-crypto/openssh/dist/openbsd-compat/base64.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-asprintf.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cray.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cray.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-nextstep.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-nextstep.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-openpty.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-poll.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-setres_id.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-setres_id.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-statvfs.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-statvfs.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-waitpid.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-waitpid.h
  vendor-crypto/openssh/dist/openbsd-compat/explicit_bzero.c
  vendor-crypto/openssh/dist/openbsd-compat/fake-rfc2

svn commit: r313013 - vendor-crypto/openssh/7.4p1

2017-01-31 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Jan 31 12:33:59 2017
New Revision: 313013
URL: https://svnweb.freebsd.org/changeset/base/313013

Log:
  Tag OpenSSH 7.4p1.

Added:
  vendor-crypto/openssh/7.4p1/
 - copied from r313012, vendor-crypto/openssh/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r312702 - in head/sys: kern libkern sys

2017-01-31 Thread Bruce Evans

On Wed, 25 Jan 2017, Bruce Evans wrote:


On Tue, 24 Jan 2017, Conrad E. Meyer wrote:


Log:
 Use time_t for intermediate values to avoid overflow in clock_ts_to_ct


This is bogus.  time_t is for storing times in seconds, not for times in
days, hours or minutes.


These bugs are still present.

Bounds checking for presposterous values in privileged syscalls is
silly, especially it is incomplete.  There are thousands of sysctls
that privileged users can use to shoot themself even more easily.

Just near the settimeofday() syscall, similar foot shooting can be
accomplished directly using the adjkerntz sysctl.  Changes to this
normally update the RTC immediately.  This is correct if the changes
are correct.  Small garbage values give garbage in the RTC and large
garbage values give overflows.  Bounds checking in this commit sometimes
detects these overflows.

Foot-shooting can also be accomplished indirectly using adjkerntz.
Set it to a large (in magnitude) value that doesn't cause overflows.
This augments the overflows in the next call to settimeofday().

The fix is not to add bounds checking to all sysctls.  Even restricting
according to securelevel wouldn't work right, since securelevel doesn't
work right.  In sys/kern, there are only 10 sysctls (not includinging
adjkerntz) restricted by securelevel.  However, settimeofday() is
restricted by securelevel.  You can't set the time backwards at high
securelevels, but you can still set the RTC to anything using adjkerntz
at high securelevels.

settimeofday() gives another unsecured method with results similar to
adjkerntz for panicing and corrupting the RTC.  set/gettimeofday()
still support timezones, and resettodr() adds both adjkerntz and
(tz_minuteswest * 60) to convert the kernel time to the RTC time.  Both
of these additions are FreeBSD features.  adjkerntz is necessary to
support normal use of the RTC on x86 (it is on local time), but
timezones in the kernel were deprecated 25 years ago, so why use them
now?  On my systems, adjkerntz is always used and I never used
tz_minutewest until today to demonstrate foot shooting.  The man page
says that the timezone is no longer used; actually, it is used for this
foot shooting.

There are many bugs in the implementation of the foot-shooting:

A: There are no bounds check on tz_minuteswest, so expressions like
(tz_minuteswest * 60) may overflow before the foot is the target.
settimeofday() tries to be careful about the order of operations, but
there is no order that just works for the dependent operations of
setting the time and the timezone.  The new timezone should be set
before setting the time, since the timezone is needed for the RTC part
of setting the time, and settings should be reversible in case one
part fails.  In practice, the time is set first, and if this succeeds
then further errors are mostly not detected, but sometimes cause panics;
then the RTC is set using a non-atomic copy of the pair (adjkerntz,
tz_minuteswest), where tz_minuteswest was usually set by the previous
settimeofday() call.  Then tz_minuteswest is set for this call.

B: There is no interlocking for any of this.  adjkerntz and tz_minuteswest
are plain ints, so reading them is probably atomic, but any number of
adjkerntz sysctls and settimeofday() syscalls can race each other.
The adjkerntz sysctl claims to be MPSAFE, but does nothing special.
It just overwrites the adjkerntz using a hopefully-atomic access, then
calls resettodr() like settime().  kib added some locking around the
hardware part of resettodr(), and did more careful things for the
boottime offset for timecounters.  The boottime offset is more important
since it is used for every CLOCK_REALTIME timecounter call, and needs
atomic accesses more since it is larger than an int.

Some of the interlocking belongs in applications.  E.g., after setting
the time, read the time and the monotonic time to check that the
(monotonic) time taken to set the time was not so long as to make the
setting too out of date, and retry until it was not too out of date.
Coherency between separate settings of the time and the RTC could be
maintained in the same way, but since the kernel sets both it do the
check.  Granularity of the x86 RTC is 1 second, and accuracy is worse,
so a long lag is acceptable, but this is MD.  My version doesn't bother
doing RTC updates for differences of less than 2 seconds.


 Add additionally safety and overflow checks to clock_ts_to_ct and the
 BCD routines while we're here.


I also disagreed with previous versions of this fix.


 Perform a safety check in sys_clock_settime() first to avoid easy local
 root panic, without having to propagate an error value back through
 dozens of APIs currently lacking error returns.


I agree with not over-engineering this to check at all levels.  But top-level
check needs to be more stringent and magic to work.  It is easier to check
a couple of levels lower.


But there is no way for lower levels to report errors, so the up-fr

svn commit: r313014 - head/sys/boot/fdt/dts/arm

2017-01-31 Thread Jared McNeill
Author: jmcneill
Date: Tue Jan 31 14:36:06 2017
New Revision: 313014
URL: https://svnweb.freebsd.org/changeset/base/313014

Log:
  Add missing ephy bus gates and resets.

Modified:
  head/sys/boot/fdt/dts/arm/h3.dtsi

Modified: head/sys/boot/fdt/dts/arm/h3.dtsi
==
--- head/sys/boot/fdt/dts/arm/h3.dtsi   Tue Jan 31 12:33:59 2017
(r313013)
+++ head/sys/boot/fdt/dts/arm/h3.dtsi   Tue Jan 31 14:36:06 2017
(r313014)
@@ -69,10 +69,10 @@
reg = <0x01c3 0x104>, <0x01c00030 0x4>;
reg-names = "emac", "syscon";
interrupts = ;
-   resets = <&ahb_rst 17>;
-   reset-names = "ahb";
-   clocks = <&bus_gates 17>;
-   clock-names = "ahb";
+   resets = <&ahb_rst 17>, <&ahb_rst 66>;
+   reset-names = "ahb", "ephy";
+   clocks = <&bus_gates 17>, <&bus_gates 128>;
+   clock-names = "ahb", "ephy";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys

2017-01-31 Thread Edward Tomasz Napierala
On 0130T1502, Gleb Smirnoff wrote:
> On Mon, Jan 30, 2017 at 12:57:23PM +, Edward Tomasz Napierala wrote:
> E> Author: trasz
> E> Date: Mon Jan 30 12:57:22 2017
> E> New Revision: 312988
> E> URL: https://svnweb.freebsd.org/changeset/base/312988
> E> 
> E> Log:
> E>   Add kern_listen(), kern_shutdown(), and kern_socket(), and use them
> E>   instead of their sys_*() counterparts in various compats. The svr4
> E>   is left untouched, because there's no point.
> 
> Btw, any good reasons to keep SVR4 support for FreeBSD 12?

I don't think so.  However, I seem to remember there was an attempt
to remove one of the compats some time ago, and it turned out there were
still some people using it.  So, I don't have plans to disconnect svr4,
but I don't have plans to keep it up to date either.

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


Re: svn commit: r313008 - head/tests/sys/geom/class/gate

2017-01-31 Thread Alan Somers
I think wait_for_ggate_device should also be used at line 32, which
calls "ggatec create".
-Alan

On Mon, Jan 30, 2017 at 11:12 PM, Ngie Cooper  wrote:
> Author: ngie
> Date: Tue Jan 31 06:12:51 2017
> New Revision: 313008
> URL: https://svnweb.freebsd.org/changeset/base/313008
>
> Log:
>   Wait for /dev/ggate* to appear after calling `ggatel create` in 
> :ggatel_{file,md}
>
>   The test assumed that `ggatel create` created a device on completion, but 
> that's
>   incorrect. This squashes the race by waiting for the device to appear, as
>   `ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not 
> called
>   with `-v`.
>
>   Discussed with:   asomers
>   MFC after:1 week
>   PR:   204616
>   Sponsored by: Dell EMC Isilon
>
> Modified:
>   head/tests/sys/geom/class/gate/ggate_test.sh
>
> Modified: head/tests/sys/geom/class/gate/ggate_test.sh
> ==
> --- head/tests/sys/geom/class/gate/ggate_test.shTue Jan 31 03:40:13 
> 2017(r313007)
> +++ head/tests/sys/geom/class/gate/ggate_test.shTue Jan 31 06:12:51 
> 2017(r313008)
> @@ -74,7 +74,11 @@ ggatel_file_body()
>
> atf_check ggatel create -u $us work
>
> -   dd if=src of=/dev/ggate${us} bs=1m count=1 conv=notrunc
> +   ggate_dev=/dev/ggate${us}
> +
> +   wait_for_ggate_device ${ggate_dev}
> +
> +   dd if=src of=${ggate_dev} bs=1m count=1 conv=notrunc
>
> checksum src work
>  }
> @@ -104,7 +108,11 @@ ggatel_md_body()
>
> atf_check ggatel create -u $us /dev/$work
>
> -   dd if=/dev/$src of=/dev/ggate${us} bs=1m count=1 conv=notrunc
> +   ggate_dev=/dev/ggate${us}
> +
> +   wait_for_ggate_device ${ggate_dev}
> +
> +   dd if=/dev/$src of=${ggate_dev} bs=1m count=1 conv=notrunc
>
> checksum /dev/$src /dev/$work
>  }
> @@ -191,3 +199,14 @@ common_cleanup()
> fi
> true
>  }
> +
> +# Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create`
> +# isn't called with `-v`.
> +wait_for_ggate_device()
> +{
> +   ggate_device=$1
> +
> +   while [ ! -c $ggate_device ]; do
> +   sleep 0.5
> +   done
> +}
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313015 - in head/sys: compat/freebsd32 kern sys

2017-01-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jan 31 15:11:23 2017
New Revision: 313015
URL: https://svnweb.freebsd.org/changeset/base/313015

Log:
  Add kern_cpuset_getid() and kern_cpuset_setid(), and use them
  in compat32 instead of their sub_*() counterparts.
  
  Reviewed by:  jhb@, kib@
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9382

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_cpuset.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 14:36:06 2017
(r313014)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 15:11:23 2017
(r313015)
@@ -2556,27 +2556,18 @@ int
 freebsd32_cpuset_setid(struct thread *td,
 struct freebsd32_cpuset_setid_args *uap)
 {
-   struct cpuset_setid_args ap;
 
-   ap.which = uap->which;
-   ap.id = PAIR32TO64(id_t,uap->id);
-   ap.setid = uap->setid;
-
-   return (sys_cpuset_setid(td, &ap));
+   return (kern_cpuset_setid(td, uap->which,
+   PAIR32TO64(id_t, uap->id), uap->setid));
 }
 
 int
 freebsd32_cpuset_getid(struct thread *td,
 struct freebsd32_cpuset_getid_args *uap)
 {
-   struct cpuset_getid_args ap;
-
-   ap.level = uap->level;
-   ap.which = uap->which;
-   ap.id = PAIR32TO64(id_t,uap->id);
-   ap.setid = uap->setid;
 
-   return (sys_cpuset_getid(td, &ap));
+   return (kern_cpuset_getid(td, uap->level, uap->which,
+   PAIR32TO64(id_t, uap->id), uap->setid));
 }
 
 int

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Tue Jan 31 14:36:06 2017(r313014)
+++ head/sys/kern/kern_cpuset.c Tue Jan 31 15:11:23 2017(r313015)
@@ -976,18 +976,26 @@ struct cpuset_setid_args {
 int
 sys_cpuset_setid(struct thread *td, struct cpuset_setid_args *uap)
 {
+
+   return (kern_cpuset_setid(td, uap->which, uap->id, uap->setid));
+}
+
+int
+kern_cpuset_setid(struct thread *td, cpuwhich_t which,
+id_t id, cpusetid_t setid)
+{
struct cpuset *set;
int error;
 
/*
 * Presently we only support per-process sets.
 */
-   if (uap->which != CPU_WHICH_PID)
+   if (which != CPU_WHICH_PID)
return (EINVAL);
-   set = cpuset_lookup(uap->setid, td);
+   set = cpuset_lookup(setid, td);
if (set == NULL)
return (ESRCH);
-   error = cpuset_setproc(uap->id, set, NULL);
+   error = cpuset_setproc(id, set, NULL);
cpuset_rel(set);
return (error);
 }
@@ -1003,19 +1011,28 @@ struct cpuset_getid_args {
 int
 sys_cpuset_getid(struct thread *td, struct cpuset_getid_args *uap)
 {
+
+   return (kern_cpuset_getid(td, uap->level, uap->which, uap->id,
+   uap->setid));
+}
+
+int
+kern_cpuset_getid(struct thread *td, cpulevel_t level, cpuwhich_t which,
+id_t id, cpusetid_t *setid)
+{
struct cpuset *nset;
struct cpuset *set;
struct thread *ttd;
struct proc *p;
-   cpusetid_t id;
+   cpusetid_t tmpid;
int error;
 
-   if (uap->level == CPU_LEVEL_WHICH && uap->which != CPU_WHICH_CPUSET)
+   if (level == CPU_LEVEL_WHICH && which != CPU_WHICH_CPUSET)
return (EINVAL);
-   error = cpuset_which(uap->which, uap->id, &p, &ttd, &set);
+   error = cpuset_which(which, id, &p, &ttd, &set);
if (error)
return (error);
-   switch (uap->which) {
+   switch (which) {
case CPU_WHICH_TID:
case CPU_WHICH_PID:
thread_lock(ttd);
@@ -1030,7 +1047,7 @@ sys_cpuset_getid(struct thread *td, stru
case CPU_WHICH_DOMAIN:
return (EINVAL);
}
-   switch (uap->level) {
+   switch (level) {
case CPU_LEVEL_ROOT:
nset = cpuset_refroot(set);
cpuset_rel(set);
@@ -1041,10 +1058,10 @@ sys_cpuset_getid(struct thread *td, stru
case CPU_LEVEL_WHICH:
break;
}
-   id = set->cs_id;
+   tmpid = set->cs_id;
cpuset_rel(set);
if (error == 0)
-   error = copyout(&id, uap->setid, sizeof(id));
+   error = copyout(&tmpid, setid, sizeof(id));
 
return (error);
 }

Modified: head/sys/sys/syscallsubr.h
==
--- head/sys/sys/syscallsubr.h  Tue Jan 31 14:36:06 2017(r313014)
+++ head/sys/sys/syscallsubr.h  Tue Jan 31 15:11:23 2017(r313015)
@@ -86,6 +86,10 @@ int  kern_clock_settime(struct thread *td
 intkern_close(struct thread *td, int fd);
 intkern_connectat(struct thread *td, int dirfd, int fd,
struct sockaddr *sa);
+intkern_cpuset_getid(struct thread *td, cpulevel

svn commit: r313016 - in head/sys: compat/freebsd32 kern

2017-01-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jan 31 15:19:44 2017
New Revision: 313016
URL: https://svnweb.freebsd.org/changeset/base/313016

Log:
  Replace calls to sys_truncate() with kern_truncate().
  
  Reviewed by:  kib@
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9371

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 15:11:23 2017
(r313015)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 15:19:44 2017
(r313016)
@@ -1500,11 +1500,9 @@ freebsd32_lseek(struct thread *td, struc
 int
 freebsd32_truncate(struct thread *td, struct freebsd32_truncate_args *uap)
 {
-   struct truncate_args ap;
 
-   ap.path = uap->path;
-   ap.length = PAIR32TO64(off_t,uap->length);
-   return (sys_truncate(td, &ap));
+   return (kern_truncate(td, uap->path, UIO_USERSPACE,
+   PAIR32TO64(off_t, uap->length)));
 }
 
 int
@@ -1600,11 +1598,9 @@ freebsd6_freebsd32_lseek(struct thread *
 int
 freebsd6_freebsd32_truncate(struct thread *td, struct 
freebsd6_freebsd32_truncate_args *uap)
 {
-   struct truncate_args ap;
 
-   ap.path = uap->path;
-   ap.length = PAIR32TO64(off_t,uap->length);
-   return (sys_truncate(td, &ap));
+   return (kern_truncate(td, uap->path, UIO_USERSPACE,
+   PAIR32TO64(off_t, uap->length)));
 }
 
 int

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Jan 31 15:11:23 2017
(r313015)
+++ head/sys/kern/vfs_syscalls.cTue Jan 31 15:19:44 2017
(r313016)
@@ -3310,22 +3310,10 @@ struct otruncate_args {
 };
 #endif
 int
-otruncate(td, uap)
-   struct thread *td;
-   register struct otruncate_args /* {
-   char *path;
-   long length;
-   } */ *uap;
+otruncate(struct thread *td, struct otruncate_args *uap)
 {
-   struct truncate_args /* {
-   char *path;
-   int pad;
-   off_t length;
-   } */ nuap;
-
-   nuap.path = uap->path;
-   nuap.length = uap->length;
-   return (sys_truncate(td, &nuap));
+
+   return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length));
 }
 #endif /* COMPAT_43 */
 
@@ -3334,11 +3322,8 @@ otruncate(td, uap)
 int
 freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap)
 {
-   struct truncate_args ouap;
 
-   ouap.path = uap->path;
-   ouap.length = uap->length;
-   return (sys_truncate(td, &ouap));
+   return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length));
 }
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313017 - head/sys/compat/linux

2017-01-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jan 31 15:22:51 2017
New Revision: 313017
URL: https://svnweb.freebsd.org/changeset/base/313017

Log:
  Fix linux_getppid() to debug the actual parent, even it was reparented
  by debugger.
  
  Reviewed by:  dchagin@
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9361

Modified:
  head/sys/compat/linux/linux_misc.c

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Tue Jan 31 15:19:44 2017
(r313016)
+++ head/sys/compat/linux/linux_misc.c  Tue Jan 31 15:22:51 2017
(r313017)
@@ -1733,9 +1733,7 @@ linux_getppid(struct thread *td, struct 
printf(ARGS(getppid, ""));
 #endif
 
-   PROC_LOCK(td->td_proc);
-   td->td_retval[0] = td->td_proc->p_pptr->p_pid;
-   PROC_UNLOCK(td->td_proc);
+   td->td_retval[0] = kern_getppid(td);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313018 - in head/sys: compat/freebsd32 compat/linux kern sys

2017-01-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jan 31 15:35:18 2017
New Revision: 313018
URL: https://svnweb.freebsd.org/changeset/base/313018

Log:
  Add kern_pread() and kern_pwrite(), and use it in compats instead
  of their sys_*() counterparts. The svr4 is left unchanged.
  
  Reviewed by:  kib@
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9379

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linux/linux_file.c
  head/sys/kern/sys_generic.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 15:22:51 2017
(r313017)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 31 15:35:18 2017
(r313018)
@@ -1452,25 +1452,17 @@ freebsd4_freebsd32_fhstatfs(struct threa
 int
 freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
 {
-   struct pread_args ap;
 
-   ap.fd = uap->fd;
-   ap.buf = uap->buf;
-   ap.nbyte = uap->nbyte;
-   ap.offset = PAIR32TO64(off_t,uap->offset);
-   return (sys_pread(td, &ap));
+   return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
+   PAIR32TO64(off_t, uap->offset)));
 }
 
 int
 freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap)
 {
-   struct pwrite_args ap;
 
-   ap.fd = uap->fd;
-   ap.buf = uap->buf;
-   ap.nbyte = uap->nbyte;
-   ap.offset = PAIR32TO64(off_t,uap->offset);
-   return (sys_pwrite(td, &ap));
+   return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
+   PAIR32TO64(off_t, uap->offset)));
 }
 
 #ifdef COMPAT_43
@@ -1559,25 +1551,17 @@ freebsd32_getdirentries(struct thread *t
 int
 freebsd6_freebsd32_pread(struct thread *td, struct 
freebsd6_freebsd32_pread_args *uap)
 {
-   struct pread_args ap;
 
-   ap.fd = uap->fd;
-   ap.buf = uap->buf;
-   ap.nbyte = uap->nbyte;
-   ap.offset = PAIR32TO64(off_t,uap->offset);
-   return (sys_pread(td, &ap));
+   return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
+   PAIR32TO64(off_t, uap->offset)));
 }
 
 int
 freebsd6_freebsd32_pwrite(struct thread *td, struct 
freebsd6_freebsd32_pwrite_args *uap)
 {
-   struct pwrite_args ap;
 
-   ap.fd = uap->fd;
-   ap.buf = uap->buf;
-   ap.nbyte = uap->nbyte;
-   ap.offset = PAIR32TO64(off_t,uap->offset);
-   return (sys_pwrite(td, &ap));
+   return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
+   PAIR32TO64(off_t, uap->offset)));
 }
 
 int

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Tue Jan 31 15:22:51 2017
(r313017)
+++ head/sys/compat/linux/linux_file.c  Tue Jan 31 15:35:18 2017
(r313018)
@@ -997,20 +997,13 @@ linux_fdatasync(td, uap)
 }
 
 int
-linux_pread(td, uap)
-   struct thread *td;
-   struct linux_pread_args *uap;
+linux_pread(struct thread *td, struct linux_pread_args *uap)
 {
-   struct pread_args bsd;
cap_rights_t rights;
struct vnode *vp;
int error;
 
-   bsd.fd = uap->fd;
-   bsd.buf = uap->buf;
-   bsd.nbyte = uap->nbyte;
-   bsd.offset = uap->offset;
-   error = sys_pread(td, &bsd);
+   error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset);
if (error == 0) {
/* This seems to violate POSIX but linux does it */
error = fgetvp(td, uap->fd,
@@ -1027,17 +1020,10 @@ linux_pread(td, uap)
 }
 
 int
-linux_pwrite(td, uap)
-   struct thread *td;
-   struct linux_pwrite_args *uap;
-{
-   struct pwrite_args bsd;
-
-   bsd.fd = uap->fd;
-   bsd.buf = uap->buf;
-   bsd.nbyte = uap->nbyte;
-   bsd.offset = uap->offset;
-   return (sys_pwrite(td, &bsd));
+linux_pwrite(struct thread *td, struct linux_pwrite_args *uap)
+{
+
+   return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
 }
 
 int

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Tue Jan 31 15:22:51 2017(r313017)
+++ head/sys/kern/sys_generic.c Tue Jan 31 15:35:18 2017(r313018)
@@ -220,39 +220,37 @@ struct pread_args {
 };
 #endif
 int
-sys_pread(td, uap)
-   struct thread *td;
-   struct pread_args *uap;
+sys_pread(struct thread *td, struct pread_args *uap)
+{
+
+   return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
+}
+
+int
+kern_pread(struct thread *td, int fd, void *buf, size_t nbyte, off_t offset)
 {
struct uio auio;
struct iovec aiov;
int error;
 
-   if (uap->nbyte > IOSIZE_MAX)
+   if (nbyte > IOSIZE_MAX)
return (EINVAL);
-   aiov.iov_base = uap->buf;
-   aiov.iov_len = uap->nbyte;
+   

Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Bruce Evans

On Tue, 31 Jan 2017, Bruce Evans wrote:


On Mon, 30 Jan 2017, Conrad Meyer wrote:


On Mon, Jan 30, 2017 at 9:26 PM, Bruce Evans  wrote:

On Tue, 31 Jan 2017, Conrad E. Meyer wrote:


Log:
 calculate_crc32c: Add SSE4.2 implementation on x86


This breaks building with gcc-4.2.1,


gcc-4.2.1 is an ancient compiler.  Good riddance.


I prefer it.


It also works better on ordinary asms for crc32.


Added: head/sys/libkern/x86/crc32_sse42.c

==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/libkern/x86/crc32_sse42.c  Tue Jan 31 03:26:32 2017
(r313006)
+
+#include 


...

Inline asm is much less unportable than intrinsics.  kib used the correct
method of .byte's in asms to avoid depending on assembler support for 
newer

instructions.  .byte is still used for clflush on amd64 and i386.  It
used to be used for invpcid on amd64.  I can't find where it is or was
used for xsave stuff.


Konstantin predicted this complaint in code review (phabricator).
Unfortunately, Clang does not automatically unroll asms, even with the
correct mnemonic.  Unrolling is essential to performance below the
by-3 block size (768 bytes in this implementation).  Hand unrolling in
C seems to generate less efficient assembly than the compiler's
unrolling.


Unorolling is almost completely useless if the instruction takes 3 cycles
like you said it does.  The loop calculations run much faster than that,
so they can run in parallel.  However, clang generates horrible code for
inline asms instead of intrinsics.


The unrolling was worse than useless (see previous reply).  It is the
horrible code in the non-intrinsics case that seems to be the main source
of differences (see below).


The left column below is block size.  The measurements are nanoseconds
per buf, per CLOCK_VIRTUAL, averaged over 10^5 loops.  These numbers
do not vary more than +/- 1ns run to run on my idle Sandy Bridge
laptop.  "asm" is using __asm__(), "intrins" using the _mm_crc32
intrinsics that Clang can unroll, and multitable is the older
lookup-table implementation (still used on other architectures).

0x10: asm:0 intrins:0 multitable:0  (ns per buf)
0x20: asm:7 intrins:9 multitable:78  (ns per buf)
0x40: asm:10 intrins:7 multitable:50  (ns per buf)
0x80: asm:15 intrins:9 multitable:91  (ns per buf)
0x000100: asm:25 intrins:17 multitable:178  (ns per buf)
0x000200: asm:55 intrins:38 multitable:347  (ns per buf)
0x000400: asm:61 intrins:62 multitable:684  (ns per buf)

Both implementations are superior to the multitable approach, so it is
unreasonable not to make one of them standard on x86 platforms.

The unrolled intrinsics are consistently better than not unrolled on
objects 0x40-0x200 bytes large.  At 0x400 bytes we pass the first
unroll-by-3 threshold and it stops mattering as much.

At 0x40 bytes, it is the difference between 6.4 GB/s and 9.1 GB/s.  At
0x200 bytes, it is the difference between 9.3 GB/s and 13.5 GB/s.  I
think this justifies some minor ugliness.


If it matters, which I doubt, then the compiler shouldn't be trusted
for unrolling.  It can only do better than handwritten unrolling if
it has tables for the correct amount unrolling for every instruction
for thousands of CPUs (since such tables are too hard to write manually).


It is the 3-way unrolling that makes the main difference.  clang is
clueless about unrolling in this function, but this 3-way unrolling is
in the C code.  It is to reduce dependencies.  The timing seems to be
as I suspected -- the crc32 instruction has a latency of 3 and a throughput
of 3 per 3 cycles, so with 3 dependent instructions it runs 3 times slower
than with 3 independent instructions.  Naive unrolling gives more dependent
instructions, so is equally slow to no unrolling.

Test program for this:

X #include 
X #include 
X 
X #ifndef __clang__


Change this to __clang__X to kill intrinsics for clang.

X static __inline uint32_t
X _mm_crc32_u8(uint32_t x, uint8_t y)
X {
X   __asm("crc32b %1,%0" : "+r" (x) : "rm" (y));
X   return (x);
X }
X 
X static __inline uint32_t __unused

X _mm_crc32_u32(uint32_t x, int32_t y)
X {
X   __asm("crc32l %1,%0" : "+r" (x) : "rm" (y));
X   return (x);
X }
X 
X #ifdef __amd64__

X static __inline uint64_t
X _mm_crc32_u64(uint64_t x, int64_t y)
X {
X   __asm("crc32q %1,%0" : "+r" (x) : "rm" (y));
X   return (x);
X }
X #endif
X #else
X #include 
X #endif
X 
X #define MISALIGN	0


MISALIGN 1 costs about 4% (0.36 seconds instead of 0.34 seconds on
freefall's Xeon).

X #define SIZE  100

The large size of 1M is to bust at least the L1 cache.  This makes little
difference, since the speed is CPU-bound (0.34 seconds @ 3.3 GHz = ~34/33
cycles per crc32 instruction).  Actually, I'm not sure about the speeds.
freefalls's machdep.tsc_freq is 3.3GHz, but the speed could be anything
due to turbo mode and frequency control (boot message give simi

Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys

2017-01-31 Thread Konstantin Belousov
On Tue, Jan 31, 2017 at 03:07:27PM +, Edward Tomasz Napierala wrote:
> On 0130T1502, Gleb Smirnoff wrote:
> > On Mon, Jan 30, 2017 at 12:57:23PM +, Edward Tomasz Napierala wrote:
> > E> Author: trasz
> > E> Date: Mon Jan 30 12:57:22 2017
> > E> New Revision: 312988
> > E> URL: https://svnweb.freebsd.org/changeset/base/312988
> > E> 
> > E> Log:
> > E>   Add kern_listen(), kern_shutdown(), and kern_socket(), and use them
> > E>   instead of their sys_*() counterparts in various compats. The svr4
> > E>   is left untouched, because there's no point.
> > 
> > Btw, any good reasons to keep SVR4 support for FreeBSD 12?
> 
> I don't think so.  However, I seem to remember there was an attempt
> to remove one of the compats some time ago, and it turned out there were
> still some people using it.  So, I don't have plans to disconnect svr4,
> but I don't have plans to keep it up to date either.
> 
SVr4 is barely useful, but still connected to the build.
iBCS2, on the other hand, was used by many people: I can claim it because
I usually got more than one report for a regression in that code when
core parts of the kernel change.

I did some improvements for iBCS2 previous summer, both to better fit it
into current kernel code, and fix outstanding bugs, biggest of which was
incompatible signal frame layout.  But there were concerns that the work
required an approval from the SCO copyright owners, and we were unable to
get a clearing.  As result, iBCS2 emulator was disconnected from the
build for 11 and HEAD.

It would be somewhat pity to kill it because it is useful for many people,
but we cannot update the code safely.  There is no such concern for SVr4.

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


svn commit: r313019 - in head/sys: dev/e1000 dev/vnic net

2017-01-31 Thread Stephen J. Kiernan
Author: stevek
Date: Tue Jan 31 16:12:31 2017
New Revision: 313019
URL: https://svnweb.freebsd.org/changeset/base/313019

Log:
  Add the folowing set accessor functions for recently-added members of ifnet
  structure:
  
  if_gethwtsomax(), if_sethwtsomax() - if_hw_tsomax
  if_gethwtsomaxsegcount(), if_sethwtsomaxsegcount() - if_hw_tsomaxsegcount
  if_gethwtsomaxsegsize(), if_sethwtsomaxsegsize()   - if_hw_tsomaxsegsize
  
  Update em and vnic drivers which had already been coverted to use accessor
  functions for the other ifnet structure members.
  
  Reviewed by:  erj
  Approved by:  sjg (mentor)
  Obtained from:Juniper Networks, Inc.
  Differential Revision:https://reviews.freebsd.org/D8544

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/vnic/nicvf_main.c
  head/sys/net/if.c
  head/sys/net/if_var.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Jan 31 15:35:18 2017(r313018)
+++ head/sys/dev/e1000/if_em.c  Tue Jan 31 16:12:31 2017(r313019)
@@ -2481,10 +2481,10 @@ em_setup_interface(if_ctx_t ctx)
INIT_DEBUGOUT("em_setup_interface: begin");
 
/* TSO parameters */
-   ifp->if_hw_tsomax = IP_MAXPACKET;
+   if_sethwtsomax(ifp, IP_MAXPACKET);
/* Take m_pullup(9)'s in em_xmit() w/ TSO into acount. */
-   ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER - 5;
-   ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE;
+   if_sethwtsomaxsegcount(ifp, EM_MAX_SCATTER - 5);
+   if_sethwtsomaxsegsize(ifp, EM_TSO_SEG_SIZE);
 
/* Single Queue */
 if (adapter->tx_num_queues == 1) {

Modified: head/sys/dev/vnic/nicvf_main.c
==
--- head/sys/dev/vnic/nicvf_main.c  Tue Jan 31 15:35:18 2017
(r313018)
+++ head/sys/dev/vnic/nicvf_main.c  Tue Jan 31 16:12:31 2017
(r313019)
@@ -370,9 +370,9 @@ nicvf_setup_ifnet(struct nicvf *nic)
/* TSO */
if_setcapabilitiesbit(ifp, IFCAP_TSO4, 0);
/* TSO parameters */
-   ifp->if_hw_tsomax = NICVF_TSO_MAXSIZE;
-   ifp->if_hw_tsomaxsegcount = NICVF_TSO_NSEGS;
-   ifp->if_hw_tsomaxsegsize = MCLBYTES;
+   if_sethwtsomax(ifp, NICVF_TSO_MAXSIZE);
+   if_sethwtsomaxsegcount(ifp, NICVF_TSO_NSEGS);
+   if_sethwtsomaxsegsize(ifp, MCLBYTES);
}
/* IP/TCP/UDP HW checksums */
if_setcapabilitiesbit(ifp, IFCAP_HWCSUM, 0);
@@ -453,7 +453,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long
 #if defined(INET) || defined(INET6)
/* Avoid reinitialization unless it's necessary */
if (avoid_reset) {
-   ifp->if_flags |= IFF_UP;
+   if_setflagbits(ifp, IFF_UP, 0);
if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))
nicvf_if_init(nic);
 #ifdef INET
@@ -482,8 +482,8 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long
NICVF_CORE_LOCK(nic);
if (if_getflags(ifp) & IFF_UP) {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
-   flags = ifp->if_flags ^ nic->if_flags;
-   if ((nic->if_flags & ifp->if_flags) &
+   flags = if_getflags(ifp) ^ nic->if_flags;
+   if ((nic->if_flags & if_getflags(ifp)) &
IFF_PROMISC) {
/* Change promiscous mode */
 #if 0
@@ -492,7 +492,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long
 #endif
}
 
-   if ((nic->if_flags ^ ifp->if_flags) &
+   if ((nic->if_flags ^ if_getflags(ifp)) &
IFF_ALLMULTI) {
/* Change multicasting settings */
 #if 0
@@ -506,7 +506,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long
} else if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
nicvf_stop_locked(nic);
 
-   nic->if_flags = ifp->if_flags;
+   nic->if_flags = if_getflags(ifp);
NICVF_CORE_UNLOCK(nic);
break;
 
@@ -528,24 +528,24 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long
break;
 
case SIOCSIFCAP:
-   mask = ifp->if_capenable ^ ifr->ifr_reqcap;
+   mask = if_getcapenable(ifp) ^ ifr->ifr_reqcap;
if (mask & IFCAP_VLAN_MTU) {
/* No work to do except acknowledge the change took. */
-   ifp->if_capenable ^= IFCAP_VLAN_MTU;
+   if_togglecapenable(ifp, IFCAP_VLAN_MTU);
}
if (mask & IFCAP_TXCSUM)
-   ifp->if_capenable ^= IFCAP_T

Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Conrad Meyer
On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans  wrote:
> On Tue, 31 Jan 2017, Bruce Evans wrote:
> Unrolling (or not) may be helpful or harmful for entry and exit code.

Helpful, per my earlier benchmarks.

> I
> think there should by no alignment on entry -- just assume the buffer is
> aligned in the usual case, and only run 4% slower when it is misaligned.

Please write such a patch and demonstrate the improvement.

> The exit code handles up to SHORT * 3 = 768 bytes, not up to 4 or 8
> bytes or up to 3 times that like simpler algorithms.  768 is quite
> large, and the exit code is quite slow.  It reduces 8 or 4 bytes at a
> time without any dependency reduction, and then 1 byte at a time.

Yes, this is the important loop to unroll for small inputs.  Somehow
with the unrolling, it is only ~19% slower than the by-3 algorithm on
my system — not 66%.  Clang 3.9.1 unrolls both of these trailing
loops; here is the first:

   0x00401b88 <+584>:   cmp$0x38,%rbx
   0x00401b8c <+588>:   jae0x401b93 
   0x00401b8e <+590>:   mov%rsi,%rdx
   0x00401b91 <+593>:   jmp0x401be1 
   0x00401b93 <+595>:   lea-0x1(%rdi),%rbx
   0x00401b97 <+599>:   sub%rdx,%rbx
   0x00401b9a <+602>:   mov%rsi,%rdx
   0x00401b9d <+605>:   nopl   (%rax)
   0x00401ba0 <+608>:   crc32q (%rdx),%rax
   0x00401ba6 <+614>:   crc32q 0x8(%rdx),%rax
   0x00401bad <+621>:   crc32q 0x10(%rdx),%rax
   0x00401bb4 <+628>:   crc32q 0x18(%rdx),%rax
   0x00401bbb <+635>:   crc32q 0x20(%rdx),%rax
   0x00401bc2 <+642>:   crc32q 0x28(%rdx),%rax
   0x00401bc9 <+649>:   crc32q 0x30(%rdx),%rax
   0x00401bd0 <+656>:   crc32q 0x38(%rdx),%rax
   0x00401bd7 <+663>:   add$0x40,%rdx
   0x00401bdb <+667>:   add$0x8,%rbx
   0x00401bdf <+671>:   jne0x401ba0 


> I
> don't understand the algorithm for joining crcs -- why doesn't it work
> to reduce to 12 or 24 bytes in the main loop?

It would, but I haven't implemented or tested that.  You're welcome to
do so and demonstrate an improvement.  It does add more lookup table
bloat, but perhaps we could just remove the 3x8k table — I'm not sure
it adds any benefit over the 3x256 table.

> Your benchmarks mainly give results for the <= 768 bytes where most of
> the manual optimizations don't apply.

0x000400: asm:68 intrins:62 multitable:684  (ns per buf)
0x000800: asm:132 intrins:133  (ns per buf)
0x002000: asm:449 intrins:446  (ns per buf)
0x008000: asm:1501 intrins:1497  (ns per buf)
0x02: asm:5618 intrins:5609  (ns per buf)

(All routines are in a separate compilation unit with no full-program
optimization, as they are in the kernel.)

> Compiler optimizations are more
> likely to help there.  So I looked more closely at the last 2 loop.
> clang indeed only unrolls the last one,

Not in 3.9.1.

> only for the unreachable case
> with more than 8 bytes on amd64.

How is it unreachable?

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

svn commit: r313020 - head/sys/dev/cxgbe

2017-01-31 Thread John Baldwin
Author: jhb
Date: Tue Jan 31 18:54:13 2017
New Revision: 313020
URL: https://svnweb.freebsd.org/changeset/base/313020

Log:
  Fix a couple of issues with t4iov probe and attach.
  
  - Check for Chelsio vendor ID in probe routines.
  - Fail attach instead of faulting if pci_find_dbsf() doesn't find a
device.
  
  PR:   216539
  Reported by:  asomers
  Tested by:Dave Baukus 
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_iov.c

Modified: head/sys/dev/cxgbe/t4_iov.c
==
--- head/sys/dev/cxgbe/t4_iov.c Tue Jan 31 16:12:31 2017(r313019)
+++ head/sys/dev/cxgbe/t4_iov.c Tue Jan 31 18:54:13 2017(r313020)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+#include "common/common.h"
 #include "t4_if.h"
 
 struct t4iov_softc {
@@ -106,6 +107,9 @@ t4iov_probe(device_t dev)
uint16_t d;
size_t i;
 
+   if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO)
+   return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t4iov_pciids); i++) {
if (d == t4iov_pciids[i].device) {
@@ -123,6 +127,9 @@ t5iov_probe(device_t dev)
uint16_t d;
size_t i;
 
+   if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO)
+   return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t5iov_pciids); i++) {
if (d == t5iov_pciids[i].device) {
@@ -140,6 +147,9 @@ t6iov_probe(device_t dev)
uint16_t d;
size_t i;
 
+   if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO)
+   return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t6iov_pciids); i++) {
if (d == t6iov_pciids[i].device) {
@@ -161,6 +171,8 @@ t4iov_attach(device_t dev)
 
sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev),
pci_get_slot(dev), 4);
+   if (sc->sc_main == NULL)
+   return (ENXIO);
if (T4_IS_MAIN_READY(sc->sc_main) == 0)
return (t4iov_attach_child(dev));
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313021 - head/release

2017-01-31 Thread Brad Davis
Author: brd (doc,ports committer)
Date: Tue Jan 31 19:09:06 2017
New Revision: 313021
URL: https://svnweb.freebsd.org/changeset/base/313021

Log:
  Force a few variables to be upper case when they are evaulated.
  
  This allows specifying, for example: CLOUDWARE=vagrant-vmware
  
  Approved by:  re (gjb)

Modified:
  head/release/Makefile.vm

Modified: head/release/Makefile.vm
==
--- head/release/Makefile.vmTue Jan 31 18:54:13 2017(r313020)
+++ head/release/Makefile.vmTue Jan 31 19:09:06 2017(r313021)
@@ -58,8 +58,8 @@ cw-${_CW:tl}:
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
-   -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
-   -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF}
+   -i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW:tu}_FORMAT} 
\
+   -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW:tu}IMAGE} -c ${${_CW}CONF}
touch ${.TARGET}
 
 cw${_CW:tl}-package:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313022 - svnadmin/conf

2017-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 31 19:12:10 2017
New Revision: 313022
URL: https://svnweb.freebsd.org/changeset/base/313022

Log:
  Add myself for tcpdump import.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confTue Jan 31 19:09:06 2017
(r313021)
+++ svnadmin/conf/sizelimit.confTue Jan 31 19:12:10 2017
(r313022)
@@ -27,3 +27,4 @@ np
 obrien
 peter
 rwatson
+glebius
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313023 - in vendor/tcpdump/4.9.0: . lbl missing tests win32 win32/prj win32/src

2017-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 31 19:12:28 2017
New Revision: 313023
URL: https://svnweb.freebsd.org/changeset/base/313023

Log:
  Import tcpdump-4.9.0.

Added:
  vendor/tcpdump/4.9.0/
  vendor/tcpdump/4.9.0/CHANGES
  vendor/tcpdump/4.9.0/CONTRIBUTING
  vendor/tcpdump/4.9.0/CREDITS
  vendor/tcpdump/4.9.0/INSTALL.txt   (contents, props changed)
  vendor/tcpdump/4.9.0/LICENSE
  vendor/tcpdump/4.9.0/Makefile-devel-adds   (contents, props changed)
  vendor/tcpdump/4.9.0/Makefile.in   (contents, props changed)
  vendor/tcpdump/4.9.0/PLATFORMS
  vendor/tcpdump/4.9.0/README   (contents, props changed)
  vendor/tcpdump/4.9.0/README.md
  vendor/tcpdump/4.9.0/Readme.Win32
  vendor/tcpdump/4.9.0/VERSION
  vendor/tcpdump/4.9.0/aclocal.m4
  vendor/tcpdump/4.9.0/addrtoname.c   (contents, props changed)
  vendor/tcpdump/4.9.0/addrtoname.h   (contents, props changed)
  vendor/tcpdump/4.9.0/addrtostr.c   (contents, props changed)
  vendor/tcpdump/4.9.0/addrtostr.h   (contents, props changed)
  vendor/tcpdump/4.9.0/af.c   (contents, props changed)
  vendor/tcpdump/4.9.0/af.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ah.h   (contents, props changed)
  vendor/tcpdump/4.9.0/appletalk.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ascii_strcasecmp.c   (contents, props changed)
  vendor/tcpdump/4.9.0/ascii_strcasecmp.h   (contents, props changed)
  vendor/tcpdump/4.9.0/atime.awk   (contents, props changed)
  vendor/tcpdump/4.9.0/atm.h   (contents, props changed)
  vendor/tcpdump/4.9.0/bpf_dump.c   (contents, props changed)
  vendor/tcpdump/4.9.0/chdlc.h   (contents, props changed)
  vendor/tcpdump/4.9.0/checksum.c   (contents, props changed)
  vendor/tcpdump/4.9.0/config.guess
  vendor/tcpdump/4.9.0/config.h.in   (contents, props changed)
  vendor/tcpdump/4.9.0/config.sub
  vendor/tcpdump/4.9.0/configure   (contents, props changed)
  vendor/tcpdump/4.9.0/configure.in   (contents, props changed)
  vendor/tcpdump/4.9.0/cpack.c   (contents, props changed)
  vendor/tcpdump/4.9.0/cpack.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ether.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ethertype.h   (contents, props changed)
  vendor/tcpdump/4.9.0/extract.h   (contents, props changed)
  vendor/tcpdump/4.9.0/getopt_long.h   (contents, props changed)
  vendor/tcpdump/4.9.0/gmpls.c   (contents, props changed)
  vendor/tcpdump/4.9.0/gmpls.h   (contents, props changed)
  vendor/tcpdump/4.9.0/gmt2local.c   (contents, props changed)
  vendor/tcpdump/4.9.0/gmt2local.h   (contents, props changed)
  vendor/tcpdump/4.9.0/in_cksum.c   (contents, props changed)
  vendor/tcpdump/4.9.0/install-sh   (contents, props changed)
  vendor/tcpdump/4.9.0/interface.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ip.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ip6.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ipproto.c   (contents, props changed)
  vendor/tcpdump/4.9.0/ipproto.h   (contents, props changed)
  vendor/tcpdump/4.9.0/l2vpn.c   (contents, props changed)
  vendor/tcpdump/4.9.0/l2vpn.h   (contents, props changed)
  vendor/tcpdump/4.9.0/lbl/
  vendor/tcpdump/4.9.0/lbl/os-osf4.h   (contents, props changed)
  vendor/tcpdump/4.9.0/lbl/os-solaris2.h   (contents, props changed)
  vendor/tcpdump/4.9.0/lbl/os-sunos4.h   (contents, props changed)
  vendor/tcpdump/4.9.0/lbl/os-ultrix4.h   (contents, props changed)
  vendor/tcpdump/4.9.0/llc.h   (contents, props changed)
  vendor/tcpdump/4.9.0/machdep.c   (contents, props changed)
  vendor/tcpdump/4.9.0/machdep.h   (contents, props changed)
  vendor/tcpdump/4.9.0/makemib   (contents, props changed)
  vendor/tcpdump/4.9.0/mib.h   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/
  vendor/tcpdump/4.9.0/missing/datalinks.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/dlnames.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/getopt_long.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/snprintf.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/strdup.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/strlcat.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/strlcpy.c   (contents, props changed)
  vendor/tcpdump/4.9.0/missing/strsep.c   (contents, props changed)
  vendor/tcpdump/4.9.0/mkdep   (contents, props changed)
  vendor/tcpdump/4.9.0/mpls.h   (contents, props changed)
  vendor/tcpdump/4.9.0/nameser.h   (contents, props changed)
  vendor/tcpdump/4.9.0/netdissect-stdinc.h   (contents, props changed)
  vendor/tcpdump/4.9.0/netdissect.c   (contents, props changed)
  vendor/tcpdump/4.9.0/netdissect.h   (contents, props changed)
  vendor/tcpdump/4.9.0/nfs.h   (contents, props changed)
  vendor/tcpdump/4.9.0/nfsfh.h   (contents, props changed)
  vendor/tcpdump/4.9.0/nlpid.c   (contents, props changed)
  vendor/tcpdump/4.9.0/nlpid.h   (contents, props changed)
  vendor/tcpdump/4.9.0/openflow.h   (contents, props changed)
  vendor/tcpdump/4.9.0/ospf.h   (contents, props changed)
  vendor/tcpdump/4.9

svn commit: r313024 - in vendor/tcpdump/dist: . lbl missing tests win32/Include win32/prj win32/src

2017-01-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 31 19:17:06 2017
New Revision: 313024
URL: https://svnweb.freebsd.org/changeset/base/313024

Log:
  Import tcpdump-4.9.0 into dist.

Added:
  vendor/tcpdump/dist/CONTRIBUTING
  vendor/tcpdump/dist/PLATFORMS
  vendor/tcpdump/dist/README   (contents, props changed)
  vendor/tcpdump/dist/addrtostr.c   (contents, props changed)
  vendor/tcpdump/dist/addrtostr.h   (contents, props changed)
  vendor/tcpdump/dist/ascii_strcasecmp.c   (contents, props changed)
  vendor/tcpdump/dist/ascii_strcasecmp.h   (contents, props changed)
  vendor/tcpdump/dist/netdissect-stdinc.h   (contents, props changed)
  vendor/tcpdump/dist/netdissect.c   (contents, props changed)
  vendor/tcpdump/dist/print-hncp.c   (contents, props changed)
  vendor/tcpdump/dist/print-lisp.c   (contents, props changed)
  vendor/tcpdump/dist/print-medsa.c   (contents, props changed)
  vendor/tcpdump/dist/print-nsh.c   (contents, props changed)
  vendor/tcpdump/dist/print-resp.c   (contents, props changed)
  vendor/tcpdump/dist/print-vxlan-gpe.c   (contents, props changed)
  vendor/tcpdump/dist/print.c   (contents, props changed)
  vendor/tcpdump/dist/print.h   (contents, props changed)
  vendor/tcpdump/dist/strtoaddr.c   (contents, props changed)
  vendor/tcpdump/dist/strtoaddr.h   (contents, props changed)
  vendor/tcpdump/dist/tests/OLSRv1_HNA_sgw_1.out
  vendor/tcpdump/dist/tests/OLSRv1_HNA_sgw_1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/RADIUS-port1700.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/aarp-heapoverflow-1.out
  vendor/tcpdump/dist/tests/aarp-heapoverflow-1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/aarp-heapoverflow-2.out
  vendor/tcpdump/dist/tests/aarp-heapoverflow-2.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/arp-too-long-tha.out
  vendor/tcpdump/dist/tests/arp-too-long-tha.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/atm-heapoverflow.out
  vendor/tcpdump/dist/tests/atm-heapoverflow.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/atm-oam-heapoverflow.out
  vendor/tcpdump/dist/tests/atm-oam-heapoverflow.pcap   (contents, props 
changed)
  vendor/tcpdump/dist/tests/bad-ipv4-version-pgm-heapoverflow.out
  vendor/tcpdump/dist/tests/bad-ipv4-version-pgm-heapoverflow.pcap   (contents, 
props changed)
  vendor/tcpdump/dist/tests/bfd-raw-auth-md5-v.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-md5.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-md5.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/bfd-raw-auth-sha1-v.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-sha1.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-sha1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/bfd-raw-auth-simple-v.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-simple.out
  vendor/tcpdump/dist/tests/bfd-raw-auth-simple.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/bgp-aigp.out
  vendor/tcpdump/dist/tests/bgp-aigp.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/bgp-large-community.out
  vendor/tcpdump/dist/tests/bgp-large-community.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/calm-fast-mac-lookup-heapoverflow.out
  vendor/tcpdump/dist/tests/calm-fast-mac-lookup-heapoverflow.pcap   (contents, 
props changed)
  vendor/tcpdump/dist/tests/cve-2014-8767-OLSR.out
  vendor/tcpdump/dist/tests/cve-2014-8767-OLSR.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/cve-2014-8768-Geonet.out
  vendor/tcpdump/dist/tests/cve-2014-8768-Geonet.pcap   (contents, props 
changed)
  vendor/tcpdump/dist/tests/cve-2014-8769-AODV.out
  vendor/tcpdump/dist/tests/cve-2014-8769-AODV.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/dhcp-mud.out
  vendor/tcpdump/dist/tests/dhcp-mud.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/dhcpv6-mud.out
  vendor/tcpdump/dist/tests/dhcpv6-mud.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/dnssec-vv.out
  vendor/tcpdump/dist/tests/dnssec.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/frf15-heapoverflow.out
  vendor/tcpdump/dist/tests/frf15-heapoverflow.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/geonet-mac-lookup-heapoverflow.out
  vendor/tcpdump/dist/tests/geonet-mac-lookup-heapoverflow.pcap   (contents, 
props changed)
  vendor/tcpdump/dist/tests/gre-heapoverflow-1.out
  vendor/tcpdump/dist/tests/gre-heapoverflow-1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/gre-heapoverflow-2.out
  vendor/tcpdump/dist/tests/gre-heapoverflow-2.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/heap-overflow-1.out
  vendor/tcpdump/dist/tests/heap-overflow-1.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/heap-overflow-2.out
  vendor/tcpdump/dist/tests/heap-overflow-2.pcap   (contents, props changed)
  vendor/tcpdump/dist/tests/heapoverflow-EXTRACT_16BITS.out
  vendor/tcpdump/dist/tests/heapoverflow-EXTRACT_16BITS.pcap   (contents, props 
changed)
  vendor/tcpdump/dist/tests/he

svn commit: r313025 - head/tests/sys/netinet

2017-01-31 Thread Alan Somers
Author: asomers
Date: Tue Jan 31 20:13:50 2017
New Revision: 313025
URL: https://svnweb.freebsd.org/changeset/base/313025

Log:
  Add tests for multi-fib IPv6 routing
  
  PR:   196361
  Submitted by: jhujh...@adjectivism.org
  Reported by:  Jason Healy 
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp

Modified:
  head/tests/sys/netinet/fibs_test.sh

Modified: head/tests/sys/netinet/fibs_test.sh
==
--- head/tests/sys/netinet/fibs_test.sh Tue Jan 31 19:17:06 2017
(r313024)
+++ head/tests/sys/netinet/fibs_test.sh Tue Jan 31 20:13:50 2017
(r313025)
@@ -75,9 +75,9 @@ arpresolve_checks_interface_fib_body()
get_fibs 2
 
# Configure TAP interfaces
-   setup_tap "$FIB0" ${ADDR0} ${MASK0}
+   setup_tap "$FIB0" inet ${ADDR0} ${MASK0}
TAP0=$TAP
-   setup_tap "$FIB1" ${ADDR1} ${MASK1}
+   setup_tap "$FIB1" inet ${ADDR1} ${MASK1}
TAP1=$TAP
 
# Simulate a crossover cable
@@ -112,7 +112,7 @@ arpresolve_checks_interface_fib_cleanup(
 atf_test_case loopback_and_network_routes_on_nondefault_fib cleanup
 loopback_and_network_routes_on_nondefault_fib_head()
 {
-   atf_set "descr" "When creating and deleting loopback routes, use the 
interface's fib"
+   atf_set "descr" "When creating and deleting loopback IPv4 routes, use 
the interface's fib"
atf_set "require.user" "root"
atf_set "require.config" "fibs"
 }
@@ -132,7 +132,7 @@ loopback_and_network_routes_on_nondefaul
get_fibs 1
 
# Configure a TAP interface
-   setup_tap ${FIB0} ${ADDR} ${MASK}
+   setup_tap ${FIB0} inet ${ADDR} ${MASK}
 
# Check whether the host route exists in only the correct FIB
setfib ${FIB0} netstat -rn -f inet | grep -q "^${ADDR}.*UHS.*lo0"
@@ -156,7 +156,7 @@ loopback_and_network_routes_on_nondefaul
setfib 0 netstat -rn -f inet | \
grep -q "^${SUBNET}/${MASK}.*${TAPD}"
if [ 0 -eq $? ]; then
-   setfib ${FIB0} netstat -rn -f inet
+   setfib 0 netstat -rn -f inet
atf_fail "Network route appeared in the wrong FIB"
fi
 }
@@ -166,12 +166,70 @@ loopback_and_network_routes_on_nondefaul
cleanup_tap
 }
 
+atf_test_case loopback_and_network_routes_on_nondefault_fib_inet6 cleanup
+loopback_and_network_routes_on_nondefault_fib_inet6_head()
+{
+   atf_set "descr" "When creating and deleting loopback IPv6 routes, use 
the interface's fib"
+   atf_set "require.user" "root"
+   atf_set "require.config" "fibs"
+}
+
+loopback_and_network_routes_on_nondefault_fib_inet6_body()
+{
+   atf_expect_fail "PR196361 IPv6 network routes don't respect 
net.add_addr_allfibs=0"
+   # Configure the TAP interface to use a nonrouteable RFC3849
+   # address and a non-default fib
+   ADDR="2001:db8::2"
+   SUBNET="2001:db8::"
+   MASK="64"
+
+   # Check system configuration
+   if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then
+   atf_skip "This test requires net.add_addr_allfibs=0"
+   fi
+   get_fibs 1
+
+   # Configure a TAP interface
+   setup_tap ${FIB0} inet6 ${ADDR} ${MASK}
+
+   # Check whether the host route exists in only the correct FIB
+   setfib ${FIB0} netstat -rn -f inet6 | grep -q "^${ADDR}.*UHS.*lo0"
+   if [ 0 -ne $? ]; then
+   setfib ${FIB0} netstat -rn -f inet6
+   atf_fail "Host route did not appear in the correct FIB"
+   fi
+   setfib 0 netstat -rn -f inet6 | grep -q "^${ADDR}.*UHS.*lo0"
+   if [ 0 -eq $? ]; then
+   setfib 0 netstat -rn -f inet6
+   atf_fail "Host route appeared in the wrong FIB"
+   fi
+
+   # Check whether the network route exists in only the correct FIB
+   setfib ${FIB0} netstat -rn -f inet6 | \
+   grep -q "^${SUBNET}/${MASK}.*${TAPD}"
+   if [ 0 -ne $? ]; then
+   setfib ${FIB0} netstat -rn -f inet6
+   atf_fail "Network route did not appear in the correct FIB"
+   fi
+   setfib 0 netstat -rn -f inet6 | \
+   grep -q "^${SUBNET}/${MASK}.*${TAPD}"
+   if [ 0 -eq $? ]; then
+   setfib 0 netstat -rn -f inet6
+   atf_fail "Network route appeared in the wrong FIB"
+   fi
+}
+
+loopback_and_network_routes_on_nondefault_fib_inet6_cleanup()
+{
+   cleanup_tap
+}
+
 
 # Regression test for kern/187552
 atf_test_case default_route_with_multiple_fibs_on_same_subnet cleanup
 default_route_with_multiple_fibs_on_same_subnet_head()
 {
-   atf_set "descr" "Multiple interfaces on the same subnet but with 
different fibs can both have default routes"
+   atf_set "descr" "Multiple interfaces on the same subnet but with 
different fibs can both have default IPv4 routes"
atf_set "require.user" "root"
atf_set "require.config" "fibs"
 }
@@ -193,9 +251,9 @@ default_route_with_m

svn commit: r313026 - head/sys/dev/ath

2017-01-31 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 31 20:57:40 2017
New Revision: 313026
URL: https://svnweb.freebsd.org/changeset/base/313026

Log:
  [ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU.
  
  This is just to improve adrian-debugging.

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cTue Jan 31 20:13:50 2017
(r313025)
+++ head/sys/dev/ath/if_ath_tx.cTue Jan 31 20:57:40 2017
(r313026)
@@ -2979,7 +2979,9 @@ ath_tx_tid_seqno_assign(struct ath_softc
M_SEQNO_SET(m0, seqno);
 
/* Return so caller can do something with it if needed */
-   DPRINTF(sc, ATH_DEBUG_SW_TX, "%s:  -> seqno=%d\n", __func__, seqno);
+   DPRINTF(sc, ATH_DEBUG_SW_TX,
+   "%s:  -> subtype=0x%x, tid=%d, seqno=%d\n",
+   __func__, subtype, tid, seqno);
return seqno;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313027 - head/release

2017-01-31 Thread Brad Davis
Author: brd (doc,ports committer)
Date: Tue Jan 31 21:59:10 2017
New Revision: 313027
URL: https://svnweb.freebsd.org/changeset/base/313027

Log:
  Add a new vagrant-box target, to make it easier and less redundant to only
  produce the Vagrant box and not upload it.
  
  Approved by:  re (gjb)

Modified:
  head/release/Makefile.vagrant

Modified: head/release/Makefile.vagrant
==
--- head/release/Makefile.vagrant   Tue Jan 31 20:57:40 2017
(r313026)
+++ head/release/Makefile.vagrant   Tue Jan 31 21:59:10 2017
(r313027)
@@ -24,8 +24,8 @@ VAGRANT_VERSION!= date +%Y.%m.%d
 VAGRANT_TARGET:=   ${OSRELEASE}${SNAPSHOT_DATE}
 .if !empty(CLOUDWARE)
 . for _PROVIDER in ${CLOUDWARE}
-.  if ${_PROVIDER:MVAGRANT*}
-VAGRANT_PROVIDERS+=${_PROVIDER:S/VAGRANT-//:tl}
+.  if ${_PROVIDER:tu:MVAGRANT*}
+VAGRANT_PROVIDERS+=${_PROVIDER:tu:S/VAGRANT-//:tl}
 .  endif
 . endfor
 .endif
@@ -70,13 +70,16 @@ ${VAGRANT_TARGET}.${PROVIDER}.box: ${PRO
 . endif
 
 CLEANFILES+=   vagrant-do-upload-${PROVIDER}
-vagrant-do-upload-${PROVIDER}: ${VAGRANT_TARGET}.${PROVIDER}.box
+vagrant-do-upload-${PROVIDER}: vagrant-box
 . if ${PROVIDER} == "virtualbox"
${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f 
${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER} -k ${VAGRANT_KEY} -u 
${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
 . elif ${PROVIDER} == "vmware"
${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f 
${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER}_desktop -k ${VAGRANT_KEY} -u 
${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
 . endif
touch ${.OBJDIR}/${.TARGET}
+
+vagrant-box: ${VAGRANT_TARGET}.${PROVIDER}.box
+
 .endfor
 
 vagrant-upload:${VAGRANT_UPLOAD_TGTS}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313028 - head/sys/net80211

2017-01-31 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Jan 31 22:21:08 2017
New Revision: 313028
URL: https://svnweb.freebsd.org/changeset/base/313028

Log:
  net80211: cleanup ic_flags / iv_flags
  
  Flags
   - IEEE80211_F_ASCAN
   - IEEE80211_F_SIBSS
   - IEEE80211_F_IBSSON
  are not used since r170530 (old WI compatibility ioctls removal)
  and r178354 (removed from other places).
  
  IEEE80211_F_TXPOW_FIXED was never utilized; initially added with
  IEEE80211_F_TXPOW_AUTO / IEEE80211_F_TXPOW_OFF flags,
  which were replaced with IEEE80211_C_TXPMGT capability check in r138568.
  
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D9369

Modified:
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_node.c
==
--- head/sys/net80211/ieee80211_node.c  Tue Jan 31 21:59:10 2017
(r313027)
+++ head/sys/net80211/ieee80211_node.c  Tue Jan 31 22:21:08 2017
(r313028)
@@ -349,7 +349,6 @@ ieee80211_create_ibss(struct ieee80211va
ni->ni_fhindex = 1;
}
if (vap->iv_opmode == IEEE80211_M_IBSS) {
-   vap->iv_flags |= IEEE80211_F_SIBSS;
ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS;   /* XXX */
if (vap->iv_flags & IEEE80211_F_DESBSSID)
IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);

Modified: head/sys/net80211/ieee80211_var.h
==
--- head/sys/net80211/ieee80211_var.h   Tue Jan 31 21:59:10 2017
(r313027)
+++ head/sys/net80211/ieee80211_var.h   Tue Jan 31 22:21:08 2017
(r313028)
@@ -572,8 +572,7 @@ MALLOC_DECLARE(M_80211_VAP);
 #defineIEEE80211_F_PRIVACY 0x0010  /* CONF: privacy 
enabled */
 #defineIEEE80211_F_PUREG   0x0020  /* CONF: 11g w/o 11b 
sta's */
 #defineIEEE80211_F_SCAN0x0080  /* STATUS: scanning */
-#defineIEEE80211_F_ASCAN   0x0100  /* STATUS: active scan 
*/
-#defineIEEE80211_F_SIBSS   0x0200  /* STATUS: start IBSS */
+/* 0x0300 reserved */
 /* NB: this is intentionally setup to be IEEE80211_CAPINFO_SHORT_SLOTTIME */
 #defineIEEE80211_F_SHSLOT  0x0400  /* STATUS: use short 
slot time*/
 #defineIEEE80211_F_PMGTON  0x0800  /* CONF: Power mgmt 
enable */
@@ -581,8 +580,7 @@ MALLOC_DECLARE(M_80211_VAP);
 #defineIEEE80211_F_WME 0x2000  /* CONF: enable WME use 
*/
 #defineIEEE80211_F_BGSCAN  0x4000  /* CONF: bg scan 
enabled (???)*/
 #defineIEEE80211_F_SWRETRY 0x8000  /* CONF: sw tx retry 
enabled */
-#define IEEE80211_F_TXPOW_FIXED0x0001  /* TX Power: fixed rate 
*/
-#defineIEEE80211_F_IBSSON  0x0002  /* CONF: IBSS creation 
enable */
+/* 0x0003 reserved */
 #defineIEEE80211_F_SHPREAMBLE  0x0004  /* STATUS: use short 
preamble */
 #defineIEEE80211_F_DATAPAD 0x0008  /* CONF: do alignment 
pad */
 #defineIEEE80211_F_USEPROT 0x0010  /* STATUS: protection 
enabled */
@@ -600,9 +598,9 @@ MALLOC_DECLARE(M_80211_VAP);
 #defineIEEE80211_F_DWDS0x8000  /* CONF: Dynamic WDS 
enabled */
 
 #defineIEEE80211_F_BITS \
-   "\20\1TURBOP\2COMP\3FF\4BURST\5PRIVACY\6PUREG\10SCAN\11ASCAN\12SIBSS" \
-   "\13SHSLOT\14PMGTON\15DESBSSID\16WME\17BGSCAN\20SWRETRY\21TXPOW_FIXED" \
-   "\22IBSSON\23SHPREAMBLE\24DATAPAD\25USEPROT\26USERBARKER\27CSAPENDING" \
+   "\20\1TURBOP\2COMP\3FF\4BURST\5PRIVACY\6PUREG\10SCAN" \
+   "\13SHSLOT\14PMGTON\15DESBSSID\16WME\17BGSCAN\20SWRETRY" \
+   "\23SHPREAMBLE\24DATAPAD\25USEPROT\26USERBARKER\27CSAPENDING" \
"\30WPA1\31WPA2\32DROPUNENC\33COUNTERM\34HIDESSID\35NOBRIDG\36PCF" \
"\37DOTH\40DWDS"
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r312988 - in head/sys: compat/cloudabi compat/linux kern sys

2017-01-31 Thread John Baldwin
On Monday, January 30, 2017 12:57:23 PM Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Mon Jan 30 12:57:22 2017
> New Revision: 312988
> URL: https://svnweb.freebsd.org/changeset/base/312988
> 
> Log:
>   Add kern_listen(), kern_shutdown(), and kern_socket(), and use them
>   instead of their sys_*() counterparts in various compats. The svr4
>   is left untouched, because there's no point.

Note that you can compile test svr4 since it is still in the tree.
If we want to remove svr4, then we should remove it.  However, we
should maintain code that is in the tree if it is still there.

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


Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-31 Thread John Baldwin
On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote:
> Author: nyan
> Date: Sat Jan 28 02:22:15 2017
> New Revision: 312910
> URL: https://svnweb.freebsd.org/changeset/base/312910
> 
> Log:
>   Remove pc98 support completely.
>   I thank all developers and contributors for pc98.
>   
>   Relnotes:   yes

BTW, my impression was that there are some other device drivers
that are effectively PC-98 only (e.g. everything that uses scsi_low.c)
but they might have pccard attachments for use with PC-98 laptops?

Perhaps Warner might know?

It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4)
all came from NetBSD/pc98 via PAO.

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


Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-31 Thread Warner Losh
On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin  wrote:
> On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote:
>> Author: nyan
>> Date: Sat Jan 28 02:22:15 2017
>> New Revision: 312910
>> URL: https://svnweb.freebsd.org/changeset/base/312910
>>
>> Log:
>>   Remove pc98 support completely.
>>   I thank all developers and contributors for pc98.
>>
>>   Relnotes:   yes
>
> BTW, my impression was that there are some other device drivers
> that are effectively PC-98 only (e.g. everything that uses scsi_low.c)
> but they might have pccard attachments for use with PC-98 laptops?
>
> Perhaps Warner might know?
>
> It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4)
> all came from NetBSD/pc98 via PAO.

These all work correctly on any PC Card machine. The only reason they
came in this way was because these devices were original marketed only
in Japan. I've used all these cards with external SCSI drives in the
past.

As far as I know, only the if_snc driver, which was removed, is truly
pc98 specific. It is wired in such a way that cannot be used in ibm-at
compatible laptops.  IIRC, it had hard-wired memory decode lines that
landed in the middle of the VGA graphics pages or BIOS low memory
areas. I have one of these cards still, and it will be detected on my
laptops, but can't work due to the required mappings.

Now, there's an different question about whether it is time to retire
some of the now-ancient SCSI cards from the system, but that's a
different kettle of fish that's larger than just nsp, ncv and stg.

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


svn commit: r313029 - svnadmin/conf

2017-01-31 Thread Matthew Seaman
Author: matthew (ports committer)
Date: Tue Jan 31 22:43:35 2017
New Revision: 313029
URL: https://svnweb.freebsd.org/changeset/base/313029

Log:
  The Grim Reaper calls.  Take in the commit bits for the following
  people who have neither made a src commit for at least 18 months, nor
  have they responded to multiple emails about their status as
  committers.  This is clearing up a backlog of about 3 years where the
  grim reaper process has not been happening.
  
  agc   Alistair Crooks
  akiyama   Shunsuke Akiyama
  andre Andre Oppermann
  charnier  Philippe Charnier
  cherryCherry Mathew
  das   David Schultz
  davidch   David Christensen
  edavisEric Davis
  fjoe  Max Khon
  iwasaki   Mitsuru IWASAKI
  kuriyama  Jun Kuriyama
  monthadar Monthadar Jaberi
  psPaul Saab
  rnoland   Robert Noland
  sanpeiMIHIRA Yoshiro
  simon Simon Nielsen
  stefanf   Stefan Farfeleder
  syuu  Takuya ASADA
  torek Chris Torek
  venkatVenkat Duvvuru
  
  Core would like to thank all of these people for their contributions
  to the project, and wishes them well in any future endeavours.
  
  While here, tidy up the mentors file.  In addition to certain of the
  above who were still technically under mentorship, remove entries for
  carl, miwi and snb who had previously given up their commit bits.
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Jan 31 22:21:08 2017(r313028)
+++ svnadmin/conf/accessTue Jan 31 22:43:35 2017(r313029)
@@ -21,13 +21,10 @@ ache
 achim
 adrian
 ae
-agc
-akiyama
 allanjude
 alc
 alfred
 ambrisko
-andre
 andreast
 andrew
 anish
@@ -50,16 +47,12 @@ brueffer
 bryanv
 bz
 cem
-charnier
-cherry
 cognet
 cperciva
 cracauer
 csjp
 cy
 dab
-das
-davidch
 davidcs
 dchagin
 def
@@ -74,14 +67,12 @@ dumbbell
 dwmalone   dwmalone=freebsd-committ...@maths.tcd.ie
 eadler
 ed
-edavis
 emaste
 emax
 eri
 erj
 fabient
 fanf
-fjoe
 gabor
 gad
 gallatin
@@ -102,7 +93,6 @@ hselasky
 ian
 imp
 ivadasz
-iwasaki
 jah
 jamie
 jasone
@@ -135,7 +125,6 @@ ken
 kevlo
 kib
 kp
-kuriyama
 landonf
 lidl
 loos
@@ -155,7 +144,6 @@ mizhka
 mjg
 mm
 mmel
-monthadar
 mp
 mr
 n_hibmadevnull
@@ -178,13 +166,11 @@ pho
 pjd
 pkelsey
 pluknet
-ps
 pstef
 qingli
 ray
 remko
 rmacklem
-rnoland
 roberto
 rodrigc
 royger
@@ -194,7 +180,6 @@ rrs
 rstone
 ru
 rwatson bb+lists.freebsd.cvs-committ...@cyrus.watson.org
-sanpei
 sbruno
 scf
 schweikh
@@ -203,23 +188,19 @@ se
 sephe
 sgalabov
 silby
-simon
 sjg
 skra
 slm
 smh
 sobomax
 stas
-stefanf
 stevek
 syrinx
-syuu
 takawata
 theraven
 thomas
 thompsa
 tijl
-torek
 trasz
 truckman
 tsoome
@@ -228,7 +209,6 @@ tychon
 ume
 uqs
 vangyzen
-venkat
 whu
 will
 wma

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Jan 31 22:21:08 2017(r313028)
+++ svnadmin/conf/mentors   Tue Jan 31 22:43:35 2017(r313029)
@@ -12,10 +12,7 @@
 # Mentee   Mentor  Optional comment
 achim  scottl  Co-mentor: emaste
 anish  neelCo-mentor: grehan
-agcscottl  Co-mentor: emax
 badger kib Co-mentor: vangyzen
-carl   jimharris
-cherry gibbs
 dabvangyzen
 defpjd
 dexuan sephe
@@ -27,14 +24,9 @@ jwd  rmacklem
 kadesaiken Co-mentor: scottl, ambrisko
 karels gnn
 mahrensmckusick
-miwi   rwatson
-monthadar  adrian
 peterj jhb Co-mentor: grog
 phil   theravenCo-mentor: sjg
 pstef  pfg
 slmken Co-mentor: scottl, ambrisko
-snbdwmalone
 stevek sjg
-torek  rpaulo
 tsoome allanjude   Co-mentor: imp
-venkat delphij Co-mentor: luigi, jhb
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-31 Thread John Baldwin
On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote:
> On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin  wrote:
> > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote:
> >> Author: nyan
> >> Date: Sat Jan 28 02:22:15 2017
> >> New Revision: 312910
> >> URL: https://svnweb.freebsd.org/changeset/base/312910
> >>
> >> Log:
> >>   Remove pc98 support completely.
> >>   I thank all developers and contributors for pc98.
> >>
> >>   Relnotes:   yes
> >
> > BTW, my impression was that there are some other device drivers
> > that are effectively PC-98 only (e.g. everything that uses scsi_low.c)
> > but they might have pccard attachments for use with PC-98 laptops?
> >
> > Perhaps Warner might know?
> >
> > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4)
> > all came from NetBSD/pc98 via PAO.
> 
> These all work correctly on any PC Card machine. The only reason they
> came in this way was because these devices were original marketed only
> in Japan. I've used all these cards with external SCSI drives in the
> past.
> 
> As far as I know, only the if_snc driver, which was removed, is truly
> pc98 specific. It is wired in such a way that cannot be used in ibm-at
> compatible laptops.  IIRC, it had hard-wired memory decode lines that
> landed in the middle of the VGA graphics pages or BIOS low memory
> areas. I have one of these cards still, and it will be detected on my
> laptops, but can't work due to the required mappings.
> 
> Now, there's an different question about whether it is time to retire
> some of the now-ancient SCSI cards from the system, but that's a
> different kettle of fish that's larger than just nsp, ncv and stg.

Fair enough.  I haven't fully put away my 12 axe and am toying with
dropping any ISA-only storage and NIC drivers (and perhaps pccard-only
as well in that case).  Hardware that wants to use ISA/pccard for
storage is probably happier running 4.x anyway.  One question is if we
should drop ISA attachments in that case for drivers that support PCI
and ISA.  However, there's a fair list of ISA-only adapters that would
be a good place to start anyway.  One concern is to not drop any drivers
that are commonly used in emulators or hypervisors (ed(4) comes to mind
though I think em(4) is probably available in any modern emulators or
hypervisors).

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


svn commit: r313030 - head/sys/netinet

2017-01-31 Thread Michael Tuexen
Author: tuexen
Date: Tue Jan 31 23:34:02 2017
New Revision: 313030
URL: https://svnweb.freebsd.org/changeset/base/313030

Log:
  Remove a duplicate debug statement.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_timer.c

Modified: head/sys/netinet/sctp_timer.c
==
--- head/sys/netinet/sctp_timer.c   Tue Jan 31 22:43:35 2017
(r313029)
+++ head/sys/netinet/sctp_timer.c   Tue Jan 31 23:34:02 2017
(r313030)
@@ -719,13 +719,9 @@ start_again:
if (num_mk) {
SCTPDBG(SCTP_DEBUG_TIMER1, "LAST TSN marked was %x\n",
tsnlast);
-   SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was 
%d peer-rwd:%ld\n",
-   num_mk, (u_long)stcb->asoc.peers_rwnd);
-   SCTPDBG(SCTP_DEBUG_TIMER1, "LAST TSN marked was %x\n",
-   tsnlast);
-   SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was 
%d peer-rwd:%d\n",
+   SCTPDBG(SCTP_DEBUG_TIMER1, "Num marked for retransmission was 
%d peer-rwd:%u\n",
num_mk,
-   (int)stcb->asoc.peers_rwnd);
+   stcb->asoc.peers_rwnd);
}
 #endif
*num_marked = num_mk;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-31 Thread Warner Losh
On Tue, Jan 31, 2017 at 3:46 PM, John Baldwin  wrote:
> On Tuesday, January 31, 2017 03:33:55 PM Warner Losh wrote:
>> On Tue, Jan 31, 2017 at 3:20 PM, John Baldwin  wrote:
>> > On Saturday, January 28, 2017 02:22:15 AM Takahashi Yoshihiro wrote:
>> >> Author: nyan
>> >> Date: Sat Jan 28 02:22:15 2017
>> >> New Revision: 312910
>> >> URL: https://svnweb.freebsd.org/changeset/base/312910
>> >>
>> >> Log:
>> >>   Remove pc98 support completely.
>> >>   I thank all developers and contributors for pc98.
>> >>
>> >>   Relnotes:   yes
>> >
>> > BTW, my impression was that there are some other device drivers
>> > that are effectively PC-98 only (e.g. everything that uses scsi_low.c)
>> > but they might have pccard attachments for use with PC-98 laptops?
>> >
>> > Perhaps Warner might know?
>> >
>> > It seems stg(4) had PCI variants, but nsp(4), ncv(4), and stg(4)
>> > all came from NetBSD/pc98 via PAO.
>>
>> These all work correctly on any PC Card machine. The only reason they
>> came in this way was because these devices were original marketed only
>> in Japan. I've used all these cards with external SCSI drives in the
>> past.
>>
>> As far as I know, only the if_snc driver, which was removed, is truly
>> pc98 specific. It is wired in such a way that cannot be used in ibm-at
>> compatible laptops.  IIRC, it had hard-wired memory decode lines that
>> landed in the middle of the VGA graphics pages or BIOS low memory
>> areas. I have one of these cards still, and it will be detected on my
>> laptops, but can't work due to the required mappings.
>>
>> Now, there's an different question about whether it is time to retire
>> some of the now-ancient SCSI cards from the system, but that's a
>> different kettle of fish that's larger than just nsp, ncv and stg.
>
> Fair enough.  I haven't fully put away my 12 axe and am toying with
> dropping any ISA-only storage and NIC drivers (and perhaps pccard-only
> as well in that case).  Hardware that wants to use ISA/pccard for
> storage is probably happier running 4.x anyway.  One question is if we
> should drop ISA attachments in that case for drivers that support PCI
> and ISA.  However, there's a fair list of ISA-only adapters that would
> be a good place to start anyway.  One concern is to not drop any drivers
> that are commonly used in emulators or hypervisors (ed(4) comes to mind
> though I think em(4) is probably available in any modern emulators or
> hypervisors).

ISA-only attachments would be a good place to start. My quick glance
shows this would be le(4), aha(4), cm(4), mse(4), and joy(4). There's
maybe half a dozen EISA-only drivers in the tree that I was planning
on retiring in 12, along with EISA. Likewise with the MCA attachments.

I know that ed, ep, ex, sn, fe and cs PC Card attachments still work,
or did fairly recently. All of those also have ISA attachments. I have
no clue if the ISA attachments work, though I still have some ISA
systems, I got rid of all my SCSI and Network ISA cards some time ago.

I had hoped to get all the pnp autoloading code going so we could
remove them from GENERIC before the 11 branch, but keep them as
modules. I ran out of time. However, there's still time for 12 though.

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


svn commit: r313031 - head/sys/netinet

2017-01-31 Thread Michael Tuexen
Author: tuexen
Date: Tue Jan 31 23:36:31 2017
New Revision: 313031
URL: https://svnweb.freebsd.org/changeset/base/313031

Log:
  Take the SCTP common header into account when computing the
  space available for chunks. This unbreaks the handling of
  ICMPV6 packets indicating "packet too big". It just worked
  for IPv4 since we are overbooking for IPv4.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Tue Jan 31 23:34:02 2017
(r313030)
+++ head/sys/netinet/sctp_usrreq.c  Tue Jan 31 23:36:31 2017
(r313031)
@@ -108,7 +108,7 @@ sctp_pathmtu_adjustment(struct sctp_tcb 
/* Adjust that too */
stcb->asoc.smallest_mtu = nxtsz;
/* now off to subtract IP_DF flag if needed */
-   overhead = IP_HDR_SIZE;
+   overhead = IP_HDR_SIZE + sizeof(struct sctphdr);
if (sctp_auth_is_required_chunk(SCTP_DATA, 
stcb->asoc.peer_auth_chunks)) {
overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313032 - head/sys/netinet

2017-01-31 Thread Michael Tuexen
Author: tuexen
Date: Wed Feb  1 00:10:29 2017
New Revision: 313032
URL: https://svnweb.freebsd.org/changeset/base/313032

Log:
  Ensure that the variable bail is always initialized before used.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Tue Jan 31 23:36:31 2017
(r313031)
+++ head/sys/netinet/sctp_output.c  Wed Feb  1 00:10:29 2017
(r313032)
@@ -7730,9 +7730,9 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
/* must make even word boundary */
space_left &= 0xfffc;
strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc);
+   giveup = 0;
+   bail = 0;
while ((space_left > 0) && (strq != NULL)) {
-   giveup = 0;
-   bail = 0;
moved = sctp_move_to_outqueue(stcb, strq, space_left, 
frag_point,
&giveup, eeor_mode, &bail, so_locked);
stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, 
strq, moved);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Bruce Evans

On Tue, 31 Jan 2017, Conrad Meyer wrote:


On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans  wrote:

On Tue, 31 Jan 2017, Bruce Evans wrote:
Unrolling (or not) may be helpful or harmful for entry and exit code.


Helpful, per my earlier benchmarks.


I
think there should by no alignment on entry -- just assume the buffer is
aligned in the usual case, and only run 4% slower when it is misaligned.


Please write such a patch and demonstrate the improvement.


I now understand the algorithm.

The division into 3 has to keep sequentiality (since CRC input is a bit
string), so it doesn't work to separate the memory acces of the 3 crc32's
by 8 bytes as in my simple test -- they have to be separated by large
amounts.  Then recombining requires multiplying the polynomials associated
with the CRCs of the higher 2 blocks by X^N and reducing again, where N is
large an related to the block size.  This is done using a large table for
each N needed, and to keep things reasonably simple, only 2 N's are used.


The exit code handles up to SHORT * 3 = 768 bytes, not up to 4 or 8
bytes or up to 3 times that like simpler algorithms.  768 is quite
large, and the exit code is quite slow.  It reduces 8 or 4 bytes at a
time without any dependency reduction, and then 1 byte at a time.


Yes, this is the important loop to unroll for small inputs.  Somehow


Not like clang does it.  Unrolling is useless without the 3-way blocking.


with the unrolling, it is only ~19% slower than the by-3 algorithm on
my system ??? not 66%.  Clang 3.9.1 unrolls both of these trailing
loops; here is the first:


Maybe 3.9.1 pessimizes the 3-way loop by unrolling it.  This would be
fairly easy to do.  Just replicate the 3 crc32q's a few times, say 8,
and do them in a bad order (3 blocks of 8 dependent ones instead of
8 blocks of 3 independent ones).  With enough replication, the code
would be too large for the hardware to reorder.  Inline asm has
another advantage here -- volatile on it prevents reordering and
might prevent unrolling.

Maybe 3.9.1 unpessimizes the inline asms.

But I suspect not getting the 3 times speedup is for another reason.




  0x00401b88 <+584>:   cmp$0x38,%rbx
  0x00401b8c <+588>:   jae0x401b93 
  0x00401b8e <+590>:   mov%rsi,%rdx
  0x00401b91 <+593>:   jmp0x401be1 
  0x00401b93 <+595>:   lea-0x1(%rdi),%rbx
  0x00401b97 <+599>:   sub%rdx,%rbx
  0x00401b9a <+602>:   mov%rsi,%rdx
  0x00401b9d <+605>:   nopl   (%rax)
  0x00401ba0 <+608>:   crc32q (%rdx),%rax
  0x00401ba6 <+614>:   crc32q 0x8(%rdx),%rax
  0x00401bad <+621>:   crc32q 0x10(%rdx),%rax
  0x00401bb4 <+628>:   crc32q 0x18(%rdx),%rax
  0x00401bbb <+635>:   crc32q 0x20(%rdx),%rax
  0x00401bc2 <+642>:   crc32q 0x28(%rdx),%rax
  0x00401bc9 <+649>:   crc32q 0x30(%rdx),%rax
  0x00401bd0 <+656>:   crc32q 0x38(%rdx),%rax
  0x00401bd7 <+663>:   add$0x40,%rdx
  0x00401bdb <+667>:   add$0x8,%rbx
  0x00401bdf <+671>:   jne0x401ba0 


No, this unrolling is useless.  The crc32q's are dependent on each other,
so they take 3 cycles each.  There are spare resources to run about 12
instructions during that time.  Loop control only takes 3.


I
don't understand the algorithm for joining crcs -- why doesn't it work
to reduce to 12 or 24 bytes in the main loop?


It would, but I haven't implemented or tested that.  You're welcome to
do so and demonstrate an improvement.  It does add more lookup table
bloat, but perhaps we could just remove the 3x8k table ??? I'm not sure
it adds any benefit over the 3x256 table.


Your benchmarks mainly give results for the <= 768 bytes where most of
the manual optimizations don't apply.


Actually, they test only the large buffer case.  They used buffer size
of 1M and 1k and didn't do the entry and exit code that usually dominates
for small buffers.

I re-tested with the correct blocking.  This was about 10% slower
(0.34 -> 0.37 seconds for 10GB), except for clang without intrinsics it
was 20% slower (0.43 -> 0.51) seconds.


0x000400: asm:68 intrins:62 multitable:684  (ns per buf)


I don't see any signs of this in my test:
- a single crc32q in a (C) loop doesn't benefit from unrolling or lose
  to the extra clang instructions without intrinsics.  clang-3.9.0
  unrolls this 8-way in the simpler environment of my test program,
  but this makes no difference.
- similarly for a single crc32b in a loop, except when I forgot to
  change the type of the crc accumulator from uint64_t to uint32_t,
  gcc was 1 cycle slower in the loop (3 instead of 4).  gcc generates
  an extra instruction to zero-extend the crc, and this is more
  expensive than usual since it gives gives another dependency.
  clang optimizes this away.


0x000800: asm:132 intrins:133  (ns per buf)
0x002000: asm:449 intrins:446  (ns per buf)
0x008000: asm:1501 intrins:1497  (ns per buf)
0x02: asm:5618 int

svn commit: r313033 - head/share/misc

2017-01-31 Thread Johannes M Dieterich
Author: jmd (ports committer)
Date: Wed Feb  1 01:25:30 2017
New Revision: 313033
URL: https://svnweb.freebsd.org/changeset/base/313033

Log:
  Add myself (jmd) to committers-ports.dot. Document rene and swills as my 
mentors.
  
  Reviewed by:  rene (mentor)
  Approved by:  rene (mentor)
  Differential Revision:https://reviews.freebsd.org/D9393

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Feb  1 00:10:29 2017
(r313032)
+++ head/share/misc/committers-ports.dotWed Feb  1 01:25:30 2017
(r313033)
@@ -125,6 +125,7 @@ jgh [label="Jason Helfman\njgh@FreeBSD.o
 jhale [label="Jason E. Hale\njh...@freebsd.org\n2012/09/10"]
 jkim [label="Jung-uk Kim\nj...@freebsd.org\n2007/09/12"]
 jlaffaye [label="Julien Laffaye\njlaff...@freebsd.org\n2011/06/06"]
+jmd [label="Johannes M. Dieterich\n...@freebsd.org\n2017/01/09"]
 jmelo [label="Jean Milanez Melo\njm...@freebsd.org\n2006/03/31"]
 joerg [label="Joerg Wunsch\njo...@freebsd.org\n1994/08/22"]
 johans [label="Johan Selst\njoh...@freebsd.org\n2006/04/01"]
@@ -562,6 +563,7 @@ rene -> bar
 rene -> cmt
 rene -> crees
 rene -> jgh
+rene -> jmd
 rene -> ler
 rene -> olivierd
 
@@ -594,6 +596,7 @@ stas -> araujo
 steve -> netchild
 
 swills -> feld
+swills -> jmd
 swills -> jrm
 swills -> milki
 swills -> pclin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313034 - head/sys/dev/usb

2017-01-31 Thread Warner Losh
Author: imp
Date: Wed Feb  1 02:00:18 2017
New Revision: 313034
URL: https://svnweb.freebsd.org/changeset/base/313034

Log:
  Add USB IDs supported by TI / Intel USB 3410 family (modems of various
  flavors). This includes both the release products (from Honeywell,
  Moxa and Multitech) as well as development kits.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Feb  1 01:25:30 2017(r313033)
+++ head/sys/dev/usb/usbdevsWed Feb  1 02:00:18 2017(r313034)
@@ -587,6 +587,7 @@ vendor CCYU 0x1065  CCYU Technology
 vendor CURITEL 0x106c  Curitel Communications Inc
 vendor SILABS2 0x10a6  SILABS2
 vendor USI 0x10ab  USI
+vendor HONEYWELL   0x10ac  Honeywell
 vendor LIEBERT20x10af  Liebert
 vendor PLX 0x10b5  PLX
 vendor ASANTE  0x10bd  Asante
@@ -594,6 +595,7 @@ vendor SILABS   0x10c4  Silicon Labs
 vendor SILABS3 0x10c5  Silicon Labs
 vendor SILABS4 0x10ce  Silicon Labs
 vendor ACTIONS 0x10d6  Actions
+vendor MOXA0x110a  Moxa
 vendor ANALOG  0x1110  Analog Devices
 vendor TENX0x1130  Ten X Technology, Inc.
 vendor ISSC0x1131  Integrated System Solution Corp.
@@ -698,6 +700,7 @@ vendor ELV  0x18ef  ELV
 vendor LINKSYS30x1915  Linksys
 vendor QUALCOMMINC 0x19d2  Qualcomm, Incorporated
 vendor QUALCOMM3   0x19f5  Qualcomm, Inc.
+vendor ABBOTT  0x1a61  Abbott Diabetics
 vendor BAYER   0x1a79  Bayer
 vendor WCH20x1a86  QinHeng Electronics
 vendor STELERA 0x1a8d  Stelera Wireless
@@ -806,6 +809,10 @@ product 3COMUSR USRISDN0x008f  3Com U.S
 product 3COMUSR HOMECONN   0x009d  3Com HomeConnect Camera
 product 3COMUSR USR56K 0x3021  U.S. Robotics 56000 Voice FaxModem Pro
 
+/* Abbott Diabetics */
+product ABBOTT STEREO_PLUG 0x3410  Abbott Diabetics Stereo Plug
+product ABBOTT STRIP_PORT  0x3420  Abbott Diabetics Strip Port
+
 /* AboCom products */
 product ABOCOM XX1 0x110c  XX1
 product ABOCOM XX2 0x200c  XX2
@@ -2290,6 +2297,9 @@ product HITACHI DVDCAM_USB0x001e  DVDCAM
 /* Holtek products */
 product HOLTEK F85 0xa030  Holtek USB gaming keyboard
 
+/* Honeywell */
+product HONEYWELL HGI800x0102  Honeywell HGI80 Wireless USB 
Gateway
+
 /* HP products */
 product HP 895C0x0004  DeskJet 895C
 product HP 4100C   0x0101  Scanjet 4100C
@@ -2448,6 +2458,9 @@ product HUAWEI3COM WUB320G0x0009  Aolynk
 
 /* IBM Corporation */
 product IBM USBCDROMDRIVE  0x4427  USB CD-ROM Drive
+product IBM USB45430x4543  TI IBM USB 4543 Modem
+product IBM USB454B0x454b  TI IBM USB 454B Modem
+product IBM USB454C0x454c  TI IBM USB 454C Modem
 
 /* Icom products */
 product ICOM SP1   0x0004  FTDI compatible adapter
@@ -3222,12 +3235,27 @@ product MOTOROLA2 MB886 0x710f  MB886 Mo
 product MOTOROLA4 RT2770   0x9031  RT2770
 product MOTOROLA4 RT3070   0x9032  RT3070
 
+/* Moxa */
+product MOXA MXU1_1110 0x1110  Moxa Uport 1110
+product MOXA MXU1_1130 0x1130  Moxa Uport 1130
+product MOXA MXU1_1131 0x1131  Moxa Uport 1131
+product MOXA MXU1_1150 0x1150  Moxa Uport 1150
+product MOXA MXU1_1151 0x1151  Moxa Uport 1151
+
 /* MpMan products */
 product MPMAN MPF400_2 0x25a8  MPF400 Music Player 2Go
 product MPMAN MPF400_1 0x36d0  MPF400 Music Player 1Go
 
 /* MultiTech products */
+product MULTITECH MT9234ZBA_2  0x0319  MT9234ZBA USB modem (alt)
 product MULTITECH ATLAS0xf101  MT5634ZBA-USB modem
+product MULTITECH GSM  0xf108  GSM USB Modem
+product MULTITECH CDMA 0xf109  CDMA USB Modem
+product MULTITECH CDMA_FW  0xf110  CDMA USB Modem firmware running
+productMULTITECH GSM_FW0xf111  GSM USB Modem firmware running
+product MULTITECH EDGE 0xf112  Edge USB Modem
+product MULTITECH MT9234MU 0xf114  MT9234 MU
+product MULTITECH MT9234ZBA0xf115  MT9234 ZBA
 
 /* Mustek products */
 product MUSTEK 1200CU  0x0001  1200 CU scanner
@@ -4466,6 +4494,13 @@ product TENX UAUDIO0 0xf211  USB audio h
 /* Texas Intel products */
 product TI UTUSB41 0x1446  UT-USB41 hub
 product TI TUSB20460x2046  TUSB2046 hub
+product TI USB3410 0x3410  TI USB 3410 Modem
+product TI USB5052 0x5052  TI USB 5250 Modem
+product TI FRI20x5053  TI Fish River Island II
+product TI USB5052_EEPROM  0x505a  TI USB 5250 Modem w/Eeprom
+product TI USB5052_FW  0x505f  TI USB 5250 Modme w/Firmware running
+product TI USB5152 0x5152  TI USB 5152 Modem
+product TI EZ430   

svn commit: r313035 - head/contrib/binutils/opcodes

2017-01-31 Thread Justin Hibbits
Author: jhibbits
Date: Wed Feb  1 02:42:45 2017
New Revision: 313035
URL: https://svnweb.freebsd.org/changeset/base/313035

Log:
  Add rfdi opcode to binutils
  
  The rfdi instruction is part of the e500mc and derivative cores.  It came into
  binutils in a GPLv3 patch, along with the rest of the e500mc instruction set.
  Currently only rfdi is planned to be used, so rather than attempt to backport
  the full patch, take a surgical route and add instructions as needed.
  
  MFC after:2 weeks

Modified:
  head/contrib/binutils/opcodes/ppc-opc.c

Modified: head/contrib/binutils/opcodes/ppc-opc.c
==
--- head/contrib/binutils/opcodes/ppc-opc.c Wed Feb  1 02:00:18 2017
(r313034)
+++ head/contrib/binutils/opcodes/ppc-opc.c Wed Feb  1 02:42:45 2017
(r313035)
@@ -2789,6 +2789,7 @@ const struct powerpc_opcode powerpc_opco
 { "crnor",   XL(19,33),XL_MASK,COM,{ BT, BA, BB } 
},
 { "rfmci",X(19,38), 0x,PPCRFMCI,   { 0 } },
 
+{ "rfdi",XL(19,39),0x, BOOKE,  { 0 } },
 { "rfi", XL(19,50),0x, COM,{ 0 } },
 { "rfci",XL(19,51),0x, PPC403 | BOOKE, { 0 } },
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Bruce Evans

Another reply to this...

On Tue, 31 Jan 2017, Conrad Meyer wrote:


On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans  wrote:

On Tue, 31 Jan 2017, Bruce Evans wrote:
Unrolling (or not) may be helpful or harmful for entry and exit code.


Helpful, per my earlier benchmarks.


I
think there should by no alignment on entry -- just assume the buffer is
aligned in the usual case, and only run 4% slower when it is misaligned.


Please write such a patch and demonstrate the improvement.


It is easy to demonstrate.  I just put #if 0 around the early alignment
code.  The result seem too good to be true, so maybe I missed some
later dependency on alignment of the addresses:
- for 128-byte buffers and misalignment of 3, 10g takes 1.48 seconds with
  alignment and 1.02 seconds without alignment.
This actually makes sense, 128 bytes can be done with 16 8-byte unaligned
crc32q's.  The alignment code makes it do 15 * 8-but and (5 + 3) * 1-byte.
7 more 3-cycle instructions and overhead too is far more than the cost
of letting the CPU do read-combining.
- for 4096-byte buffers, the difference is insignificant (0.47 seconds for
  10g.


I
don't understand the algorithm for joining crcs -- why doesn't it work
to reduce to 12 or 24 bytes in the main loop?


It would, but I haven't implemented or tested that.  You're welcome to
do so and demonstrate an improvement.  It does add more lookup table
bloat, but perhaps we could just remove the 3x8k table ??? I'm not sure
it adds any benefit over the 3x256 table.


Good idea, but the big table is useful.  Ifdefing out the LONG case reduces
the speed for large buffers from ~0.35 seconds to ~0.43 seconds in the
setup below.  Ifdefing out the SHORT case only reduces to ~0.39 seconds.
I hoped that an even shorter SHORT case would work.  I think it now handles
768 bytes (3 * SHORT) in the inner loop.  That is 32 sets of 3 crc32q's,
and I would have thought that update at the end would take about as long
as 1 iteration (3%), but it apparently takes 33%.


...
Your benchmarks mainly give results for the <= 768 bytes where most of
the manual optimizations don't apply.


0x000400: asm:68 intrins:62 multitable:684  (ns per buf)
0x000800: asm:132 intrins:133  (ns per buf)
0x002000: asm:449 intrins:446  (ns per buf)
0x008000: asm:1501 intrins:1497  (ns per buf)
0x02: asm:5618 intrins:5609  (ns per buf)

(All routines are in a separate compilation unit with no full-program
optimization, as they are in the kernel.)


These seem slow.  I modified my program to test the actual kernel code,
and get for 10gB on freefall's Xeon (main times in seconds):

0x08: asm(rm):3.41 asm(r):3.07 intrins:6.01 gcc:3.74  (3S = 2.4ns/buf)
0x10: asm(rm):2.05 asm(r):1.70 intrins:2.92 gcc:2.62  (2S = 3/2ns/buf)
0x20: asm(rm):1.63 asm(r):1.58 intrins:1.62 gcc:1.61  (1.6S = 5.12ns/buf)
0x40: asm(rm):1.07 asm(r):1.11 intrins:1.06 gcc:1.14  (1.1S = 7.04ns/buf)
0x80: asm(rm):1.02 asm(r):1.04 intrins:1.03 gcc:1.04  (1.02S = 13.06ns/buf)
0x000100: asm(rm):1.02 asm(r):1.02 intrins:1.02 gcc:1.08  (1.02S = 52.22ns/buf)
0x000200: asm(rm):1.02 asm(r):1.02 intrins:1.02 gcc:1.02  (1.02S = 104.45ns/buf)
0x000400: asm(rm):0.58 asm(r):0.57 intrins:0.57 gcc:0.57  (.57S = 116.43ns/buf)
0x001000: asm(rm):0.62 asm(r):0.57 intrins:0.57 gcc:0.57  (.57S = 233.44ns/buf)
0x002000: asm(rm):0.48 asm(r):0.46 intrins:0.46 gcc:0.46  (.46S = 376.83ns/buf)
0x004000: asm(rm):0.49 asm(r):0.46 intrins:0.46 gcc:0.46  (.46S = 753.66ns/buf)
0x008000: asm(rm):0.49 asm(r):0.38 intrins:0.38 gcc:0.38  (.38S = 1245.18ns/buf)
0x01: asm(rm):0.47 asm(r):0.38 intrins:0.36 gcc:0.38  (.36S = 2359.30ns/buf)
0x02: asm(rm):0.43 asm(r):1.05 intrins:0.35 gcc:0.36  (.35S = 4587.52ns/buf)

asm(r) is a fix for clang's slownes with inline asms.  Just change the
constraint from "rm" to "r".  This takes an extra register, but no more
uops.

This is for the aligned case with no hacks.

intrins does something bad for small buffers.  Probably just the branch over
the dead unrolling.  Twice 2.4ns/buf for 8-byte buffers is still very fast.
This is 16 cycles.  3 cycles to do 1 crc32q and the rest mainly for 1 function
call and too many branches.

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

svn commit: r313036 - in head/sys/powerpc: booke include

2017-01-31 Thread Justin Hibbits
Author: jhibbits
Date: Wed Feb  1 03:29:13 2017
New Revision: 313036
URL: https://svnweb.freebsd.org/changeset/base/313036

Log:
  Add Book-E Enhanced Debug (E.D) profile debug support
  
  Freescale added the E.D profile to e500mc and derivative cores.  From
  Freescale's EREF reference manual this is enabled by a bit in HID0 and should
  otherwise default to traditional debug.  However, none of the Freescale cores
  support that bit, and instead always use E.D.  This results in kernel panics
  using the standard debug on e500mc+ cores.
  
  Enhanced debug allows debugging of interrupts, including critical interrupts,
  as it uses a different save/restore registers (srr*).  At this time we don't 
use
  this ability, so instead share the core of the debug handler code between both
  handlers.
  
  MFC after:3 weeks

Modified:
  head/sys/powerpc/booke/booke_machdep.c
  head/sys/powerpc/booke/trap_subr.S
  head/sys/powerpc/include/spr.h

Modified: head/sys/powerpc/booke/booke_machdep.c
==
--- head/sys/powerpc/booke/booke_machdep.c  Wed Feb  1 02:42:45 2017
(r313035)
+++ head/sys/powerpc/booke/booke_machdep.c  Wed Feb  1 03:29:13 2017
(r313036)
@@ -187,6 +187,7 @@ extern void *int_watchdog;
 extern void *int_data_tlb_error;
 extern void *int_inst_tlb_error;
 extern void *int_debug;
+extern void *int_debug_ed;
 extern void *int_vec;
 extern void *int_vecast;
 #ifdef HWPMC_HOOKS
@@ -242,6 +243,7 @@ ivor_setup(void)
case FSL_E500mc:
case FSL_E5500:
SET_TRAP(SPR_IVOR7, int_fpu);
+   SET_TRAP(SPR_IVOR15, int_debug_ed);
break;
case FSL_E500v1:
case FSL_E500v2:

Modified: head/sys/powerpc/booke/trap_subr.S
==
--- head/sys/powerpc/booke/trap_subr.S  Wed Feb  1 02:42:45 2017
(r313035)
+++ head/sys/powerpc/booke/trap_subr.S  Wed Feb  1 03:29:13 2017
(r313036)
@@ -794,6 +794,22 @@ interrupt_vector_top:
 INTERRUPT(int_debug)
STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1)
FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG)
+   bl  int_debug_int
+   FRAME_LEAVE(SPR_CSRR0, SPR_CSRR1)
+   rfci
+
+INTERRUPT(int_debug_ed)
+   STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_DSRR0, SPR_DSRR1)
+   FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG)
+   bl  int_debug_int
+   FRAME_LEAVE(SPR_DSRR0, SPR_DSRR1)
+   rfdi
+   /* .long 0x4c4e */
+
+/* Internal helper for debug interrupt handling. */
+/* Common code between e500v1/v2 and e500mc-based cores. */
+int_debug_int:
+   mflr%r14
GET_CPUINFO(%r3)
lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0)(%r3)
bl  0f
@@ -819,7 +835,8 @@ INTERRUPT(int_debug)
mtspr   SPR_SRR0, %r3
lwz %r4, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR1+8)(%r4);
mtspr   SPR_SRR1, %r4
-   b   9f
+   mtlr%r14
+   blr
 1:
addi%r3, %r1, 8
bl  CNAME(trap)
@@ -828,10 +845,6 @@ INTERRUPT(int_debug)
 * We actually need to return to the process with an rfi.
 */
b   trapexit
-9:
-   FRAME_LEAVE(SPR_CSRR0, SPR_CSRR1)
-   rfci
-
 
 /*
  * Common trap code

Modified: head/sys/powerpc/include/spr.h
==
--- head/sys/powerpc/include/spr.h  Wed Feb  1 02:42:45 2017
(r313035)
+++ head/sys/powerpc/include/spr.h  Wed Feb  1 03:29:13 2017
(r313036)
@@ -671,6 +671,8 @@
 #defineSPR_CSRR1   0x03b   /* ..8 59 Critical SRR1 */
 #defineSPR_MCSRR0  0x23a   /* ..8 570 Machine check SRR0 */
 #defineSPR_MCSRR1  0x23b   /* ..8 571 Machine check SRR1 */
+#defineSPR_DSRR0   0x23e   /* ..8 574 Debug SRR0 */
+#defineSPR_DSRR1   0x23f   /* ..8 575 Debug SRR1 */
 
 #defineSPR_MMUCR   0x3b2   /* 4.. MMU Control Register */
 #define  MMUCR_SWOA(0x8000 >> 7)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313037 - in head/sys: amd64/include kern mips/include net powerpc/include sparc64/include

2017-01-31 Thread Jason A. Harmening
Author: jah
Date: Wed Feb  1 03:32:49 2017
New Revision: 313037
URL: https://svnweb.freebsd.org/changeset/base/313037

Log:
  Implement get_pcpu() for the remaining architectures and use it to
  replace pcpu_find(curcpu) in MI code.

Modified:
  head/sys/amd64/include/pcpu.h
  head/sys/kern/kern_rmlock.c
  head/sys/mips/include/pcpu.h
  head/sys/net/netisr.c
  head/sys/powerpc/include/cpufunc.h
  head/sys/powerpc/include/pcpu.h
  head/sys/sparc64/include/pcpu.h

Modified: head/sys/amd64/include/pcpu.h
==
--- head/sys/amd64/include/pcpu.h   Wed Feb  1 03:29:13 2017
(r313036)
+++ head/sys/amd64/include/pcpu.h   Wed Feb  1 03:32:49 2017
(r313037)
@@ -78,6 +78,7 @@
 
 extern struct pcpu *pcpup;
 
+#defineget_pcpu()  (pcpup)
 #definePCPU_GET(member)(pcpup->pc_ ## member)
 #definePCPU_ADD(member, val)   (pcpup->pc_ ## member += (val))
 #definePCPU_INC(member)PCPU_ADD(member, 1)
@@ -203,6 +204,15 @@ extern struct pcpu *pcpup;
}   \
 }
 
+#defineget_pcpu() __extension__ ({ 
\
+   struct pcpu *__pc;  \
+   \
+   __asm __volatile("movq %%gs:%1,%0"  \
+   : "=r" (__pc)   \
+   : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace;  \
+   __pc;   \
+})
+
 #definePCPU_GET(member)__PCPU_GET(pc_ ## member)
 #definePCPU_ADD(member, val)   __PCPU_ADD(pc_ ## member, val)
 #definePCPU_INC(member)__PCPU_INC(pc_ ## member)

Modified: head/sys/kern/kern_rmlock.c
==
--- head/sys/kern/kern_rmlock.c Wed Feb  1 03:29:13 2017(r313036)
+++ head/sys/kern/kern_rmlock.c Wed Feb  1 03:32:49 2017(r313037)
@@ -156,7 +156,7 @@ unlock_rm(struct lock_object *lock)
 */
critical_enter();
td = curthread;
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
for (queue = pc->pc_rm_queue.rmq_next;
queue != &pc->pc_rm_queue; queue = queue->rmq_next) {
tracker = (struct rm_priotracker *)queue;
@@ -258,7 +258,7 @@ rm_cleanIPI(void *arg)
struct rmlock *rm = arg;
struct rm_priotracker *tracker;
struct rm_queue *queue;
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
 
for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue;
queue = queue->rmq_next) {
@@ -355,7 +355,7 @@ _rm_rlock_hard(struct rmlock *rm, struct
struct pcpu *pc;
 
critical_enter();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
 
/* Check if we just need to do a proper critical_exit. */
if (!CPU_ISSET(pc->pc_cpuid, &rm->rm_writecpus)) {
@@ -416,7 +416,7 @@ _rm_rlock_hard(struct rmlock *rm, struct
}
 
critical_enter();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
CPU_CLR(pc->pc_cpuid, &rm->rm_writecpus);
rm_tracker_add(pc, tracker);
sched_pin();
@@ -641,7 +641,7 @@ _rm_rlock_debug(struct rmlock *rm, struc
 #ifdef INVARIANTS
if (!(rm->lock_object.lo_flags & LO_RECURSABLE) && !trylock) {
critical_enter();
-   KASSERT(rm_trackers_present(pcpu_find(curcpu), rm,
+   KASSERT(rm_trackers_present(get_pcpu(), rm,
curthread) == 0,
("rm_rlock: recursed on non-recursive rmlock %s @ %s:%d\n",
rm->lock_object.lo_name, file, line));
@@ -771,7 +771,7 @@ _rm_assert(const struct rmlock *rm, int 
}
 
critical_enter();
-   count = rm_trackers_present(pcpu_find(curcpu), rm, curthread);
+   count = rm_trackers_present(get_pcpu(), rm, curthread);
critical_exit();
 
if (count == 0)
@@ -797,7 +797,7 @@ _rm_assert(const struct rmlock *rm, int 
rm->lock_object.lo_name, file, line);
 
critical_enter();
-   count = rm_trackers_present(pcpu_find(curcpu), rm, curthread);
+   count = rm_trackers_present(get_pcpu(), rm, curthread);
critical_exit();
 
if (count != 0)

Modified: head/sys/mips/include/pcpu.h
==
--- head/sys/mips/include/pcpu.hWed Feb  1 03:29:13 2017
(r313036)
+++ head/sys/mips/include/pcpu.hWed Feb  1 03:32:49 2017
(r313037)
@@ -65,6 +65,7 @@ extern char pcpu_space[MAXCP

Re: svn commit: r313006 - in head: sys/conf sys/libkern sys/libkern/x86 sys/sys tests/sys/kern

2017-01-31 Thread Conrad Meyer
On Tue, Jan 31, 2017 at 7:16 PM, Bruce Evans  wrote:
> Another reply to this...
>
> On Tue, 31 Jan 2017, Conrad Meyer wrote:
>
>> On Tue, Jan 31, 2017 at 7:36 AM, Bruce Evans  wrote:
>>>
>>> On Tue, 31 Jan 2017, Bruce Evans wrote:
>>> I
>>> think there should by no alignment on entry -- just assume the buffer is
>>> aligned in the usual case, and only run 4% slower when it is misaligned.
>>
>>
>> Please write such a patch and demonstrate the improvement.
>
>
> It is easy to demonstrate.  I just put #if 0 around the early alignment
> code.  The result seem too good to be true, so maybe I missed some
> later dependency on alignment of the addresses:
> - for 128-byte buffers and misalignment of 3, 10g takes 1.48 seconds with
>   alignment and 1.02 seconds without alignment.
> This actually makes sense, 128 bytes can be done with 16 8-byte unaligned
> crc32q's.  The alignment code makes it do 15 * 8-but and (5 + 3) * 1-byte.
> 7 more 3-cycle instructions and overhead too is far more than the cost
> of letting the CPU do read-combining.
> - for 4096-byte buffers, the difference is insignificant (0.47 seconds for
>   10g.

I believe it, especially for newer amd64.  I seem to recall that older
x86 machines had a higher misalignment penalty, but it was largely
reduced in (?)Nehalem.  Why don't you go ahead and commit that change?

>> perhaps we could just remove the 3x8k table — I'm not sure
>> it adds any benefit over the 3x256 table.
>
>
> Good idea, but the big table is useful.  Ifdefing out the LONG case reduces
> the speed for large buffers from ~0.35 seconds to ~0.43 seconds in the
> setup below.  Ifdefing out the SHORT case only reduces to ~0.39 seconds.

Interesting.

> I hoped that an even shorter SHORT case would work.  I think it now handles
> 768 bytes (3 * SHORT) in the inner loop.

Right.

> That is 32 sets of 3 crc32q's,
> and I would have thought that update at the end would take about as long
> as 1 iteration (3%), but it apparently takes 33%.

The update at the end may be faster with PCLMULQDQ.  There are
versions of this algorithm that use that in place of the lookup-table
combine (for example, Linux has a permissively licensed implementation
here: 
http://lxr.free-electrons.com/source/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
).

Unfortunately, PCLMULQDQ uses FPU state, which is inappropriate most
of the time in kernel mode.  It could be used opportunistically if the
thread is already in FPU-save mode or if the input is "big enough" to
make it worth it.

>>> Your benchmarks mainly give results for the <= 768 bytes where most of
>>> the manual optimizations don't apply.
>>
>>
>> 0x000400: asm:68 intrins:62 multitable:684  (ns per buf)
>> 0x000800: asm:132 intrins:133  (ns per buf)
>> 0x002000: asm:449 intrins:446  (ns per buf)
>> 0x008000: asm:1501 intrins:1497  (ns per buf)
>> 0x02: asm:5618 intrins:5609  (ns per buf)
>>
>> (All routines are in a separate compilation unit with no full-program
>> optimization, as they are in the kernel.)
>
>
> These seem slow.  I modified my program to test the actual kernel code,
> and get for 10gB on freefall's Xeon (main times in seconds):

Freefall has a Haswell Xeon @ 3.3GHz.  My laptop is a Sandy Bridge
Core i5 @ 2.6 GHz.  That may help explain the difference.

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

Re: svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-31 Thread Mark Linimon
On Tue, Jan 31, 2017 at 04:36:04PM -0700, Warner Losh wrote:
> ISA-only attachments would be a good place to start. My quick glance
> shows this would be le(4), aha(4), cm(4), mse(4), and joy(4). There's
> maybe half a dozen EISA-only drivers in the tree that I was planning
> on retiring in 12, along with EISA. Likewise with the MCA attachments.

I can join the list of people threatening to send ISA cards to anyone who
objects.  This should scare them into not objecting :-)

(Yes, there is still at least one aha(4) card here in the house.  Somewhere.)

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


svn commit: r313038 - stable/11/sys/net

2017-01-31 Thread Ravi Pokala
Author: rpokala
Date: Wed Feb  1 04:53:52 2017
New Revision: 313038
URL: https://svnweb.freebsd.org/changeset/base/313038

Log:
  MFC r312678: Eliminate misleading comments and dead code in
  lacp_port_create()
  
  Variables "fast" and "active" are both constant in lacp_port_create(), but
  comments mispleadingly suggest that "fast" can be changed via ioctl. The
  constant values control the value of "lp->lp_state", so it too is constant,
  and the code for assigning different value to it is essentially dead.
  
  Remove both "fast" and "active", and set "lp->lp_state" unconditionally;
  that gets rid of the dead code and misleading comments.

Modified:
  stable/11/sys/net/ieee8023ad_lacp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/ieee8023ad_lacp.c
==
--- stable/11/sys/net/ieee8023ad_lacp.c Wed Feb  1 03:32:49 2017
(r313037)
+++ stable/11/sys/net/ieee8023ad_lacp.c Wed Feb  1 04:53:52 2017
(r313038)
@@ -526,9 +526,6 @@ lacp_port_create(struct lagg_port *lgp)
struct ifmultiaddr *rifma = NULL;
int error;
 
-   boolean_t active = TRUE; /* XXX should be configurable */
-   boolean_t fast = FALSE; /* Configurable via ioctl */ 
-
link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER);
sdl.sdl_alen = ETHER_ADDR_LEN;
 
@@ -557,9 +554,7 @@ lacp_port_create(struct lagg_port *lgp)
 
lacp_fill_actorinfo(lp, &lp->lp_actor);
lacp_fill_markerinfo(lp, &lp->lp_marker);
-   lp->lp_state =
-   (active ? LACP_STATE_ACTIVITY : 0) |
-   (fast ? LACP_STATE_TIMEOUT : 0);
+   lp->lp_state = LACP_STATE_ACTIVITY;
lp->lp_aggregator = NULL;
lacp_sm_rx_set_expired(lp);
LACP_UNLOCK(lsc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313039 - stable/10/sys/net

2017-01-31 Thread Ravi Pokala
Author: rpokala
Date: Wed Feb  1 04:54:23 2017
New Revision: 313039
URL: https://svnweb.freebsd.org/changeset/base/313039

Log:
  MFC r312678: Eliminate misleading comments and dead code in
  lacp_port_create()
  
  Variables "fast" and "active" are both constant in lacp_port_create(), but
  comments mispleadingly suggest that "fast" can be changed via ioctl. The
  constant values control the value of "lp->lp_state", so it too is constant,
  and the code for assigning different value to it is essentially dead.
  
  Remove both "fast" and "active", and set "lp->lp_state" unconditionally;
  that gets rid of the dead code and misleading comments.

Modified:
  stable/10/sys/net/ieee8023ad_lacp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/ieee8023ad_lacp.c
==
--- stable/10/sys/net/ieee8023ad_lacp.c Wed Feb  1 04:53:52 2017
(r313038)
+++ stable/10/sys/net/ieee8023ad_lacp.c Wed Feb  1 04:54:23 2017
(r313039)
@@ -523,9 +523,6 @@ lacp_port_create(struct lagg_port *lgp)
struct ifmultiaddr *rifma = NULL;
int error;
 
-   boolean_t active = TRUE; /* XXX should be configurable */
-   boolean_t fast = FALSE; /* Configurable via ioctl */ 
-
bzero((char *)&sdl, sizeof(sdl));
sdl.sdl_len = sizeof(sdl);
sdl.sdl_family = AF_LINK;
@@ -557,9 +554,7 @@ lacp_port_create(struct lagg_port *lgp)
 
lacp_fill_actorinfo(lp, &lp->lp_actor);
lacp_fill_markerinfo(lp, &lp->lp_marker);
-   lp->lp_state =
-   (active ? LACP_STATE_ACTIVITY : 0) |
-   (fast ? LACP_STATE_TIMEOUT : 0);
+   lp->lp_state = LACP_STATE_ACTIVITY;
lp->lp_aggregator = NULL;
lacp_sm_rx_set_expired(lp);
LACP_UNLOCK(lsc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313040 - head/sys/mips/include

2017-01-31 Thread Alexander Kabaev
Author: kan
Date: Wed Feb  1 05:00:34 2017
New Revision: 313040
URL: https://svnweb.freebsd.org/changeset/base/313040

Log:
  Add atomic_fcmpset_*() inlines for MIPS
  
  atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the
  read value from the target memory location into the 'old' pointer.
  
  Reviewed by:  imp, brooks
  Requested by: mjg
  Differential Revision:https://reviews.freebsd.org/D9391

Modified:
  head/sys/mips/include/atomic.h

Modified: head/sys/mips/include/atomic.h
==
--- head/sys/mips/include/atomic.h  Wed Feb  1 04:54:23 2017
(r313039)
+++ head/sys/mips/include/atomic.h  Wed Feb  1 05:00:34 2017
(r313040)
@@ -362,7 +362,7 @@ atomic_load_64(__volatile uint64_t *p, u
  * zero if the compare failed, nonzero otherwise.
  */
 static __inline uint32_t
-atomic_cmpset_32(__volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
+atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
 {
uint32_t ret;
 
@@ -405,6 +405,46 @@ atomic_cmpset_rel_32(__volatile uint32_t
return (atomic_cmpset_32(p, cmpval, newval));
 }
 
+static __inline uint32_t
+atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
+{
+   uint32_t ret;
+
+   __asm __volatile (
+   "1:\n\t"
+   "ll %0, %1\n\t" /* load old value */
+   "bne%0, %4, 2f\n\t" /* compare */
+   "move   %0, %3\n\t" /* value to store */
+   "sc %0, %1\n\t" /* attempt to store */
+   "beqz   %0, 1b\n\t" /* if it failed, spin */
+   "j  3f\n\t"
+   "2:\n\t"
+   "sw %0, %2\n\t" /* save old value */
+   "li %0, 0\n\t"
+   "3:\n"
+   : "=&r" (ret), "+m" (*p), "=m" (*cmpval)
+   : "r" (newval), "r" (*cmpval)
+   : "memory");
+   return ret;
+}
+
+static __inline uint32_t
+atomic_fcmpset_acq_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t 
newval)
+{
+   int retval;
+
+   retval = atomic_fcmpset_32(p, cmpval, newval);
+   mips_sync();
+   return (retval);
+}
+
+static __inline uint32_t
+atomic_fcmpset_rel_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t 
newval)
+{
+   mips_sync();
+   return (atomic_fcmpset_32(p, cmpval, newval));
+}
+
 /*
  * Atomically add the value of v to the integer pointed to by p and return
  * the previous value of *p.
@@ -431,7 +471,7 @@ atomic_fetchadd_32(__volatile uint32_t *
  * zero if the compare failed, nonzero otherwise.
  */
 static __inline uint64_t
-atomic_cmpset_64(__volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
+atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
 {
uint64_t ret;
 
@@ -475,6 +515,47 @@ atomic_cmpset_rel_64(__volatile uint64_t
return (atomic_cmpset_64(p, cmpval, newval));
 }
 
+static __inline uint32_t
+atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
+{
+uint32_t ret;
+
+__asm __volatile (
+"1:\n\t"
+   "lld%0, %1\n\t" /* load old value */
+"bne   %0, %4, 2f\n\t" /* compare */
+"move  %0, %3\n\t" /* value to store */
+"scd   %0, %1\n\t" /* attempt to store */
+"beqz  %0, 1b\n\t" /* if it failed, spin */
+"j 3f\n\t"
+"2:\n\t"
+"sw%0, %2\n\t" /* save old value */
+"li%0, 0\n\t"
+"3:\n"
+: "=&r" (ret), "+m" (*p), "=m" (*cmpval)
+: "r" (newval), "r" (*cmpval)
+: "memory");
+
+   return ret;
+}
+
+static __inline uint64_t
+atomic_fcmpset_acq_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t 
newval)
+{
+   int retval;
+
+   retval = atomic_fcmpset_64(p, cmpval, newval);
+   mips_sync();
+   return (retval);
+}
+
+static __inline uint64_t
+atomic_fcmpset_rel_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t 
newval)
+{
+   mips_sync();
+   return (atomic_fcmpset_64(p, cmpval, newval));
+}
+
 /*
  * Atomically add the value of v to the integer pointed to by p and return
  * the previous value of *p.
@@ -568,6 +649,9 @@ atomic_thread_fence_seq_cst(void)
 #defineatomic_cmpset_int   atomic_cmpset_32
 #defineatomic_cmpset_acq_int   atomic_cmpset_acq_32
 #defineatomic_cmpset_rel_int   atomic_cmpset_rel_32
+#defineatomic_fcmpset_int  atomic_fcmpset_32
+#defineatomic_fcmpset_acq_int  atomic_fcmpset_acq_32
+#defineatomic_fcmpset_rel_int  atomic_fcmpset_rel_32
 #defineatomic_load_acq_int atomic_load_acq_32
 #defineatomic_store_rel_intatomic_st

svn commit: r313041 - head/gnu/usr.bin/cc/cc_tools

2017-01-31 Thread Ed Maste
Author: emaste
Date: Wed Feb  1 05:24:17 2017
New Revision: 313041
URL: https://svnweb.freebsd.org/changeset/base/313041

Log:
  Bump GCC FBSD_CC_VER for r312899 (-march=octeon+ support)
  
  Reported by:  lidl
  MFC after:1 month
  MFC with: r312899
  Sponsored by: The FreeBSD Foundation

Modified:
  head/gnu/usr.bin/cc/cc_tools/freebsd-native.h

Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
==
--- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h   Wed Feb  1 05:00:34 
2017(r313040)
+++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h   Wed Feb  1 05:24:17 
2017(r313041)
@@ -8,7 +8,7 @@
 
 /* Fake out gcc/config/freebsd.h.  */
 #defineFBSD_MAJOR  12
-#defineFBSD_CC_VER 120 /* form like __FreeBSD_version 
*/
+#defineFBSD_CC_VER 121 /* form like __FreeBSD_version 
*/
 
 #undef SYSTEM_INCLUDE_DIR  /* We don't need one for now. */
 #undef TOOL_INCLUDE_DIR/* We don't need one for now. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"