Re: svn commit: r254476 - head/sys/dev/hwpmc

2013-08-17 Thread hiren panchasara
On Sat, Aug 17, 2013 at 11:08 PM, Adrian Chadd  wrote:

> Author: adrian
> Date: Sun Aug 18 06:08:52 2013
> New Revision: 254476
> URL: http://svnweb.freebsd.org/changeset/base/254476
>
> Log:
>   Add in missing events for Sandy Bridge Xeon.
>
>   * Add in MEM_LOAD_UOPS_LLC_HIT_RETIRED for both sandy bridge and sandy
> bridge Xeon.  Right now it only is enabled for Sandy Bridge.
>   * D2/0F is actually a combination rather than a separate counter, so
> just flip that on for the CPU types that support it.
>
>   There's an errata for using this on SB Xeon hardware - I've documented
>   it in kern/181346.
>
>   Tested:
>
>   * Sandy Bridge
>   * Sandy Bridge Xeon
>
>   Sponsored by: Netflix, Inc.
>
> Modified:
>   head/sys/dev/hwpmc/hwpmc_core.c
>   head/sys/dev/hwpmc/pmc_events.h
>

Please add new counters to sandybridge xeon manpage - man 3
pmc.sandybridgexeon

Cheers,
Hiren
___
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: r254476 - head/sys/dev/hwpmc

2013-08-17 Thread Adrian Chadd
Author: adrian
Date: Sun Aug 18 06:08:52 2013
New Revision: 254476
URL: http://svnweb.freebsd.org/changeset/base/254476

Log:
  Add in missing events for Sandy Bridge Xeon.
  
  * Add in MEM_LOAD_UOPS_LLC_HIT_RETIRED for both sandy bridge and sandy
bridge Xeon.  Right now it only is enabled for Sandy Bridge.
  * D2/0F is actually a combination rather than a separate counter, so
just flip that on for the CPU types that support it.
  
  There's an errata for using this on SB Xeon hardware - I've documented
  it in kern/181346.
  
  Tested:
  
  * Sandy Bridge
  * Sandy Bridge Xeon
  
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/pmc_events.h

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Sun Aug 18 04:22:13 2013
(r254475)
+++ head/sys/dev/hwpmc/hwpmc_core.c Sun Aug 18 06:08:52 2013
(r254476)
@@ -1541,15 +1541,21 @@ static struct iap_event_descr iap_events
IAP_F_SBX | IAP_F_IBX | IAP_F_HW),
 
 IAPDESCR(D2H_01H, 0xD2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
-   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW),
+   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
+   IAP_F_IBX | IAP_F_HW),
 IAPDESCR(D2H_02H, 0xD2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
-   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW),
+   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
+   IAP_F_IBX | IAP_F_HW),
 IAPDESCR(D2H_04H, 0xD2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
-   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW),
+   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
+   IAP_F_IBX | IAP_F_HW),
 IAPDESCR(D2H_08H, 0xD2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
-   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW),
+   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
+   IAP_F_IBX | IAP_F_HW),
 IAPDESCR(D2H_0FH, 0xD2, 0x0F, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
-   IAP_F_I7 | IAP_F_WM),
+   IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
+   IAP_F_IBX | IAP_F_HW),
+
 IAPDESCR(D2H_10H, 0xD2, 0x10, IAP_F_FM | IAP_F_CC2E),
 
 IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX |

Modified: head/sys/dev/hwpmc/pmc_events.h
==
--- head/sys/dev/hwpmc/pmc_events.h Sun Aug 18 04:22:13 2013
(r254475)
+++ head/sys/dev/hwpmc/pmc_events.h Sun Aug 18 06:08:52 2013
(r254476)
@@ -2656,6 +2656,8 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE
 IAP_EVENT_D2H_04H) \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE",  \
 IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL",\
+IAP_EVENT_D2H_0FH) \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM",\
 IAP_EVENT_D3H_01H) \
 __PMC_EV_ALIAS("BACLEARS.ANY", IAP_EVENT_E6H_1FH)  \
@@ -2859,6 +2861,8 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE
 IAP_EVENT_D2H_04H) \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE",  \
 IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL",\
+IAP_EVENT_D2H_0FH) \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM",\
 IAP_EVENT_D3H_01H) \
 __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H)   \
@@ -3524,6 +3528,18 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H)  \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_MISS", IAP_EVENT_D1H_20H) \
 __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.HIT_LFB", IAP_EVENT_D1H_40H)  \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS",  \
+IAP_EVENT_D2H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT",   \
+IAP_EVENT_D2H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM",  \
+IAP_EVENT_D2H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE",  \
+IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL",\
+IAP_EVENT_D2H_0FH) 

Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

2013-08-17 Thread Dimitry Andric
On Aug 13, 2013, at 09:15, Peter Wemm  wrote:
> Author: peter
> Date: Tue Aug 13 07:15:01 2013
> New Revision: 254273
> URL: http://svnweb.freebsd.org/changeset/base/254273
> 
> Log:
>  The iconv in libc did two things - implement the standard APIs, the GNU
>  extensions and also tried to be link time compatible with ports libiconv.
>  This splits that functionality and enables the parts that shouldn't
>  interfere with the port by default.
> 
>  WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
>  WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker
>  symbols and even a stub libiconv.so.3 that are good enough to be able
>  to 'pkg delete -f libiconv' on a running system and reasonably expect it
>  to work.
> 
>  I have tortured many machines over the last few days to try and reduce
>  the possibilities of foot-shooting as much as I can.  I've successfully
>  recompiled to enable and disable the libiconv_compat modes, ports that use
>  libiconv alongside system iconv etc.  If you don't enable the
>  WITH_LIBICONV_COMPAT switch, they don't share symbol space.
> 
>  This is an extension of behavior on other system.  iconv(3) is a standard
>  libc interface and libiconv port expects to be able to run alongside it on
>  systems that have it.

Unfortunately I expect this will break many ports, when the libiconv
port is installed.  A simple example is the following:

  #include 

  int main(void)
  {
iconv_t ic = iconv_open("UTF-8", "ISO-8859-1");
iconv_close(ic);
return 0;
  }

If you compile this on a system after r254273 with -I/usr/local/include,
and the libiconv port installed, it will result in:

  $ cc -I/usr/local/include iconv-test.c -o iconv-test
  /tmp/iconv-test-I1ltw1.o: In function `main':
  iconv-test.c:(.text+0x21): undefined reference to `libiconv_open'
  iconv-test.c:(.text+0x2f): undefined reference to `libiconv_close'
  cc: error: linker command failed with exit code 1 (use -v to see invocation)

This is because libiconv's iconv.h does:

  #define iconv_open libiconv_open
  ...
  #define iconv_close libiconv_close

and so on for most of its functions.

-Dimitry

___
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: r254470 - head/usr.sbin/rtsold

2013-08-17 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 17 22:13:26 2013
New Revision: 254470
URL: http://svnweb.freebsd.org/changeset/base/254470

Log:
  Use sysctl(ICMPV6CTL_ND6_DRLIST) instead of SIOCGDRLST_IN6 ioctl.

Modified:
  head/usr.sbin/rtsold/probe.c

Modified: head/usr.sbin/rtsold/probe.c
==
--- head/usr.sbin/rtsold/probe.cSat Aug 17 22:06:30 2013
(r254469)
+++ head/usr.sbin/rtsold/probe.cSat Aug 17 22:13:26 2013
(r254470)
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -102,41 +103,51 @@ probe_init(void)
 void
 defrouter_probe(struct ifinfo *ifinfo)
 {
-   u_char ntopbuf[INET6_ADDRSTRLEN];
-   struct in6_drlist dr;
-   int s, i;
-   int ifindex = ifinfo->sdl->sdl_index;
+   struct in6_defrouter *p, *ep;
+   int ifindex, mib[4];
+   char *buf, ntopbuf[INET6_ADDRSTRLEN];
+   size_t l;
 
-   if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-   warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno));
+   ifindex = ifinfo->sdl->sdl_index;
+   if (ifindex == 0)
+   return;
+   mib[0] = CTL_NET;
+   mib[1] = PF_INET6;
+   mib[2] = IPPROTO_ICMPV6;
+   mib[3] = ICMPV6CTL_ND6_DRLIST;
+   if (sysctl(mib, nitems(mib), NULL, &l, NULL, 0) < 0) {
+   warnmsg(LOG_ERR, __func__, "sysctl(ICMPV6CTL_ND6_DRLIST): %s",
+   strerror(errno));
return;
}
-   memset(&dr, 0, sizeof(dr));
-   strlcpy(dr.ifname, "lo0", sizeof dr.ifname); /* dummy interface */
-   if (ioctl(s, SIOCGDRLST_IN6, (caddr_t)&dr) < 0) {
-   warnmsg(LOG_ERR, __func__, "ioctl(SIOCGDRLST_IN6): %s",
+   if (l == 0)
+   return;
+   buf = malloc(l);
+   if (buf == NULL) {
+   warnmsg(LOG_ERR, __func__, "malloc(): %s", strerror(errno));
+   return;
+   }
+   if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) {
+   warnmsg(LOG_ERR, __func__, "sysctl(ICMPV6CTL_ND6_DRLIST): %s",
strerror(errno));
-   goto closeandend;
+   free(buf);
+   return;
}
-
-   for (i = 0; i < DRLSTSIZ && dr.defrouter[i].if_index; i++) {
-   if (ifindex && dr.defrouter[i].if_index == ifindex) {
-   /* sanity check */
-   if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) {
-   warnmsg(LOG_ERR, __func__,
-   "default router list contains a "
-   "non-link-local address(%s)",
-   inet_ntop(AF_INET6,
-   &dr.defrouter[i].rtaddr,
-   ntopbuf, INET6_ADDRSTRLEN));
-   continue; /* ignore the address */
-   }
-   sendprobe(&dr.defrouter[i].rtaddr, ifinfo);
+   ep = (struct in6_defrouter *)(void *)(buf + l);
+   for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) {
+   if (ifindex != p->if_index)
+   continue;
+   if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) {
+   warnmsg(LOG_ERR, __func__,
+   "default router list contains a "
+   "non-link-local address(%s)",
+   inet_ntop(AF_INET6, &p->rtaddr.sin6_addr, ntopbuf,
+   INET6_ADDRSTRLEN));
+   continue; /* ignore the address */
}
+   sendprobe(&p->rtaddr.sin6_addr, ifinfo);
}
-
-closeandend:
-   close(s);
+   free(buf);
 }
 
 static void
___
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: r254469 - head/share/man/man9

2013-08-17 Thread Mark Johnston
Author: markj
Date: Sat Aug 17 22:06:30 2013
New Revision: 254469
URL: http://svnweb.freebsd.org/changeset/base/254469

Log:
  Update the SDT(9) man page with the macros added in 254468. Also change the
  existing examples to not pass an mbuf as a probe argument. There's no
  obvious reason to have it there, and it doesn't really jibe with the example
  added in this revision.
  
  MFC after:1 week

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

Modified: head/share/man/man9/SDT.9
==
--- head/share/man/man9/SDT.9   Sat Aug 17 22:02:26 2013(r254468)
+++ head/share/man/man9/SDT.9   Sat Aug 17 22:06:30 2013(r254469)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 3, 2013
+.Dd August 17, 2013
 .Dt SDT 9
 .Os
 .Sh NAME
@@ -45,6 +45,19 @@
 .Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5
 .Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5   
\
 arg6
+.Fn SDT_PROBE_DEFINE0_XLATE prov mod func name sname
+.Fn SDT_PROBE_DEFINE1_XLATE prov mod func name sname arg0 xarg0
+.Fn SDT_PROBE_DEFINE2_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1
+.Fn SDT_PROBE_DEFINE3_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \
+arg2 xarg2
+.Fn SDT_PROBE_DEFINE4_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \
+arg2 xarg2 arg3 xarg3
+.Fn SDT_PROBE_DEFINE5_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \
+arg2 xarg2 arg3 xarg3 arg4 xarg4
+.Fn SDT_PROBE_DEFINE6_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \
+arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5
+.Fn SDT_PROBE_DEFINE7_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \
+arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5 arg6 xarg6
 .Fn SDT_PROBE0 prov mod func name
 .Fn SDT_PROBE1 prov mod func name arg0
 .Fn SDT_PROBE2 prov mod func name arg0 arg1
@@ -150,6 +163,30 @@ It is strongly recommended that probe de
 argument types.
 .Pp
 The
+.Fn SDT_PROBE_DEFINE*_XLATE
+macros are used for probes whose argument types are to be dynamically 
translated
+to the types specified by the corresponding
+.Ar xarg
+arguments.
+This is mainly useful when porting probe definitions from other operating
+systems.
+As seen by
+.Xr dtrace 1 ,
+the arguments of a probe defined using these macros will have types which match
+the
+.Ar xarg
+types in the probe definition.
+However, the arguments passed in at the trace point will have types matching 
the
+native argument types in the probe definition, and thus the native type is
+dynamically translated to the translated type.
+So long as an appropriate translator is defined in
+.Pa /usr/lib/dtrace ,
+scripts making use of the probe need not concern themselves with the underlying
+type of a given
+.Nm
+probe argument.
+.Pp
+The
 .Fn SDT_PROBE*
 macros are used to create
 .Nm
@@ -164,21 +201,20 @@ of type Destination Unreachable:
 .Bd -literal -offset indent
 SDT_PROVIDER_DECLARE(icmp);
 
-SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive,
-"struct mbuf *", "struct icmp *");
+SDT_PROBE_DEFINE1(icmp, , unreach, pkt_receive, pkt-receive,
+"struct icmp *");
 
 .Ed
-This particular probe would take two arguments: a pointer to the
-.Xr mbuf 9
-containing the incoming packet, and a pointer to the ICMP header for the 
packet.
+This particular probe would take a single argument: a pointer to the struct
+containing the ICMP header for the packet.
 Note that the module name of this probe is not specified.
 .Pp
 Consider a DTrace probe which fires when the network stack receives an IP
 packet.
 Such a probe would be defined by multiple tracepoints:
 .Bd -literal -offset indent
-SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *",
-"struct ifnet *", "struct ip *", "struct ip6_hdr *");
+SDT_PROBE_DEFINE3(ip, , , receive, receive, "struct ifnet *",
+"struct ip *", "struct ip6_hdr *");
 
 int
 ip_input(struct mbuf *m)
@@ -186,7 +222,7 @@ ip_input(struct mbuf *m)
struct ip *ip;
...
ip = mtod(m, struct ip *);
-   SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL);
+   SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, ip, NULL);
...
 }
 
@@ -196,13 +232,46 @@ ip6_input(struct mbuf *m)
struct ip6_hdr *ip6;
...
ip6 = mtod(m, struct ip6_hdr *);
-   SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6);
+   SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, NULL, ip6);
...
 }
 
 .Ed
 In particular, the probe should fire when the kernel receives either an IPv4
 packet or an IPv6 packet.
+.Pp
+Consider the ICMP probe discussed above.
+We note that its second argument is of type
+.Ar struct icmp ,
+which is a type defined in the FreeBSD kernel to represent the ICMP header of
+an ICMP packet, defined in RFC 792.
+Linux has a corresponding type,
+.Ar struct icmphdr ,
+for the same purpose, but its field names differ from FreeBSD's
+.Ar struct icmp .
+Similarly, illumos

svn commit: r254468 - in head/sys: cddl/dev/sdt sys

2013-08-17 Thread Mark Johnston
Author: markj
Date: Sat Aug 17 22:02:26 2013
New Revision: 254468
URL: http://svnweb.freebsd.org/changeset/base/254468

Log:
  Add a "translated type" argument to SDT_PROBE_ARGTYPE() and add some macros
  which allow one to define SDT probes that specify translated types. The idea
  is to make it easy to write SDT probe definitions that can work across
  multiple operating systems. In particular, this makes it possible to port
  illumos SDT probes to FreeBSD without changing their argument types, so long
  as the appropriate translators are defined. Then DTrace scripts written for
  Solaris/illumos will work on FreeBSD without any changes.
  
  MFC after:1 week

Modified:
  head/sys/cddl/dev/sdt/sdt.c
  head/sys/sys/sdt.h

Modified: head/sys/cddl/dev/sdt/sdt.c
==
--- head/sys/cddl/dev/sdt/sdt.c Sat Aug 17 21:53:37 2013(r254467)
+++ head/sys/cddl/dev/sdt/sdt.c Sat Aug 17 22:02:26 2013(r254468)
@@ -201,11 +201,15 @@ sdt_getargdesc(void *arg, dtrace_id_t id
if (desc->dtargd_ndx < probe->n_args) {
TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) {
if (desc->dtargd_ndx == argtype->ndx) {
-   /* XXX */
desc->dtargd_mapping = desc->dtargd_ndx;
strlcpy(desc->dtargd_native, argtype->type,
sizeof(desc->dtargd_native));
-   desc->dtargd_xlate[0] = '\0'; /* XXX */
+   if (argtype->xtype != NULL)
+   strlcpy(desc->dtargd_xlate,
+   argtype->xtype,
+   sizeof(desc->dtargd_xlate));
+   else
+   desc->dtargd_xlate[0] = '\0';
}
}
} else

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Sat Aug 17 21:53:37 2013(r254467)
+++ head/sys/sys/sdt.h  Sat Aug 17 22:02:26 2013(r254468)
@@ -87,7 +87,7 @@
 #define SDT_PROBE_DEFINE(prov, mod, func, name, sname)
 #define SDT_PROBE_DECLARE(prov, mod, func, name)
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
-#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type)
+#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)
 
 #defineSDT_PROBE_DEFINE0(prov, mod, func, name, sname)
 #defineSDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)
@@ -110,6 +110,22 @@
 #defineSDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, 
arg5,  \
 arg6)
 
+#defineSDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname)
+#defineSDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, 
xarg0)
+#defineSDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, 
xarg0, \
+arg1, xarg1)
+#defineSDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, 
xarg0, \
+arg1, xarg1, arg2, xarg2)
+#define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, 
\
+arg1, xarg1, arg2, xarg2, arg3, xarg3)
+#defineSDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, 
xarg0, \
+arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4)
+#defineSDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, 
xarg0, \
+arg1,  xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5)
+#defineSDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, 
xarg0, \
+arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, 
\
+xarg6)
+
 #else
 
 SET_DECLARE(sdt_providers_set, struct sdt_provider);
@@ -143,9 +159,9 @@ SET_DECLARE(sdt_argtypes_set, struct sdt
(uintptr_t) arg3, (uintptr_t) arg4);
\
 } while (0)
 
-#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type)
\
+#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) 
\
static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1]  
\
-   = { { num, type, { NULL, NULL },
\
+   = { { num, type, xtype, { NULL, NULL }, 
\
sdt_##prov##_##mod##_##func##_##name }  
\
};  
\
DATA_SET(sdt_argtypes_set, sdt_##prov##_##mod##_##func##_##name##num);
@@ -155,54 +171,113 @@ SET_DECLARE(sdt_argtypes_set, struct sdt
 
 #defineSDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)   
\
SDT_PROBE_DEFINE(prov, mod, func, name, sname); \
-   SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, 

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

2013-08-17 Thread Mark Johnston
Author: markj
Date: Sat Aug 17 21:53:37 2013
New Revision: 254467
URL: http://svnweb.freebsd.org/changeset/base/254467

Log:
  Remove a couple of unused macros.
  
  MFC after:3 days

Modified:
  head/sys/compat/linux/linux_dtrace.h

Modified: head/sys/compat/linux/linux_dtrace.h
==
--- head/sys/compat/linux/linux_dtrace.hSat Aug 17 19:49:08 2013
(r254466)
+++ head/sys/compat/linux/linux_dtrace.hSat Aug 17 21:53:37 2013
(r254467)
@@ -72,11 +72,6 @@
 #defineLIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h)   
_LIN_SDT_PROBE_DEFINE5(\
 LINUX_DTRACE, a, b, c, d, e, f, g, h)
 
-#define_LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e, f)
SDT_PROBE_ARGTYPE(a, b,\
-c, d, e, f)
-#define LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e)   _LIN_SDT_PROBE_ARGTYPE( \
-LINUX_DTRACE, a, b, c, d, e)
-
 #defineLIN_SDT_PROBE0(a, b, c) 
SDT_PROBE1(LINUX_DTRACE, a, b, \
 c, 0)
 #defineLIN_SDT_PROBE1(a, b, c, d)  
SDT_PROBE1(LINUX_DTRACE, a, b, \
___
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: r254466 - in head/sys/amd64: amd64 include

2013-08-17 Thread Neel Natu
Author: neel
Date: Sat Aug 17 19:49:08 2013
New Revision: 254466
URL: http://svnweb.freebsd.org/changeset/base/254466

Log:
  Bump up the maximum addressable memory on amd64 systems from 1TB to 4TB.
  Bump up the KVA size proportionally from 512GB to 2TB.
  
  The number of page table pages used by the direct map is now calculated at
  run time based on 'Maxmem'. This means the small memory systems will not
  see any additional tax in terms of page table pages for the direct map.
  
  However all amd64 systems, regardless of the memory size, will use 3 more
  pages to accomodate the bump in the KVA size.
  
  More details available here:
  http://lists.freebsd.org/pipermail/freebsd-hackers/2013-June/043015.html
  http://lists.freebsd.org/pipermail/freebsd-current/2013-July/043143.html
  
  Tested with the following configurations:
  - Sandybridge server with 64GB of memory.
  - bhyve VM with 64MB of memory.
  - bhyve VM with a 8GB of memory with the memory segment above 4GB cuddling
right up against the 4TB maximum memory limit.
  
  Discussed on: hackers@, current@
  Submitted by: Chris Torek (to...@torek.net)

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/include/pmap.h
  head/sys/amd64/include/vmparam.h

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Aug 17 19:34:41 2013(r254465)
+++ head/sys/amd64/amd64/pmap.c Sat Aug 17 19:49:08 2013(r254466)
@@ -232,6 +232,7 @@ u_int64_t   KPML4phys;  /* phys addr of ke
 
 static u_int64_t   DMPDphys;   /* phys addr of direct mapped level 2 */
 static u_int64_t   DMPDPphys;  /* phys addr of direct mapped level 3 */
+static int ndmpdpphys; /* number of DMPDPphys pages */
 
 static struct rwlock_padalign pvh_global_lock;
 
@@ -539,7 +540,18 @@ create_pagetables(vm_paddr_t *firstaddr)
ndmpdp = (ptoa(Maxmem) + NBPDP - 1) >> PDPSHIFT;
if (ndmpdp < 4) /* Minimum 4GB of dirmap */
ndmpdp = 4;
-   DMPDPphys = allocpages(firstaddr, NDMPML4E);
+   ndmpdpphys = howmany(ndmpdp, NPDPEPG);
+   if (ndmpdpphys > NDMPML4E) {
+   /*
+* Each NDMPML4E allows 512 GB, so limit to that,
+* and then readjust ndmpdp and ndmpdpphys.
+*/
+   printf("NDMPML4E limits system to %d GB\n", NDMPML4E * 512);
+   Maxmem = atop(NDMPML4E * NBPML4);
+   ndmpdpphys = NDMPML4E;
+   ndmpdp = NDMPML4E * NPDEPG;
+   }
+   DMPDPphys = allocpages(firstaddr, ndmpdpphys);
ndm1g = 0;
if ((amd_feature & AMDID_PAGE1GB) != 0)
ndm1g = ptoa(Maxmem) >> PDPSHIFT;
@@ -556,6 +568,10 @@ create_pagetables(vm_paddr_t *firstaddr)
 * bootstrap.  We defer this until after all memory-size dependent
 * allocations are done (e.g. direct map), so that we don't have to
 * build in too much slop in our estimate.
+*
+* Note that when NKPML4E > 1, we have an empty page underneath
+* all but the KPML4I'th one, so we need NKPML4E-1 extra (zeroed)
+* pages.  (pmap_enter requires a PD page to exist for each KPML4E.)
 */
nkpt_init(*firstaddr);
nkpdpe = NKPDPE(nkpt);
@@ -580,8 +596,8 @@ create_pagetables(vm_paddr_t *firstaddr)
for (i = 0; (i << PDRSHIFT) < *firstaddr; i++)
pd_p[i] = (i << PDRSHIFT) | PG_RW | PG_V | PG_PS | PG_G;
 
-   /* And connect up the PD to the PDP */
-   pdp_p = (pdp_entry_t *)KPDPphys;
+   /* And connect up the PD to the PDP (leaving room for L4 pages) */
+   pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE));
for (i = 0; i < nkpdpe; i++)
pdp_p[i + KPDPI] = (KPDphys + ptoa(i)) | PG_RW | PG_V | PG_U;
 
@@ -618,14 +634,16 @@ create_pagetables(vm_paddr_t *firstaddr)
p4_p[PML4PML4I] |= PG_RW | PG_V | PG_U;
 
/* Connect the Direct Map slot(s) up to the PML4. */
-   for (i = 0; i < NDMPML4E; i++) {
+   for (i = 0; i < ndmpdpphys; i++) {
p4_p[DMPML4I + i] = DMPDPphys + ptoa(i);
p4_p[DMPML4I + i] |= PG_RW | PG_V | PG_U;
}
 
-   /* Connect the KVA slot up to the PML4 */
-   p4_p[KPML4I] = KPDPphys;
-   p4_p[KPML4I] |= PG_RW | PG_V | PG_U;
+   /* Connect the KVA slots up to the PML4 */
+   for (i = 0; i < NKPML4E; i++) {
+   p4_p[KPML4BASE + i] = KPDPphys + ptoa(i);
+   p4_p[KPML4BASE + i] |= PG_RW | PG_V | PG_U;
+   }
 }
 
 /*
@@ -1684,8 +1702,11 @@ pmap_pinit(pmap_t pmap)
pagezero(pmap->pm_pml4);
 
/* Wire in kernel global address entries. */
-   pmap->pm_pml4[KPML4I] = KPDPphys | PG_RW | PG_V | PG_U;
-   for (i = 0; i < NDMPML4E; i++) {
+   for (i = 0; i < NKPML4E; i++) {
+   pmap->pm_pml4[KPML4BASE + i] = (KPDPphys + (i << PAGE_SHIFT)) |
+ 

svn commit: r254465 - head/sys/sys

2013-08-17 Thread Ed Maste
Author: emaste
Date: Sat Aug 17 19:34:41 2013
New Revision: 254465
URL: http://svnweb.freebsd.org/changeset/base/254465

Log:
  Correct implementation of atomic_flag_test_and_set
  
  The function sets the flag and returns the previous value (7.17.8.1).

Modified:
  head/sys/sys/stdatomic.h

Modified: head/sys/sys/stdatomic.h
==
--- head/sys/sys/stdatomic.hSat Aug 17 19:29:51 2013(r254464)
+++ head/sys/sys/stdatomic.hSat Aug 17 19:34:41 2013(r254465)
@@ -381,11 +381,7 @@ static __inline _Bool
 atomic_flag_test_and_set_explicit(volatile atomic_flag *__object,
 memory_order __order)
 {
-   _Bool __expected;
-
-   __expected = 0;
-   return (atomic_compare_exchange_strong_explicit(&__object->__flag,
-   &__expected, 1, __order, __order));
+   return (atomic_exchange_explicit(&__object->__flag, 1, __order));
 }
 
 static __inline void
___
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: r254464 - head/sys/arm/conf

2013-08-17 Thread Ian Lepore
Author: ian
Date: Sat Aug 17 19:29:51 2013
New Revision: 254464
URL: http://svnweb.freebsd.org/changeset/base/254464

Log:
  Enable VFP support for BeagleBone.

Modified:
  head/sys/arm/conf/BEAGLEBONE

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONESat Aug 17 19:24:58 2013
(r254463)
+++ head/sys/arm/conf/BEAGLEBONESat Aug 17 19:29:51 2013
(r254464)
@@ -49,6 +49,7 @@ options   _KPOSIX_PRIORITY_SCHEDULING #Po
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
 optionsPREEMPTION
 optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon
 
 # Debugging
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
___
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: r254463 - in head: lib/libc/amd64/sys lib/libc/gen lib/libc/i386/sys sys/amd64/include sys/i386/include

2013-08-17 Thread Jilles Tjoelker
Author: jilles
Date: Sat Aug 17 19:24:58 2013
New Revision: 254463
URL: http://svnweb.freebsd.org/changeset/base/254463

Log:
  libc: Access _logname_valid more efficiently.
  
  The variable _logname_valid is not exported via the version script;
  therefore, change C and i386/amd64 assembler code to remove indirection
  (which allowed interposition). This makes the code slightly smaller and
  faster.
  
  Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC,
  there is no place containing the address of each variable, so there is no
  possible definition for PIC_GOT.

Modified:
  head/lib/libc/amd64/sys/setlogin.S
  head/lib/libc/gen/getlogin.c
  head/lib/libc/i386/sys/setlogin.S
  head/sys/amd64/include/asm.h
  head/sys/i386/include/asm.h

Modified: head/lib/libc/amd64/sys/setlogin.S
==
--- head/lib/libc/amd64/sys/setlogin.S  Sat Aug 17 19:23:35 2013
(r254462)
+++ head/lib/libc/amd64/sys/setlogin.S  Sat Aug 17 19:24:58 2013
(r254463)
@@ -48,12 +48,7 @@ ENTRY(__sys_setlogin)
mov $SYS_setlogin,%rax
KERNCALL
jb  HIDENAME(cerror)
-#ifdef PIC
-   movqPIC_GOT(CNAME(_logname_valid)),%rdx
-   movl$0,(%rdx)
-#else
movl$0,CNAME(_logname_valid)(%rip)
-#endif
ret /* setlogin(name) */
 END(__sys_setlogin)
 

Modified: head/lib/libc/gen/getlogin.c
==
--- head/lib/libc/gen/getlogin.cSat Aug 17 19:23:35 2013
(r254462)
+++ head/lib/libc/gen/getlogin.cSat Aug 17 19:24:58 2013
(r254463)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 
 extern int _getlogin(char *, int);
 
-int_logname_valid; /* known to setlogin() */
+int_logname_valid __hidden; /* known to setlogin() */
 static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static char *

Modified: head/lib/libc/i386/sys/setlogin.S
==
--- head/lib/libc/i386/sys/setlogin.S   Sat Aug 17 19:23:35 2013
(r254462)
+++ head/lib/libc/i386/sys/setlogin.S   Sat Aug 17 19:24:58 2013
(r254463)
@@ -41,16 +41,9 @@ __FBSDID("$FreeBSD$");
 .globl CNAME(_logname_valid)   /* in _getlogin() */
 
 SYSCALL(setlogin)
-#ifdef PIC
PIC_PROLOGUE
-   pushl   %eax
-   movlPIC_GOT(CNAME(_logname_valid)),%eax
-   movl$0,(%eax)
-   popl%eax
+   movl$0,PIC_GOTOFF(CNAME(_logname_valid))
PIC_EPILOGUE
-#else
-   movl$0,CNAME(_logname_valid)
-#endif
ret /* setlogin(name) */
 END(__sys_setlogin)
 

Modified: head/sys/amd64/include/asm.h
==
--- head/sys/amd64/include/asm.hSat Aug 17 19:23:35 2013
(r254462)
+++ head/sys/amd64/include/asm.hSat Aug 17 19:24:58 2013
(r254463)
@@ -43,7 +43,6 @@
 #definePIC_GOT(x)  x@GOTPCREL(%rip)
 #else
 #definePIC_PLT(x)  x
-#definePIC_GOT(x)  x
 #endif
 
 /*

Modified: head/sys/i386/include/asm.h
==
--- head/sys/i386/include/asm.h Sat Aug 17 19:23:35 2013(r254462)
+++ head/sys/i386/include/asm.h Sat Aug 17 19:24:58 2013(r254463)
@@ -49,11 +49,12 @@
popl%ebx
 #definePIC_PLT(x)  x@PLT
 #definePIC_GOT(x)  x@GOT(%ebx)
+#definePIC_GOTOFF(x)   x@GOTOFF(%ebx)
 #else
 #definePIC_PROLOGUE
 #definePIC_EPILOGUE
 #definePIC_PLT(x)  x
-#definePIC_GOT(x)  x
+#definePIC_GOTOFF(x)   x
 #endif
 
 /*
___
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: r254462 - head/usr.sbin/rtsold

2013-08-17 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 17 19:23:35 2013
New Revision: 254462
URL: http://svnweb.freebsd.org/changeset/base/254462

Log:
  - Remove struct ifinfo *iflist.  It is no longer used.
  - Suppress warnings about increase of alignment requirement.

Modified:
  head/usr.sbin/rtsold/dump.c
  head/usr.sbin/rtsold/if.c
  head/usr.sbin/rtsold/probe.c
  head/usr.sbin/rtsold/rtsock.c
  head/usr.sbin/rtsold/rtsol.c
  head/usr.sbin/rtsold/rtsold.c
  head/usr.sbin/rtsold/rtsold.h

Modified: head/usr.sbin/rtsold/dump.c
==
--- head/usr.sbin/rtsold/dump.c Sat Aug 17 18:51:38 2013(r254461)
+++ head/usr.sbin/rtsold/dump.c Sat Aug 17 19:23:35 2013(r254462)
@@ -50,8 +50,6 @@
 
 static FILE *fp;
 
-extern struct ifinfo *iflist;
-
 static void dump_interface_status(void);
 static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", 
"TENTATIVE"};
 

Modified: head/usr.sbin/rtsold/if.c
==
--- head/usr.sbin/rtsold/if.c   Sat Aug 17 18:51:38 2013(r254461)
+++ head/usr.sbin/rtsold/if.c   Sat Aug 17 19:23:35 2013(r254462)
@@ -61,7 +61,6 @@
 #include 
 #include "rtsold.h"
 
-extern int rssock;
 static int ifsock;
 
 static int get_llflag(const char *);
@@ -304,13 +303,13 @@ if_nametosdl(char *name)
 
lim = buf + len;
for (next = buf; next < lim; next += ifm->ifm_msglen) {
-   ifm = (struct if_msghdr *)next;
+   ifm = (struct if_msghdr *)(void *)next;
if (ifm->ifm_type == RTM_IFINFO) {
sa = (struct sockaddr *)(ifm + 1);
get_rtaddrs(ifm->ifm_addrs, sa, rti_info);
if ((sa = rti_info[RTAX_IFP]) != NULL) {
if (sa->sa_family == AF_LINK) {
-   sdl = (struct sockaddr_dl *)sa;
+   sdl = (struct sockaddr_dl *)(void *)sa;
if (strlen(name) != sdl->sdl_nlen)
continue; /* not same len */
if (strncmp(&sdl->sdl_data[0],
@@ -397,7 +396,7 @@ get_llflag(const char *name)
continue;
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
-   sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
+   sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr;
if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
continue;
 

Modified: head/usr.sbin/rtsold/probe.c
==
--- head/usr.sbin/rtsold/probe.cSat Aug 17 18:51:38 2013
(r254461)
+++ head/usr.sbin/rtsold/probe.cSat Aug 17 19:23:35 2013
(r254462)
@@ -164,7 +164,7 @@ sendprobe(struct in6_addr *addr, struct 
cm->cmsg_level = IPPROTO_IPV6;
cm->cmsg_type = IPV6_PKTINFO;
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
-   pi = (struct in6_pktinfo *)CMSG_DATA(cm);
+   pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm);
memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr));   /*XXX*/
pi->ipi6_ifindex = ifindex;
 

Modified: head/usr.sbin/rtsold/rtsock.c
==
--- head/usr.sbin/rtsold/rtsock.c   Sat Aug 17 18:51:38 2013
(r254461)
+++ head/usr.sbin/rtsold/rtsock.c   Sat Aug 17 19:23:35 2013
(r254462)
@@ -103,7 +103,7 @@ rtsock_input(int s)
 
lim = msg + n;
for (next = msg; next < lim; next += len) {
-   rtm = (struct rt_msghdr *)next;
+   rtm = (struct rt_msghdr *)(void *)next;
if (lim - next < lenlim)
break;
len = rtm->rtm_msglen;
@@ -138,7 +138,7 @@ static int
 rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim)
 {
struct if_announcemsghdr *ifan;
-   struct ifinfo *ifinfo;
+   struct ifinfo *ifi;
 
ifan = (struct if_announcemsghdr *)rtm;
if ((char *)(ifan + 1) > lim)
@@ -158,14 +158,14 @@ rtsock_input_ifannounce(int s __unused, 
case IFAN_DEPARTURE:
warnmsg(LOG_WARNING, __func__,
"interface %s removed", ifan->ifan_name);
-   ifinfo = find_ifinfo(ifan->ifan_index);
-   if (ifinfo) {
+   ifi = find_ifinfo(ifan->ifan_index);
+   if (ifi) {
if (dflag > 1) {
warnmsg(LOG_INFO, __func__,
"bring interface %s to DOWN state",
ifan->ifan_name);
}
-   ifinfo->state = IFS_DOWN;
+   ifi->state = IFS_DOWN;

svn commit: r254461 - in head/sys: arm/arm arm/conf arm/include conf

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 18:51:38 2013
New Revision: 254461
URL: http://svnweb.freebsd.org/changeset/base/254461

Log:
  Rename device vfp to option VFP and retire the ARM_VFP_SUPPORT option. This
  simplifies enabling as previously both options were required to be enabled,
  now we only need a single option.
  
  While here enable VFP on the PandaBoard.

Modified:
  head/sys/arm/arm/genassym.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/arm/mp_machdep.c
  head/sys/arm/arm/swtch.S
  head/sys/arm/arm/undefined.c
  head/sys/arm/arm/vfp.c
  head/sys/arm/conf/PANDABOARD
  head/sys/arm/conf/RPI-B
  head/sys/arm/include/pcpu.h
  head/sys/conf/files.arm
  head/sys/conf/options.arm

Modified: head/sys/arm/arm/genassym.c
==
--- head/sys/arm/arm/genassym.c Sat Aug 17 18:38:00 2013(r254460)
+++ head/sys/arm/arm/genassym.c Sat Aug 17 18:51:38 2013(r254461)
@@ -113,7 +113,7 @@ ASSYM(ARM_RAS_START, ARM_RAS_START);
 ASSYM(ARM_RAS_END, ARM_RAS_END);
 #endif
 
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
 ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
 ASSYM(PCB_VFPCPU, offsetof(struct pcb, pcb_vfpcpu));
 

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sat Aug 17 18:38:00 2013(r254460)
+++ head/sys/arm/arm/machdep.c  Sat Aug 17 18:51:38 2013(r254461)
@@ -875,7 +875,7 @@ pcpu0_init(void)
 #endif
pcpu_init(pcpup, 0, sizeof(struct pcpu));
PCPU_SET(curthread, &thread0);
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
PCPU_SET(cpu, 0);
 #endif
 }

Modified: head/sys/arm/arm/mp_machdep.c
==
--- head/sys/arm/arm/mp_machdep.c   Sat Aug 17 18:38:00 2013
(r254460)
+++ head/sys/arm/arm/mp_machdep.c   Sat Aug 17 18:51:38 2013
(r254461)
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
 #include 
 #endif
 
@@ -199,7 +199,7 @@ init_secondary(int cpu)
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
pc->pc_curthread = pc->pc_idlethread;
pc->pc_curpcb = pc->pc_idlethread->td_pcb;
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
pc->pc_cpu = cpu;
 
vfp_init();

Modified: head/sys/arm/arm/swtch.S
==
--- head/sys/arm/arm/swtch.SSat Aug 17 18:38:00 2013(r254460)
+++ head/sys/arm/arm/swtch.SSat Aug 17 18:51:38 2013(r254461)
@@ -114,7 +114,7 @@ ENTRY(cpu_throw)
 
GET_PCPU(r7)
 
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
/*
 * vfp_discard will clear pcpu->pc_vfpcthread, and modify
 * and modify the control as needed.
@@ -124,7 +124,7 @@ ENTRY(cpu_throw)
bne 3f
bl  _C_LABEL(vfp_discard)   /* yes, shut down vfp */
 3:
-#endif /* ARM_VFP_SUPPORT */
+#endif /* VFP */
 
ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */
   
@@ -303,7 +303,7 @@ ENTRY(cpu_switch)
/* rem: r9 = new PCB */
/* rem: interrupts are enabled */
 
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
/*
 * vfp_store will clear pcpu->pc_vfpcthread, save 
 * registers and state, and modify the control as needed.
@@ -325,7 +325,7 @@ ENTRY(cpu_switch)
add r0, r2, #(PCB_VFPSTATE)
bl  _C_LABEL(vfp_store)
 1:
-#endif /* ARM_VFP_SUPPORT */
+#endif /* VFP */
 
/* r1 now free! */
 
@@ -505,7 +505,7 @@ ENTRY(savectx)
/* Store all the registers in the process's pcb */
add r2, r0, #(PCB_R8)
stmia   r2, {r8-r13}
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
/*
 * vfp_store will clear pcpu->pc_vfpcthread, save 
 * registers and state, and modify the control as needed.
@@ -525,7 +525,7 @@ ENTRY(savectx)
add r0, r0, #(PCB_VFPSTATE)
bl  _C_LABEL(vfp_store)
 1:
-#endif /* ARM_VFP_SUPPORT */
+#endif /* VFP */
add sp, sp, #4;
ldmfd   sp!, {r4-r7, pc}
 END(savectx)

Modified: head/sys/arm/arm/undefined.c
==
--- head/sys/arm/arm/undefined.cSat Aug 17 18:38:00 2013
(r254460)
+++ head/sys/arm/arm/undefined.cSat Aug 17 18:51:38 2013
(r254461)
@@ -234,13 +234,13 @@ undefinedinstruction(trapframe_t *frame)
coprocessor = 0;
if ((fault_instruction & (1 << 27)) != 0)
coprocessor = (fault_instruction >> 8) & 0x0f;
-#ifdef ARM_VFP_SUPPORT
+#ifdef VFP
else {  /* check for special instructions */
if (((fault_instruction & 0xfe00) == 0xf200) ||
((fault_instruction & 0xff10) == 0xf400))
coprocessor = 10; 

svn commit: r254459 - head/usr.bin/netstat

2013-08-17 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 17 17:23:42 2013
New Revision: 254459
URL: http://svnweb.freebsd.org/changeset/base/254459

Log:
  - Use getnameinfo(3) instead of gethostbyaddr(3) or inet_ntop(3).
  
  - Fill sin6_scope_id from in6p.sin6_addr.s6_addr[2].  struct inpcb has
struct in6_addr for the endpoint addresses, so sin6_scope_id must be filled.

Modified:
  head/usr.bin/netstat/inet6.c

Modified: head/usr.bin/netstat/inet6.c
==
--- head/usr.bin/netstat/inet6.cSat Aug 17 17:09:26 2013
(r254458)
+++ head/usr.bin/netstat/inet6.cSat Aug 17 17:23:42 2013
(r254459)
@@ -1120,12 +1120,17 @@ inet6print(struct in6_addr *in6, int por
 char *
 inet6name(struct in6_addr *in6p)
 {
-   char *cp;
+   struct sockaddr_in6 sin6;
+   char hbuf[NI_MAXHOST], *cp;
static char line[50];
-   struct hostent *hp;
static char domain[MAXHOSTNAMELEN];
static int first = 1;
+   int flags, error;
 
+   if (IN6_IS_ADDR_UNSPECIFIED(in6p)) {
+   strcpy(line, "*");
+   return (line);
+   }
if (first && !numeric_addr) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
@@ -1134,24 +1139,26 @@ inet6name(struct in6_addr *in6p)
else
domain[0] = 0;
}
-   cp = 0;
-   if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) {
-   hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6);
-   if (hp) {
-   if ((cp = strchr(hp->h_name, '.')) &&
-   !strcmp(cp + 1, domain))
-   *cp = 0;
-   cp = hp->h_name;
-   }
-   }
-   if (IN6_IS_ADDR_UNSPECIFIED(in6p))
-   strcpy(line, "*");
-   else if (cp)
-   strcpy(line, cp);
-   else
+   memset(&sin6, 0, sizeof(sin6));
+   memcpy(&sin6.sin6_addr, in6p, sizeof(*in6p));
+   sin6.sin6_family = AF_INET6;
+   /* XXX: in6p.s6_addr[2] can contain scopeid. */ 
+   in6_fillscopeid(&sin6);
+   flags = (numeric_addr) ? NI_NUMERICHOST : 0;
+   error = getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), hbuf,
+   sizeof(hbuf), NULL, 0, flags);
+   if (error == 0) {
+   if ((flags & NI_NUMERICHOST) == 0 &&
+   (cp = strchr(hbuf, '.')) &&
+   !strcmp(cp + 1, domain))
+   *cp = 0;
+   strcpy(line, hbuf);
+   } else {
+   /* XXX: this should not happen. */
sprintf(line, "%s",
-   inet_ntop(AF_INET6, (void *)in6p, ntop_buf,
+   inet_ntop(AF_INET6, (void *)&sin6.sin6_addr, ntop_buf,
sizeof(ntop_buf)));
+   }
return (line);
 }
 #endif /*INET6*/
___
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: r254457 - head/sys/kern

2013-08-17 Thread Bryan Venteicher
Author: bryanv
Date: Sat Aug 17 17:02:43 2013
New Revision: 254457
URL: http://svnweb.freebsd.org/changeset/base/254457

Log:
  Do not use potentially stale thread in kthread_add()
  
  When an existing process is provided, the thread selected to use
  to initialize the new thread could have exited and be reaped.
  Acquire the proc lock earlier to ensure the thread remains valid.
  
  Reviewed by:  jhb, julian (previous version)
  MFC after:3 days

Modified:
  head/sys/kern/kern_kthread.c

Modified: head/sys/kern/kern_kthread.c
==
--- head/sys/kern/kern_kthread.cSat Aug 17 16:42:18 2013
(r254456)
+++ head/sys/kern/kern_kthread.cSat Aug 17 17:02:43 2013
(r254457)
@@ -257,18 +257,17 @@ kthread_add(void (*func)(void *), void *
panic("kthread_add called too soon");
 
/* If no process supplied, put it on proc0 */
-   if (p == NULL) {
+   if (p == NULL)
p = &proc0;
-   oldtd = &thread0;
-   } else {
-   oldtd = FIRST_THREAD_IN_PROC(p);
-   }
 
/* Initialize our new td  */
newtd = thread_alloc(pages);
if (newtd == NULL)
return (ENOMEM);
 
+   PROC_LOCK(p);
+   oldtd = FIRST_THREAD_IN_PROC(p);
+
bzero(&newtd->td_startzero,
__rangeof(struct thread, td_startzero, td_endzero));
bcopy(&oldtd->td_startcopy, &newtd->td_startcopy,
@@ -292,7 +291,6 @@ kthread_add(void (*func)(void *), void *
newtd->td_ucred = crhold(p->p_ucred);
 
/* this code almost the same as create_thread() in kern_thr.c */
-   PROC_LOCK(p);
p->p_flag |= P_HADTHREADS;
thread_link(newtd, p);
thread_lock(oldtd);
___
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: r254455 - head/sys/conf

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 15:21:17 2013
New Revision: 254455
URL: http://svnweb.freebsd.org/changeset/base/254455

Log:
  Remove the armfpe config options. These files don't exist on FreeBSD.

Modified:
  head/sys/conf/files.arm

Modified: head/sys/conf/files.arm
==
--- head/sys/conf/files.arm Sat Aug 17 15:09:14 2013(r254454)
+++ head/sys/conf/files.arm Sat Aug 17 15:21:17 2013(r254455)
@@ -51,9 +51,6 @@ arm/arm/undefined.c   standard
 arm/arm/vectors.S  standard
 arm/arm/vm_machdep.c   standard
 arm/arm/vfp.c  optionalvfp
-arm/fpe-arm/armfpe_glue.S  optionalarmfpe
-arm/fpe-arm/armfpe_init.c  optionalarmfpe
-arm/fpe-arm/armfpe.S   optionalarmfpe
 board_id.h standard   \
dependency  "$S/arm/conf/genboardid.awk $S/arm/conf/mach-types" \
compile-with"${AWK} -f $S/arm/conf/genboardid.awk 
$S/arm/conf/mach-types > board_id.h" \
___
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: r254454 - in head/sys: arm/arm conf

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 15:09:14 2013
New Revision: 254454
URL: http://svnweb.freebsd.org/changeset/base/254454

Log:
  Remove the ARMFPE option. It is unsupported, and appears to be broken as
  arm_fpe_core_changecontext is not a function.

Modified:
  head/sys/arm/arm/swtch.S
  head/sys/conf/options.arm

Modified: head/sys/arm/arm/swtch.S
==
--- head/sys/arm/arm/swtch.SSat Aug 17 14:55:31 2013(r254453)
+++ head/sys/arm/arm/swtch.SSat Aug 17 15:09:14 2013(r254454)
@@ -472,15 +472,6 @@ ENTRY(cpu_switch)
ldr r13, [r7, #(PCB_SP)]
 #endif
 
-   /* rem: r6 = lock */
-   /* rem: r7 = new pcb */
-
-#ifdef ARMFPE
-   add r0, r7, #(USER_SIZE) & 0x00ff
-   add r0, r0, #(USER_SIZE) & 0xff00
-   bl  _C_LABEL(arm_fpe_core_changecontext)
-#endif
-
/* rem: r5 = new lwp's proc */
/* rem: r6 = lock */
/* rem: r7 = new PCB */

Modified: head/sys/conf/options.arm
==
--- head/sys/conf/options.arm   Sat Aug 17 14:55:31 2013(r254453)
+++ head/sys/conf/options.arm   Sat Aug 17 15:09:14 2013(r254454)
@@ -1,7 +1,6 @@
 #$FreeBSD$
 ARM9_CACHE_WRITE_THROUGH   opt_global.h
 ARM_CACHE_LOCK_ENABLE  opt_global.h
-ARMFPE opt_global.h
 ARM_KERN_DIRECTMAP opt_vm.h
 ARM_L2_PIPTopt_global.h
 ARM_MANY_BOARD opt_global.h
___
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: r254453 - head/lib/libc/sys

2013-08-17 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Aug 17 14:55:31 2013
New Revision: 254453
URL: http://svnweb.freebsd.org/changeset/base/254453

Log:
  Correct function name and return value.

Modified:
  head/lib/libc/sys/cap_ioctls_limit.2

Modified: head/lib/libc/sys/cap_ioctls_limit.2
==
--- head/lib/libc/sys/cap_ioctls_limit.2Sat Aug 17 14:53:53 2013
(r254452)
+++ head/lib/libc/sys/cap_ioctls_limit.2Sat Aug 17 14:55:31 2013
(r254453)
@@ -99,10 +99,10 @@ argument.
 .Rv -std cap_ioctls_limit
 .Pp
 The
-.Fn cap_ioctls_limit
+.Fn cap_ioctls_get
 function, if successfull, returns the total number of allowed ioctl commands or
 the value
-.Dv INT_MAX
+.Dv CAP_IOCTLS_ALL
 if all ioctls commands are allowed.
 On failure the value
 .Va -1
___
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: r254452 - head/sys/arm/include

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 14:53:53 2013
New Revision: 254452
URL: http://svnweb.freebsd.org/changeset/base/254452

Log:
  Remove fpe_sp_state as we don't support fpe.

Modified:
  head/sys/arm/include/fp.h
  head/sys/arm/include/pcb.h

Modified: head/sys/arm/include/fp.h
==
--- head/sys/arm/include/fp.h   Sat Aug 17 14:52:19 2013(r254451)
+++ head/sys/arm/include/fp.h   Sat Aug 17 14:53:53 2013(r254452)
@@ -66,19 +66,10 @@ typedef struct fp_extended_precision fp_
  * This needs to move and be hidden from userland.
  */
 
-#ifdef ARM_VFP_SUPPORT
 struct vfp_state {
u_int64_t reg[32];
u_int32_t fpscr;
 };
-#else
-struct fpe_sp_state {
-   unsigned int fp_flags;
-   unsigned int fp_sr;
-   unsigned int fp_cr;
-   fp_reg_t fp_registers[16];
-};
-#endif
 
 /*
  * Type for a saved FP context, if we want to translate the context to a

Modified: head/sys/arm/include/pcb.h
==
--- head/sys/arm/include/pcb.h  Sat Aug 17 14:52:19 2013(r254451)
+++ head/sys/arm/include/pcb.h  Sat Aug 17 14:53:53 2013(r254452)
@@ -80,12 +80,8 @@ struct pcb {
 #define PCB_NOALIGNFLT 0x0002
caddr_t pcb_onfault;/* On fault handler */
struct  pcb_arm32 un_32;
-#ifdef ARM_VFP_SUPPORT
struct vfp_state pcb_vfpstate;  /* VP/NEON state */
u_int pcb_vfpcpu;   /* VP/NEON last cpu */
-#else
-   struct  fpe_sp_state pcb_fpstate;   /* Floating Point state */
-#endif
 };
 
 /*
___
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: r254451 - head/sys/arm/arm

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 14:52:19 2013
New Revision: 254451
URL: http://svnweb.freebsd.org/changeset/base/254451

Log:
  Remove unused FPE code. This is not enabled anywhere as it is the only
  file I can find containing FAST_FPE. It appears this would not work as
  want_resched is not defined anywhere.

Modified:
  head/sys/arm/arm/undefined.c

Modified: head/sys/arm/arm/undefined.c
==
--- head/sys/arm/arm/undefined.cSat Aug 17 14:42:40 2013
(r254450)
+++ head/sys/arm/arm/undefined.cSat Aug 17 14:52:19 2013
(r254451)
@@ -65,9 +65,6 @@ __FBSDID("$FreeBSD$");
 #ifdef KDB
 #include 
 #endif
-#ifdef FAST_FPE
-#include 
-#endif
 
 #include 
 #include 
@@ -89,9 +86,6 @@ __FBSDID("$FreeBSD$");
 #endif
 
 static int gdb_trapper(u_int, u_int, struct trapframe *, int);
-#ifdef FAST_FPE
-extern int want_resched;
-#endif
 
 LIST_HEAD(, undefined_handler) undefined_handlers[MAX_COPROCS];
 
@@ -294,33 +288,5 @@ undefinedinstruction(trapframe_t *frame)
panic("Undefined instruction in kernel.\n");
}
 
-#ifdef FAST_FPE
-   /* Optimised exit code */
-   {
-
-   /*
-* Check for reschedule request, at the moment there is only
-* 1 ast so this code should always be run
-*/
-
-   if (want_resched) {
-   /*
-* We are being preempted.
-*/
-   preempt(0);
-   }
-
-   /* Invoke MI userret code */
-   mi_userret(td);
-
-#if 0
-   l->l_priority = l->l_usrpri;
-
-   curcpu()->ci_schedstate.spc_curpriority = l->l_priority;
-#endif
-   }
-
-#else
userret(td, frame);
-#endif
 }
___
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: r254450 - head/lib/libthread_db/arch/arm

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 14:42:40 2013
New Revision: 254450
URL: http://svnweb.freebsd.org/changeset/base/254450

Log:
  Ensure we set all fpu registers to zero by using the address and size of
  the union over one of its members.

Modified:
  head/lib/libthread_db/arch/arm/libpthread_md.c

Modified: head/lib/libthread_db/arch/arm/libpthread_md.c
==
--- head/lib/libthread_db/arch/arm/libpthread_md.c  Sat Aug 17 14:36:32 
2013(r254449)
+++ head/lib/libthread_db/arch/arm/libpthread_md.c  Sat Aug 17 14:42:40 
2013(r254450)
@@ -90,7 +90,7 @@ pt_fpreg_to_ucontext(const struct fpreg 
mcontext_t *mc = &uc->uc_mcontext;
 
/* XXX */
-   memset(&mc->__fpu.__fpregs, 0, sizeof(__fpregset_t));
+   memset(&mc->__fpu, 0, sizeof(mc->__fpu));
 }
 
 void
___
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: r254449 - head/contrib/binutils/gas/config

2013-08-17 Thread Andrew Turner
Author: andrew
Date: Sat Aug 17 14:36:32 2013
New Revision: 254449
URL: http://svnweb.freebsd.org/changeset/base/254449

Log:
  Silence a warning that is incorrect on ARMv6 and later. In the smull, umull,
  smlal, and umlal the output registers are allowed to be the same as either
  input registers, where in ARMv4 and ARMv5 they could only be the same as the
  last input register.

Modified:
  head/contrib/binutils/gas/config/tc-arm.c

Modified: head/contrib/binutils/gas/config/tc-arm.c
==
--- head/contrib/binutils/gas/config/tc-arm.c   Sat Aug 17 14:18:41 2013
(r254448)
+++ head/contrib/binutils/gas/config/tc-arm.c   Sat Aug 17 14:36:32 2013
(r254449)
@@ -7218,10 +7218,11 @@ do_mull (void)
   inst.instruction |= inst.operands[2].reg;
   inst.instruction |= inst.operands[3].reg << 8;
 
-  /* rdhi, rdlo and rm must all be different.  */
+  /* rdhi, rdlo and rm must all be different prior to ARMv6.  */
   if (inst.operands[0].reg == inst.operands[1].reg
-  || inst.operands[0].reg == inst.operands[2].reg
+  || ((inst.operands[0].reg == inst.operands[2].reg
   || inst.operands[1].reg == inst.operands[2].reg)
+  && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6)))
 as_tsktsk (_("rdhi, rdlo and rm must all be different"));
 }
 
___
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: r254448 - head/sys/compat/freebsd32

2013-08-17 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Aug 17 14:18:41 2013
New Revision: 254448
URL: http://svnweb.freebsd.org/changeset/base/254448

Log:
  Regenerate after r254447.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Sat Aug 17 14:17:13 2013
(r254447)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Sat Aug 17 14:18:41 2013
(r254448)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 
2013-07-21 19:43:52Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Sat Aug 17 14:17:13 
2013(r254447)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Sat Aug 17 14:18:41 
2013(r254448)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 
2013-07-21 19:43:52Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -424,6 +424,9 @@
 #defineFREEBSD32_SYS_cap_rights_get515
 #defineFREEBSD32_SYS_cap_enter 516
 #defineFREEBSD32_SYS_cap_getmode   517
+#defineFREEBSD32_SYS_pdfork518
+#defineFREEBSD32_SYS_pdkill519
+#defineFREEBSD32_SYS_pdgetpid  520
 #defineFREEBSD32_SYS_freebsd32_pselect 522
 #defineFREEBSD32_SYS_getloginclass 523
 #defineFREEBSD32_SYS_setloginclass 524

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Sat Aug 17 14:17:13 
2013(r254447)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Sat Aug 17 14:18:41 
2013(r254448)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 
2013-07-21 19:43:52Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -541,10 +541,10 @@ const char *freebsd32_syscallnames[] = {
"cap_rights_get",   /* 515 = cap_rights_get */
"cap_enter",/* 516 = cap_enter */
"cap_getmode",  /* 517 = cap_getmode */
-   "#518", /* 518 = pdfork */
-   "#519", /* 519 = pdkill */
-   "#520", /* 520 = pdgetpid */
-   "#521", /* 521 = pdwait */
+   "pdfork",   /* 518 = pdfork */
+   "pdkill",   /* 519 = pdkill */
+   "pdgetpid", /* 520 = pdgetpid */
+   "#521", /* 521 = pdwait4 */
"freebsd32_pselect",/* 522 = freebsd32_pselect */
"getloginclass",/* 523 = getloginclass */
"setloginclass",/* 524 = setloginclass */

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cSat Aug 17 14:17:13 
2013(r254447)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cSat Aug 17 14:18:41 
2013(r254448)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 
2013-07-21 19:43:52Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
  */
 
 #include "opt_compat.h"
@@ -578,10 +578,10 @@ struct sysent freebsd32_sysent[] = {
{ AS(cap_rights_get_args), (sy_call_t *)sys_cap_rights_get, 
AUE_CAP_RIGHTS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 515 = cap_rights_get */
{ 0, (sy_call_t *)sys_cap_enter, AUE_CAP_ENTER, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 516 = cap_enter */
{ AS(cap_getmode_args), (sy_call_t *)sys_cap_getmode, AUE_CAP_GETMODE, 
NULL, 0, 0, 0, SY_THR_STATIC },  /* 517 = cap_getmode */
-   { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0

svn commit: r254447 - head/sys/compat/freebsd32

2013-08-17 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Aug 17 14:17:13 2013
New Revision: 254447
URL: http://svnweb.freebsd.org/changeset/base/254447

Log:
  Make pdfork(2), pdkill(2) and pdgetpid(2) syscalls available for 32bit
  binaries running under 64bit kernel.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Sat Aug 17 14:13:45 2013
(r254446)
+++ head/sys/compat/freebsd32/syscalls.master   Sat Aug 17 14:17:13 2013
(r254447)
@@ -975,10 +975,10 @@
uint64_t *rightsp); }
 516AUE_CAP_ENTER   NOPROTO { int cap_enter(void); }
 517AUE_CAP_GETMODE NOPROTO { int cap_getmode(u_int *modep); }
-518AUE_PDFORK  UNIMPL  pdfork
-519AUE_PDKILL  UNIMPL  pdkill
-520AUE_PDGETPIDUNIMPL  pdgetpid
-521AUE_PDWAIT  UNIMPL  pdwait
+518AUE_PDFORK  NOPROTO { int pdfork(int *fdp, int flags); }
+519AUE_PDKILL  NOPROTO { int pdkill(int fd, int signum); }
+520AUE_PDGETPIDNOPROTO { int pdgetpid(int fd, pid_t *pidp); }
+521AUE_PDWAIT  UNIMPL  pdwait4
 522AUE_SELECT  STD { int freebsd32_pselect(int nd, fd_set *in, \
fd_set *ou, fd_set *ex, \
const struct timespec32 *ts, \
___
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: r254446 - head/sys/kern

2013-08-17 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Aug 17 14:13:45 2013
New Revision: 254446
URL: http://svnweb.freebsd.org/changeset/base/254446

Log:
  In r114945 the line 'nmp = TAILQ_NEXT(mp, mnt_list);' was duplicated.
  Instead of just removing the duplicate, convert the loop to TAILQ_FOREACH().

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cSat Aug 17 14:09:46 2013(r254445)
+++ head/sys/kern/vfs_subr.cSat Aug 17 14:13:45 2013(r254446)
@@ -2906,7 +2906,7 @@ vn_printf(struct vnode *vp, const char *
  */
 DB_SHOW_COMMAND(lockedvnods, lockedvnodes)
 {
-   struct mount *mp, *nmp;
+   struct mount *mp;
struct vnode *vp;
 
/*
@@ -2916,14 +2916,11 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnode
 * about that.
 */
db_printf("Locked vnodes\n");
-   for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) {
-   nmp = TAILQ_NEXT(mp, mnt_list);
+   TAILQ_FOREACH(mp, &mountlist, mnt_list) {
TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) {
-   if (vp->v_type != VMARKER &&
-   VOP_ISLOCKED(vp))
+   if (vp->v_type != VMARKER && VOP_ISLOCKED(vp))
vprint("", vp);
}
-   nmp = TAILQ_NEXT(mp, mnt_list);
}
 }
 
___
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: r254445 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-17 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sat Aug 17 14:09:46 2013
New Revision: 254445
URL: http://svnweb.freebsd.org/changeset/base/254445

Log:
  Remove redundant variable.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cSat Aug 
17 08:31:34 2013(r25)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cSat Aug 
17 14:09:46 2013(r254445)
@@ -1799,12 +1799,10 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s
 int
 zfs_vnode_lock(vnode_t *vp, int flags)
 {
-   int error;
 
ASSERT(vp != NULL);
 
-   error = vn_lock(vp, flags);
-   return (error);
+   return (vn_lock(vp, flags));
 }
 
 static int
___
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: r254441 - head/sys/netinet6

2013-08-17 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 17 07:14:45 2013
New Revision: 254441
URL: http://svnweb.freebsd.org/changeset/base/254441

Log:
  Return 0 in nbi->expire when la_expire == 0.  Conversion from time_uptime to
  time_second should not be performed in this case.

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Sat Aug 17 07:12:52 2013(r254440)
+++ head/sys/netinet6/nd6.c Sat Aug 17 07:14:45 2013(r254441)
@@ -1508,7 +1508,11 @@ nd6_ioctl(u_long cmd, caddr_t data, stru
nbi->state = ln->ln_state;
nbi->asked = ln->la_asked;
nbi->isrouter = ln->ln_router;
-   nbi->expire = ln->la_expire + (time_second - time_uptime);
+   if (ln->la_expire == 0)
+   nbi->expire = 0;
+   else
+   nbi->expire = ln->la_expire +
+   (time_second - time_uptime);
LLE_RUNLOCK(ln);
break;
}
___
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: r254440 - head/usr.sbin/rwhod

2013-08-17 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 17 07:12:52 2013
New Revision: 254440
URL: http://svnweb.freebsd.org/changeset/base/254440

Log:
  Unbreak rwhod(8):
  
  - It did not work with GENERIC kernel after r250603 because
options PROCDESC was required for pdfork(2).  It now just uses fork(2)
instead when this syscall is not available.
  
  - Fix verify().  This function was broken in r250602 because the outermost
"()" was removed from the condition !(isalnum() || ispunct()).
It prevented hostnames including "-", for example.

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

Modified: head/usr.sbin/rwhod/rwhod.c
==
--- head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:10:01 2013(r254439)
+++ head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:12:52 2013(r254440)
@@ -274,6 +274,15 @@ main(int argc, char *argv[])
exit(1);
if (!quiet_mode) {
pid_child_receiver = pdfork(&fdp, 0);
+   if (pid_child_receiver == -1) {
+   if (errno != ENOSYS) {
+   syslog(LOG_ERR, "pdfork: %m");
+   exit(1);
+   } else {
+   pid_child_receiver = fork();
+   fdp = -1;
+   }
+   }
if (pid_child_receiver == 0) {
receiver_process();
} else if (pid_child_receiver > 0) {
@@ -328,7 +337,7 @@ verify(char *name, int maxlen)
 
size = 0;
while (*name != '\0' && size < maxlen - 1) {
-   if (!isascii(*name) || !isalnum(*name) || ispunct(*name))
+   if (!isascii(*name) || !(isalnum(*name) || ispunct(*name)))
return (0);
name++;
size++;
___
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: r254439 - head/sys/vm

2013-08-17 Thread Konstantin Belousov
Author: kib
Date: Sat Aug 17 07:10:01 2013
New Revision: 254439
URL: http://svnweb.freebsd.org/changeset/base/254439

Log:
  Remove the arbitrary binding of the pagedaemon threads to the domains,
  update the comment accordingly and make it more precise.
  
  Requested and reviewed by:jeff (previous version)

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cSat Aug 17 06:29:45 2013(r254438)
+++ head/sys/vm/vm_pageout.cSat Aug 17 07:10:01 2013(r254439)
@@ -1575,35 +1575,16 @@ static void
 vm_pageout_worker(void *arg)
 {
struct vm_domain *domain;
-   struct pcpu *pc;
-   int cpu, domidx;
+   int domidx;
 
domidx = (uintptr_t)arg;
domain = &vm_dom[domidx];
 
/*
-* XXXKIB The bind is rather arbitrary.  With some minor
-* complications, we could assign the cpuset consisting of all
-* CPUs in the same domain.  In fact, it even does not matter
-* if the CPU we bind to is in the affinity domain of this
-* page queue, we only need to establish the fair distribution
-* of pagedaemon threads among CPUs.
-*
-* XXXKIB It would be useful to allocate vm_pages for the
-* domain from the domain, and put pcpu area into the page
-* owned by the domain.
+* XXXKIB It could be useful to bind pageout daemon threads to
+* the cores belonging to the domain, from which vm_page_array
+* is allocated.
 */
-   if (mem_affinity != NULL) {
-   CPU_FOREACH(cpu) {
-   pc = pcpu_find(cpu);
-   if (pc->pc_domain == domidx) {
-   thread_lock(curthread);
-   sched_bind(curthread, cpu);
-   thread_unlock(curthread);
-   break;
-   }
-   }
-   }
 
KASSERT(domain->vmd_segs != 0, ("domain without segments"));
vm_pageout_init_marker(&domain->vmd_marker, PQ_INACTIVE);
___
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"