Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Warner Losh
On Fri, Aug 12, 2016 at 3:06 PM, Ngie Cooper  wrote:
> On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery  wrote:
>
> ...
>
>> No, I was missing r303637.  Hard to say if it is related... Andrey says
>> it's not.  I haven't dived into it yet and it's so far only happened
>> once (out of a few tests).  We do have various customizations but I'm
>> inclined to think it's the stock code having problems.
>
> I hit it again on our internal vendor tree (what bdrewery was noting
> previously). I can provide some details about the panic if need be.

Ideally, you'd reproduce it on an unmodified -current. In a vendor tree there's
many chances that something else is odd or off that would make it hard for
the community to help.

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


svn commit: r304034 - head/lib/libc/net

2016-08-12 Thread Garrett Cooper
Author: ngie
Date: Sat Aug 13 02:05:06 2016
New Revision: 304034
URL: https://svnweb.freebsd.org/changeset/base/304034

Log:
  Initialize `ai` to NULL and test for `ai` with type-appropriate values
  
  Depending on the address family and ai_flags containing AI_V4MAPPED,
  it might not do a proper DNS lookup on the provided DNS address
  
  Convert some `ai` boolean true/false checks to NULL/non-NULL while here.
  
  MFC after:1 week
  PR:   211790
  Reported by:  herbie.robin...@stratus.com
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sat Aug 13 01:49:11 2016
(r304033)
+++ head/lib/libc/net/getaddrinfo.c Sat Aug 13 02:05:06 2016
(r304034)
@@ -2249,6 +2249,8 @@ _dns_getaddrinfo(void *rv, void *cb_data
struct res_target q, q2;
res_state res;
 
+   ai = NULL;
+
hostname = va_arg(ap, char *);
pai = va_arg(ap, const struct addrinfo *);
 
@@ -2327,16 +2329,16 @@ _dns_getaddrinfo(void *rv, void *cb_data
/* prefer IPv6 */
if (q.next) {
ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res);
-   if (ai) {
+   if (ai != NULL) {
cur->ai_next = ai;
while (cur && cur->ai_next)
cur = cur->ai_next;
}
}
-   if (!ai || pai->ai_family != AF_UNSPEC ||
+   if (ai == NULL || pai->ai_family != AF_UNSPEC ||
(pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) {
ai = getanswer(buf, q.n, q.name, q.qtype, pai, res);
-   if (ai)
+   if (ai != NULL)
cur->ai_next = ai;
}
free(buf);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304033 - head/lib/libc/tests/resolv

2016-08-12 Thread Ngie Cooper
On Fri, Aug 12, 2016 at 6:49 PM, Garrett Cooper  wrote:
> Author: ngie
> Date: Sat Aug 13 01:49:11 2016
> New Revision: 304033
> URL: https://svnweb.freebsd.org/changeset/base/304033
>
> Log:
>   Increase timeout from 10 minutes to 20 minutes for all tests

Ugh... I meant 7.5 minutes. Sorry >_>...
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304033 - head/lib/libc/tests/resolv

2016-08-12 Thread Garrett Cooper
Author: ngie
Date: Sat Aug 13 01:49:11 2016
New Revision: 304033
URL: https://svnweb.freebsd.org/changeset/base/304033

Log:
  Increase timeout from 10 minutes to 20 minutes for all tests
  
  On particular slow networks, it can (on average) take longer to
  resolve hosts to IP* addresses. 20 minutes seemed reasonable for
  my work network
  
  This will be solved in a more meaningful way (if possible) using
  concurrency in the near future
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/tests/resolv/resolv_test.c

Modified: head/lib/libc/tests/resolv/resolv_test.c
==
--- head/lib/libc/tests/resolv/resolv_test.cSat Aug 13 01:40:08 2016
(r304032)
+++ head/lib/libc/tests/resolv/resolv_test.cSat Aug 13 01:49:11 2016
(r304033)
@@ -291,7 +291,7 @@ do {
\
 
 ATF_TC(getaddrinfo_test);
 ATF_TC_HEAD(getaddrinfo_test, tc) {
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(getaddrinfo_test, tc)
 {
@@ -301,7 +301,7 @@ ATF_TC_BODY(getaddrinfo_test, tc)
 
 ATF_TC(gethostby_test);
 ATF_TC_HEAD(gethostby_test, tc) {
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(gethostby_test, tc)
 {
@@ -312,7 +312,7 @@ ATF_TC_BODY(gethostby_test, tc)
 ATF_TC(getipnodeby_test);
 ATF_TC_HEAD(getipnodeby_test, tc) {
 
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(getipnodeby_test, tc)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304031 - stable/9/sys/dev/usb

2016-08-12 Thread Cy Schubert
Author: cy
Date: Sat Aug 13 01:34:35 2016
New Revision: 304031
URL: https://svnweb.freebsd.org/changeset/base/304031

Log:
  MFC r303806:
  
  Add Logitech Unifying receiver.

Modified:
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/usbdevs
==
--- stable/9/sys/dev/usb/usbdevsSat Aug 13 01:33:53 2016
(r304030)
+++ stable/9/sys/dev/usb/usbdevsSat Aug 13 01:34:35 2016
(r304031)
@@ -2726,6 +2726,7 @@ product LOGITECH BB13 0xc401  USB-PS/2 T
 product LOGITECH RK53  0xc501  Cordless mouse
 product LOGITECH RB6   0xc503  Cordless keyboard
 product LOGITECH MX700 0xc506  Cordless optical mouse
+product LOGITECH UNIFYING  0xc52b  Logitech Unifying Receiver
 product LOGITECH QUICKCAMPRO2  0xd001  QuickCam Pro
 
 /* Logitec Corp. products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304030 - stable/10/sys/dev/usb

2016-08-12 Thread Cy Schubert
Author: cy
Date: Sat Aug 13 01:33:53 2016
New Revision: 304030
URL: https://svnweb.freebsd.org/changeset/base/304030

Log:
  MFC r303806:
  
  Add Logitech Unifying receiver.

Modified:
  stable/10/sys/dev/usb/usbdevs
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/usbdevs
==
--- stable/10/sys/dev/usb/usbdevs   Sat Aug 13 01:32:35 2016
(r304029)
+++ stable/10/sys/dev/usb/usbdevs   Sat Aug 13 01:33:53 2016
(r304030)
@@ -2726,6 +2726,7 @@ product LOGITECH BB13 0xc401  USB-PS/2 T
 product LOGITECH RK53  0xc501  Cordless mouse
 product LOGITECH RB6   0xc503  Cordless keyboard
 product LOGITECH MX700 0xc506  Cordless optical mouse
+product LOGITECH UNIFYING  0xc52b  Logitech Unifying Receiver
 product LOGITECH QUICKCAMPRO2  0xd001  QuickCam Pro
 
 /* Logitec Corp. products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304029 - stable/11/sys/dev/usb

2016-08-12 Thread Cy Schubert
Author: cy
Date: Sat Aug 13 01:32:35 2016
New Revision: 304029
URL: https://svnweb.freebsd.org/changeset/base/304029

Log:
  MFC r303806:
  
  Add Logitech Unifying receiver.

Modified:
  stable/11/sys/dev/usb/usbdevs
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/usbdevs
==
--- stable/11/sys/dev/usb/usbdevs   Fri Aug 12 23:27:56 2016
(r304028)
+++ stable/11/sys/dev/usb/usbdevs   Sat Aug 13 01:32:35 2016
(r304029)
@@ -2729,6 +2729,7 @@ product LOGITECH BB13 0xc401  USB-PS/2 T
 product LOGITECH RK53  0xc501  Cordless mouse
 product LOGITECH RB6   0xc503  Cordless keyboard
 product LOGITECH MX700 0xc506  Cordless optical mouse
+product LOGITECH UNIFYING  0xc52b  Logitech Unifying Receiver
 product LOGITECH QUICKCAMPRO2  0xd001  QuickCam Pro
 
 /* Logitec Corp. products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304021 - in head/sys: conf kern net sys

2016-08-12 Thread Stephen Hurd
Conrad Meyer wrote:
> A manual page for gtaskqueue would be nice, if you have time.

I'll try to pull something together in the next few days.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304028 - stable/11/contrib/blacklist/lib

2016-08-12 Thread Kurt Lidl
Author: lidl
Date: Fri Aug 12 23:27:56 2016
New Revision: 304028
URL: https://svnweb.freebsd.org/changeset/base/304028

Log:
  MFC r303518:
libblacklist: Do not use %m for logging, use strerror(errno)
  
The blacklist library can accept a function to use for logging,
defaulting to vsyslog(), if no function is specified.  Make the
blacklist library use strerror(errno) explicitly, instead of %m,
so that the passed in function does not need to support the
syslog specific placeholder.
  
This matches a change already submitted and accepted upstream.
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/contrib/blacklist/lib/bl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/blacklist/lib/bl.c
==
--- stable/11/contrib/blacklist/lib/bl.cFri Aug 12 23:25:22 2016
(r304027)
+++ stable/11/contrib/blacklist/lib/bl.cFri Aug 12 23:27:56 2016
(r304028)
@@ -152,8 +152,8 @@ bl_init(bl_t b, bool srv)
b->b_fd = socket(PF_LOCAL,
SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_NOSIGPIPE, 0);
if (b->b_fd == -1) {
-   bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%m)",
-   __func__);
+   bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%s)",
+   __func__, strerror(errno));
BL_UNLOCK(b);
return -1;
}
@@ -200,8 +200,8 @@ bl_init(bl_t b, bool srv)
 */
if (b->b_connected != 1) {
bl_log(b->b_fun, LOG_DEBUG,
-   "%s: connect failed for `%s' (%m)",
-   __func__, sun->sun_path);
+   "%s: connect failed for `%s' (%s)",
+   __func__, sun->sun_path, strerror(errno));
b->b_connected = 1;
}
BL_UNLOCK(b);
@@ -220,8 +220,8 @@ bl_init(bl_t b, bool srv)
errno = serrno;
if (rv == -1) {
bl_log(b->b_fun, LOG_ERR,
-   "%s: bind failed for `%s' (%m)",
-   __func__, sun->sun_path);
+   "%s: bind failed for `%s' (%s)",
+   __func__, sun->sun_path, strerror(errno));
goto out;
}
}
@@ -260,7 +260,8 @@ bl_init(bl_t b, bool srv)
if (setsockopt(b->b_fd, CRED_LEVEL, CRED_NAME,
, (socklen_t)sizeof(one)) == -1) {
bl_log(b->b_fun, LOG_ERR, "%s: setsockopt %s "
-   "failed (%m)", __func__, __STRING(CRED_NAME));
+   "failed (%s)", __func__, __STRING(CRED_NAME),
+   strerror(errno));
goto out;
}
 #endif
@@ -296,7 +297,8 @@ bl_create(bool srv, const char *path, vo
return b;
 out:
free(b);
-   bl_log(fun, LOG_ERR, "%s: malloc failed (%m)", __func__);
+   bl_log(fun, LOG_ERR, "%s: malloc failed (%s)", __func__,
+   strerror(errno));
return NULL;
 }
 
@@ -451,7 +453,8 @@ bl_recv(bl_t b)
 
 rlen = recvmsg(b->b_fd, , 0);
 if (rlen == -1) {
-   bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%m)", __func__);
+   bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%s)", __func__,
+   strerror(errno));
return NULL;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304027 - stable/11/usr.bin/resizewin

2016-08-12 Thread Kurt Lidl
Author: lidl
Date: Fri Aug 12 23:25:22 2016
New Revision: 304027
URL: https://svnweb.freebsd.org/changeset/base/304027

Log:
  MFC r303515:
Make resizewin.1 manpage use .Fx macro
  
Fix capitalization of "PuTTY" also.

Modified:
  stable/11/usr.bin/resizewin/resizewin.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/resizewin/resizewin.1
==
--- stable/11/usr.bin/resizewin/resizewin.1 Fri Aug 12 22:44:59 2016
(r304026)
+++ stable/11/usr.bin/resizewin/resizewin.1 Fri Aug 12 23:25:22 2016
(r304027)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 17, 2016
+.Dd July 9, 2016
 .Dt RESIZEWIN 1
 .Os
 .Sh NAME
@@ -55,10 +55,12 @@ updates the kernel's window size to matc
 .Pp
 Note that virtually all modern terninals support VT100/ANSI escape
 sequences, including xterm, konsole, gnome-terminal iTerm,
-Terminal.app, and puTTY.
+Terminal.app, and PuTTY.
 .Sh SEE ALSO
 .Xr resize 1 ,
 .Xr stty 1
 .Sh HISTORY
+The
 .Nm
-appeared in FreeBSD 11.
+command first appeared in
+.Fx 11 .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304026 - in head/sys/fs: nfs nfsclient nfsserver

2016-08-12 Thread Rick Macklem
Author: rmacklem
Date: Fri Aug 12 22:44:59 2016
New Revision: 304026
URL: https://svnweb.freebsd.org/changeset/base/304026

Log:
  Update the nfsstats structure to include the changes needed by
  the patch in D1626 plus changes so that it includes counts for
  NFSv4.1 (and the draft of NFSv4.2).
  Also, make all the counts uint64_t and add a vers field at the
  beginning, so that future revisions can easily be implemented.
  There is code in place to handle the old vesion of the nfsstats
  structure for backwards binary compatibility.
  
  Subsequent commits will update nfsstat(8) to use the new fields.
  
  Submitted by: will (earlier version)
  Reviewed by:  ken
  MFC after:1 month
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D1626

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nfsclient/nfs_clcomsubs.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsclient/nfs_clsubs.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/fs/nfsserver/nfs_nfsdcache.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdsocket.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cFri Aug 12 22:25:01 2016
(r304025)
+++ head/sys/fs/nfs/nfs_commonkrpc.cFri Aug 12 22:44:59 2016
(r304026)
@@ -89,7 +89,7 @@ uint32_t  nfscl_nfs4_done_probes[NFSV41_N
 NFSSTATESPINLOCK;
 NFSREQSPINLOCK;
 NFSDLOCKMUTEX;
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
 extern struct nfsreqhead nfsd_reqq;
 extern int nfscl_ticks;
 extern void (*ncl_call_invalcaches)(struct vnode *);
@@ -642,7 +642,7 @@ newnfs_request(struct nfsrv_descript *nd
procnum = NFSV4PROC_COMPOUND;
 
if (nmp != NULL) {
-   NFSINCRGLOBAL(newnfsstats.rpcrequests);
+   NFSINCRGLOBAL(nfsstatsv1.rpcrequests);
 
/* Map the procnum to the old NFSv2 one, as required. */
if ((nd->nd_flag & ND_NFSV2) != 0) {
@@ -762,18 +762,18 @@ tryagain:
if (stat == RPC_SUCCESS) {
error = 0;
} else if (stat == RPC_TIMEDOUT) {
-   NFSINCRGLOBAL(newnfsstats.rpctimeouts);
+   NFSINCRGLOBAL(nfsstatsv1.rpctimeouts);
error = ETIMEDOUT;
} else if (stat == RPC_VERSMISMATCH) {
-   NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+   NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EOPNOTSUPP;
} else if (stat == RPC_PROGVERSMISMATCH) {
-   NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+   NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EPROTONOSUPPORT;
} else if (stat == RPC_INTR) {
error = EINTR;
} else {
-   NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+   NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EACCES;
}
if (error) {

Modified: head/sys/fs/nfs/nfs_commonport.c
==
--- head/sys/fs/nfs/nfs_commonport.cFri Aug 12 22:25:01 2016
(r304025)
+++ head/sys/fs/nfs/nfs_commonport.cFri Aug 12 22:44:59 2016
(r304026)
@@ -58,7 +58,7 @@ extern void (*nfsd_call_recall)(struct v
 extern int nfsrv_useacl;
 struct mount nfsv4root_mnt;
 int newnfs_numnfsd = 0;
-struct nfsstats newnfsstats;
+struct nfsstatsv1 nfsstatsv1;
 int nfs_numnfscbd = 0;
 int nfscl_debuglevel = 0;
 char nfsv4_callbackaddr[INET6_ADDRSTRLEN];
@@ -69,6 +69,7 @@ void (*ncl_call_invalcaches)(struct vnod
 
 static int nfs_realign_test;
 static int nfs_realign_count;
+static struct ext_nfsstats oldnfsstats;
 
 SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem");
 SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, _realign_test,
@@ -446,9 +447,12 @@ nfssvc_nfscommon(struct thread *td, stru
 static int
 nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
 {
-   int error = EINVAL;
+   int error = EINVAL, i, j;
struct nfsd_idargs nid;
struct nfsd_oidargs onid;
+   struct {
+   int vers;   /* Just the first field of nfsstats. */
+   } nfsstatver;
 
if (uap->flag & NFSSVC_IDNAME) {
if ((uap->flag & NFSSVC_NEWSTRUCT) != 0)
@@ -472,63 +476,157 @@ nfssvc_call(struct thread *p, struct nfs
error = nfssvc_idname();
goto out;
} else if (uap->flag & NFSSVC_GETSTATS) {
-   error = copyout(,
-   CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats));
+   if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) {
+   /* Copy fields to the old 

svn commit: r304025 - head/share/misc

2016-08-12 Thread Toomas Soome
Author: tsoome
Date: Fri Aug 12 22:25:01 2016
New Revision: 304025
URL: https://svnweb.freebsd.org/changeset/base/304025

Log:
  Reviewed by:allanjude
  Approved by:  allanjude (mentor)
  Differential Revision:https://reviews.freebsd.org/D7491

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

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Fri Aug 12 22:22:11 2016
(r304024)
+++ head/share/misc/committers-src.dot  Fri Aug 12 22:25:01 2016
(r304025)
@@ -312,6 +312,7 @@ theraven [label="David Chisnall\ntherave
 thompsa [label="Andrew Thompson\nthom...@freebsd.org\n2005/05/25"]
 ticso [label="Bernd Walter\nti...@freebsd.org\n2002/01/31"]
 tijl [label="Tijl Coosemans\nt...@freebsd.org\n2010/07/16"]
+tsoome [label="Toomas Soome\ntso...@freebsd.org\n2016/08/10"]
 trasz [label="Edward Tomasz Napierala\ntr...@freebsd.org\n2008/08/22"]
 trhodes [label="Tom Rhodes\ntrho...@freebsd.org\n2002/05/28"]
 trociny [label="Mikolaj Golub\ntroc...@freebsd.org\n2011/03/10"]
@@ -363,6 +364,8 @@ adrian -> sgalabov
 
 ae -> melifaro
 
+allanjude -> tsoome
+
 alc -> davide
 
 andre -> qingli
@@ -520,6 +523,7 @@ imp -> sanpei
 imp -> shiba
 imp -> takawata
 imp -> toshi
+imp -> tsoome
 imp -> uch
 
 jake -> bms
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303848 - head/sys/netgraph

2016-08-12 Thread Ngie Cooper (yaneurabeya)

> On Aug 12, 2016, at 11:38, Gleb Smirnoff  wrote:
> 
>  Hi!
> 
>  Sorry, I'm afraid this isn't a correct fix. Simply adding checks
> against NULL to avoid panics at race conditions isn't a solution.
> 
> I can provide help with this problem. It must be related to my
> callout changes, in case if this is a very recent problem.
> 
> Is it a recent problem or an old one?

I should have requested that the change be revised or further qualified first… 
as I said in the CR:

“””
In D7209#150056, @bz wrote:
Is this sudden problem possibly related to glebius' callout changes? I am not 
properly tracking things but if invariants changed and weren't reflected in the 
callers, that might explain.
I don't know to be honest.

I'll add glebius (I should have done that in the first place).
“””

Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r304024 - head/sys/kern

2016-08-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug 12 22:22:11 2016
New Revision: 304024
URL: https://svnweb.freebsd.org/changeset/base/304024

Log:
  Remove unused "X" vnode lock assertion, somehow missed in r303743.
  
  MFC after:1 month

Modified:
  head/sys/kern/vnode_if.src

Modified: head/sys/kern/vnode_if.src
==
--- head/sys/kern/vnode_if.src  Fri Aug 12 22:20:52 2016(r304023)
+++ head/sys/kern/vnode_if.src  Fri Aug 12 22:22:11 2016(r304024)
@@ -44,7 +44,6 @@
 # U: unlocked.
 # -: not applicable.  vnode does not yet (or no longer) exists.
 # =: the same on input and output, may be either L or U.
-# X: locked if not nil.
 #
 # The paramater named "vpp" is assumed to be always used with double
 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304023 - head/sys/kern

2016-08-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug 12 22:20:52 2016
New Revision: 304023
URL: https://svnweb.freebsd.org/changeset/base/304023

Log:
  Print vnode details when vnode locking assertion gets triggered.
  
  MFC after:1 month

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cFri Aug 12 22:00:13 2016(r304022)
+++ head/sys/kern/vfs_subr.cFri Aug 12 22:20:52 2016(r304023)
@@ -4402,6 +4402,10 @@ int vfs_badlock_print = 1;   /* Print lock
 SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, _badlock_print,
 0, "Print lock violations");
 
+int vfs_badlock_vnode = 1; /* Print vnode details on lock violations. */
+SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_vnode, CTLFLAG_RW, _badlock_vnode,
+0, "Print vnode details on lock violations");
+
 #ifdef KDB
 int vfs_badlock_backtrace = 1; /* Print backtrace at lock violations. */
 SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW,
@@ -4416,6 +4420,8 @@ vfs_badlock(const char *msg, const char 
if (vfs_badlock_backtrace)
kdb_backtrace();
 #endif
+   if (vfs_badlock_vnode)
+   vn_printf(vp, "vnode ");
if (vfs_badlock_print)
printf("%s: %p %s\n", str, (void *)vp, msg);
if (vfs_badlock_ddb)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304021 - in head/sys: conf kern net sys

2016-08-12 Thread Conrad Meyer
A manual page for gtaskqueue would be nice, if you have time.

Thanks,
Conrad

On Fri, Aug 12, 2016 at 2:29 PM, Stephen Hurd  wrote:
> Author: shurd (ports committer)
> Date: Fri Aug 12 21:29:44 2016
> New Revision: 304021
> URL: https://svnweb.freebsd.org/changeset/base/304021
>
> Log:
>   Update iflib to support more NIC designs
>
>   - Move group task queue into kern/subr_gtaskqueue.c
>   - Change intr_enable to return an int so it can be detected if it's not
> implemented
>   - Allow different TX/RX queues per set to be different sizes
>   - Don't split up TX mbufs before transmit
>   - Allow a completion queue for TX as well as RX
>   - Pass the RX budget to isc_rxd_available() to allow an earlier return
> and avoid multiple calls
>
>   Submitted by: shurd
>   Reviewed by:  gallatin
>   Approved by:  scottl
>   Differential Revision:https://reviews.freebsd.org/D7393
>
> Added:
>   head/sys/kern/subr_gtaskqueue.c   (contents, props changed)
>   head/sys/sys/gtaskqueue.h   (contents, props changed)
> Modified:
>   head/sys/conf/files
>   head/sys/kern/subr_taskqueue.c
>   head/sys/net/ifdi_if.m
>   head/sys/net/iflib.c
>   head/sys/net/iflib.h
>   head/sys/sys/_task.h
>   head/sys/sys/taskqueue.h
>
> Modified: head/sys/conf/files
> ==
> --- head/sys/conf/files Fri Aug 12 20:33:23 2016(r304020)
> +++ head/sys/conf/files Fri Aug 12 21:29:44 2016(r304021)
> @@ -3349,6 +3349,7 @@ kern/subr_disk.c  standard
>  kern/subr_eventhandler.c   standard
>  kern/subr_fattime.cstandard
>  kern/subr_firmware.c   optional firmware
> +kern/subr_gtaskqueue.c standard
>  kern/subr_hash.c   standard
>  kern/subr_hints.c  standard
>  kern/subr_kdb.cstandard
>
> Added: head/sys/kern/subr_gtaskqueue.c
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/kern/subr_gtaskqueue.c Fri Aug 12 21:29:44 2016
> (r304021)
> @@ -0,0 +1,864 @@
> +/*-
> + * Copyright (c) 2000 Doug Rabson
> + * Copyright (c) 2014 Jeff Roberson
> + * Copyright (c) 2016 Matthew Macy
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#include 
> +__FBSDID("$FreeBSD$");
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues");
> +static voidgtaskqueue_thread_enqueue(void *);
> +static voidgtaskqueue_thread_loop(void *arg);
> +
> +
> +struct gtaskqueue_busy {
> +   struct gtask*tb_running;
> +   TAILQ_ENTRY(gtaskqueue_busy) tb_link;
> +};
> +
> +static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1;
> +
> +struct gtaskqueue {
> +   STAILQ_HEAD(, gtask)tq_queue;
> +   gtaskqueue_enqueue_fn   tq_enqueue;
> +   void*tq_context;
> +   char*tq_name;
> +   TAILQ_HEAD(, gtaskqueue_busy) tq_active;
> +   struct mtx  tq_mutex;
> +   struct thread   **tq_threads;
> +   int tq_tcount;
> +   int tq_spin;
> +   int tq_flags;
> +   int tq_callouts;
> +   taskqueue_callback_fn   tq_callbacks[TASKQUEUE_NUM_CALLBACKS];
> +   void

Re: svn commit: r303848 - head/sys/netgraph

2016-08-12 Thread Sean Bruno
The original problem was reported in this review, it doesn't look like
an "old" problem IMO.

sean

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


svn commit: r304022 - stable/10/release/doc/share/xml

2016-08-12 Thread Glen Barber
Author: gjb
Date: Fri Aug 12 22:00:13 2016
New Revision: 304022
URL: https://svnweb.freebsd.org/changeset/base/304022

Log:
  Document EN-16:10 through EN-16:16.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/doc/share/xml/errata.xml

Modified: stable/10/release/doc/share/xml/errata.xml
==
--- stable/10/release/doc/share/xml/errata.xml  Fri Aug 12 21:29:44 2016
(r304021)
+++ stable/10/release/doc/share/xml/errata.xml  Fri Aug 12 22:00:13 2016
(r304022)
@@ -48,6 +48,62 @@
Fix  support of
11.0-RELEASE
   
+
+  
+   FreeBSD-EN-16:10.dhclient
+   11August2016
+   Better handle unknown options received from
+   aDHCP server
+  
+
+  
+   FreeBSD-EN-16:11.vmbus
+   11August2016
+   Avoid using spin locks for channel message
+   locks
+  
+
+  
+   FreeBSD-EN-16:12.hv_storvsc
+   11August2016
+   Enable INQUIRY result check only on
+   Windows10 host systems
+  
+
+  
+   FreeBSD-EN-16:13.vmbus
+   11August2016
+   Register time counter early enough for TSC freq
+   calibration
+  
+
+  
+   FreeBSD-EN-16:14.hv_storvsc
+   11August2016
+   Disable incorrect callout in
+   
+  
+
+  
+   FreeBSD-EN-16:15.vmbus
+   11August2016
+   Better handle the GPADL setup failure in
+   Hyper-V
+  
+
+  
+   FreeBSD-EN-16:16.hv_storvsc
+   11August2016
+   Fix SCSI INQUIRY checks and error
+   handling
+  
 
   
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304021 - in head/sys: conf kern net sys

2016-08-12 Thread Stephen Hurd
Author: shurd (ports committer)
Date: Fri Aug 12 21:29:44 2016
New Revision: 304021
URL: https://svnweb.freebsd.org/changeset/base/304021

Log:
  Update iflib to support more NIC designs
  
  - Move group task queue into kern/subr_gtaskqueue.c
  - Change intr_enable to return an int so it can be detected if it's not
implemented
  - Allow different TX/RX queues per set to be different sizes
  - Don't split up TX mbufs before transmit
  - Allow a completion queue for TX as well as RX
  - Pass the RX budget to isc_rxd_available() to allow an earlier return
and avoid multiple calls
  
  Submitted by: shurd
  Reviewed by:  gallatin
  Approved by:  scottl
  Differential Revision:https://reviews.freebsd.org/D7393

Added:
  head/sys/kern/subr_gtaskqueue.c   (contents, props changed)
  head/sys/sys/gtaskqueue.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/kern/subr_taskqueue.c
  head/sys/net/ifdi_if.m
  head/sys/net/iflib.c
  head/sys/net/iflib.h
  head/sys/sys/_task.h
  head/sys/sys/taskqueue.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Aug 12 20:33:23 2016(r304020)
+++ head/sys/conf/files Fri Aug 12 21:29:44 2016(r304021)
@@ -3349,6 +3349,7 @@ kern/subr_disk.c  standard
 kern/subr_eventhandler.c   standard
 kern/subr_fattime.cstandard
 kern/subr_firmware.c   optional firmware
+kern/subr_gtaskqueue.c standard
 kern/subr_hash.c   standard
 kern/subr_hints.c  standard
 kern/subr_kdb.cstandard

Added: head/sys/kern/subr_gtaskqueue.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/subr_gtaskqueue.c Fri Aug 12 21:29:44 2016
(r304021)
@@ -0,0 +1,864 @@
+/*-
+ * Copyright (c) 2000 Doug Rabson
+ * Copyright (c) 2014 Jeff Roberson
+ * Copyright (c) 2016 Matthew Macy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues");
+static voidgtaskqueue_thread_enqueue(void *);
+static voidgtaskqueue_thread_loop(void *arg);
+
+
+struct gtaskqueue_busy {
+   struct gtask*tb_running;
+   TAILQ_ENTRY(gtaskqueue_busy) tb_link;
+};
+
+static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1;
+
+struct gtaskqueue {
+   STAILQ_HEAD(, gtask)tq_queue;
+   gtaskqueue_enqueue_fn   tq_enqueue;
+   void*tq_context;
+   char*tq_name;
+   TAILQ_HEAD(, gtaskqueue_busy) tq_active;
+   struct mtx  tq_mutex;
+   struct thread   **tq_threads;
+   int tq_tcount;
+   int tq_spin;
+   int tq_flags;
+   int tq_callouts;
+   taskqueue_callback_fn   tq_callbacks[TASKQUEUE_NUM_CALLBACKS];
+   void*tq_cb_contexts[TASKQUEUE_NUM_CALLBACKS];
+};
+
+#defineTQ_FLAGS_ACTIVE (1 << 0)
+#defineTQ_FLAGS_BLOCKED(1 << 1)
+#defineTQ_FLAGS_UNLOCKED_ENQUEUE   (1 << 2)
+
+#defineDT_CALLOUT_ARMED(1 << 0)
+
+#defineTQ_LOCK(tq) 
\
+   do {

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

2016-08-12 Thread Ngie Cooper
On Fri, Aug 12, 2016 at 11:36 AM, Konstantin Belousov
 wrote:

...

> Because the API is unusable.  It causes full queue iteration when the object
> is NULL, i.e. at the end of the queue, instead of doing nothing.

It would have been nice if this had been documented in the commit
message instead of leaving the reader to guess..
Thank you for the explanation -- I really appreciate it!
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Ngie Cooper
On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery  wrote:

...

> No, I was missing r303637.  Hard to say if it is related... Andrey says
> it's not.  I haven't dived into it yet and it's so far only happened
> once (out of a few tests).  We do have various customizations but I'm
> inclined to think it's the stock code having problems.

I hit it again on our internal vendor tree (what bdrewery was noting
previously). I can provide some details about the panic if need be.
Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-08-12 Thread Ed Schouten
Hi Kostik,

2016-08-12 21:35 GMT+02:00 Konstantin Belousov :
> What is improper about the tail-queue for global object list ?
> Typical operations with it involve all objects in the list.  The only
> special ops I am aware are lookups by name or by dev_t/inode, but having
> the parallel (two) maps there is overkill.

Nothing! That's all good. :-)

All I wanted to say is that I think that it's a pity that
 provides macros that implement operations that can only
be implemented with a suboptimal time complexity. A good example is
SLIST_REMOVE(). In my opinion, it shouldn't exist in the first place.
As soon as you need it, you should have very likely used LIST_*()
instead.

It would be nice if we could at one point get rid of those bad macros,
but I guess I may be too optimistic about that.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304018 - head/sys/boot/efi/loader

2016-08-12 Thread John Baldwin
Author: jhb
Date: Fri Aug 12 19:47:20 2016
New Revision: 304018
URL: https://svnweb.freebsd.org/changeset/base/304018

Log:
  Add defines needed to export SMBIOS serial numbers
  
  Some defines needed for exporting serial numbers from the SMBIOS were
  missed during integration of SMBIOS support in the EFI boot loader (r281138).
  This is needed for getting the hostid set from the system hardware UUID.
  
  PR:   206031
  Submitted by: Thomas Eberhardt 
  MFC after:1 week

Modified:
  head/sys/boot/efi/loader/Makefile

Modified: head/sys/boot/efi/loader/Makefile
==
--- head/sys/boot/efi/loader/Makefile   Fri Aug 12 19:43:06 2016
(r304017)
+++ head/sys/boot/efi/loader/Makefile   Fri Aug 12 19:47:20 2016
(r304018)
@@ -63,6 +63,18 @@ CFLAGS+= -DNO_PCI -DEFI
 LIBSTAND=  ${.OBJDIR}/../../../../lib/libstand/libstand.a
 .endif
 
+.if !defined(BOOT_HIDE_SERIAL_NUMBERS)
+# Export serial numbers, UUID, and asset tag from loader.
+CFLAGS+= -DSMBIOS_SERIAL_NUMBERS
+.if defined(BOOT_LITTLE_ENDIAN_UUID)
+# Use little-endian UUID format as defined in SMBIOS 2.6.
+CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
+.elif defined(BOOT_NETWORK_ENDIAN_UUID)
+# Use network-endian UUID format for backward compatibility.
+CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
+.endif
+.endif
+
 .if ${MK_FORTH} != "no"
 BOOT_FORTH=yes
 CFLAGS+=   -DBOOT_FORTH
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304017 - in stable/10: lib/libc/sys sys/kern sys/sys tests/sys/kern

2016-08-12 Thread John Baldwin
Author: jhb
Date: Fri Aug 12 19:43:06 2016
New Revision: 304017
URL: https://svnweb.freebsd.org/changeset/base/304017

Log:
  MFC 292894,292896: Add ptrace(2) reporting for LWP events.
  
  292894:
  Add ptrace(2) reporting for LWP events.
  
  Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting
  thread creation and destruction. Newly created threads will stop to report
  PL_FLAG_BORN before returning to userland and exiting threads will stop to
  report PL_FLAG_EXIT before exiting completely. Both of these events are
  only enabled and reported if PT_LWP_EVENTS is enabled on a process.
  
  292896:
  Document the recently added support for ptrace(2) LWP events.

Modified:
  stable/10/lib/libc/sys/ptrace.2
  stable/10/sys/kern/kern_fork.c
  stable/10/sys/kern/kern_sig.c
  stable/10/sys/kern/kern_thr.c
  stable/10/sys/kern/sys_process.c
  stable/10/sys/sys/proc.h
  stable/10/sys/sys/ptrace.h
  stable/10/tests/sys/kern/ptrace_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/sys/ptrace.2
==
--- stable/10/lib/libc/sys/ptrace.2 Fri Aug 12 19:31:41 2016
(r304016)
+++ stable/10/lib/libc/sys/ptrace.2 Fri Aug 12 19:43:06 2016
(r304017)
@@ -2,7 +2,7 @@
 .\"$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\"
 .\" This file is in the public domain.
-.Dd October 20, 2015
+.Dd December 29, 2015
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -372,6 +372,20 @@ The flag is set for first event reported
 automatically attached due to
 .Dv PT_FOLLOW_FORK
 enabled.
+.It PL_FLAG_BORN
+This flag is set for the first event reported from a new LWP when LWP
+events are enabled via
+.Dv PT_LWP_EVENTS .
+It is reported along with
+.Dv PL_FLAG_SCX
+and is always reported if LWP events are enabled.
+.It PL_FLAG_EXITED
+This flag is set for the last event reported by an exiting LWP when
+LWP events are enabled via
+.Dv PT_LWP_EVENTS .
+Note that this event is not reported when the last LWP in a process exits.
+The termination of the last thread is reported via a normal process exit
+event.
 .El
 .It pl_sigmask
 The current signal mask of the LWP
@@ -463,6 +477,29 @@ Child processes do not inherit this prop
 The traced process will set the
 .Dv PL_FLAG_FORKED
 flag upon exit from a system call that creates a new process.
+.It PT_LWP_EVENTS
+This request controls tracing of LWP creation and destruction.
+If
+.Fa data
+is non-zero,
+then LWPs will stop to report creation and destruction events.
+If
+.Fa data
+is zero,
+then LWP creation and destruction events will not be reported.
+By default, tracing is not enabled for LWP events.
+Child processes do not inherit this property.
+New LWPs will stop to report an event with
+.Dv PL_FLAG_BORN
+set before executing their first instruction.
+Exiting LWPs will stop to report an event with
+.Dv PL_FLAG_EXITED
+set before completing their termination.
+.Pp
+Note that new processes do not report an event for the creation of their
+initial thread,
+and exiting processes do not report an event for the termination of the
+last thread.
 .It PT_VM_TIMESTAMP
 This request returns the generation number or timestamp of the memory map of
 the traced process as the return value from

Modified: stable/10/sys/kern/kern_fork.c
==
--- stable/10/sys/kern/kern_fork.c  Fri Aug 12 19:31:41 2016
(r304016)
+++ stable/10/sys/kern/kern_fork.c  Fri Aug 12 19:43:06 2016
(r304017)
@@ -1083,7 +1083,7 @@ fork_return(struct thread *td, struct tr
cv_broadcast(>p_dbgwait);
}
PROC_UNLOCK(p);
-   } else if (p->p_flag & P_TRACED) {
+   } else if (p->p_flag & P_TRACED || td->td_dbgflags & TDB_BORN) {
/*
 * This is the start of a new thread in a traced
 * process.  Report a system call exit event.
@@ -1091,9 +1091,10 @@ fork_return(struct thread *td, struct tr
PROC_LOCK(p);
td->td_dbgflags |= TDB_SCX;
_STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
-   if ((p->p_stops & S_PT_SCX) != 0)
+   if ((p->p_stops & S_PT_SCX) != 0 ||
+   (td->td_dbgflags & TDB_BORN) != 0)
ptracestop(td, SIGTRAP);
-   td->td_dbgflags &= ~TDB_SCX;
+   td->td_dbgflags &= ~(TDB_SCX | TDB_BORN);
PROC_UNLOCK(p);
}
 

Modified: stable/10/sys/kern/kern_sig.c
==
--- stable/10/sys/kern/kern_sig.c   Fri Aug 12 19:31:41 2016
(r304016)
+++ stable/10/sys/kern/kern_sig.c   Fri Aug 12 19:43:06 2016
(r304017)
@@ -2488,7 +2488,12 @@ ptracestop(struct thread *td, int sig)
td->td_tid, p->p_pid, td->td_dbgflags, sig);
PROC_SLOCK(p);
while 

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

2016-08-12 Thread Konstantin Belousov
On Fri, Aug 12, 2016 at 09:32:37PM +0200, Ed Schouten wrote:
> 2016-08-12 20:36 GMT+02:00 Konstantin Belousov :
> > Because the API is unusable.  It causes full queue iteration when the object
> > is NULL, i.e. at the end of the queue, instead of doing nothing.
> 
> Ah, thanks for working on this then. I personally think that all of
> those macros in  that run in linear time should be
> removed. Why not just use the proper data structure?

What is improper about the tail-queue for global object list ?
Typical operations with it involve all objects in the list.  The only
special ops I am aware are lookups by name or by dev_t/inode, but having
the parallel (two) maps there is overkill.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-08-12 Thread Ed Schouten
2016-08-12 20:36 GMT+02:00 Konstantin Belousov :
> Because the API is unusable.  It causes full queue iteration when the object
> is NULL, i.e. at the end of the queue, instead of doing nothing.

Ah, thanks for working on this then. I personally think that all of
those macros in  that run in linear time should be
removed. Why not just use the proper data structure?

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304016 - in head: lib/libsysdecode libexec/rtld-elf

2016-08-12 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 12 19:31:41 2016
New Revision: 304016
URL: https://svnweb.freebsd.org/changeset/base/304016

Log:
  Move defines common between rtld and libsysdecode into the header,
  instead of copying inline into sources.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Added:
  head/libexec/rtld-elf/rtld_utrace.h   (contents, props changed)
Modified:
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/utrace.c
  head/libexec/rtld-elf/rtld.c

Modified: head/lib/libsysdecode/Makefile
==
--- head/lib/libsysdecode/Makefile  Fri Aug 12 19:26:12 2016
(r304015)
+++ head/lib/libsysdecode/Makefile  Fri Aug 12 19:31:41 2016
(r304016)
@@ -9,6 +9,7 @@ SRCS=   errno.c ioctl.c syscallnames.c utr
 INCS=  sysdecode.h
 
 CFLAGS+= -I${.CURDIR}/../../sys
+CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf
 
 MAN+=  sysdecode.3 \
sysdecode_abi_to_freebsd_errno.3 \

Modified: head/lib/libsysdecode/utrace.c
==
--- head/lib/libsysdecode/utrace.c  Fri Aug 12 19:26:12 2016
(r304015)
+++ head/lib/libsysdecode/utrace.c  Fri Aug 12 19:31:41 2016
(r304016)
@@ -35,33 +35,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
-#defineUTRACE_DLOPEN_START 1
-#defineUTRACE_DLOPEN_STOP  2
-#defineUTRACE_DLCLOSE_START3
-#defineUTRACE_DLCLOSE_STOP 4
-#defineUTRACE_LOAD_OBJECT  5
-#defineUTRACE_UNLOAD_OBJECT6
-#defineUTRACE_ADD_RUNDEP   7
-#defineUTRACE_PRELOAD_FINISHED 8
-#defineUTRACE_INIT_CALL9
-#defineUTRACE_FINI_CALL10
-#defineUTRACE_DLSYM_START  11
-#defineUTRACE_DLSYM_STOP   12
-
-struct utrace_rtld {
-   char sig[4];/* 'RTLD' */
-   int event;
-   void *handle;
-   void *mapbase;
-   size_t mapsize;
-   int refcnt;
-   char name[MAXPATHLEN];
-};
+#include "rtld_utrace.h"
 
 #ifdef __LP64__
 struct utrace_rtld32 {
-   char sig[4];/* 'RTLD' */
+   char sig[4];
int event;
uint32_t handle;
uint32_t mapbase;
@@ -189,10 +167,11 @@ sysdecode_utrace(FILE *fp, void *p, size
struct utrace_malloc um;
struct utrace_malloc32 *pm;
 #endif
+   static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG;
 
-   if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) {
+   if (len == sizeof(struct utrace_rtld) && bcmp(p, rtld_utrace_sig,
+   sizeof(rtld_utrace_sig)) == 0)
return (print_utrace_rtld(fp, p));
-   }
 
if (len == sizeof(struct utrace_malloc)) {
print_utrace_malloc(fp, p);
@@ -200,7 +179,8 @@ sysdecode_utrace(FILE *fp, void *p, size
}
 
 #ifdef __LP64__
-   if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) {
+   if (len == sizeof(struct utrace_rtld32) && bcmp(p, rtld_utrace_sig,
+   sizeof(rtld_utrace_sig)) == 0) {
pr = p;
memset(, 0, sizeof(ur));
memcpy(ur.sig, pr->sig, sizeof(ur.sig));

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri Aug 12 19:26:12 2016
(r304015)
+++ head/libexec/rtld-elf/rtld.cFri Aug 12 19:31:41 2016
(r304016)
@@ -59,6 +59,7 @@
 #include "paths.h"
 #include "rtld_tls.h"
 #include "rtld_printf.h"
+#include "rtld_utrace.h"
 #include "notes.h"
 
 /* Types. */
@@ -273,29 +274,6 @@ char *ld_env_prefix = LD_;
 (dlp)->num_alloc = obj_count,  \
 (dlp)->num_used = 0)
 
-#defineUTRACE_DLOPEN_START 1
-#defineUTRACE_DLOPEN_STOP  2
-#defineUTRACE_DLCLOSE_START3
-#defineUTRACE_DLCLOSE_STOP 4
-#defineUTRACE_LOAD_OBJECT  5
-#defineUTRACE_UNLOAD_OBJECT6
-#defineUTRACE_ADD_RUNDEP   7
-#defineUTRACE_PRELOAD_FINISHED 8
-#defineUTRACE_INIT_CALL9
-#defineUTRACE_FINI_CALL10
-#defineUTRACE_DLSYM_START  11
-#defineUTRACE_DLSYM_STOP   12
-
-struct utrace_rtld {
-   char sig[4];/* 'RTLD' */
-   int event;
-   void *handle;
-   void *mapbase;  /* Used for 'parent' and 'init/fini' */
-   size_t mapsize;
-   int refcnt; /* Used for 'mode' */
-   char name[MAXPATHLEN];
-};
-
 #defineLD_UTRACE(e, h, mb, ms, r, n) do {  \
if (ld_utrace != 

svn commit: r304015 - releng/11.0/release

2016-08-12 Thread Glen Barber
Author: gjb
Date: Fri Aug 12 19:26:12 2016
New Revision: 304015
URL: https://svnweb.freebsd.org/changeset/base/304015

Log:
  MFs11 r304014:
  MFC r303897:
Pass overrides to make(1) when building ports for arm/armv6
targets, similar to what is done for the run-autotools-fixup
override for non-arm targets.
  
While here, set SRCBRANCH in release.conf.sample to use
releng/11.0, which is a direct commit to releng/11.0.
  
  Approved by:  re (kib)
  Sponsored by: The FreeBSD Foundation

Modified:
  releng/11.0/release/release.conf.sample
  releng/11.0/release/release.sh
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/release/release.conf.sample
==
--- releng/11.0/release/release.conf.sample Fri Aug 12 19:06:29 2016
(r304014)
+++ releng/11.0/release/release.conf.sample Fri Aug 12 19:26:12 2016
(r304015)
@@ -16,7 +16,7 @@ CHROOTDIR="/scratch"
 SVNROOT="svn://svn.FreeBSD.org/"
 
 ## Set the src/, ports/, and doc/ branches or tags.
-SRCBRANCH="base/stable/11@rHEAD"
+SRCBRANCH="base/releng/11.0@rHEAD"
 DOCBRANCH="doc/head@rHEAD"
 PORTBRANCH="ports/head@rHEAD"
 

Modified: releng/11.0/release/release.sh
==
--- releng/11.0/release/release.sh  Fri Aug 12 19:06:29 2016
(r304014)
+++ releng/11.0/release/release.sh  Fri Aug 12 19:26:12 2016
(r304015)
@@ -287,9 +287,15 @@ extra_chroot_setup() {
fi
 
if [ ! -z "${EMBEDDEDPORTS}" ]; then
+   _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
+   REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V 
REVISION)
+   BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
+   PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes"
+   PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}"
+   PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}"
for _PORT in ${EMBEDDEDPORTS}; do
eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \
-   BATCH=1 FORCE_PKG_REGISTER=1 install clean 
distclean
+   FORCE_PKG_REGISTER=1 ${PBUILD_FLAGS} install 
clean distclean
done
fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304014 - in stable: 10/release 11/release

2016-08-12 Thread Glen Barber
Author: gjb
Date: Fri Aug 12 19:06:29 2016
New Revision: 304014
URL: https://svnweb.freebsd.org/changeset/base/304014

Log:
  MFC r303897:
Pass overrides to make(1) when building ports for arm/armv6
targets, similar to what is done for the run-autotools-fixup
override for non-arm targets.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/release.sh
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/release/release.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/release/release.sh
==
--- stable/11/release/release.shFri Aug 12 18:53:08 2016
(r304013)
+++ stable/11/release/release.shFri Aug 12 19:06:29 2016
(r304014)
@@ -287,9 +287,15 @@ extra_chroot_setup() {
fi
 
if [ ! -z "${EMBEDDEDPORTS}" ]; then
+   _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
+   REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V 
REVISION)
+   BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
+   PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes"
+   PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}"
+   PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}"
for _PORT in ${EMBEDDEDPORTS}; do
eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \
-   BATCH=1 FORCE_PKG_REGISTER=1 install clean 
distclean
+   FORCE_PKG_REGISTER=1 ${PBUILD_FLAGS} install 
clean distclean
done
fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304014 - in stable: 10/release 11/release

2016-08-12 Thread Glen Barber
Author: gjb
Date: Fri Aug 12 19:06:29 2016
New Revision: 304014
URL: https://svnweb.freebsd.org/changeset/base/304014

Log:
  MFC r303897:
Pass overrides to make(1) when building ports for arm/armv6
targets, similar to what is done for the run-autotools-fixup
override for non-arm targets.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/release.sh
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/release/release.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/release/release.sh
==
--- stable/10/release/release.shFri Aug 12 18:53:08 2016
(r304013)
+++ stable/10/release/release.shFri Aug 12 19:06:29 2016
(r304014)
@@ -281,9 +281,15 @@ extra_chroot_setup() {
fi
 
if [ ! -z "${EMBEDDEDPORTS}" ]; then
+   _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
+   REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V 
REVISION)
+   BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
+   PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes"
+   PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}"
+   PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}"
for _PORT in ${EMBEDDEDPORTS}; do
eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \
-   BATCH=1 FORCE_PKG_REGISTER=1 install clean 
distclean
+   FORCE_PKG_REGISTER=1 ${PBUILD_FLAGS} install 
clean distclean
done
fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304013 - svnadmin/conf

2016-08-12 Thread Glen Barber
Author: gjb
Date: Fri Aug 12 18:53:08 2016
New Revision: 304013
URL: https://svnweb.freebsd.org/changeset/base/304013

Log:
  Thaw stable/11 after releng/11.0 has branched.
  
  Committers are requested to excercise caution for the duration
  of the 11.0-RELEASE cycle, especially regarding changes that
  are eligible (or proposed) for MFC to releng/11.0.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Fri Aug 12 18:31:44 2016(r304012)
+++ svnadmin/conf/approvers Fri Aug 12 18:53:08 2016(r304013)
@@ -17,7 +17,7 @@
 # $FreeBSD$
 #
 #^head/re
-^stable/11/re
+#^stable/11/   re
 #^stable/10/   re
 ^release/  re
 ^releng/11.0/  re
@@ -35,5 +35,5 @@
 ^head/LOCKScore
 ^head/sys/dev/random   (security-officer|so|secteam|core)
 ^head/sys/libkern/arc4random.c (security-officer|so|secteam|core)
-^stable/([7-9]|10)/sys/dev/random  (security-officer|so|secteam|core)
-^stable/([7-9]|10)/sys/libkern/arc4random.c
(security-officer|so|secteam|core)
+^stable/([7-9]|1[01])/sys/dev/random   (security-officer|so|secteam|core)
+^stable/([7-9]|1[01])/sys/libkern/arc4random.c 
(security-officer|so|secteam|core)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303848 - head/sys/netgraph

2016-08-12 Thread Gleb Smirnoff
  Hi!

  Sorry, I'm afraid this isn't a correct fix. Simply adding checks
against NULL to avoid panics at race conditions isn't a solution.

I can provide help with this problem. It must be related to my
callout changes, in case if this is a very recent problem.

Is it a recent problem or an old one?

On Mon, Aug 08, 2016 at 07:31:01PM +, Sean Bruno wrote:
S> Author: sbruno
S> Date: Mon Aug  8 19:31:01 2016
S> New Revision: 303848
S> URL: https://svnweb.freebsd.org/changeset/base/303848
S> 
S> Log:
S>   Avoid panic from ng_uncallout when unpluggin ethernet cable with active
S>   PPTP VPN connection.
S>   
S>   Submitted by:  Michael Zhilin 
S>   Reviewed by:   ngie
S>   MFC after: 3 days
S>   Differential Revision: https://reviews.freebsd.org/D7209
S> 
S> Modified:
S>   head/sys/netgraph/ng_base.c
S> 
S> Modified: head/sys/netgraph/ng_base.c
S> 
==
S> --- head/sys/netgraph/ng_base.c  Mon Aug  8 18:57:50 2016
(r303847)
S> +++ head/sys/netgraph/ng_base.c  Mon Aug  8 19:31:01 2016
(r303848)
S> @@ -3815,7 +3815,7 @@ ng_uncallout(struct callout *c, node_p n
S>  item = c->c_arg;
S>  /* Do an extra check */
S>  if ((rval > 0) && (c->c_func == _callout_trampoline) &&
S> -(NGI_NODE(item) == node)) {
S> +(item != NULL) && (NGI_NODE(item) == node)) {
S>  /*
S>   * We successfully removed it from the queue before it ran
S>   * So now we need to unreference everything that was
S> ___
S> svn-src-all@freebsd.org mailing list
S> https://lists.freebsd.org/mailman/listinfo/svn-src-all
S> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

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


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

2016-08-12 Thread Konstantin Belousov
On Fri, Aug 12, 2016 at 11:34:42AM -0700, Ngie Cooper wrote:
> 
> > On Aug 12, 2016, at 11:29, Konstantin Belousov  wrote:
> > 
> > Author: kib
> > Date: Fri Aug 12 18:29:11 2016
> > New Revision: 304011
> > URL: https://svnweb.freebsd.org/changeset/base/304011
> > 
> > Log:
> >  Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
> 
> Why?
Because the API is unusable.  It causes full queue iteration when the object
is NULL, i.e. at the end of the queue, instead of doing nothing.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-08-12 Thread Ngie Cooper

> On Aug 12, 2016, at 11:29, Konstantin Belousov  wrote:
> 
> Author: kib
> Date: Fri Aug 12 18:29:11 2016
> New Revision: 304011
> URL: https://svnweb.freebsd.org/changeset/base/304011
> 
> Log:
>  Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.

Why?

>  Sponsored by:The FreeBSD Foundation
>  MFC after:1 week
> 
> Modified:
>  head/libexec/rtld-elf/rtld.c
> 
> Modified: head/libexec/rtld-elf/rtld.c
> ==
> --- head/libexec/rtld-elf/rtld.cFri Aug 12 18:07:44 2016(r304010)
> +++ head/libexec/rtld-elf/rtld.cFri Aug 12 18:29:11 2016(r304011)
> @@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in
> {
> Obj_Entry *obj;
> 
> -obj = first;
> -TAILQ_FOREACH_FROM(obj, _list, next) {
> +for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
>if (obj->marker)
>continue;
>if (process_needed(obj, obj->needed, flags) == -1)
> @@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool 
>Obj_Entry *obj;
>int error;
> 
> -error = 0;
> -obj = first;
> -TAILQ_FOREACH_FROM(obj, _list, next) {
> +for (error = 0, obj = first;  obj != NULL;
> +obj = TAILQ_NEXT(obj, next)) {
>if (obj->marker)
>continue;
>error = relocate_object(obj, bind_now, rtldobj, flags,
> @@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first, 
> {
>Obj_Entry *obj;
> 
> -obj = first;
> -TAILQ_FOREACH_FROM(obj, _list, next) {
> +for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
>if (obj->marker)
>continue;
>if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1)
> @@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj)
> 
> list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL"));
> 
> -TAILQ_FOREACH_FROM(obj, _list, next) {
> +for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
>Needed_Entry*needed;
>char*name, *path;
>boolis_lib;
> @@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldt
> */
>free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
> } else {
> -obj = objs;
> -TAILQ_FOREACH_FROM(obj, _list, next) {
> +for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
>if (obj->marker || obj->tlsoffset == 0)
>continue;
>addr = segbase - obj->tlsoffset;
> 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304012 - head/libexec/rtld-elf

2016-08-12 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 12 18:31:44 2016
New Revision: 304012
URL: https://svnweb.freebsd.org/changeset/base/304012

Log:
  Fill phdr and phsize for rtld object.  It is needed for
  dl_iterate_phdr() reporting the correct values.
  
  PR:   211367
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri Aug 12 18:29:11 2016
(r304011)
+++ head/libexec/rtld-elf/rtld.cFri Aug 12 18:31:44 2016
(r304012)
@@ -1916,6 +1916,7 @@ static void
 init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info)
 {
 Obj_Entry objtmp;  /* Temporary rtld object */
+const Elf_Ehdr *ehdr;
 const Elf_Dyn *dyn_rpath;
 const Elf_Dyn *dyn_soname;
 const Elf_Dyn *dyn_runpath;
@@ -1954,6 +1955,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo *
 
relocate_objects(, true, , 0, NULL);
 }
+ehdr = (Elf_Ehdr *)mapbase;
+objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff);
+objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]);
 
 /* Initialize the object list. */
 TAILQ_INIT(_list);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304011 - head/libexec/rtld-elf

2016-08-12 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 12 18:29:11 2016
New Revision: 304011
URL: https://svnweb.freebsd.org/changeset/base/304011

Log:
  Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri Aug 12 18:07:44 2016
(r304010)
+++ head/libexec/rtld-elf/rtld.cFri Aug 12 18:29:11 2016
(r304011)
@@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in
 {
 Obj_Entry *obj;
 
-obj = first;
-TAILQ_FOREACH_FROM(obj, _list, next) {
+for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
if (process_needed(obj, obj->needed, flags) == -1)
@@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool 
Obj_Entry *obj;
int error;
 
-   error = 0;
-   obj = first;
-   TAILQ_FOREACH_FROM(obj, _list, next) {
+   for (error = 0, obj = first;  obj != NULL;
+   obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
error = relocate_object(obj, bind_now, rtldobj, flags,
@@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first, 
 {
Obj_Entry *obj;
 
-   obj = first;
-   TAILQ_FOREACH_FROM(obj, _list, next) {
+   for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1)
@@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj)
 
 list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL"));
 
-TAILQ_FOREACH_FROM(obj, _list, next) {
+for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
Needed_Entry*needed;
char*name, *path;
boolis_lib;
@@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldt
 */
free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
 } else {
-   obj = objs;
-   TAILQ_FOREACH_FROM(obj, _list, next) {
+   for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker || obj->tlsoffset == 0)
continue;
addr = segbase - obj->tlsoffset;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304009 - head/bin/ps

2016-08-12 Thread John Baldwin
Author: jhb
Date: Fri Aug 12 16:13:50 2016
New Revision: 304009
URL: https://svnweb.freebsd.org/changeset/base/304009

Log:
  Remove description of P_FOLLOWFORK as this flag was removed.

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Fri Aug 12 16:05:53 2016(r304008)
+++ head/bin/ps/ps.1Fri Aug 12 16:13:50 2016(r304009)
@@ -29,7 +29,7 @@
 .\" @(#)ps.1   8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2016
+.Dd August 12, 2016
 .Dt PS 1
 .Os
 .Sh NAME
@@ -319,7 +319,6 @@ the include file
 .It Dv "P_ADVLOCK" Ta No "0x1" Ta "Process may hold a POSIX advisory lock"
 .It Dv "P_CONTROLT" Ta No "0x2" Ta "Has a controlling terminal"
 .It Dv "P_KPROC" Ta No "0x4" Ta "Kernel process"
-.It Dv "P_FOLLOWFORK" Ta No "0x8" Ta "Attach debugger to new children"
 .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit"
 .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling"
 .It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304008 - head/sys/dev/filemon

2016-08-12 Thread Bryan Drewery
Author: bdrewery
Date: Fri Aug 12 16:05:53 2016
New Revision: 304008
URL: https://svnweb.freebsd.org/changeset/base/304008

Log:
  Avoid taking PROC_LOCK in syscalls if not being traced.
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

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

Modified: head/sys/dev/filemon/filemon.c
==
--- head/sys/dev/filemon/filemon.c  Fri Aug 12 14:10:11 2016
(r304007)
+++ head/sys/dev/filemon/filemon.c  Fri Aug 12 16:05:53 2016
(r304008)
@@ -137,6 +137,8 @@ filemon_proc_get(struct proc *p)
 {
struct filemon *filemon;
 
+   if (p->p_filemon == NULL)
+   return (NULL);
PROC_LOCK(p);
filemon = filemon_acquire(p->p_filemon);
PROC_UNLOCK(p);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Bryan Drewery
On 8/12/16 8:21 AM, Warner Losh wrote:
> On Fri, Aug 12, 2016 at 9:17 AM, Kenneth D. Merry  wrote:
>> On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote:
>>> On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry  wrote:
 On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote:
> On 12.08.16 03:26, Bryan Drewery wrote:
>> On r303467 I ran into this:
>>
>> panic @ time 1470916206.652, thread 0xf8000412f000:
>> g_resize_provider_event but withered
>> cpuid = 0
>> Panic occurred in module kernel loaded at 0x8020:
>>
>> Stack: --
>> kernel:kassert_panic+0x166
>> kernel:g_resize_provider_event+0x181
>> kernel:g_run_events+0x186^M^M
>> kernel:fork_exit+0x83^M^M
>> --
>>
>> No further information available unfortunately.
>
> This one is related to r302087 :)

 It looks like there is a race.  I think we need to replace the KASSERT
 in g_resize_provider_event() with a return in case the provider is
 withered.

 I won't be able to work on or test this until sometime next week.  So if
 you guys want to go ahead and make the change, please do.
>>>
>>> But why are we calling g_resize_provider on a withered object? That's
>>> the part I don't understand in this thread.
>>
>> It isn't withered when the event is queued, but it is withered by the time
>> the event is executed.
>>
>> There is a check in g_resize_provider() to make sure it isn't withered.  If
>> not, the event is queued.  But once g_resize_provider_event() runs, it is
>> withered and we run into the KASSERT.
>>
>> There isn't adequate locking and ordering in there to prevent the race
>> from happening, so the assert should be replaced with an "if (withered)
>> return" statement.
> 
> I'll grant that we may wither with outstanding events, but why is it
> withering? That seems odd. Either we're bogusly posting this event
> just before it will wither, or something else is bogusly withering it.
> Just removing the assert isn't going to fix the underlying issue.
> 
> Back to Bryan: just to be clear, this is with the latest version of
> the code, and not the intermediate version that was fixed after
> numerous problems surfaced, right?
> 

No, I was missing r303637.  Hard to say if it is related... Andrey says
it's not.  I haven't dived into it yet and it's so far only happened
once (out of a few tests).  We do have various customizations but I'm
inclined to think it's the stock code having problems.


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Warner Losh
On Fri, Aug 12, 2016 at 9:17 AM, Kenneth D. Merry  wrote:
> On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote:
>> On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry  wrote:
>> > On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote:
>> >> On 12.08.16 03:26, Bryan Drewery wrote:
>> >> > On r303467 I ran into this:
>> >> >
>> >> > panic @ time 1470916206.652, thread 0xf8000412f000:
>> >> > g_resize_provider_event but withered
>> >> > cpuid = 0
>> >> > Panic occurred in module kernel loaded at 0x8020:
>> >> >
>> >> > Stack: --
>> >> > kernel:kassert_panic+0x166
>> >> > kernel:g_resize_provider_event+0x181
>> >> > kernel:g_run_events+0x186^M^M
>> >> > kernel:fork_exit+0x83^M^M
>> >> > --
>> >> >
>> >> > No further information available unfortunately.
>> >>
>> >> This one is related to r302087 :)
>> >
>> > It looks like there is a race.  I think we need to replace the KASSERT
>> > in g_resize_provider_event() with a return in case the provider is
>> > withered.
>> >
>> > I won't be able to work on or test this until sometime next week.  So if
>> > you guys want to go ahead and make the change, please do.
>>
>> But why are we calling g_resize_provider on a withered object? That's
>> the part I don't understand in this thread.
>
> It isn't withered when the event is queued, but it is withered by the time
> the event is executed.
>
> There is a check in g_resize_provider() to make sure it isn't withered.  If
> not, the event is queued.  But once g_resize_provider_event() runs, it is
> withered and we run into the KASSERT.
>
> There isn't adequate locking and ordering in there to prevent the race
> from happening, so the assert should be replaced with an "if (withered)
> return" statement.

I'll grant that we may wither with outstanding events, but why is it
withering? That seems odd. Either we're bogusly posting this event
just before it will wither, or something else is bogusly withering it.
Just removing the assert isn't going to fix the underlying issue.

Back to Bryan: just to be clear, this is with the latest version of
the code, and not the intermediate version that was fixed after
numerous problems surfaced, right?

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


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Kenneth D. Merry
On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote:
> On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry  wrote:
> > On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote:
> >> On 12.08.16 03:26, Bryan Drewery wrote:
> >> > On r303467 I ran into this:
> >> >
> >> > panic @ time 1470916206.652, thread 0xf8000412f000:
> >> > g_resize_provider_event but withered
> >> > cpuid = 0
> >> > Panic occurred in module kernel loaded at 0x8020:
> >> >
> >> > Stack: --
> >> > kernel:kassert_panic+0x166
> >> > kernel:g_resize_provider_event+0x181
> >> > kernel:g_run_events+0x186^M^M
> >> > kernel:fork_exit+0x83^M^M
> >> > --
> >> >
> >> > No further information available unfortunately.
> >>
> >> This one is related to r302087 :)
> >
> > It looks like there is a race.  I think we need to replace the KASSERT
> > in g_resize_provider_event() with a return in case the provider is
> > withered.
> >
> > I won't be able to work on or test this until sometime next week.  So if
> > you guys want to go ahead and make the change, please do.
> 
> But why are we calling g_resize_provider on a withered object? That's
> the part I don't understand in this thread.

It isn't withered when the event is queued, but it is withered by the time
the event is executed.

There is a check in g_resize_provider() to make sure it isn't withered.  If
not, the event is queued.  But once g_resize_provider_event() runs, it is
withered and we run into the KASSERT.

There isn't adequate locking and ordering in there to prevent the race
from happening, so the assert should be replaced with an "if (withered)
return" statement.

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


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Warner Losh
On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry  wrote:
> On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote:
>> On 12.08.16 03:26, Bryan Drewery wrote:
>> > On r303467 I ran into this:
>> >
>> > panic @ time 1470916206.652, thread 0xf8000412f000:
>> > g_resize_provider_event but withered
>> > cpuid = 0
>> > Panic occurred in module kernel loaded at 0x8020:
>> >
>> > Stack: --
>> > kernel:kassert_panic+0x166
>> > kernel:g_resize_provider_event+0x181
>> > kernel:g_run_events+0x186^M^M
>> > kernel:fork_exit+0x83^M^M
>> > --
>> >
>> > No further information available unfortunately.
>>
>> This one is related to r302087 :)
>
> It looks like there is a race.  I think we need to replace the KASSERT
> in g_resize_provider_event() with a return in case the provider is
> withered.
>
> I won't be able to work on or test this until sometime next week.  So if
> you guys want to go ahead and make the change, please do.

But why are we calling g_resize_provider on a withered object? That's
the part I don't understand in this thread.

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


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Kenneth D. Merry
On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote:
> On 12.08.16 03:26, Bryan Drewery wrote:
> > On r303467 I ran into this:
> > 
> > panic @ time 1470916206.652, thread 0xf8000412f000:
> > g_resize_provider_event but withered
> > cpuid = 0
> > Panic occurred in module kernel loaded at 0x8020:
> > 
> > Stack: --
> > kernel:kassert_panic+0x166
> > kernel:g_resize_provider_event+0x181
> > kernel:g_run_events+0x186^M^M
> > kernel:fork_exit+0x83^M^M
> > --
> > 
> > No further information available unfortunately.
> 
> This one is related to r302087 :)

It looks like there is a race.  I think we need to replace the KASSERT
in g_resize_provider_event() with a return in case the provider is
withered.

I won't be able to work on or test this until sometime next week.  So if
you guys want to go ahead and make the change, please do.

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


svn commit: r304007 - head/bin/ps

2016-08-12 Thread Warren Block
Author: wblock (doc committer)
Date: Fri Aug 12 14:10:11 2016
New Revision: 304007
URL: https://svnweb.freebsd.org/changeset/base/304007

Log:
  Correct the history of where ps first appeared.
  
  PR:   211741
  Submitted by: Sevan Janiyan 
  MFC after:1 week

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Fri Aug 12 13:52:51 2016(r304006)
+++ head/bin/ps/ps.1Fri Aug 12 14:10:11 2016(r304007)
@@ -768,7 +768,8 @@ operating systems.
 The
 .Nm
 command appeared in
-.At v4 .
+.At v3
+in section 8 of the manual.
 .Sh BUGS
 Since
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304006 - head

2016-08-12 Thread Bryan Drewery
Author: bdrewery
Date: Fri Aug 12 13:52:51 2016
New Revision: 304006
URL: https://svnweb.freebsd.org/changeset/base/304006

Log:
  Avoid showing the bootstrap make command for check-old, etc.
  
  Reported by:  koobs
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/Makefile
  head/Makefile.inc1

Modified: head/Makefile
==
--- head/Makefile   Fri Aug 12 11:06:54 2016(r304005)
+++ head/Makefile   Fri Aug 12 13:52:51 2016(r304006)
@@ -209,7 +209,8 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${M
 SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk
 .endif
 
-_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} 
TARGET_ARCH=${_TARGET_ARCH}
+_MAKE= PATH=${PATH} MAKE_CMD=${MAKE} ${SUB_MAKE} -f Makefile.inc1 \
+   TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
 
 # Only allow meta mode for the whitelisted targets.  See META_TGT_WHITELIST
 # above.

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Aug 12 11:06:54 2016(r304005)
+++ head/Makefile.inc1  Fri Aug 12 13:52:51 2016(r304006)
@@ -2378,11 +2378,11 @@ check-old-dirs: .PHONY
done
 
 delete-old: delete-old-files delete-old-dirs .PHONY
-   @echo "To remove old libraries run '${MAKE} delete-old-libs'."
+   @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
 
 check-old: check-old-files check-old-libs check-old-dirs .PHONY
-   @echo "To remove old files and directories run '${MAKE} delete-old'."
-   @echo "To remove old libraries run '${MAKE} delete-old-libs'."
+   @echo "To remove old files and directories run '${MAKE_CMD} 
delete-old'."
+   @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'."
 
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304005 - head/sys/conf

2016-08-12 Thread Bryan Drewery
Author: bdrewery
Date: Fri Aug 12 11:06:54 2016
New Revision: 304005
URL: https://svnweb.freebsd.org/changeset/base/304005

Log:
  PORTS_MODULES: Don't leak in CC/CXX/CPP.
  
  These may have ccache in them or -target/--sysroot from external
  compiler or SYSTEM_COMPILER support.  Many ports do not support
  a CC with spaces in it, such as emulators/virtualbox-ose-kmod.
  Passing --sysroot to ports makes no sense as ports doesn't support
  --sysroot currently.
  If these variables need to be overridden for ports then they can
  be set in make.conf or passed as make arguments.
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Fri Aug 12 10:29:34 2016(r304004)
+++ head/sys/conf/kern.post.mk  Fri Aug 12 11:06:54 2016(r304005)
@@ -65,6 +65,10 @@ OSRELDATE!=  awk '/^\#define[[:space:]]*_
 # Keep the related ports builds in the obj directory so that they are only 
rebuilt once per kernel build
 WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF}
 PORTSMODULESENV=\
+   env \
+   -u CC \
+   -u CXX \
+   -u CPP \
PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
SRC_BASE=${SRC_BASE} \
OSVERSION=${OSRELDATE} \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303019 - head/sys/geom

2016-08-12 Thread Andrey V. Elsukov
On 12.08.16 03:26, Bryan Drewery wrote:
> On r303467 I ran into this:
> 
> panic @ time 1470916206.652, thread 0xf8000412f000:
> g_resize_provider_event but withered
> cpuid = 0
> Panic occurred in module kernel loaded at 0x8020:
> 
> Stack: --
> kernel:kassert_panic+0x166
> kernel:g_resize_provider_event+0x181
> kernel:g_run_events+0x186^M^M
> kernel:fork_exit+0x83^M^M
> --
> 
> No further information available unfortunately.

This one is related to r302087 :)

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


svn commit: r304004 - in head/sys/arm64: arm64 include

2016-08-12 Thread Andrew Turner
Author: andrew
Date: Fri Aug 12 10:29:34 2016
New Revision: 304004
URL: https://svnweb.freebsd.org/changeset/base/304004

Log:
  Implement promotions and demotions in the arm64 pmap code. For now we don't
  promote memory as I am not sure all the demotion cases are handled, however
  it is useful to implement pmap_page_set_memattr. This is used, for example,
  when mapping uncached memory for bus_dma(9).
  
  pmap_page_set_memattr needs to demote the DMAP region as on ARM we need to
  ensure all mappings to the same physical address have the same attributes.
  
  Reviewed by:  kib
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6987

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/arm64/trap.c
  head/sys/arm64/include/pmap.h

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Fri Aug 12 08:50:05 2016(r304003)
+++ head/sys/arm64/arm64/pmap.c Fri Aug 12 10:29:34 2016(r304004)
@@ -229,6 +229,13 @@ CTASSERT((DMAP_MAX_ADDRESS  & ~L0_OFFSET
 #defineDMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> 
L0_SHIFT)
 extern pt_entry_t pagetable_dmap[];
 
+static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
+
+static int superpages_enabled = 1;
+SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled,
+CTLFLAG_RDTUN | CTLFLAG_NOFETCH, _enabled, 0,
+"Are large page mappings enabled?");
+
 /*
  * Data for the pv entry allocation mechanism
  */
@@ -243,6 +250,13 @@ static vm_page_t reclaim_pv_chunk(pmap_t
 static voidpmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va);
 static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap,
vm_offset_t va);
+
+static int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode);
+static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode);
+static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va);
+static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2,
+vm_offset_t va, struct rwlock **lockp);
+static pt_entry_t *pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va);
 static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va,
 vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp);
 static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva,
@@ -422,6 +436,13 @@ pmap_pte(pmap_t pmap, vm_offset_t va, in
return (l3);
 }
 
+static inline bool
+pmap_superpages_enabled(void)
+{
+
+   return (superpages_enabled != 0);
+}
+
 bool
 pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l0, pd_entry_t **l1,
 pd_entry_t **l2, pt_entry_t **l3)
@@ -837,6 +858,11 @@ pmap_init(void)
int i;
 
/*
+* Are large page mappings enabled?
+*/
+   TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", _enabled);
+
+   /*
 * Initialize the pv chunk list mutex.
 */
mtx_init(_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF);
@@ -2000,6 +2026,15 @@ pmap_remove(pmap_t pmap, vm_offset_t sva
 
l3_paddr = pmap_load(l2);
 
+   if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) {
+   KASSERT((l3_paddr & ATTR_SW_MANAGED) == 0,
+   ("%s: TODO: Demote managed pages", __func__));
+   if (pmap_demote_l2_locked(pmap, l2, sva & ~L2_OFFSET,
+   ) == NULL)
+   continue;
+   l3_paddr = pmap_load(l2);
+   }
+
/*
 * Weed out invalid mappings.
 */
@@ -2194,6 +2229,99 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 }
 
 /*
+ * Performs a break-before-make update of a pmap entry. This is needed when
+ * either promoting or demoting pages to ensure the TLB doesn't get into an
+ * inconsistent state.
+ */
+static void
+pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte,
+vm_offset_t va)
+{
+   register_t intr;
+
+   PMAP_LOCK_ASSERT(pmap, MA_OWNED);
+
+   /*
+* Ensure we don't get switched out with the page table in an
+* inconsistent state. We also need to ensure no interrupts fire
+* as they may make use of an address we are about to invalidate.
+*/
+   intr = intr_disable();
+   critical_enter();
+
+   /* Clear the old mapping */
+   pmap_load_clear(pte);
+   PTE_SYNC(pte);
+   pmap_invalidate_page(pmap, va);
+
+   /* Create the new mapping */
+   pmap_load_store(pte, newpte);
+   PTE_SYNC(pte);
+
+   critical_exit();
+   intr_restore(intr);
+}
+
+/*
+ * Tries to promote the 512, contiguous 4KB page mappings that are within a
+ * single level 2 table entry to a single 2MB page mapping.  For promotion
+ * to occur, 

svn commit: r304002 - head/sys/dev/hyperv/netvsc

2016-08-12 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug 12 08:29:26 2016
New Revision: 304002
URL: https://svnweb.freebsd.org/changeset/base/304002

Log:
  hyperv/hn: Simplify RXBUF disconnection.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7472

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:21:02 2016
(r304001)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:29:26 2016
(r304002)
@@ -384,32 +384,24 @@ cleanup:
 static int
 hv_nv_destroy_rx_buffer(netvsc_dev *net_dev)
 {
-   nvsp_msg *revoke_pkt;
int ret = 0;
 
-   /*
-* If we got a section count, it means we received a
-* send_rx_buf_complete msg 
-* (ie sent nvsp_msg_1_type_send_rx_buf msg) therefore,
-* we need to send a revoke msg here
-*/
if (net_dev->rx_section_count) {
-   /* Send the revoke receive buffer */
-   revoke_pkt = _dev->revoke_packet;
-   memset(revoke_pkt, 0, sizeof(nvsp_msg));
+   struct hn_nvs_rxbuf_disconn disconn;
 
-   revoke_pkt->hdr.msg_type = nvsp_msg_1_type_revoke_rx_buf;
-   revoke_pkt->msgs.vers_1_msgs.revoke_rx_buf.id =
-   NETVSC_RECEIVE_BUFFER_ID;
+   /*
+* Disconnect RXBUF from NVS.
+*/
+   memset(, 0, sizeof(disconn));
+   disconn.nvs_type = HN_NVS_TYPE_RXBUF_DISCONN;
+   disconn.nvs_sig = HN_NVS_RXBUF_SIG;
 
ret = vmbus_chan_send(net_dev->sc->hn_prichan,
-   VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg),
+   VMBUS_CHANPKT_TYPE_INBAND, 0, , sizeof(disconn),
(uint64_t)(uintptr_t)_send_ctx_none);
-   /*
-* If we failed here, we might as well return and have a leak 
-* rather than continue and a bugchk
-*/
if (ret != 0) {
+   if_printf(net_dev->sc->hn_ifp,
+   "send rxbuf disconn failed: %d\n", ret);
return (ret);
}
net_dev->rx_section_count = 0;

Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h
==
--- head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 08:21:02 2016
(r304001)
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 08:29:26 2016
(r304002)
@@ -42,6 +42,7 @@
 #define HN_NVS_TYPE_NDIS_INIT  100
 #define HN_NVS_TYPE_RXBUF_CONN 101
 #define HN_NVS_TYPE_RXBUF_CONNRESP 102
+#define HN_NVS_TYPE_RXBUF_DISCONN  103
 #define HN_NVS_TYPE_CHIM_CONN  104
 #define HN_NVS_TYPE_CHIM_CONNRESP  105
 #define HN_NVS_TYPE_NDIS_CONF  125
@@ -112,6 +113,14 @@ struct hn_nvs_rxbuf_connresp {
struct hn_nvs_rxbuf_sect nvs_sect[];
 } __packed;
 
+/* No response */
+struct hn_nvs_rxbuf_disconn {
+   uint32_tnvs_type;   /* HN_NVS_TYPE_RXBUF_DISCONN */
+   uint16_tnvs_sig;/* HN_NVS_RXBUF_SIG */
+   uint8_t nvs_rsvd[26];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_rxbuf_disconn) >= HN_NVS_REQSIZE_MIN);
+
 struct hn_nvs_chim_conn {
uint32_tnvs_type;   /* HN_NVS_TYPE_CHIM_CONN */
uint32_tnvs_gpadl;  /* chimney buf vmbus GPADL */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304001 - head/sys/dev/hyperv/netvsc

2016-08-12 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug 12 08:21:02 2016
New Revision: 304001
URL: https://svnweb.freebsd.org/changeset/base/304001

Log:
  hyperv/hn: Switch to vmbus xact APIs for NVS chimney buffer connection.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7470

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:16:35 2016
(r304000)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:21:02 2016
(r304001)
@@ -241,7 +241,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
 
if (status != HN_NVS_STATUS_OK) {
if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status);
-   error = EINVAL;
+   error = EIO;
goto cleanup;
}
net_dev->rx_section_count = 1;
@@ -260,9 +260,13 @@ static int 
 hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc)
 {
struct hn_send_ctx sndc;
+   struct vmbus_xact *xact;
+   struct hn_nvs_chim_conn *chim;
+   const struct hn_nvs_chim_connresp *resp;
+   size_t resp_len;
+   uint32_t status, sectsz;
netvsc_dev *net_dev;
-   nvsp_msg *init_pkt;
-   int ret = 0;
+   int error;
 
net_dev = hv_nv_get_outbound_net_device(sc);
if (!net_dev) {
@@ -274,7 +278,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru
BUS_DMA_WAITOK | BUS_DMA_ZERO);
if (net_dev->send_buf == NULL) {
device_printf(sc->hn_dev, "allocate chimney txbuf failed\n");
-   return ENOMEM;
+   return (ENOMEM);
}
 
/*
@@ -284,48 +288,77 @@ hv_nv_init_send_buffer_with_net_vsp(stru
 * Only primary channel has chimney sending buffer connected to it.
 * Sub-channels just share this chimney sending buffer.
 */
-   ret = vmbus_chan_gpadl_connect(sc->hn_prichan,
+   error = vmbus_chan_gpadl_connect(sc->hn_prichan,
net_dev->txbuf_dma.hv_paddr, net_dev->send_buf_size,
_dev->send_buf_gpadl_handle);
-   if (ret != 0) {
-   device_printf(sc->hn_dev, "chimney sending buffer gpadl "
-   "connect failed: %d\n", ret);
+   if (error) {
+   if_printf(sc->hn_ifp, "chimney sending buffer gpadl "
+   "connect failed: %d\n", error);
goto cleanup;
}
 
-   /* Notify the NetVsp of the gpadl handle */
-
-   init_pkt = _dev->channel_init_packet;
+   /*
+* Connect chimney sending buffer to NVS
+*/
 
-   memset(init_pkt, 0, sizeof(nvsp_msg));
+   xact = vmbus_xact_get(sc->hn_xact, sizeof(*chim));
+   if (xact == NULL) {
+   if_printf(sc->hn_ifp, "no xact for nvs chim conn\n");
+   error = ENXIO;
+   goto cleanup;
+   }
 
-   init_pkt->hdr.msg_type = nvsp_msg_1_type_send_send_buf;
-   init_pkt->msgs.vers_1_msgs.send_rx_buf.gpadl_handle =
-   net_dev->send_buf_gpadl_handle;
-   init_pkt->msgs.vers_1_msgs.send_rx_buf.id =
-   NETVSC_SEND_BUFFER_ID;
+   chim = vmbus_xact_req_data(xact);
+   chim->nvs_type = HN_NVS_TYPE_CHIM_CONN;
+   chim->nvs_gpadl = net_dev->send_buf_gpadl_handle;
+   chim->nvs_sig = HN_NVS_CHIM_SIG;
 
-   /* Send the gpadl notification request */
+   hn_send_ctx_init_simple(, hn_nvs_sent_xact, xact);
+   vmbus_xact_activate(xact);
 
-   hn_send_ctx_init_simple(, hn_nvs_sent_wakeup, NULL);
-   ret = vmbus_chan_send(sc->hn_prichan,
+   error = vmbus_chan_send(sc->hn_prichan,
VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC,
-   init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t));
-   if (ret != 0) {
+   chim, sizeof(*chim), (uint64_t)(uintptr_t));
+   if (error) {
+   if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n",
+   error);
+   vmbus_xact_deactivate(xact);
+   vmbus_xact_put(xact);
goto cleanup;
}
 
-   sema_wait(_dev->channel_init_sema);
+   resp = vmbus_xact_wait(xact, _len);
+   if (resp_len < sizeof(*resp)) {
+   if_printf(sc->hn_ifp, "invalid chim conn resp length %zu\n",
+   resp_len);
+   vmbus_xact_put(xact);
+   error = EINVAL;
+   goto cleanup;
+   }
+   if (resp->nvs_type != HN_NVS_TYPE_CHIM_CONNRESP) {
+   if_printf(sc->hn_ifp, "not chim conn resp, type %u\n",
+   resp->nvs_type);
+   vmbus_xact_put(xact);
+   error = EINVAL;
+   goto cleanup;
+   }
 
-   /* Check the response */
-   if (init_pkt->msgs.vers_1_msgs.send_send_buf_complete.status
-   != 

svn commit: r304000 - head/usr.sbin/acpi/acpidump

2016-08-12 Thread Maxim Konovalov
Author: maxim
Date: Fri Aug 12 08:16:35 2016
New Revision: 304000
URL: https://svnweb.freebsd.org/changeset/base/304000

Log:
  o Move tmpstr varibale initialization out of assert(3) call.
  
  This fixes acpidump(8) compiled with "WITHOUT_ASSERT_DEBUG=yes" that
  removes assert(3)'s from the code.
  
  Submitted by: Alexander Nedotsukov

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 12 08:08:29 2016
(r303999)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 12 08:16:35 2016
(r304000)
@@ -1494,8 +1494,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
perror("mkdtemp tmp working dir");
return;
}
-   assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname)
-   <= sizeof(tmpstr) - 1);
+   len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname);
+   assert(len <= sizeof(tmpstr) - 1);
fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (fd < 0) {
perror("iasl tmp file");
@@ -1527,8 +1527,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
}
 
/* Dump iasl's output to stdout */
-   assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname)
-   <= sizeof(tmpstr) -1);
+   len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname);
+   assert(len <= sizeof(tmpstr) - 1);
fp = fopen(tmpstr, "r");
if (unlink(tmpstr) < 0) {
perror("unlink");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303999 - stable/8/sys/dev/usb/controller

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 08:08:29 2016
New Revision: 303999
URL: https://svnweb.freebsd.org/changeset/base/303999

Log:
  MFC r302371:
  Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
  "struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Modified:
  stable/8/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/controller/xhci.h
==
--- stable/8/sys/dev/usb/controller/xhci.h  Fri Aug 12 08:07:56 2016
(r303998)
+++ stable/8/sys/dev/usb/controller/xhci.h  Fri Aug 12 08:08:29 2016
(r303999)
@@ -30,7 +30,7 @@
 
 #defineXHCI_MAX_DEVICESMIN(USB_MAX_DEVICES, 128)
 #defineXHCI_MAX_ENDPOINTS  32  /* hardcoded - do not change */
-#defineXHCI_MAX_SCRATCHPADS1024
+#defineXHCI_MAX_SCRATCHPADS256 /* theoretical max is 1023 */
 #defineXHCI_MAX_EVENTS (16 * 13)
 #defineXHCI_MAX_COMMANDS   (16 * 1)
 #defineXHCI_MAX_RSEG   1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303998 - head/sys/dev/hyperv/netvsc

2016-08-12 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug 12 08:07:56 2016
New Revision: 303998
URL: https://svnweb.freebsd.org/changeset/base/303998

Log:
  hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7469

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:07:19 2016
(r303997)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:07:56 2016
(r303998)
@@ -152,10 +152,14 @@ hv_nv_get_next_send_section(netvsc_dev *
 static int 
 hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc)
 {
+   struct vmbus_xact *xact;
+   struct hn_nvs_rxbuf_conn *conn;
+   const struct hn_nvs_rxbuf_connresp *resp;
+   size_t resp_len;
struct hn_send_ctx sndc;
netvsc_dev *net_dev;
-   nvsp_msg *init_pkt;
-   int ret = 0;
+   uint32_t status;
+   int error;
 
net_dev = hv_nv_get_outbound_net_device(sc);
if (!net_dev) {
@@ -167,7 +171,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
BUS_DMA_WAITOK | BUS_DMA_ZERO);
if (net_dev->rx_buf == NULL) {
device_printf(sc->hn_dev, "allocate rxbuf failed\n");
-   return ENOMEM;
+   return (ENOMEM);
}
 
/*
@@ -177,74 +181,76 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
 * Only primary channel has RXBUF connected to it.  Sub-channels
 * just share this RXBUF.
 */
-   ret = vmbus_chan_gpadl_connect(sc->hn_prichan,
+   error = vmbus_chan_gpadl_connect(sc->hn_prichan,
net_dev->rxbuf_dma.hv_paddr, net_dev->rx_buf_size,
_dev->rx_buf_gpadl_handle);
-   if (ret != 0) {
-   device_printf(sc->hn_dev, "rxbuf gpadl connect failed: %d\n",
-   ret);
+   if (error) {
+   if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n",
+   error);
goto cleanup;
}
-   
-   /* sema_wait(>channel_init_sema); KYS CHECK */
 
-   /* Notify the NetVsp of the gpadl handle */
-   init_pkt = _dev->channel_init_packet;
+   /*
+* Connect RXBUF to NVS.
+*/
 
-   memset(init_pkt, 0, sizeof(nvsp_msg));
+   xact = vmbus_xact_get(sc->hn_xact, sizeof(*conn));
+   if (xact == NULL) {
+   if_printf(sc->hn_ifp, "no xact for nvs rxbuf conn\n");
+   error = ENXIO;
+   goto cleanup;
+   }
 
-   init_pkt->hdr.msg_type = nvsp_msg_1_type_send_rx_buf;
-   init_pkt->msgs.vers_1_msgs.send_rx_buf.gpadl_handle =
-   net_dev->rx_buf_gpadl_handle;
-   init_pkt->msgs.vers_1_msgs.send_rx_buf.id =
-   NETVSC_RECEIVE_BUFFER_ID;
+   conn = vmbus_xact_req_data(xact);
+   conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN;
+   conn->nvs_gpadl = net_dev->rx_buf_gpadl_handle;
+   conn->nvs_sig = HN_NVS_RXBUF_SIG;
 
-   /* Send the gpadl notification request */
+   hn_send_ctx_init_simple(, hn_nvs_sent_xact, xact);
+   vmbus_xact_activate(xact);
 
-   hn_send_ctx_init_simple(, hn_nvs_sent_wakeup, NULL);
-   ret = vmbus_chan_send(sc->hn_prichan,
+   error = vmbus_chan_send(sc->hn_prichan,
VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC,
-   init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t));
-   if (ret != 0) {
+   conn, sizeof(*conn), (uint64_t)(uintptr_t));
+   if (error != 0) {
+   if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n",
+   error);
+   vmbus_xact_deactivate(xact);
+   vmbus_xact_put(xact);
goto cleanup;
}
 
-   sema_wait(_dev->channel_init_sema);
-
-   /* Check the response */
-   if (init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.status
-   != nvsp_status_success) {
-   ret = EINVAL;
+   resp = vmbus_xact_wait(xact, _len);
+   if (resp_len < sizeof(*resp)) {
+   if_printf(sc->hn_ifp, "invalid rxbuf conn resp length %zu\n",
+   resp_len);
+   vmbus_xact_put(xact);
+   error = EINVAL;
+   goto cleanup;
+   }
+   if (resp->nvs_type != HN_NVS_TYPE_RXBUF_CONNRESP) {
+   if_printf(sc->hn_ifp, "not rxbuf conn resp, type %u\n",
+   resp->nvs_type);
+   vmbus_xact_put(xact);
+   error = EINVAL;
goto cleanup;
}
 
-   net_dev->rx_section_count =
-   init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.num_sections;
-
-   net_dev->rx_sections = malloc(net_dev->rx_section_count *
-   sizeof(nvsp_1_rx_buf_section), M_NETVSC, 

svn commit: r303997 - stable/9/sys/dev/usb/controller

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 08:07:19 2016
New Revision: 303997
URL: https://svnweb.freebsd.org/changeset/base/303997

Log:
  MFC r302371:
  Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
  "struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Modified:
  stable/9/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/xhci.h
==
--- stable/9/sys/dev/usb/controller/xhci.h  Fri Aug 12 08:05:40 2016
(r303996)
+++ stable/9/sys/dev/usb/controller/xhci.h  Fri Aug 12 08:07:19 2016
(r303997)
@@ -30,7 +30,7 @@
 
 #defineXHCI_MAX_DEVICESMIN(USB_MAX_DEVICES, 128)
 #defineXHCI_MAX_ENDPOINTS  32  /* hardcoded - do not change */
-#defineXHCI_MAX_SCRATCHPADS1024
+#defineXHCI_MAX_SCRATCHPADS256 /* theoretical max is 1023 */
 #defineXHCI_MAX_EVENTS (16 * 13)
 #defineXHCI_MAX_COMMANDS   (16 * 1)
 #defineXHCI_MAX_RSEG   1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303996 - stable/10/sys/dev/usb/controller

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 08:05:40 2016
New Revision: 303996
URL: https://svnweb.freebsd.org/changeset/base/303996

Log:
  MFC r302371:
  Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
  "struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Modified:
  stable/10/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/xhci.h
==
--- stable/10/sys/dev/usb/controller/xhci.h Fri Aug 12 08:03:31 2016
(r303995)
+++ stable/10/sys/dev/usb/controller/xhci.h Fri Aug 12 08:05:40 2016
(r303996)
@@ -30,7 +30,7 @@
 
 #defineXHCI_MAX_DEVICESMIN(USB_MAX_DEVICES, 128)
 #defineXHCI_MAX_ENDPOINTS  32  /* hardcoded - do not change */
-#defineXHCI_MAX_SCRATCHPADS1024
+#defineXHCI_MAX_SCRATCHPADS256 /* theoretical max is 1023 */
 #defineXHCI_MAX_EVENTS (16 * 13)
 #defineXHCI_MAX_COMMANDS   (16 * 1)
 #defineXHCI_MAX_RSEG   1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303995 - stable/8/sys/dev/sound/usb

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 08:03:31 2016
New Revision: 303995
URL: https://svnweb.freebsd.org/changeset/base/303995

Log:
  MFC r301039:
  Add support for simplex USB MIDI devices, which only provide BULK or
  INTERRUPT endpoints for moving data in one direction, like the KeyRig
  49 from M-Audio.
  
  Requested by: Ivan Klymenko 

Modified:
  stable/8/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/usb/   (props changed)

Modified: stable/8/sys/dev/sound/usb/uaudio.c
==
--- stable/8/sys/dev/sound/usb/uaudio.c Fri Aug 12 07:59:06 2016
(r303994)
+++ stable/8/sys/dev/sound/usb/uaudio.c Fri Aug 12 08:03:31 2016
(r303995)
@@ -660,6 +660,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
+   .flags = {.no_pipe_ok = 1},
.callback = _bulk_write_callback,
},
 
@@ -668,7 +669,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4,   /* bytes */
-   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
+   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
.callback = _bulk_read_callback,
},
 };
@@ -5747,7 +5748,16 @@ umidi_start_write(struct usb_fifo *fifo)
 {
struct umidi_chan *chan = usb_fifo_softc(fifo);
 
-   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) {
+   uint8_t buf[1];
+   int actlen;
+   do {
+   /* dump data */
+   usb_fifo_get_data_linear(fifo, buf, 1, , 0);
+   } while (actlen > 0);
+   } else {
+   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   }
 }
 
 static void
@@ -5865,6 +5875,11 @@ umidi_probe(device_t dev)
DPRINTF("error=%s\n", usbd_errstr(error));
goto detach;
}
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL &&
+   chan->xfer[UMIDI_RX_TRANSFER] == NULL) {
+   DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n");
+   goto detach;
+   }
 
/*
 * Some USB MIDI device makers couldn't resist using
@@ -5878,7 +5893,8 @@ umidi_probe(device_t dev)
 * and 64-byte maximum packet sizes for full-speed bulk
 * endpoints and 512 bytes for high-speed bulk endpoints."
 */
-   if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
+   if (chan->xfer[UMIDI_TX_TRANSFER] != NULL &&
+   usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
chan->single_command = 1;
 
if (chan->single_command != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303994 - stable/9/sys/dev/sound/usb

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 07:59:06 2016
New Revision: 303994
URL: https://svnweb.freebsd.org/changeset/base/303994

Log:
  MFC r301039:
  Add support for simplex USB MIDI devices, which only provide BULK or
  INTERRUPT endpoints for moving data in one direction, like the KeyRig
  49 from M-Audio.
  
  Requested by: Ivan Klymenko 

Modified:
  stable/9/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/usb/uaudio.c
==
--- stable/9/sys/dev/sound/usb/uaudio.c Fri Aug 12 07:57:27 2016
(r303993)
+++ stable/9/sys/dev/sound/usb/uaudio.c Fri Aug 12 07:59:06 2016
(r303994)
@@ -660,6 +660,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
+   .flags = {.no_pipe_ok = 1},
.callback = _bulk_write_callback,
},
 
@@ -668,7 +669,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4,   /* bytes */
-   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
+   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
.callback = _bulk_read_callback,
},
 };
@@ -5747,7 +5748,16 @@ umidi_start_write(struct usb_fifo *fifo)
 {
struct umidi_chan *chan = usb_fifo_softc(fifo);
 
-   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) {
+   uint8_t buf[1];
+   int actlen;
+   do {
+   /* dump data */
+   usb_fifo_get_data_linear(fifo, buf, 1, , 0);
+   } while (actlen > 0);
+   } else {
+   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   }
 }
 
 static void
@@ -5865,6 +5875,11 @@ umidi_probe(device_t dev)
DPRINTF("error=%s\n", usbd_errstr(error));
goto detach;
}
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL &&
+   chan->xfer[UMIDI_RX_TRANSFER] == NULL) {
+   DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n");
+   goto detach;
+   }
 
/*
 * Some USB MIDI device makers couldn't resist using
@@ -5878,7 +5893,8 @@ umidi_probe(device_t dev)
 * and 64-byte maximum packet sizes for full-speed bulk
 * endpoints and 512 bytes for high-speed bulk endpoints."
 */
-   if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
+   if (chan->xfer[UMIDI_TX_TRANSFER] != NULL &&
+   usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
chan->single_command = 1;
 
if (chan->single_command != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303993 - stable/10/sys/dev/sound/usb

2016-08-12 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 12 07:57:27 2016
New Revision: 303993
URL: https://svnweb.freebsd.org/changeset/base/303993

Log:
  MFC r301039:
  Add support for simplex USB MIDI devices, which only provide BULK or
  INTERRUPT endpoints for moving data in one direction, like the KeyRig
  49 from M-Audio.
  
  Requested by: Ivan Klymenko 

Modified:
  stable/10/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sound/usb/uaudio.c
==
--- stable/10/sys/dev/sound/usb/uaudio.cFri Aug 12 07:57:03 2016
(r303992)
+++ stable/10/sys/dev/sound/usb/uaudio.cFri Aug 12 07:57:27 2016
(r303993)
@@ -663,6 +663,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
+   .flags = {.no_pipe_ok = 1},
.callback = _bulk_write_callback,
},
 
@@ -671,7 +672,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4,   /* bytes */
-   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
+   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
.callback = _bulk_read_callback,
},
 };
@@ -5760,7 +5761,16 @@ umidi_start_write(struct usb_fifo *fifo)
 {
struct umidi_chan *chan = usb_fifo_softc(fifo);
 
-   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) {
+   uint8_t buf[1];
+   int actlen;
+   do {
+   /* dump data */
+   usb_fifo_get_data_linear(fifo, buf, 1, , 0);
+   } while (actlen > 0);
+   } else {
+   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   }
 }
 
 static void
@@ -5878,6 +5888,11 @@ umidi_probe(device_t dev)
DPRINTF("error=%s\n", usbd_errstr(error));
goto detach;
}
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL &&
+   chan->xfer[UMIDI_RX_TRANSFER] == NULL) {
+   DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n");
+   goto detach;
+   }
 
/*
 * Some USB MIDI device makers couldn't resist using
@@ -5891,7 +5906,8 @@ umidi_probe(device_t dev)
 * and 64-byte maximum packet sizes for full-speed bulk
 * endpoints and 512 bytes for high-speed bulk endpoints."
 */
-   if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
+   if (chan->xfer[UMIDI_TX_TRANSFER] != NULL &&
+   usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
chan->single_command = 1;
 
if (chan->single_command != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303992 - head/sys/dev/hyperv/netvsc

2016-08-12 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug 12 07:57:03 2016
New Revision: 303992
URL: https://svnweb.freebsd.org/changeset/base/303992

Log:
  hyperv/hn: Simplify NDIS initialization.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7467

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_rndis.h
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:54:59 2016
(r303991)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:57:03 2016
(r303992)
@@ -558,8 +558,6 @@ static int
 hv_nv_connect_to_vsp(struct hn_softc *sc)
 {
netvsc_dev *net_dev;
-   nvsp_msg *init_pkt;
-   uint32_t ndis_version;
uint32_t protocol_list[] = { NVSP_PROTOCOL_VERSION_1,
NVSP_PROTOCOL_VERSION_2,
NVSP_PROTOCOL_VERSION_4,
@@ -569,6 +567,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc
int ret = 0;
device_t dev = sc->hn_dev;
struct ifnet *ifp = sc->hn_ifp;
+   struct hn_nvs_ndis_init ndis;
 
net_dev = hv_nv_get_outbound_net_device(sc);
 
@@ -601,37 +600,23 @@ hv_nv_connect_to_vsp(struct hn_softc *sc
ret = hv_nv_send_ndis_config(sc, ifp->if_mtu);
 
/*
-* Send the NDIS version
+* Initialize NDIS.
 */
-   init_pkt = _dev->channel_init_packet;
 
-   memset(init_pkt, 0, sizeof(nvsp_msg));
-
-   if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4) {
-   ndis_version = NDIS_VERSION_6_1;
-   } else {
-   ndis_version = NDIS_VERSION_6_30;
-   }
-
-   init_pkt->hdr.msg_type = nvsp_msg_1_type_send_ndis_vers;
-   init_pkt->msgs.vers_1_msgs.send_ndis_vers.ndis_major_vers =
-   (ndis_version & 0x) >> 16;
-   init_pkt->msgs.vers_1_msgs.send_ndis_vers.ndis_minor_vers =
-   ndis_version & 0x;
-
-   /* Send the init request */
+   memset(, 0, sizeof(ndis));
+   ndis.nvs_type = HN_NVS_TYPE_NDIS_INIT;
+   ndis.nvs_ndis_major = NDIS_VERSION_MAJOR_6;
+   if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4)
+   ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_1;
+   else
+   ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30;
 
ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0,
-   init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)_send_ctx_none);
+   , sizeof(ndis), (uint64_t)(uintptr_t)_send_ctx_none);
if (ret != 0) {
+   if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret);
goto cleanup;
}
-   /*
-* TODO:  BUGBUG - We have to wait for the above msg since the netvsp
-* uses KMCL which acknowledges packet (completion packet) 
-* since our Vmbus always set the VMBUS_CHANPKT_FLAG_RC flag
-*/
-   /* sema_wait(>channel_init_sema); */
 
/* Post the big receive buffer to NetVSP */
if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2)

Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h
==
--- head/sys/dev/hyperv/netvsc/hv_rndis.h   Fri Aug 12 07:54:59 2016
(r303991)
+++ head/sys/dev/hyperv/netvsc/hv_rndis.h   Fri Aug 12 07:57:03 2016
(r303992)
@@ -41,6 +41,10 @@
 #define NDIS_VERSION_6_10x00060001
 #define NDIS_VERSION_6_30   0x0006001e
 
+#define NDIS_VERSION_MAJOR_6   6
+#define NDIS_VERSION_MINOR_1   1
+#define NDIS_VERSION_MINOR_30  30
+
 #define NDIS_VERSION(NDIS_VERSION_5_1)
 
 /*

Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h
==
--- head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 07:54:59 2016
(r303991)
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 07:57:03 2016
(r303992)
@@ -36,6 +36,7 @@
 
 #define HN_NVS_TYPE_INIT   1
 #define HN_NVS_TYPE_INIT_RESP  2
+#define HN_NVS_TYPE_NDIS_INIT  100
 #define HN_NVS_TYPE_NDIS_CONF  125
 
 /*
@@ -73,4 +74,13 @@ CTASSERT(sizeof(struct hn_nvs_ndis_conf)
 #define HN_NVS_NDIS_CONF_SRIOV 0x0004
 #define HN_NVS_NDIS_CONF_VLAN  0x0008
 
+/* No response */
+struct hn_nvs_ndis_init {
+   uint32_tnvs_type;   /* HN_NVS_TYPE_NDIS_INIT */
+   uint32_tnvs_ndis_major; /* NDIS_VERSION_MAJOR_ */
+   uint32_tnvs_ndis_minor; /* NDIS_VERSION_MINOR_ */
+   uint8_t nvs_rsvd[20];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN);
+
 #endif /* !_IF_HNREG_H_ */
___

svn commit: r303991 - head/lib/libsysdecode

2016-08-12 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 12 07:54:59 2016
New Revision: 303991
URL: https://svnweb.freebsd.org/changeset/base/303991

Log:
  Decode 32bit utrace records on the 64bit host.
  
  Suppose that ktrace is performed on 32bit binary running on 64bit
  host.  In this case, the kernel records are 64bit, while utrace
  records from rtld and malloc are 32bit.  Make kdump useful to see
  decoded utrace data in that case.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libsysdecode/utrace.c

Modified: head/lib/libsysdecode/utrace.c
==
--- head/lib/libsysdecode/utrace.c  Fri Aug 12 07:52:13 2016
(r303990)
+++ head/lib/libsysdecode/utrace.c  Fri Aug 12 07:54:59 2016
(r303991)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #defineUTRACE_DLOPEN_START 1
@@ -59,6 +59,18 @@ struct utrace_rtld {
char name[MAXPATHLEN];
 };
 
+#ifdef __LP64__
+struct utrace_rtld32 {
+   char sig[4];/* 'RTLD' */
+   int event;
+   uint32_t handle;
+   uint32_t mapbase;
+   uint32_t mapsize;
+   int refcnt;
+   char name[MAXPATHLEN];
+};
+#endif
+
 static int
 print_utrace_rtld(FILE *fp, void *p)
 {
@@ -145,6 +157,14 @@ struct utrace_malloc {
void *r;
 };
 
+#ifdef __LP64__
+struct utrace_malloc32 {
+   uint32_t p;
+   uint32_t s;
+   uint32_t r;
+};
+#endif
+
 static void
 print_utrace_malloc(FILE *fp, void *p)
 {
@@ -163,6 +183,12 @@ print_utrace_malloc(FILE *fp, void *p)
 int
 sysdecode_utrace(FILE *fp, void *p, size_t len)
 {
+#ifdef __LP64__
+   struct utrace_rtld ur;
+   struct utrace_rtld32 *pr;
+   struct utrace_malloc um;
+   struct utrace_malloc32 *pm;
+#endif
 
if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) {
return (print_utrace_rtld(fp, p));
@@ -172,6 +198,32 @@ sysdecode_utrace(FILE *fp, void *p, size
print_utrace_malloc(fp, p);
return (1);
}
-   
+
+#ifdef __LP64__
+   if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) {
+   pr = p;
+   memset(, 0, sizeof(ur));
+   memcpy(ur.sig, pr->sig, sizeof(ur.sig));
+   ur.event = pr->event;
+   ur.handle = (void *)(uintptr_t)pr->handle;
+   ur.mapbase = (void *)(uintptr_t)pr->mapbase;
+   ur.mapsize = pr->mapsize;
+   ur.refcnt = pr->refcnt;
+   memcpy(ur.name, pr->name, sizeof(ur.name));
+   return (print_utrace_rtld(fp, ));
+   }
+
+   if (len == sizeof(struct utrace_malloc32)) {
+   pm = p;
+   memset(, 0, sizeof(um));
+   um.p = pm->p == (uint32_t)-1 ? (void *)(intptr_t)-1 :
+   (void *)(uintptr_t)pm->p;
+   um.s = pm->s;
+   um.r = (void *)(uintptr_t)pm->r;
+   print_utrace_malloc(fp, );
+   return (1);
+   }
+#endif
+
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303990 - head/usr.bin/kdump

2016-08-12 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 12 07:52:13 2016
New Revision: 303990
URL: https://svnweb.freebsd.org/changeset/base/303990

Log:
  Remove unused prototypes.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Fri Aug 12 07:14:40 2016(r303989)
+++ head/usr.bin/kdump/kdump.c  Fri Aug 12 07:52:13 2016(r303990)
@@ -105,8 +105,6 @@ void ktrgenio(struct ktr_genio *, int);
 void ktrpsig(struct ktr_psig *);
 void ktrcsw(struct ktr_csw *);
 void ktrcsw_old(struct ktr_csw_old *);
-void ktruser_malloc(void *);
-void ktruser_rtld(int, void *);
 void ktruser(int, void *);
 void ktrcaprights(cap_rights_t *);
 void ktritimerval(struct itimerval *it);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303989 - head/sys/dev/hyperv/netvsc

2016-08-12 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug 12 07:14:40 2016
New Revision: 303989
URL: https://svnweb.freebsd.org/changeset/base/303989

Log:
  hyperv/hn: Simplify NDIS configuration.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7466

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:03:58 2016
(r303988)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:14:40 2016
(r303989)
@@ -536,33 +536,19 @@ hv_nv_negotiate_nvsp_protocol(struct hn_
 static int
 hv_nv_send_ndis_config(struct hn_softc *sc, uint32_t mtu)
 {
-   netvsc_dev *net_dev;
-   nvsp_msg *init_pkt;
-   int ret;
-
-   net_dev = hv_nv_get_outbound_net_device(sc);
-   if (!net_dev)
-   return (-ENODEV);
-
-   /*
-* Set up configuration packet, write MTU
-* Indicate we are capable of handling VLAN tags
-*/
-   init_pkt = _dev->channel_init_packet;
-   memset(init_pkt, 0, sizeof(nvsp_msg));
-   init_pkt->hdr.msg_type = nvsp_msg_2_type_send_ndis_config;
-   init_pkt->msgs.vers_2_msgs.send_ndis_config.mtu = mtu;
-   init_pkt->
-   msgs.vers_2_msgs.send_ndis_config.capabilities.u1.u2.ieee8021q
-   = 1;
-
-   /* Send the configuration packet */
-   ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0,
-   init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)_send_ctx_none);
-   if (ret != 0)
-   return (-EINVAL);
+   struct hn_nvs_ndis_conf conf;
+   int error;
 
-   return (0);
+   memset(, 0, sizeof(conf));
+   conf.nvs_type = HN_NVS_TYPE_NDIS_CONF;
+   conf.nvs_mtu = mtu;
+   conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN;
+
+   error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0,
+   , sizeof(conf), (uint64_t)(uintptr_t)_send_ctx_none);
+   if (error)
+   if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error);
+   return (error);
 }
 
 /*

Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h
==
--- head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 07:03:58 2016
(r303988)
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h   Fri Aug 12 07:14:40 2016
(r303989)
@@ -36,6 +36,7 @@
 
 #define HN_NVS_TYPE_INIT   1
 #define HN_NVS_TYPE_INIT_RESP  2
+#define HN_NVS_TYPE_NDIS_CONF  125
 
 /*
  * Any size less than this one will _not_ work, e.g. hn_nvs_init
@@ -59,4 +60,17 @@ struct hn_nvs_init_resp {
uint32_tnvs_status; /* HN_NVS_STATUS_ */
 } __packed;
 
+/* No reponse */
+struct hn_nvs_ndis_conf {
+   uint32_tnvs_type;   /* HN_NVS_TYPE_NDIS_CONF */
+   uint32_tnvs_mtu;
+   uint32_tnvs_rsvd;
+   uint64_tnvs_caps;   /* HN_NVS_NDIS_CONF_ */
+   uint8_t nvs_rsvd1[12];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_ndis_conf) >= HN_NVS_REQSIZE_MIN);
+
+#define HN_NVS_NDIS_CONF_SRIOV 0x0004
+#define HN_NVS_NDIS_CONF_VLAN  0x0008
+
 #endif /* !_IF_HNREG_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303988 - head/lib/libc/gen

2016-08-12 Thread Ed Schouten
Author: ed
Date: Fri Aug 12 07:03:58 2016
New Revision: 303988
URL: https://svnweb.freebsd.org/changeset/base/303988

Log:
  Reimplement dirname(3) to be thread-safe.
  
  Now that we've updated the prototypes of the basename(3) and dirname(3)
  functions to conform to POSIX, let's go ahead and reimplement dirname(3)
  in such a way that it's thread-safe, but also guaranteed to succeed. C
  libraries like glibc, musl and the one that's part of Solaris already
  follow such an approach.
  
  Move the existing implementation to another source file,
  freebsd11_dirname.c to keep existing users of the API that pass in a
  constant string happy, using symbol versioning.
  
  Put a new version of the function in dirname.c, obtained from CloudABI's
  C library. This version scans through the pathname string from left to
  right, normalizing it, while discarding the last pathname component.
  
  Reviewed by:  emaste, jilles
  Differential Revision:https://reviews.freebsd.org/D7355

Added:
  head/lib/libc/gen/dirname_compat.c
 - copied, changed from r303452, head/lib/libc/gen/dirname.c
Modified:
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/dirname.3
  head/lib/libc/gen/dirname.c

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Fri Aug 12 06:19:40 2016
(r303987)
+++ head/lib/libc/gen/Makefile.inc  Fri Aug 12 07:03:58 2016
(r303988)
@@ -29,6 +29,7 @@ SRCS+=__getosreldate.c \
devname.c \
dirfd.c \
dirname.c \
+   dirname_compat.c \
disklabel.c \
dlfcn.c \
drand48.c \

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapFri Aug 12 06:19:40 2016
(r303987)
+++ head/lib/libc/gen/Symbol.mapFri Aug 12 07:03:58 2016
(r303988)
@@ -82,7 +82,6 @@ FBSD_1.0 {
daemon;
devname;
devname_r;
-   dirname;
getdiskbyname;
dladdr;
dlclose;
@@ -418,6 +417,10 @@ FBSD_1.4 {
stravis;
 };
 
+FBSD_1.5 {
+   dirname;
+};
+
 FBSDprivate_1.0 {
/* needed by thread libraries */
__thr_jtable;

Modified: head/lib/libc/gen/dirname.3
==
--- head/lib/libc/gen/dirname.3 Fri Aug 12 06:19:40 2016(r303987)
+++ head/lib/libc/gen/dirname.3 Fri Aug 12 07:03:58 2016(r303988)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 29, 2016
+.Dd August 12, 2016
 .Dt DIRNAME 3
 .Os
 .Sh NAME
@@ -37,6 +37,7 @@ Any trailing
 .Sq \&/
 characters are not counted as part of the directory
 name.
+.Sh RETURN VALUES
 If
 .Fa path
 is a null pointer, the empty string, or contains no
@@ -46,40 +47,24 @@ characters,
 returns a pointer to the string
 .Qq \&. ,
 signifying the current directory.
+Otherwise,
+it returns a pointer to the parent directory of
+.Fa path .
 .Sh IMPLEMENTATION NOTES
-The
+This implementation of
 .Fn dirname
-function
-returns a pointer to internal storage space allocated on the first call
-that will be overwritten
-by subsequent calls.
+uses the buffer provided by the caller to store the resulting parent
+directory.
+Other vendor implementations may return a pointer to internal storage
+space instead.
+The advantage of the former approach is that it ensures thread-safety,
+while also placing no upper limit on the supported length of the
+pathname.
 .Pp
-Other vendor implementations of
-.Fn dirname
-may store their result in the input buffer,
-making it safe to use in multithreaded applications.
-Future versions of
-.Fx
-will follow this approach as well.
-.Sh RETURN VALUES
-On successful completion,
-.Fn dirname
-returns a pointer to the parent directory of
-.Fa path .
-.Pp
-If
-.Fn dirname
-fails, a null pointer is returned and the global variable
-.Va errno
-is set to indicate the error.
-.Sh ERRORS
-The following error codes may be set in
-.Va errno :
-.Bl -tag -width Er
-.It Bq Er ENAMETOOLONG
-The path component to be returned was larger than
-.Dv MAXPATHLEN .
-.El
+The algorithm used by this implementation also discards redundant
+slashes and
+.Qq \&.
+pathname components from the pathname string.
 .Sh SEE ALSO
 .Xr basename 1 ,
 .Xr dirname 1 ,
@@ -96,5 +81,10 @@ function first appeared in
 .Ox 2.2
 and
 .Fx 4.2 .
+.Pp
+In
+.Fx 12.0 ,
+this function was reimplemented to store its result in the provided
+input buffer.
 .Sh AUTHORS
-.An "Todd C. Miller"
+.An Nuxi, the Netherlands

Modified: head/lib/libc/gen/dirname.c
==
--- head/lib/libc/gen/dirname.c Fri Aug 12 06:19:40 2016(r303987)
+++ head/lib/libc/gen/dirname.c Fri Aug 12 07:03:58 2016(r303988)
@@ -1,77 +1,90 @@
-/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 

Re: svn commit: r303970 - in stable/11/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2016-08-12 Thread Andriy Gapon
On 12/08/2016 01:33, Slawa Olhovchenkov wrote:
> MFC to 10.x/9.x planed?

I would like to do it, but it depends on how hard it would be to merge the code.
If it's trivial, then I'll certainly do it.
If it's very hard, then I will not do it myself.  But if anybody merges and
tests the change, then I'll be happy to commit it.

Also, I would normally use a much longer MFC period for such a change.  It was
short only to get the change into 11.0.  So, I'll wait for a couple more weeks
before even trying to MFC the change to stable/10 and 9.

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


svn commit: r303987 - vendor/NetBSD/tests/08.11.2016_18.01

2016-08-12 Thread Garrett Cooper
Author: ngie
Date: Fri Aug 12 06:19:40 2016
New Revision: 303987
URL: https://svnweb.freebsd.org/changeset/base/303987

Log:
  Copy snapshot of .../dist to .../08.11.2016_18.01

Added:
  vendor/NetBSD/tests/08.11.2016_18.01/
 - copied from r303986, vendor/NetBSD/tests/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303986 - in vendor/NetBSD/tests/dist: dev/fss/CVS dev/usb/CVS dev/usb/libhid/CVS dev/usb/t_hid/CVS lib/libusbhid/CVS net/arp/CVS net/if_gif/CVS net/if_pppoe/CVS net/if_tap/CVS net/in_c...

2016-08-12 Thread Garrett Cooper
Author: ngie
Date: Fri Aug 12 06:16:14 2016
New Revision: 303986
URL: https://svnweb.freebsd.org/changeset/base/303986

Log:
  Remove CVS directories accidentally added in r303980

Deleted:
  vendor/NetBSD/tests/dist/dev/fss/CVS/
  vendor/NetBSD/tests/dist/dev/usb/CVS/
  vendor/NetBSD/tests/dist/dev/usb/libhid/CVS/
  vendor/NetBSD/tests/dist/dev/usb/t_hid/CVS/
  vendor/NetBSD/tests/dist/lib/libusbhid/CVS/
  vendor/NetBSD/tests/dist/net/arp/CVS/
  vendor/NetBSD/tests/dist/net/if_gif/CVS/
  vendor/NetBSD/tests/dist/net/if_pppoe/CVS/
  vendor/NetBSD/tests/dist/net/if_tap/CVS/
  vendor/NetBSD/tests/dist/net/in_cksum/CVS/
  vendor/NetBSD/tests/dist/net/mcast/CVS/
  vendor/NetBSD/tests/dist/net/ndp/CVS/
  vendor/NetBSD/tests/dist/sbin/gpt/CVS/
  vendor/NetBSD/tests/dist/sys/net/CVS/
  vendor/NetBSD/tests/dist/sys/netatalk/CVS/
  vendor/NetBSD/tests/dist/sys/netinet/CVS/
  vendor/NetBSD/tests/dist/sys/netinet6/CVS/
  vendor/NetBSD/tests/dist/usr.bin/gdb/CVS/
  vendor/NetBSD/tests/dist/usr.bin/ld/CVS/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"