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

2016-01-22 Thread George Neville-Neil



On 22 Jan 2016, at 2:13, Lawrence Stewart wrote:


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.



I actually was wondering about this as well.  I think it ought to be 
reverted to agnostic.


Best,
George
___
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: r294595 - head/sys/fs/devfs

2016-01-22 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 22 20:30:51 2016
New Revision: 294595
URL: https://svnweb.freebsd.org/changeset/base/294595

Log:
  When devfs dirent is freed, a vnode might still keep a pointer to it,
  apparently.  Interlock and clear the pointer to avoid free memory
  dereference.
  
  Submitted by: bde (previous version)
  MFC after:3 weeks

Modified:
  head/sys/fs/devfs/devfs_devs.c

Modified: head/sys/fs/devfs/devfs_devs.c
==
--- head/sys/fs/devfs/devfs_devs.c  Fri Jan 22 20:28:24 2016
(r294594)
+++ head/sys/fs/devfs/devfs_devs.c  Fri Jan 22 20:30:51 2016
(r294595)
@@ -304,6 +304,13 @@ devfs_vmkdir(struct devfs_mount *dmp, ch
 void
 devfs_dirent_free(struct devfs_dirent *de)
 {
+   struct vnode *vp;
+
+   vp = de->de_vnode;
+   mtx_lock(_de_interlock);
+   if (vp != NULL && vp->v_data == de)
+   vp->v_data = NULL;
+   mtx_unlock(_de_interlock);
free(de, M_DEVFS3);
 }
 
___
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: r294600 - head/tools/tools/ath/ath_ee_v4k_print

2016-01-22 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Jan 22 20:53:50 2016
New Revision: 294600
URL: https://svnweb.freebsd.org/changeset/base/294600

Log:
  tools/tools/ath/ath_ee_v4k_print: reflect changes from r220589
  
  Fix printf() arguments + sort includes
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4045

Modified:
  head/tools/tools/ath/ath_ee_v4k_print/v4k.c

Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c
==
--- head/tools/tools/ath/ath_ee_v4k_print/v4k.c Fri Jan 22 20:41:56 2016
(r294599)
+++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c Fri Jan 22 20:53:50 2016
(r294600)
@@ -26,12 +26,13 @@
  * $FreeBSD$
  */
 
+#include 
+
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
-#include 
+#include 
 
 typedef enum {
 AH_FALSE = 0,   /* NB: lots of code assumes false is zero */
@@ -128,12 +129,10 @@ eeprom_v4k_modal_print(uint16_t *buf)
 
printf("| Modal Version: %.2x |\n", mh->version);
 
-   printf("| futureModal: 0x%.2x 0x%.2x 0x%.2x 0x%.2x |\n",
-   mh->futureModal[0],
-   mh->futureModal[1],
-   mh->futureModal[2],
-   mh->futureModal[3]
-   );
+   printf("| tx_diversity: 0x%.2x |\n", mh->tx_diversity);
+   printf("| flc_pwr_thresh: 0x%.2x |\n", mh->flc_pwr_thresh);
+   printf("| bb_scale_smrt_antenna: 0x%.2x |\n", 
mh->bb_scale_smrt_antenna);
+   printf("| futureModal: 0x%.2x |\n", mh->futureModal[0]);
 
/* and now, spur channels */
for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
___
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-22 Thread Bryan Drewery
On 1/22/2016 1:56 PM, Dag-Erling Smørgrav wrote:
> Bryan Drewery  writes:
>> I've used these in sshd_config and ssh_config to restore some removed
>> functionality:
>>
>> Ciphers +blowfish-cbc,arcfour,aes128-cbc,3des-cbc
>> KexAlgorithms +diffie-hellman-group1-sha1
> 
> Do you actually need these?  Do you know of any clients or servers which
> do not support any of the other ciphers and key exchange algorithms
> which OpenSSH offers?
> 
>> PubkeyAcceptedKeyTypes +ssh-dss,ssh-dss-cert-...@openssh.com
>> HostkeyAlgorithms +ssh-dss,ssh-dss-cert-...@openssh.com
> 
> These are already enabled.
> 

Right. I was suggesting an alternative method to modifying these
upstream files and providing deprecated and potentially insecure
functionality by default.


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r294594 - head/sys/dev/pty

2016-01-22 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 22 20:28:24 2016
New Revision: 294594
URL: https://svnweb.freebsd.org/changeset/base/294594

Log:
  Remove printf only useful for debugging.
  
  Requested by: bde
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks

Modified:
  head/sys/dev/pty/pty.c

Modified: head/sys/dev/pty/pty.c
==
--- head/sys/dev/pty/pty.c  Fri Jan 22 20:10:08 2016(r294593)
+++ head/sys/dev/pty/pty.c  Fri Jan 22 20:28:24 2016(r294594)
@@ -126,10 +126,8 @@ pty_clone(void *arg, struct ucred *cr, c
mda.mda_gid = GID_WHEEL;
mda.mda_mode = 0666;
error = make_dev_s(, dev, "%s", name);
-   if (error != 0) {
-   printf("pty_clone: failed to create %s: %d\n", name, error);
+   if (error != 0)
*dev = NULL;
-   }
 }
 
 static int
___
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: r294598 - head/sys/kern

2016-01-22 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 22 20:38:46 2016
New Revision: 294598
URL: https://svnweb.freebsd.org/changeset/base/294598

Log:
  In tty_dealloc(), clear the queues.  See the comment for a scenario
  which explains why ttydev_leave() cleanup might not happen.
  
  Submitted by: bde
  MFC after:3 weeks

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Fri Jan 22 20:36:03 2016(r294597)
+++ head/sys/kern/tty.c Fri Jan 22 20:38:46 2016(r294598)
@@ -213,7 +213,7 @@ ttydev_leave(struct tty *tp)
 
ttydisc_close(tp);
 
-   /* Destroy associated buffers already. */
+   /* Free i/o queues now since they might be large. */
ttyinq_free(>t_inq);
tp->t_inlow = 0;
ttyoutq_free(>t_outq);
@@ -1031,10 +1031,15 @@ tty_dealloc(void *arg)
 {
struct tty *tp = arg;
 
-   /* Make sure we haven't leaked buffers. */
-   MPASS(ttyinq_getsize(>t_inq) == 0);
-   MPASS(ttyoutq_getsize(>t_outq) == 0);
-
+   /*
+* ttyydev_leave() usually frees the i/o queues earlier, but it is
+* not always called between queue allocation and here.  The queues
+* may be allocated by ioctls on a pty control device without the
+* corresponding pty slave device ever being open, or after it is
+* closed.
+*/
+   ttyinq_free(>t_inq);
+   ttyoutq_free(>t_outq);
seldrain(>t_inpoll);
seldrain(>t_outpoll);
knlist_destroy(>t_inpoll.si_note);
___
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: r294593 - in head/bin/sh: . tests/builtins

2016-01-22 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 22 20:10:08 2016
New Revision: 294593
URL: https://svnweb.freebsd.org/changeset/base/294593

Log:
  sh: Clean a readonly local, even if the variable does not exist outside.
  
  If a local variable has been made read-only, this should not prevent its
  removal when the function returns.

Added:
  head/bin/sh/tests/builtins/local7.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile
  head/bin/sh/var.c

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Fri Jan 22 19:43:26 2016
(r294592)
+++ head/bin/sh/tests/builtins/Makefile Fri Jan 22 20:10:08 2016
(r294593)
@@ -113,6 +113,7 @@ FILES+= local3.0
 FILES+=local4.0
 FILES+=local5.0
 FILES+=local6.0
+FILES+=local7.0
 .if ${MK_NLS} != "no"
 FILES+=locale1.0
 .endif

Added: head/bin/sh/tests/builtins/local7.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/local7.0 Fri Jan 22 20:10:08 2016
(r294593)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+f() {
+   local x
+   readonly x=2
+}
+unset x
+f
+x=4
+[ "$x" = 4 ]

Modified: head/bin/sh/var.c
==
--- head/bin/sh/var.c   Fri Jan 22 19:43:26 2016(r294592)
+++ head/bin/sh/var.c   Fri Jan 22 20:10:08 2016(r294593)
@@ -802,6 +802,7 @@ poplocalvars(void)
ckfree(lvp->text);
optschanged();
} else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) {
+   vp->flags &= ~VREADONLY;
(void)unsetvar(vp->text);
} else {
islocalevar = (vp->flags | lvp->flags) & VEXPORT &&
___
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: r294596 - head/sys/kern

2016-01-22 Thread Konstantin Belousov
Author: kib
Date: Fri Jan 22 20:35:20 2016
New Revision: 294596
URL: https://svnweb.freebsd.org/changeset/base/294596

Log:
  The struct file f_advice member is overlaid with the devfs f_cdevpriv
  data.  If vnode bypass for devfs file failed, vn_read/vn_write are
  called and might try to dereference f_advice.  Limit the accesses to
  f_advice to VREG vnodes only, which is the type ensured by
  posix_fadvise().
  
  The f_advice for regular files is protected by mtxpool lock.  Recheck
  that f_advice is not NULL after lock is taken.
  
  Reported and tested by:   bde
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Fri Jan 22 20:30:51 2016(r294595)
+++ head/sys/kern/vfs_vnops.c   Fri Jan 22 20:35:20 2016(r294596)
@@ -743,12 +743,13 @@ get_advice(struct file *fp, struct uio *
int ret;
 
ret = POSIX_FADV_NORMAL;
-   if (fp->f_advice == NULL)
+   if (fp->f_advice == NULL || fp->f_vnode->v_type != VREG)
return (ret);
 
mtxp = mtx_pool_find(mtxpool_sleep, fp);
mtx_lock(mtxp);
-   if (uio->uio_offset >= fp->f_advice->fa_start &&
+   if (fp->f_advice != NULL &&
+   uio->uio_offset >= fp->f_advice->fa_start &&
uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
ret = fp->f_advice->fa_advice;
mtx_unlock(mtxp);
___
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: r294597 - head/lib/libc/string

2016-01-22 Thread Warren Block
Author: wblock (doc committer)
Date: Fri Jan 22 20:36:03 2016
New Revision: 294597
URL: https://svnweb.freebsd.org/changeset/base/294597

Log:
  Add a standards compliance note for strtok_r as suggested by cpercival.
  
  Reviewed by:  cpercival
  MFC after:1 week

Modified:
  head/lib/libc/string/strtok.3

Modified: head/lib/libc/string/strtok.3
==
--- head/lib/libc/string/strtok.3   Fri Jan 22 20:35:20 2016
(r294596)
+++ head/lib/libc/string/strtok.3   Fri Jan 22 20:36:03 2016
(r294597)
@@ -44,7 +44,7 @@
 .\" @(#)strtok.3   8.2 (Berkeley) 2/3/94
 .\" $FreeBSD$
 .\"
-.Dd November 27, 1998
+.Dd January 22, 2016
 .Dt STRTOK 3
 .Os
 .Sh NAME
@@ -149,6 +149,11 @@ The
 function
 conforms to
 .St -isoC .
+The
+.Fn strtok_r
+function
+conforms to
+.St -p1003.1-2001 .
 .Sh AUTHORS
 .An Wes Peters Aq Mt w...@softweyr.com ,
 Softweyr LLC
___
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: r294608 - in head: gnu/lib/libreadline/readline lib/libelftc sys/boot/usb/tools

2016-01-22 Thread Ed Maste
Author: emaste
Date: Fri Jan 22 21:33:27 2016
New Revision: 294608
URL: https://svnweb.freebsd.org/changeset/base/294608

Log:
  Use MAN= to specify that no man page is provided
  
  NO_MAN is deprecated.
  
  Reviewed by:  imp

Modified:
  head/gnu/lib/libreadline/readline/Makefile
  head/lib/libelftc/Makefile
  head/sys/boot/usb/tools/Makefile

Modified: head/gnu/lib/libreadline/readline/Makefile
==
--- head/gnu/lib/libreadline/readline/Makefile  Fri Jan 22 21:18:25 2016
(r294607)
+++ head/gnu/lib/libreadline/readline/Makefile  Fri Jan 22 21:33:27 2016
(r294608)
@@ -2,7 +2,7 @@
 
 LIB=readline
 INTERNALLIB=   yes
-NO_MAN=yes
+MAN=
 
 TILDESRC= tilde.c
 SRCS= readline.c vi_mode.c funmap.c keymaps.c parens.c search.c \

Modified: head/lib/libelftc/Makefile
==
--- head/lib/libelftc/Makefile  Fri Jan 22 21:18:25 2016(r294607)
+++ head/lib/libelftc/Makefile  Fri Jan 22 21:33:27 2016(r294608)
@@ -25,6 +25,6 @@ SRCS= elftc_bfdtarget.c 
 INCS=  libelftc.h
 CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
 
-NO_MAN=yes
+MAN=
 
 .include 

Modified: head/sys/boot/usb/tools/Makefile
==
--- head/sys/boot/usb/tools/MakefileFri Jan 22 21:18:25 2016
(r294607)
+++ head/sys/boot/usb/tools/MakefileFri Jan 22 21:33:27 2016
(r294608)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PROG=  sysinit
-NO_MAN=
+MAN=
 
 CFLAGS+=   -I${.CURDIR}/../../kshim
 
___
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-22 Thread Bryan Drewery
On 1/22/2016 1:37 AM, Dag-Erling Smørgrav wrote:
> Conrad Meyer  writes:
>> Are we going to maintain DSA key support after upstream deprecates it
>> entirely?  And why?
> 
> I am not aware of any plans to remove DSA support.  It has simply been
> disabled in the default run-time configuration - unlike, for instance,
> libwrap, which was removed entirely, and SSHv1, which needs to be
> enabled at compile time.  I understand that decision (although I
> disagree with their justification, or at least the way it was worded),
> but we still have users who use DSA keys and who will be locked out of
> their systems if we disable DSA without sufficient advance warning.  I
> will look into what steps can be taken to deprecate DSA without causing
> our users too much inconvenience.
> 
> DES
> 

I've used these in sshd_config and ssh_config to restore some removed
functionality:

Ciphers +blowfish-cbc,arcfour,aes128-cbc,3des-cbc
KexAlgorithms +diffie-hellman-group1-sha1
PubkeyAcceptedKeyTypes +ssh-dss,ssh-dss-cert-...@openssh.com
HostkeyAlgorithms +ssh-dss,ssh-dss-cert-...@openssh.com

Maintaining these in the default config would be simpler and allow users
to more easily remove them, but not give them a working upgrade. I'm not
sure if these support '-' to disable them. On the otherhand we can just
put these lines in the release notes and UPDATING so we are
secure-by-default.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


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

2016-01-22 Thread Dag-Erling Smørgrav
Bryan Drewery  writes:
> I've used these in sshd_config and ssh_config to restore some removed
> functionality:
>
> Ciphers +blowfish-cbc,arcfour,aes128-cbc,3des-cbc
> KexAlgorithms +diffie-hellman-group1-sha1

Do you actually need these?  Do you know of any clients or servers which
do not support any of the other ciphers and key exchange algorithms
which OpenSSH offers?

> PubkeyAcceptedKeyTypes +ssh-dss,ssh-dss-cert-...@openssh.com
> HostkeyAlgorithms +ssh-dss,ssh-dss-cert-...@openssh.com

These are already enabled.

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

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

In the code checked in the check for (CC_ALGO(tp)->ctl_output being
not NULL and the actual call are under the same lock.

Is that the race you refer to?

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

2016-01-22 Thread Gleb Smirnoff
On Fri, Jan 22, 2016 at 06:13:54PM +1100, Lawrence Stewart wrote:
L> On 01/22/16 09:34, Gleb Smirnoff wrote:
L> > Author: glebius
L> > Date: Thu Jan 21 22:34:51 2016
L> > New Revision: 294535
L> > URL: https://svnweb.freebsd.org/changeset/base/294535
L> > 
L> > Log:
L> >   - Rename cc.h to more meaningful tcp_cc.h.
L> 
L> As a bit of historical context, the naming was intentionally protocol
L> agnostic because it was originally hoped that the CC framework could be
L> shared between multiple CC aware transports, and the design went to some
L> lengths to accommodate that possibility (e.g. the ccv_container union in
L> struct cc_var). SCTP was the obvious potential in tree consumer at the
L> time, and other protocols like DCCP were considered as well.
L> 
L> This hasn't come about to date, but I'm not sure what value is obtained
L> from your rename change unless we decide to completely give up on shared
L> CC and if we do that, this change doesn't go far enough and we can
L> further simplify the framework to make it entirely TCP specific e.g. we
L> should probably do away with struct cc_var.
L> 
L> I'd argue in favour of reverting the rename and if you're gung ho about
L> making the framework TCP specific, we can start a public discussion
L> about what that should look like.

The problem is that cc.h (or tcp_cc.h) is already depening on many
TCP types. So, the structures defined inside are not agnostic, including
tcp headers before cc.h is required.

The old cc.h used to include tcp.h implicitly, which is a bad style.

Since many developers sorted netinet/* includes in a .c file using
sort(1), that lead to cc.h always come before actual tcp includes,
hiding the real requirement for tcp.h in a .c file.

P.S. Speaking of agnostic stuff. My humble opinion, that in the
network stack through the whole BSD history agnosticism never yield
in virtue. Examples: routing code can be used for IPv4, IPv6, Atalk
and IPX. Result is that Atalk and IPX are history, but our routing
table uses 8x more memory for IPv4 and performs miserably. Another
example is the same sockbuf used for all types of sockets, including
stream, datagram, local and network, which first yielded in quite
complex code for a quite trivial task, and later then, when SCTP
came in failed to be agnostic enough to fit into SCTP.

-- 
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: r294562 - head/sys/dev/fdt

2016-01-22 Thread Ian Lepore
On Fri, 2016-01-22 at 10:26 -0800, Adrian Chadd wrote:
> ... we're about to start using FDT on MIPS, so .. ?
> 
> 
> -a
> 

But mips will be using intrng from the outset, only the arm platforms
that don't yet use intrng need fdt_pic_table.

-- Ian

> 
> On 22 January 2016 at 05:09, Andrew Turner 
> wrote:
> > Author: andrew
> > Date: Fri Jan 22 13:09:43 2016
> > New Revision: 294562
> > URL: https://svnweb.freebsd.org/changeset/base/294562
> > 
> > Log:
> >   Only define fdt_pic_table on arm, and when not using intrng as
> > this is
> >   the only place that uses it.
> > 
> > Modified:
> >   head/sys/dev/fdt/fdt_common.h
> > 
> > Modified: head/sys/dev/fdt/fdt_common.h
> > ===
> > ===
> > --- head/sys/dev/fdt/fdt_common.h   Fri Jan 22 12:51:12 2016   
> >  (r294561)
> > +++ head/sys/dev/fdt/fdt_common.h   Fri Jan 22 13:09:43 2016   
> >  (r294562)
> > @@ -45,8 +45,10 @@ struct fdt_sense_level {
> > enum intr_polarity  pol;
> >  };
> > 
> > +#if defined(__arm__) && !defined(ARM_INTRNG)
> >  typedef int (*fdt_pic_decode_t)(phandle_t, pcell_t *, int *, int
> > *, int *);
> >  extern fdt_pic_decode_t fdt_pic_table[];
> > +#endif
> > 
> >  #if defined(__arm__) || defined(__powerpc__)
> >  typedef void (*fdt_fixup_t)(phandle_t);
> > 
> 
___
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: r294591 - head/usr.bin/whois

2016-01-22 Thread Tony Finch
Author: fanf
Date: Fri Jan 22 19:06:43 2016
New Revision: 294591
URL: https://svnweb.freebsd.org/changeset/base/294591

Log:
  Update whois synopsis and usage with new options

Modified:
  head/usr.bin/whois/whois.1
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.1
==
--- head/usr.bin/whois/whois.1  Fri Jan 22 19:03:39 2016(r294590)
+++ head/usr.bin/whois/whois.1  Fri Jan 22 19:06:43 2016(r294591)
@@ -36,7 +36,7 @@
 .Nd "Internet domain name and network number directory service"
 .Sh SYNOPSIS
 .Nm
-.Op Fl aAbfgiIklmPQr
+.Op Fl aAbfgiIklmPQrRS
 .Op Fl c Ar country-code | Fl h Ar host
 .Op Fl p Ar port
 .Ar name ...

Modified: head/usr.bin/whois/whois.c
==
--- head/usr.bin/whois/whois.c  Fri Jan 22 19:03:39 2016(r294590)
+++ head/usr.bin/whois/whois.c  Fri Jan 22 19:06:43 2016(r294591)
@@ -523,7 +523,7 @@ static void
 usage(void)
 {
fprintf(stderr,
-   "usage: whois [-aAbfgiIklmPQr] [-c country-code | -h hostname] "
+   "usage: whois [-aAbfgiIklmPQrRS] [-c country-code | -h hostname] "
"[-p port] name ...\n");
exit(EX_USAGE);
 }
___
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: r294582 - head/bin/sh/tests/builtins

2016-01-22 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 22 18:10:36 2016
New Revision: 294582
URL: https://svnweb.freebsd.org/changeset/base/294582

Log:
  sh: Add already working test for local-readonly interaction.

Added:
  head/bin/sh/tests/builtins/local6.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Fri Jan 22 18:09:25 2016
(r294581)
+++ head/bin/sh/tests/builtins/Makefile Fri Jan 22 18:10:36 2016
(r294582)
@@ -112,6 +112,7 @@ FILES+= local2.0
 FILES+=local3.0
 FILES+=local4.0
 FILES+=local5.0
+FILES+=local6.0
 .if ${MK_NLS} != "no"
 FILES+=locale1.0
 .endif

Added: head/bin/sh/tests/builtins/local6.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/local6.0 Fri Jan 22 18:10:36 2016
(r294582)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+f() {
+   local x
+   readonly x=2
+}
+x=3
+f
+x=4
+[ "$x" = 4 ]
___
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: r294562 - head/sys/dev/fdt

2016-01-22 Thread Adrian Chadd
... we're about to start using FDT on MIPS, so .. ?


-a


On 22 January 2016 at 05:09, Andrew Turner  wrote:
> Author: andrew
> Date: Fri Jan 22 13:09:43 2016
> New Revision: 294562
> URL: https://svnweb.freebsd.org/changeset/base/294562
>
> Log:
>   Only define fdt_pic_table on arm, and when not using intrng as this is
>   the only place that uses it.
>
> Modified:
>   head/sys/dev/fdt/fdt_common.h
>
> Modified: head/sys/dev/fdt/fdt_common.h
> ==
> --- head/sys/dev/fdt/fdt_common.h   Fri Jan 22 12:51:12 2016
> (r294561)
> +++ head/sys/dev/fdt/fdt_common.h   Fri Jan 22 13:09:43 2016
> (r294562)
> @@ -45,8 +45,10 @@ struct fdt_sense_level {
> enum intr_polarity  pol;
>  };
>
> +#if defined(__arm__) && !defined(ARM_INTRNG)
>  typedef int (*fdt_pic_decode_t)(phandle_t, pcell_t *, int *, int *, int *);
>  extern fdt_pic_decode_t fdt_pic_table[];
> +#endif
>
>  #if defined(__arm__) || defined(__powerpc__)
>  typedef void (*fdt_fixup_t)(phandle_t);
>
___
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: r294590 - head/gnu/lib/libgcc

2016-01-22 Thread Ed Maste
Author: emaste
Date: Fri Jan 22 19:03:39 2016
New Revision: 294590
URL: https://svnweb.freebsd.org/changeset/base/294590

Log:
  Restore libunwind.cpp to LLVM libunwind build (reverts r294576)
  
  The unw_* functions are not exported, but are used internally.

Modified:
  head/gnu/lib/libgcc/Makefile

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileFri Jan 22 18:39:23 2016
(r294589)
+++ head/gnu/lib/libgcc/MakefileFri Jan 22 19:03:39 2016
(r294590)
@@ -81,7 +81,8 @@ LIB2ADDEH = gcc_personality_v0.c \
UnwindLevel1-gcc-ext.c \
UnwindLevel1.c \
UnwindRegistersRestore.S \
-   UnwindRegistersSave.S
+   UnwindRegistersSave.S \
+   libunwind.cpp
 
 CFLAGS+=   -I${UNWINDINCDIR} -I${.CURDIR}
 .if empty(CXXFLAGS:M-std=*)
___
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: r294556 - head/share/dtrace

2016-01-22 Thread Devin Teske
Author: dteske
Date: Fri Jan 22 08:29:23 2016
New Revision: 294556
URL: https://svnweb.freebsd.org/changeset/base/294556

Log:
  Switch to syscall; HEAD lacks fbt for kill(2)
  
  MFC after:3 days
  X-MFC-to: stable/10
  X-MFC-with:   294548

Modified:
  head/share/dtrace/watch_kill

Modified: head/share/dtrace/watch_kill
==
--- head/share/dtrace/watch_killFri Jan 22 07:35:10 2016
(r294555)
+++ head/share/dtrace/watch_killFri Jan 22 08:29:23 2016
(r294556)
@@ -40,11 +40,10 @@ syscall::execve:entry /* probe ID 1 */
 
 /*/
 
-fbt::kill:entry /* probe ID 2 */
+syscall::kill:entry /* probe ID 2 */
 {
-   this->kill_args = (struct kill_args *)arg1;
-   this->pid_to_kill = this->kill_args->pid;
-   this->kill_signal = this->kill_args->signum;
+   this->pid_to_kill = (pid_t)arg0;
+   this->kill_signal = (int)arg1;
 
/*
 * Examine process, parent process, and grandparent process details
___
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: r294557 - head/sys/dev/hyperv/storvsc

2016-01-22 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Jan 22 09:06:40 2016
New Revision: 294557
URL: https://svnweb.freebsd.org/changeset/base/294557

Log:
  hyperv/stor: Verify returned inquiry data before further dispatching
  
  Windows 10 and Window 2016 will return all zero inquiry data for
  non-existing slots.  If we dispatched them, then a lot of useless
  (0 sized) disks would be created.  So we verify the returned inquiry
  data (valid type, non-empty vendor/product/revision etc.), before
  further dispatching.
  
  Minor white space cleanup and wording fix.
  
  Submitted by: Hongjiang Zhang 
  Reviewed by:  adrian, sephe, Jun Su 
  Approved by:  adrian (mentor)
  Modified by:  sephe
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D4928

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cFri Jan 22 
08:29:23 2016(r294556)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cFri Jan 22 
09:06:40 2016(r294557)
@@ -1923,6 +1923,66 @@ create_storvsc_request(union ccb *ccb, s
return(0);
 }
 
+/*
+ * Modified based on scsi_print_inquiry which is responsible to
+ * print the detail information for scsi_inquiry_data.
+ *
+ * Return 1 if it is valid, 0 otherwise.
+ */
+static inline int
+is_inquiry_valid(const struct scsi_inquiry_data *inq_data)
+{
+   uint8_t type;
+   char vendor[16], product[48], revision[16];
+
+   /*
+* Check device type and qualifier
+*/
+   if (!(SID_QUAL_IS_VENDOR_UNIQUE(inq_data) ||
+   SID_QUAL(inq_data) == SID_QUAL_LU_CONNECTED))
+   return (0);
+
+   type = SID_TYPE(inq_data);
+   switch (type) {
+   case T_DIRECT:
+   case T_SEQUENTIAL:
+   case T_PRINTER:
+   case T_PROCESSOR:
+   case T_WORM:
+   case T_CDROM:
+   case T_SCANNER:
+   case T_OPTICAL:
+   case T_CHANGER:
+   case T_COMM:
+   case T_STORARRAY:
+   case T_ENCLOSURE:
+   case T_RBC:
+   case T_OCRW:
+   case T_OSD:
+   case T_ADC:
+   break;
+   case T_NODEVICE:
+   default:
+   return (0);
+   }
+
+   /*
+* Check vendor, product, and revision
+*/
+   cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor),
+   sizeof(vendor));
+   cam_strvis(product, inq_data->product, sizeof(inq_data->product),
+   sizeof(product));
+   cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision),
+   sizeof(revision));
+   if (strlen(vendor) == 0  ||
+   strlen(product) == 0 ||
+   strlen(revision) == 0)
+   return (0);
+
+   return (1);
+}
+
 /**
  * @brief completion function before returning to CAM
  *
@@ -1993,11 +2053,33 @@ storvsc_io_done(struct hv_storvsc_reques
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
if (vm_srb->scsi_status == SCSI_STATUS_OK) {
-   ccb->ccb_h.status |= CAM_REQ_CMP;
-} else {
+   const struct scsi_generic *cmd;
+
+   /*
+* Check whether the data for INQUIRY cmd is valid or
+* not.  Windows 10 and Windows 2016 send all zero
+* inquiry data to VM even for unpopulated slots.
+*/
+   cmd = (const struct scsi_generic *)
+   ((ccb->ccb_h.flags & CAM_CDB_POINTER) ?
+csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes);
+   if (cmd->opcode == INQUIRY &&
+   is_inquiry_valid(
+   (const struct scsi_inquiry_data *)csio->data_ptr) == 0) {
+   ccb->ccb_h.status |= CAM_DEV_NOT_THERE;
+   if (bootverbose) {
+   mtx_lock(>hs_lock);
+   xpt_print(ccb->ccb_h.path,
+   "storvsc uninstalled device\n");
+   mtx_unlock(>hs_lock);
+   }
+   } else {
+   ccb->ccb_h.status |= CAM_REQ_CMP;
+   }
+   } else {
mtx_lock(>hs_lock);
xpt_print(ccb->ccb_h.path,
-   "srovsc scsi_status = %d\n",
+   "storvsc scsi_status = %d\n",
vm_srb->scsi_status);
mtx_unlock(>hs_lock);
ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
___
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: r294558 - head/sys/cam/ctl

2016-01-22 Thread Alexander Motin
Author: mav
Date: Fri Jan 22 09:32:19 2016
New Revision: 294558
URL: https://svnweb.freebsd.org/changeset/base/294558

Log:
  Hide "soconnect() error" messages under bootverbose.
  
  They can be too noisy.

Modified:
  head/sys/cam/ctl/ctl_ha.c

Modified: head/sys/cam/ctl/ctl_ha.c
==
--- head/sys/cam/ctl/ctl_ha.c   Fri Jan 22 09:06:40 2016(r294557)
+++ head/sys/cam/ctl/ctl_ha.c   Fri Jan 22 09:32:19 2016(r294558)
@@ -443,7 +443,7 @@ ctl_ha_connect(struct ha_softc *softc)
 
memcpy(, >ha_peer_in, sizeof(sa));
error = soconnect(so, (struct sockaddr *), td);
-   if (error != 0) {
+   if (error != 0 && bootverbose) {
printf("%s: soconnect() error %d\n", __func__, error);
goto out;
}
___
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-22 Thread Dag-Erling Smørgrav
Conrad Meyer  writes:
> Are we going to maintain DSA key support after upstream deprecates it
> entirely?  And why?

I am not aware of any plans to remove DSA support.  It has simply been
disabled in the default run-time configuration - unlike, for instance,
libwrap, which was removed entirely, and SSHv1, which needs to be
enabled at compile time.  I understand that decision (although I
disagree with their justification, or at least the way it was worded),
but we still have users who use DSA keys and who will be locked out of
their systems if we disable DSA without sufficient advance warning.  I
will look into what steps can be taken to deprecate DSA without causing
our users too much inconvenience.

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"

commit message 294534

2016-01-22 Thread Julian Elischer

On 22/01/2016 6:24 AM, Gleb Smirnoff wrote:

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


a bit of spare time on a plane or something?
 :-)

___
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-22 Thread Slawa Olhovchenkov
On Fri, Jan 22, 2016 at 10:56:48PM +0100, Dag-Erling Smørgrav wrote:

> Bryan Drewery  writes:
> > I've used these in sshd_config and ssh_config to restore some removed
> > functionality:
> >
> > Ciphers +blowfish-cbc,arcfour,aes128-cbc,3des-cbc
> > KexAlgorithms +diffie-hellman-group1-sha1
> 
> Do you actually need these?  Do you know of any clients or servers which
> do not support any of the other ciphers and key exchange algorithms
> which OpenSSH offers?

PIX 515E?
ASA w/o K9 license?
___
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: r294543 - head/usr.sbin/ypldap

2016-01-22 Thread Marcelo Araujo
2016-01-22 15:57 GMT+08:00 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 

Re: svn commit: r294556 - head/share/dtrace

2016-01-22 Thread Devin Teske
A better log message in retrospect:

"syscalls changed fbt names to be sys_*"

(developed these scripts on 8.x originally where "sys_" prefix was not
applied and we still had fbt::kill)
-- 
Devin

On Fri, 2016-01-22 at 08:29 +, Devin Teske wrote:
> Author: dteske
> Date: Fri Jan 22 08:29:23 2016
> New Revision: 294556
> URL: https://svnweb.freebsd.org/changeset/base/294556
> 
> Log:
>   Switch to syscall; HEAD lacks fbt for kill(2)
>   
>   MFC after:  3 days
>   X-MFC-to:   stable/10
>   X-MFC-with: 294548
> 
> Modified:
>   head/share/dtrace/watch_kill
> 
> Modified: head/share/dtrace/watch_kill
> =
> =
> --- head/share/dtrace/watch_kill  Fri Jan 22 07:35:10 2016
> (r294555)
> +++ head/share/dtrace/watch_kill  Fri Jan 22 08:29:23 2016
> (r294556)
> @@ -40,11 +40,10 @@ syscall::execve:entry /* probe ID 1 */
>  
>  /*/
>  
> -fbt::kill:entry /* probe ID 2 */
> +syscall::kill:entry /* probe ID 2 */
>  {
> - this->kill_args = (struct kill_args *)arg1;
> - this->pid_to_kill = this->kill_args->pid;
> - this->kill_signal = this->kill_args->signum;
> + this->pid_to_kill = (pid_t)arg0;
> + this->kill_signal = (int)arg1;
>  
>   /*
>* Examine process, parent process, and grandparent process
> details
> 
___
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: r294561 - head/sys/arm/ti

2016-01-22 Thread Andrew Turner
Author: andrew
Date: Fri Jan 22 12:51:12 2016
New Revision: 294561
URL: https://svnweb.freebsd.org/changeset/base/294561

Log:
  Stop defining fdt_pic_table with ARM_INTRNG, it's unused.

Modified:
  head/sys/arm/ti/ti_common.c

Modified: head/sys/arm/ti/ti_common.c
==
--- head/sys/arm/ti/ti_common.c Fri Jan 22 12:14:08 2016(r294560)
+++ head/sys/arm/ti/ti_common.c Fri Jan 22 12:51:12 2016(r294561)
@@ -53,6 +53,7 @@ struct fdt_fixup_entry fdt_fixup_table[]
{ NULL, NULL }
 };
 
+#ifndef ARM_INTRNG
 #ifdef SOC_TI_AM335X
 static int
 fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
@@ -72,7 +73,7 @@ fdt_aintc_decode_ic(phandle_t node, pcel
 #endif
 
 fdt_pic_decode_t fdt_pic_table[] = {
-#if defined(SOC_OMAP4) && !defined(ARM_INTRNG)
+#if defined(SOC_OMAP4)
_decode_fdt,
 #endif
 #ifdef SOC_TI_AM335X
@@ -80,3 +81,4 @@ fdt_pic_decode_t fdt_pic_table[] = {
 #endif
NULL
 };
+#endif /* !ARM_INTRNG */
___
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: r294543 - head/usr.sbin/ypldap

2016-01-22 Thread Bruce Evans

On Fri, 22 Jan 2016, Marcelo Araujo wrote:


2016-01-22 15:57 GMT+08:00 Bruce Evans :

...
Unfortunately, getdtablesize() is still needed for arrays as used in yp*,
and for anything using select().  If getdtablesize() is large then the
arrays should be sparse or large fd's should not be actually used.
closefrom() should probably be used early to kill unknown fd's to make
space for private fd's.  After that, getdtablesize() becomes almost
useless.  You just allocate a table large enough for the fd's that
you allocate, and don't allocate fd's sparsely.
...


I noticed that getdtablesize(2) specifically for ypldap(8) case is a bit
slower than FD_SETSIZE, mostly because of the size of max_fd.


freefall actually takes only 0.11 seconds to close 706977 mostly-non-open
fd's.  But if you watch this using ktrace (with ktrace.out on nfs) it takes
2.79 seconds for 1000 fd's or 33 minutes.  ktrace on nfs is unusably slow.


However, as ypldap(8) was imported from OpenBSD seemed good to keep it as
much as synced with OpenBSD implementation. Although I'm not sure if
FreeBSD and OpenBSD shares the same getdtablesize(2) implementation.


How did it diverge in the first place?

getdtablesize(2)'s implementation can't be much different, but its value
should be.  Allowing 706977 fd's for a single thread should be considered
a security hole (just a denial of service one).


Not an excuse for sure, but I agree with you!!!


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


svn commit: r294559 - head/sys/mips/nlm

2016-01-22 Thread Andrew Turner
Author: andrew
Date: Fri Jan 22 12:00:56 2016
New Revision: 294559
URL: https://svnweb.freebsd.org/changeset/base/294559

Log:
  Stop calling fdt_immr_addr from the xlp startup code. It's used to set
  fdt_immr_{va,pa,size}, but these are not used outside a single ARM SoC.

Modified:
  head/sys/mips/nlm/xlp_machdep.c

Modified: head/sys/mips/nlm/xlp_machdep.c
==
--- head/sys/mips/nlm/xlp_machdep.c Fri Jan 22 09:32:19 2016
(r294558)
+++ head/sys/mips/nlm/xlp_machdep.c Fri Jan 22 12:00:56 2016
(r294559)
@@ -311,8 +311,6 @@ xlp_bootargs_init(__register_t arg)
while (1);
if (OF_init((void *)dtbp) != 0)
while (1);
-   if (fdt_immr_addr(xlp_io_base) != 0)
-   while (1);
OF_interpret("perform-fixup", 0);
 
chosen = OF_finddevice("/chosen");
___
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: r294560 - head/etc/rc.d

2016-01-22 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Jan 22 12:14:08 2016
New Revision: 294560
URL: https://svnweb.freebsd.org/changeset/base/294560

Log:
  Do not generate RSA1 or DSA keys by default.

Modified:
  head/etc/rc.d/sshd

Modified: head/etc/rc.d/sshd
==
--- head/etc/rc.d/sshd  Fri Jan 22 12:00:56 2016(r294559)
+++ head/etc/rc.d/sshd  Fri Jan 22 12:14:08 2016(r294560)
@@ -20,9 +20,9 @@ configtest_cmd="sshd_configtest"
 pidfile="/var/run/${name}.pid"
 extra_commands="configtest keygen reload"
 
-: ${sshd_rsa1_enable:="yes"}
+: ${sshd_rsa1_enable:="no"}
 : ${sshd_rsa_enable:="yes"}
-: ${sshd_dsa_enable:="yes"}
+: ${sshd_dsa_enable:="no"}
 : ${sshd_ecdsa_enable:="yes"}
 : ${sshd_ed25519_enable:="yes"}
 
___
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: r294543 - head/usr.sbin/ypldap

2016-01-22 Thread Marcelo Araujo
2016-01-22 19:37 GMT+08:00 Bruce Evans :

> On Fri, 22 Jan 2016, Marcelo Araujo wrote:
>
> 2016-01-22 15:57 GMT+08:00 Bruce Evans :
>>
>>> ...
>>> Unfortunately, getdtablesize() is still needed for arrays as used in yp*,
>>> and for anything using select().  If getdtablesize() is large then the
>>> arrays should be sparse or large fd's should not be actually used.
>>> closefrom() should probably be used early to kill unknown fd's to make
>>> space for private fd's.  After that, getdtablesize() becomes almost
>>> useless.  You just allocate a table large enough for the fd's that
>>> you allocate, and don't allocate fd's sparsely.
>>> ...
>>>
>>
>> I noticed that getdtablesize(2) specifically for ypldap(8) case is a bit
>> slower than FD_SETSIZE, mostly because of the size of max_fd.
>>
>
> freefall actually takes only 0.11 seconds to close 706977 mostly-non-open
> fd's.  But if you watch this using ktrace (with ktrace.out on nfs) it takes
> 2.79 seconds for 1000 fd's or 33 minutes.  ktrace on nfs is unusably slow.
>

I will check the yp(8) code to see how complex would be to get those
getdtablesize(2) removed from there.


>
> However, as ypldap(8) was imported from OpenBSD seemed good to keep it as
>> much as synced with OpenBSD implementation. Although I'm not sure if
>> FreeBSD and OpenBSD shares the same getdtablesize(2) implementation.
>>
>
> How did it diverge in the first place?
>

Mostly I fixed a bug, made a small benchmark and noticed that "not using
getdtablesize(2)" would be fast, also for ypldap(8) I really don't see any
case to have more than 1024 FD allocated, but in other hands, keep the code
synced as closes as possible will make easy for future sync with OpenBSD.
That was the main reason why I bring back getdtablesize(2).


>
> getdtablesize(2)'s implementation can't be much different, but its value
> should be.  Allowing 706977 fd's for a single thread should be considered
> a security hole (just a denial of service one).


The good part of getdtablesize(2) is the tunable part, however for
ypldap(8), I really don't need that. The change was mostly to don't diverge
too much from OpenBSD.


>
>
> Not an excuse for sure, but I agree with you!!!
>>
>
> Bruce
>


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r294562 - head/sys/dev/fdt

2016-01-22 Thread Andrew Turner
Author: andrew
Date: Fri Jan 22 13:09:43 2016
New Revision: 294562
URL: https://svnweb.freebsd.org/changeset/base/294562

Log:
  Only define fdt_pic_table on arm, and when not using intrng as this is
  the only place that uses it.

Modified:
  head/sys/dev/fdt/fdt_common.h

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Fri Jan 22 12:51:12 2016
(r294561)
+++ head/sys/dev/fdt/fdt_common.h   Fri Jan 22 13:09:43 2016
(r294562)
@@ -45,8 +45,10 @@ struct fdt_sense_level {
enum intr_polarity  pol;
 };
 
+#if defined(__arm__) && !defined(ARM_INTRNG)
 typedef int (*fdt_pic_decode_t)(phandle_t, pcell_t *, int *, int *, int *);
 extern fdt_pic_decode_t fdt_pic_table[];
+#endif
 
 #if defined(__arm__) || defined(__powerpc__)
 typedef void (*fdt_fixup_t)(phandle_t);
___
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: r294610 - in head/sys: dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core ofed/include/rdma

2016-01-22 Thread Navdeep Parhar
Author: np
Date: Fri Jan 22 23:33:34 2016
New Revision: 294610
URL: https://svnweb.freebsd.org/changeset/base/294610

Log:
  Fix for iWARP servers that listen on INADDR_ANY.
  
  The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to
  represent an iWARP endpoint when the connection is over TCP. For
  servers the current approach is to invoke create_listen callback for
  each iWARP RNIC registered with the CM. This doesn't work too well for
  INADDR_ANY because a listen on any TCP socket already notifies all
  hardware TOEs/RNICs of the new listener. This patch fixes the server
  side of things for FreeBSD. We've tried to keep all these modifications
  in the iWARP/TCP specific parts of the OFED infrastructure as much as
  possible.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio (with design inputs from Steve 
Wise)
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D4801

Modified:
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.h
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
  head/sys/dev/cxgbe/iw_cxgbe/provider.c
  head/sys/ofed/drivers/infiniband/core/cma.c
  head/sys/ofed/drivers/infiniband/core/iwcm.c
  head/sys/ofed/include/rdma/iw_cm.h
  head/sys/ofed/include/rdma/rdma_cm.h

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h
==
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h Fri Jan 22 21:50:08 2016
(r294609)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h Fri Jan 22 23:33:34 2016
(r294610)
@@ -174,4 +174,5 @@ static inline void remove_handle(struct 
 }
 
 void iwch_ev_dispatch(struct iwch_dev *, struct mbuf *);
+void process_newconn(struct iw_cm_id *parent_cm_id, struct socket *child_so);
 #endif

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
==
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c  Fri Jan 22 21:50:08 2016
(r294609)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c  Fri Jan 22 23:33:34 2016
(r294610)
@@ -260,7 +260,6 @@ alloc_ep(int size, int flags)
 void __free_ep(struct iwch_ep_common *epc)
 {
CTR3(KTR_IW_CXGB, "%s ep %p state %s", __FUNCTION__, epc, 
states[state_read(epc)]);
-   KASSERT(!epc->so, ("%s warning ep->so %p \n", __FUNCTION__, epc->so));
KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list!\n", 
__FUNCTION__, epc));
free(epc, M_DEVBUF);
 }
@@ -1361,7 +1360,7 @@ out:
 }
 
 int
-iwch_create_listen(struct iw_cm_id *cm_id, int backlog)
+iwch_create_listen_ep(struct iw_cm_id *cm_id, int backlog)
 {
int err = 0;
struct iwch_listen_ep *ep;
@@ -1381,35 +1380,22 @@ iwch_create_listen(struct iw_cm_id *cm_i
state_set(>com, LISTEN);
 
ep->com.so = cm_id->so;
-   err = init_sock(>com);
-   if (err)
-   goto fail;
-
-   err = solisten(ep->com.so, ep->backlog, ep->com.thread);
-   if (!err) {
-   cm_id->provider_data = ep;
-   goto out;
-   }
-   close_socket(>com, 0);
-fail:
-   cm_id->rem_ref(cm_id);
-   put_ep(>com);
+   cm_id->provider_data = ep;
 out:
return err;
 }
 
-int
-iwch_destroy_listen(struct iw_cm_id *cm_id)
+void
+iwch_destroy_listen_ep(struct iw_cm_id *cm_id)
 {
struct iwch_listen_ep *ep = to_listen_ep(cm_id);
 
CTR2(KTR_IW_CXGB, "%s ep %p", __FUNCTION__, ep);
 
state_set(>com, DEAD);
-   close_socket(>com, 0);
cm_id->rem_ref(cm_id);
put_ep(>com);
-   return 0;
+   return;
 }
 
 int
@@ -1526,54 +1512,32 @@ process_connected(struct iwch_ep *ep)
}
 }
 
-static struct socket *
-dequeue_socket(struct socket *head, struct sockaddr_in **remote, struct 
iwch_ep *child_ep)
-{
-   struct socket *so;
-
-   ACCEPT_LOCK();
-   so = TAILQ_FIRST(>so_comp);
-   if (!so) {
-   ACCEPT_UNLOCK();
-   return NULL;
-   }
-   TAILQ_REMOVE(>so_comp, so, so_list);
-   head->so_qlen--;
-   SOCK_LOCK(so);
-   so->so_qstate &= ~SQ_COMP;
-   so->so_head = NULL;
-   soref(so);
-   soupcall_set(so, SO_RCV, iwch_so_upcall, child_ep);
-   so->so_state |= SS_NBIO;
-   PANIC_IF(!(so->so_state & SS_ISCONNECTED));
-   PANIC_IF(so->so_error);
-   SOCK_UNLOCK(so);
-   ACCEPT_UNLOCK();
-   soaccept(so, (struct sockaddr **)remote);
-   return so;
-}
-
-static void
-process_newconn(struct iwch_ep *parent_ep)
+void
+process_newconn(struct iw_cm_id *parent_cm_id, struct socket *child_so)
 {
-   struct socket *child_so;
struct iwch_ep *child_ep;
+   struct sockaddr_in *local;
struct sockaddr_in *remote;
+   struct iwch_ep *parent_ep = parent_cm_id->provider_data;
 

svn commit: r294611 - head/usr.bin/whois

2016-01-22 Thread Tony Finch
Author: fanf
Date: Sat Jan 23 00:28:18 2016
New Revision: 294611
URL: https://svnweb.freebsd.org/changeset/base/294611

Log:
  A lot of the cleverness in whois is no longer needed!
  
  The IANA whois server has the right referral information for domain
  names, IP addresses, and AS numbers, so whois does not need to be
  able to choose servers itself (except for a few cases where referrals
  do not work). We can delete a chunk of code, which is always fun.
  
  This change improves the referral handling to be less sensitive to
  all the various formats, and to allow multi-hop referral chains,
  such as IANA -> registry -> registrar.
  
  ARIN queries have the "+" flag added if no flags are present, so we
  get full details if the query matches multiple objects. The Verisign
  anti-spam logic is also now suppressed if the user provided a non-
  trivial query string.
  
  Uninformative rubric is now trimmed by default. The -S option
  turns off trimming, and disables query fettling.
  
  The -i option is back to its traditional pre-1999 hostname, since
  whois.internic.net is more useful than whois.networksolutions.com.
  Note that the old fallback/default server whois.crsnic.net is an
  alias for whois.internic.net.
  
  The manual is more informative about query syntax.

Modified:
  head/usr.bin/whois/whois.1
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.1
==
--- head/usr.bin/whois/whois.1  Fri Jan 22 23:33:34 2016(r294610)
+++ head/usr.bin/whois/whois.1  Sat Jan 23 00:28:18 2016(r294611)
@@ -28,7 +28,7 @@
 .\" From: @(#)whois.1  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2016
+.Dd January 23, 2016
 .Dt WHOIS 1
 .Os
 .Sh NAME
@@ -49,31 +49,22 @@ Network Information Centers
 .Pp
 By default
 .Nm
-automatically discovers the name of a whois server to use
-from the top-level domain
-.Pq Tn TLD
-of the supplied (single) argument.
-It tries
-.Qq Va TLD Ns Li .whois-servers.net
-and
-.Qq Li whois.nic. Ns Va TLD
-and if neither host exists it falls back to its default server.
-.Pp
-If an IP address or AS number is specified,
-the whois server will default to
-the American Registry for Internet Numbers
-.Pq Tn ARIN .
-.Pp
-If
-.Nm
-cannot automatically discover a server,
-it will fall back to
-the host specified in the
-.Ev WHOIS_SERVER
-or
-.Ev RA_SERVER
-environment variables, or if those are not set, it will use
-.Pa whois.crsnic.net .
+starts by querying the Internet Assigned Numbers Authority (IANA) whois server,
+and follows referrals to whois servers
+that have more specific details about the query
+.Ar name .
+The IANA whois server knows about
+IP address and AS numbers
+as well as domain names.
+.Pp
+There are a few special cases where referrals do not work, so
+.Nm
+goes directly to the appropriate server.
+These include point-of-contact handles for ARIN,
+.Pa nic.at ,
+NORID, and RIPE,
+and domain names under
+.Pa ac.uk .
 .Pp
 The options are as follows:
 .Bl -tag -width indent
@@ -85,17 +76,16 @@ It contains network numbers used in thos
 .Tn APNIC , AfriNIC , LACNIC ,
 nor by
 .Tn RIPE .
-.Pp
-(Hint: All point of contact handles in the
-.Tn ARIN
-whois database end with
-.Qq Li -ARIN . )
+The query syntax is documented at
+.Pa https://www.arin.net/resources/whoisrws/whois_api.html#nicname
 .It Fl A
 Use the Asia/Pacific Network Information Center
 .Pq Tn APNIC
 database.
 It contains network numbers used in East Asia, Australia,
 New Zealand, and the Pacific islands.
+Get query syntax documentation using
+.Ic whois -A help
 .It Fl b
 Use the Network Abuse Clearinghouse database.
 It contains addresses to which network abuse should be reported,
@@ -111,6 +101,8 @@ Use the African Network Information Cent
 database.
 It contains network numbers used in Africa and the islands of the
 western Indian Ocean.
+Get query syntax documentation using
+.Ic whois -f help
 .It Fl g
 Use the US non-military federal government database, which contains points of
 contact for subdomains of
@@ -119,14 +111,28 @@ contact for subdomains of
 Use the specified host instead of the default.
 Either a host name or an IP address may be specified.
 .It Fl i
-Use the obsolete Network Solutions Registry for Internet Numbers
-.Pq Pa whois.networksolutions.com
+Use the traditional Network Information Center (InterNIC)
+.Pq Pa whois.internic.net
 database.
+This now contains only registrations for domain names under
+.Pa .COM ,
+.Pa .NET ,
+.Pa .EDU .
+You can specify the type of object to search for like
+.Ic whois -i ' Ns Ar type Ar name Ns Ic '
+where
+.Ar type
+can be
+.Nm domain , nameserver , registrar .
+The
+.Ar name
+can contain
+.Li *
+wildcards.
 .It Fl I
 Use the Internet Assigned Numbers Authority
 .Pq Tn IANA
 database.
-It contains network information for top-level domains.
 .It Fl k
 Use the National Internet Development Agency of Korea's
 .Pq Tn KRNIC
@@ -160,7 +166,7 @@ Do a quick 

svn commit: r294616 - head/sys/geom

2016-01-22 Thread Adrian Chadd
Author: adrian
Date: Sat Jan 23 05:26:29 2016
New Revision: 294616
URL: https://svnweb.freebsd.org/changeset/base/294616

Log:
  Teach the flashmap code about the SPI flash.
  
  PR:   kern/206227
  Submitted by: Stanislav Galabov 

Modified:
  head/sys/geom/geom_flashmap.c

Modified: head/sys/geom/geom_flashmap.c
==
--- head/sys/geom/geom_flashmap.c   Sat Jan 23 04:18:44 2016
(r294615)
+++ head/sys/geom/geom_flashmap.c   Sat Jan 23 05:26:29 2016
(r294616)
@@ -190,8 +190,12 @@ g_flashmap_taste(struct g_class *mp, str
size = sizeof(device_t);
if (g_io_getattr("NAND::device", cp, , )) {
size = sizeof(device_t);
-   if (g_io_getattr("CFI::device", cp, , ))
-   break;
+   if (g_io_getattr("CFI::device", cp, , )) {
+   size = sizeof(device_t);
+   if (g_io_getattr("SPI::device", cp, ,
+   ))
+   break;
+   }
}
 
nslices = g_flashmap_load(dev, );
___
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: r294535 - in head/sys/netinet: . cc tcp_stacks

2016-01-22 Thread Lawrence Stewart
On 01/23/16 05:18, Gleb Smirnoff wrote:
> On Fri, Jan 22, 2016 at 06:13:54PM +1100, Lawrence Stewart wrote:
> L> On 01/22/16 09:34, Gleb Smirnoff wrote:
> L> > Author: glebius
> L> > Date: Thu Jan 21 22:34:51 2016
> L> > New Revision: 294535
> L> > URL: https://svnweb.freebsd.org/changeset/base/294535
> L> > 
> L> > Log:
> L> >   - Rename cc.h to more meaningful tcp_cc.h.
> L> 
> L> As a bit of historical context, the naming was intentionally protocol
> L> agnostic because it was originally hoped that the CC framework could be
> L> shared between multiple CC aware transports, and the design went to some
> L> lengths to accommodate that possibility (e.g. the ccv_container union in
> L> struct cc_var). SCTP was the obvious potential in tree consumer at the
> L> time, and other protocols like DCCP were considered as well.
> L> 
> L> This hasn't come about to date, but I'm not sure what value is obtained
> L> from your rename change unless we decide to completely give up on shared
> L> CC and if we do that, this change doesn't go far enough and we can
> L> further simplify the framework to make it entirely TCP specific e.g. we
> L> should probably do away with struct cc_var.
> L> 
> L> I'd argue in favour of reverting the rename and if you're gung ho about
> L> making the framework TCP specific, we can start a public discussion
> L> about what that should look like.
> 
> The problem is that cc.h (or tcp_cc.h) is already depening on many
> TCP types. So, the structures defined inside are not agnostic, including
> tcp headers before cc.h is required.

Not in any significant way that tightly couples the API to TCP from
consumers' perspective.

> The old cc.h used to include tcp.h implicitly, which is a bad style.
> 
> Since many developers sorted netinet/* includes in a .c file using
> sort(1), that lead to cc.h always come before actual tcp includes,
> hiding the real requirement for tcp.h in a .c file.

To provide some more context, I considered that choice to be a lesser
evil at the time. Linux had set the defacto standard macro naming and
location so even though I would have put the CC related defines in cc.h
given the choice, I wanted third-party software which checked for
modular CC the Linux way to work on FreeBSD. The alphabetical ordering
of includes is what prompted me to include tcp.h in cc.h so that cc.h
could happily sit at the top of the list. I probably could have just
moved cc.h to the cc subdir, in which case it would always come
logically after the TCP includes as  - perhaps that's
the right solution.

> P.S. Speaking of agnostic stuff. My humble opinion, that in the
> network stack through the whole BSD history agnosticism never yield
> in virtue. Examples: routing code can be used for IPv4, IPv6, Atalk
> and IPX. Result is that Atalk and IPX are history, but our routing
> table uses 8x more memory for IPv4 and performs miserably. Another
> example is the same sockbuf used for all types of sockets, including
> stream, datagram, local and network, which first yielded in quite
> complex code for a quite trivial task, and later then, when SCTP
> came in failed to be agnostic enough to fit into SCTP.

I generally agree with you, though I'm not sure the examples are overly
applicable to the CC framework given the minimal overhead required to
make it agnostic vs the potential overhead of maintaining multiple
incarnations of the same algorithm. That being said, I'm not at all
against declaring the shared CC idea a failed experiment given that it
hasn't come to fruition. I just suggest that if we're going to do that,
we have to go a lot further than just a rename.

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"


svn commit: r294617 - head/sys/conf

2016-01-22 Thread Adrian Chadd
Author: adrian
Date: Sat Jan 23 05:27:55 2016
New Revision: 294617
URL: https://svnweb.freebsd.org/changeset/base/294617

Log:
  Now that the flashmap code knows about SPI flash, add it in builds.
  
  PR:   kern/206227
  Submitted by: Stanislav Galabov 

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Jan 23 05:26:29 2016(r294616)
+++ head/sys/conf/files Sat Jan 23 05:27:55 2016(r294617)
@@ -1419,7 +1419,7 @@ dev/fdt/fdt_clock_if.moptional fdt fdt
 dev/fdt/fdt_common.c   optional fdt
 dev/fdt/fdt_pinctrl.c  optional fdt fdt_pinctrl
 dev/fdt/fdt_pinctrl_if.m   optional fdt fdt_pinctrl
-dev/fdt/fdt_slicer.c   optional fdt cfi | fdt nand
+dev/fdt/fdt_slicer.c   optional fdt cfi | fdt nand | fdt mx25l
 dev/fdt/fdt_static_dtb.S   optional fdt fdt_dtb_static \
dependency  "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}"
 dev/fdt/simplebus.coptional fdt
@@ -3010,7 +3010,7 @@ geom/geom_disk.c  standard
 geom/geom_dump.c   standard
 geom/geom_event.c  standard
 geom/geom_fox.coptional geom_fox
-geom/geom_flashmap.c   optional fdt cfi | fdt nand
+geom/geom_flashmap.c   optional fdt cfi | fdt nand | fdt mx25l
 geom/geom_io.c standard
 geom/geom_kern.c   standard
 geom/geom_map.coptional geom_map
___
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-22 Thread Lawrence Stewart
On 01/23/16 05:04, Gleb Smirnoff wrote:
> On Fri, Jan 22, 2016 at 05:19:34PM +1100, Lawrence Stewart wrote:
> L> On 01/22/16 09:53, Gleb Smirnoff wrote:
> L> > Author: glebius
> L> > Date: Thu Jan 21 22:53:12 2016
> L> > New Revision: 294536
> L> > URL: https://svnweb.freebsd.org/changeset/base/294536
> L> > 
> L> > Log:
> L> >   Refactor TCP_CONGESTION setsockopt handling:
> L> >   - Use M_TEMP instead of stack variable.
> L> >   - Unroll error handling, removing several levels of indentation.
> L> 
> L> As noted privately elsewhere, this change introduces races with respect
> L> to CC algorithm module unloading which will need to be fixed. Just
> L> mentioning it again publicly so others are aware of it.
> 
> In the code checked in the check for (CC_ALGO(tp)->ctl_output being
> not NULL and the actual call are under the same lock.
> 
> Is that the race you refer to?

No, the TCP_CONGESTION refactoring i.e. this commit, introduced races in
the get and set cases. I guess I didn't provide enough context in
Crucible, so here goes...

The post refactoring get code is now:

case TCP_CONGESTION:
INP_WUNLOCK(inp);
error = sooptcopyout(sopt, CC_ALGO(tp)->name, TCP_CA_NAME_MAX);
break;

Consider that tp is using cc_blah and that the cc_blah module is
unloaded as the copy out is happening. By not holding the INP lock, the
CC module unload code is able to walk the list of active connections,
find this connection is using cc_blah, acquire the INP lock, switch this
connection to cc_newreno, release the lock and finally unload the
cc_blah module, rendering the pointer passed in to sooptcopyout garbage.
See cc_deregister_algo() in cc.c and tcp_ccalgounload() in tcp_subr.c
for details related to CC module unload.

The post refactoring set code is now:

case TCP_CONGESTION:
INP_WUNLOCK(inp);
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);
/*
 * 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 && algo->cb_init(tp->ccv) != 0) {
CC_ALGO(tp) = _cc_algo;
/*
 * The only reason init should fail is
 * because of malloc.
 */
error = ENOMEM;
   }
   INP_WUNLOCK(inp);
   break;

Consider that the application has requested to switch to "blah"
congestion control and that the cc_blah module is unloaded as the
request is being processed. We hold no locks, copy in the string "blah",
grab the CC list lock, find cc_blah's algo struct in the list leaving
its pointer stored in the "algo" variable and drop the CC list lock.

Crucially at this point, we don't hold the INP lock, so once we drop the
CC list lock, the CC module unload code is free to pull cc_blah from the
CC module list, walk the list of active connections and switch any using
cc_blah to cc_newreno and to unload the cc_blah module. The tp we're
modifying hasn't switched to cc_blah yet so it won't be reverted to
cc_newreno by the CC module unload code, which means the "algo" variable
will be a garbage pointer by the time we get around to grabbing the INP
lock at the INP_WLOCK_RECHECK() line of code.

You have to ensure that the algo pointer is valid and that the INP lock
is held at the time of assigning to the tp, as that will ensure that if
you're racing with the unload code, the unload code will correctly
switch the connection's algo back to cc_newreno once it's able to
acquire the INP lock.

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: r294547 - head/sys/boot/kshim

2016-01-22 Thread Hans Petter Selasky

On 01/22/16 16:25, Conrad Meyer wrote:

Is this incomplete?



No, malloc() is a macro in this case, and the two last arguments are not 
used :-)


--HPS

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

2016-01-22 Thread Bjoern A. Zeeb

> On 22 Jan 2016, at 15:21 , George Neville-Neil  wrote:
> 
> 
> 
> On 22 Jan 2016, at 2:13, Lawrence Stewart wrote:
> 
>> 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.
>> 
> 
> I actually was wondering about this as well.  I think it ought to be reverted 
> to agnostic.

I probably share that view but I also agree that cc.h is not a good name.

So before we entirely revert this, can when maybe come up with a name that is 
better than cc.h or tcp_cc.h and only make this one more change forward rather 
than going back to the previous status quo?

/bz
___
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: r294578 - head/sys/dev/ixgbe

2016-01-22 Thread Steven Hartland
Author: smh
Date: Fri Jan 22 17:03:32 2016
New Revision: 294578
URL: https://svnweb.freebsd.org/changeset/base/294578

Log:
  Fix ix advertise value after media change
  
  When ifconfig sets media then the values displayed by the advertise_speed
  value are invalidated.
  
  Fix this by setting the bits correctly including setting advertise to 0 for
  media = auto.
  
  Reviewed by:  sbruno
  MFC after:1 week
  Sponsored by: Multiplay
  Differential Revision:https://reviews.freebsd.org/D5034

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Fri Jan 22 16:59:06 2016(r294577)
+++ head/sys/dev/ixgbe/if_ix.c  Fri Jan 22 17:03:32 2016(r294578)
@@ -1948,10 +1948,16 @@ ixgbe_media_change(struct ifnet * ifp)
 
hw->mac.autotry_restart = TRUE;
hw->mac.ops.setup_link(hw, speed, TRUE);
-   adapter->advertise =
-   ((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) |
-   ((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) |
-   ((speed & IXGBE_LINK_SPEED_100_FULL) << 0);
+   if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) {
+   adapter->advertise = 0;
+   } else {
+   if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0)
+   adapter->advertise |= 1 << 2;
+   if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0)
+   adapter->advertise |= 1 << 1;
+   if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0)
+   adapter->advertise |= 1 << 0;
+   }
 
return (0);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294579 - head/usr.bin/whois

2016-01-22 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Fri Jan 22 17:17:27 2016
New Revision: 294579
URL: https://svnweb.freebsd.org/changeset/base/294579

Log:
  Bump .Dd after r294575

Modified:
  head/usr.bin/whois/whois.1

Modified: head/usr.bin/whois/whois.1
==
--- head/usr.bin/whois/whois.1  Fri Jan 22 17:03:32 2016(r294578)
+++ head/usr.bin/whois/whois.1  Fri Jan 22 17:17:27 2016(r294579)
@@ -28,7 +28,7 @@
 .\" From: @(#)whois.1  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd May 14, 2015
+.Dd January 22, 2016
 .Dt WHOIS 1
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r294579 - head/usr.bin/whois

2016-01-22 Thread Tony Finch
Benjamin Kaduk  wrote:

>   Bump .Dd after r294575

Thanks :-)

Tony.
-- 
f.anthony.n.finch    http://dotat.at/
Portland, Plymouth, Biscay, Fitzroy, Sole: West or southwest, backing south, 5
to 7, decreasing 3 or 4 at times. Moderate or rough, becoming mainly very
rough, occasionally high at first in northwest Fitzroy and west Sole. Rain or
drizzle at times. Moderate or good, occasionally poor.
___
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: r294564 - head/crypto/openssh

2016-01-22 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Jan 22 14:22:11 2016
New Revision: 294564
URL: https://svnweb.freebsd.org/changeset/base/294564

Log:
  r294563 was incomplete; re-add the client-side options as well.

Modified:
  head/crypto/openssh/readconf.c

Modified: head/crypto/openssh/readconf.c
==
--- head/crypto/openssh/readconf.c  Fri Jan 22 13:13:46 2016
(r294563)
+++ head/crypto/openssh/readconf.c  Fri Jan 22 14:22:11 2016
(r294564)
@@ -286,6 +286,8 @@ static struct {
{ "hpnbuffersize", oDeprecated },
{ "tcprcvbufpoll", oDeprecated },
{ "tcprcvbuf", oDeprecated },
+   { "noneenabled", oUnsupported },
+   { "noneswitch", oUnsupported },
{ "versionaddendum", oVersionAddendum },
 
{ NULL, oBadOption }
___
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: r294563 - head/crypto/openssh

2016-01-22 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Jan 22 13:13:46 2016
New Revision: 294563
URL: https://svnweb.freebsd.org/changeset/base/294563

Log:
  Instead of removing the NoneEnabled option, mark it as unsupported.
  (should have done this in r291198, but didn't think of it until now)

Modified:
  head/crypto/openssh/servconf.c

Modified: head/crypto/openssh/servconf.c
==
--- head/crypto/openssh/servconf.c  Fri Jan 22 13:09:43 2016
(r294562)
+++ head/crypto/openssh/servconf.c  Fri Jan 22 13:13:46 2016
(r294563)
@@ -565,6 +565,7 @@ static struct {
{ "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL },
{ "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL 
},
{ "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL },
+   { "noneenabled", sUnsupported, SSHCFG_ALL },
{ "hpndisabled", sDeprecated, SSHCFG_ALL },
{ "hpnbuffersize", sDeprecated, SSHCFG_ALL },
{ "tcprcvbufpoll", sDeprecated, SSHCFG_ALL },
___
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: r294573 - in head/contrib/jemalloc/include/jemalloc: . internal

2016-01-22 Thread Ruslan Bukin
Author: br
Date: Fri Jan 22 16:37:26 2016
New Revision: 294573
URL: https://svnweb.freebsd.org/changeset/base/294573

Log:
  Add configuration for RISC-V ISA.
  
  Reviewed by:  emaste
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D5020

Modified:
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Fri Jan 
22 16:35:01 2016(r294572)
+++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Fri Jan 
22 16:37:26 2016(r294573)
@@ -253,6 +253,9 @@ typedef unsigned szind_t;
 #  ifdef __powerpc__
 #define LG_QUANTUM 4
 #  endif
+#  ifdef __riscv__
+#define LG_QUANTUM 4
+#  endif
 #  ifdef __s390__
 #define LG_QUANTUM 4
 #  endif

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Fri Jan 22 
16:35:01 2016(r294572)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Fri Jan 22 
16:37:26 2016(r294573)
@@ -52,6 +52,9 @@
 #elif defined(__powerpc__)
 #  define LG_SIZEOF_PTR2
 #endif
+#ifdef __riscv__
+#  define LG_SIZEOF_PTR3
+#endif
 
 #ifndef JEMALLOC_TLS_MODEL
 #  define JEMALLOC_TLS_MODEL   /* Default. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r294574 - in head/contrib/llvm/projects/libunwind: include src

2016-01-22 Thread Ruslan Bukin
Author: br
Date: Fri Jan 22 16:42:06 2016
New Revision: 294574
URL: https://svnweb.freebsd.org/changeset/base/294574

Log:
  Add stubs for RISC-V ISA so libunwind can be compiled.
  
  Reviewed by:  emaste
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D5035

Modified:
  head/contrib/llvm/projects/libunwind/include/libunwind.h
  head/contrib/llvm/projects/libunwind/src/Registers.hpp
  head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
  head/contrib/llvm/projects/libunwind/src/config.h
  head/contrib/llvm/projects/libunwind/src/libunwind.cpp

Modified: head/contrib/llvm/projects/libunwind/include/libunwind.h
==
--- head/contrib/llvm/projects/libunwind/include/libunwind.hFri Jan 22 
16:37:26 2016(r294573)
+++ head/contrib/llvm/projects/libunwind/include/libunwind.hFri Jan 22 
16:42:06 2016(r294574)
@@ -295,6 +295,77 @@ enum {
   UNW_PPC_SPEFSCR = 112
 };
 
+// 64-bit RISC-V registers
+enum {
+  UNW_RISCV_X0  = 0,
+  UNW_RISCV_X1  = 1,
+  UNW_RISCV_RA  = 1,
+  UNW_RISCV_X2  = 2,
+  UNW_RISCV_SP  = 2,
+  UNW_RISCV_X3  = 3,
+  UNW_RISCV_X4  = 4,
+  UNW_RISCV_X5  = 5,
+  UNW_RISCV_X6  = 6,
+  UNW_RISCV_X7  = 7,
+  UNW_RISCV_X8  = 8,
+  UNW_RISCV_X9  = 9,
+  UNW_RISCV_X10 = 10,
+  UNW_RISCV_X11 = 11,
+  UNW_RISCV_X12 = 12,
+  UNW_RISCV_X13 = 13,
+  UNW_RISCV_X14 = 14,
+  UNW_RISCV_X15 = 15,
+  UNW_RISCV_X16 = 16,
+  UNW_RISCV_X17 = 17,
+  UNW_RISCV_X18 = 18,
+  UNW_RISCV_X19 = 19,
+  UNW_RISCV_X20 = 20,
+  UNW_RISCV_X21 = 21,
+  UNW_RISCV_X22 = 22,
+  UNW_RISCV_X23 = 23,
+  UNW_RISCV_X24 = 24,
+  UNW_RISCV_X25 = 25,
+  UNW_RISCV_X26 = 26,
+  UNW_RISCV_X27 = 27,
+  UNW_RISCV_X28 = 28,
+  UNW_RISCV_X29 = 29,
+  UNW_RISCV_X30 = 30,
+  UNW_RISCV_X31 = 31,
+  // reserved block
+  UNW_RISCV_D0  = 64,
+  UNW_RISCV_D1  = 65,
+  UNW_RISCV_D2  = 66,
+  UNW_RISCV_D3  = 67,
+  UNW_RISCV_D4  = 68,
+  UNW_RISCV_D5  = 69,
+  UNW_RISCV_D6  = 70,
+  UNW_RISCV_D7  = 71,
+  UNW_RISCV_D8  = 72,
+  UNW_RISCV_D9  = 73,
+  UNW_RISCV_D10 = 74,
+  UNW_RISCV_D11 = 75,
+  UNW_RISCV_D12 = 76,
+  UNW_RISCV_D13 = 77,
+  UNW_RISCV_D14 = 78,
+  UNW_RISCV_D15 = 79,
+  UNW_RISCV_D16 = 80,
+  UNW_RISCV_D17 = 81,
+  UNW_RISCV_D18 = 82,
+  UNW_RISCV_D19 = 83,
+  UNW_RISCV_D20 = 84,
+  UNW_RISCV_D21 = 85,
+  UNW_RISCV_D22 = 86,
+  UNW_RISCV_D23 = 87,
+  UNW_RISCV_D24 = 88,
+  UNW_RISCV_D25 = 89,
+  UNW_RISCV_D26 = 90,
+  UNW_RISCV_D27 = 91,
+  UNW_RISCV_D28 = 92,
+  UNW_RISCV_D29 = 93,
+  UNW_RISCV_D30 = 94,
+  UNW_RISCV_D31 = 95,
+};
+
 // 64-bit ARM64 registers
 enum {
   UNW_ARM64_X0  = 0,

Modified: head/contrib/llvm/projects/libunwind/src/Registers.hpp
==
--- head/contrib/llvm/projects/libunwind/src/Registers.hpp  Fri Jan 22 
16:37:26 2016(r294573)
+++ head/contrib/llvm/projects/libunwind/src/Registers.hpp  Fri Jan 22 
16:42:06 2016(r294574)
@@ -1024,6 +1024,264 @@ inline const char *Registers_ppc::getReg
 
 }
 
+/// Registers_riscv holds the register state of a thread in a 64-bit RISC-V
+/// process.
+class _LIBUNWIND_HIDDEN Registers_riscv {
+public:
+  Registers_riscv();
+  Registers_riscv(const void *registers);
+
+  boolvalidRegister(int num) const;
+  uint64_tgetRegister(int num) const;
+  voidsetRegister(int num, uint64_t value);
+  boolvalidFloatRegister(int num) const;
+  double  getFloatRegister(int num) const;
+  voidsetFloatRegister(int num, double value);
+  boolvalidVectorRegister(int num) const;
+  v128getVectorRegister(int num) const;
+  voidsetVectorRegister(int num, v128 value);
+  const char *getRegisterName(int num);
+  voidjumpto();
+  static int  lastDwarfRegNum() { return 95; }
+
+  uint64_t  getSP() const { return _registers.__x[2]; }
+  void  setSP(uint64_t value) { _registers.__x[2] = value; }
+  uint64_t  getIP() const { return _registers.__x[1]; }
+  void  setIP(uint64_t value) { _registers.__x[1] = value; }
+
+private:
+  struct GPRs {
+uint64_t __x[32]; // x0-x31
+  };
+
+  GPRs_registers;
+  double  _vectorHalfRegisters[32];
+  // Currently only the lower double in 128-bit vectore registers
+  // is perserved during unwinding.  We could define new register
+  // numbers (> 96) which mean whole vector registers, then this
+  // struct would need to change to contain whole vector registers.
+};
+
+inline Registers_riscv::Registers_riscv(const void *registers) {
+  static_assert(sizeof(Registers_riscv) < sizeof(unw_context_t),
+"riscv registers do not fit into unw_context_t");
+  memcpy(&_registers, registers, sizeof(_registers));
+  static_assert(sizeof(GPRs) == 0x100,
+"expected 

svn commit: r294575 - head/usr.bin/whois

2016-01-22 Thread Tony Finch
Author: fanf
Date: Fri Jan 22 16:43:49 2016
New Revision: 294575
URL: https://svnweb.freebsd.org/changeset/base/294575

Log:
  A few `whois` usability improvements
  
  Look up AS numbers at ARIN.
  
  Handle more referral formats.
  
  Suppress spammy nameserver objects when querying the .com and .net
  whois servers by explicitly querying for domain names by default.

Modified:
  head/usr.bin/whois/whois.1
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.1
==
--- head/usr.bin/whois/whois.1  Fri Jan 22 16:42:06 2016(r294574)
+++ head/usr.bin/whois/whois.1  Fri Jan 22 16:43:49 2016(r294575)
@@ -59,18 +59,10 @@ and
 .Qq Li whois.nic. Ns Va TLD
 and if neither host exists it falls back to its default server.
 .Pp
-If an IP address is specified, the whois server will default to
+If an IP address or AS number is specified,
+the whois server will default to
 the American Registry for Internet Numbers
 .Pq Tn ARIN .
-If a query to
-.Tn ARIN
-references
-.Tn APNIC , AfriNIC , LACNIC ,
-or
-.Tn RIPE ,
-that server will be queried also, provided that the
-.Fl Q
-option is not specified.
 .Pp
 If
 .Nm
@@ -164,18 +156,42 @@ Use the PeeringDB database of AS numbers
 It contains details about presence at internet peering points
 for many network operators.
 .It Fl Q
-Do a quick lookup.
-This means that
+Do a quick lookup;
 .Nm
-will not attempt to lookup the name in the authoritative whois
-server (if one is listed).
-This option has no effect when combined with any other options.
+will not attempt to follow referrals to other whois servers.
+This is the default if a server is explicitly specified
+using one of the other options.
+See also the
+.Fl R
+option.
 .It Fl r
 Use the R\(aaeseaux IP Europ\(aaeens
 .Pq Tn RIPE
 database.
 It contains network numbers and domain contact information
 for Europe.
+.It Fl R
+Do a recursive lookup;
+.Nm
+will attempt to follow referrals to other whois servers.
+This is the default if no server is explicitly specified.
+See also the
+.Fl Q
+option.
+.It Fl S
+By default, if the whois server is
+.Pa whois.verisign-grs.com
+(or a CNAME alias pointing at that name)
+then
+.Nm
+will query for
+.Dl domain Ar name
+The
+.Fl S
+option suppresses this behaviour,
+allowing you to make a loose-matching query,
+or query for host objects using the syntax
+.Dl nameserver Ar name
 .El
 .Pp
 The operands specified to

Modified: head/usr.bin/whois/whois.c
==
--- head/usr.bin/whois/whois.c  Fri Jan 22 16:42:06 2016(r294574)
+++ head/usr.bin/whois/whois.c  Fri Jan 22 16:43:49 2016(r294575)
@@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$");
 #defineANICHOST"whois.arin.net"
 #defineBNICHOST"whois.registro.br"
 #defineFNICHOST"whois.afrinic.net"
-#defineGERMNICHOST "de.whois-servers.net"
+#defineGERMNICHOST "de" QNICHOST_TAIL
 #defineGNICHOST"whois.nic.gov"
 #defineIANAHOST"whois.iana.org"
 #defineINICHOST"whois.networksolutions.com"
@@ -76,14 +76,13 @@ __FBSDID("$FreeBSD$");
 #defineQNICHOST_HEAD   "whois.nic."
 #defineQNICHOST_TAIL   ".whois-servers.net"
 #defineRNICHOST"whois.ripe.net"
+#defineVNICHOST"whois.verisign-grs.com"
 
 #defineDEFAULT_PORT"whois"
 
-#defineWHOIS_SERVER_ID "Whois Server: "
-#defineWHOIS_ORG_SERVER_ID "Registrant Street1:Whois Server:"
-
 #define WHOIS_RECURSE  0x01
 #define WHOIS_QUICK0x02
+#define WHOIS_SPAM_ME  0x04
 
 #define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-')
 
@@ -100,8 +99,20 @@ static struct {
{ NULL, NULL }
 };
 
-static const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST,
- FNICHOST, NULL };
+#define WHOIS_REFERRAL(s) { s, sizeof(s) - 1 }
+static struct {
+   const char *prefix;
+   size_t len;
+} whois_referral[] = {
+   WHOIS_REFERRAL("Whois Server: "),
+   WHOIS_REFERRAL("WHOIS Server: "),
+   WHOIS_REFERRAL("   Whois Server: "),
+   WHOIS_REFERRAL("refer:"),
+   WHOIS_REFERRAL("Registrant Street1:Whois Server:"),
+   WHOIS_REFERRAL("ReferralServer:  whois://"),
+   { NULL, 0 }
+};
+
 static const char *port = DEFAULT_PORT;
 
 static char *choose_server(char *);
@@ -123,7 +134,7 @@ main(int argc, char *argv[])
 
country = host = qnichost = NULL;
flags = use_qnichost = 0;
-   while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:PQr")) != -1) {
+   while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:PQrRS")) != -1) {
switch (ch) {
case 'a':
host = ANICHOST;
@@ -173,6 +184,12 @@ main(int argc, char *argv[])
case 'r':
host = 

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

2016-01-22 Thread Ed Maste
Author: emaste
Date: Fri Jan 22 16:47:36 2016
New Revision: 294576
URL: https://svnweb.freebsd.org/changeset/base/294576

Log:
  Drop HP libunwind (unw_*) functions from LLVM libunwind
  
  They are not needed for exception handling.

Modified:
  head/gnu/lib/libgcc/Makefile

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileFri Jan 22 16:43:49 2016
(r294575)
+++ head/gnu/lib/libgcc/MakefileFri Jan 22 16:47:36 2016
(r294576)
@@ -81,8 +81,7 @@ LIB2ADDEH = gcc_personality_v0.c \
UnwindLevel1-gcc-ext.c \
UnwindLevel1.c \
UnwindRegistersRestore.S \
-   UnwindRegistersSave.S \
-   libunwind.cpp
+   UnwindRegistersSave.S
 
 CFLAGS+=   -I${UNWINDINCDIR} -I${.CURDIR}
 .if empty(CXXFLAGS:M-std=*)
___
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: r294577 - in head/contrib/compiler-rt/lib: builtins sanitizer_common

2016-01-22 Thread Ruslan Bukin
Author: br
Date: Fri Jan 22 16:59:06 2016
New Revision: 294577
URL: https://svnweb.freebsd.org/changeset/base/294577

Log:
  Add support for RISC-V ISA.
  
  Reviewed by:  emaste
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D5021

Modified:
  head/contrib/compiler-rt/lib/builtins/int_lib.h
  
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h
==
--- head/contrib/compiler-rt/lib/builtins/int_lib.h Fri Jan 22 16:47:36 
2016(r294576)
+++ head/contrib/compiler-rt/lib/builtins/int_lib.h Fri Jan 22 16:59:06 
2016(r294577)
@@ -74,11 +74,13 @@
  * global header to prevent other C files from making the detour
  * through __c?zdi2() as well.
  *
- * This problem has only been observed on FreeBSD for sparc64 and
- * mips64 with GCC 4.2.1.
+ * This problem has been observed on FreeBSD for sparc64 and
+ * mips64 with GCC 4.2.1, and for riscv with GCC 5.2.0.
+ * Presumably it's any version of GCC, and targeting an arch that
+ * does not have dedicated bit counting instructions.
  */
 #if defined(__FreeBSD__) && (defined(__sparc64__) || \
-defined(__mips_n64) || defined(__mips_o64))
+defined(__mips_n64) || defined(__mips_o64) || defined(__riscv__))
 si_int __clzsi2(si_int);
 si_int __ctzsi2(si_int);
 #define__builtin_clz __clzsi2

Modified: 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
==
--- 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 
Fri Jan 22 16:47:36 2016(r294576)
+++ 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 
Fri Jan 22 16:59:06 2016(r294577)
@@ -76,6 +76,10 @@ namespace __sanitizer {
 #elif defined(__powerpc64__)
   const unsigned struct_kernel_stat_sz = 144;
   const unsigned struct_kernel_stat64_sz = 104;
+#elif defined(__riscv__)
+  /* RISCVTODO: check that these values are correct */
+  const unsigned struct_kernel_stat_sz = 128;
+  const unsigned struct_kernel_stat64_sz = 128;
 #elif defined(__mips__)
   #if SANITIZER_WORDSIZE == 64
   const unsigned struct_kernel_stat_sz = 216;
@@ -103,7 +107,7 @@ namespace __sanitizer {
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD
 
-#if defined(__powerpc64__)
+#if defined(__powerpc64__) || defined(__riscv__)
   const unsigned struct___old_kernel_stat_sz = 0;
 #else
   const unsigned struct___old_kernel_stat_sz = 32;
@@ -481,7 +485,7 @@ namespace __sanitizer {
   typedef long __sanitizer___kernel_off_t;
 #endif
 
-#if defined(__powerpc__) || defined(__mips__)
+#if defined(__powerpc__) || defined(__mips__) || defined(__riscv__)
   typedef unsigned int __sanitizer___kernel_old_uid_t;
   typedef unsigned int __sanitizer___kernel_old_gid_t;
 #else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: commit message 294534

2016-01-22 Thread Gleb Smirnoff
On Fri, Jan 22, 2016 at 06:35:29PM +0800, Julian Elischer wrote:
J> On 22/01/2016 6:24 AM, Gleb Smirnoff wrote:
J> > Author: glebius
J> > Date: Thu Jan 21 22:24:20 2016
J> > New Revision: 294534
J> > URL: https://svnweb.freebsd.org/changeset/base/294534
J> >
J> > Log:
J> >Cleanup TCP files from unnecessary interface related includes.
J> >
J> > Modified:
J> >head/sys/netinet/cc/cc.c
J> >head/sys/netinet/cc/cc_cdg.c
J> >head/sys/netinet/cc/cc_chd.c
J> >head/sys/netinet/cc/cc_dctcp.c
J> >head/sys/netinet/cc/cc_hd.c
J> >head/sys/netinet/cc/cc_vegas.c
J> >head/sys/netinet/tcp_input.c
J> >head/sys/netinet/tcp_stacks/fastpath.c
J> 
J> a bit of spare time on a plane or something?
J>   :-)

Came as a cleanup before the TCP_CCALGOOPT.

-- 
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: r294565 - in head: lib/libc/gen tools/regression/posixsem2

2016-01-22 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 22 14:52:31 2016
New Revision: 294565
URL: https://svnweb.freebsd.org/changeset/base/294565

Log:
  sem: Don't free nameinfo that is still in list when open() fails.
  
  This bug could be reproduced easily by calling sem_open() with O_CREAT |
  O_EXCL on a semaphore that is already open in the process. The struct
  sem_nameinfo would be freed while still in sem_list and later calls to
  sem_open() or sem_close() could access freed memory.
  
  PR:   206396
  MFC after:5 days

Modified:
  head/lib/libc/gen/sem_new.c
  head/tools/regression/posixsem2/semtest.c

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Fri Jan 22 14:22:11 2016(r294564)
+++ head/lib/libc/gen/sem_new.c Fri Jan 22 14:52:31 2016(r294565)
@@ -177,8 +177,10 @@ _sem_open(const char *name, int flags, .
if (ni->name != NULL && strcmp(name, ni->name) == 0) {
fd = _open(path, flags | O_RDWR | O_CLOEXEC |
O_EXLOCK, mode);
-   if (fd == -1 || _fstat(fd, ) == -1)
+   if (fd == -1 || _fstat(fd, ) == -1) {
+   ni = NULL;
goto error;
+   }
if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT |
O_EXCL) || ni->dev != sb.st_dev ||
ni->ino != sb.st_ino) {

Modified: head/tools/regression/posixsem2/semtest.c
==
--- head/tools/regression/posixsem2/semtest.c   Fri Jan 22 14:22:11 2016
(r294564)
+++ head/tools/regression/posixsem2/semtest.c   Fri Jan 22 14:52:31 2016
(r294565)
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -14,6 +15,7 @@
 
 int test_unnamed(void);
 int test_named(void);
+int test_named2(void);
 
 int
 test_unnamed(void)
@@ -94,9 +96,42 @@ test_named(void)
 }
 
 int
+test_named2(void)
+{
+   sem_t *s, *s2, *s3;
+
+   printf("testing named process-shared semaphore, O_EXCL cases\n");
+   sem_unlink(SEM_NAME);
+   s = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 0);
+   if (s == SEM_FAILED)
+   err(1, "sem_open failed");
+   s2 = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 0);
+   if (s2 != SEM_FAILED)
+   errx(2, "second sem_open call wrongly succeeded");
+   if (errno != EEXIST)
+   err(3, "second sem_open call failed with wrong errno");
+
+   s3 = sem_open(SEM_NAME, 0);
+   if (s3 == SEM_FAILED)
+   err(4, "third sem_open call failed");
+   if (s != s3)
+   errx(5,
+"two sem_open calls for same semaphore do not return same address");
+   if (sem_close(s3))
+   err(6, "sem_close failed");
+
+   if (sem_close(s))
+   err(7, "sem_close failed");
+   
+   printf("OK.\n");
+   return (0);
+}
+
+int
 main(void)
 {
test_unnamed();
test_named();
+   test_named2();
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-01-22 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Jan 22 15:03:22 2016
New Revision: 294567
URL: https://svnweb.freebsd.org/changeset/base/294567

Log:
  Change the variable to a #define in order to make gcc happy which
  otherwise will complain about "variably modified 'alias' at file scope".
  Unbreaks the build on gcc platforms.

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

Modified: head/contrib/bsnmp/snmp_mibII/mibII.h
==
--- head/contrib/bsnmp/snmp_mibII/mibII.h   Fri Jan 22 15:00:01 2016
(r294566)
+++ head/contrib/bsnmp/snmp_mibII/mibII.h   Fri Jan 22 15:03:22 2016
(r294567)
@@ -58,7 +58,7 @@
 #include "mibII_tree.h"
 
 /* maximum size of the interface alias */
-static const u_int MIBIF_ALIAS_SIZE = 64 + 1;
+#defineMIBIF_ALIAS_SIZE(64 + 1)
 
 /*
  * Interface list and flags.
___
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: r294571 - in head/usr.bin/xlint: arch/riscv lint1

2016-01-22 Thread Ruslan Bukin
Author: br
Date: Fri Jan 22 16:32:22 2016
New Revision: 294571
URL: https://svnweb.freebsd.org/changeset/base/294571

Log:
  Add support for RISC-V ISA.
  
  Reviewed by:  andrew
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D5014

Added:
  head/usr.bin/xlint/arch/riscv/
  head/usr.bin/xlint/arch/riscv/targparam.h   (contents, props changed)
Modified:
  head/usr.bin/xlint/lint1/param.h

Added: head/usr.bin/xlint/arch/riscv/targparam.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/xlint/arch/riscv/targparam.h   Fri Jan 22 16:32:22 2016
(r294571)
@@ -0,0 +1,53 @@
+/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $*/
+
+/*
+ * Copyright (c) 1994, 1995 Jochen Pohl
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ * This product includes software developed by Jochen Pohl for
+ * The NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * 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.
+ */
+
+/*
+ * Machine-dependent target parameters for lint1.
+ */
+
+#include "lp64.h"
+
+/*
+ * Should be set to 1 if the difference of two pointers is of type long
+ * or the value of sizeof is of type unsigned long.  Note this MUST be
+ * kept in sync with the compiler!
+ */ 
+
+#definePTRDIFF_IS_LONG 1
+#defineSIZEOF_IS_ULONG 1
+
+#defineFLOAT_SIZE  (4 * CHAR_BIT)
+#defineDOUBLE_SIZE (8 * CHAR_BIT)
+#defineLDOUBLE_SIZE(16 * CHAR_BIT)
+
+#defineENUM_SIZE   (4 * CHAR_BIT)

Modified: head/usr.bin/xlint/lint1/param.h
==
--- head/usr.bin/xlint/lint1/param.hFri Jan 22 15:56:35 2016
(r294570)
+++ head/usr.bin/xlint/lint1/param.hFri Jan 22 16:32:22 2016
(r294571)
@@ -80,6 +80,9 @@
 #elif __powerpc__
 #define PTRDIFF_IS_LONG0
 #define SIZEOF_IS_ULONG0
+#elif __riscv__
+#define PTRDIFF_IS_LONG1
+#define SIZEOF_IS_ULONG1
 #elif __sparc__
 #define PTRDIFF_IS_LONG0
 #define SIZEOF_IS_ULONG0
___
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: r294572 - head/sys/arm64/arm64

2016-01-22 Thread Andrew Turner
Author: andrew
Date: Fri Jan 22 16:35:01 2016
New Revision: 294572
URL: https://svnweb.freebsd.org/changeset/base/294572

Log:
  Stop including fdt_common.h in the arm64 code. We don't use anything from
  it, however may have relied on header pollution to pull in the needed
  headers through it
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/gic_fdt.c
  head/sys/arm64/arm64/gic_v3_fdt.c
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/arm64/nexus.c

Modified: head/sys/arm64/arm64/gic_fdt.c
==
--- head/sys/arm64/arm64/gic_fdt.c  Fri Jan 22 16:32:22 2016
(r294571)
+++ head/sys/arm64/arm64/gic_fdt.c  Fri Jan 22 16:35:01 2016
(r294572)
@@ -30,7 +30,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -38,7 +39,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm64/arm64/gic_v3_fdt.c
==
--- head/sys/arm64/arm64/gic_v3_fdt.c   Fri Jan 22 16:32:22 2016
(r294571)
+++ head/sys/arm64/arm64/gic_v3_fdt.c   Fri Jan 22 16:35:01 2016
(r294572)
@@ -31,13 +31,13 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Fri Jan 22 16:32:22 2016
(r294571)
+++ head/sys/arm64/arm64/machdep.c  Fri Jan 22 16:35:01 2016
(r294572)
@@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #ifdef FDT
-#include 
 #include 
 #endif
 

Modified: head/sys/arm64/arm64/nexus.c
==
--- head/sys/arm64/arm64/nexus.cFri Jan 22 16:32:22 2016
(r294571)
+++ head/sys/arm64/arm64/nexus.cFri Jan 22 16:35:01 2016
(r294572)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_platform.h"
 
 #ifdef FDT
-#include 
+#include 
 #include "ofw_bus_if.h"
 #endif
 #ifdef DEV_ACPI
___
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: r294547 - head/sys/boot/kshim

2016-01-22 Thread Conrad Meyer
Is this incomplete?

On Thu, Jan 21, 2016 at 10:26 PM, Wojciech Macek  wrote:
> 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
>
> ...
>
> +   ret = malloc(sizeof(struct bus_dma_tag), XXX, XXX);
> ...
> +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);

etc.

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"


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

2016-01-22 Thread hiren panchasara
On 01/22/16 at 04:06P, Bjoern A. Zeeb wrote:
> 
> > On 22 Jan 2016, at 15:21 , George Neville-Neil  
> > wrote:
> > 
> > 
> > 
> > On 22 Jan 2016, at 2:13, Lawrence Stewart wrote:
> > 
> >> 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.
> >> 
> > 
> > I actually was wondering about this as well.  I think it ought to be 
> > reverted to agnostic.
> 
> I probably share that view but I also agree that cc.h is not a good name.
> 
> So before we entirely revert this, can when maybe come up with a name that is 
> better than cc.h or tcp_cc.h and only make this one more change forward 
> rather than going back to the previous status quo?

We use "cc" everywhere in the stack to refer to congestion control.
Whether thats mod_cc or cc_ or sys/netinet/cc directory. I don't
see a problem with the name. Neither do I feel a need for any change.

Cheers,
Hiren


pgpG6wFD7H7qH.pgp
Description: PGP signature


svn commit: r294615 - in head: sbin/ifconfig share/man/man4 sys/net

2016-01-22 Thread Marcelo Araujo
Author: araujo
Date: Sat Jan 23 04:18:44 2016
New Revision: 294615
URL: https://svnweb.freebsd.org/changeset/base/294615

Log:
  Add an IOCTL rr_limit to let users fine tuning the number of packets to be
  sent using roundrobin protocol and set a better granularity and distribution
  among the interfaces. Tuning the number of packages sent by interface can
  increase throughput and reduce unordered packets as well as reduce SACK.
  
  Example of usage:
  # ifconfig bge0 up
  # ifconfig bge1 up
  # ifconfig lagg0 create
  # ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \
192.168.1.1 netmask 255.255.255.0
  # ifconfig lagg0 rr_limit 500
  
  Reviewed by:  thompsa, glebius, adrian (old patch)
  Approved by:  bapt (mentor)
  Relnotes: Yes
  Differential Revision:https://reviews.freebsd.org/D540

Modified:
  head/sbin/ifconfig/iflagg.c
  head/share/man/man4/lagg.4
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sbin/ifconfig/iflagg.c
==
--- head/sbin/ifconfig/iflagg.c Sat Jan 23 01:21:11 2016(r294614)
+++ head/sbin/ifconfig/iflagg.c Sat Jan 23 04:18:44 2016(r294615)
@@ -100,6 +100,19 @@ setlaggflowidshift(const char *val, int 
 }
 
 static void
+setlaggrr_limit(const char *val, int d, int s, const struct afswtch *afp)
+{
+   struct lagg_reqopts ro;
+   
+   bzero(, sizeof(ro));
+   strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname));
+   ro.ro_bkt = (int)strtol(val, NULL, 10);
+
+   if (ioctl(s, SIOCSLAGGOPTS, ) != 0)
+   err(1, "SIOCSLAGG");
+}
+
+static void
 setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp)
 {
struct lagg_reqopts ro;
@@ -252,6 +265,8 @@ lagg_status(int s)
printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS);
putchar('\n');
printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift);
+   if (ra.ra_proto == LAGG_PROTO_ROUNDROBIN)
+   printf("\t\trr_limit: %d\n", ro.ro_bkt);
printf("\tlagg statistics:\n");
printf("\t\tactive ports: %d\n", ro.ro_active);
printf("\t\tflapping: %u\n", ro.ro_flapping);
@@ -298,6 +313,7 @@ static struct cmd lagg_cmds[] = {
DEF_CMD("lacp_fast_timeout",LAGG_OPT_LACP_TIMEOUT,  setlaggsetopt),
DEF_CMD("-lacp_fast_timeout",   -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt),
DEF_CMD_ARG("flowid_shift", setlaggflowidshift),
+   DEF_CMD_ARG("rr_limit", setlaggrr_limit),
 };
 static struct afswtch af_lagg = {
.af_name= "af_lagg",

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Sat Jan 23 01:21:11 2016(r294614)
+++ head/share/man/man4/lagg.4  Sat Jan 23 04:18:44 2016(r294615)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 6, 2015
+.Dd January 23, 2016
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -110,6 +110,11 @@ available, the VLAN tag, and the IP sour
 Distributes outgoing traffic using a round-robin scheduler
 through all active ports and accepts incoming traffic from
 any active port.
+Using
+.Ic roundrobin
+mode can cause unordered packet arrival at the client.
+Throughput might be limited as the client performs CPU-intensive packet
+reordering.
 .It Ic broadcast
 Sends frames to all ports of the LAG and receives frames on
 any port of the LAG.
@@ -161,6 +166,19 @@ Gigabit Ethernet interfaces:
192.168.1.1 netmask 255.255.255.0
 .Ed
 .Pp
+Create a link aggregation using ROUNDROBIN with two 
+.Xr bge 4
+Gigabit Ethernet interfaces and set the limit of 500 packets
+per interface:
+.Bd -literal -offset indent
+# ifconfig bge0 up
+# ifconfig bge1 up
+# ifconfig lagg0 create
+# ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \e
+   192.168.1.1 netmask 255.255.255.0
+# ifconfig lagg0 rr_limit 500
+.Ed
+.Pp
 The following example uses an active failover interface to set up roaming
 between wired and wireless networks using two network devices.
 Whenever the wired master interface is unplugged, the wireless failover

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Sat Jan 23 01:21:11 2016(r294614)
+++ head/sys/net/if_lagg.c  Sat Jan 23 04:18:44 2016(r294615)
@@ -3,7 +3,7 @@
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter 
  * Copyright (c) 2007 Andrew Thompson 
- * Copyright (c) 2014 Marcelo Araujo 
+ * Copyright (c) 2014, 2016 Marcelo Araujo 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -1291,10 +1291,17 @@ 

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

2016-01-22 Thread Lawrence Stewart
On 01/23/16 03:06, Bjoern A. Zeeb wrote:
> 
>> On 22 Jan 2016, at 15:21 , George Neville-Neil  wrote:
>>
>>
>>
>> On 22 Jan 2016, at 2:13, Lawrence Stewart wrote:
>>
>>> 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.
>>>
>>
>> I actually was wondering about this as well.  I think it ought to be 
>> reverted to agnostic.
> 
> I probably share that view but I also agree that cc.h is not a good name.
> 
> So before we entirely revert this, can when maybe come up with a name that is 
> better than cc.h or tcp_cc.h and only make this one more change forward 
> rather than going back to the previous status quo?

I don't object to a name change if it's desired by others, but I don't
have any suggestions to offer and would personally just stick with cc.h

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"


svn commit: r294613 - head/usr.bin/whois

2016-01-22 Thread Tony Finch
Author: fanf
Date: Sat Jan 23 01:20:58 2016
New Revision: 294613
URL: https://svnweb.freebsd.org/changeset/base/294613

Log:
  Fix a regression in the .de and .dk whois special cases
  
  Ensure the special cases trigger whether we come via a referral
  or via the -c option. Match host names case-insensitively.
  
  Use the default character set supported by .de (UTF-8) since that
  is more compatible with the modern world than ISO 8859-1. Persuade
  them to give us a useful answer whether an internationalized
  domain name is given in UTF-8 or in punycode.

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

Modified: head/usr.bin/whois/whois.c
==
--- head/usr.bin/whois/whois.c  Sat Jan 23 01:02:28 2016(r294612)
+++ head/usr.bin/whois/whois.c  Sat Jan 23 01:20:58 2016(r294613)
@@ -61,7 +61,8 @@ __FBSDID("$FreeBSD$");
 
 #defineABUSEHOST   "whois.abuse.net"
 #defineANICHOST"whois.arin.net"
-#defineDENICHOST   "de" QNICHOST_TAIL
+#defineDENICHOST   "whois.denic.de"
+#defineDKNICHOST   "whois.dk-hostmaster.dk"
 #defineFNICHOST"whois.afrinic.net"
 #defineGNICHOST"whois.nic.gov"
 #defineIANAHOST"whois.iana.org"
@@ -415,17 +416,24 @@ done:
err(EX_OSERR, "fdopen()");
 
if (!(flags & WHOIS_SPAM_ME) &&
-   strcmp(hostname, DENICHOST) == 0)
-   fprintf(fp, "-T dn,ace -C ISO-8859-1 %s\r\n", query);
-   else if (!(flags & WHOIS_SPAM_ME) &&
-strcmp(hostname, "dk" QNICHOST_TAIL) == 0)
+   (strcasecmp(hostname, DENICHOST) == 0 ||
+strcasecmp(hostname, "de" QNICHOST_TAIL) == 0)) {
+   const char *q;
+   int idn = 0;
+   for (q = query; *q != '\0'; q++)
+   if (!isascii(*q))
+   idn = 1;
+   fprintf(fp, "-T dn%s %s\r\n", idn ? "" : ",ace", query);
+   } else if (!(flags & WHOIS_SPAM_ME) &&
+  (strcasecmp(hostname, DKNICHOST) == 0 ||
+   strcasecmp(hostname, "dk" QNICHOST_TAIL) == 0))
fprintf(fp, "--show-handles %s\r\n", query);
else if ((flags & WHOIS_SPAM_ME) ||
 strchr(query, ' ') != NULL)
fprintf(fp, "%s\r\n", query);
-   else if (strcmp(hostname, ANICHOST) == 0)
+   else if (strcasecmp(hostname, ANICHOST) == 0)
fprintf(fp, "+ %s\r\n", query);
-   else if (strcmp(hostres->ai_canonname, VNICHOST) == 0)
+   else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0)
fprintf(fp, "domain %s\r\n", query);
else
fprintf(fp, "%s\r\n", query);
___
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"