svn commit: r294496 - in head/crypto/openssh: . contrib contrib/redhat contrib/suse

2016-01-21 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Jan 21 11:54:34 2016
New Revision: 294496
URL: https://svnweb.freebsd.org/changeset/base/294496

Log:
  Upgrade to OpenSSH 7.1p2.

Modified:
  head/crypto/openssh/ChangeLog
  head/crypto/openssh/README
  head/crypto/openssh/auth.c
  head/crypto/openssh/bitmap.c
  head/crypto/openssh/compat.c
  head/crypto/openssh/contrib/README
  head/crypto/openssh/contrib/redhat/openssh.spec
  head/crypto/openssh/contrib/suse/openssh.spec
  head/crypto/openssh/dns.c
  head/crypto/openssh/kex.c
  head/crypto/openssh/mux.c
  head/crypto/openssh/packet.c
  head/crypto/openssh/sftp-server.c
  head/crypto/openssh/sftp.c
  head/crypto/openssh/ssh-keygen.1
  head/crypto/openssh/ssh-keygen.c
  head/crypto/openssh/ssh-pkcs11-helper.c
  head/crypto/openssh/ssh_config
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/sshbuf-getput-crypto.c
  head/crypto/openssh/sshbuf-misc.c
  head/crypto/openssh/sshbuf.c
  head/crypto/openssh/sshconnect.c
  head/crypto/openssh/sshd.c
  head/crypto/openssh/sshd_config
  head/crypto/openssh/sshd_config.5
  head/crypto/openssh/sshkey.c
  head/crypto/openssh/version.h
Directory Properties:
  head/crypto/openssh/   (props changed)

Modified: head/crypto/openssh/ChangeLog
==
--- head/crypto/openssh/ChangeLog   Thu Jan 21 11:10:14 2016
(r294495)
+++ head/crypto/openssh/ChangeLog   Thu Jan 21 11:54:34 2016
(r294496)
@@ -1,3 +1,204 @@
+commit c88ac102f0eb89f2eaa314cb2e2e0ca3c890c443
+Author: Damien Miller 
+Date:   Thu Jan 14 11:08:19 2016 +1100
+
+bump version numbers
+
+commit 302bc21e6fadacb04b665868cd69b625ef69df90
+Author: Damien Miller 
+Date:   Thu Jan 14 11:04:04 2016 +1100
+
+openssh-7.1p2
+
+commit 6b33763242c063e4e0593877e835eeb1fd1b60aa
+Author: Damien Miller 
+Date:   Thu Jan 14 11:02:58 2016 +1100
+
+forcibly disable roaming support in the client
+
+commit 34d364f0d2e1e30a444009f0e04299bb7c94ba13
+Author: d...@openbsd.org 
+Date:   Mon Oct 5 17:11:21 2015 +
+
+upstream commit
+
+some more bzero->explicit_bzero, from Michael McConville
+
+Upstream-ID: 17f19545685c33327db2efdc357c1c9225ff00d0
+
+commit 8f5b93026797b9f7fba90d0c717570421ccebbd3
+Author: guent...@openbsd.org 
+Date:   Fri Sep 11 08:50:04 2015 +
+
+upstream commit
+
+Use explicit_bzero() when zeroing before free()
+
+from Michael McConville (mmcconv1 (at) sccs.swarthmore.edu)
+ok millert@ djm@
+
+Upstream-ID: 2e3337db046c3fe70c7369ee31515ac73ec00f50
+
+commit d77148e3a3ef6c29b26ec74331455394581aa257
+Author: d...@openbsd.org 
+Date:   Sun Nov 8 21:59:11 2015 +
+
+upstream commit
+
+fix OOB read in packet code caused by missing return
+ statement found by Ben Hawkes; ok markus@ deraadt@
+
+Upstream-ID: a3e3a85434ebfa0690d4879091959591f30efc62
+
+commit 076d849e17ab12603627f87b301e2dca71bae518
+Author: Damien Miller 
+Date:   Sat Nov 14 18:44:49 2015 +1100
+
+read back from libcrypto RAND when privdropping
+
+makes certain libcrypto implementations cache a /dev/urandom fd
+in preparation of sandboxing. Based on patch by Greg Hartman.
+
+commit f72adc0150011a28f177617a8456e1f83733099d
+Author: d...@openbsd.org 
+Date:   Sun Dec 13 22:42:23 2015 +
+
+upstream commit
+
+unbreak connections with peers that set
+ first_kex_follows; fix from Matt Johnston va bz#2515
+
+Upstream-ID: decc88ec4fc7515594fdb42b04aa03189a44184b
+
+commit 04bd8d019ccd906cac1a2b362517b8505f3759e6
+Author: d...@openbsd.org 
+Date:   Tue Jan 12 23:42:54 2016 +
+
+upstream commit
+
+use explicit_bzero() more liberally in the buffer code; ok
+ deraadt
+
+Upstream-ID: 0ece37069fd66bc6e4f55eb1321f93df372b65bf
+
+commit e91346dc2bbf460246df2ab591b7613908c1b0ad
+Author: Damien Miller 
+Date:   Fri Aug 21 14:49:03 2015 +1000
+
+we don't use Github for issues/pull-requests
+
+commit a4f5b507c708cc3dc2c8dd2d02e4416d7514dc23
+Author: Damien Miller 
+Date:   Fri Aug 21 14:43:55 2015 +1000
+
+fix URL for connect.c
+
+commit d026a8d3da0f8186598442997c7d0a28e7275414
+Author: Damien Miller 
+Date:   Fri Aug 21 13:47:10 2015 +1000
+
+update version numbers for 7.1
+
+commit 78f8f589f0ca1c9f41e5a9bae3cda5ce8a6b42ed
+Author: d...@openbsd.org 
+Date:   Fri Aug 21 03:45:26 2015 +
+
+upstream commit
+
+openssh-7.1
+
+Upstream-ID: ff7b1ef4b06caddfb45e08ba998128c88be3d73f
+
+commit 32a181980c62fce94f7f9ffaf6a79d90f0c309cf
+Author: d...@openbsd.org 
+Date:   Fri Aug 21 03:42:19 2015 +
+
+upstream commit
+
+fix inverted logic that broke PermitRootLogin; reported
+ by Mantas Mikulenas; ok 

Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-01-21 Thread Slawa Olhovchenkov
On Thu, Jan 21, 2016 at 01:34:57AM +0200, Andriy Gapon wrote:

> On 20/01/2016 22:03, Alan Somers wrote:
> > On Wed, Jan 20, 2016 at 2:20 AM, Andriy Gapon  wrote:
> >> On 19/01/2016 19:20, Alan Somers wrote:
> >>> The thing is, it never really worked in the first place.  Panics and
> >>> deadlocks are so frequent that I don't think the feature was usable
> >>> for anybody.
> >>
> >> The feature is perfectly usable for me.  I have never run into the 
> >> problems that
> >> you describe.  Why not fix the real bugs that you've run into?
> > 
> > Spectra Logic and iXSystems both experienced many problems with this.
> > The worst is a deadlock that can be triggered simply by pulling a
> > drive from a redundant pool when there exists a zvol anywhere in the
> > system (see https://reviews.freebsd.org/D4998 for a quick way to
> > reproduce).  Fixing it correctly would likely require far more time
> > than I have available.  I just want the bugs to go away.  See that
> > same code review for a change to make the feature optional.
> 
> I think that we all want all the bugs to go way.  One way to remove bugs is to
> remove (disable) code that contains bugs.  That way the perfect bug-free
> software is clearly achievable :-)  Unfortunately, that technique is not 
> always
> welcomed.
> 
> P.S.
> I think that the real problem here is that a method of a geom must never drop
> topology_lock.  In other words, the GEOM management code (like g_xxx() stuff 
> in
> geom_subr.c) expects that a topology can not change underneath it.  But
> zvol_geom_access() clearly breaks that contract.

May be same cause problem with swap on zvol (don't test on latest
-stable)?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294497 - head/crypto/openssh

2016-01-21 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Jan 21 12:41:02 2016
New Revision: 294497
URL: https://svnweb.freebsd.org/changeset/base/294497

Log:
  Explain why we don't include VersionAddendum in the debug mode banner.

Modified:
  head/crypto/openssh/ssh.c

Modified: head/crypto/openssh/ssh.c
==
--- head/crypto/openssh/ssh.c   Thu Jan 21 11:54:34 2016(r294496)
+++ head/crypto/openssh/ssh.c   Thu Jan 21 12:41:02 2016(r294497)
@@ -990,6 +990,7 @@ main(int ac, char **av)
SYSLOG_FACILITY_USER, !use_syslog);
 
if (debug_flag)
+   /* version_addendum is always NULL at this point */
logit("%s, %s", SSH_RELEASE, OPENSSL_VERSION);
 
/* Parse the configuration files */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294495 - in head: . crypto/openssh

2016-01-21 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Jan 21 11:10:14 2016
New Revision: 294495
URL: https://svnweb.freebsd.org/changeset/base/294495

Log:
  Enable DSA keys by default.  They were disabled in OpenSSH 6.9p1.
  
  Noticed by:   glebius

Modified:
  head/UPDATING
  head/crypto/openssh/myproposal.h   (contents, props changed)
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/sshd_config.5

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jan 21 10:57:45 2016(r294494)
+++ head/UPDATING   Thu Jan 21 11:10:14 2016(r294495)
@@ -32,10 +32,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20160119:
-   The default configuration of ssh(1) no longer allows to use ssh-dss
-   keys.  To enable using them, add 'ssh-dss' to PubkeyAcceptedKeyTypes
-   option in the /etc/ssh/ssh_config.  Refer to ssh_config(5) for more
-   information.
The NONE and HPN patches has been removed from OpenSSH.  They are
still available in the security/openssh-portable port.
 

Modified: head/crypto/openssh/myproposal.h
==
--- head/crypto/openssh/myproposal.hThu Jan 21 10:57:45 2016
(r294494)
+++ head/crypto/openssh/myproposal.hThu Jan 21 11:10:14 2016
(r294495)
@@ -1,4 +1,5 @@
 /* $OpenBSD: myproposal.h,v 1.47 2015/07/10 06:21:53 markus Exp $ */
+/* $FreeBSD$ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -99,9 +100,11 @@
HOSTKEY_ECDSA_CERT_METHODS \
"ssh-ed25519-cert-...@openssh.com," \
"ssh-rsa-cert-...@openssh.com," \
+   "ssh-dss-cert-...@openssh.com," \
HOSTKEY_ECDSA_METHODS \
"ssh-ed25519," \
-   "ssh-rsa" \
+   "ssh-rsa," \
+   "ssh-dss"
 
 /* the actual algorithms */
 

Modified: head/crypto/openssh/ssh_config.5
==
--- head/crypto/openssh/ssh_config.5Thu Jan 21 10:57:45 2016
(r294494)
+++ head/crypto/openssh/ssh_config.5Thu Jan 21 11:10:14 2016
(r294495)
@@ -798,8 +798,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 .Pp
 The
@@ -821,8 +823,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 .Pp
 If hostkeys are known for the destination host then this default is modified
@@ -1251,8 +1255,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 .Pp
 The

Modified: head/crypto/openssh/sshd_config.5
==
--- head/crypto/openssh/sshd_config.5   Thu Jan 21 10:57:45 2016
(r294494)
+++ head/crypto/openssh/sshd_config.5   Thu Jan 21 11:10:14 2016
(r294495)
@@ -657,8 +657,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 .Pp
 The
@@ -752,8 +754,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 .Pp
 The list of available key types may also be obtained using the
@@ -1355,8 +1359,10 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 ssh-ed25519-cert-...@openssh.com,
 ssh-rsa-cert-...@openssh.com,
-ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
-ssh-ed25519,ssh-rsa
+ssh-dss-cert-...@openssh.com,
+ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
+ecdsa-sha2-nistp521,ssh-ed25519,
+ssh-rsa,ssh-dss
 .Ed
 

svn commit: r294499 - head/lib/clang

2016-01-21 Thread Andrew Turner
Author: andrew
Date: Thu Jan 21 12:59:54 2016
New Revision: 294499
URL: https://svnweb.freebsd.org/changeset/base/294499

Log:
  Disable -mlong-calls for the clang libraries for now, it increases the
  size of the clang binary for people with a crt1.o from before r293832.

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

Modified: head/lib/clang/clang.lib.mk
==
--- head/lib/clang/clang.lib.mk Thu Jan 21 12:42:31 2016(r294498)
+++ head/lib/clang/clang.lib.mk Thu Jan 21 12:59:54 2016(r294499)
@@ -7,7 +7,8 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/l
 INTERNALLIB=
 
 .if ${MACHINE_CPUARCH} == "arm"
-STATIC_CXXFLAGS+= -mlong-calls
+# This will need to be enabled to link clang 3.8
+#STATIC_CXXFLAGS+= -mlong-calls
 .endif
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294494 - head/crypto/openssh

2016-01-21 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Jan 21 10:57:45 2016
New Revision: 294494
URL: https://svnweb.freebsd.org/changeset/base/294494

Log:
  Take care not to pick up the wrong version of OpenSSL when running in an
  environment that has OpenSSL from ports in addition to the base version.

Modified:
  head/crypto/openssh/freebsd-configure.sh

Modified: head/crypto/openssh/freebsd-configure.sh
==
--- head/crypto/openssh/freebsd-configure.shThu Jan 21 08:58:39 2016
(r294493)
+++ head/crypto/openssh/freebsd-configure.shThu Jan 21 10:57:45 2016
(r294494)
@@ -7,6 +7,7 @@ configure_args="
 --prefix=/usr
 --sysconfdir=/etc/ssh
 --with-pam
+--with-ssl-dir=/usr
 --with-tcp-wrappers
 --with-libedit
 --with-ssl-engine
@@ -18,11 +19,16 @@ set -e
 # make sure configure uses the correct compiler
 export CC=$(echo ".include " | make -f /dev/stdin -VCC)
 export CPP=$(echo ".include " | make -f /dev/stdin -VCPP)
+unset CFLAGS CPPFLAGS LDFLAGS LIBS
 
 # regenerate configure and config.h.in
 autoheader
 autoconf
 
+# reset PATH to avoid picking up the wrong libraries
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+unset LD_LIBRARY_PATH
+
 # generate config.h with krb5 and stash it
 sh configure $configure_args --with-kerberos5
 mv config.log config.log.orig
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294498 - head/crypto/openssh

2016-01-21 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Jan 21 12:42:31 2016
New Revision: 294498
URL: https://svnweb.freebsd.org/changeset/base/294498

Log:
  Update the instructions and the list of major local modifications.

Modified:
  head/crypto/openssh/FREEBSD-upgrade

Modified: head/crypto/openssh/FREEBSD-upgrade
==
--- head/crypto/openssh/FREEBSD-upgrade Thu Jan 21 12:41:02 2016
(r294497)
+++ head/crypto/openssh/FREEBSD-upgrade Thu Jan 21 12:42:31 2016
(r294498)
@@ -1,5 +1,4 @@
 
-
FreeBSD maintainer's guide to OpenSSH-portable
==
 
@@ -34,10 +33,11 @@
 07) Tag:
 
 $ svn copy -m "Tag OpenSSH X.YpZ." \
-svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist \
-svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/X.YpZ
+   svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist \
+   svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/X.YpZ
 
-08) Check out head and run the pre-merge script:
+08) Check out head and run the pre-merge script, which strips our RCS
+tags from files that have them:
 
 $ svn co svn+ssh://svn.freebsd.org/base/head
 $ cd head/crypto/openssh
@@ -53,14 +53,16 @@
 
 0B) Diff against the vendor branch:
 
-$ svn diff \^/vendor-crypto/openssh/dist .
+$ svn diff --no-diff-deleted --no-diff-added \
+   --ignore-properties \^/vendor-crypto/openssh/X.YpZ .
 
 Files that have modifications relative to the vendor code, and
 only those files, must have the svn:keywords property set to
 FreeBSD=%H and be listed in the 'keywords' file created by the
 pre-merge script.
 
-0C) Run the post-merge script:
+0C) Run the post-merge script, which re-adds RCS tags to files that
+need them:
 
 $ sh freebsd-post-merge.sh
 
@@ -68,7 +70,7 @@
 
 $ sh freebsd-configure.sh
 
-0E) Check config.h very carefully.
+0E) Review changes to config.h very carefully.
 
 0F) If source files have been added or removed, update the appropriate
 makefiles to reflect changes in the vendor's Makefile.in.
@@ -92,8 +94,6 @@
  An overview of FreeBSD changes to OpenSSH-portable
  ==
 
-XXX This section is out of date
-
 0) VersionAddendum
 
The SSH protocol allows for a human-readable version string of up
@@ -103,26 +103,28 @@ XXX This section is out of date
is vulnerable when an OpenSSH advisory goes out.  Some people,
however, dislike advertising their patch level in the protocol
handshake, so we've added a VersionAddendum configuration variable
-   to allow them to change or disable it.
+   to allow them to change or disable it.  Upstream added support for
+   VersionAddendum on the server side, but we also support it on the
+   client side.
 
 1) Modified server-side defaults
 
We've modified some configuration defaults in sshd:
 
-  - PasswordAuthentication defaults to "no".
-
-  - LoginGraceTime defaults to 120 seconds instead of 600.
-
+  - UsePAM defaults to "yes".
   - PermitRootLogin defaults to "no".
-
-  - X11Forwarding defaults to "yes" (it's a threat to the client,
-not to the server.)
+  - X11Forwarding defaults to "yes".
+  - PasswordAuthentication defaults to "no".
+  - VersionAddendum defaults to "FreeBSD-MMDD".
+  - PrivilegeSeparation defaults to "sandbox".
 
 2) Modified client-side defaults
 
We've modified some configuration defaults in ssh:
 
   - CheckHostIP defaults to "no".
+  - VerifyHostKeyDNS defaults to "yes" if built with LDNS.
+  - VersionAddendum defaults to "FreeBSD-MMDD".
 
 3) Canonic host names
 
@@ -135,6 +137,34 @@ XXX This section is out of date
Our setusercontext(3) can set environment variables, which we must
take care to transfer to the child's environment.
 
+5) TCP wrappers
+
+   Support for TCP wrappers was removed in upstream 6.7p1.  We've
+   added it back by porting the 6.6p1 code forward.
+
+6) DSA keys
+
+   DSA keys were disabled by default in upstream 6.9p1.  We've added
+   them back.
+
+7) Agent client reference counting
+
+   We've added code to ssh-agent.c to implement client reference
+   counting; the agent will automatically exit when the last client
+   disconnects.
+
+8) Class-based login restrictions
+
+   We've added code to auth2.c to enforce the host.allow, host.deny,
+   times.allow and times.deny login class capabilities.
+
+9) HPN
+
+   We no longer have the HPN patches (adaptive buffer size for
+   increased throughput on high-BxD links), but we recognize and
+   ignore HPN-related configuration options to avoid breaking existing
+   configurations.
+
 
 
 This port was brought to you by (in no particular order) DARPA, NAI
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send 

svn commit: r294493 - in head/sys/boot: common efi/boot1

2016-01-21 Thread Steven Hartland
Author: smh
Date: Thu Jan 21 08:58:39 2016
New Revision: 294493
URL: https://svnweb.freebsd.org/changeset/base/294493

Log:
  Fix EFI UFS caching
  
  EFI was mixing caching in two separate places causing issues when multiple
  partitions where tested.
  
  Eliminate this by removing fsstat and re-factoring fsread into fsread_size,
  adding basic parameter validation.
  
  Also:
  * Enhance some error print outs.
  * Fix compilation under UFS1_ONLY and UFS2_ONLY
  * Use sizeof on vars instead of structs.
  * Add basic parameter validation to fsread_size.
  
  MFC after:1 week
  X-MFC-With:   r293268
  Sponsored by: Multiplay
  Differential Revision:https://reviews.freebsd.org/D4989

Modified:
  head/sys/boot/common/ufsread.c
  head/sys/boot/efi/boot1/ufs_module.c

Modified: head/sys/boot/common/ufsread.c
==
--- head/sys/boot/common/ufsread.c  Thu Jan 21 08:51:24 2016
(r294492)
+++ head/sys/boot/common/ufsread.c  Thu Jan 21 08:58:39 2016
(r294493)
@@ -165,7 +165,7 @@ static int sblock_try[] = SBLOCKSEARCH;
 #endif
 
 static ssize_t
-fsread(ufs_ino_t inode, void *buf, size_t nbyte)
+fsread_size(ufs_ino_t inode, void *buf, size_t nbyte, size_t *fsizep)
 {
 #ifndef UFS2_ONLY
static struct ufs1_dinode dp1;
@@ -185,6 +185,10 @@ fsread(ufs_ino_t inode, void *buf, size_
static ufs2_daddr_t blkmap, indmap;
u_int u;
 
+   /* Basic parameter validation. */
+   if ((buf == NULL && nbyte != 0) || dmadat == NULL)
+   return (-1);
+
blkbuf = dmadat->blkbuf;
indbuf = dmadat->indbuf;
 
@@ -231,18 +235,18 @@ fsread(ufs_ino_t inode, void *buf, size_
return -1;
n = INO_TO_VBO(n, inode);
 #if defined(UFS1_ONLY)
-   memcpy(, (struct ufs1_dinode *)blkbuf + n,
-   sizeof(struct ufs1_dinode));
+   memcpy(, (struct ufs1_dinode *)(void *)blkbuf + n,
+   sizeof(dp1));
 #elif defined(UFS2_ONLY)
-   memcpy(, (struct ufs2_dinode *)blkbuf + n,
-   sizeof(struct ufs2_dinode));
+   memcpy(, (struct ufs2_dinode *)(void *)blkbuf + n,
+   sizeof(dp2));
 #else
if (fs.fs_magic == FS_UFS1_MAGIC)
memcpy(, (struct ufs1_dinode *)(void *)blkbuf + n,
-   sizeof(struct ufs1_dinode));
+   sizeof(dp1));
else
memcpy(, (struct ufs2_dinode *)(void *)blkbuf + n,
-   sizeof(struct ufs2_dinode));
+   sizeof(dp2));
 #endif
inomap = inode;
fs_off = 0;
@@ -306,5 +310,17 @@ fsread(ufs_ino_t inode, void *buf, size_
fs_off += n;
nb -= n;
}
+
+   if (fsizep != NULL)
+   *fsizep = size;
+
return nbyte;
 }
+
+static ssize_t
+fsread(ufs_ino_t inode, void *buf, size_t nbyte)
+{
+
+   return fsread_size(inode, buf, nbyte, NULL);
+}
+

Modified: head/sys/boot/efi/boot1/ufs_module.c
==
--- head/sys/boot/efi/boot1/ufs_module.cThu Jan 21 08:51:24 2016
(r294492)
+++ head/sys/boot/efi/boot1/ufs_module.cThu Jan 21 08:58:39 2016
(r294493)
@@ -68,93 +68,23 @@ dskread(void *buf, u_int64_t lba, int nb
 
 #include "ufsread.c"
 
-static ssize_t
-fsstat(ufs_ino_t inode)
+static struct dmadat __dmadat;
+
+static int
+init_dev(dev_info_t* dev)
 {
-#ifndef UFS2_ONLY
-   static struct ufs1_dinode dp1;
-#endif
-#ifndef UFS1_ONLY
-   static struct ufs2_dinode dp2;
-#endif
-   static struct fs fs;
-   static ufs_ino_t inomap;
-   char *blkbuf;
-   void *indbuf;
-   size_t n, size;
-   static ufs2_daddr_t blkmap, indmap;
-
-   blkbuf = dmadat->blkbuf;
-   indbuf = dmadat->indbuf;
-   if (!dsk_meta) {
-   inomap = 0;
-   for (n = 0; sblock_try[n] != -1; n++) {
-   if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE,
-   SBLOCKSIZE / DEV_BSIZE))
-   return (-1);
-   memcpy(, dmadat->sbbuf, sizeof(struct fs));
-   if ((
-#if defined(UFS1_ONLY)
-   fs.fs_magic == FS_UFS1_MAGIC
-#elif defined(UFS2_ONLY)
-   (fs.fs_magic == FS_UFS2_MAGIC &&
-   fs.fs_sblockloc == sblock_try[n])
-#else
-   fs.fs_magic == FS_UFS1_MAGIC ||
-   (fs.fs_magic == FS_UFS2_MAGIC &&
-   fs.fs_sblockloc == sblock_try[n])
-#endif
-   ) &&
-   fs.fs_bsize <= MAXBSIZE &&
-   fs.fs_bsize >= (int32_t)sizeof(struct fs))
-   

Re: svn commit: r294471 - head/sys/dev/usb/wlan

2016-01-21 Thread Andriy Gapon
On 21/01/2016 03:28, Mark Johnston wrote:
> One feature that would be nice would be a way to associate KTR rings
> with arbitrary objects rather than having a single global ring (or
> per-CPU rings). For example, KTR_BUF lets one trace operations on
> filesystem buffers, but there's no good way to find all trace records
> corresponding to a given buf. At the moment one has to always include a
> pointer to the buf, and then scan *all* KTR entries for the pointer of
> interest while hoping that the relevant entries haven't already been
> overwritten. With per-object rings, one can in effect see a "history" of
> the object, whether it's a buf or a driver softc or whatever.
> 
> Isilon has done ad-hoc implementations of this for bufs and mbufs, and
> they're quite handy for debugging. With BUF_TRACKING enabled in our
> kernel config, each buf contains a const char *b_records[32], and one
> adds
> 
>   buf_track(bp, __func__);
> 
> or so to various functions to record an entry in the buf when the
> function is invoked. This is really similar to what KTR does already,
> and I've needed to further hack up our buf tracking to include metadata
> (thread IDs) that KTR already provides. And, KTR records can be
> retrieved from vmcores by ktrdump -M.

Does your extension also save a stack trace?
I would love to have something like that for the memory allocation and
deallocation audit.

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


Re: svn commit: r294487 - head

2016-01-21 Thread Dag-Erling Smørgrav
Gleb Smirnoff  writes:
> Log:
>   Note that new ssh(1) doesn't allow to use DSA keys by default.

Please revert.

The correct procedure is to contact the maintainer, report the problem
and ask whether the change was intentional, at which point a decision
can be made as to whether to revert or document the change.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-01-21 Thread Cy Schubert
In message <20160121113813.gg37...@zxy.spb.ru>, Slawa Olhovchenkov writes:
> On Thu, Jan 21, 2016 at 01:34:57AM +0200, Andriy Gapon wrote:
> 
> > On 20/01/2016 22:03, Alan Somers wrote:
> > > On Wed, Jan 20, 2016 at 2:20 AM, Andriy Gapon  wrote:
> > >> On 19/01/2016 19:20, Alan Somers wrote:
> > >>> The thing is, it never really worked in the first place.  Panics and
> > >>> deadlocks are so frequent that I don't think the feature was usable
> > >>> for anybody.
> > >>
> > >> The feature is perfectly usable for me.  I have never run into the probl
> ems that
> > >> you describe.  Why not fix the real bugs that you've run into?
> > > 
> > > Spectra Logic and iXSystems both experienced many problems with this.
> > > The worst is a deadlock that can be triggered simply by pulling a
> > > drive from a redundant pool when there exists a zvol anywhere in the
> > > system (see https://reviews.freebsd.org/D4998 for a quick way to
> > > reproduce).  Fixing it correctly would likely require far more time
> > > than I have available.  I just want the bugs to go away.  See that
> > > same code review for a change to make the feature optional.
> > 
> > I think that we all want all the bugs to go way.  One way to remove bugs is
>  to
> > remove (disable) code that contains bugs.  That way the perfect bug-free
> > software is clearly achievable :-)  Unfortunately, that technique is not al
> ways
> > welcomed.
> > 
> > P.S.
> > I think that the real problem here is that a method of a geom must never dr
> op
> > topology_lock.  In other words, the GEOM management code (like g_xxx() stuf
> f in
> > geom_subr.c) expects that a topology can not change underneath it.  But
> > zvol_geom_access() clearly breaks that contract.
> 
> May be same cause problem with swap on zvol (don't test on latest
> -stable)?

Not related but should be disabled by default through sysctl is vdev on 
USB. OK for a laptop but not a server. 100% hang on shutdown/reboot.


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

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


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


svn commit: r294505 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys

2016-01-21 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jan 21 14:57:45 2016
New Revision: 294505
URL: https://svnweb.freebsd.org/changeset/base/294505

Log:
  Implement idr_preload(), idr_preload_end(), idr_alloc() and
  idr_alloc_cyclic() in the LinuxKPI. Bump the FreeBSD version to
  force recompilation of all KLDs due to IDR structure size change.
  
  MFC after:2 weeks
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/idr.h
  head/sys/compat/linuxkpi/common/src/linux_idr.c
  head/sys/sys/param.h

Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h
==
--- head/sys/compat/linuxkpi/common/include/linux/idr.h Thu Jan 21 14:50:28 
2016(r294504)
+++ head/sys/compat/linuxkpi/common/include/linux/idr.h Thu Jan 21 14:57:45 
2016(r294505)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -60,6 +60,7 @@ struct idr {
struct idr_layer*top;
struct idr_layer*free;
int layers;
+   int next_cyclic_id;
 };
 
 #define DEFINE_IDR(name)   \
@@ -67,6 +68,9 @@ struct idr {
SYSINIT(name##_idr_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, \
idr_init, &(name));
 
+#defineidr_preload(x) do { } while (0)
+#defineidr_preload_end() do { } while (0)
+
 void   *idr_find(struct idr *idp, int id);
 intidr_pre_get(struct idr *idp, gfp_t gfp_mask);
 intidr_get_new(struct idr *idp, void *ptr, int *id);
@@ -76,5 +80,7 @@ void  idr_remove(struct idr *idp, int id)
 void   idr_remove_all(struct idr *idp);
 void   idr_destroy(struct idr *idp);
 void   idr_init(struct idr *idp);
+intidr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t);
+intidr_alloc_cyclic(struct idr *idp, void *ptr, int start, int end, gfp_t);
 
 #endif /* _LINUX_IDR_H_ */

Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c
==
--- head/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jan 21 14:50:28 
2016(r294504)
+++ head/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jan 21 14:57:45 
2016(r294505)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -116,21 +116,18 @@ idr_remove_all(struct idr *idr)
mtx_unlock(>lock);
 }
 
-void
-idr_remove(struct idr *idr, int id)
+static void
+idr_remove_locked(struct idr *idr, int id)
 {
struct idr_layer *il;
int layer;
int idx;
 
id &= MAX_ID_MASK;
-   mtx_lock(>lock);
il = idr->top;
layer = idr->layers - 1;
-   if (il == NULL || id > idr_max(idr)) {
-   mtx_unlock(>lock);
+   if (il == NULL || id > idr_max(idr))
return;
-   }
/*
 * Walk down the tree to this item setting bitmaps along the way
 * as we know at least one item will be free along this path.
@@ -152,8 +149,14 @@ idr_remove(struct idr *idr, int id)
id, idr, il);
il->ary[idx] = NULL;
il->bitmap |= 1 << idx;
+}
+
+void
+idr_remove(struct idr *idr, int id)
+{
+   mtx_lock(>lock);
+   idr_remove_locked(idr, id);
mtx_unlock(>lock);
-   return;
 }
 
 void *
@@ -278,8 +281,8 @@ idr_get(struct idr *idr)
  * Could be implemented as get_new_above(idr, ptr, 0, idp) but written
  * first for simplicity sake.
  */
-int
-idr_get_new(struct idr *idr, void *ptr, int *idp)
+static int
+idr_get_new_locked(struct idr *idr, void *ptr, int *idp)
 {
struct idr_layer *stack[MAX_LEVEL];
struct idr_layer *il;
@@ -288,8 +291,9 @@ idr_get_new(struct idr *idr, void *ptr, 
int idx;
int id;
 
+   mtx_assert(>lock, MA_OWNED);
+
error = -EAGAIN;
-   mtx_lock(>lock);
/*
 * Expand the tree until there is free space.
 */
@@ -350,12 +354,22 @@ out:
idr, id, ptr);
}
 #endif
-   mtx_unlock(>lock);
return (error);
 }
 
 int
-idr_get_new_above(struct idr *idr, void *ptr, int starting_id, int *idp)
+idr_get_new(struct idr *idr, void *ptr, int *idp)
+{
+   int retval;
+
+   mtx_lock(>lock);
+   retval = idr_get_new_locked(idr, ptr, idp);
+   mtx_unlock(>lock);
+   return (retval);
+}
+
+static int

Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-01-21 Thread alan somers
On Thu, Jan 21, 2016 at 4:38 AM, Slawa Olhovchenkov  wrote:
> On Thu, Jan 21, 2016 at 01:34:57AM +0200, Andriy Gapon wrote:
>
>> On 20/01/2016 22:03, Alan Somers wrote:
>> > On Wed, Jan 20, 2016 at 2:20 AM, Andriy Gapon  wrote:
>> >> On 19/01/2016 19:20, Alan Somers wrote:
>> >>> The thing is, it never really worked in the first place.  Panics and
>> >>> deadlocks are so frequent that I don't think the feature was usable
>> >>> for anybody.
>> >>
>> >> The feature is perfectly usable for me.  I have never run into the 
>> >> problems that
>> >> you describe.  Why not fix the real bugs that you've run into?
>> >
>> > Spectra Logic and iXSystems both experienced many problems with this.
>> > The worst is a deadlock that can be triggered simply by pulling a
>> > drive from a redundant pool when there exists a zvol anywhere in the
>> > system (see https://reviews.freebsd.org/D4998 for a quick way to
>> > reproduce).  Fixing it correctly would likely require far more time
>> > than I have available.  I just want the bugs to go away.  See that
>> > same code review for a change to make the feature optional.
>>
>> I think that we all want all the bugs to go way.  One way to remove bugs is 
>> to
>> remove (disable) code that contains bugs.  That way the perfect bug-free
>> software is clearly achievable :-)  Unfortunately, that technique is not 
>> always
>> welcomed.
>>
>> P.S.
>> I think that the real problem here is that a method of a geom must never drop
>> topology_lock.  In other words, the GEOM management code (like g_xxx() stuff 
>> in
>> geom_subr.c) expects that a topology can not change underneath it.  But
>> zvol_geom_access() clearly breaks that contract.
>
> May be same cause problem with swap on zvol (don't test on latest
> -stable)?

I'm not familiar with that problem.  Is there a PR?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294504 - in head/sys: conf fs/ext2fs modules/ext2fs

2016-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jan 21 14:50:28 2016
New Revision: 294504
URL: https://svnweb.freebsd.org/changeset/base/294504

Log:
  ext2fs: Bring back the htree dir_index implementation.
  
  The htree dir_index is perhaps one of the most characteristic
  features of the linux ext3 implementation. It was removed
  in r281670, due to repeated bug reports.
  
  Damjan Jovanic detected and fixed three bugs and did some
  stress testing by building Apache OpenOffice on top of it
  so it is now in good shape to bring back.
  
  Differential Revision:https://reviews.freebsd.org/D5007
  
  Submitted by: Damjan Jovanovic
  Reviewed by:  pfg
  Tested by:pho
  Relnotes: Yes
  MFC after:2 months (only 10.x)

Added:
  head/sys/fs/ext2fs/ext2_hash.c
 - copied unchanged from r281669, head/sys/fs/ext2fs/ext2_hash.c
  head/sys/fs/ext2fs/ext2_htree.c
 - copied, changed from r281669, head/sys/fs/ext2fs/ext2_htree.c
Modified:
  head/sys/conf/files
  head/sys/fs/ext2fs/ext2_dir.h
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2fs.h
  head/sys/modules/ext2fs/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Jan 21 14:11:01 2016(r294503)
+++ head/sys/conf/files Thu Jan 21 14:50:28 2016(r294504)
@@ -3114,6 +3114,8 @@ fs/ext2fs/ext2_bmap.c optional ext2fs
 fs/ext2fs/ext2_extents.c   optional ext2fs
 fs/ext2fs/ext2_inode.c optional ext2fs
 fs/ext2fs/ext2_inode_cnv.c optional ext2fs
+fs/ext2fs/ext2_hash.c  optional ext2fs
+fs/ext2fs/ext2_htree.c optional ext2fs
 fs/ext2fs/ext2_lookup.coptional ext2fs
 fs/ext2fs/ext2_subr.c  optional ext2fs
 fs/ext2fs/ext2_vfsops.coptional ext2fs

Modified: head/sys/fs/ext2fs/ext2_dir.h
==
--- head/sys/fs/ext2fs/ext2_dir.h   Thu Jan 21 14:11:01 2016
(r294503)
+++ head/sys/fs/ext2fs/ext2_dir.h   Thu Jan 21 14:50:28 2016
(r294504)
@@ -40,6 +40,21 @@ struct   ext2fs_direct {
uint16_t e2d_namlen;/* length of string in e2d_name */
char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
+
+enum slotstatus {
+   NONE,
+   COMPACT,
+   FOUND
+};
+
+struct ext2fs_searchslot {
+   enum slotstatus slotstatus;
+   doff_t slotoffset;  /* offset of area with free space */
+   int slotsize;   /* size of area at slotoffset */
+   int slotfreespace;  /* amount of space free in slot */
+   int slotneeded; /* sizeof the entry we are seeking */
+};
+
 /*
  * The new version of the directory entry.  Since EXT2 structures are
  * stored in intel byte order, and the name_len field could never be

Modified: head/sys/fs/ext2fs/ext2_extern.h
==
--- head/sys/fs/ext2fs/ext2_extern.hThu Jan 21 14:11:01 2016
(r294503)
+++ head/sys/fs/ext2fs/ext2_extern.hThu Jan 21 14:50:28 2016
(r294504)
@@ -40,12 +40,15 @@
 #define_FS_EXT2FS_EXT2_EXTERN_H_
 
 struct ext2fs_dinode;
+struct ext2fs_direct_2;
+struct ext2fs_searchslot;
 struct indir;
 struct inode;
 struct mount;
 struct vfsconf;
 struct vnode;
 
+intext2_add_entry(struct vnode *, struct ext2fs_direct_2 *);
 intext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int,
struct ucred *, e4fs_daddr_t *);
 intext2_balloc(struct inode *,
@@ -83,6 +86,18 @@ int  ext2_dirempty(struct inode *, ino_t,
 intext2_checkpath(struct inode *, struct inode *, struct ucred *);
 intcg_has_sb(int i);
 intext2_inactive(struct vop_inactive_args *);
+intext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *,
+   struct componentname *);
+intext2_htree_create_index(struct vnode *, struct componentname *,
+   struct ext2fs_direct_2 *);
+intext2_htree_has_idx(struct inode *);
+intext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *,
+   uint32_t *);
+intext2_htree_lookup(struct inode *, const char *, int, struct buf **,
+   int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
+intext2_search_dirblock(struct inode *, void *, int *, const char *, int,
+   int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
+
 
 /* Flags to low-level allocation routines.
  * The low 16-bits are reserved for IO_ flags from vnode.h.

Copied: head/sys/fs/ext2fs/ext2_hash.c (from r281669, 
head/sys/fs/ext2fs/ext2_hash.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/fs/ext2fs/ext2_hash.c  Thu Jan 21 14:50:28 2016
(r294504, copy of r281669, 

Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2016-01-21 Thread Slawa Olhovchenkov
On Thu, Jan 21, 2016 at 08:03:25AM -0700, alan somers wrote:

> On Thu, Jan 21, 2016 at 4:38 AM, Slawa Olhovchenkov  wrote:
> > On Thu, Jan 21, 2016 at 01:34:57AM +0200, Andriy Gapon wrote:
> >
> >> On 20/01/2016 22:03, Alan Somers wrote:
> >> > On Wed, Jan 20, 2016 at 2:20 AM, Andriy Gapon  wrote:
> >> >> On 19/01/2016 19:20, Alan Somers wrote:
> >> >>> The thing is, it never really worked in the first place.  Panics and
> >> >>> deadlocks are so frequent that I don't think the feature was usable
> >> >>> for anybody.
> >> >>
> >> >> The feature is perfectly usable for me.  I have never run into the 
> >> >> problems that
> >> >> you describe.  Why not fix the real bugs that you've run into?
> >> >
> >> > Spectra Logic and iXSystems both experienced many problems with this.
> >> > The worst is a deadlock that can be triggered simply by pulling a
> >> > drive from a redundant pool when there exists a zvol anywhere in the
> >> > system (see https://reviews.freebsd.org/D4998 for a quick way to
> >> > reproduce).  Fixing it correctly would likely require far more time
> >> > than I have available.  I just want the bugs to go away.  See that
> >> > same code review for a change to make the feature optional.
> >>
> >> I think that we all want all the bugs to go way.  One way to remove bugs 
> >> is to
> >> remove (disable) code that contains bugs.  That way the perfect bug-free
> >> software is clearly achievable :-)  Unfortunately, that technique is not 
> >> always
> >> welcomed.
> >>
> >> P.S.
> >> I think that the real problem here is that a method of a geom must never 
> >> drop
> >> topology_lock.  In other words, the GEOM management code (like g_xxx() 
> >> stuff in
> >> geom_subr.c) expects that a topology can not change underneath it.  But
> >> zvol_geom_access() clearly breaks that contract.
> >
> > May be same cause problem with swap on zvol (don't test on latest
> > -stable)?
> 
> I'm not familiar with that problem.  Is there a PR?

I am find PR 199189.
My expirense slightly different: VirtualBox VM with test install (384M
RAM) hang, not crashed, just infinite wait somewhere. Tested on 10.1.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294506 - head/sys/boot/common

2016-01-21 Thread Steven Hartland
Author: smh
Date: Thu Jan 21 15:27:44 2016
New Revision: 294506
URL: https://svnweb.freebsd.org/changeset/base/294506

Log:
  Prevent loader.conf load failure due to unknown console entries
  
  When processing loader.conf if console contained an entry for an unsupported
  console then cons_set would return an error refusing to set any console.
  
  This has two side effects:
  
  1. Forth would throw a syntax error and stop processing loader.conf at that
point.
  2. The value of console is ignored.
  
  #1 Means other important loader.conf entries may not be processed, which is
 clearly undesirable.
  #2 Means the users preference for console aren't applied even if they did
 contain valid options. Now we have support for multi boot paths from a
 single image e.g. bios and efi mode the console preference needs to deal
 with the need to set preference for more than one source.
  
  Fix this by:
  * Returning CMD_OK where possible from cons_set.
  * Allowing set with at least one valid console to proceed.
  
  Reviewed by:  allanjude
  MFC after:1 week
  Sponsored by: Multiplay
  Differential Revision:https://reviews.freebsd.org/D5018

Modified:
  head/sys/boot/common/console.c

Modified: head/sys/boot/common/console.c
==
--- head/sys/boot/common/console.c  Thu Jan 21 14:57:45 2016
(r294505)
+++ head/sys/boot/common/console.c  Thu Jan 21 15:27:44 2016
(r294506)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 static int cons_set(struct env_var *ev, int flags, const void *value);
 static int cons_find(const char *name);
 static int cons_check(const char *string);
-static voidcons_change(const char *string);
+static int cons_change(const char *string);
 static int twiddle_set(struct env_var *ev, int flags, const void *value);
 
 /*
@@ -47,12 +47,12 @@ static int  twiddle_set(struct env_var *e
  * as active.  Also create the console variable.
  */
 void
-cons_probe(void) 
+cons_probe(void)
 {
 intcons;
 intactive;
 char   *prefconsole;
-
+
 /* We want a callback to install the new value when this var changes. */
 env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, env_nounset);
 
@@ -162,54 +162,69 @@ cons_find(const char *name)
 static int
 cons_set(struct env_var *ev, int flags, const void *value)
 {
-intcons;
+intret;
 
-if ((value == NULL) || (cons_check(value) == -1)) {
-   if (value != NULL) 
-   printf("no such console!\n");
-   printf("Available consoles:\n");
-   for (cons = 0; consoles[cons] != NULL; cons++)
-   printf("%s\n", consoles[cons]->c_name);
-   return(CMD_ERROR);
+if ((value == NULL) || (cons_check(value) == 0)) {
+   /*
+* Return CMD_OK instead of CMD_ERROR to prevent forth syntax error,
+* which would prevent it processing any further loader.conf entries.
+*/
+   return (CMD_OK);
 }
 
-cons_change(value);
+ret = cons_change(value);
+if (ret != CMD_OK)
+   return (ret);
 
 env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
-return(CMD_OK);
+return (CMD_OK);
 }
 
 /*
- * Check that all of the consoles listed in *string are valid consoles
+ * Check that at least one the consoles listed in *string is valid
  */
 static int
 cons_check(const char *string)
 {
-intcons;
+intcons, found, failed;
 char   *curpos, *dup, *next;
 
 dup = next = strdup(string);
-cons = -1;
+found = failed = 0;
 while (next != NULL) {
curpos = strsep(, " ,");
if (*curpos != '\0') {
cons = cons_find(curpos);
-   if (cons == -1)
-   break;
+   if (cons == -1) {
+   printf("console %s is invalid!\n", curpos);
+   failed++;
+   } else {
+   found++;
+   }
}
 }
 
 free(dup);
-return (cons);
+
+if (found == 0)
+   printf("no valid consoles!\n");
+
+if (found == 0 || failed != 0) {
+   printf("Available consoles:\n");
+   for (cons = 0; consoles[cons] != NULL; cons++)
+   printf("%s\n", consoles[cons]->c_name);
+}
+
+return (found);
 }
 
 /*
- * Activate all of the consoles listed in *string and disable all the others.
+ * Activate all the valid consoles listed in *string and disable all others.
  */
-static void
+static int
 cons_change(const char *string)
 {
-intcons;
+intcons, active;
 char   *curpos, *dup, *next;
 
 /* Disable all consoles */
@@ -219,6 +234,7 @@ cons_change(const char *string)
 
 /* Enable selected consoles */
 dup = next = strdup(string);
+active = 0;
 while (next != NULL) {
curpos = strsep(, " ,");

svn commit: r294515 - head/lib/libc/mips

2016-01-21 Thread Brooks Davis
Author: brooks
Date: Thu Jan 21 17:29:01 2016
New Revision: 294515
URL: https://svnweb.freebsd.org/changeset/base/294515

Log:
  Fix the implementations of PSEUDO_NOERROR and PSEUDO.
  
  The PSEUDO* macros should not declare , only _ and
  __sys_.  This was causing the interposing C wrappers to be
  ignored due to link order.
  
  Reviewed by:  kib
  Obtained from:CheriBSD (4e8e13c90fc6a80e1520de44a6864cfd78b3b56d)
  MFC after:1 week
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D4097

Modified:
  head/lib/libc/mips/SYS.h

Modified: head/lib/libc/mips/SYS.h
==
--- head/lib/libc/mips/SYS.hThu Jan 21 17:25:41 2016(r294514)
+++ head/lib/libc/mips/SYS.hThu Jan 21 17:29:01 2016(r294515)
@@ -100,13 +100,31 @@
  * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)
  */
 #define RSYSCALL_NOERROR(x)\
-   PSEUDO_NOERROR(x)
+LEAF(__sys_ ## x); \
+   .weak _C_LABEL(x);  \
+   _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
+   .weak _C_LABEL(__CONCAT(_,x));  \
+   _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
+   SYSTRAP(x); \
+   j ra;   \
+END(__sys_ ## x)
 
 /*
  * Do a normal syscall.
  */
 #define RSYSCALL(x)\
-   PSEUDO(x)
+LEAF(__sys_ ## x); \
+   .weak _C_LABEL(x);  \
+   _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
+   .weak _C_LABEL(__CONCAT(_,x));  \
+   _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
+   PIC_PROLOGUE(__sys_ ## x);  \
+   SYSTRAP(x); \
+   bne a3,zero,err;\
+   PIC_RETURN();   \
+err:   \
+   PIC_TAILCALL(__cerror); \
+END(__sys_ ## x)
 
 /*
  * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint
@@ -114,18 +132,14 @@
  */
 #define PSEUDO_NOERROR(x)  \
 LEAF(__sys_ ## x); \
-   .weak _C_LABEL(x);  \
-   _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
.weak _C_LABEL(__CONCAT(_,x));  \
_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
SYSTRAP(x); \
j ra;   \
-   END(__sys_ ## x)
+END(__sys_ ## x)
 
 #define PSEUDO(x)  \
 LEAF(__sys_ ## x); \
-   .weak _C_LABEL(x);  \
-   _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
.weak _C_LABEL(__CONCAT(_,x));  \
_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
PIC_PROLOGUE(__sys_ ## x);  \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294507 - head/contrib/bsnmp/snmp_mibII

2016-01-21 Thread Hartmut Brandt
Author: harti
Date: Thu Jan 21 16:11:20 2016
New Revision: 294507
URL: https://svnweb.freebsd.org/changeset/base/294507

Log:
  Fill the ifAlias leaf of the ifXTable with the interface description
  if there is one available and it fits into the maximum size (64 characters).

Modified:
  head/contrib/bsnmp/snmp_mibII/mibII.c
  head/contrib/bsnmp/snmp_mibII/mibII.h
  head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c

Modified: head/contrib/bsnmp/snmp_mibII/mibII.c
==
--- head/contrib/bsnmp/snmp_mibII/mibII.c   Thu Jan 21 15:27:44 2016
(r294506)
+++ head/contrib/bsnmp/snmp_mibII/mibII.c   Thu Jan 21 16:11:20 2016
(r294507)
@@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp)
size_t len;
void *newmib;
struct ifmibdata oldmib = ifp->mib;
+   struct ifreq irr;
 
if (fetch_generic_mib(ifp, ) == -1)
return (-1);
@@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp)
}
 
   out:
+   strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name));
+   irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias;
+   irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias);
+   if (ioctl(mib_netsock, SIOCGIFDESCR, ) == -1) {
+   MIBIF_PRIV(ifp)->alias[0] = 0;
+   if (errno != ENOMSG)
+   syslog(LOG_WARNING, "SIOCGIFDESCR (%s): %m", ifp->name);
+   } else if (irr.ifr_buffer.buffer == NULL) {
+   MIBIF_PRIV(ifp)->alias[0] = 0;
+   syslog(LOG_WARNING, "SIOCGIFDESCR (%s): too long (%zu)",
+   ifp->name, irr.ifr_buffer.length);
+   }
ifp->mibtick = get_ticks();
return (0);
 }

Modified: head/contrib/bsnmp/snmp_mibII/mibII.h
==
--- head/contrib/bsnmp/snmp_mibII/mibII.h   Thu Jan 21 15:27:44 2016
(r294506)
+++ head/contrib/bsnmp/snmp_mibII/mibII.h   Thu Jan 21 16:11:20 2016
(r294507)
@@ -57,6 +57,9 @@
 #include "snmp_mibII.h"
 #include "mibII_tree.h"
 
+/* maximum size of the interface alias */
+static const u_int MIBIF_ALIAS_SIZE = 64 + 1;
+
 /*
  * Interface list and flags.
  */
@@ -77,6 +80,9 @@ struct mibif_private {
uint64_thc_opackets;
uint64_thc_imcasts;
uint64_thc_ipackets;
+
+   /* this should be made public */
+   charalias[MIBIF_ALIAS_SIZE];
 };
 #defineMIBIF_PRIV(IFP) ((struct mibif_private *)((IFP)->private))
 

Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
==
--- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.cThu Jan 21 15:27:44 
2016(r294506)
+++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.cThu Jan 21 16:11:20 
2016(r294507)
@@ -528,7 +528,7 @@ op_ifxtable(struct snmp_context *ctx, st
break;
 
  case LEAF_ifAlias:
-   ret = string_get(value, "", -1);
+   ret = string_get(value, MIBIF_PRIV(ifp)->alias, -1);
break;
 
  case LEAF_ifCounterDiscontinuityTime:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294511 - in head/sys: conf dev/fdt dev/ofw

2016-01-21 Thread Andrew Turner
Author: andrew
Date: Thu Jan 21 16:48:01 2016
New Revision: 294511
URL: https://svnweb.freebsd.org/changeset/base/294511

Log:
  Remove fdt_fixup_table from architectures where it's unneeded. We only make
  use of fdt_fixup_table on PowerPC and ARM. As such we can remove it from
  other architectures as it's unneeded.
  
  Reviewed by:  nwhitehorn
  Sponsored by: ABT Systems Ltd
  Differential Revision:https://reviews.freebsd.org/D5013

Deleted:
  head/sys/dev/fdt/fdt_arm64.c
  head/sys/dev/fdt/fdt_mips.c
  head/sys/dev/fdt/fdt_x86.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.arm64
  head/sys/conf/files.i386
  head/sys/conf/files.mips
  head/sys/dev/fdt/fdt_common.h
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Thu Jan 21 16:42:52 2016(r294510)
+++ head/sys/conf/files.amd64   Thu Jan 21 16:48:01 2016(r294511)
@@ -240,7 +240,6 @@ dev/fdc/fdc.c   optionalfdc
 dev/fdc/fdc_acpi.c optionalfdc
 dev/fdc/fdc_isa.c  optionalfdc isa
 dev/fdc/fdc_pccard.c   optionalfdc pccard
-dev/fdt/fdt_x86.c  optionalfdt
 dev/hpt27xx/hpt27xx_os_bsd.c   optionalhpt27xx
 dev/hpt27xx/hpt27xx_osm_bsd.c  optionalhpt27xx
 dev/hpt27xx/hpt27xx_config.c   optionalhpt27xx

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Thu Jan 21 16:42:52 2016(r294510)
+++ head/sys/conf/files.arm64   Thu Jan 21 16:48:01 2016(r294511)
@@ -59,7 +59,6 @@ crypto/blowfish/bf_enc.c  optionalcrypto
 crypto/des/des_enc.c   optionalcrypto | ipsec | netsmb
 dev/acpica/acpi_if.m   optionalacpi
 dev/ahci/ahci_generic.coptional ahci fdt
-dev/fdt/fdt_arm64.coptionalfdt
 dev/hwpmc/hwpmc_arm64.coptionalhwpmc
 dev/hwpmc/hwpmc_arm64_md.c optionalhwpmc
 dev/mmc/host/dwmmc.c   optionaldwmmc

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Thu Jan 21 16:42:52 2016(r294510)
+++ head/sys/conf/files.i386Thu Jan 21 16:48:01 2016(r294511)
@@ -208,7 +208,6 @@ dev/fdc/fdc.c   optional fdc
 dev/fdc/fdc_acpi.c optional fdc
 dev/fdc/fdc_isa.c  optional fdc isa
 dev/fdc/fdc_pccard.c   optional fdc pccard
-dev/fdt/fdt_x86.c  optional fdt
 dev/fe/if_fe_isa.c optional fe isa
 dev/glxiic/glxiic.coptional glxiic
 dev/glxsb/glxsb.c  optional glxsb

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsThu Jan 21 16:42:52 2016(r294510)
+++ head/sys/conf/files.mipsThu Jan 21 16:48:01 2016(r294511)
@@ -80,7 +80,6 @@ dev/syscons/scvtb.c   optionalsc
 mips/mips/sc_machdep.c optionalsc
 
 # FDT support
-dev/fdt/fdt_mips.c optionalfdt
 dev/uart/uart_cpu_fdt.coptionaluart fdt
 
 # crypto support -- use generic

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Thu Jan 21 16:42:52 2016
(r294510)
+++ head/sys/dev/fdt/fdt_common.h   Thu Jan 21 16:48:01 2016
(r294511)
@@ -48,12 +48,14 @@ struct fdt_sense_level {
 typedef int (*fdt_pic_decode_t)(phandle_t, pcell_t *, int *, int *, int *);
 extern fdt_pic_decode_t fdt_pic_table[];
 
+#if defined(__arm__) || defined(__powerpc__)
 typedef void (*fdt_fixup_t)(phandle_t);
 struct fdt_fixup_entry {
char*model;
fdt_fixup_t handler;
 };
 extern struct fdt_fixup_entry fdt_fixup_table[];
+#endif
 
 extern SLIST_HEAD(fdt_ic_list, fdt_ic) fdt_ic_list_head;
 struct fdt_ic {

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Thu Jan 21 16:42:52 2016(r294510)
+++ head/sys/dev/ofw/ofw_fdt.c  Thu Jan 21 16:48:01 2016(r294511)
@@ -394,6 +394,7 @@ ofw_fdt_package_to_path(ofw_t ofw, phand
return (-1);
 }
 
+#if defined(__arm__) || defined(__powerpc__)
 static int
 ofw_fdt_fixup(ofw_t ofw)
 {
@@ -427,10 +428,12 @@ ofw_fdt_fixup(ofw_t ofw)
 
return (0);
 }
+#endif
 
 static int
 ofw_fdt_interpret(ofw_t ofw, const char *cmd, int nret, cell_t *retvals)
 {
+#if defined(__arm__) || defined(__powerpc__)
int rv;
 
/*
@@ -449,4 +452,7 @@ ofw_fdt_interpret(ofw_t ofw, const char 
retvals[0] = rv;
 
 

Re: svn commit: r294507 - head/contrib/bsnmp/snmp_mibII

2016-01-21 Thread Shawn Webb
On Thu, Jan 21, 2016 at 04:11:20PM +, Hartmut Brandt wrote:
> Author: harti
> Date: Thu Jan 21 16:11:20 2016
> New Revision: 294507
> URL: https://svnweb.freebsd.org/changeset/base/294507
> 
> Log:
>   Fill the ifAlias leaf of the ifXTable with the interface description
>   if there is one available and it fits into the maximum size (64 characters).
> 
> Modified:
>   head/contrib/bsnmp/snmp_mibII/mibII.c
>   head/contrib/bsnmp/snmp_mibII/mibII.h
>   head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
> 
> Modified: head/contrib/bsnmp/snmp_mibII/mibII.c
> ==
> --- head/contrib/bsnmp/snmp_mibII/mibII.c Thu Jan 21 15:27:44 2016
> (r294506)
> +++ head/contrib/bsnmp/snmp_mibII/mibII.c Thu Jan 21 16:11:20 2016
> (r294507)
> @@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp)
>   size_t len;
>   void *newmib;
>   struct ifmibdata oldmib = ifp->mib;
> + struct ifreq irr;
>  
>   if (fetch_generic_mib(ifp, ) == -1)
>   return (-1);
> @@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp)
>   }
>  
>out:
> + strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name));

Why not strlcpy? You're not forcing null termination here, so there
could be issues.

Thanks,

-- 
Shawn Webb
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r294514 - head/sys/netinet

2016-01-21 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Jan 21 17:25:41 2016
New Revision: 294514
URL: https://svnweb.freebsd.org/changeset/base/294514

Log:
  The variable is write once only and not used.
  Recover the vertical space.
  
  Sponsored by: The FreeBSD Foundation
  MFC After:3 days
  Obtained from:p4 CH=180830
  Reviewed by:  gnn, hiren
  Differential Revision:https://reviews.freebsd.org/D4898

Modified:
  head/sys/netinet/igmp.c

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Thu Jan 21 17:09:38 2016(r294513)
+++ head/sys/netinet/igmp.c Thu Jan 21 17:25:41 2016(r294514)
@@ -659,16 +659,12 @@ igmp_ifdetach(struct ifnet *ifp)
 void
 igmp_domifdetach(struct ifnet *ifp)
 {
-   struct igmp_ifsoftc *igi;
 
CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)",
__func__, ifp, ifp->if_xname);
 
IGMP_LOCK();
-
-   igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp;
igi_delete_locked(ifp);
-
IGMP_UNLOCK();
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294518 - head/sys/compat/linuxkpi/common/include/linux

2016-01-21 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jan 21 17:36:06 2016
New Revision: 294518
URL: https://svnweb.freebsd.org/changeset/base/294518

Log:
  Use function macro instead of non-function macro to reduce chance of
  incorrect expansion.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/mutex.h

Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h
==
--- head/sys/compat/linuxkpi/common/include/linux/mutex.h   Thu Jan 21 
17:33:31 2016(r294517)
+++ head/sys/compat/linuxkpi/common/include/linux/mutex.h   Thu Jan 21 
17:36:06 2016(r294518)
@@ -59,6 +59,6 @@ linux_mutex_init(mutex_t *m)
sx_init_flags(>sx, "lnxmtx",  SX_NOWITNESS);
 }
 
-#definemutex_init  linux_mutex_init
+#definemutex_init(m)   linux_mutex_init(m)
 
 #endif /* _LINUX_MUTEX_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294520 - head/sys/compat/linuxkpi/common/include/asm

2016-01-21 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jan 21 17:52:55 2016
New Revision: 294520
URL: https://svnweb.freebsd.org/changeset/base/294520

Log:
  LinuxKPI atomic fixes:
  - Fix implementation of atomic_add_unless(). The atomic_cmpset_int()
function returns a boolean and not the previous value of the atomic
variable.
  - The atomic counters should be signed according to Linux.
  - Some minor cosmetics and styling while at it.
  
  Reviewed by:  alfred @
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/asm/atomic-long.h
  head/sys/compat/linuxkpi/common/include/asm/atomic.h

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h
==
--- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h   Thu Jan 21 
17:49:10 2016(r294519)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h   Thu Jan 21 
17:52:55 2016(r294520)
@@ -36,7 +36,7 @@
 #include 
 
 typedef struct {
-   volatile u_long counter;
+   volatile long counter;
 } atomic_long_t;
 
 #defineatomic_long_add(i, v)   atomic_long_add_return((i), (v))

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h
==
--- head/sys/compat/linuxkpi/common/include/asm/atomic.hThu Jan 21 
17:49:10 2016(r294519)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic.hThu Jan 21 
17:52:55 2016(r294520)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,9 +36,13 @@
 #include 
 
 typedef struct {
-   volatile u_int counter;
+   volatile int counter;
 } atomic_t;
 
+/**
+ * 32-bit atomic operations
+ **/
+
 #defineatomic_add(i, v)atomic_add_return((i), (v))
 #defineatomic_sub(i, v)atomic_sub_return((i), (v))
 #defineatomic_inc_return(v)atomic_add_return(1, (v))
@@ -46,7 +50,8 @@ typedef struct {
 #defineatomic_sub_and_test(i, v)   (atomic_sub_return((i), (v)) == 
0)
 #defineatomic_dec_and_test(v)  (atomic_sub_return(1, (v)) == 0)
 #defineatomic_inc_and_test(v)  (atomic_add_return(1, (v)) == 0)
-#define atomic_dec_return(v) atomic_sub_return(1, (v))
+#defineatomic_dec_return(v)atomic_sub_return(1, (v))
+#defineatomic_inc_not_zero(v)  atomic_add_unless((v), 1, 0)
 
 static inline int
 atomic_add_return(int i, atomic_t *v)
@@ -84,24 +89,19 @@ atomic_dec(atomic_t *v)
return atomic_fetchadd_int(>counter, -1) - 1;
 }
 
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int
+atomic_add_unless(atomic_t *v, int a, int u)
 {
-int c, old;
-c = atomic_read(v);
-for (;;) {
-if (unlikely(c == (u)))
-break;
-old = atomic_cmpset_int(>counter, c, c + (a));
-if (likely(old == c))
-break;
-c = old;
-}
-return c != (u);
-}
-
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
-
+   int c;
 
+   for (;;) {
+   c = atomic_read(v);
+   if (unlikely(c == u))
+   break;
+   if (likely(atomic_cmpset_int(>counter, c, c + a)))
+   break;
+   }
+   return (c != u);
+}
 
-#endif /* _ASM_ATOMIC_H_ */
+#endif /* _ASM_ATOMIC_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294495 - in head: . crypto/openssh

2016-01-21 Thread Conrad Meyer
On Thu, Jan 21, 2016 at 3:10 AM, Dag-Erling Smørgrav  wrote:
> Author: des
> Date: Thu Jan 21 11:10:14 2016
> New Revision: 294495
> URL: https://svnweb.freebsd.org/changeset/base/294495
>
> Log:
>   Enable DSA keys by default.  They were disabled in OpenSSH 6.9p1.

Are we going to maintain DSA key support after upstream deprecates it
entirely?  And why?

"""
Future Deprecation Notice
=

The 7.0 release of OpenSSH, due for release in late July, will
deprecate several features, some of which may affect compatibility
or existing configurations. The intended changes are as follows:

...

 * Support for ssh-dss, ssh-dss-cert-* host and user keys will be
   run-time disabled by default.
"""

http://www.openssh.com/txt/release-6.9

"OpenSSH 7.0 and greater similarly disables the ssh-dss (DSA) public
key algorithm. It too is weak and we recommend against its use."

http://www.openssh.com/legacy.html

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

svn commit: r294526 - head/sys/amd64/include

2016-01-21 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jan 21 18:22:50 2016
New Revision: 294526
URL: https://svnweb.freebsd.org/changeset/base/294526

Log:
  Add missing atomic wrapper macro.
  
  Reviewed by:  alfred @
  Sponsored by: Mellanox Technologies
  MFC after:1 week

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

Modified: head/sys/amd64/include/atomic.h
==
--- head/sys/amd64/include/atomic.h Thu Jan 21 18:20:40 2016
(r294525)
+++ head/sys/amd64/include/atomic.h Thu Jan 21 18:22:50 2016
(r294526)
@@ -558,6 +558,7 @@ u_long  atomic_swap_long(volatile u_long 
 #defineatomic_cmpset_rel_64atomic_cmpset_rel_long
 #defineatomic_swap_64  atomic_swap_long
 #defineatomic_readandclear_64  atomic_readandclear_long
+#defineatomic_fetchadd_64  atomic_fetchadd_long
 #defineatomic_testandset_64atomic_testandset_long
 
 /* Operations on pointers. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294471 - head/sys/dev/usb/wlan

2016-01-21 Thread Conrad Meyer
On Thu, Jan 21, 2016 at 1:52 AM, Andriy Gapon  wrote:
> On 21/01/2016 03:28, Mark Johnston wrote:
>> Isilon has done ad-hoc implementations of this for bufs and mbufs, and
>> they're quite handy for debugging. With BUF_TRACKING enabled in our
>> kernel config, each buf contains a const char *b_records[32], and one
>> adds
>>
>>   buf_track(bp, __func__);
>>
>> or so to various functions to record an entry in the buf when the
>> function is invoked.
>
> Does your extension also save a stack trace?
> I would love to have something like that for the memory allocation and
> deallocation audit.

No, just a pointer to a constant string (function name or similar).  I
think stacks would take up a huge amount of space relative to the size
of a buf (~1kB), rather than just a little bit more space :-).

I worked on a project involving buffers and found the tracking very
handy.  Something less ad-hoc would be useful to have.

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


svn commit: r294521 - head/sys/compat/linuxkpi/common/include/asm

2016-01-21 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jan 21 17:56:23 2016
New Revision: 294521
URL: https://svnweb.freebsd.org/changeset/base/294521

Log:
  Implement 64-bit atomic operations for the LinuxKPI.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/compat/linuxkpi/common/include/asm/atomic64.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/asm/atomic64.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h  Thu Jan 21 
17:56:23 2016(r294521)
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 2016 Mellanox Technologies, Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef_ASM_ATOMIC64_H_
+#define_ASM_ATOMIC64_H_
+
+#include 
+#include 
+#include 
+
+typedef struct {
+   volatile int64_t counter;
+} atomic64_t;
+
+/**
+ * 64-bit atomic operations
+ **/
+
+#defineatomic64_add(i, v)  atomic64_add_return((i), (v))
+#defineatomic64_sub(i, v)  atomic64_sub_return((i), (v))
+#defineatomic64_inc_return(v)  atomic64_add_return(1, (v))
+#defineatomic64_add_negative(i, v) (atomic64_add_return((i), (v)) 
< 0)
+#defineatomic64_sub_and_test(i, v) (atomic64_sub_return((i), (v)) 
== 0)
+#defineatomic64_dec_and_test(v)(atomic64_sub_return(1, (v)) == 
0)
+#defineatomic64_inc_and_test(v)(atomic64_add_return(1, (v)) == 
0)
+#defineatomic64_dec_return(v)  atomic64_sub_return(1, (v))
+#defineatomic64_inc_not_zero(v)atomic64_add_unless((v), 1, 0)
+
+static inline int64_t
+atomic64_add_return(int64_t i, atomic64_t *v)
+{
+   return i + atomic_fetchadd_64(>counter, i);
+}
+
+static inline int64_t
+atomic64_sub_return(int64_t i, atomic64_t *v)
+{
+   return atomic_fetchadd_64(>counter, -i) - i;
+}
+
+static inline void
+atomic64_set(atomic64_t *v, int64_t i)
+{
+   atomic_store_rel_64(>counter, i);
+}
+
+static inline int64_t
+atomic64_read(atomic64_t *v)
+{
+   return atomic_load_acq_64(>counter);
+}
+
+static inline int64_t
+atomic64_inc(atomic64_t *v)
+{
+   return atomic_fetchadd_64(>counter, 1) + 1;
+}
+
+static inline int64_t
+atomic64_dec(atomic64_t *v)
+{
+   return atomic_fetchadd_64(>counter, -1) - 1;
+}
+
+static inline int64_t
+atomic64_add_unless(atomic64_t *v, int64_t a, int64_t u)
+{
+   int64_t c;
+
+   for (;;) {
+   c = atomic64_read(v);
+   if (unlikely(c == u))
+   break;
+   if (likely(atomic_cmpset_64(>counter, c, c + a)))
+   break;
+   }
+   return (c != u);
+}
+
+#endif /* _ASM_ATOMIC64_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-01-21 Thread Gleb Smirnoff
On Wed, Jan 20, 2016 at 05:40:03PM -0800, Ravi Pokala wrote:
R> ISTR there's an API for creating a batch of counters; that might be cleaner 
than creating a dozen+ individually?

There are some. An array macros are in sys/counter.h itself. The network
stack has magic macros that allow you to use array macros on structures,
assuming all members are counter(9)s. This stuff from the network stack
can be generalized.

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


Re: svn commit: r294471 - head/sys/dev/usb/wlan

2016-01-21 Thread alex.burlyga.ietf alex.burlyga.ietf
Just out of curriosity, why not Dtrace? For kernel it has most of the
things that all the ad-hoc tracing things trying to accomplish and
then some more.

On Wed, Jan 20, 2016 at 4:02 PM, Adrian Chadd  wrote:
> Hi,
>
> So yeah, I think it's time we just bit the bullet and wrote a
> generic-ish debug/ktr framework for drivers to use so drivers and
> infrastructure doesn't keep spinning its own damned debugging stuff.
>
> (I know people keep saying "dtrace", but ...)
>
> Let's have a think about it.
>
>
> -a
> ___
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294525 - head/sys/netpfil/ipfw

2016-01-21 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Jan 21 18:20:40 2016
New Revision: 294525
URL: https://svnweb.freebsd.org/changeset/base/294525

Log:
  Fix panic on table/table entry delete. The panic could have happened
if more than 64 distinct values had been used.
  
  Table value code uses internal objhash API which requires unique key
for each object. For value code, pointer to the actual value data
is used. The actual problem arises from the fact that 'actual' e.g.
runtime data is stored in array and that array is auto-growing. There is
special hook (update_tvalue() function) which is used to update the pointers
after the change. For some reason, object 'key' was not updated.
Fix this by adding update code to the update_tvalue().
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/ip_fw_table_value.c

Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c
==
--- head/sys/netpfil/ipfw/ip_fw_table_value.c   Thu Jan 21 18:19:33 2016
(r294524)
+++ head/sys/netpfil/ipfw/ip_fw_table_value.c   Thu Jan 21 18:20:40 2016
(r294525)
@@ -158,6 +158,7 @@ update_tvalue(struct namedobj_instance *
 
pval = da->pval;
ptv->pval = [ptv->no.kidx];
+   ptv->no.name = (char *)[ptv->no.kidx];
 
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294523 - head/lib/libc/gmon

2016-01-21 Thread Brooks Davis
Author: brooks
Date: Thu Jan 21 18:17:19 2016
New Revision: 294523
URL: https://svnweb.freebsd.org/changeset/base/294523

Log:
  Replace the last non-optional use of sbrk() in the tree with mmap().
  
  All gmon want's is a region of memory without the overhead of malloc().
  Just mapping some pages with mmap is an easy way to accomplish this.
  
  Approved by:  jhb, cem, emaste
  Obtained from:CheriBSD (bf33e1e70b368ababde74aa3ac70d108c8a52c69)
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D5005

Modified:
  head/lib/libc/gmon/gmon.c

Modified: head/lib/libc/gmon/gmon.c
==
--- head/lib/libc/gmon/gmon.c   Thu Jan 21 18:02:31 2016(r294522)
+++ head/lib/libc/gmon/gmon.c   Thu Jan 21 18:17:19 2016(r294523)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -50,14 +51,6 @@ __FBSDID("$FreeBSD$");
 
 #include "libc_private.h"
 
-#if defined(__i386__) || defined(__sparc64__) || defined(__amd64__) || 
(defined(__powerpc__) && !defined(__powerpc64__))
-extern char *minbrk __asm (".minbrk");
-#elif defined(__powerpc64__)
-extern char *minbrk __asm ("_minbrk");
-#else
-extern char *minbrk __asm ("minbrk");
-#endif
-
 struct gmonparam _gmonparam = { GMON_PROF_OFF };
 
 static int s_scale;
@@ -94,8 +87,9 @@ monstartup(u_long lowpc, u_long highpc)
p->tolimit = MAXARCS;
p->tossize = p->tolimit * sizeof(struct tostruct);
 
-   cp = sbrk(p->kcountsize + p->fromssize + p->tossize);
-   if (cp == (char *)-1) {
+   cp = mmap(NULL, p->kcountsize + p->fromssize + p->tossize,
+   PROT_READ | PROT_WRITE, MAP_ANON, -1, 0);
+   if (cp == MAP_FAILED) {
ERR("monstartup: out of memory\n");
return;
}
@@ -108,7 +102,6 @@ monstartup(u_long lowpc, u_long highpc)
cp += p->kcountsize;
p->froms = (u_short *)cp;
 
-   minbrk = sbrk(0);
p->tos[0].link = 0;
 
o = p->highpc - p->lowpc;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294471 - head/sys/dev/usb/wlan

2016-01-21 Thread Andriy Gapon
On 21/01/2016 19:25, Conrad Meyer wrote:
> On Thu, Jan 21, 2016 at 1:52 AM, Andriy Gapon  wrote:
>> On 21/01/2016 03:28, Mark Johnston wrote:
>>> Isilon has done ad-hoc implementations of this for bufs and mbufs, and
>>> they're quite handy for debugging. With BUF_TRACKING enabled in our
>>> kernel config, each buf contains a const char *b_records[32], and one
>>> adds
>>>
>>>   buf_track(bp, __func__);
>>>
>>> or so to various functions to record an entry in the buf when the
>>> function is invoked.
>>
>> Does your extension also save a stack trace?
>> I would love to have something like that for the memory allocation and
>> deallocation audit.
> 
> No, just a pointer to a constant string (function name or similar).  I
> think stacks would take up a huge amount of space relative to the size
> of a buf (~1kB), rather than just a little bit more space :-).

Well, 15 or so addresses on amd64 would take 120 bytes and if they go to a
circular buffer, then it should not matter that much.

> I worked on a project involving buffers and found the tracking very
> handy.  Something less ad-hoc would be useful to have.

Indeed!

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


svn commit: r294510 - head/sys/arm/mv

2016-01-21 Thread Andrew Turner
Author: andrew
Date: Thu Jan 21 16:42:52 2016
New Revision: 294510
URL: https://svnweb.freebsd.org/changeset/base/294510

Log:
  Remove an extra '!' found by clang 3.8.

Modified:
  head/sys/arm/mv/mv_pci.c

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cThu Jan 21 16:38:58 2016(r294509)
+++ head/sys/arm/mv/mv_pci.cThu Jan 21 16:42:52 2016(r294510)
@@ -922,7 +922,7 @@ static inline void
 pcib_write_irq_mask(struct mv_pcib_softc *sc, uint32_t mask)
 {
 
-   if (!sc->sc_type != MV_TYPE_PCI)
+   if (sc->sc_type != MV_TYPE_PCI)
return;
 
bus_space_write_4(sc->sc_bst, sc->sc_bsh, PCIE_REG_IRQ_MASK, mask);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294507 - head/contrib/bsnmp/snmp_mibII

2016-01-21 Thread Ed Maste
On 21 January 2016 at 11:11, Hartmut Brandt  wrote:
> Author: harti
> Date: Thu Jan 21 16:11:20 2016
> New Revision: 294507
> URL: https://svnweb.freebsd.org/changeset/base/294507
>
> Log:
>   Fill the ifAlias leaf of the ifXTable with the interface description
>   if there is one available and it fits into the maximum size (64 characters).

This breaks the build for our GCC-using architectures:
/scratch/tmp/emaste/freebsd/usr.sbin/bsnmpd/modules/snmp_mibII/../../../../contrib/bsnmp/snmp_mibII/mibII.h:85:
error: variably modified 'alias' at file scope
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294530 - head/sys/sys

2016-01-21 Thread Ed Maste
Author: emaste
Date: Thu Jan 21 20:44:21 2016
New Revision: 294530
URL: https://svnweb.freebsd.org/changeset/base/294530

Log:
  Add STB_GNU_UNIQUE symbol binding definition
  
  Red Hat created STB_GNU_UNIQUE to handle certain special cases relating
  to dynamically loading C++ DSOs[1].
  
  We don't (currently) have support for STB_GNU_UNIQUE, but ought to
  reserve the value in ELFNN_ST_BIND. This will also be used by an
  upcoming ELF Tool Chain import.
  
  [1] https://www.redhat.com/archives/posix-c++-wg/2009-August/msg2.html
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu Jan 21 19:19:24 2016(r294529)
+++ head/sys/sys/elf_common.h   Thu Jan 21 20:44:21 2016(r294530)
@@ -753,8 +753,9 @@ typedef struct {
 #defineSTB_LOCAL   0   /* Local symbol */
 #defineSTB_GLOBAL  1   /* Global symbol */
 #defineSTB_WEAK2   /* like global - lower precedence */
-#defineSTB_LOOS10  /* Reserved range for operating system 
*/
-#defineSTB_HIOS12  /*   specific semantics. */
+#defineSTB_LOOS10  /* Start of operating system reserved 
range. */
+#defineSTB_GNU_UNIQUE  10  /* Unique symbol (GNU) */
+#defineSTB_HIOS12  /* End of operating system reserved 
range. */
 #defineSTB_LOPROC  13  /* reserved range for processor */
 #defineSTB_HIPROC  15  /*   specific semantics. */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294531 - head/sys/sys

2016-01-21 Thread Kirk McKusick
Author: mckusick
Date: Thu Jan 21 20:52:20 2016
New Revision: 294531
URL: https://svnweb.freebsd.org/changeset/base/294531

Log:
  Update comment to note the function, prison_priv_check(), that needs to
  be updated in kern_jail.c when a new priviledge is added.

Modified:
  head/sys/sys/priv.h

Modified: head/sys/sys/priv.h
==
--- head/sys/sys/priv.h Thu Jan 21 20:44:21 2016(r294530)
+++ head/sys/sys/priv.h Thu Jan 21 20:52:20 2016(r294531)
@@ -45,8 +45,9 @@
  * loadable kernel module ABI, and should not be changed across minor
  * releases.
  *
- * When adding a new privilege, remember to determine if it's appropriate for
- * use in jail, and update the privilege switch in kern_jail.c as necessary.
+ * When adding a new privilege, remember to determine if it's appropriate
+ * for use in jail, and update the privilege switch in prison_priv_check()
+ * in kern_jail.c as necessary.
  */
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294530 - head/sys/sys

2016-01-21 Thread Renato Botelho
> On Jan 21, 2016, at 18:44, Ed Maste  wrote:
> 
> Author: emaste
> Date: Thu Jan 21 20:44:21 2016
> New Revision: 294530
> URL: https://svnweb.freebsd.org/changeset/base/294530
> 
> Log:
>  Add STB_GNU_UNIQUE symbol binding definition
> 
>  Red Hat created STB_GNU_UNIQUE to handle certain special cases relating
>  to dynamically loading C++ DSOs[1].
> 
>  We don't (currently) have support for STB_GNU_UNIQUE, but ought to
>  reserve the value in ELFNN_ST_BIND. This will also be used by an
>  upcoming ELF Tool Chain import.
> 
>  [1] https://www.redhat.com/archives/posix-c++-wg/2009-August/msg2.html
> 
>  MFC after:   1 week
>  Sponsored by:The FreeBSD Foundation
> 
> Modified:
>  head/sys/sys/elf_common.h
> 
> Modified: head/sys/sys/elf_common.h
> ==
> --- head/sys/sys/elf_common.h Thu Jan 21 19:19:24 2016(r294529)
> +++ head/sys/sys/elf_common.h Thu Jan 21 20:44:21 2016(r294530)
> @@ -753,8 +753,9 @@ typedef struct {
> #define   STB_LOCAL   0   /* Local symbol */
> #define   STB_GLOBAL  1   /* Global symbol */
> #define   STB_WEAK2   /* like global - lower precedence */
> -#define  STB_LOOS10  /* Reserved range for operating system 
> */
> -#define  STB_HIOS12  /*   specific semantics. */
> +#define  STB_LOOS10  /* Start of operating system reserved 
> range. */
> +#define  STB_GNU_UNIQUE  10  /* Unique symbol (GNU) */

Looks like you meant to use 11 here, no?

> +#define  STB_HIOS12  /* End of operating system reserved 
> range. */
> #define   STB_LOPROC  13  /* reserved range for processor */
> #define   STB_HIPROC  15  /*   specific semantics. */
> 
> ___
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


--
Renato Botelho

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


Re: svn commit: r294470 - head/libexec/rtld-elf

2016-01-21 Thread Alexander Kabaev
On Thu, 21 Jan 2016 22:20:12 +0100
Antoine Brodin  wrote:

> On Thu, Jan 21, 2016 at 12:26 AM, Alexander Kabaev 
> wrote:
> > Author: kan
> > Date: Wed Jan 20 23:26:35 2016
> > New Revision: 294470
> > URL: https://svnweb.freebsd.org/changeset/base/294470
> >
> > Log:
> >   Fix initlist_add_object invocation parameters.
> >
> >   The tail parameter should point to the last object for
> >   which dependencies should be processed. In most cases,
> >   this is the object itself.
> >
> > Modified:
> >   head/libexec/rtld-elf/rtld.c  
> 
> Hi,
> 
> It seems there are still some hangs after this fix  (seen on the -head
> package builders,  tar -xf hanging for instance).
> 
> Cheers,
> 
> Antoine

I've seen hangs _before_ this fix but none after. You'd have to collect
some backtraces and share with me and kib@.
  
-- 
Alexander Kabaev


pgpuqp_JT29zB.pgp
Description: Цифровая подпись OpenPGP


svn commit: r294536 - head/sys/netinet

2016-01-21 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 21 22:53:12 2016
New Revision: 294536
URL: https://svnweb.freebsd.org/changeset/base/294536

Log:
  Refactor TCP_CONGESTION setsockopt handling:
  - Use M_TEMP instead of stack variable.
  - Unroll error handling, removing several levels of indentation.

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Thu Jan 21 22:34:51 2016
(r294535)
+++ head/sys/netinet/tcp_usrreq.c   Thu Jan 21 22:53:12 2016
(r294536)
@@ -1479,7 +1479,7 @@ tcp_default_ctloutput(struct socket *so,
u_int   ui;
struct  tcp_info ti;
struct cc_algo *algo;
-   char buf[TCP_CA_NAME_MAX];
+   char*buf;

switch (sopt->sopt_dir) {
case SOPT_SET:
@@ -1574,50 +1574,47 @@ unlock_and_done:
 
case TCP_CONGESTION:
INP_WUNLOCK(inp);
-   bzero(buf, sizeof(buf));
-   error = sooptcopyin(sopt, , sizeof(buf), 1);
-   if (error)
+   buf = malloc(TCP_CA_NAME_MAX, M_TEMP, M_WAITOK|M_ZERO);
+   error = sooptcopyin(sopt, buf, TCP_CA_NAME_MAX, 1);
+   if (error) {
+   free(buf, M_TEMP);
break;
+   }
+   CC_LIST_RLOCK();
+   STAILQ_FOREACH(algo, _list, entries)
+   if (strncmp(buf, algo->name,
+   TCP_CA_NAME_MAX) == 0)
+   break;
+   CC_LIST_RUNLOCK();
+   free(buf, M_TEMP);
+   if (algo == NULL) {
+   error = EINVAL;
+   break;
+   }
INP_WLOCK_RECHECK(inp);
/*
-* Return EINVAL if we can't find the requested cc algo.
+* We hold a write lock over the tcb so it's safe to
+* do these things without ordering concerns.
 */
-   error = EINVAL;
-   CC_LIST_RLOCK();
-   STAILQ_FOREACH(algo, _list, entries) {
-   if (strncmp(buf, algo->name, TCP_CA_NAME_MAX)
-   == 0) {
-   /* We've found the requested algo. */
-   error = 0;
-   /*
-* We hold a write lock over the tcb
-* so it's safe to do these things
-* without ordering concerns.
-*/
-   if (CC_ALGO(tp)->cb_destroy != NULL)
-   
CC_ALGO(tp)->cb_destroy(tp->ccv);
-   CC_ALGO(tp) = algo;
-   /*
-* If something goes pear shaped
-* initialising the new algo,
-* fall back to newreno (which
-* does not require initialisation).
-*/
-   if (algo->cb_init != NULL)
-   if (algo->cb_init(tp->ccv) > 0) 
{
-   CC_ALGO(tp) = 
_cc_algo;
-   /*
-* The only reason init
-* should fail is
-* because of malloc.
-*/
-   error = ENOMEM;
-   }
-   break; /* Break the STAILQ_FOREACH. */
-   }
+   if (CC_ALGO(tp)->cb_destroy != NULL)
+   CC_ALGO(tp)->cb_destroy(tp->ccv);
+   CC_ALGO(tp) = algo;
+   /*
+* If something goes pear shaped initialising the new
+* algo, fall back to newreno (which does not
+* require initialisation).
+*/
+   if (algo->cb_init != NULL &&
+   algo->cb_init(tp->ccv) != 0) {
+   

Re: svn commit: r294530 - head/sys/sys

2016-01-21 Thread Ed Maste
On 21 January 2016 at 16:00, Renato Botelho  wrote:
>> On Jan 21, 2016, at 18:44, Ed Maste  wrote:
>>
>> Author: emaste
>> Date: Thu Jan 21 20:44:21 2016
>> New Revision: 294530
>> URL: https://svnweb.freebsd.org/changeset/base/294530
>>
>> Log:
>>  Add STB_GNU_UNIQUE symbol binding definition
>>
>>  Red Hat created STB_GNU_UNIQUE to handle certain special cases relating
>>  to dynamically loading C++ DSOs[1].
>>
>>  We don't (currently) have support for STB_GNU_UNIQUE, but ought to
>>  reserve the value in ELFNN_ST_BIND. This will also be used by an
>>  upcoming ELF Tool Chain import.
>>
>>  [1] https://www.redhat.com/archives/posix-c++-wg/2009-August/msg2.html
>>
>>  MFC after:   1 week
>>  Sponsored by:The FreeBSD Foundation
>>
>> Modified:
>>  head/sys/sys/elf_common.h
>>
>> Modified: head/sys/sys/elf_common.h
>> ==
>> --- head/sys/sys/elf_common.h Thu Jan 21 19:19:24 2016(r294529)
>> +++ head/sys/sys/elf_common.h Thu Jan 21 20:44:21 2016(r294530)
>> @@ -753,8 +753,9 @@ typedef struct {
>> #define   STB_LOCAL   0   /* Local symbol */
>> #define   STB_GLOBAL  1   /* Global symbol */
>> #define   STB_WEAK2   /* like global - lower precedence */
>> -#define  STB_LOOS10  /* Reserved range for operating system 
>> */
>> -#define  STB_HIOS12  /*   specific semantics. */
>> +#define  STB_LOOS10  /* Start of operating system reserved 
>> range. */
>> +#define  STB_GNU_UNIQUE  10  /* Unique symbol (GNU) */
>
> Looks like you meant to use 11 here, no?

No, it is supposed to be 10. STB_LOOS is a placeholder for the first
OS-specific entry, and STB_GNU_UNIQUE is the first one. It's similar
to STT_GNU_IFUNC (which we do use) -- it has the same value as
STT_LOOS.

These two are really more of a toolchain concern than a "GNU OS," but
either way STB_GNU_UNIQUE has the value 10, and if we end up
supporting this functionality we'll use the same value.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294470 - head/libexec/rtld-elf

2016-01-21 Thread Antoine Brodin
On Thu, Jan 21, 2016 at 12:26 AM, Alexander Kabaev  wrote:
> Author: kan
> Date: Wed Jan 20 23:26:35 2016
> New Revision: 294470
> URL: https://svnweb.freebsd.org/changeset/base/294470
>
> Log:
>   Fix initlist_add_object invocation parameters.
>
>   The tail parameter should point to the last object for
>   which dependencies should be processed. In most cases,
>   this is the object itself.
>
> Modified:
>   head/libexec/rtld-elf/rtld.c

Hi,

It seems there are still some hangs after this fix  (seen on the -head
package builders,  tar -xf hanging for instance).

Cheers,

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


svn commit: r294534 - in head/sys/netinet: . cc tcp_stacks

2016-01-21 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 21 22:24:20 2016
New Revision: 294534
URL: https://svnweb.freebsd.org/changeset/base/294534

Log:
  Cleanup TCP files from unnecessary interface related includes.

Modified:
  head/sys/netinet/cc/cc.c
  head/sys/netinet/cc/cc_cdg.c
  head/sys/netinet/cc/cc_chd.c
  head/sys/netinet/cc/cc_dctcp.c
  head/sys/netinet/cc/cc_hd.c
  head/sys/netinet/cc/cc_vegas.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/fastpath.c

Modified: head/sys/netinet/cc/cc.c
==
--- head/sys/netinet/cc/cc.cThu Jan 21 21:42:06 2016(r294533)
+++ head/sys/netinet/cc/cc.cThu Jan 21 22:24:20 2016(r294534)
@@ -63,8 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-#include 
+#include 
 
 #include 
 #include 

Modified: head/sys/netinet/cc/cc_cdg.c
==
--- head/sys/netinet/cc/cc_cdg.cThu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/cc/cc_cdg.cThu Jan 21 22:24:20 2016
(r294534)
@@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_chd.c
==
--- head/sys/netinet/cc/cc_chd.cThu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/cc/cc_chd.cThu Jan 21 22:24:20 2016
(r294534)
@@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_dctcp.c
==
--- head/sys/netinet/cc/cc_dctcp.c  Thu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/cc/cc_dctcp.c  Thu Jan 21 22:24:20 2016
(r294534)
@@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/netinet/cc/cc_hd.c
==
--- head/sys/netinet/cc/cc_hd.c Thu Jan 21 21:42:06 2016(r294533)
+++ head/sys/netinet/cc/cc_hd.c Thu Jan 21 22:24:20 2016(r294534)
@@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_vegas.c
==
--- head/sys/netinet/cc/cc_vegas.c  Thu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/cc/cc_vegas.c  Thu Jan 21 22:24:20 2016
(r294534)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #include 

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/tcp_input.cThu Jan 21 22:24:20 2016
(r294534)
@@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include/* required for icmp_var.h */
 #include   /* for ICMP_BANDLIM */
@@ -96,6 +95,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #ifdef TCP_RFC7413

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Thu Jan 21 21:42:06 2016
(r294533)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Thu Jan 21 22:24:20 2016
(r294534)
@@ -81,8 +81,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
 #include 
 #include 
 
@@ -93,7 +91,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include/* required for icmp_var.h */
 #include   /* for ICMP_BANDLIM */
@@ -103,7 +100,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294535 - in head/sys/netinet: . cc tcp_stacks

2016-01-21 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jan 21 22:34:51 2016
New Revision: 294535
URL: https://svnweb.freebsd.org/changeset/base/294535

Log:
  - Rename cc.h to more meaningful tcp_cc.h.
  - Declare it a kernel only include, which it already is.
  - Don't include tcp.h implicitly from tcp_cc.h

Added:
  head/sys/netinet/tcp_cc.h
 - copied, changed from r294534, head/sys/netinet/cc.h
Deleted:
  head/sys/netinet/cc.h
Modified:
  head/sys/netinet/cc/cc.c
  head/sys/netinet/cc/cc_cdg.c
  head/sys/netinet/cc/cc_chd.c
  head/sys/netinet/cc/cc_cubic.c
  head/sys/netinet/cc/cc_dctcp.c
  head/sys/netinet/cc/cc_hd.c
  head/sys/netinet/cc/cc_htcp.c
  head/sys/netinet/cc/cc_newreno.c
  head/sys/netinet/cc/cc_vegas.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/cc/cc.c
==
--- head/sys/netinet/cc/cc.cThu Jan 21 22:24:20 2016(r294534)
+++ head/sys/netinet/cc/cc.cThu Jan 21 22:34:51 2016(r294535)
@@ -65,10 +65,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 

Modified: head/sys/netinet/cc/cc_cdg.c
==
--- head/sys/netinet/cc/cc_cdg.cThu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_cdg.cThu Jan 21 22:34:51 2016
(r294535)
@@ -65,11 +65,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_chd.c
==
--- head/sys/netinet/cc/cc_chd.cThu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_chd.cThu Jan 21 22:34:51 2016
(r294535)
@@ -67,11 +67,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_cubic.c
==
--- head/sys/netinet/cc/cc_cubic.c  Thu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_cubic.c  Thu Jan 21 22:34:51 2016
(r294535)
@@ -59,11 +59,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 

Modified: head/sys/netinet/cc/cc_dctcp.c
==
--- head/sys/netinet/cc/cc_dctcp.c  Thu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_dctcp.c  Thu Jan 21 22:34:51 2016
(r294535)
@@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
-
+#include 
 #include 
 
 #defineCAST_PTR_INT(X) (*((int*)(X)))

Modified: head/sys/netinet/cc/cc_hd.c
==
--- head/sys/netinet/cc/cc_hd.c Thu Jan 21 22:24:20 2016(r294534)
+++ head/sys/netinet/cc/cc_hd.c Thu Jan 21 22:34:51 2016(r294535)
@@ -68,11 +68,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 #include 

Modified: head/sys/netinet/cc/cc_htcp.c
==
--- head/sys/netinet/cc/cc_htcp.c   Thu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_htcp.c   Thu Jan 21 22:34:51 2016
(r294535)
@@ -62,11 +62,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 /* Fixed point math shifts. */

Modified: head/sys/netinet/cc/cc_newreno.c
==
--- head/sys/netinet/cc/cc_newreno.cThu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_newreno.cThu Jan 21 22:34:51 2016
(r294535)
@@ -62,10 +62,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
-
+#include 
 #include 
 
 static voidnewreno_ack_received(struct cc_var *ccv, uint16_t type);

Modified: head/sys/netinet/cc/cc_vegas.c
==
--- head/sys/netinet/cc/cc_vegas.c  Thu Jan 21 22:24:20 2016
(r294534)
+++ head/sys/netinet/cc/cc_vegas.c  Thu Jan 21 22:34:51 2016
(r294535)
@@ -69,11 +69,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 #include 
-
+#include 
 #include 
 
 #include 

Copied and modified: head/sys/netinet/tcp_cc.h (from r294534, 
head/sys/netinet/cc.h)

Re: svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread Gleb Smirnoff
On Thu, Jan 21, 2016 at 06:43:10PM -0800, hiren panchasara wrote:
h> > h> >   Provide new socket option TCP_CCALGOOPT, which stands for TCP 
congestion
h> > h> >   control algorithm options.  The argument is variable length and is 
opaque
h> > h> >   to TCP, forwarded directly to the algorithm's ctl_output method.
h> > h> >   
h> > h> >   Provide new includes directory netinet/cc, where algorithm specific
h> > h> >   headers can be installed.
h> > h> >   
h> > h> >   The new API doesn't yet have any in tree consumers.
h> > h> >   
h> > h> >   The original code written by lstewart.
h> > h> >   Reviewed by:rrs, emax
h> > h> >   Sponsored by:   Netflix
h> > h> >   Differential Revision:  https://reviews.freebsd.org/D711
h> > h> 
h> > h> Thanks Lawrence and Glebius for the patch.
h> > h> 
h> > h> I know original plan was to have this in earlier but is it possible to
h> > h> still get this in 10.3 or would it be too soon?
h> > 
h> > Do you have a module that is going to utilize it?
h> 
h> Not right now. But having this in 10.3 can be useful. I don't want to
h> push. I can always carry this patch around if I need in 10.

Yes, I'm quite reluctant to merge. First we need more modules using the API,
and then we can say ourselves that API is good and can go into stable. Since
when it wents into stable, we should no longer change it.

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


svn commit: r294541 - in head/sys: conf kern

2016-01-21 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 22 02:23:18 2016
New Revision: 294541
URL: https://svnweb.freebsd.org/changeset/base/294541

Log:
  - Separate sendfile(2) implementation from uipc_syscalls.c into
separate file.  Claim my copyright.
  - Provide more comments, better function and structure names.
  - Sort out unneeded includes from resulting two files.
  
  No functional changes.

Added:
  head/sys/kern/kern_sendfile.c
 - copied, changed from r294536, head/sys/kern/uipc_syscalls.c
Modified:
  head/sys/conf/files
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jan 22 02:07:48 2016(r294540)
+++ head/sys/conf/files Fri Jan 22 02:23:18 2016(r294541)
@@ -3213,6 +3213,7 @@ kern/kern_rmlock.cstandard
 kern/kern_rwlock.c standard
 kern/kern_sdt.coptional kdtrace_hooks
 kern/kern_sema.c   standard
+kern/kern_sendfile.c   standard
 kern/kern_sharedpage.c standard
 kern/kern_shutdown.c   standard
 kern/kern_sig.cstandard

Copied and modified: head/sys/kern/kern_sendfile.c (from r294536, 
head/sys/kern/uipc_syscalls.c)
==
--- head/sys/kern/uipc_syscalls.c   Thu Jan 21 22:53:12 2016
(r294536, copy source)
+++ head/sys/kern/kern_sendfile.c   Fri Jan 22 02:23:18 2016
(r294541)
@@ -1,8 +1,5 @@
 /*-
- * Copyright (c) 1982, 1986, 1989, 1990, 1993
- * The Regents of the University of California.  All rights reserved.
- *
- * sendfile(2) and related extensions:
+ * Copyright (c) 2013-2015 Gleb Smirnoff 
  * Copyright (c) 1998, David Greenman. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,55 +25,33 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
  */
 
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_capsicum.h"
-#include "opt_inet.h"
-#include "opt_inet6.h"
 #include "opt_compat.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
-#ifdef COMPAT_FREEBSD32
-#include 
-#endif
 
 #include 
 
@@ -84,1736 +59,68 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
-
-/*
- * Flags for accept1() and kern_accept4(), in addition to SOCK_CLOEXEC
- * and SOCK_NONBLOCK.
- */
-#defineACCEPT4_INHERIT 0x1
-#defineACCEPT4_COMPAT  0x2
-
-static int sendit(struct thread *td, int s, struct msghdr *mp, int flags);
-static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp);
-
-static int accept1(struct thread *td, int s, struct sockaddr *uname,
-  socklen_t *anamelen, int flags);
-static int do_sendfile(struct thread *td, struct sendfile_args *uap,
-  int compat);
-static int getsockname1(struct thread *td, struct getsockname_args *uap,
-   int compat);
-static int getpeername1(struct thread *td, struct getpeername_args *uap,
-   int compat);
-
-counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)];
-
-static void
-sfstat_init(const void *unused)
-{
-
-   COUNTER_ARRAY_ALLOC(sfstat, sizeof(struct sfstat) / sizeof(uint64_t),
-   M_WAITOK);
-}
-SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL);
-
-static int
-sfstat_sysctl(SYSCTL_HANDLER_ARGS)
-{
-   struct sfstat s;
-
-   COUNTER_ARRAY_COPY(sfstat, , sizeof(s) / sizeof(uint64_t));
-   if (req->newptr)
-   COUNTER_ARRAY_ZERO(sfstat, sizeof(s) / sizeof(uint64_t));
-   return (SYSCTL_OUT(req, , sizeof(s)));
-}
-SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQUE | CTLFLAG_RW,
-NULL, 0, sfstat_sysctl, "I", "sendfile statistics");
-
-/*
- * Convert a user file descriptor to a kernel file entry and check if required
- * capability rights are present.
- * A reference on the file entry is held upon returning.
- */
-int
-getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
-struct file **fpp, u_int *fflagp)
-{
-   struct file *fp;
-   int error;
-
-   error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, , NULL);
-   if (error != 0)
-   return (error);
-   if (fp->f_type != DTYPE_SOCKET) {
-   fdrop(fp, td);
-   return (ENOTSOCK);
-   }
-  

Re: svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread hiren panchasara
On 01/21/16 at 06:39P, Gleb Smirnoff wrote:
>   Hiren,
> 
> On Thu, Jan 21, 2016 at 06:24:02PM -0800, hiren panchasara wrote:
> h> > Log:
> h> >   Provide new socket option TCP_CCALGOOPT, which stands for TCP 
> congestion
> h> >   control algorithm options.  The argument is variable length and is 
> opaque
> h> >   to TCP, forwarded directly to the algorithm's ctl_output method.
> h> >   
> h> >   Provide new includes directory netinet/cc, where algorithm specific
> h> >   headers can be installed.
> h> >   
> h> >   The new API doesn't yet have any in tree consumers.
> h> >   
> h> >   The original code written by lstewart.
> h> >   Reviewed by:   rrs, emax
> h> >   Sponsored by:  Netflix
> h> >   Differential Revision: https://reviews.freebsd.org/D711
> h> 
> h> Thanks Lawrence and Glebius for the patch.
> h> 
> h> I know original plan was to have this in earlier but is it possible to
> h> still get this in 10.3 or would it be too soon?
> 
> Do you have a module that is going to utilize it?

Not right now. But having this in 10.3 can be useful. I don't want to
push. I can always carry this patch around if I need in 10.

Cheers,
Hiren


pgp0lxfBAmKrx.pgp
Description: PGP signature


Re: svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread Gleb Smirnoff
  Hiren,

On Thu, Jan 21, 2016 at 06:24:02PM -0800, hiren panchasara wrote:
h> > Log:
h> >   Provide new socket option TCP_CCALGOOPT, which stands for TCP congestion
h> >   control algorithm options.  The argument is variable length and is opaque
h> >   to TCP, forwarded directly to the algorithm's ctl_output method.
h> >   
h> >   Provide new includes directory netinet/cc, where algorithm specific
h> >   headers can be installed.
h> >   
h> >   The new API doesn't yet have any in tree consumers.
h> >   
h> >   The original code written by lstewart.
h> >   Reviewed by: rrs, emax
h> >   Sponsored by:Netflix
h> >   Differential Revision:   https://reviews.freebsd.org/D711
h> 
h> Thanks Lawrence and Glebius for the patch.
h> 
h> I know original plan was to have this in earlier but is it possible to
h> still get this in 10.3 or would it be too soon?

Do you have a module that is going to utilize it?

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


svn commit: r294543 - head/usr.sbin/ypldap

2016-01-21 Thread Marcelo Araujo
Author: araujo
Date: Fri Jan 22 03:02:38 2016
New Revision: 294543
URL: https://svnweb.freebsd.org/changeset/base/294543

Log:
  Switch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
  tunable. Also it gets more close with the original implementation from
  OpenBSD.
  
  Requested by: rodrigc
  Approved by:  rodrigc (mentor)
  Differential Revision:https://reviews.freebsd.org/D4970

Modified:
  head/usr.sbin/ypldap/yp.c

Modified: head/usr.sbin/ypldap/yp.c
==
--- head/usr.sbin/ypldap/yp.c   Fri Jan 22 02:28:17 2016(r294542)
+++ head/usr.sbin/ypldap/yp.c   Fri Jan 22 03:02:38 2016(r294543)
@@ -83,17 +83,14 @@ void
 yp_enable_events(void)
 {
int i;
-   extern fd_set svc_fdset;
struct yp_event *ye;
 
-   for (i = 0; i < FD_SETSIZE; i++) {
-   if (FD_ISSET(i, _fdset)) {
-   if ((ye = calloc(1, sizeof(*ye))) == NULL)
-   fatal(NULL);
-   event_set(>ye_event, i, EV_READ, yp_fd_event, NULL);
-   event_add(>ye_event, NULL);
-   TAILQ_INSERT_TAIL(>sc_yp->yd_events, ye, ye_entry);
-   }
+   for (i = 0; i < getdtablesize(); i++) {
+   if ((ye = calloc(1, sizeof(*ye))) == NULL)
+   fatal(NULL);
+   event_set(>ye_event, i, EV_READ, yp_fd_event, NULL);
+   event_add(>ye_event, NULL);
+   TAILQ_INSERT_TAIL(>sc_yp->yd_events, ye, ye_entry);
}
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294539 - head/sys/sparc64/include

2016-01-21 Thread John Baldwin
Author: jhb
Date: Fri Jan 22 00:29:11 2016
New Revision: 294539
URL: https://svnweb.freebsd.org/changeset/base/294539

Log:
  Add an atomic_fetchadd_64() wrapper on sparc64.
  
  Reviewed by:  marius

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

Modified: head/sys/sparc64/include/atomic.h
==
--- head/sys/sparc64/include/atomic.h   Fri Jan 22 00:13:18 2016
(r294538)
+++ head/sys/sparc64/include/atomic.h   Fri Jan 22 00:29:11 2016
(r294539)
@@ -319,6 +319,7 @@ ATOMIC_GEN(ptr, uintptr_t *, uintptr_t, 
 #defineatomic_fetchadd_int atomic_add_int
 #defineatomic_fetchadd_32  atomic_add_32
 #defineatomic_fetchadd_longatomic_add_long
+#defineatomic_fetchadd_64  atomic_add_64
 
 #undef ATOMIC_GEN
 #undef atomic_cas
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread hiren panchasara
On 01/21/16 at 06:50P, Gleb Smirnoff wrote:
> On Thu, Jan 21, 2016 at 06:43:10PM -0800, hiren panchasara wrote:
> h> > h> >   Provide new socket option TCP_CCALGOOPT, which stands for TCP 
> congestion
> h> > h> >   control algorithm options.  The argument is variable length and 
> is opaque
> h> > h> >   to TCP, forwarded directly to the algorithm's ctl_output method.
> h> > h> >   
> h> > h> >   Provide new includes directory netinet/cc, where algorithm 
> specific
> h> > h> >   headers can be installed.
> h> > h> >   
> h> > h> >   The new API doesn't yet have any in tree consumers.
> h> > h> >   
> h> > h> >   The original code written by lstewart.
> h> > h> >   Reviewed by:  rrs, emax
> h> > h> >   Sponsored by: Netflix
> h> > h> >   Differential Revision:https://reviews.freebsd.org/D711
> h> > h> 
> h> > h> Thanks Lawrence and Glebius for the patch.
> h> > h> 
> h> > h> I know original plan was to have this in earlier but is it possible to
> h> > h> still get this in 10.3 or would it be too soon?
> h> > 
> h> > Do you have a module that is going to utilize it?
> h> 
> h> Not right now. But having this in 10.3 can be useful. I don't want to
> h> push. I can always carry this patch around if I need in 10.
> 
> Yes, I'm quite reluctant to merge. First we need more modules using the API,
> and then we can say ourselves that API is good and can go into stable. Since
> when it wents into stable, we should no longer change it.

Fair enough.

Cheers,
Hiren


pgp5hDbCw48WM.pgp
Description: PGP signature


svn commit: r294544 - head/sys/dev/flash

2016-01-21 Thread Adrian Chadd
Author: adrian
Date: Fri Jan 22 03:15:53 2016
New Revision: 294544
URL: https://svnweb.freebsd.org/changeset/base/294544

Log:
  [flash] Teach mx25l SPI flash driver to interact with fdt_slicer and 
geom_flashmap
  
  This teaches the mx25l driver (sys/dev/flash/mx25l.c) to interact with
  sys/dev/fdt/fdt_slicer.c and sys/geom/geom_flashmap.c.
  
  This allows systems with SPI flash to benefit from the possibility to define
  flash 'slices' via FDT, just the same way that it's currently possible for
  CFI and NAND flashes.
  
  Tested:
  
  * Carambola 2, AR9331 + SPI NOR flash
  
  PR:   kern/206227
  Submitted by: Stanislav Galabov 

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Fri Jan 22 03:02:38 2016(r294543)
+++ head/sys/dev/flash/mx25l.c  Fri Jan 22 03:15:53 2016(r294544)
@@ -93,6 +93,7 @@ static int mx25l_open(struct disk *dp);
 static int mx25l_close(struct disk *dp);
 static int mx25l_ioctl(struct disk *, u_long, void *, int, struct thread *);
 static void mx25l_strategy(struct bio *bp);
+static int mx25l_getattr(struct bio *bp);
 static void mx25l_task(void *arg);
 
 struct mx25l_flash_ident flash_devices[] = {
@@ -383,6 +384,7 @@ mx25l_attach(device_t dev)
sc->sc_disk->d_open = mx25l_open;
sc->sc_disk->d_close = mx25l_close;
sc->sc_disk->d_strategy = mx25l_strategy;
+   sc->sc_disk->d_getattr = mx25l_getattr;
sc->sc_disk->d_ioctl = mx25l_ioctl;
sc->sc_disk->d_name = "flash/spi";
sc->sc_disk->d_drv1 = sc;
@@ -448,6 +450,27 @@ mx25l_strategy(struct bio *bp)
M25PXX_UNLOCK(sc);
 }
 
+static int
+mx25l_getattr(struct bio *bp)
+{
+   struct mx25l_softc *sc;
+   device_t dev;
+
+   if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL)
+   return (ENXIO);
+
+   sc = bp->bio_disk->d_drv1;
+   dev = sc->sc_dev;
+
+   if (strcmp(bp->bio_attribute, "SPI::device") == 0) {
+   if (bp->bio_length != sizeof(dev))
+   return (EFAULT);
+   bcopy(, bp->bio_data, sizeof(dev));
+   } else
+   return (-1);
+   return (0);
+}
+
 static void
 mx25l_task(void *arg)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 22 02:07:48 2016
New Revision: 294540
URL: https://svnweb.freebsd.org/changeset/base/294540

Log:
  Provide new socket option TCP_CCALGOOPT, which stands for TCP congestion
  control algorithm options.  The argument is variable length and is opaque
  to TCP, forwarded directly to the algorithm's ctl_output method.
  
  Provide new includes directory netinet/cc, where algorithm specific
  headers can be installed.
  
  The new API doesn't yet have any in tree consumers.
  
  The original code written by lstewart.
  Reviewed by:  rrs, emax
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D711

Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/share/man/man4/mod_cc.4
  head/share/man/man4/tcp.4
  head/share/man/man9/mod_cc.9
  head/sys/netinet/tcp.h
  head/sys/netinet/tcp_cc.h
  head/sys/netinet/tcp_usrreq.c

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Fri Jan 22 00:29:11 2016
(r294539)
+++ head/etc/mtree/BSD.include.dist Fri Jan 22 02:07:48 2016
(r294540)
@@ -270,6 +270,8 @@
 ..
 ..
 netinet
+cc
+..
 ..
 netinet6
 ..

Modified: head/include/Makefile
==
--- head/include/Makefile   Fri Jan 22 00:29:11 2016(r294539)
+++ head/include/Makefile   Fri Jan 22 02:07:48 2016(r294540)
@@ -53,6 +53,7 @@ LSUBDIRS= cam/ata cam/scsi \
geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
net/altq \
netgraph/atm netgraph/netflow \
+   netinet/cc \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
security/mac_mls security/mac_partition \

Modified: head/share/man/man4/mod_cc.4
==
--- head/share/man/man4/mod_cc.4Fri Jan 22 00:29:11 2016
(r294539)
+++ head/share/man/man4/mod_cc.4Fri Jan 22 02:07:48 2016
(r294540)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2015
+.Dd January 21, 2016
 .Dt MOD_CC 4
 .Os
 .Sh NAME
@@ -49,7 +49,9 @@ using the
 facility.
 .Pp
 The default algorithm is NewReno, and all connections use the default unless
-explicitly overridden using the TCP_CONGESTION socket option (see
+explicitly overridden using the
+.Dv TCP_CONGESTION
+socket option (see
 .Xr tcp 4
 for details).
 The default can be changed using a
@@ -57,6 +59,14 @@ The default can be changed using a
 MIB variable detailed in the
 .Sx MIB Variables
 section below.
+.Pp
+Algorithm specific parameters can be set or queried using the
+.Dv TCP_CCALGOOPT
+socket option (see
+.Xr tcp 4
+for details).
+Callers must pass a pointer to an algorithm specific data, and specify
+its size.
 .Sh MIB Variables
 The framework exposes the following variables in the
 .Va net.inet.tcp.cc

Modified: head/share/man/man4/tcp.4
==
--- head/share/man/man4/tcp.4   Fri Jan 22 00:29:11 2016(r294539)
+++ head/share/man/man4/tcp.4   Fri Jan 22 02:07:48 2016(r294540)
@@ -34,7 +34,7 @@
 .\" From: @(#)tcp.48.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 27, 2015
+.Dd January 21, 2016
 .Dt TCP 4
 .Os
 .Sh NAME
@@ -137,6 +137,11 @@ send window size,
 receive window size,
 and
 bandwidth-controlled window space.
+.It Dv TCP_CCALGOOPT
+Set or query congestion control algorithm specific parameters.
+See
+.Xr mod_cc 4
+for details.
 .It Dv TCP_CONGESTION
 Select or query the congestion control algorithm that TCP will use for the
 connection.

Modified: head/share/man/man9/mod_cc.9
==
--- head/share/man/man9/mod_cc.9Fri Jan 22 00:29:11 2016
(r294539)
+++ head/share/man/man9/mod_cc.9Fri Jan 22 02:07:48 2016
(r294540)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 26, 2014
+.Dd January 21, 2016
 .Dt MOD_CC 9
 .Os
 .Sh NAME
@@ -40,7 +40,8 @@
 .Nm CCV
 .Nd Modular Congestion Control
 .Sh SYNOPSIS
-.In netinet/cc.h
+.In netinet/tcp.h
+.In netinet/tcp_cc.h
 .In netinet/cc/cc_module.h
 .Fn DECLARE_CC_MODULE "ccname" "ccalgo"
 .Fn CCV "ccv" "what"
@@ -74,6 +75,7 @@ struct cc_algo {
void(*cong_signal) (struct cc_var *ccv, uint32_t type);
void(*post_recovery) (struct cc_var *ccv);
void(*after_idle) (struct cc_var *ccv);
+   int (*ctl_output)(struct cc_var *, struct sockopt *, void *);
 };
 .Ed
 .Pp
@@ -166,6 +168,20 @@ function is called when data transfer re
 It should be implemented to adjust state as required.
 .Pp
 The
+.Va ctl_output
+function is called when
+.Xr getsockopt 2
+or
+.Xr setsockopt 2
+is called on a
+.Xr tcp 4
+socket with the

svn commit: r294542 - head/gnu/lib/libgcc

2016-01-21 Thread Ed Maste
Author: emaste
Date: Fri Jan 22 02:28:17 2016
New Revision: 294542
URL: https://svnweb.freebsd.org/changeset/base/294542

Log:
  Remove old generated unwind.h when using LLVM libunwind
  
  When not using LLVM libunwind, unwind.h is a generated header and a stale
  copy may remain in the OBJDIR after enabling LLVM libunwind. Explicitly
  remove it.
  
  Reported by:  bz
  Reviewed by:  bdrewery
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5019

Modified:
  head/gnu/lib/libgcc/Makefile

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileFri Jan 22 02:23:18 2016
(r294541)
+++ head/gnu/lib/libgcc/MakefileFri Jan 22 02:28:17 2016
(r294542)
@@ -193,7 +193,12 @@ LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS:
 .endif
 
 COMMONHDRS=tm.h tconfig.h options.h gthr-default.h
-.if ${MK_LLVM_LIBUNWIND} == no
+.if ${MK_LLVM_LIBUNWIND} != "no"
+# unwind.h is a generated file when MK_LLVM_LIBUNWIND == "no", and a stale
+# copy may be left behind in OBJDIR when switching, so remove it explicitly.
+beforebuild:
+   @rm -f ${.OBJDIR}/unwind.h
+.else
 COMMONHDRS+=   unwind.h
 .endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294540 - in head: etc/mtree include share/man/man4 share/man/man9 sys/netinet

2016-01-21 Thread hiren panchasara
On 01/22/16 at 02:07P, Gleb Smirnoff wrote:
> Author: glebius
> Date: Fri Jan 22 02:07:48 2016
> New Revision: 294540
> URL: https://svnweb.freebsd.org/changeset/base/294540
> 
> Log:
>   Provide new socket option TCP_CCALGOOPT, which stands for TCP congestion
>   control algorithm options.  The argument is variable length and is opaque
>   to TCP, forwarded directly to the algorithm's ctl_output method.
>   
>   Provide new includes directory netinet/cc, where algorithm specific
>   headers can be installed.
>   
>   The new API doesn't yet have any in tree consumers.
>   
>   The original code written by lstewart.
>   Reviewed by:rrs, emax
>   Sponsored by:   Netflix
>   Differential Revision:  https://reviews.freebsd.org/D711

Thanks Lawrence and Glebius for the patch.

I know original plan was to have this in earlier but is it possible to
still get this in 10.3 or would it be too soon?

Cheers,
Hiren


pgp8nqJzQgYoq.pgp
Description: PGP signature


Re: svn commit: r294536 - head/sys/netinet

2016-01-21 Thread Lawrence Stewart
Hi Gleb,

On 01/22/16 09:53, Gleb Smirnoff wrote:
> Author: glebius
> Date: Thu Jan 21 22:53:12 2016
> New Revision: 294536
> URL: https://svnweb.freebsd.org/changeset/base/294536
> 
> Log:
>   Refactor TCP_CONGESTION setsockopt handling:
>   - Use M_TEMP instead of stack variable.
>   - Unroll error handling, removing several levels of indentation.

As noted privately elsewhere, this change introduces races with respect
to CC algorithm module unloading which will need to be fixed. Just
mentioning it again publicly so others are aware of it.

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


Re: svn commit: r294536 - head/sys/netinet

2016-01-21 Thread NGie Cooper

> On Jan 21, 2016, at 22:19, Lawrence Stewart  wrote:
> 
> Hi Gleb,
> 
> On 01/22/16 09:53, Gleb Smirnoff wrote:
>> Author: glebius
>> Date: Thu Jan 21 22:53:12 2016
>> New Revision: 294536
>> URL: https://svnweb.freebsd.org/changeset/base/294536
>> 
>> Log:
>>  Refactor TCP_CONGESTION setsockopt handling:
>>  - Use M_TEMP instead of stack variable.
>>  - Unroll error handling, removing several levels of indentation.
> 
> As noted privately elsewhere, this change introduces races with respect
> to CC algorithm module unloading which will need to be fixed. Just
> mentioning it again publicly so others are aware of it.

That sounds like it deserves a bug...
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294554 - in head: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/libntp contrib/ntp/ntpd contrib/ntp/ntpdc contrib/ntp/ntpq contrib/ntp/ntpsnmpd contrib/ntp/scripts contr...

2016-01-21 Thread Xin LI
Author: delphij
Date: Fri Jan 22 07:32:39 2016
New Revision: 294554
URL: https://svnweb.freebsd.org/changeset/base/294554

Log:
  MFV r294491: ntp 4.2.8p6.
  
  Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975
  Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978
  Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139
  Security: CVE-2015-8140, CVE-2015-8158
  With hat: so

Added:
  head/contrib/ntp/include/ntp_keyacc.h
 - copied unchanged from r294491, vendor/ntp/dist/include/ntp_keyacc.h
  head/contrib/ntp/libntp/is_ip_address.c
 - copied unchanged from r294491, vendor/ntp/dist/libntp/is_ip_address.c
Modified:
  head/contrib/ntp/ChangeLog
  head/contrib/ntp/CommitLog
  head/contrib/ntp/NEWS
  head/contrib/ntp/configure
  head/contrib/ntp/html/miscopt.html
  head/contrib/ntp/include/Makefile.am
  head/contrib/ntp/include/Makefile.in
  head/contrib/ntp/include/ntp.h
  head/contrib/ntp/include/ntp_io.h
  head/contrib/ntp/include/ntp_stdlib.h
  head/contrib/ntp/include/ntp_types.h
  head/contrib/ntp/include/ntp_worker.h
  head/contrib/ntp/include/parse.h
  head/contrib/ntp/libntp/Makefile.am
  head/contrib/ntp/libntp/Makefile.in
  head/contrib/ntp/libntp/authkeys.c
  head/contrib/ntp/libntp/authreadkeys.c
  head/contrib/ntp/libntp/authusekey.c
  head/contrib/ntp/libntp/ntp_worker.c
  head/contrib/ntp/libntp/systime.c
  head/contrib/ntp/libntp/work_thread.c
  head/contrib/ntp/ntpd/invoke-ntp.conf.texi
  head/contrib/ntp/ntpd/invoke-ntp.keys.texi
  head/contrib/ntp/ntpd/invoke-ntpd.texi
  head/contrib/ntp/ntpd/keyword-gen-utd
  head/contrib/ntp/ntpd/keyword-gen.c
  head/contrib/ntp/ntpd/ntp.conf.5man
  head/contrib/ntp/ntpd/ntp.conf.5mdoc
  head/contrib/ntp/ntpd/ntp.conf.def
  head/contrib/ntp/ntpd/ntp.conf.html
  head/contrib/ntp/ntpd/ntp.conf.man.in
  head/contrib/ntp/ntpd/ntp.conf.mdoc.in
  head/contrib/ntp/ntpd/ntp.keys.5man
  head/contrib/ntp/ntpd/ntp.keys.5mdoc
  head/contrib/ntp/ntpd/ntp.keys.def
  head/contrib/ntp/ntpd/ntp.keys.html
  head/contrib/ntp/ntpd/ntp.keys.man.in
  head/contrib/ntp/ntpd/ntp.keys.mdoc.in
  head/contrib/ntp/ntpd/ntp_config.c
  head/contrib/ntp/ntpd/ntp_control.c
  head/contrib/ntp/ntpd/ntp_crypto.c
  head/contrib/ntp/ntpd/ntp_io.c
  head/contrib/ntp/ntpd/ntp_keyword.h
  head/contrib/ntp/ntpd/ntp_parser.c
  head/contrib/ntp/ntpd/ntp_parser.h
  head/contrib/ntp/ntpd/ntp_proto.c
  head/contrib/ntp/ntpd/ntp_request.c
  head/contrib/ntp/ntpd/ntp_scanner.c
  head/contrib/ntp/ntpd/ntp_timer.c
  head/contrib/ntp/ntpd/ntpd-opts.c
  head/contrib/ntp/ntpd/ntpd-opts.h
  head/contrib/ntp/ntpd/ntpd.1ntpdman
  head/contrib/ntp/ntpd/ntpd.1ntpdmdoc
  head/contrib/ntp/ntpd/ntpd.c
  head/contrib/ntp/ntpd/ntpd.html
  head/contrib/ntp/ntpd/ntpd.man.in
  head/contrib/ntp/ntpd/ntpd.mdoc.in
  head/contrib/ntp/ntpd/refclock_chu.c
  head/contrib/ntp/ntpd/refclock_gpsdjson.c
  head/contrib/ntp/ntpd/refclock_jjy.c
  head/contrib/ntp/ntpd/refclock_shm.c
  head/contrib/ntp/ntpdc/invoke-ntpdc.texi
  head/contrib/ntp/ntpdc/ntpdc-opts.c
  head/contrib/ntp/ntpdc/ntpdc-opts.h
  head/contrib/ntp/ntpdc/ntpdc.1ntpdcman
  head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
  head/contrib/ntp/ntpdc/ntpdc.c
  head/contrib/ntp/ntpdc/ntpdc.html
  head/contrib/ntp/ntpdc/ntpdc.man.in
  head/contrib/ntp/ntpdc/ntpdc.mdoc.in
  head/contrib/ntp/ntpq/invoke-ntpq.texi
  head/contrib/ntp/ntpq/ntpq-opts.c
  head/contrib/ntp/ntpq/ntpq-opts.h
  head/contrib/ntp/ntpq/ntpq-subs.c
  head/contrib/ntp/ntpq/ntpq.1ntpqman
  head/contrib/ntp/ntpq/ntpq.1ntpqmdoc
  head/contrib/ntp/ntpq/ntpq.c
  head/contrib/ntp/ntpq/ntpq.html
  head/contrib/ntp/ntpq/ntpq.man.in
  head/contrib/ntp/ntpq/ntpq.mdoc.in
  head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
  head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
  head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.html
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
  head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
  head/contrib/ntp/packageinfo.sh
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
  head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
  head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
  head/contrib/ntp/scripts/invoke-plot_summary.texi
  head/contrib/ntp/scripts/invoke-summary.texi
  head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
  head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.html
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
  head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
  head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
  

Re: svn commit: r294543 - head/usr.sbin/ypldap

2016-01-21 Thread Bruce Evans

On Fri, 22 Jan 2016, Marcelo Araujo wrote:


Log:
 Switch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
 tunable. Also it gets more close with the original implementation from
 OpenBSD.



Modified: head/usr.sbin/ypldap/yp.c
==
--- head/usr.sbin/ypldap/yp.c   Fri Jan 22 02:28:17 2016(r294542)
+++ head/usr.sbin/ypldap/yp.c   Fri Jan 22 03:02:38 2016(r294543)
@@ -83,17 +83,14 @@ void
yp_enable_events(void)
{
int i;
-   extern fd_set svc_fdset;
struct yp_event *ye;

-   for (i = 0; i < FD_SETSIZE; i++) {
-   if (FD_ISSET(i, _fdset)) {
-   if ((ye = calloc(1, sizeof(*ye))) == NULL)
-   fatal(NULL);
-   event_set(>ye_event, i, EV_READ, yp_fd_event, NULL);
-   event_add(>ye_event, NULL);
-   TAILQ_INSERT_TAIL(>sc_yp->yd_events, ye, ye_entry);
-   }
+   for (i = 0; i < getdtablesize(); i++) {
+   if ((ye = calloc(1, sizeof(*ye))) == NULL)
+   fatal(NULL);
+   event_set(>ye_event, i, EV_READ, yp_fd_event, NULL);
+   event_add(>ye_event, NULL);
+   TAILQ_INSERT_TAIL(>sc_yp->yd_events, ye, ye_entry);
}
}


getdtablesize() is a syscall, so evaluating it every time in the loop is
slow.  Its value must be a loop invariant to work right.  Compilers
cannot reasonably tell that syscalls return invariant values.  Maybe they
should for the standard sysconf() values, but kernels have bugs like
extra limits that break the invariants.

Only old code or very unportable code should use getdtablize().  Code
newer than 1990 should use {OPEN_MAX}.  sysconf(_SC_OPEN_MAX) is
almost as easy to use as getdtablesize() provided you don't handle
errors for either.

Old code in /usr/src provides many examples of better use of getdtablesize().
In fact, the second largest subcollection of examples was in old yp code.
In FreeBSD-~5.2:

- login/login.c: this is the simplest good use.  It uses a count-down loop
  so that the top limit is only evaluated once

- rpcgen/rpc_svcount.c: this is careful to generate good code.  It generates
  a loop like the above, but with the loop invariant moved out of the loop.

- window/wwinit.c: this assigns getdtablesize() to a global but then never
  uses the value.  This was even more broken in 4.4BSD-Lite2.
  getdtablesize() was unused but the comment on the variable said that it
  was used.  The variable was the value of the highest fd seen, and was
  unused.

  This looks like some floundering to avoid using very large values
  of the limit.  It is never right to just use the result of the
  syscall, or {OPEN_MAX}.  E.g., blindly closing {OPEN_MAX} fd's in
  daemons is bad since it might make them take hours to start up.
  {OPEN_MAX} is 706977 on freefall.

- ppp/bundle.c, ppp/chap.c, ppp/chat.c, ppp/command.c, ppp/exec.c: top-down
  loop
- ppp/defs.c: used with malloc().  With no error checking of course.

- rpc/yppasswdd/yppasswdd_main.c, rpc/ypupdate/ypupdate_main.c,
  rpc/ypxfrd/ypxfrd_main.c, ypserv/yp_main.c: bottom-up loop with
  invariant evaluated earlier

- slip/sliplogin.c bottom-up loop with invariant evaluated earlier

- sysinstall/install.c, sysinstall/network.c, sysinstall/user.c: top-down
  loop
- sysinstall/system.c: 1 bottom-up-loop with invariant evaluated earlier,
  and 1 top-down loop

- syslogd/syslogd.c: top-down loop

- libexec/ftpd.c: home made popen() that mallocs() an array of size
  getdtablesize().  This actually has some error handling

- rbootd/rbootd.c: bottom-up-loop with invariant evaluated earlier

- rexecd/rexecd.c: top-down loop

- rshd/rshd.c: top-down loop

So all the examples were not too bad, modulo the bug that the API is
broken as designed (it is OK if {OPEN_MAX} is 20 instead of 706977
even on old systems where 20 is large).

{OPEN_MAX} was surprisingly little used in *bin and libexec.  I once
tried to remove all instances of OPEN_MAX and almost succeeded
(OPEN_MAX is the wrong static limit for {OPEN_MAX} and shouldn't
exist).  The only literal matches for OPEN_MAX were 4 in gperf and
4 in compat code in cron.

Now, OPEN_MAX is sed just twice more in  *bin and libexec.  It is
used in hastd as sysconf(_SC_OPEN_MAX) since hastd is too far from
BSD style to use getdtablesie().  The style differences include
too much error handling instead of too little.

getdtablesize() is now used in much the same places as in ~5.2, except:
- rexecd, slip_login, sysinstall and window went away
- I missed uses in atm in ~5.2, and there are none there now
- I missed a use in pkg_install in ~5.2, and it went away
- a more careful grep somehow found an inconsistent set for yp*
- large changes for syslogd and login.  Without looking at the code,
  I think that these are to reduces the slowness of looking at
  thousands or millions of fd's.  

svn commit: r294546 - head/sys/boot/kshim

2016-01-21 Thread Wojciech Macek
Author: wma
Date: Fri Jan 22 06:05:31 2016
New Revision: 294546
URL: https://svnweb.freebsd.org/changeset/base/294546

Log:
  Fix compilation errors in usb/kshim
  
  Remove old header from the include list and declare extern symbol
  for delay() function.
  
  Approved by:   hselasky, cognet (mentor)
  Differential revision: https://reviews.freebsd.org/D5012

Modified:
  head/sys/boot/kshim/bsd_global.h
  head/sys/boot/kshim/bsd_kernel.h

Modified: head/sys/boot/kshim/bsd_global.h
==
--- head/sys/boot/kshim/bsd_global.hFri Jan 22 03:25:06 2016
(r294545)
+++ head/sys/boot/kshim/bsd_global.hFri Jan 22 06:05:31 2016
(r294546)
@@ -55,7 +55,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/boot/kshim/bsd_kernel.h
==
--- head/sys/boot/kshim/bsd_kernel.hFri Jan 22 03:25:06 2016
(r294545)
+++ head/sys/boot/kshim/bsd_kernel.hFri Jan 22 06:05:31 2016
(r294546)
@@ -579,4 +579,7 @@ extern int (*ofw_bus_is_compatible_cb)(d
 #definestrlcpy(d,s,n) snprintf((d),(n),"%s",(s))
 #endif
 
+/* Should be defined in user application since it is machine-dependent */
+extern int delay(unsigned int);
+
 #endif /* _BSD_KERNEL_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294549 - head/share/dtrace

2016-01-21 Thread Devin Teske
Author: dteske
Date: Fri Jan 22 07:22:30 2016
New Revision: 294549
URL: https://svnweb.freebsd.org/changeset/base/294549

Log:
  Fix bad title on script (caused by copy/paste)
  
  MFC after:3 days
  X-MFC-to: stable/10
  X-MFC-with:   r294548

Modified:
  head/share/dtrace/watch_execve

Modified: head/share/dtrace/watch_execve
==
--- head/share/dtrace/watch_execve  Fri Jan 22 07:19:30 2016
(r294548)
+++ head/share/dtrace/watch_execve  Fri Jan 22 07:22:30 2016
(r294549)
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Title: dtrace(1) script to log process(es) entering vfs::vop_remove $
+ * $Title: dtrace(1) script to log process(es) entering syscall::execve $
  * $FreeBSD$
  */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294553 - head/sys/dev/hyperv/vmbus

2016-01-21 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Jan 22 07:29:31 2016
New Revision: 294553
URL: https://svnweb.freebsd.org/changeset/base/294553

Log:
  hyperv/vmbus: Lookup channel through id table
  
  Vmbus event handler will need to find the channel by its relative
  id, when software interrupt for event happens.  The original lookup
  searches the channel list, which is not very efficient.  We now
  create a table indexed by the channel relative id to speed up
  the channel lookup.
  
  Submitted by: Hongjiang Zhang 
  Reviewed by:  delphij, adrain, sephe, Dexuan Cui 
  Approved by:  adrian (mentor)
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D4802

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hv_connection.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Jan 22 07:25:59 2016
(r294552)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Fri Jan 22 07:29:31 2016
(r294553)
@@ -271,14 +271,16 @@ vmbus_channel_process_offer(hv_vmbus_cha
boolean_t   f_new;
hv_vmbus_channel*   channel;
int ret;
+   uint32_trelid;
 
f_new = TRUE;
channel = NULL;
-
+   relid = new_channel->offer_msg.child_rel_id;
/*
 * Make sure this is a new offer
 */
mtx_lock(_vmbus_g_connection.channel_lock);
+   hv_vmbus_g_connection.channels[relid] = new_channel;
 
TAILQ_FOREACH(channel, _vmbus_g_connection.channel_anchor,
list_entry)
@@ -322,16 +324,18 @@ vmbus_channel_process_offer(hv_vmbus_cha
mtx_unlock(>sc_lock);
 
/* Insert new channel into channel_anchor. */
-   printf("Storvsc get multi-channel offer, rel=%u.\n",
-   new_channel->offer_msg.child_rel_id);   
+   printf("VMBUS get multi-channel offer, rel=%u,sub=%u\n",
+   new_channel->offer_msg.child_rel_id,
+   new_channel->offer_msg.offer.sub_channel_index);
mtx_lock(_vmbus_g_connection.channel_lock);
TAILQ_INSERT_TAIL(_vmbus_g_connection.channel_anchor,
new_channel, list_entry);   
mtx_unlock(_vmbus_g_connection.channel_lock);
 
if(bootverbose)
-   printf("VMBUS: new multi-channel offer <%p>.\n",
-   new_channel);
+   printf("VMBUS: new multi-channel offer <%p>, "
+   "its primary channel is <%p>.\n",
+   new_channel, new_channel->primary_channel);
 
/*XXX add it to percpu_list */
 
@@ -521,11 +525,14 @@ vmbus_channel_on_offer_rescind(hv_vmbus_
 
rescind = (hv_vmbus_channel_rescind_offer*) hdr;
 
-   channel = hv_vmbus_get_channel_from_rel_id(rescind->child_rel_id);
+   channel = hv_vmbus_g_connection.channels[rescind->child_rel_id];
if (channel == NULL) 
return;
 
hv_vmbus_child_device_unregister(channel->device);
+   mtx_lock(_vmbus_g_connection.channel_lock);
+   hv_vmbus_g_connection.channels[rescind->child_rel_id] = NULL;
+   mtx_unlock(_vmbus_g_connection.channel_lock);
 }
 
 /**
@@ -779,6 +786,8 @@ hv_vmbus_release_unattached_channels(voi
hv_vmbus_child_device_unregister(channel->device);
hv_vmbus_free_vmbus_channel(channel);
}
+   bzero(hv_vmbus_g_connection.channels, 
+   sizeof(hv_vmbus_channel*) * HV_CHANNEL_MAX_COUNT);
mtx_unlock(_vmbus_g_connection.channel_lock);
 }
 

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Fri Jan 22 07:25:59 2016
(r294552)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Fri Jan 22 07:29:31 2016
(r294553)
@@ -229,6 +229,9 @@ hv_vmbus_connect(void) {
goto cleanup;
}
 
+   hv_vmbus_g_connection.channels = malloc(sizeof(hv_vmbus_channel*) *
+   HV_CHANNEL_MAX_COUNT,
+   M_DEVBUF, M_WAITOK | M_ZERO);
/*
 * Find the highest vmbus version number we can support.
 */
@@ -292,6 +295,7 @@ hv_vmbus_connect(void) {
free(msg_info, M_DEVBUF);
}
 
+   free(hv_vmbus_g_connection.channels, M_DEVBUF);
return (ret);
 }
 
@@ -322,6 +326,7 @@ hv_vmbus_disconnect(void) {
hv_work_queue_close(hv_vmbus_g_connection.work_queue);

svn commit: r294547 - head/sys/boot/kshim

2016-01-21 Thread Wojciech Macek
Author: wma
Date: Fri Jan 22 06:26:11 2016
New Revision: 294547
URL: https://svnweb.freebsd.org/changeset/base/294547

Log:
  Provide busdma stubs for loader/kshim
  
  Simple bus space stubs require the VA-PA mapping
  to be identical.
  
  Approved by:   hselasky, cognet (mentor)
  Differential revision: https://reviews.freebsd.org/D4314

Modified:
  head/sys/boot/kshim/bsd_kernel.c
  head/sys/boot/kshim/bsd_kernel.h

Modified: head/sys/boot/kshim/bsd_kernel.c
==
--- head/sys/boot/kshim/bsd_kernel.cFri Jan 22 06:05:31 2016
(r294546)
+++ head/sys/boot/kshim/bsd_kernel.cFri Jan 22 06:26:11 2016
(r294547)
@@ -47,6 +47,74 @@ mtx_system_init(void *arg)
 }
 SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
 
+int
+bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
+  bus_size_t boundary, bus_addr_t lowaddr,
+  bus_addr_t highaddr, bus_dma_filter_t *filter,
+  void *filterarg, bus_size_t maxsize, int nsegments,
+  bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+  void *lockfuncarg, bus_dma_tag_t *dmat)
+{
+   struct bus_dma_tag *ret;
+
+   ret = malloc(sizeof(struct bus_dma_tag), XXX, XXX);
+   if (*dmat == NULL)
+   return (ENOMEM);
+   ret->alignment = alignment;
+   ret->maxsize = maxsize;
+
+   *dmat = ret;
+
+   return (0);
+}
+
+int
+bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
+bus_dmamap_t *mapp)
+{
+   void *addr;
+
+   addr = malloc(dmat->maxsize + dmat->alignment, XXX, XXX);
+   if (addr == 0)
+   return (ENOMEM);
+
+   *mapp = addr;
+   addr = (void*)(((uintptr_t)addr + dmat->alignment - 1) & 
~(dmat->alignment - 1));
+
+   *vaddr = addr;
+   return (0);
+}
+
+int
+bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
+bus_size_t buflen, bus_dmamap_callback_t *callback,
+void *callback_arg, int flags)
+{
+   bus_dma_segment_t segs[1];
+
+   segs[0].ds_addr = (uintptr_t)buf;
+   segs[0].ds_len = buflen;
+
+   (*callback)(callback_arg, segs, 1, 0);
+
+   return (0);
+}
+
+void
+bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
+{
+
+   free(map, XXX);
+}
+
+int
+bus_dma_tag_destroy(bus_dma_tag_t dmat)
+{
+
+   free(dmat, XXX);
+   return (0);
+}
+
 struct resource *
 bus_alloc_resource_any(device_t dev, int type, int *rid, unsigned int flags)
 {

Modified: head/sys/boot/kshim/bsd_kernel.h
==
--- head/sys/boot/kshim/bsd_kernel.hFri Jan 22 06:05:31 2016
(r294546)
+++ head/sys/boot/kshim/bsd_kernel.hFri Jan 22 06:26:11 2016
(r294547)
@@ -48,8 +48,15 @@
 #defineUSB_BUS_EXPLORE_PROC(bus) (usb_process + 0)
 #defineUSB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1)
 #defineSYSCTL_DECL(...)
+struct sysctl_req {
+   void*newptr;
+};
+#defineSYSCTL_HANDLER_ARGS void *oidp, void *arg1, \
+   uint32_t arg2, struct sysctl_req *req
 #defineSYSCTL_NODE(name,...) struct { } name __used
 #defineSYSCTL_INT(...)
+#defineSYSCTL_UINT(...)
+#defineSYSCTL_PROC(...)
 #defineTUNABLE_INT(...)
 #defineMALLOC_DECLARE(...)
 #defineMALLOC_DEFINE(...)
@@ -65,6 +72,7 @@
 #defineMOD_UNLOAD 2
 #defineDEVMETHOD(what,func) { #what, (void *) }
 #defineDEVMETHOD_END {0,0}
+#defineEARLY_DRIVER_MODULE(a, b, c, d, e, f, g)
DRIVER_MODULE(a, b, c, d, e, f)
 #defineDRIVER_MODULE(name, busname, driver, devclass, evh, arg)
\
   static struct module_data bsd_##name##_##busname##_driver_mod = {\
evh, arg, #busname, #name, #busname "/" #name,  \
@@ -202,11 +210,30 @@ typedef unsigned long u_long;
 typedef unsigned long bus_addr_t;
 typedef unsigned long bus_size_t;
 
+typedef struct bus_dma_segment {
+   bus_addr_t  ds_addr;/* DMA address */
+   bus_size_t  ds_len; /* length of transfer */
+} bus_dma_segment_t;
+
+struct bus_dma_tag {
+   uint32_talignment;
+   uint32_tmaxsize;
+};
+
 typedef void *bus_dmamap_t;
-typedef void *bus_dma_tag_t;
+typedef struct bus_dma_tag *bus_dma_tag_t;
+
+typedef enum {
+   BUS_DMA_LOCK= 0x01,
+   BUS_DMA_UNLOCK  = 0x02,
+} bus_dma_lock_op_t;
 
 typedef void *bus_space_tag_t;
 typedef uint8_t *bus_space_handle_t;
+typedef int bus_dma_filter_t(void *, bus_addr_t);
+typedef void bus_dma_lock_t(void *, bus_dma_lock_op_t);
+
+typedef uint32_t bool;
 
 /* SYSINIT API */
 
@@ -582,4 +609,37 @@ extern int (*ofw_bus_is_compatible_cb)(d
 /* Should be defined in user application since it is machine-dependent */
 extern int delay(unsigned int);
 
+/* BUS dma */

svn commit: r294548 - head/share/dtrace

2016-01-21 Thread Devin Teske
Author: dteske
Date: Fri Jan 22 07:19:30 2016
New Revision: 294548
URL: https://svnweb.freebsd.org/changeset/base/294548

Log:
  Add scripts for watching common entry points.
  
  MFC after:3 days
  X-MFC-to: stable/10

Added:
  head/share/dtrace/watch_execve   (contents, props changed)
  head/share/dtrace/watch_kill   (contents, props changed)
  head/share/dtrace/watch_vop_remove   (contents, props changed)
Modified:
  head/share/dtrace/Makefile

Modified: head/share/dtrace/Makefile
==
--- head/share/dtrace/Makefile  Fri Jan 22 06:26:11 2016(r294547)
+++ head/share/dtrace/Makefile  Fri Jan 22 07:19:30 2016(r294548)
@@ -22,7 +22,10 @@ SCRIPTS= blocking \
tcpconn \
tcpstate \
tcptrack \
-   udptrack
+   udptrack \
+   watch_execve \
+   watch_kill \
+   watch_vop_remove
 
 SCRIPTSDIR= ${SHAREDIR}/dtrace
 

Added: head/share/dtrace/watch_execve
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/dtrace/watch_execve  Fri Jan 22 07:19:30 2016
(r294548)
@@ -0,0 +1,227 @@
+#!/usr/sbin/dtrace -s
+/* -
+ * Copyright (c) 2014 Devin Teske 
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Title: dtrace(1) script to log process(es) entering vfs::vop_remove $
+ * $FreeBSD$
+ */
+
+#pragma D option quiet
+#pragma D option dynvarsize=16m
+#pragma D option switchrate=10hz
+
+/*/
+
+syscall::execve:entry /* probe ID 1 */
+{
+   this->caller_execname = execname;
+}
+
+/*/
+
+syscall::execve:return /execname != this->caller_execname/ /* probe ID 2 */
+{
+   /*
+* Examine process, parent process, and grandparent process details
+*/
+
+   /*** CURPROC ***/
+
+   this->proc = curthread->td_proc;
+   this->pid0 = this->proc->p_pid;
+   this->uid0 = this->proc->p_ucred->cr_uid;
+   this->gid0 = this->proc->p_ucred->cr_rgid;
+   this->p_args = this->proc->p_args;
+   this->ar_length = this->p_args ? this->p_args->ar_length : 0;
+   this->ar_args = (char *)(this->p_args ? this->p_args->ar_args : 0);
+
+   this->arg0_0 = this->ar_length > 0 ?
+   this->ar_args : stringof(this->proc->p_comm);
+   this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0;
+   this->ar_args += this->len;
+   this->ar_length -= this->len;
+
+   this->arg0_1 = this->ar_length > 0 ? this->ar_args : "";
+   this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0;
+   this->ar_args += this->len;
+   this->ar_length -= this->len;
+
+   this->arg0_2 = this->ar_length > 0 ? this->ar_args : "";
+   this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0;
+   this->ar_args += this->len;
+   this->ar_length -= this->len;
+
+   this->arg0_3 = this->ar_length > 0 ? this->ar_args : "";
+   this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0;
+   this->ar_args += this->len;
+   this->ar_length -= this->len;
+
+   this->arg0_4 = this->ar_length > 0 ? "..." : "";
+
+   /*** PPARENT ***/
+
+   this->proc = this->proc->p_pptr;
+   this->pid1 = this->proc->p_pid;
+   this->uid1 = this->proc->p_ucred->cr_uid;
+   this->gid1 = this->proc->p_ucred->cr_rgid;
+   this->p_args = this->proc ? 

Re: svn commit: r294535 - in head/sys/netinet: . cc tcp_stacks

2016-01-21 Thread Lawrence Stewart
Hi Gleb,

On 01/22/16 09:34, Gleb Smirnoff wrote:
> Author: glebius
> Date: Thu Jan 21 22:34:51 2016
> New Revision: 294535
> URL: https://svnweb.freebsd.org/changeset/base/294535
> 
> Log:
>   - Rename cc.h to more meaningful tcp_cc.h.

As a bit of historical context, the naming was intentionally protocol
agnostic because it was originally hoped that the CC framework could be
shared between multiple CC aware transports, and the design went to some
lengths to accommodate that possibility (e.g. the ccv_container union in
struct cc_var). SCTP was the obvious potential in tree consumer at the
time, and other protocols like DCCP were considered as well.

This hasn't come about to date, but I'm not sure what value is obtained
from your rename change unless we decide to completely give up on shared
CC and if we do that, this change doesn't go far enough and we can
further simplify the framework to make it entirely TCP specific e.g. we
should probably do away with struct cc_var.

I'd argue in favour of reverting the rename and if you're gung ho about
making the framework TCP specific, we can start a public discussion
about what that should look like.

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