svn commit: r281690 - head/usr.sbin/bluetooth/hccontrol

2015-04-18 Thread Takanori Watanabe
Author: takawata
Date: Sat Apr 18 16:04:32 2015
New Revision: 281690
URL: https://svnweb.freebsd.org/changeset/base/281690

Log:
  Change printf formatting to unbroke i386 arch.
  
  Submitted by:da...@catwhisker.org

Modified:
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 09:49:09 2015
(r281689)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 16:04:32 2015
(r281690)
@@ -232,7 +232,7 @@ le_read_local_supported_features(int s, 
NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), 
(void *)rp, n);
 
-   printf(LOCAL SUPPORTED: %d %d %lu\n, e, rp.status,
+   printf(LOCAL SUPPORTED: %d %d %jx\n, e, rp.status,
rp.le_features);
 
return 0;
@@ -250,7 +250,7 @@ le_read_supported_status(int s, int argc
NG_HCI_OCF_LE_READ_SUPPORTED_STATUS),
(void *)rp, n);
 
-   printf(LE_STATUS: %d %d %lx\n, e, rp.status, rp.le_status);
+   printf(LE_STATUS: %d %d %jx\n, e, rp.status, rp.le_status);
 
return 0;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281697 - head/usr.sbin/bluetooth/hccontrol

2015-04-18 Thread Takanori Watanabe
Author: takawata
Date: Sat Apr 18 17:41:09 2015
New Revision: 281697
URL: https://svnweb.freebsd.org/changeset/base/281697

Log:
  To ensure j formatting string valid, cast uint64_t values to uintmax_t.

Modified:
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 17:21:12 2015
(r281696)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 17:41:09 2015
(r281697)
@@ -43,6 +43,7 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include stdint.h
 #define L2CAP_SOCKET_CHECKED
 #include bluetooth.h
 #include hccontrol.h
@@ -233,7 +234,7 @@ le_read_local_supported_features(int s, 
(void *)rp, n);
 
printf(LOCAL SUPPORTED: %d %d %jx\n, e, rp.status,
-   rp.le_features);
+  (uintmax_t) rp.le_features);
 
return 0;
 }
@@ -250,7 +251,7 @@ le_read_supported_status(int s, int argc
NG_HCI_OCF_LE_READ_SUPPORTED_STATUS),
(void *)rp, n);
 
-   printf(LE_STATUS: %d %d %jx\n, e, rp.status, rp.le_status);
+   printf(LE_STATUS: %d %d %jx\n, e, rp.status, (uintmax_t)rp.le_status);
 
return 0;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281695 - head/sys/netipsec

2015-04-18 Thread Andrey V. Elsukov
Author: ae
Date: Sat Apr 18 16:58:33 2015
New Revision: 281695
URL: https://svnweb.freebsd.org/changeset/base/281695

Log:
  Change ipsec_address() and ipsec_logsastr() functions to take two
  additional arguments - buffer and size of this buffer.
  
  ipsec_address() is used to convert sockaddr structure to presentation
  format. The IPv6 part of this function returns pointer to the on-stack
  buffer and at the moment when it will be used by caller, it becames
  invalid. IPv4 version uses 4 static buffers and returns pointer to
  new buffer each time when it called. But anyway it is still possible
  to get corrupted data when several threads will use this function.
  
  ipsec_logsastr() is used to format string about SA entry. It also
  uses static buffer and has the same problem with concurrent threads.
  
  To fix these problems add the buffer pointer and size of this
  buffer to arguments. Now each caller will pass buffer and its size
  to these functions. Also convert all places where these functions
  are used (except disabled code).
  
  And now ipsec_address() uses inet_ntop() function from libkern.
  
  PR:   185996
  Differential Revision:https://reviews.freebsd.org/D2321
  Reviewed by:  gnn
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c

Modified: head/sys/netipsec/ipsec.c
==
--- head/sys/netipsec/ipsec.c   Sat Apr 18 16:51:24 2015(r281694)
+++ head/sys/netipsec/ipsec.c   Sat Apr 18 16:58:33 2015(r281695)
@@ -1488,6 +1488,7 @@ ipsec_chkreplay(u_int32_t seq, struct se
 int
 ipsec_updatereplay(u_int32_t seq, struct secasvar *sav)
 {
+   char buf[128];
struct secreplay *replay;
u_int32_t diff;
int fr;
@@ -1567,7 +1568,8 @@ ok:
return (1);
 
ipseclog((LOG_WARNING, %s: replay counter made %d cycle. %s\n,
-   __func__, replay-overflow, ipsec_logsastr(sav)));
+   __func__, replay-overflow,
+   ipsec_logsastr(sav, buf, sizeof(buf;
}
 
replay-count++;
@@ -1598,67 +1600,37 @@ vshiftl(unsigned char *bitmap, int nbit,
}
 }
 
-#ifdef INET
-/* Return a printable string for the IPv4 address. */
-static char *
-inet_ntoa4(struct in_addr ina)
-{
-   static char buf[4][4 * sizeof 123 + 4];
-   unsigned char *ucp = (unsigned char *) ina;
-   static int i = 3;
-
-   /* XXX-BZ Returns static buffer. */
-   i = (i + 1) % 4;
-   sprintf(buf[i], %d.%d.%d.%d, ucp[0]  0xff, ucp[1]  0xff,
-   ucp[2]  0xff, ucp[3]  0xff);
-   return (buf[i]);
-}
-#endif
-
 /* Return a printable string for the address. */
-char *
-ipsec_address(union sockaddr_union* sa)
+char*
+ipsec_address(union sockaddr_union* sa, char *buf, socklen_t size)
 {
-#ifdef INET6
-   char ip6buf[INET6_ADDRSTRLEN];
-#endif
 
switch (sa-sa.sa_family) {
 #ifdef INET
case AF_INET:
-   return (inet_ntoa4(sa-sin.sin_addr));
+   return (inet_ntop(AF_INET, sa-sin.sin_addr, buf, size));
 #endif /* INET */
 #ifdef INET6
case AF_INET6:
-   return (ip6_sprintf(ip6buf, sa-sin6.sin6_addr));
+   return (inet_ntop(AF_INET6, sa-sin6.sin6_addr, buf, size));
 #endif /* INET6 */
default:
return ((unknown address family));
}
 }
 
-const char *
-ipsec_logsastr(struct secasvar *sav)
+char *
+ipsec_logsastr(struct secasvar *sav, char *buf, size_t size)
 {
-   static char buf[256];
-   char *p;
-   struct secasindex *saidx = sav-sah-saidx;
-
-   IPSEC_ASSERT(saidx-src.sa.sa_family == saidx-dst.sa.sa_family,
-   (address family mismatch));
-
-   p = buf;
-   snprintf(buf, sizeof(buf), SA(SPI=%u , (u_int32_t)ntohl(sav-spi));
-   while (p  *p)
-   p++;
-   /* NB: only use ipsec_address on one address at a time. */
-   snprintf(p, sizeof (buf) - (p - buf), src=%s ,
-   ipsec_address(saidx-src));
-   while (p  *p)
-   p++;
-   snprintf(p, sizeof (buf) - (p - buf), dst=%s),
-   ipsec_address(saidx-dst));
+   char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN];
+
+   IPSEC_ASSERT(sav-sah-saidx.src.sa.sa_family ==
+   sav-sah-saidx.dst.sa.sa_family, (address family mismatch));
 
+   snprintf(buf, size, SA(SPI=%08lx src=%s dst=%s),
+   (u_long)ntohl(sav-spi),
+   ipsec_address(sav-sah-saidx.src, sbuf, sizeof(sbuf)),
+   ipsec_address(sav-sah-saidx.dst, dbuf, sizeof(dbuf)));
return (buf);
 }
 

Modified: head/sys/netipsec/ipsec.h
==
--- head/sys/netipsec/ipsec.h   Sat 

svn commit: r281692 - in head/sys: conf netipsec

2015-04-18 Thread Andrey V. Elsukov
Author: ae
Date: Sat Apr 18 16:38:45 2015
New Revision: 281692
URL: https://svnweb.freebsd.org/changeset/base/281692

Log:
  Remove xform_ipip.c and code related to XF_IP4.
  
  The only thing is used from this code is ipip_output() function, that does
  IPIP encapsulation. Other parts of XF_IP4 code were removed in r275133.
  Also it isn't possible to configure the use of XF_IP4, nor from userland
  via setkey(8), nor from the kernel.
  
  Simplify the ipip_output() function and rename it to ipsec_encap().
  * move IP_DF handling from ipsec4_process_packet() into ipsec_encap();
  * since ipsec_encap() called from ipsec[64]_process_packet(), it
is safe to assume that mbuf is contiguous at least to IP header
for used IP version. Remove all unneeded m_pullup(), m_copydata
and related checks.
  * use V_ip_defttl and V_ip6_defhlim for outer headers;
  * use V_ip4_ipsec_ecn and V_ip6_ipsec_ecn for outer headers;
  * move all diagnostic messages to the ipsec_encap() callers;
  * simplify handling of ipsec_encap() results: if it returns non zero
value, print diagnostic message and free mbuf.
  * some style(9) fixes.
  
  Differential Revision:https://reviews.freebsd.org/D2303
  Reviewed by:  glebius
  Sponsored by: Yandex LLC

Deleted:
  head/sys/netipsec/xform_ipip.c
Modified:
  head/sys/conf/files
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/xform.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Apr 18 16:08:06 2015(r281691)
+++ head/sys/conf/files Sat Apr 18 16:38:45 2015(r281692)
@@ -3565,7 +3565,6 @@ netipsec/keysock.coptional ipsec inet 
 netipsec/xform_ah.coptional ipsec inet | ipsec inet6
 netipsec/xform_esp.c   optional ipsec inet | ipsec inet6
 netipsec/xform_ipcomp.coptional ipsec inet | ipsec inet6
-netipsec/xform_ipip.c  optional ipsec inet | ipsec inet6
 netipsec/xform_tcp.c   optional ipsec inet tcp_signature | \
 ipsec inet6 tcp_signature
 netnatm/natm.c optional natm

Modified: head/sys/netipsec/ipsec_output.c
==
--- head/sys/netipsec/ipsec_output.cSat Apr 18 16:08:06 2015
(r281691)
+++ head/sys/netipsec/ipsec_output.cSat Apr 18 16:38:45 2015
(r281692)
@@ -61,6 +61,7 @@
 #include netinet/ip6.h
 #ifdef INET6
 #include netinet6/ip6_var.h
+#include netinet6/scope6_var.h
 #endif
 #include netinet/in_pcb.h
 #ifdef INET6
@@ -419,6 +420,101 @@ bad:
 #undef IPSEC_OSTAT
 }
 
+static int
+ipsec_encap(struct mbuf **mp, struct secasindex *saidx)
+{
+#ifdef INET6
+   struct ip6_hdr *ip6;
+#endif
+   struct ip *ip;
+   int setdf;
+   uint8_t itos, proto;
+
+   ip = mtod(*mp, struct ip *);
+   switch (ip-ip_v) {
+#ifdef INET
+   case IPVERSION:
+   proto = IPPROTO_IPIP;
+   /*
+* Collect IP_DF state from the inner header
+* and honor system-wide control of how to handle it.
+*/
+   switch (V_ip4_ipsec_dfbit) {
+   case 0: /* clear in outer header */
+   case 1: /* set in outer header */
+   setdf = V_ip4_ipsec_dfbit;
+   break;
+   default:/* propagate to outer header */
+   setdf = (ip-ip_off  ntohs(IP_DF)) != 0;
+   }
+   itos = ip-ip_tos;
+   break;
+#endif
+#ifdef INET6
+   case (IPV6_VERSION  4):
+   proto = IPPROTO_IPV6;
+   ip6 = mtod(*mp, struct ip6_hdr *);
+   itos = (ntohl(ip6-ip6_flow)  20)  0xff;
+   setdf = V_ip4_ipsec_dfbit ? 1: 0;
+   /* scoped address handling */
+   in6_clearscope(ip6-ip6_src);
+   in6_clearscope(ip6-ip6_dst);
+   break;
+#endif
+   default:
+   return (EAFNOSUPPORT);
+   }
+   switch (saidx-dst.sa.sa_family) {
+#ifdef INET
+   case AF_INET:
+   if (saidx-src.sa.sa_family != AF_INET ||
+   saidx-src.sin.sin_addr.s_addr == INADDR_ANY ||
+   saidx-dst.sin.sin_addr.s_addr == INADDR_ANY)
+   return (EINVAL);
+   M_PREPEND(*mp, sizeof(struct ip), M_NOWAIT);
+   if (*mp == NULL)
+   return (ENOBUFS);
+   ip = mtod(*mp, struct ip *);
+   ip-ip_v = IPVERSION;
+   ip-ip_hl = sizeof(struct ip)  2;
+   ip-ip_p = proto;
+   ip-ip_len = htons((*mp)-m_pkthdr.len);
+   ip-ip_ttl = V_ip_defttl;
+   ip-ip_sum = 0;
+   ip-ip_off = setdf ? htons(IP_DF): 0;
+   ip-ip_src = saidx-src.sin.sin_addr;
+   ip-ip_dst = saidx-dst.sin.sin_addr;
+  

svn commit: r281693 - head/sys/netipsec

2015-04-18 Thread Andrey V. Elsukov
Author: ae
Date: Sat Apr 18 16:46:31 2015
New Revision: 281693
URL: https://svnweb.freebsd.org/changeset/base/281693

Log:
  Fix handling of scoped IPv6 addresses in IPSec code.
  
  * in ipsec_encap() embed scope zone ids into link-local addresses
in the new IPv6 header, this helps ip6_output() disambiguate the
scope;
  * teach key_ismyaddr6() use in6_localip(). in6_localip() is less
strict than key_sockaddrcmp(). It doesn't compare all fileds of
struct sockaddr_in6, but it is faster and it should be safe,
because all SA's data was checked for correctness. Also, since
IPv6 link-local addresses in the V_in6_ifaddrhead are stored in
kernel-internal form, we need to embed scope zone id from SA into
the address before calling in6_localip.
  * in ipsec_common_input() take scope zone id embedded in the address
and use it to initialize sin6_scope_id, then use this sockaddr
structure to lookup SA, because we keep addresses in the SADB without
embedded scope zone id.
  
  Differential Revision:https://reviews.freebsd.org/D2304
  Reviewed by:  gnn
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/ipsec_input.c
==
--- head/sys/netipsec/ipsec_input.c Sat Apr 18 16:38:45 2015
(r281692)
+++ head/sys/netipsec/ipsec_input.c Sat Apr 18 16:46:31 2015
(r281693)
@@ -195,6 +195,13 @@ ipsec_common_input(struct mbuf *m, int s
m_copydata(m, offsetof(struct ip6_hdr, ip6_dst),
sizeof(struct in6_addr),
(caddr_t) dst_address.sin6.sin6_addr);
+   /* We keep addresses in SADB without embedded scope id */
+   if (IN6_IS_SCOPE_LINKLOCAL(dst_address.sin6.sin6_addr)) {
+   /* XXX: sa6_recoverscope() */
+   dst_address.sin6.sin6_scope_id =
+   ntohs(dst_address.sin6.sin6_addr.s6_addr16[1]);
+   dst_address.sin6.sin6_addr.s6_addr16[1] = 0;
+   }
break;
 #endif /* INET6 */
default:

Modified: head/sys/netipsec/ipsec_output.c
==
--- head/sys/netipsec/ipsec_output.cSat Apr 18 16:38:45 2015
(r281692)
+++ head/sys/netipsec/ipsec_output.cSat Apr 18 16:46:31 2015
(r281693)
@@ -503,7 +503,14 @@ ipsec_encap(struct mbuf **mp, struct sec
ip6-ip6_hlim = V_ip6_defhlim;
ip6-ip6_nxt = proto;
ip6-ip6_dst = saidx-dst.sin6.sin6_addr;
+   /* For link-local address embed scope zone id */
+   if (IN6_IS_SCOPE_LINKLOCAL(ip6-ip6_dst))
+   ip6-ip6_dst.s6_addr16[1] =
+   htons(saidx-dst.sin6.sin6_scope_id  0x);
ip6-ip6_src = saidx-src.sin6.sin6_addr;
+   if (IN6_IS_SCOPE_LINKLOCAL(ip6-ip6_src))
+   ip6-ip6_src.s6_addr16[1] =
+   htons(saidx-src.sin6.sin6_scope_id  0x);
ip6-ip6_plen = htons((*mp)-m_pkthdr.len - sizeof(*ip6));
ip_ecn_ingress(V_ip6_ipsec_ecn, proto, itos);
ip6-ip6_flow |= htonl((uint32_t)proto  20);

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Sat Apr 18 16:38:45 2015(r281692)
+++ head/sys/netipsec/key.c Sat Apr 18 16:46:31 2015(r281693)
@@ -3856,48 +3856,19 @@ key_ismyaddr(struct sockaddr *sa)
  * compare my own address for IPv6.
  * 1: ours
  * 0: other
- * NOTE: derived ip6_input() in KAME. This is necessary to modify more.
  */
-#include netinet6/in6_var.h
-
 static int
 key_ismyaddr6(struct sockaddr_in6 *sin6)
 {
-   struct in6_ifaddr *ia;
-#if 0
-   struct in6_multi *in6m;
-#endif
-
-   IN6_IFADDR_RLOCK();
-   TAILQ_FOREACH(ia, V_in6_ifaddrhead, ia_link) {
-   if (key_sockaddrcmp((struct sockaddr *)sin6,
-   (struct sockaddr *)ia-ia_addr, 0) == 0) {
-   IN6_IFADDR_RUNLOCK();
-   return 1;
-   }
-
-#if 0
-   /*
-* XXX Multicast
-* XXX why do we care about multlicast here while we don't care
-* about IPv4 multicast??
-* XXX scope
-*/
-   in6m = NULL;
-   IN6_LOOKUP_MULTI(sin6-sin6_addr, ia-ia_ifp, in6m);
-   if (in6m) {
-   IN6_IFADDR_RUNLOCK();
-   return 1;
-   }
-#endif
-   }
-   IN6_IFADDR_RUNLOCK();
+   struct in6_addr in6;
 
-   /* loopback, just for safety */
-   if (IN6_IS_ADDR_LOOPBACK(sin6-sin6_addr))
-   return 1;
+   

svn commit: r281696 - head/sys/kern

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 17:21:12 2015
New Revision: 281696
URL: https://svnweb.freebsd.org/changeset/base/281696

Log:
  Initialize td_sel in the thread_init().  Struct thread is not zeroed
  on the initial allocation, but seltdinit() assumes that td_sel is NULL
  or a valid pointer.  Note that thread_fini()/seltdfini() also relies
  on this, but correctly resets td_sel to NULL.
  
  Submitted by: luke...@gmail.com
  PR:   199518
  MFC after:1 week

Modified:
  head/sys/kern/kern_thread.c

Modified: head/sys/kern/kern_thread.c
==
--- head/sys/kern/kern_thread.c Sat Apr 18 16:58:33 2015(r281695)
+++ head/sys/kern/kern_thread.c Sat Apr 18 17:21:12 2015(r281696)
@@ -209,6 +209,7 @@ thread_init(void *mem, int size, int fla
td-td_sched = (struct td_sched *)td[1];
umtx_thread_init(td);
td-td_kstack = 0;
+   td-td_sel = NULL;
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281698 - head/sys/dev/virtio/block

2015-04-18 Thread Alexander Motin
Author: mav
Date: Sat Apr 18 19:37:37 2015
New Revision: 281698
URL: https://svnweb.freebsd.org/changeset/base/281698

Log:
  Do not report stripe size if it is equal to sector size.
  
  MFC after:1 week

Modified:
  head/sys/dev/virtio/block/virtio_blk.c

Modified: head/sys/dev/virtio/block/virtio_blk.c
==
--- head/sys/dev/virtio/block/virtio_blk.c  Sat Apr 18 17:41:09 2015
(r281697)
+++ head/sys/dev/virtio/block/virtio_blk.c  Sat Apr 18 19:37:37 2015
(r281698)
@@ -710,7 +710,8 @@ vtblk_alloc_disk(struct vtblk_softc *sc,
dp-d_fwheads = blkcfg-geometry.heads;
}
 
-   if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) {
+   if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) 
+   blkcfg-topology.physical_block_exp  0) {
dp-d_stripesize = dp-d_sectorsize *
(1  blkcfg-topology.physical_block_exp);
dp-d_stripeoffset = (dp-d_stripesize -
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281691 - in head: . etc/defaults etc/rc.d sbin/mount sbin/mount_nfs share/man/man5 sys/nfsclient usr.bin/nfsstat usr.sbin/nfsd

2015-04-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Sat Apr 18 16:08:06 2015
New Revision: 281691
URL: https://svnweb.freebsd.org/changeset/base/281691

Log:
  Remove some oldnfs remnants.
  
  Differential Revision:https://reviews.freebsd.org/D2287
  Reviewed by:  rmacklem@
  Sponsored by: The FreeBSD Foundation

Modified:
  head/ObsoleteFiles.inc
  head/etc/defaults/rc.conf
  head/etc/rc.d/mountd
  head/etc/rc.d/nfsd
  head/sbin/mount/mount.8
  head/sbin/mount/mount.c
  head/sbin/mount_nfs/Makefile
  head/sbin/mount_nfs/mount_nfs.8
  head/share/man/man5/rc.conf.5
  head/sys/nfsclient/nfs.h
  head/usr.bin/nfsstat/nfsstat.c
  head/usr.sbin/nfsd/nfsd.8

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Apr 18 16:04:32 2015(r281690)
+++ head/ObsoleteFiles.inc  Sat Apr 18 16:08:06 2015(r281691)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20150418
+OLD_FILES+=sbin/mount_oldnfs
+OLD_FILES+=usr/share/man/man8/mount_oldnfs.8.gz
 # 20150416: ALTQ moved to net/altq
 OLD_FILES+=usr/include/altq/altq_rmclass_debug.h
 OLD_FILES+=usr/include/altq/altq.h

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Sat Apr 18 16:04:32 2015(r281690)
+++ head/etc/defaults/rc.conf   Sat Apr 18 16:08:06 2015(r281691)
@@ -88,7 +88,7 @@ fsck_y_enable=NO# Set to YES to do fs
 fsck_y_flags=# Additional flags for fsck -y
 background_fsck=YES  # Attempt to run fsck in the background where possible.
 background_fsck_delay=60 # Time to wait (seconds) before starting the fsck.
-netfs_types=nfs:NFS oldnfs:OLDNFS smbfs:SMB # Net filesystems.
+netfs_types=nfs:NFS smbfs:SMB # Net filesystems.
 extra_netfs_types=NO # List of network extra filesystem types for delayed
# mount at startup (or NO).
 
@@ -324,7 +324,6 @@ autounmountd_flags=   # Flags to autoun
 nfs_client_enable=NO # This host is an NFS client (or NO).
 nfs_access_cache=60  # Client cache timeout in seconds
 nfs_server_enable=NO # This host is an NFS server (or NO).
-oldnfs_server_enable=NO  # Run the old NFS server (YES/NO).
 nfs_server_flags=-u -t   # Flags to nfsd (if enabled).
 mountd_enable=NO # Run mountd (or NO).
 mountd_flags=-r  # Flags to mountd (if NFS server enabled).

Modified: head/etc/rc.d/mountd
==
--- head/etc/rc.d/mountdSat Apr 18 16:04:32 2015(r281690)
+++ head/etc/rc.d/mountdSat Apr 18 16:08:06 2015(r281691)
@@ -33,12 +33,6 @@ mountd_precmd()
fi
fi
 
-   # If oldnfs_server_enable is yes, force use of the old NFS server
-   #
-   if checkyesno oldnfs_server_enable; then
-   rc_flags=-o ${rc_flags}
-   fi
-
if checkyesno zfs_enable; then
rc_flags=${rc_flags} /etc/exports /etc/zfs/exports
fi

Modified: head/etc/rc.d/nfsd
==
--- head/etc/rc.d/nfsd  Sat Apr 18 16:04:32 2015(r281690)
+++ head/etc/rc.d/nfsd  Sat Apr 18 16:08:06 2015(r281691)
@@ -19,40 +19,25 @@ sig_stop=USR1
 
 nfsd_precmd()
 {
-   if checkyesno oldnfs_server_enable; then
-   rc_flags=-o ${nfs_server_flags}
+   rc_flags=${nfs_server_flags}
 
-   # Load the module now, so that the vfs.nfsrv sysctl
-   # oids are available.
-   load_kld nfsserver
-
-   if checkyesno nfs_reserved_port_only; then
-   echo 'NFS on reserved port only=YES'
-   sysctl vfs.nfsrv.nfs_privport=1  /dev/null
-   else
-   sysctl vfs.nfsrv.nfs_privport=0  /dev/null
-   fi
+   # Load the modules now, so that the vfs.nfsd sysctl
+   # oids are available.
+   load_kld nfsd
+
+   if checkyesno nfs_reserved_port_only; then
+   echo 'NFS on reserved port only=YES'
+   sysctl vfs.nfsd.nfs_privport=1  /dev/null
else
-   rc_flags=${nfs_server_flags}
+   sysctl vfs.nfsd.nfs_privport=0  /dev/null
+   fi
 
-   # Load the modules now, so that the vfs.nfsd sysctl
-   # oids are available.
-   load_kld nfsd
-
-   if checkyesno nfs_reserved_port_only; then
-   echo 'NFS on reserved port only=YES'
-   sysctl vfs.nfsd.nfs_privport=1  /dev/null
-   else
-   sysctl vfs.nfsd.nfs_privport=0  /dev/null
-   fi
-
-   if checkyesno nfsv4_server_enable; then
-   sysctl vfs.nfsd.server_max_nfsvers=4  /dev/null
-   force_depend nfsuserd || err 1

svn commit: r281694 - head/sys/netipsec

2015-04-18 Thread Andrey V. Elsukov
Author: ae
Date: Sat Apr 18 16:51:24 2015
New Revision: 281694
URL: https://svnweb.freebsd.org/changeset/base/281694

Log:
  Requeue mbuf via netisr when we use IPSec tunnel mode and IPv6.
  
  ipsec6_common_input_cb() uses partial copy of ip6_input() to parse
  headers. But this isn't correct, when we use tunnel mode IPSec.
  
  When we stripped outer IPv6 header from the decrypted packet, it
  can become IPv4 packet and should be handled by ip_input. Also when
  we use tunnel mode IPSec with IPv6 traffic, we should pass decrypted
  packet with inner IPv6 header to ip6_input, it will correctly handle
  it and also can decide to forward it.
  
  The skip variable points to offset where payload starts. In tunnel
  mode we reset it to zero after stripping the outer header. So, when
  it is zero, we should requeue mbuf via netisr.
  
  Differential Revision:https://reviews.freebsd.org/D2306
  Reviewed by:  adrian, gnn
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec_input.c

Modified: head/sys/netipsec/ipsec_input.c
==
--- head/sys/netipsec/ipsec_input.c Sat Apr 18 16:46:31 2015
(r281693)
+++ head/sys/netipsec/ipsec_input.c Sat Apr 18 16:51:24 2015
(r281694)
@@ -627,7 +627,7 @@ ipsec6_common_input_cb(struct mbuf *m, s
struct m_tag *mtag;
struct tdb_ident *tdbi;
struct secasindex *saidx;
-   int nxt;
+   int nxt, isr_prot;
u_int8_t nxt8;
int error, nest;
 #ifdef notyet
@@ -803,6 +803,35 @@ ipsec6_common_input_cb(struct mbuf *m, s
if ((error = ipsec_filter(m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0)
return (error);
 #endif /* DEV_ENC */
+   if (skip == 0) {
+   /*
+* We stripped outer IPv6 header.
+* Now we should requeue decrypted packet via netisr.
+*/
+   switch (prot) {
+#ifdef INET
+   case IPPROTO_IPIP:
+   isr_prot = NETISR_IP;
+   break;
+#endif
+   case IPPROTO_IPV6:
+   isr_prot = NETISR_IPV6;
+   break;
+   default:
+   DPRINTF((%s: cannot handle inner ip proto %d\n,
+   __func__, prot));
+   IPSEC_ISTAT(sproto, nopf);
+   error = EPFNOSUPPORT;
+   goto bad;
+   }
+   error = netisr_queue_src(isr_prot, (uintptr_t)sav-spi, m);
+   if (error) {
+   IPSEC_ISTAT(sproto, qfull);
+   DPRINTF((%s: queue full; proto %u packet dropped\n,
+   __func__, sproto));
+   }
+   return (error);
+   }
/*
 * See the end of ip6_input for this logic.
 * IPPROTO_IPV[46] case will be processed just like other ones
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281699 - head/usr.sbin/mountd

2015-04-18 Thread Simon J. Gerraty
Author: sjg
Date: Sat Apr 18 19:52:39 2015
New Revision: 281699
URL: https://svnweb.freebsd.org/changeset/base/281699

Log:
  No need to delete export from filesystems which are not exported.

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Sat Apr 18 19:37:37 2015
(r281698)
+++ head/usr.sbin/mountd/mountd.c   Sat Apr 18 19:52:39 2015
(r281699)
@@ -1732,6 +1732,12 @@ get_exportlist(void)
}
 
/*
+* We do not need to delete export flag from
+* filesystems that do not have it set.
+*/
+   if (!(fsp-f_flags  MNT_EXPORTED))
+   continue;
+   /*
 * Do not delete export for network filesystem by
 * passing export arg to nmount().
 * It only makes sense to do this for local filesystems.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281701 - head/share/man/man9

2015-04-18 Thread Mark Johnston
Author: markj
Date: Sat Apr 18 20:31:59 2015
New Revision: 281701
URL: https://svnweb.freebsd.org/changeset/base/281701

Log:
  SDT(9): add a section on SDT providers, mentioning the sdt provider.
  Add examples demonstrating how one can list available providers and the
  DTrace probes provided by a provider.
  
  Differential Revision:https://reviews.freebsd.org/D2166
  Reviewed by:  rpaulo
  MFC after:2 weeks

Modified:
  head/share/man/man9/SDT.9

Modified: head/share/man/man9/SDT.9
==
--- head/share/man/man9/SDT.9   Sat Apr 18 20:10:19 2015(r281700)
+++ head/share/man/man9/SDT.9   Sat Apr 18 20:31:59 2015(r281701)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd March 8, 2015
+.Dd April 18, 2015
 .Dt SDT 9
 .Os
 .Sh NAME
@@ -194,7 +194,37 @@ macros are used to create
 trace points.
 They are meant to be added to executable code and can be used to instrument the
 code in which they are called.
+.Sh PROVIDERS
+A number of kernel DTrace providers are available.
+In general, these providers define stable interfaces and should be treated as
+such: existing D scripts may be broken if a probe is renamed or its arguments
+are modified.
+However, it is often useful to define ad-hoc
+.Nm
+probes for debugging a subsystem or driver.
+Similarly, a developer may wish to provide a group of
+.Nm
+probes without committing to their future stability.
+Such probes should be added to the
+.Ql sdt
+provider instead of defining a new provider.
 .Sh EXAMPLES
+The DTrace providers available on the current system can be listed with
+.Bd -literal -offset indent
+dtrace -l | sed 1d | awk '{print $2}' | sort -u
+.Ed
+.Pp
+A detailed list of the probes offered by a given provider can be obtained by
+specifying the provider using the
+.Fl P
+flag.
+For example, to view the probes and argument types for the
+.Ql sched
+provider, run
+.Bd -literal -offset indent
+dtrace -lv -P sched
+.Ed
+.Pp
 The following probe definition will create a DTrace probe called
 .Ql icmp:::receive-unreachable ,
 which would hypothetically be triggered when the kernel receives an ICMP packet
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281702 - head/sys/kern

2015-04-18 Thread Mark Johnston
Author: markj
Date: Sat Apr 18 20:36:58 2015
New Revision: 281702
URL: https://svnweb.freebsd.org/changeset/base/281702

Log:
  Remove unimplemented sched provider probes.
  
  They were added for compatibility with the sched provider in Solaris and
  illumos, but our sched provider is already incompatible since it uses native
  types, so there isn't much point in keeping them around.
  
  Differential Revision:https://reviews.freebsd.org/D2167
  Reviewed by:  rpaulo

Modified:
  head/sys/kern/kern_synch.c

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Apr 18 20:31:59 2015(r281701)
+++ head/sys/kern/kern_synch.c  Sat Apr 18 20:36:58 2015(r281702)
@@ -108,17 +108,6 @@ static voidloadav(void *arg);
 SDT_PROVIDER_DECLARE(sched);
 SDT_PROBE_DEFINE(sched, , , preempt);
 
-/*
- * These probes reference Solaris features that are not implemented in FreeBSD.
- * Create the probes anyway for compatibility with existing D scripts; they'll
- * just never fire.
- */
-SDT_PROBE_DEFINE(sched, , , cpucaps__sleep);
-SDT_PROBE_DEFINE(sched, , , cpucaps__wakeup);
-SDT_PROBE_DEFINE(sched, , , schedctl__nopreempt);
-SDT_PROBE_DEFINE(sched, , , schedctl__preempt);
-SDT_PROBE_DEFINE(sched, , , schedctl__yield);
-
 static void
 sleepinit(void *unused)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281704 - head/sys/dev/atkbdc

2015-04-18 Thread Rui Paulo
Author: rpaulo
Date: Sat Apr 18 20:55:55 2015
New Revision: 281704
URL: https://svnweb.freebsd.org/changeset/base/281704

Log:
  Synaptics: don't report the middle button when clickPad is used.
  
  On trackpads that had support for both, we were sending two button
  events when the trackpad was pressed.
  
  Tested by:Jakob Alvermark jakob at alvermark.net
  MFC after:1 week

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Sat Apr 18 20:55:33 2015(r281703)
+++ head/sys/dev/atkbdc/psm.c   Sat Apr 18 20:55:55 2015(r281704)
@@ -2756,7 +2756,8 @@ proc_synaptics(struct psm_softc *sc, pac
touchpad_buttons |= MOUSE_BUTTON4DOWN;
if ((pb-ipacket[3] ^ pb-ipacket[0])  0x02)
touchpad_buttons |= MOUSE_BUTTON5DOWN;
-   } else if (sc-synhw.capExtended  sc-synhw.capMiddle) {
+   } else if (sc-synhw.capExtended  sc-synhw.capMiddle 
+   !sc-synhw.capClickPad) {
/* Middle Button */
if ((pb-ipacket[0] ^ pb-ipacket[3])  0x01)
touchpad_buttons |= MOUSE_BUTTON2DOWN;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281703 - head/sys/conf

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 20:55:33 2015
New Revision: 281703
URL: https://svnweb.freebsd.org/changeset/base/281703

Log:
  Complete r281670, unlist removed files.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Apr 18 20:36:58 2015(r281702)
+++ head/sys/conf/files Sat Apr 18 20:55:33 2015(r281703)
@@ -2933,8 +2933,6 @@ fs/ext2fs/ext2_bmap.c optional ext2fs
 fs/ext2fs/ext2_extents.c   optional ext2fs
 fs/ext2fs/ext2_inode.c optional ext2fs
 fs/ext2fs/ext2_inode_cnv.c optional ext2fs
-fs/ext2fs/ext2_hash.c  optional ext2fs
-fs/ext2fs/ext2_htree.c optional ext2fs
 fs/ext2fs/ext2_lookup.coptional ext2fs
 fs/ext2fs/ext2_subr.c  optional ext2fs
 fs/ext2fs/ext2_vfsops.coptional ext2fs
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281703 - head/sys/conf

2015-04-18 Thread Pedro Giffuni


Oops .. thanks!

Pedro.

On 04/18/15 15:55, Konstantin Belousov wrote:

Author: kib
Date: Sat Apr 18 20:55:33 2015
New Revision: 281703
URL: https://svnweb.freebsd.org/changeset/base/281703

Log:
   Complete r281670, unlist removed files.
   
   Sponsored by:	The FreeBSD Foundation


Modified:
   head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Apr 18 20:36:58 2015(r281702)
+++ head/sys/conf/files Sat Apr 18 20:55:33 2015(r281703)
@@ -2933,8 +2933,6 @@ fs/ext2fs/ext2_bmap.c optional ext2fs
  fs/ext2fs/ext2_extents.c  optional ext2fs
  fs/ext2fs/ext2_inode.coptional ext2fs
  fs/ext2fs/ext2_inode_cnv.coptional ext2fs
-fs/ext2fs/ext2_hash.c  optional ext2fs
-fs/ext2fs/ext2_htree.c optional ext2fs
  fs/ext2fs/ext2_lookup.c   optional ext2fs
  fs/ext2fs/ext2_subr.c optional ext2fs
  fs/ext2fs/ext2_vfsops.c   optional ext2fs



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


svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:23:16 2015
New Revision: 281707
URL: https://svnweb.freebsd.org/changeset/base/281707

Log:
  Remove lazy pmap switch code from i386.  Naive benchmark with md(4)
  shows no difference with the code removed.
  
  On both amd64 and i386, assert that a released pmap is not active.
  
  Proposed and reviewed by: alc
  Discussed with:   Svatopluk Kraus onw...@gmail.com, peter
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/apic_vector.s
  head/sys/i386/i386/db_trace.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/i386/swtch.s
  head/sys/i386/include/smp.h
  head/sys/i386/xen/mp_machdep.c
  head/sys/i386/xen/pmap.c
  head/sys/x86/include/acpica_machdep.h
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015(r281706)
+++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015(r281707)
@@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap)
pmap-pm_stats.resident_count));
KASSERT(vm_radix_is_empty(pmap-pm_root),
(pmap_release: pmap has reserved page table page(s)));
+   KASSERT(CPU_EMPTY(pmap-pm_active),
+   (releasing active pmap %p, pmap));
 
if (pmap_pcid_enabled) {
/*

Modified: head/sys/i386/i386/apic_vector.s
==
--- head/sys/i386/i386/apic_vector.sSat Apr 18 21:22:26 2015
(r281706)
+++ head/sys/i386/i386/apic_vector.sSat Apr 18 21:23:16 2015
(r281707)
@@ -320,19 +320,4 @@ IDTVEC(rendezvous)
POP_FRAME
iret

-/*
- * Clean up when we lose out on the lazy context switch optimization.
- * ie: when we are about to release a PTD but a cpu is still borrowing it.
- */
-   SUPERALIGN_TEXT
-IDTVEC(lazypmap)
-   PUSH_FRAME
-   SET_KERNEL_SREGS
-   cld
-
-   callpmap_lazyfix_action
-
-   callas_lapic_eoi
-   POP_FRAME
-   iret
 #endif /* SMP */

Modified: head/sys/i386/i386/db_trace.c
==
--- head/sys/i386/i386/db_trace.c   Sat Apr 18 21:22:26 2015
(r281706)
+++ head/sys/i386/i386/db_trace.c   Sat Apr 18 21:23:16 2015
(r281707)
@@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_
frame_type = TRAP_TIMERINT;
else if (strcmp(name, Xcpustop) == 0 ||
strcmp(name, Xrendezvous) == 0 ||
-   strcmp(name, Xipi_intr_bitmap_handler) == 0 ||
-   strcmp(name, Xlazypmap) == 0)
+   strcmp(name, Xipi_intr_bitmap_handler) == 0)
frame_type = TRAP_INTERRUPT;
}
 

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015
(r281706)
+++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015
(r281707)
@@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU];
 u_long *ipi_invlpg_counts[MAXCPU];
 u_long *ipi_invlcache_counts[MAXCPU];
 u_long *ipi_rendezvous_counts[MAXCPU];
-u_long *ipi_lazypmap_counts[MAXCPU];
 static u_long *ipi_hardclock_counts[MAXCPU];
 #endif
 
@@ -576,10 +575,6 @@ cpu_mp_start(void)
setidt(IPI_INVLCACHE, IDTVEC(invlcache),
   SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 
-   /* Install an inter-CPU IPI for lazy pmap release */
-   setidt(IPI_LAZYPMAP, IDTVEC(lazypmap),
-  SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
-
/* Install an inter-CPU IPI for all-CPU rendezvous */
setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous),
   SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy)
intrcnt_add(buf, ipi_ast_counts[i]);
snprintf(buf, sizeof(buf), cpu%d:rendezvous, i);
intrcnt_add(buf, ipi_rendezvous_counts[i]);
-   snprintf(buf, sizeof(buf), cpu%d:lazypmap, i);
-   intrcnt_add(buf, ipi_lazypmap_counts[i]);
snprintf(buf, sizeof(buf), cpu%d:hardclock, i);
intrcnt_add(buf, ipi_hardclock_counts[i]);
}   

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sat Apr 18 21:22:26 2015(r281706)
+++ head/sys/i386/i386/pmap.c   Sat Apr 18 21:23:16 2015(r281707)
@@ -1248,18 +1248,14 @@ pmap_invalidate_cache_pages(vm_page_t *p
 }
 
 /*
- * Are we current address space or kernel?  N.B. We return FALSE when
- * a pmap's page table is in use because a kernel thread is borrowing
- * 

Re: svn commit: r281705 - in head: cddl/contrib/opensolaris/cmd/dtrace share/man/man4 share/man/man9

2015-04-18 Thread Steven Hartland

Thank you for doing this!

On 18/04/2015 22:00, Mark Johnston wrote:

Author: markj
Date: Sat Apr 18 21:00:36 2015
New Revision: 281705
URL: https://svnweb.freebsd.org/changeset/base/281705

Log:
   Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers.
   The format of these pages is somewhat experimental, so they may be subject
   to further tweaking.
   
   Differential Revision:	https://reviews.freebsd.org/D2170

   Reviewed by: bcr, rpaulo
   MFC after:   2 weeks

Added:
   head/share/man/man4/dtrace-io.4   (contents, props changed)
   head/share/man/man4/dtrace-ip.4   (contents, props changed)
   head/share/man/man4/dtrace-proc.4   (contents, props changed)
   head/share/man/man4/dtrace-sched.4   (contents, props changed)
   head/share/man/man4/dtrace-tcp.4   (contents, props changed)
   head/share/man/man4/dtrace-udp.4   (contents, props changed)
Modified:
   head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
   head/share/man/man4/Makefile
   head/share/man/man9/SDT.9

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Sat Apr 18 20:55:55 
2015(r281704)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Sat Apr 18 21:00:36 
2015(r281705)
@@ -21,7 +21,7 @@
  .\
  .\ $FreeBSD$
  .\
-.Dd October 5, 2013
+.Dd April 18, 2015
  .Dt DTRACE 1
  .Os
  .Sh NAME
@@ -670,7 +670,8 @@ Invalid command line options or argument
  .Sh SEE ALSO
  .Xr cpp 1 ,
  .Xr dtruss 1 ,
-.Xr elf 5
+.Xr elf 5 ,
+.Xr SDT 9
  .Rs
  .%T Solaris Dynamic Tracing Guide
  .Re

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Apr 18 20:55:55 2015
(r281704)
+++ head/share/man/man4/MakefileSat Apr 18 21:00:36 2015
(r281705)
@@ -121,6 +121,12 @@ MAN=   aac.4 \
dpt.4 \
ds1307.4 \
ds3231.4 \
+   ${_dtrace_io.4} \
+   ${_dtrace_ip.4} \
+   ${_dtrace_proc.4} \
+   ${_dtrace_sched.4} \
+   ${_dtrace_tcp.4} \
+   ${_dtrace_udp.4} \
dummynet.4 \
ed.4 \
edsc.4 \
@@ -812,6 +818,15 @@ SUBDIR=man4.${MACHINE_CPUARCH}
  _ccd.4=   ccd.4
  .endif
  
+.if ${MK_CDDL} != no

+_dtrace_io.4=  dtrace-io.4
+_dtrace_ip.4=  dtrace-ip.4
+_dtrace_proc.4=dtrace-proc.4
+_dtrace_sched.4= dtrace-sched.4
+_dtrace_tcp.4= dtrace-tcp.4
+_dtrace_udp.4= dtrace-udp.4
+.endif
+
  .if ${MK_ISCSI} != no
  MAN+= iscsi.4
  MAN+= iscsi_initiator.4

Added: head/share/man/man4/dtrace-io.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/dtrace-io.4 Sat Apr 18 21:00:36 2015
(r281705)
@@ -0,0 +1,123 @@
+.\ Copyright (c) 2015 Mark Johnston ma...@freebsd.org
+.\ 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.
+.\
+.\ $FreeBSD$
+.\
+.Dd April 18, 2015
+.Dt DTRACE-IO 4
+.Os
+.Sh NAME
+.Nm dtrace-io
+.Nd a DTrace provider for tracing events related to disk I/O
+.Sh SYNOPSIS
+.Fn io:::start struct bio * struct devstat *
+.Fn io:::done struct bio * struct devstat *
+.Sh DESCRIPTION
+The
+.Nm io
+provider allows the tracing of disk I/O events.
+The
+.Fn io:::start
+probe fires when a I/O request is about to be sent to the backing driver of a
+.Xr disk 9
+object.
+This occurs after all
+.Xr GEOM 4
+transformations have been performed on the request.
+The
+.Fn io:::done
+probe fires when a I/O request is completed.
+Both probes take a
+.Vt struct bio *
+representing the I/O 

svn commit: r281710 - head/sys/x86/include

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:27:28 2015
New Revision: 281710
URL: https://svnweb.freebsd.org/changeset/base/281710

Log:
  Revert unrelated chunk from the r281707.
  
  MFC after:2 weeks

Modified:
  head/sys/x86/include/acpica_machdep.h

Modified: head/sys/x86/include/acpica_machdep.h
==
--- head/sys/x86/include/acpica_machdep.h   Sat Apr 18 21:26:47 2015
(r281709)
+++ head/sys/x86/include/acpica_machdep.h   Sat Apr 18 21:27:28 2015
(r281710)
@@ -74,7 +74,6 @@ enum intr_polarity;
 
 void   acpi_SetDefaultIntrModel(int model);
 void   acpi_cpu_c1(void);
-void   acpi_cpu_idle_mwait(uint32_t mwait_hint);
 void   *acpi_map_table(vm_paddr_t pa, const char *sig);
 void   acpi_unmap_table(void *table);
 vm_paddr_t acpi_find_table(const char *sig);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281713 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/modules/hwpmc sys/powerpc/booke sys/powerpc/include

2015-04-18 Thread Justin Hibbits
Author: jhibbits
Date: Sat Apr 18 21:39:17 2015
New Revision: 281713
URL: https://svnweb.freebsd.org/changeset/base/281713

Log:
  Implement hwpmc(4) for Freescale e500 core.
  
  This supports e500v1, e500v2, and e500mc. Tested only on e500v2, but the
  performance counters are identical across all, with e500mc having some
  additional events.
  
  Relnotes: Yes

Added:
  head/sys/dev/hwpmc/hwpmc_e500.c   (contents, props changed)
Modified:
  head/lib/libpmc/libpmc.c
  head/sys/conf/files.powerpc
  head/sys/dev/hwpmc/hwpmc_mpc7xxx.c
  head/sys/dev/hwpmc/hwpmc_powerpc.c
  head/sys/dev/hwpmc/hwpmc_powerpc.h
  head/sys/dev/hwpmc/hwpmc_ppc970.c
  head/sys/dev/hwpmc/pmc_events.h
  head/sys/modules/hwpmc/Makefile
  head/sys/powerpc/booke/interrupt.c
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/booke/machdep.c
  head/sys/powerpc/booke/trap_subr.S
  head/sys/powerpc/include/pmc_mdep.h

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cSat Apr 18 21:35:41 2015(r281712)
+++ head/lib/libpmc/libpmc.cSat Apr 18 21:39:17 2015(r281713)
@@ -164,6 +164,7 @@ PMC_CLASSDEP_TABLE(octeon, OCTEON);
 PMC_CLASSDEP_TABLE(ucf, UCF);
 PMC_CLASSDEP_TABLE(ppc7450, PPC7450);
 PMC_CLASSDEP_TABLE(ppc970, PPC970);
+PMC_CLASSDEP_TABLE(e500, E500);
 
 static struct pmc_event_descr soft_event_table[PMC_EV_DYN_COUNT];
 
@@ -296,8 +297,9 @@ PMC_MDEP_TABLE(armv7, ARMV7, PMC_CLASS_S
 PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K);
 PMC_MDEP_TABLE(mips74k, MIPS74K, PMC_CLASS_SOFT, PMC_CLASS_MIPS74K);
 PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON);
-PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450);
-PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970);
+PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450, 
PMC_CLASS_TSC);
+PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970, 
PMC_CLASS_TSC);
+PMC_MDEP_TABLE(e500, E500, PMC_CLASS_SOFT, PMC_CLASS_E500, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(generic, SOFT, PMC_CLASS_SOFT);
 
 static const struct pmc_event_descr tsc_event_table[] =
@@ -368,6 +370,7 @@ PMC_CLASS_TABLE_DESC(octeon, OCTEON, oct
 #if defined(__powerpc__)
 PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, powerpc);
 PMC_CLASS_TABLE_DESC(ppc970, PPC970, ppc970, powerpc);
+PMC_CLASS_TABLE_DESC(e500, E500, e500, powerpc);
 #endif
 
 static struct pmc_class_descr soft_class_table_descr =
@@ -2494,6 +2497,12 @@ static struct pmc_event_alias ppc970_ali
EV_ALIAS(NULL, NULL)
 };
 
+static struct pmc_event_alias e500_aliases[] = {
+   EV_ALIAS(instructions, INSTR_COMPLETED),
+   EV_ALIAS(cycles,   CYCLES),
+   EV_ALIAS(NULL, NULL)
+};
+
 #definePOWERPC_KW_OS   os
 #definePOWERPC_KW_USR  usr
 #definePOWERPC_KW_ANYTHREADanythread
@@ -2949,6 +2958,10 @@ pmc_event_names_of_class(enum pmc_class 
ev = ppc970_event_table;
count = PMC_EVENT_TABLE_SIZE(ppc970);
break;
+   case PMC_CLASS_E500:
+   ev = e500_event_table;
+   count = PMC_EVENT_TABLE_SIZE(e500);
+   break;
case PMC_CLASS_SOFT:
ev = soft_event_table;
count = soft_event_info.pm_nevent;
@@ -3245,6 +3258,10 @@ pmc_init(void)
PMC_MDEP_INIT(ppc970);
pmc_class_table[n] = ppc970_class_table_descr;
break;
+   case PMC_CPU_PPC_E500:
+   PMC_MDEP_INIT(e500);
+   pmc_class_table[n] = e500_class_table_descr;
+   break;
 #endif
default:
/*
@@ -3444,6 +3461,9 @@ _pmc_name_of_event(enum pmc_event pe, en
} else if (pe = PMC_EV_PPC970_FIRST  pe = PMC_EV_PPC970_LAST) {
ev = ppc970_event_table;
evfence = ppc970_event_table + PMC_EVENT_TABLE_SIZE(ppc970);
+   } else if (pe = PMC_EV_E500_FIRST  pe = PMC_EV_E500_LAST) {
+   ev = e500_event_table;
+   evfence = e500_event_table + PMC_EVENT_TABLE_SIZE(e500);
} else if (pe == PMC_EV_TSC_TSC) {
ev = tsc_event_table;
evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc);

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sat Apr 18 21:35:41 2015(r281712)
+++ head/sys/conf/files.powerpc Sat Apr 18 21:39:17 2015(r281713)
@@ -31,8 +31,9 @@ dev/fb/fb.c   optionalsc
 dev/fdt/fdt_powerpc.c  optionalfdt
 # ofwbus depends on simplebus.
 dev/fdt/simplebus.coptionalaim | fdt
-dev/hwpmc/hwpmc_powerpc.c  optionalhwpmc
+dev/hwpmc/hwpmc_e500.c optionalhwpmc
 dev/hwpmc/hwpmc_mpc7xxx.c  optionalhwpmc
+dev/hwpmc/hwpmc_powerpc.c  optionalhwpmc
 

svn commit: r281715 - in head/sys: kern sys

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:50:53 2015
New Revision: 281715
URL: https://svnweb.freebsd.org/changeset/base/281715

Log:
  Regen.

Modified:
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Sat Apr 18 21:50:13 2015(r281714)
+++ head/sys/kern/init_sysent.c Sat Apr 18 21:50:53 2015(r281715)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 277610 2015-01-23 
21:07:08Z jilles 
+ * created from FreeBSD: head/sys/kern/syscalls.master 281714 2015-04-18 
21:50:13Z kib 
  */
 
 #include opt_compat.h
@@ -26,6 +26,12 @@
 #define compat4(n, name) 0, (sy_call_t *)nosys
 #endif
 
+#ifdef COMPAT_FREEBSD6
+#define compat6(n, name) n, (sy_call_t *)__CONCAT(freebsd6_,name)
+#else
+#define compat6(n, name) 0, (sy_call_t *)nosys
+#endif
+
 #ifdef COMPAT_FREEBSD7
 #define compat7(n, name) n, (sy_call_t *)__CONCAT(freebsd7_,name)
 #else
@@ -207,8 +213,8 @@ struct sysent sysent[] = {
{ AS(msgsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_ABSENT },/* 170 = msgsys */
{ AS(shmsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_ABSENT },/* 171 = shmsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 172 = nosys */
-   { AS(freebsd6_pread_args), (sy_call_t *)freebsd6_pread, AUE_PREAD, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6_pread */
-   { AS(freebsd6_pwrite_args), (sy_call_t *)freebsd6_pwrite, AUE_PWRITE, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },  /* 174 = freebsd6_pwrite */
+   { compat6(AS(freebsd6_pread_args),pread), AUE_PREAD, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 173 = freebsd6 pread */
+   { compat6(AS(freebsd6_pwrite_args),pwrite), AUE_PWRITE, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },/* 174 = freebsd6 pwrite */
{ AS(setfib_args), (sy_call_t *)sys_setfib, AUE_NULL, NULL, 0, 0, 0, 
SY_THR_STATIC },   /* 175 = setfib */
{ AS(ntp_adjtime_args), (sy_call_t *)sys_ntp_adjtime, AUE_NTP_ADJTIME, 
NULL, 0, 0, 0, SY_THR_STATIC },  /* 176 = ntp_adjtime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 177 = sfork */
@@ -231,11 +237,11 @@ struct sysent sysent[] = {
{ AS(__getrlimit_args), (sy_call_t *)sys_getrlimit, AUE_GETRLIMIT, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 194 = getrlimit */
{ AS(__setrlimit_args), (sy_call_t *)sys_setrlimit, AUE_SETRLIMIT, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 195 = setrlimit */
{ AS(getdirentries_args), (sy_call_t *)sys_getdirentries, 
AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },   /* 196 = 
getdirentries */
-   { AS(freebsd6_mmap_args), (sy_call_t *)freebsd6_mmap, AUE_MMAP, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 197 = freebsd6_mmap */
+   { compat6(AS(freebsd6_mmap_args),mmap), AUE_MMAP, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },  /* 197 = freebsd6 mmap */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },  
/* 198 = __syscall */
-   { AS(freebsd6_lseek_args), (sy_call_t *)freebsd6_lseek, AUE_LSEEK, 
NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6_lseek */
-   { AS(freebsd6_truncate_args), (sy_call_t *)freebsd6_truncate, 
AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6_truncate */
-   { AS(freebsd6_ftruncate_args), (sy_call_t *)freebsd6_ftruncate, 
AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 201 = 
freebsd6_ftruncate */
+   { compat6(AS(freebsd6_lseek_args),lseek), AUE_LSEEK, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 199 = freebsd6 lseek */
+   { compat6(AS(freebsd6_truncate_args),truncate), AUE_TRUNCATE, NULL, 0, 
0, 0, SY_THR_STATIC },   /* 200 = freebsd6 truncate */
+   { compat6(AS(freebsd6_ftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },   /* 201 = freebsd6 ftruncate */
{ AS(sysctl_args), (sy_call_t *)sys___sysctl, AUE_SYSCTL, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },  /* 202 = __sysctl */
{ AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 203 = mlock */
{ AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC }, /* 204 = munlock */

Modified: head/sys/kern/syscalls.c
==
--- head/sys/kern/syscalls.cSat Apr 18 21:50:13 2015(r281714)
+++ head/sys/kern/syscalls.cSat Apr 18 21:50:53 2015

svn commit: r281716 - head/share/man/man5

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:54:00 2015
New Revision: 281716
URL: https://svnweb.freebsd.org/changeset/base/281716

Log:
  Regen.

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Apr 18 21:50:53 2015
(r281715)
+++ head/share/man/man5/src.conf.5  Sat Apr 18 21:54:00 2015
(r281716)
@@ -1,7 +1,7 @@
 .\ DO NOT EDIT-- this file is automatically generated.
 .\ from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z 
des
 .\ $FreeBSD$
-.Dd April 3, 2015
+.Dd April 19, 2015
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1100,9 +1100,6 @@ and related programs.
 .It Va WITHOUT_SYMVER
 .\ from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 
05:03:24Z deischen
 Set to disable symbol versioning when building shared libraries.
-.It Va WITHOUT_SYSCALL_COMPAT
-.\ from FreeBSD: head/tools/build/options/WITHOUT_SYSCALL_COMPAT 265826 
2014-05-10 16:37:28Z imp
-Do not include some compatible syscall wrappers in libc.
 .It Va WITHOUT_SYSCONS
 .\ from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 
07:50:50Z ru
 Set to not build
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281700 - head/usr.sbin/bhyve

2015-04-18 Thread Alexander Motin
Author: mav
Date: Sat Apr 18 20:10:19 2015
New Revision: 281700
URL: https://svnweb.freebsd.org/changeset/base/281700

Log:
  Workaround bhyve virtual disks operation on top of GEOM providers.
  
  GEOM does not support scatter/gather lists in its I/Os.  Such requests
  are cut in pieces by physio(), that may be problematic, if those pieces
  are not multiple of provider's sector size.  If such case is detected,
  move the data through temporary sequential buffer.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/bhyve/block_if.c
  head/usr.sbin/bhyve/block_if.h
  head/usr.sbin/bhyve/pci_ahci.c
  head/usr.sbin/bhyve/pci_virtio_block.c

Modified: head/usr.sbin/bhyve/block_if.c
==
--- head/usr.sbin/bhyve/block_if.c  Sat Apr 18 19:52:39 2015
(r281699)
+++ head/usr.sbin/bhyve/block_if.c  Sat Apr 18 20:10:19 2015
(r281700)
@@ -85,6 +85,7 @@ struct blockif_ctxt {
int bc_magic;
int bc_fd;
int bc_ischr;
+   int bc_isgeom;
int bc_candelete;
int bc_rdonly;
off_t   bc_size;
@@ -198,27 +199,93 @@ blockif_complete(struct blockif_ctxt *bc
 }
 
 static void
-blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be)
+blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf)
 {
struct blockif_req *br;
off_t arg[2];
-   int err;
+   ssize_t clen, len, off, boff, voff;
+   int i, err;
 
br = be-be_req;
+   if (br-br_iovcnt = 1)
+   buf = NULL;
err = 0;
-
switch (be-be_op) {
case BOP_READ:
-   if (preadv(bc-bc_fd, br-br_iov, br-br_iovcnt,
-  br-br_offset)  0)
-   err = errno;
+   if (buf == NULL) {
+   if ((len = preadv(bc-bc_fd, br-br_iov, br-br_iovcnt,
+  br-br_offset))  0)
+   err = errno;
+   else
+   br-br_resid -= len;
+   break;
+   }
+   i = 0;
+   off = voff = 0;
+   while (br-br_resid  0) {
+   len = MIN(br-br_resid, MAXPHYS);
+   if (pread(bc-bc_fd, buf, len, br-br_offset +
+   off)  0) {
+   err = errno;
+   break;
+   }
+   boff = 0;
+   do {
+   clen = MIN(len - boff, br-br_iov[i].iov_len -
+   voff);
+   memcpy(br-br_iov[i].iov_base + voff,
+   buf + boff, clen);
+   if (clen  br-br_iov[i].iov_len - voff)
+   voff += clen;
+   else {
+   i++;
+   voff = 0;
+   }
+   boff += clen;
+   } while (boff  len);
+   off += len;
+   br-br_resid -= len;
+   }
break;
case BOP_WRITE:
-   if (bc-bc_rdonly)
+   if (bc-bc_rdonly) {
err = EROFS;
-   else if (pwritev(bc-bc_fd, br-br_iov, br-br_iovcnt,
-br-br_offset)  0)
-   err = errno;
+   break;
+   }
+   if (buf == NULL) {
+   if ((len = pwritev(bc-bc_fd, br-br_iov, br-br_iovcnt,
+   br-br_offset))  0)
+   err = errno;
+   else
+   br-br_resid -= len;
+   break;
+   }
+   i = 0;
+   off = voff = 0;
+   while (br-br_resid  0) {
+   len = MIN(br-br_resid, MAXPHYS);
+   boff = 0;
+   do {
+   clen = MIN(len - boff, br-br_iov[i].iov_len -
+   voff);
+   memcpy(buf + boff,
+   br-br_iov[i].iov_base + voff, clen);
+   if (clen  br-br_iov[i].iov_len - voff)
+   voff += clen;
+   else {
+   i++;
+   voff = 0;
+   }
+   boff += clen;
+   } while (boff  len);
+   

svn commit: r281705 - in head: cddl/contrib/opensolaris/cmd/dtrace share/man/man4 share/man/man9

2015-04-18 Thread Mark Johnston
Author: markj
Date: Sat Apr 18 21:00:36 2015
New Revision: 281705
URL: https://svnweb.freebsd.org/changeset/base/281705

Log:
  Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers.
  The format of these pages is somewhat experimental, so they may be subject
  to further tweaking.
  
  Differential Revision:https://reviews.freebsd.org/D2170
  Reviewed by:  bcr, rpaulo
  MFC after:2 weeks

Added:
  head/share/man/man4/dtrace-io.4   (contents, props changed)
  head/share/man/man4/dtrace-ip.4   (contents, props changed)
  head/share/man/man4/dtrace-proc.4   (contents, props changed)
  head/share/man/man4/dtrace-sched.4   (contents, props changed)
  head/share/man/man4/dtrace-tcp.4   (contents, props changed)
  head/share/man/man4/dtrace-udp.4   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
  head/share/man/man4/Makefile
  head/share/man/man9/SDT.9

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Sat Apr 18 20:55:55 
2015(r281704)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1   Sat Apr 18 21:00:36 
2015(r281705)
@@ -21,7 +21,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 5, 2013
+.Dd April 18, 2015
 .Dt DTRACE 1
 .Os
 .Sh NAME
@@ -670,7 +670,8 @@ Invalid command line options or argument
 .Sh SEE ALSO
 .Xr cpp 1 ,
 .Xr dtruss 1 ,
-.Xr elf 5
+.Xr elf 5 ,
+.Xr SDT 9
 .Rs
 .%T Solaris Dynamic Tracing Guide
 .Re

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Apr 18 20:55:55 2015
(r281704)
+++ head/share/man/man4/MakefileSat Apr 18 21:00:36 2015
(r281705)
@@ -121,6 +121,12 @@ MAN=   aac.4 \
dpt.4 \
ds1307.4 \
ds3231.4 \
+   ${_dtrace_io.4} \
+   ${_dtrace_ip.4} \
+   ${_dtrace_proc.4} \
+   ${_dtrace_sched.4} \
+   ${_dtrace_tcp.4} \
+   ${_dtrace_udp.4} \
dummynet.4 \
ed.4 \
edsc.4 \
@@ -812,6 +818,15 @@ SUBDIR=man4.${MACHINE_CPUARCH}
 _ccd.4=ccd.4
 .endif
 
+.if ${MK_CDDL} != no
+_dtrace_io.4=  dtrace-io.4
+_dtrace_ip.4=  dtrace-ip.4
+_dtrace_proc.4=dtrace-proc.4
+_dtrace_sched.4= dtrace-sched.4
+_dtrace_tcp.4= dtrace-tcp.4
+_dtrace_udp.4= dtrace-udp.4
+.endif
+
 .if ${MK_ISCSI} != no
 MAN+=  iscsi.4
 MAN+=  iscsi_initiator.4

Added: head/share/man/man4/dtrace-io.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/dtrace-io.4 Sat Apr 18 21:00:36 2015
(r281705)
@@ -0,0 +1,123 @@
+.\ Copyright (c) 2015 Mark Johnston ma...@freebsd.org
+.\ 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.
+.\
+.\ $FreeBSD$
+.\
+.Dd April 18, 2015
+.Dt DTRACE-IO 4
+.Os
+.Sh NAME
+.Nm dtrace-io
+.Nd a DTrace provider for tracing events related to disk I/O
+.Sh SYNOPSIS
+.Fn io:::start struct bio * struct devstat *
+.Fn io:::done struct bio * struct devstat *
+.Sh DESCRIPTION
+The
+.Nm io
+provider allows the tracing of disk I/O events.
+The
+.Fn io:::start
+probe fires when a I/O request is about to be sent to the backing driver of a
+.Xr disk 9
+object.
+This occurs after all
+.Xr GEOM 4
+transformations have been performed on the request.
+The
+.Fn io:::done
+probe fires when a I/O request is completed.
+Both probes take a
+.Vt struct bio *
+representing the I/O request as their first argument.
+The second argument is a
+.Vt struct devstat *
+for the 

svn commit: r281714 - in head: lib/libc lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/include lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/sparc64/sys lib...

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:50:13 2015
New Revision: 281714
URL: https://svnweb.freebsd.org/changeset/base/281714

Log:
  The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and
  pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x
  kernels which required padding before the off_t parameter.  The
  fcntl(2) contains compatibility code to handle kernels before the
  struct flock was changed during the 8.x CURRENT development.  The
  shims were reasonable to allow easier revert to the older kernel at
  that time.
  
  Now, two or three major releases later, shims do not serve any
  purpose.  Such old kernels cannot handle current libc, so revert the
  compatibility code.
  
  Make padded syscalls support conditional under the COMPAT6 config
  option.  For COMPAT32, the syscalls were under COMPAT6 already.
  
  Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to
  (partially) disable the removed shims.
  
  Reviewed by:  jhb, imp (previous versions)
  Discussed with:   peter
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Deleted:
  head/lib/libc/sys/ftruncate.c
  head/lib/libc/sys/lseek.c
  head/lib/libc/sys/mmap.c
  head/lib/libc/sys/pread.c
  head/lib/libc/sys/pwrite.c
  head/lib/libc/sys/truncate.c
  head/tools/build/options/WITHOUT_SYSCALL_COMPAT
Modified:
  head/lib/libc/Makefile
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/arm/sys/Makefile.inc
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/include/compat.h
  head/lib/libc/include/libc_private.h
  head/lib/libc/mips/sys/Makefile.inc
  head/lib/libc/powerpc/sys/Makefile.inc
  head/lib/libc/powerpc64/sys/Makefile.inc
  head/lib/libc/sparc64/sys/Makefile.inc
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/fcntl.c
  head/lib/libc/sys/interposing_table.c
  head/lib/libthr/Makefile
  head/lib/libthr/thread/thr_syscalls.c
  head/share/mk/src.opts.mk
  head/sys/kern/sys_generic.c
  head/sys/kern/syscalls.master
  head/sys/kern/vfs_syscalls.c
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Sat Apr 18 21:39:17 2015(r281713)
+++ head/lib/libc/Makefile  Sat Apr 18 21:50:13 2015(r281714)
@@ -157,10 +157,6 @@ libkern.${LIBC_ARCH}:: ${KMSRCS}
${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
 .endif
 
-.if ${MK_SYSCALL_COMPAT} != no
-CFLAGS+=-DSYSCALL_COMPAT
-.endif
-
 .include bsd.arch.inc.mk
 
 .include bsd.lib.mk

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incSat Apr 18 21:39:17 2015
(r281713)
+++ head/lib/libc/amd64/sys/Makefile.incSat Apr 18 21:50:13 2015
(r281714)
@@ -11,6 +11,3 @@ MDASM=vfork.S brk.S cerror.S exect.S ge
 NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
 
 PSEUDO=_getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != no
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif

Modified: head/lib/libc/arm/sys/Makefile.inc
==
--- head/lib/libc/arm/sys/Makefile.inc  Sat Apr 18 21:39:17 2015
(r281713)
+++ head/lib/libc/arm/sys/Makefile.inc  Sat Apr 18 21:50:13 2015
(r281714)
@@ -8,6 +8,3 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S pt
 NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
 
 PSEUDO= _exit.o _getlogin.o
-.if ${MK_SYSCALL_COMPAT} != no
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif

Modified: head/lib/libc/i386/sys/Makefile.inc
==
--- head/lib/libc/i386/sys/Makefile.inc Sat Apr 18 21:39:17 2015
(r281713)
+++ head/lib/libc/i386/sys/Makefile.inc Sat Apr 18 21:50:13 2015
(r281714)
@@ -15,9 +15,6 @@ MDASM=Ovfork.S brk.S cerror.S exect.S g
 NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
 
 PSEUDO=_getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != no
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
 
 MAN+=  i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2
 MAN+=  i386_set_watch.3

Modified: head/lib/libc/include/compat.h
==
--- head/lib/libc/include/compat.h  Sat Apr 18 21:39:17 2015
(r281713)
+++ head/lib/libc/include/compat.h  Sat Apr 18 21:50:13 2015
(r281714)
@@ -47,9 +47,7 @@ __sym_compat(shmctl, freebsd7_shmctl, FB
 #define__weak_reference(sym,alias) \
.weak   alias;.equ  alias,sym
 
-#ifndef SYSCALL_COMPAT
 __weak_reference(__sys_fcntl,__fcntl_compat)
-#endif
 
 #undef __weak_reference
 

Modified: head/lib/libc/include/libc_private.h

Re: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen

2015-04-18 Thread Oliver Pinter
On Sat, Apr 18, 2015 at 11:23 PM, Konstantin Belousov k...@freebsd.org wrote:
 Author: kib
 Date: Sat Apr 18 21:23:16 2015
 New Revision: 281707
 URL: https://svnweb.freebsd.org/changeset/base/281707

 Log:
   Remove lazy pmap switch code from i386.  Naive benchmark with md(4)
   shows no difference with the code removed.

   On both amd64 and i386, assert that a released pmap is not active.

   Proposed and reviewed by: alc
   Discussed with:   Svatopluk Kraus onw...@gmail.com, peter
   Sponsored by: The FreeBSD Foundation
   MFC after:2 weeks

 Modified:
   head/sys/amd64/amd64/pmap.c
   head/sys/i386/i386/apic_vector.s
   head/sys/i386/i386/db_trace.c
   head/sys/i386/i386/mp_machdep.c
   head/sys/i386/i386/pmap.c
   head/sys/i386/i386/swtch.s
   head/sys/i386/include/smp.h
   head/sys/i386/xen/mp_machdep.c
   head/sys/i386/xen/pmap.c
   head/sys/x86/include/acpica_machdep.h
   head/sys/x86/xen/xen_apic.c

 Modified: head/sys/amd64/amd64/pmap.c
 ==
 --- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015(r281706)
 +++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015(r281707)
 @@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap)
 pmap-pm_stats.resident_count));
 KASSERT(vm_radix_is_empty(pmap-pm_root),
 (pmap_release: pmap has reserved page table page(s)));
 +   KASSERT(CPU_EMPTY(pmap-pm_active),
 +   (releasing active pmap %p, pmap));

 if (pmap_pcid_enabled) {
 /*

 Modified: head/sys/i386/i386/apic_vector.s
 ==
 --- head/sys/i386/i386/apic_vector.sSat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/apic_vector.sSat Apr 18 21:23:16 2015
 (r281707)
 @@ -320,19 +320,4 @@ IDTVEC(rendezvous)
 POP_FRAME
 iret

 -/*
 - * Clean up when we lose out on the lazy context switch optimization.
 - * ie: when we are about to release a PTD but a cpu is still borrowing it.
 - */
 -   SUPERALIGN_TEXT
 -IDTVEC(lazypmap)
 -   PUSH_FRAME
 -   SET_KERNEL_SREGS
 -   cld
 -
 -   callpmap_lazyfix_action
 -
 -   callas_lapic_eoi
 -   POP_FRAME
 -   iret
  #endif /* SMP */

 Modified: head/sys/i386/i386/db_trace.c
 ==
 --- head/sys/i386/i386/db_trace.c   Sat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/db_trace.c   Sat Apr 18 21:23:16 2015
 (r281707)
 @@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_
 frame_type = TRAP_TIMERINT;
 else if (strcmp(name, Xcpustop) == 0 ||
 strcmp(name, Xrendezvous) == 0 ||
 -   strcmp(name, Xipi_intr_bitmap_handler) == 0 ||
 -   strcmp(name, Xlazypmap) == 0)
 +   strcmp(name, Xipi_intr_bitmap_handler) == 0)
 frame_type = TRAP_INTERRUPT;
 }


 Modified: head/sys/i386/i386/mp_machdep.c
 ==
 --- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015
 (r281707)
 @@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU];
  u_long *ipi_invlpg_counts[MAXCPU];
  u_long *ipi_invlcache_counts[MAXCPU];
  u_long *ipi_rendezvous_counts[MAXCPU];
 -u_long *ipi_lazypmap_counts[MAXCPU];
  static u_long *ipi_hardclock_counts[MAXCPU];
  #endif

 @@ -576,10 +575,6 @@ cpu_mp_start(void)
 setidt(IPI_INVLCACHE, IDTVEC(invlcache),
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));

 -   /* Install an inter-CPU IPI for lazy pmap release */
 -   setidt(IPI_LAZYPMAP, IDTVEC(lazypmap),
 -  SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 -
 /* Install an inter-CPU IPI for all-CPU rendezvous */
 setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous),
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 @@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy)
 intrcnt_add(buf, ipi_ast_counts[i]);
 snprintf(buf, sizeof(buf), cpu%d:rendezvous, i);
 intrcnt_add(buf, ipi_rendezvous_counts[i]);
 -   snprintf(buf, sizeof(buf), cpu%d:lazypmap, i);
 -   intrcnt_add(buf, ipi_lazypmap_counts[i]);
 snprintf(buf, sizeof(buf), cpu%d:hardclock, i);
 intrcnt_add(buf, ipi_hardclock_counts[i]);
 }

 Modified: head/sys/i386/i386/pmap.c
 ==
 --- head/sys/i386/i386/pmap.c   Sat Apr 18 21:22:26 2015(r281706)
 +++ head/sys/i386/i386/pmap.c   Sat Apr 18 21:23:16 2015(r281707)
 @@ -1248,18 +1248,14 @@ pmap_invalidate_cache_pages(vm_page_t 

svn commit: r281712 - in head: lib/libc/gen lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3

2015-04-18 Thread Konstantin Belousov
Author: kib
Date: Sat Apr 18 21:35:41 2015
New Revision: 281712
URL: https://svnweb.freebsd.org/changeset/base/281712

Log:
  Make wait6(2), waitid(3) and ppoll(2) cancellation points.  The
  waitid() function is required to be cancellable by the standard.  The
  wait6() and ppoll() follow the other syscalls in their groups.
  
  Reviewed by:  jhb, jilles (previous versions)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Added:
  head/lib/libc/sys/ppoll.c   (contents, props changed)
  head/lib/libc/sys/wait6.c   (contents, props changed)
Modified:
  head/lib/libc/gen/waitid.c
  head/lib/libc/include/libc_private.h
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/interposing_table.c
  head/lib/libthr/thread/thr_syscalls.c
  head/share/man/man3/pthread_testcancel.3

Modified: head/lib/libc/gen/waitid.c
==
--- head/lib/libc/gen/waitid.c  Sat Apr 18 21:31:36 2015(r281711)
+++ head/lib/libc/gen/waitid.c  Sat Apr 18 21:35:41 2015(r281712)
@@ -37,6 +37,7 @@ __FBSDID($FreeBSD$);
 #include signal.h
 #include errno.h
 #include un-namespace.h
+#include libc_private.h
 
 int
 __waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
@@ -44,7 +45,9 @@ __waitid(idtype_t idtype, id_t id, sigin
int status;
pid_t ret;
 
-   ret = _wait6(idtype, id, status, flags, NULL, info);
+   ret = ((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *,
+   siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id,
+   status, flags, NULL, info);
 
/*
 * According to SUSv4, waitid() shall not return a PID when a

Modified: head/lib/libc/include/libc_private.h
==
--- head/lib/libc/include/libc_private.hSat Apr 18 21:31:36 2015
(r281711)
+++ head/lib/libc/include/libc_private.hSat Apr 18 21:35:41 2015
(r281712)
@@ -222,6 +222,8 @@ enum {
INTERPOS_spinlock,
INTERPOS_spinunlock,
INTERPOS_kevent,
+   INTERPOS_wait6,
+   INTERPOS_ppoll,
INTERPOS_MAX
 };
 
@@ -305,6 +307,8 @@ struct timeval;
 struct timezone;
 struct __siginfo;
 struct __ucontext;
+struct __wrusage;
+enum idtype;
 int__sys_aio_suspend(const struct aiocb * const[], int,
const struct timespec *);
 int__sys_accept(int, struct sockaddr *, __socklen_t *);
@@ -329,6 +333,8 @@ int __sys_pselect(int, struct fd_set *,
struct fd_set *, const struct timespec *,
const __sigset_t *);
 int__sys_poll(struct pollfd *, unsigned, int);
+int__sys_ppoll(struct pollfd *, unsigned, const struct timespec *,
+   const __sigset_t *);
 __ssize_t  __sys_pread(int, void *, __size_t, __off_t);
 __ssize_t  __sys_pwrite(int, const void *, __size_t, __off_t);
 __ssize_t  __sys_read(int, void *, __size_t);
@@ -357,6 +363,8 @@ int __sys_thr_kill(long, int);
 int__sys_thr_self(long *);
 int__sys_truncate(const char *, __off_t);
 __pid_t__sys_wait4(__pid_t, int *, int, struct rusage *);
+__pid_t__sys_wait6(enum idtype, __id_t, int *, int,
+   struct __wrusage *, struct __siginfo *);
 __ssize_t  __sys_write(int, const void *, __size_t);
 __ssize_t  __sys_writev(int, const struct iovec *, int);
 

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Sat Apr 18 21:31:36 2015
(r281711)
+++ head/lib/libc/sys/Makefile.inc  Sat Apr 18 21:35:41 2015
(r281712)
@@ -57,6 +57,7 @@ INTERPOSED = \
open \
openat \
poll \
+   ppoll \
pselect \
read \
readv \
@@ -73,6 +74,7 @@ INTERPOSED = \
sigwaitinfo \
swapcontext \
wait4 \
+   wait6 \
write \
writev
 

Modified: head/lib/libc/sys/interposing_table.c
==
--- head/lib/libc/sys/interposing_table.c   Sat Apr 18 21:31:36 2015
(r281711)
+++ head/lib/libc/sys/interposing_table.c   Sat Apr 18 21:35:41 2015
(r281712)
@@ -76,6 +76,8 @@ interpos_func_t __libc_interposing[INTER
SLOT(spinlock, __libc_spinlock_stub),
SLOT(spinunlock, __libc_spinunlock_stub),
SLOT(kevent, __sys_kevent),
+   SLOT(wait6, __sys_wait6),
+   SLOT(ppoll, __sys_ppoll),
 };
 #undef SLOT
 

Added: head/lib/libc/sys/ppoll.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/sys/ppoll.c   Sat Apr 18 21:35:41 2015(r281712)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015 The FreeBSD Foundation.
+ * All 

Re: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen

2015-04-18 Thread Oliver Pinter
On Sun, Apr 19, 2015 at 12:39 AM, Oliver Pinter
oliver.pin...@hardenedbsd.org wrote:
 On Sat, Apr 18, 2015 at 11:23 PM, Konstantin Belousov k...@freebsd.org 
 wrote:
 Author: kib
 Date: Sat Apr 18 21:23:16 2015
 New Revision: 281707
 URL: https://svnweb.freebsd.org/changeset/base/281707

 Log:
   Remove lazy pmap switch code from i386.  Naive benchmark with md(4)
   shows no difference with the code removed.

   On both amd64 and i386, assert that a released pmap is not active.

   Proposed and reviewed by: alc
   Discussed with:   Svatopluk Kraus onw...@gmail.com, peter
   Sponsored by: The FreeBSD Foundation
   MFC after:2 weeks

 Modified:
   head/sys/amd64/amd64/pmap.c
   head/sys/i386/i386/apic_vector.s
   head/sys/i386/i386/db_trace.c
   head/sys/i386/i386/mp_machdep.c
   head/sys/i386/i386/pmap.c
   head/sys/i386/i386/swtch.s
   head/sys/i386/include/smp.h
   head/sys/i386/xen/mp_machdep.c
   head/sys/i386/xen/pmap.c
   head/sys/x86/include/acpica_machdep.h
   head/sys/x86/xen/xen_apic.c

 Modified: head/sys/amd64/amd64/pmap.c
 ==
 --- head/sys/amd64/amd64/pmap.c Sat Apr 18 21:22:26 2015(r281706)
 +++ head/sys/amd64/amd64/pmap.c Sat Apr 18 21:23:16 2015(r281707)
 @@ -2532,6 +2532,8 @@ pmap_release(pmap_t pmap)
 pmap-pm_stats.resident_count));
 KASSERT(vm_radix_is_empty(pmap-pm_root),
 (pmap_release: pmap has reserved page table page(s)));
 +   KASSERT(CPU_EMPTY(pmap-pm_active),
 +   (releasing active pmap %p, pmap));

 if (pmap_pcid_enabled) {
 /*

 Modified: head/sys/i386/i386/apic_vector.s
 ==
 --- head/sys/i386/i386/apic_vector.sSat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/apic_vector.sSat Apr 18 21:23:16 2015
 (r281707)
 @@ -320,19 +320,4 @@ IDTVEC(rendezvous)
 POP_FRAME
 iret

 -/*
 - * Clean up when we lose out on the lazy context switch optimization.
 - * ie: when we are about to release a PTD but a cpu is still borrowing it.
 - */
 -   SUPERALIGN_TEXT
 -IDTVEC(lazypmap)
 -   PUSH_FRAME
 -   SET_KERNEL_SREGS
 -   cld
 -
 -   callpmap_lazyfix_action
 -
 -   callas_lapic_eoi
 -   POP_FRAME
 -   iret
  #endif /* SMP */

 Modified: head/sys/i386/i386/db_trace.c
 ==
 --- head/sys/i386/i386/db_trace.c   Sat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/db_trace.c   Sat Apr 18 21:23:16 2015
 (r281707)
 @@ -316,8 +316,7 @@ db_nextframe(struct i386_frame **fp, db_
 frame_type = TRAP_TIMERINT;
 else if (strcmp(name, Xcpustop) == 0 ||
 strcmp(name, Xrendezvous) == 0 ||
 -   strcmp(name, Xipi_intr_bitmap_handler) == 0 ||
 -   strcmp(name, Xlazypmap) == 0)
 +   strcmp(name, Xipi_intr_bitmap_handler) == 0)
 frame_type = TRAP_INTERRUPT;
 }


 Modified: head/sys/i386/i386/mp_machdep.c
 ==
 --- head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:22:26 2015
 (r281706)
 +++ head/sys/i386/i386/mp_machdep.c Sat Apr 18 21:23:16 2015
 (r281707)
 @@ -163,7 +163,6 @@ u_long *ipi_invlrng_counts[MAXCPU];
  u_long *ipi_invlpg_counts[MAXCPU];
  u_long *ipi_invlcache_counts[MAXCPU];
  u_long *ipi_rendezvous_counts[MAXCPU];
 -u_long *ipi_lazypmap_counts[MAXCPU];
  static u_long *ipi_hardclock_counts[MAXCPU];
  #endif

 @@ -576,10 +575,6 @@ cpu_mp_start(void)
 setidt(IPI_INVLCACHE, IDTVEC(invlcache),
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));

 -   /* Install an inter-CPU IPI for lazy pmap release */
 -   setidt(IPI_LAZYPMAP, IDTVEC(lazypmap),
 -  SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 -
 /* Install an inter-CPU IPI for all-CPU rendezvous */
 setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous),
SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 @@ -1672,8 +1667,6 @@ mp_ipi_intrcnt(void *dummy)
 intrcnt_add(buf, ipi_ast_counts[i]);
 snprintf(buf, sizeof(buf), cpu%d:rendezvous, i);
 intrcnt_add(buf, ipi_rendezvous_counts[i]);
 -   snprintf(buf, sizeof(buf), cpu%d:lazypmap, i);
 -   intrcnt_add(buf, ipi_lazypmap_counts[i]);
 snprintf(buf, sizeof(buf), cpu%d:hardclock, i);
 intrcnt_add(buf, ipi_hardclock_counts[i]);
 }

 Modified: head/sys/i386/i386/pmap.c
 ==
 --- head/sys/i386/i386/pmap.c   Sat Apr 18 21:22:26 2015(r281706)
 +++ head/sys/i386/i386/pmap.c   Sat Apr 18 

svn commit: r281718 - in head/bin/sh: . tests/builtins

2015-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Sat Apr 18 23:49:57 2015
New Revision: 281718
URL: https://svnweb.freebsd.org/changeset/base/281718

Log:
  sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap 
n n...'.
  
  The parser considered 'trap exit INT' to reset the default for both EXIT and
  INT. This beahvior is not POSIX compliant. This was avoided if a value was
  specified for 'exit', but then disallows exiting with the signal received. A
  possible workaround is using ' exit'.
  
  However POSIX does allow this type of behavior if the parameters are all
  integers. Fix the handling for this and clarify its support in the manpage
  since it is specifically allowed by POSIX.
  
  Differential Revision:https://reviews.freebsd.org/D2325
  Reviewed by:  jilles
  MFC after:2 weeks

Added:
  head/bin/sh/tests/builtins/trap15.0   (contents, props changed)
  head/bin/sh/tests/builtins/trap16.0   (contents, props changed)
Modified:
  head/bin/sh/sh.1
  head/bin/sh/tests/builtins/Makefile
  head/bin/sh/trap.c

Modified: head/bin/sh/sh.1
==
--- head/bin/sh/sh.1Sat Apr 18 23:08:52 2015(r281717)
+++ head/bin/sh/sh.1Sat Apr 18 23:49:57 2015(r281718)
@@ -32,7 +32,7 @@
 .\from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\ $FreeBSD$
 .\
-.Dd February 22, 2015
+.Dd April 18, 2015
 .Dt SH 1
 .Os
 .Sh NAME
@@ -2574,8 +2574,7 @@ the former causes the specified signal t
 and the latter causes the default action to be taken.
 Omitting the
 .Ar action
-is another way to request the default action, for compatibility reasons this
-usage is not recommended though.
+and using only signal numbers is another way to request the default action.
 In a subshell or utility environment,
 the shell resets trapped (but not ignored) signals to the default action.
 The

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Sat Apr 18 23:08:52 2015
(r281717)
+++ head/bin/sh/tests/builtins/Makefile Sat Apr 18 23:49:57 2015
(r281718)
@@ -137,6 +137,8 @@ FILES+= trap11.0
 FILES+=trap12.0
 FILES+=trap13.0
 FILES+=trap14.0
+FILES+=trap15.0
+FILES+=trap16.0
 FILES+=trap2.0
 FILES+=trap3.0
 FILES+=trap4.0

Added: head/bin/sh/tests/builtins/trap15.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/trap15.0 Sat Apr 18 23:49:57 2015
(r281718)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+(${SH} -c 'term(){ exit 5;}; trap term TERM; kill -TERM $$') 
+wait /dev/null 21 $!
+[ $? -eq 5 ]

Added: head/bin/sh/tests/builtins/trap16.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/trap16.0 Sat Apr 18 23:49:57 2015
(r281718)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+traps=$(${SH} -c 'trap echo bad 0; trap - 0; trap')
+[ -z $traps ] || exit 1
+traps=$(${SH} -c 'trap echo bad 0; trap  0; trap')
+expected_traps=$(${SH} -c 'trap  EXIT; trap')
+[ $traps = $expected_traps ] || exit 2
+traps=$(${SH} -c 'trap echo bad 0; trap 0; trap')
+[ -z $traps ] || exit 3
+traps=$(${SH} -c 'trap echo bad 0; trap -- 0; trap')
+[ -z $traps ] || exit 4
+traps=$(${SH} -c 'trap echo bad 0 1 2; trap - 0 1 2; trap')
+[ -z $traps ] || exit 5
+traps=$(${SH} -c 'trap echo bad 0 1 2; trap  0 1 2; trap')
+expected_traps=$(${SH} -c 'trap  EXIT HUP INT; trap')
+[ $traps = $expected_traps ] || exit 6
+traps=$(${SH} -c 'trap echo bad 0 1 2; trap 0 1 2; trap')
+[ -z $traps ] || exit 7
+traps=$(${SH} -c 'trap echo bad 0 1 2; trap -- 0 1 2; trap')
+[ -z $traps ] || exit 8

Modified: head/bin/sh/trap.c
==
--- head/bin/sh/trap.c  Sat Apr 18 23:08:52 2015(r281717)
+++ head/bin/sh/trap.c  Sat Apr 18 23:49:57 2015(r281718)
@@ -183,7 +183,7 @@ trapcmd(int argc __unused, char **argv)
return 0;
}
action = NULL;
-   if (*argv  sigstring_to_signum(*argv) == -1) {
+   if (*argv  !is_number(*argv)) {
if (strcmp(*argv, -) == 0)
argv++;
else {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r281719 - head/bin/ed

2015-04-18 Thread Pedro Giffuni


Oh yes ...
On 04/18/15 18:56, Eitan Adler wrote:

Author: eadler
Date: Sat Apr 18 23:56:04 2015
New Revision: 281719
URL: https://svnweb.freebsd.org/changeset/base/281719

Log:
   bin/ed: use correct type in multiplication
The result is line_t** so the multiplication should be size *
sizeof(line_t*)
   
   MFC After:	1 month


Modified:
   head/bin/ed/glbl.c

Modified: head/bin/ed/glbl.c
==
--- head/bin/ed/glbl.c  Sat Apr 18 23:49:57 2015(r281718)
+++ head/bin/ed/glbl.c  Sat Apr 18 23:56:04 2015(r281719)
@@ -153,7 +153,7 @@ set_active_node(line_t *lp)
if (active_list != NULL) {
  #endif
if ((ts = (line_t **) realloc(active_list,
-   (ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
+   (ti += MINBUFSZ) * sizeof(line_t *))) == NULL) {
fprintf(stderr, %s\n, strerror(errno));
errmsg = out of memory;
SPL0();



Found by:clang static checker

http://scan.freebsd.org/scan-build/bin/2015-04-18-amd64/report-9ba1bb.html#EndPath

;)

Thanks,

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


Re: svn commit: r281707 - in head/sys: amd64/amd64 i386/i386 i386/include i386/xen x86/include x86/xen

2015-04-18 Thread Steve Kargl
On Sun, Apr 19, 2015 at 12:39:47AM +0200, Oliver Pinter wrote:
 On Sat, Apr 18, 2015 at 11:23 PM, Konstantin Belousov k...@freebsd.org 
 wrote:
 
   void   acpi_SetDefaultIntrModel(int model);
   void   acpi_cpu_c1(void);
 
 
  +void   acpi_cpu_idle_mwait(uint32_t mwait_hint);
 
 This change is related of this commit or this belongs to other modificatons?
 

Please trim your replies.

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


svn commit: r281719 - head/bin/ed

2015-04-18 Thread Eitan Adler
Author: eadler
Date: Sat Apr 18 23:56:04 2015
New Revision: 281719
URL: https://svnweb.freebsd.org/changeset/base/281719

Log:
  bin/ed: use correct type in multiplication
The result is line_t** so the multiplication should be size *
sizeof(line_t*)
  
  MFC After:1 month

Modified:
  head/bin/ed/glbl.c

Modified: head/bin/ed/glbl.c
==
--- head/bin/ed/glbl.c  Sat Apr 18 23:49:57 2015(r281718)
+++ head/bin/ed/glbl.c  Sat Apr 18 23:56:04 2015(r281719)
@@ -153,7 +153,7 @@ set_active_node(line_t *lp)
if (active_list != NULL) {
 #endif
if ((ts = (line_t **) realloc(active_list,
-   (ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
+   (ti += MINBUFSZ) * sizeof(line_t *))) == NULL) {
fprintf(stderr, %s\n, strerror(errno));
errmsg = out of memory;
SPL0();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281720 - head/sys/vm

2015-04-18 Thread Alan Cox
Author: alc
Date: Sun Apr 19 00:29:02 2015
New Revision: 281720
URL: https://svnweb.freebsd.org/changeset/base/281720

Log:
  Eliminate an unused variable.
  
  MFC after:1 week

Modified:
  head/sys/vm/device_pager.c

Modified: head/sys/vm/device_pager.c
==
--- head/sys/vm/device_pager.c  Sat Apr 18 23:56:04 2015(r281719)
+++ head/sys/vm/device_pager.c  Sun Apr 19 00:29:02 2015(r281720)
@@ -294,7 +294,6 @@ static int
 old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot,
 vm_page_t *mres)
 {
-   vm_pindex_t pidx;
vm_paddr_t paddr;
vm_page_t m_paddr, page;
struct cdev *dev;
@@ -304,7 +303,6 @@ old_dev_pager_fault(vm_object_t object, 
vm_memattr_t memattr;
int ref, ret;
 
-   pidx = OFF_TO_IDX(offset);
memattr = object-memattr;
 
VM_OBJECT_WUNLOCK(object);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281721 - head/sys/sys

2015-04-18 Thread Justin Hibbits
Author: jhibbits
Date: Sun Apr 19 00:33:21 2015
New Revision: 281721
URL: https://svnweb.freebsd.org/changeset/base/281721

Log:
  Fix the build.  Commit the last part of e500 PMC.
  
  Pointy hat to:jhibbits

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==
--- head/sys/sys/pmc.h  Sun Apr 19 00:29:02 2015(r281720)
+++ head/sys/sys/pmc.h  Sun Apr 19 00:33:21 2015(r281721)
@@ -102,6 +102,8 @@
__PMC_CPU(MIPS_OCTEON,  0x201,  Cavium Octeon)\
__PMC_CPU(MIPS_74K, 0x202,  MIPS 74K) \
__PMC_CPU(PPC_7450, 0x300,  PowerPC MPC7450)  \
+   __PMC_CPU(PPC_E500, 0x340,  PowerPC e500 Core)\
+   __PMC_CPU(PPC_MPC85XX,  0x340,  Freescale PowerPC MPC85XX)\
__PMC_CPU(PPC_970,  0x380,  IBM PowerPC 970)  \
__PMC_CPU(GENERIC,  0x400,  Generic)
 
@@ -136,6 +138,7 @@ enum pmc_cputype {
__PMC_CLASS(MIPS74K)/* MIPS 74K */  \
__PMC_CLASS(PPC7450)/* Motorola MPC7450 class */\
__PMC_CLASS(PPC970) /* IBM PowerPC 970 class */ \
+   __PMC_CLASS(E500)   /* Freescale e500 class */  \
__PMC_CLASS(SOFT)   /* Software events */
 
 enum pmc_class {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281723 - head/usr.bin/calendar

2015-04-18 Thread Eitan Adler
Author: eadler
Date: Sun Apr 19 04:27:50 2015
New Revision: 281723
URL: https://svnweb.freebsd.org/changeset/base/281723

Log:
  calendar: remove useless check
lineline checked for 0 in the while loop condition.  There is no need to
check for it additionally in the body.
  
  CID:  1288959
  MFC After:1 week

Modified:
  head/usr.bin/calendar/io.c

Modified: head/usr.bin/calendar/io.c
==
--- head/usr.bin/calendar/io.c  Sun Apr 19 01:23:12 2015(r281722)
+++ head/usr.bin/calendar/io.c  Sun Apr 19 04:27:50 2015(r281723)
@@ -257,9 +257,6 @@ cal_parse(FILE *in, FILE *out)
return (1);
 
while ((linelen = getline(line, linecap, in))  0) {
-   if (linelen == 0)
-   continue;
-
if (*line == '#') {
switch (token(line+1, out, skip)) {
case T_ERR:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281724 - head/usr.bin/rpcgen

2015-04-18 Thread Eitan Adler
Author: eadler
Date: Sun Apr 19 04:53:28 2015
New Revision: 281724
URL: https://svnweb.freebsd.org/changeset/base/281724

Log:
  rpcgen: fix use use of strcmp
strcmp only guarantee that it will return at least 1 if the string B
is greater than that of string A.

Modified:
  head/usr.bin/rpcgen/rpc_sample.c

Modified: head/usr.bin/rpcgen/rpc_sample.c
==
--- head/usr.bin/rpcgen/rpc_sample.cSun Apr 19 04:27:50 2015
(r281723)
+++ head/usr.bin/rpcgen/rpc_sample.cSun Apr 19 04:53:28 2015
(r281724)
@@ -115,7 +115,7 @@ write_sample_client(const char *program_
for (l = proc-args.decls; l != NULL; l = l-next) {
f_print(fout, \t);
ptype(l-decl.prefix, l-decl.type, 1);
-   if (strcmp(l-decl.type,string) == 1)
+   if (strcmp(l-decl.type,string) = 1)
f_print(fout,  );
pvname(proc-proc_name, vp-vers_num);
f_print(fout, _%s;\n, l-decl.name);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281686 - head/sys/dev/etherswitch

2015-04-18 Thread Rui Paulo
Author: rpaulo
Date: Sat Apr 18 07:34:39 2015
New Revision: 281686
URL: https://svnweb.freebsd.org/changeset/base/281686

Log:
  Fix French typos in etherswitch.

Modified:
  head/sys/dev/etherswitch/miiproxy.c

Modified: head/sys/dev/etherswitch/miiproxy.c
==
--- head/sys/dev/etherswitch/miiproxy.c Sat Apr 18 06:53:13 2015
(r281685)
+++ head/sys/dev/etherswitch/miiproxy.c Sat Apr 18 07:34:39 2015
(r281686)
@@ -62,35 +62,35 @@ struct mdioproxy_softc {
 };
 
 /*
- * The rendevous data structures and functions allow two device endpoints to
+ * The rendezvous data structures and functions allow two device endpoints to
  * match up, so that the proxy endpoint can be associated with a target
  * endpoint.  The proxy has to know the device name of the target that it
- * wants to associate with, for example through a hint.  The rendevous code
+ * wants to associate with, for example through a hint.  The rendezvous code
  * makes no assumptions about the devices that want to meet.
  */
-struct rendevous_entry;
+struct rendezvous_entry;
 
-enum rendevous_op {
-   RENDEVOUS_ATTACH,
-   RENDEVOUS_DETACH
+enum rendezvous_op {
+   RENDEZVOUS_ATTACH,
+   RENDEZVOUS_DETACH
 };
 
-typedef int (*rendevous_callback_t)(enum rendevous_op,
-struct rendevous_entry *);
+typedef int (*rendezvous_callback_t)(enum rendezvous_op,
+struct rendezvous_entry *);
 
-static SLIST_HEAD(rendevoushead, rendevous_entry) rendevoushead =
-SLIST_HEAD_INITIALIZER(rendevoushead);
+static SLIST_HEAD(rendezvoushead, rendezvous_entry) rendezvoushead =
+SLIST_HEAD_INITIALIZER(rendezvoushead);
 
-struct rendevous_endpoint {
+struct rendezvous_endpoint {
device_tdevice;
const char  *name;
-   rendevous_callback_tcallback;
+   rendezvous_callback_t   callback;
 };
 
-struct rendevous_entry {
-   SLIST_ENTRY(rendevous_entry)entries;
-   struct rendevous_endpoint   proxy;
-   struct rendevous_endpoint   target;
+struct rendezvous_entry {
+   SLIST_ENTRY(rendezvous_entry)   entries;
+   struct rendezvous_endpoint  proxy;
+   struct rendezvous_endpoint  target;
 };
 
 /*
@@ -98,15 +98,15 @@ struct rendevous_entry {
  * returns an error, undo the attachment.
  */
 static int
-rendevous_attach(struct rendevous_entry *e, struct rendevous_endpoint *ep)
+rendezvous_attach(struct rendezvous_entry *e, struct rendezvous_endpoint *ep)
 {
int error;
 
-   error = e-proxy.callback(RENDEVOUS_ATTACH, e);
+   error = e-proxy.callback(RENDEZVOUS_ATTACH, e);
if (error == 0) {
-   error = e-target.callback(RENDEVOUS_ATTACH, e);
+   error = e-target.callback(RENDEZVOUS_ATTACH, e);
if (error != 0) {
-   e-proxy.callback(RENDEVOUS_DETACH, e);
+   e-proxy.callback(RENDEZVOUS_DETACH, e);
ep-device = NULL;
ep-callback = NULL;
}
@@ -115,27 +115,27 @@ rendevous_attach(struct rendevous_entry 
 }
 
 /*
- * Create an entry for the proxy in the rendevous list.  The name parameter
+ * Create an entry for the proxy in the rendezvous list.  The name parameter
  * indicates the name of the device that is the target endpoint for this
- * rendevous.  The callback will be invoked as soon as the target is
+ * rendezvous.  The callback will be invoked as soon as the target is
  * registered: either immediately if the target registered itself earlier,
  * or once the target registers.  Returns ENXIO if the target has not yet
  * registered.
  */
 static int
-rendevous_register_proxy(device_t dev, const char *name,
-rendevous_callback_t callback)
+rendezvous_register_proxy(device_t dev, const char *name,
+rendezvous_callback_t callback)
 {
-   struct rendevous_entry *e;
+   struct rendezvous_entry *e;
 
KASSERT(callback != NULL, (callback must be set));
-   SLIST_FOREACH(e, rendevoushead, entries) {
+   SLIST_FOREACH(e, rendezvoushead, entries) {
if (strcmp(name, e-target.name) == 0) {
/* the target is already attached */
e-proxy.name = device_get_nameunit(dev);
e-proxy.device = dev;
e-proxy.callback = callback;
-   return (rendevous_attach(e, e-proxy));
+   return (rendezvous_attach(e, e-proxy));
}
}
e = malloc(sizeof(*e), M_MIIPROXY, M_WAITOK | M_ZERO);
@@ -143,34 +143,34 @@ rendevous_register_proxy(device_t dev, c
e-proxy.device = dev;
e-proxy.callback = callback;
e-target.name = name;
-   SLIST_INSERT_HEAD(rendevoushead, e, entries);
+   SLIST_INSERT_HEAD(rendezvoushead, e, entries);
return (ENXIO);
 }
 
 /*
- * Create an entry in the rendevous list for the 

svn commit: r281683 - head/sys/netgraph/bluetooth/include

2015-04-18 Thread Takanori Watanabe
Author: takawata
Date: Sat Apr 18 06:16:33 2015
New Revision: 281683
URL: https://svnweb.freebsd.org/changeset/base/281683

Log:
  Forgot to add  default event mask definition.

Modified:
  head/sys/netgraph/bluetooth/include/ng_hci.h

Modified: head/sys/netgraph/bluetooth/include/ng_hci.h
==
--- head/sys/netgraph/bluetooth/include/ng_hci.hSat Apr 18 05:05:38 
2015(r281682)
+++ head/sys/netgraph/bluetooth/include/ng_hci.hSat Apr 18 06:16:33 
2015(r281683)
@@ -897,6 +897,8 @@ typedef struct {
 } __attribute__ ((packed)) ng_hci_set_event_mask_cp;
 
 typedef ng_hci_status_rp   ng_hci_set_event_mask_rp;
+#define NG_HCI_EVENT_MASK_DEFAULT 0x1fff
+#define NG_HCI_EVENT_MASK_LE  0x2000
 
 #define NG_HCI_OCF_RESET   0x0003
 /* No command parameter(s) */
@@ -1454,6 +1456,7 @@ typedef struct {

 } __attribute__ ((packed)) ng_hci_le_set_event_mask_cp;
 typedef ng_hci_status_rp   ng_hci_le_set_event_mask_rp;
+#define NG_HCI_LE_EVENT_MASK_ALL 0x1f
 
 #define NG_HCI_OCF_LE_READ_BUFFER_SIZE 0x0002
 /*No command parameter */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281684 - head/usr.sbin/bluetooth/hccontrol

2015-04-18 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Sat Apr 18 06:48:03 2015
New Revision: 281684
URL: https://svnweb.freebsd.org/changeset/base/281684

Log:
  Improve code style(9), no functional changes.
  
  Differential Revision:D2320
  Reviewed by:  takawata

Modified:
  head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
==
--- head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.cSat Apr 
18 06:16:33 2015(r281683)
+++ head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.cSat Apr 
18 06:48:03 2015(r281684)
@@ -1491,7 +1491,7 @@ hci_write_page_scan_mode(int s, int argc
 static int
 hci_read_le_host_supported_command(int s, int argc, char **argv) 
 {
-   ng_hci_read_le_host_supported_rprp;
+   ng_hci_read_le_host_supported_rp rp;
int n;
n = sizeof(rp);
if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND,
@@ -1514,10 +1514,10 @@ hci_read_le_host_supported_command(int s
 static int
 hci_write_le_host_supported_command(int s, int argc, char **argv) 
 {
-   ng_hci_write_le_host_supported_cp   cp;
-   ng_hci_write_le_host_supported_rp   rp;
+   ng_hci_write_le_host_supported_cp cp;
+   ng_hci_write_le_host_supported_rp rp;
 
-   int n;
+   int n;
 
cp.le_supported_host = 0;
cp.simultaneous_le_host = 0;

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 06:16:33 2015
(r281683)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 06:48:03 2015
(r281684)
@@ -46,6 +46,7 @@
 #define L2CAP_SOCKET_CHECKED
 #include bluetooth.h
 #include hccontrol.h
+
 static int le_set_scan_param(int s, int argc, char *argv[]);
 static int le_set_scan_enable(int s, int argc, char *argv[]);
 static int parse_param(int argc, char *argv[], char *buf, int *len);
@@ -56,51 +57,47 @@ static int set_le_event_mask(int s, uint
 static int set_event_mask(int s, uint64_t mask);
 static int le_enable(int s, int argc, char *argv[]);
 
-static int le_set_scan_param(int s, int argc, char *argv[])
+static int
+le_set_scan_param(int s, int argc, char *argv[])
 {
int type;
int interval;
int window;
int adrtype;
-   int  policy;
+   int policy;
+   int e, n;
 
ng_hci_le_set_scan_parameters_cp cp;
ng_hci_le_set_scan_parameters_rp rp;
-   int e,n;
 
-   if(argc != 5){
+   if (argc != 5)
return USAGE;
-   }

-   if(strcmp(argv[0], active)==0){
+   if (strcmp(argv[0], active) == 0)
type = 1;
-   }else if (strcmp(argv[0], passive) == 0){
+   else if (strcmp(argv[0], passive) == 0)
type = 0;
-   }else{
+   else
return USAGE;
-   }
 
interval = (int)(atof(argv[1])/0.625);
interval = (interval  4)? 4: interval;
window = (int)(atof(argv[2])/0.625);
window = (window  4) ? 4 : interval;

-   if(strcmp(argv[3], public)==0){
+   if (strcmp(argv[3], public) == 0)
adrtype = 0;
-   }else if (strcmp(argv[0], random) == 0){
+   else if (strcmp(argv[0], random) == 0)
adrtype = 1;
-   }else{
+   else
return USAGE;
-   }
 
-   if(strcmp(argv[4], all)==0){
+   if (strcmp(argv[4], all) == 0)
policy = 0;
-   }else if (strcmp(argv[4], whitelist) == 0){
+   else if (strcmp(argv[4], whitelist) == 0)
policy = 1;
-   }else{
+   else
return USAGE;
-   }
-   
 
cp.le_scan_type = type;
cp.le_scan_interval = interval;
@@ -109,43 +106,42 @@ static int le_set_scan_param(int s, int 
cp.scanning_filter_policy = policy;
n = sizeof(rp);
e = hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE,
-NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), 
-   (void *)cp, sizeof(cp), (void *)rp, n);
-   
+   NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), 
+   (void *)cp, sizeof(cp), (void *)rp, n);
 
return 0;
-   
 }
 
-
-static int le_set_scan_enable(int s, int argc, char *argv[])
+static int
+le_set_scan_enable(int s, int argc, char *argv[])
 {
ng_hci_le_set_scan_enable_cp cp;
ng_hci_le_set_scan_enable_rp rp;
-   int e,n,enable = 0;
+   int e, n, enable = 0;
 
-   if(argc != 1)
+   if (argc != 1)
return USAGE;
  
-   if(strcmp(argv[0], enable) == 0){
+   if (strcmp(argv[0], enable) == 0)
enable = 1;
-   }else 

svn commit: r281685 - head/usr.sbin/bluetooth/hccontrol

2015-04-18 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Sat Apr 18 06:53:13 2015
New Revision: 281685
URL: https://svnweb.freebsd.org/changeset/base/281685

Log:
  Fix misspelling.

Modified:
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 06:48:03 2015
(r281684)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 06:53:13 2015
(r281685)
@@ -232,7 +232,7 @@ le_read_local_supported_features(int s, 
NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), 
(void *)rp, n);
 
-   printf(LOCAL SUPPOREDED: %d %d %lu\n, e, rp.status,
+   printf(LOCAL SUPPORTED: %d %d %lu\n, e, rp.status,
rp.le_features);
 
return 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r281688 - head/usr.sbin/bluetooth/hccontrol

2015-04-18 Thread Takanori Watanabe
Author: takawata
Date: Sat Apr 18 09:08:47 2015
New Revision: 281688
URL: https://svnweb.freebsd.org/changeset/base/281688

Log:
  Fix Typo.

Modified:
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 08:01:12 2015
(r281687)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Sat Apr 18 09:08:47 2015
(r281688)
@@ -247,7 +247,7 @@ le_read_supported_status(int s, int argc
 
e = hci_simple_request(s, NG_HCI_OPCODE(
NG_HCI_OGF_LE,
-   NG_HCI_OCF_LE_READ_SUPPORTED),
+   NG_HCI_OCF_LE_READ_SUPPORTED_STATUS),
(void *)rp, n);
 
printf(LE_STATUS: %d %d %lx\n, e, rp.status, rp.le_status);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-04-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Sat Apr 18 09:49:09 2015
New Revision: 281689
URL: https://svnweb.freebsd.org/changeset/base/281689

Log:
  Remove unused code from linux_mount(), and make it possible to mount
  any kind of filesystem instead of harcoded three.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Sat Apr 18 09:08:47 2015
(r281688)
+++ head/sys/compat/linux/linux_file.c  Sat Apr 18 09:49:09 2015
(r281689)
@@ -55,10 +55,6 @@ __FBSDID($FreeBSD$);
 
 #include security/mac/mac_framework.h
 
-#include ufs/ufs/extattr.h
-#include ufs/ufs/quota.h
-#include ufs/ufs/ufsmount.h
-
 #ifdef COMPAT_LINUX32
 #include machine/../linux32/linux.h
 #include machine/../linux32/linux32_proto.h
@@ -1078,12 +1074,10 @@ linux_pwrite(td, uap)
 int
 linux_mount(struct thread *td, struct linux_mount_args *args)
 {
-   struct ufs_args ufs;
char fstypename[MFSNAMELEN];
char mntonname[MNAMELEN], mntfromname[MNAMELEN];
int error;
int fsflags;
-   void *fsdata;
 
error = copyinstr(args-filesystemtype, fstypename, MFSNAMELEN - 1,
NULL);
@@ -1104,20 +1098,10 @@ linux_mount(struct thread *td, struct li
 
if (strcmp(fstypename, ext2) == 0) {
strcpy(fstypename, ext2fs);
-   fsdata = ufs;
-   ufs.fspec = mntfromname;
-#define DEFAULT_ROOTID -2
-   ufs.export.ex_root = DEFAULT_ROOTID;
-   ufs.export.ex_flags =
-   args-rwflag  LINUX_MS_RDONLY ? MNT_EXRDONLY : 0;
} else if (strcmp(fstypename, proc) == 0) {
strcpy(fstypename, linprocfs);
-   fsdata = NULL;
} else if (strcmp(fstypename, vfat) == 0) {
strcpy(fstypename, msdosfs);
-   fsdata = NULL;
-   } else {
-   return (ENODEV);
}
 
fsflags = 0;
@@ -1137,19 +1121,11 @@ linux_mount(struct thread *td, struct li
fsflags |= MNT_UPDATE;
}
 
-   if (strcmp(fstypename, linprocfs) == 0) {
-   error = kernel_vmount(fsflags,
-   fstype, fstypename,
-   fspath, mntonname,
-   NULL);
-   } else if (strcmp(fstypename, msdosfs) == 0) {
-   error = kernel_vmount(fsflags,
-   fstype, fstypename,
-   fspath, mntonname,
-   from, mntfromname,
-   NULL);
-   } else
-   error = EOPNOTSUPP;
+   error = kernel_vmount(fsflags,
+   fstype, fstypename,
+   fspath, mntonname,
+   from, mntfromname,
+   NULL);
return (error);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org