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

2013-11-01 Thread Gleb Smirnoff
Author: glebius
Date: Fri Nov  1 10:01:57 2013
New Revision: 257498
URL: http://svnweb.freebsd.org/changeset/base/257498

Log:
  prison_check_ip4() can take const arguments.

Modified:
  head/sys/kern/kern_jail.c
  head/sys/sys/jail.h

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Fri Nov  1 07:03:44 2013(r257497)
+++ head/sys/kern/kern_jail.c   Fri Nov  1 10:01:57 2013(r257498)
@@ -135,7 +135,7 @@ static void prison_racct_modify(struct p
 static void prison_racct_detach(struct prison *pr);
 #endif
 #ifdef INET
-static int _prison_check_ip4(struct prison *pr, struct in_addr *ia);
+static int _prison_check_ip4(const struct prison *, const struct in_addr *);
 static int prison_restrict_ip4(struct prison *pr, struct in_addr *newip4);
 #endif
 #ifdef INET6
@@ -2930,7 +2930,7 @@ prison_remote_ip4(struct ucred *cred, st
  * doesn't allow IPv4.  Address passed in in NBO.
  */
 static int
-_prison_check_ip4(struct prison *pr, struct in_addr *ia)
+_prison_check_ip4(const struct prison *pr, const struct in_addr *ia)
 {
int i, a, z, d;
 
@@ -2960,7 +2960,7 @@ _prison_check_ip4(struct prison *pr, str
 }
 
 int
-prison_check_ip4(struct ucred *cred, struct in_addr *ia)
+prison_check_ip4(const struct ucred *cred, const struct in_addr *ia)
 {
struct prison *pr;
int error;

Modified: head/sys/sys/jail.h
==
--- head/sys/sys/jail.h Fri Nov  1 07:03:44 2013(r257497)
+++ head/sys/sys/jail.h Fri Nov  1 10:01:57 2013(r257498)
@@ -384,7 +384,7 @@ int prison_equal_ip4(struct prison *, st
 int prison_get_ip4(struct ucred *cred, struct in_addr *ia);
 int prison_local_ip4(struct ucred *cred, struct in_addr *ia);
 int prison_remote_ip4(struct ucred *cred, struct in_addr *ia);
-int prison_check_ip4(struct ucred *cred, struct in_addr *ia);
+int prison_check_ip4(const struct ucred *, const struct in_addr *);
 int prison_saddrsel_ip4(struct ucred *, struct in_addr *);
 #ifdef INET6
 int prison_equal_ip6(struct prison *, struct prison *);
___
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: r257499 - head/sys/netinet

2013-11-01 Thread Gleb Smirnoff
Author: glebius
Date: Fri Nov  1 10:18:41 2013
New Revision: 257499
URL: http://svnweb.freebsd.org/changeset/base/257499

Log:
  Cleanup in_ifscrub(), which is just an entry to in_scrubprefix().

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet/in_var.h
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Fri Nov  1 10:01:57 2013(r257498)
+++ head/sys/netinet/if_ether.c Fri Nov  1 10:18:41 2013(r257499)
@@ -142,7 +142,7 @@ static const struct netisr_handler arp_n
 
 #ifdef AF_INET
 /*
- * called by in_ifscrub to remove entry from the table when
+ * called by in_scrubprefix() to remove entry from the table when
  * the interface goes away
  */
 void

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Fri Nov  1 10:01:57 2013(r257498)
+++ head/sys/netinet/in.c   Fri Nov  1 10:18:41 2013(r257499)
@@ -488,7 +488,7 @@ in_control(struct socket *so, u_long cmd
 * is the same as before, then the call is
 * un-necessarily executed here.
 */
-   in_ifscrub(ifp, ia, LLE_STATIC);
+   in_scrubprefix(ia, LLE_STATIC);
ia->ia_sockmask = ifra->ifra_mask;
ia->ia_sockmask.sin_family = AF_INET;
ia->ia_subnetmask =
@@ -497,7 +497,7 @@ in_control(struct socket *so, u_long cmd
}
if ((ifp->if_flags & IFF_POINTOPOINT) &&
(ifra->ifra_dstaddr.sin_family == AF_INET)) {
-   in_ifscrub(ifp, ia, LLE_STATIC);
+   in_scrubprefix(ia, LLE_STATIC);
ia->ia_dstaddr = ifra->ifra_dstaddr;
maskIsNew  = 1; /* We lie; but the effect's the same */
}
@@ -523,9 +523,9 @@ in_control(struct socket *so, u_long cmd
 
case SIOCDIFADDR:
/*
-* in_ifscrub kills the interface route.
+* in_scrubprefix() kills the interface route.
 */
-   in_ifscrub(ifp, ia, LLE_STATIC);
+   in_scrubprefix(ia, LLE_STATIC);
 
/*
 * in_ifadown gets rid of all the rest of
@@ -771,16 +771,6 @@ in_lifaddr_ioctl(struct socket *so, u_lo
 }
 
 /*
- * Delete any existing route for an interface.
- */
-void
-in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia, u_int flags)
-{
-
-   in_scrubprefix(ia, flags);
-}
-
-/*
  * Initialize an interface's internet address
  * and routing table entry.
  */

Modified: head/sys/netinet/in_var.h
==
--- head/sys/netinet/in_var.h   Fri Nov  1 10:01:57 2013(r257498)
+++ head/sys/netinet/in_var.h   Fri Nov  1 10:18:41 2013(r257499)
@@ -412,7 +412,6 @@ int in_addprefix(struct in_ifaddr *, int
 intin_scrubprefix(struct in_ifaddr *, u_int);
 void   ip_input(struct mbuf *);
 intin_ifadown(struct ifaddr *ifa, int);
-void   in_ifscrub(struct ifnet *, struct in_ifaddr *, u_int);
 struct mbuf*ip_fastforward(struct mbuf *);
 void   *in_domifattach(struct ifnet *);
 void   in_domifdetach(struct ifnet *, void *);

Modified: head/sys/netinet/raw_ip.c
==
--- head/sys/netinet/raw_ip.c   Fri Nov  1 10:01:57 2013(r257498)
+++ head/sys/netinet/raw_ip.c   Fri Nov  1 10:18:41 2013(r257499)
@@ -736,9 +736,9 @@ rip_ctlinput(int cmd, struct sockaddr *s
ifa_ref(&ia->ia_ifa);
IN_IFADDR_RUNLOCK();
/*
-* in_ifscrub kills the interface route.
+* in_scrubprefix() kills the interface route.
 */
-   in_ifscrub(ia->ia_ifp, ia, 0);
+   in_scrubprefix(ia, 0);
/*
 * in_ifadown gets rid of all the rest of the
 * routes.  This is not quite the right thing
___
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: r257500 - head/sys/netinet

2013-11-01 Thread Gleb Smirnoff
Author: glebius
Date: Fri Nov  1 10:29:10 2013
New Revision: 257500
URL: http://svnweb.freebsd.org/changeset/base/257500

Log:
  in_ifadown() can be void.

Modified:
  head/sys/netinet/in_rmx.c
  head/sys/netinet/in_var.h

Modified: head/sys/netinet/in_rmx.c
==
--- head/sys/netinet/in_rmx.c   Fri Nov  1 10:18:41 2013(r257499)
+++ head/sys/netinet/in_rmx.c   Fri Nov  1 10:29:10 2013(r257500)
@@ -433,15 +433,15 @@ in_ifadownkill(struct radix_node *rn, vo
return 0;
 }
 
-int
+void
 in_ifadown(struct ifaddr *ifa, int delete)
 {
struct in_ifadown_arg arg;
struct radix_node_head *rnh;
int fibnum;
 
-   if (ifa->ifa_addr->sa_family != AF_INET)
-   return 1;
+   KASSERT(ifa->ifa_addr->sa_family == AF_INET,
+   ("%s: wrong family", __func__));
 
for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) {
rnh = rt_tables_get_rnh(fibnum, AF_INET);
@@ -452,7 +452,6 @@ in_ifadown(struct ifaddr *ifa, int delet
RADIX_NODE_HEAD_UNLOCK(rnh);
ifa->ifa_flags &= ~IFA_ROUTE;   /* XXXlocking? */
}
-   return 0;
 }
 
 /*

Modified: head/sys/netinet/in_var.h
==
--- head/sys/netinet/in_var.h   Fri Nov  1 10:18:41 2013(r257499)
+++ head/sys/netinet/in_var.h   Fri Nov  1 10:29:10 2013(r257500)
@@ -411,7 +411,7 @@ voidin_rtqdrain(void);
 intin_addprefix(struct in_ifaddr *, int);
 intin_scrubprefix(struct in_ifaddr *, u_int);
 void   ip_input(struct mbuf *);
-intin_ifadown(struct ifaddr *ifa, int);
+void   in_ifadown(struct ifaddr *ifa, int);
 struct mbuf*ip_fastforward(struct mbuf *);
 void   *in_domifattach(struct ifnet *);
 void   in_domifdetach(struct ifnet *, 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: r257501 - head/sys/kern

2013-11-01 Thread Alexander Motin
Author: mav
Date: Fri Nov  1 10:32:33 2013
New Revision: 257501
URL: http://svnweb.freebsd.org/changeset/base/257501

Log:
  Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
  allocate memory and so not require sleepable environment.  getenv() has
  already used on-stack temporary storage, so just use it more rationally.
  getenv_string() receives buffer as argument, so don't need another one.

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cFri Nov  1 10:29:10 2013
(r257500)
+++ head/sys/kern/kern_environment.cFri Nov  1 10:32:33 2013
(r257501)
@@ -315,20 +315,12 @@ char *
 getenv(const char *name)
 {
char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1];
-   char *ret, *cp;
-   int len;
+   char *ret;
 
if (dynamic_kenv) {
-   mtx_lock(&kenv_lock);
-   cp = _getenv_dynamic(name, NULL);
-   if (cp != NULL) {
-   strcpy(buf, cp);
-   mtx_unlock(&kenv_lock);
-   len = strlen(buf) + 1;
-   ret = malloc(len, M_KENV, M_WAITOK);
-   strcpy(ret, buf);
+   if (getenv_string(name, buf, sizeof(buf))) {
+   ret = strdup(buf, M_KENV);
} else {
-   mtx_unlock(&kenv_lock);
ret = NULL;
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"getenv");
@@ -458,15 +450,20 @@ unsetenv(const char *name)
 int
 getenv_string(const char *name, char *data, int size)
 {
-   char *tmp;
+   char *cp;
 
-   tmp = getenv(name);
-   if (tmp != NULL) {
-   strlcpy(data, tmp, size);
-   freeenv(tmp);
-   return (1);
-   } else
-   return (0);
+   if (dynamic_kenv) {
+   mtx_lock(&kenv_lock);
+   cp = _getenv_dynamic(name, NULL);
+   if (cp != NULL)
+   strlcpy(data, cp, size);
+   mtx_unlock(&kenv_lock);
+   } else {
+   cp = _getenv_static(name);
+   if (cp != NULL)
+   strlcpy(data, cp, size);
+   }
+   return (cp != NULL);
 }
 
 /*
@@ -535,18 +532,15 @@ getenv_ulong(const char *name, unsigned 
 int
 getenv_quad(const char *name, quad_t *data)
 {
-   char*value;
+   charvalue[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1];
char*vtp;
quad_t  iv;
 
-   value = getenv(name);
-   if (value == NULL)
+   if (!getenv_string(name, value, sizeof(value)))
return (0);
iv = strtoq(value, &vtp, 0);
-   if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) {
-   freeenv(value);
+   if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0'))
return (0);
-   }
switch (vtp[0]) {
case 't': case 'T':
iv *= 1024;
@@ -559,11 +553,9 @@ getenv_quad(const char *name, quad_t *da
case '\0':
break;
default:
-   freeenv(value);
return (0);
}
*data = iv;
-   freeenv(value);
return (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: r257502 - head/usr.bin/limits

2013-11-01 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Nov  1 10:42:32 2013
New Revision: 257502
URL: http://svnweb.freebsd.org/changeset/base/257502

Log:
  Remove the dependency on procfs.
  
  Reviewed by:  kib
  MFC after:1 week
  X-MFC with:   r257430

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

Modified: head/usr.bin/limits/limits.1
==
--- head/usr.bin/limits/limits.1Fri Nov  1 10:32:33 2013
(r257501)
+++ head/usr.bin/limits/limits.1Fri Nov  1 10:42:32 2013
(r257502)
@@ -19,7 +19,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2012
+.Dd October 31, 2013
 .Dt LIMITS 1
 .Os
 .Sh NAME
@@ -87,9 +87,6 @@ Like the previous usage, it outputs thes
 output, except that it will emit them in
 .Ic eval
 format, suitable for the calling shell.
-The calling shell is determined by examining the entries in the
-.Pa /proc
-file system for the parent process.
 If the shell is known (i.e., it is one of
 .Nm sh , csh , bash , tcsh , ksh , pdksh
 or
@@ -386,21 +383,6 @@ utility does not handle commands with eq
 signs in their
 names, for obvious reasons.
 .Pp
-When eval output is selected, the
-.Pa /proc
-file system must be installed
-and mounted for the shell to be correctly determined, and therefore
-output syntax correct for the running shell.
-The default output is valid for
-.Xr sh 1 ,
-so this means that any
-usage of
-.Nm
-in eval mode prior mounting
-.Pa /proc
-may only occur in standard bourne
-shell scripts.
-.Pp
 The
 .Nm
 utility makes no effort to ensure that resource settings emitted or displayed
___
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: r257504 - head/bin/sh

2013-11-01 Thread Jilles Tjoelker
Author: jilles
Date: Fri Nov  1 11:28:56 2013
New Revision: 257504
URL: http://svnweb.freebsd.org/changeset/base/257504

Log:
  sh: Reorder union node to reduce its size on 64-bit platforms.

Modified:
  head/bin/sh/nodetypes

Modified: head/bin/sh/nodetypes
==
--- head/bin/sh/nodetypes   Fri Nov  1 11:02:59 2013(r257503)
+++ head/bin/sh/nodetypes   Fri Nov  1 11:28:56 2013(r257504)
@@ -118,16 +118,16 @@ NFROMTO nfile # fd<> fname
 NAPPEND nfile  # fd>> fname
 NCLOBBER nfile # fd>| fname
type  int
-   next  nodeptr   # next redirection in list
fdint   # file descriptor being redirected
+   next  nodeptr   # next redirection in list
fname nodeptr   # file name, in a NARG node
expfname  temp  char *expfname  # actual file name
 
 NTOFD ndup # fd<&dupfd
 NFROMFD ndup   # fd>&dupfd
type  int
-   next  nodeptr   # next redirection in list
fdint   # file descriptor being redirected
+   next  nodeptr   # next redirection in list
dupfd int   # file descriptor to duplicate
vname nodeptr   # file name if fd>&$var
 
@@ -135,8 +135,8 @@ NFROMFD ndup# fd>&dupfd
 NHERE nhere# fd<<\!
 NXHERE nhere   # fd

Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Bryan Drewery
On 11/1/2013 1:18 AM, Luigi Rizzo wrote:
> On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote:
>> On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote:
>>> as per the subject, after this commit building head on stable/9
>>> fails with the error below:
>>>
>>> ===> lib/libpam/modules/pam_krb5 (all)
>>> make: don't know how to make
>>> /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
>>> Stop
>>>
>>> reverting the commit fixes the build.
>>>
>>> Any idea how this can be fixed ?
>>
>> I just built world and kernel with a freshly checked out head on
>> ref9-amd64 so I supect something in your environment.  This change
>> should only impact the installed copy of ld which would have no effect
>> on a 9-stable system.  Any portion of the build system using a version
>> effected by this change is broken since only the cross build version
>> should be used and that one will have it's own sysroot value as always
>> it always has.
> 
> ok so what happens is the following (trying to build HEAD on 9.2, both amd64)
> 
> - WITHOUT_CLANG and related options:
> "make toolchain"  fails with the error on krb5
> "make buildworld" works, and a subsequent
>   "make toolchain" also works
> 
> - without options (so compiling CLANG)
> 
> "make toolchain"  fails with the error below
> 
> building shared library libc.so.7
> /usr/bin/ld: this linker was not configured to use sysroots
> cc: error: linker command failed with exit code 1 (use -v to see 
> invocation)

Are you using ccache? I've seen this error with that before r257268.

> *** [libc.so.7] Error code 1
> 1 error
> *** [all] Error code 2
> 1 error
> 
> 
> "make toolchain" on an empty tree used to work until before this commit,
> and does work if i revert this single change
> 
> So does this mean that 'toolchain' now has some prerequisites ?
> 
> cheers
> luigi
> ___
> svn-src-...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r257505 - head/usr.sbin/pkg

2013-11-01 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Fri Nov  1 12:37:36 2013
New Revision: 257505
URL: http://svnweb.freebsd.org/changeset/base/257505

Log:
  Add -f support to 'pkg bootstrap' and 'pkg add' to force installation
  of pkg(8) even if already installed.
  
  This is useful if you somehow messup pkg(8) and need to reinstall from
  remote with it already being registered in the pkg(8) /var/db/pkg database.
  
  Also add some sanity checks to 'pkg add'.
  
  Approved by:  bapt
  MFC after:2 days

Modified:
  head/usr.sbin/pkg/pkg.7
  head/usr.sbin/pkg/pkg.c

Modified: head/usr.sbin/pkg/pkg.7
==
--- head/usr.sbin/pkg/pkg.7 Fri Nov  1 11:28:56 2013(r257504)
+++ head/usr.sbin/pkg/pkg.7 Fri Nov  1 12:37:36 2013(r257505)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2013
+.Dd November 1, 2013
 .Dt PKG 7
 .Os
 .Sh NAME
@@ -35,11 +35,13 @@
 .Ao Ar command Ac
 .Nm
 add
+.Op Fl f
 .Ao Pa pkg.txz Ac
 .Nm
 .Fl N
 .Nm
 bootstrap
+.Op Fl f
 .Sh DESCRIPTION
 .Nm
 is the package management tool.
@@ -55,7 +57,7 @@ The first time invoked,
 will bootstrap the real
 .Xr pkg 8
 from a remote repository.
-.Bl -tag -width "pkg add  xxx"
+.Bl -tag -width "pkg bootstrap"
 .It Nm Ao Ar command Ac
 If
 .Xr pkg 8
@@ -63,7 +65,7 @@ is not installed yet, it will be fetched
 installed, and then have the original command forwarded to it.
 If already installed, the command requested will be forwarded to the real
 .Xr pkg 8 .
-.It Nm Li add Ao Pa pkg.txz Ac
+.It Nm Li add Oo Fl f Oc Ao Pa pkg.txz Ac
 Install
 .Xr pkg 8
 from a local package instead of fetching from remote.
@@ -72,16 +74,26 @@ If a
 file exists and
 signature checking is enabled, then the signature will be verified
 before installing the package.
+If the
+.Fl f
+flag is specified, then
+.Xr pkg 8
+will be installed regardless if it is already installed.
 .It Nm Fl N
 Do not bootstrap, just determine if
 .Xr pkg 8
 is actually installed or not.
 Returns 0 and the number of packages installed
 if it is, otherwise 1.
-.It Nm Li bootstrap
+.It Nm Li bootstrap Op Fl f
 Attempt to bootstrap and do not forward anything to
 .Xr pkg 8
 after it is installed.
+If the
+.Fl f
+flag is specified, then
+.Xr pkg 8
+will be fetched and installed regardless if it is already installed.
 .El
 .Sh CONFIGURATION
 Configuration varies in whether it is in a repository configuration file

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Fri Nov  1 11:28:56 2013(r257504)
+++ head/usr.sbin/pkg/pkg.c Fri Nov  1 12:37:36 2013(r257505)
@@ -135,7 +135,7 @@ cleanup:
 }
 
 static int
-install_pkg_static(const char *path, const char *pkgpath)
+install_pkg_static(const char *path, const char *pkgpath, bool force)
 {
int pstat;
pid_t pid;
@@ -144,7 +144,12 @@ install_pkg_static(const char *path, con
case -1:
return (-1);
case 0:
-   execl(path, "pkg-static", "add", pkgpath, (char *)NULL);
+   if (force)
+   execl(path, "pkg-static", "add", "-f", pkgpath,
+   (char *)NULL);
+   else
+   execl(path, "pkg-static", "add", pkgpath,
+   (char *)NULL);
_exit(1);
default:
break;
@@ -740,7 +745,7 @@ cleanup:
 }
 
 static int
-bootstrap_pkg(void)
+bootstrap_pkg(bool force)
 {
FILE *config;
int fd_pkg, fd_sig;
@@ -801,7 +806,7 @@ bootstrap_pkg(void)
}
 
if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0)
-   ret = install_pkg_static(pkgstatic, tmppkg);
+   ret = install_pkg_static(pkgstatic, tmppkg, force);
 
snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf",
getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE);
@@ -866,7 +871,7 @@ pkg_query_yes_no(void)
 }
 
 static int
-bootstrap_pkg_local(const char *pkgpath)
+bootstrap_pkg_local(const char *pkgpath, bool force)
 {
char path[MAXPATHLEN];
char pkgstatic[MAXPATHLEN];
@@ -898,7 +903,7 @@ bootstrap_pkg_local(const char *pkgpath)
}
 
if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0)
-   ret = install_pkg_static(pkgstatic, pkgpath);
+   ret = install_pkg_static(pkgstatic, pkgpath, force);
 
 cleanup:
close(fd_pkg);
@@ -912,12 +917,24 @@ int
 main(__unused int argc, char *argv[])
 {
char pkgpath[MAXPATHLEN];
-   bool yes = false;
+   const char *pkgarg;
+   bool bootstrap_only, force, yes;
+
+   bootstrap_only = false;
+   force = false;
+   pkgarg = NULL;
+   yes = false;
 
snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg",
getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE);
 
-   if (access(pkgpath, X_

svn commit: r257506 - in head: bin/sh usr.bin/limits

2013-11-01 Thread Jilles Tjoelker
Author: jilles
Date: Fri Nov  1 13:57:30 2013
New Revision: 257506
URL: http://svnweb.freebsd.org/changeset/base/257506

Log:
  sh(1),limits(1): Document kqueues (-k) rlimit.

Modified:
  head/bin/sh/sh.1
  head/usr.bin/limits/limits.1

Modified: head/bin/sh/sh.1
==
--- head/bin/sh/sh.1Fri Nov  1 12:37:36 2013(r257505)
+++ head/bin/sh/sh.1Fri Nov  1 13:57:30 2013(r257506)
@@ -32,7 +32,7 @@
 .\"from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2013
+.Dd November 1, 2013
 .Dt SH 1
 .Os
 .Sh NAME
@@ -2551,7 +2551,7 @@ and not found.
 For aliases the alias expansion is printed;
 for commands and tracked aliases
 the complete pathname of the command is printed.
-.It Ic ulimit Oo Fl HSabcdflmnpstuvw Oc Op Ar limit
+.It Ic ulimit Oo Fl HSabcdfklmnpstuvw Oc Op Ar limit
 Set or display resource limits (see
 .Xr getrlimit 2 ) .
 If
@@ -2598,6 +2598,11 @@ The maximal size of core dump files, in 
 The maximal size of the data segment of a process, in kilobytes.
 .It Fl f Ar filesize
 The maximal size of a file, in 512-byte blocks.
+.It Fl k Ar kqueues
+The maximal number of kqueues
+(see
+.Xr kqueue 2 )
+for this user ID.
 .It Fl l Ar lockedmem
 The maximal size of memory that can be locked by a process, in
 kilobytes.

Modified: head/usr.bin/limits/limits.1
==
--- head/usr.bin/limits/limits.1Fri Nov  1 12:37:36 2013
(r257505)
+++ head/usr.bin/limits/limits.1Fri Nov  1 13:57:30 2013
(r257506)
@@ -19,7 +19,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 31, 2013
+.Dd November 1, 2013
 .Dt LIMITS 1
 .Os
 .Sh NAME
@@ -30,11 +30,11 @@
 .Op Fl C Ar class | Fl P Ar pid | Fl U Ar user
 .Op Fl SHB
 .Op Fl ea
-.Op Fl bcdflmnstuvpw Op Ar val
+.Op Fl bcdfklmnstuvpw Op Ar val
 .Nm
 .Op Fl C Ar class | Fl U Ar user
 .Op Fl SHB
-.Op Fl bcdflmnstuvpw Op Ar val
+.Op Fl bcdfklmnstuvpw Op Ar val
 .Op Fl E
 .Oo
 .Op Ar name Ns = Ns Ar value ...
@@ -207,6 +207,10 @@ resource limit.
 Select or set the
 .Va filesize
 resource limit.
+.It Fl k Op Ar val
+Select or set the
+.Va kqueues
+resource limit.
 .It Fl l Op Ar val
 Select or set the
 .Va memorylocked
___
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: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Luigi Rizzo
On Fri, Nov 01, 2013 at 07:15:08AM -0500, Bryan Drewery wrote:
> On 11/1/2013 1:18 AM, Luigi Rizzo wrote:
...
> > ok so what happens is the following (trying to build HEAD on 9.2, both 
> > amd64)
> > 
> > - WITHOUT_CLANG and related options:
> > "make toolchain"fails with the error on krb5
> > "make buildworld"   works, and a subsequent
> > "make toolchain" also works
> > 
> > - without options (so compiling CLANG)
> > 
> > "make toolchain"fails with the error below
> > 
> > building shared library libc.so.7
> > /usr/bin/ld: this linker was not configured to use sysroots
> > cc: error: linker command failed with exit code 1 (use -v to see 
> > invocation)
> 
> Are you using ccache? I've seen this error with that before r257268.

no ccache, and even disabling parallel make (I am using -j 4)
does not seem to affect the behaviour

cheers
luigi

> > *** [libc.so.7] Error code 1
> > 1 error
> > *** [all] Error code 2
> > 1 error
> > 
> > 
> > "make toolchain" on an empty tree used to work until before this commit,
> > and does work if i revert this single change
> > 
> > So does this mean that 'toolchain' now has some prerequisites ?
> > 
> > cheers
> > luigi
> > ___
> > svn-src-...@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/svn-src-all
> > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> > 
> 
> 
> -- 
> Regards,
> Bryan Drewery
> 


___
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: r257511 - head/sys/x86/iommu

2013-11-01 Thread Konstantin Belousov
Author: kib
Date: Fri Nov  1 17:16:44 2013
New Revision: 257511
URL: http://svnweb.freebsd.org/changeset/base/257511

Log:
  Return BUS_PROBE_NOWILDCARD from the DMAR probe method.
  
  Confirmed by: nwhitehorn
  MFC after:1 month

Modified:
  head/sys/x86/iommu/intel_drv.c

Modified: head/sys/x86/iommu/intel_drv.c
==
--- head/sys/x86/iommu/intel_drv.c  Fri Nov  1 17:12:45 2013
(r257510)
+++ head/sys/x86/iommu/intel_drv.c  Fri Nov  1 17:16:44 2013
(r257511)
@@ -217,7 +217,7 @@ dmar_probe(device_t dev)
if (acpi_get_handle(dev) != NULL)
return (ENXIO);
device_set_desc(dev, "DMA remap");
-   return (0);
+   return (BUS_PROBE_NOWILDCARD);
 }
 
 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: r257512 - in head/sys: conf x86/iommu

2013-11-01 Thread Konstantin Belousov
Author: kib
Date: Fri Nov  1 17:38:52 2013
New Revision: 257512
URL: http://svnweb.freebsd.org/changeset/base/257512

Log:
  Add support for queued invalidation.
  
  Right now, the semaphore write is scheduled after each batch, which is
  not optimal and must be tuned.
  
  Discussed with:   alc
  Tested by:pho
  MFC after:1 month

Added:
  head/sys/x86/iommu/intel_qi.c   (contents, props changed)
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/x86/iommu/intel_ctx.c
  head/sys/x86/iommu/intel_dmar.h
  head/sys/x86/iommu/intel_drv.c
  head/sys/x86/iommu/intel_fault.c
  head/sys/x86/iommu/intel_gas.c
  head/sys/x86/iommu/intel_idpgtbl.c
  head/sys/x86/iommu/intel_reg.h
  head/sys/x86/iommu/intel_utils.c

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Fri Nov  1 17:16:44 2013(r257511)
+++ head/sys/conf/files.amd64   Fri Nov  1 17:38:52 2013(r257512)
@@ -537,6 +537,7 @@ x86/iommu/intel_drv.c   optionalacpi acp
 x86/iommu/intel_fault.coptionalacpi acpi_dmar pci
 x86/iommu/intel_gas.c  optionalacpi acpi_dmar pci
 x86/iommu/intel_idpgtbl.c  optionalacpi acpi_dmar pci
+x86/iommu/intel_qi.c   optionalacpi acpi_dmar pci
 x86/iommu/intel_quirks.c   optionalacpi acpi_dmar pci
 x86/iommu/intel_utils.coptionalacpi acpi_dmar pci
 x86/isa/atpic.coptionalatpic isa

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Fri Nov  1 17:16:44 2013(r257511)
+++ head/sys/conf/files.i386Fri Nov  1 17:38:52 2013(r257512)
@@ -560,6 +560,7 @@ x86/iommu/intel_drv.c   optional acpi acp
 x86/iommu/intel_fault.coptional acpi acpi_dmar pci
 x86/iommu/intel_gas.c  optional acpi acpi_dmar pci
 x86/iommu/intel_idpgtbl.c  optional acpi acpi_dmar pci
+x86/iommu/intel_qi.c   optional acpi acpi_dmar pci
 x86/iommu/intel_quirks.c   optional acpi acpi_dmar pci
 x86/iommu/intel_utils.coptional acpi acpi_dmar pci
 x86/isa/atpic.coptional atpic

Modified: head/sys/x86/iommu/intel_ctx.c
==
--- head/sys/x86/iommu/intel_ctx.c  Fri Nov  1 17:16:44 2013
(r257511)
+++ head/sys/x86/iommu/intel_ctx.c  Fri Nov  1 17:38:52 2013
(r257512)
@@ -385,17 +385,29 @@ dmar_get_ctx(struct dmar_unit *dmar, dev
 * negative TLB entries.
 */
if ((dmar->hw_cap & DMAR_CAP_CM) != 0 || enable) {
-   error = dmar_inv_ctx_glob(dmar);
-   if (error == 0 &&
-   (dmar->hw_ecap & DMAR_ECAP_DI) != 0)
-   error = dmar_inv_iotlb_glob(dmar);
-   if (error != 0) {
-   dmar_free_ctx_locked(dmar, ctx);
-   TD_PINNED_ASSERT;
-   return (NULL);
+   if (dmar->qi_enabled) {
+   dmar_qi_invalidate_ctx_glob_locked(dmar);
+   if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0)
+   dmar_qi_invalidate_iotlb_glob_locked(dmar);
+   } else {
+   error = dmar_inv_ctx_glob(dmar);
+   if (error == 0 &&
+   (dmar->hw_ecap & DMAR_ECAP_DI) != 0)
+   error = dmar_inv_iotlb_glob(dmar);
+   if (error != 0) {
+   dmar_free_ctx_locked(dmar, ctx);
+   TD_PINNED_ASSERT;
+   return (NULL);
+   }
}
}
-   if (enable && !rmrr_init) {
+
+   /*
+* The dmar lock was potentially dropped between check for the
+* empty context list and now.  Recheck the state of GCMD_TE
+* to avoid unneeded command.
+*/
+   if (enable && !rmrr_init && (dmar->hw_gcmd & DMAR_GCMD_TE) == 0) {
error = dmar_enable_translation(dmar);
if (error != 0) {
dmar_free_ctx_locked(dmar, ctx);
@@ -469,8 +481,12 @@ dmar_free_ctx_locked(struct dmar_unit *d
dmar_pte_clear(&ctxp->ctx1);
ctxp->ctx2 = 0;
dmar_inv_ctx_glob(dmar);
-   if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0)
-   dmar_inv_iotlb_glob(dmar);
+   if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) {
+   if (dmar->qi_enabled)
+   dmar_qi_invalidate_iotlb_glob_locked(dmar);
+   else
+   dmar_inv_iotlb_glob(dmar);
+   }
LIST_REMOVE(ctx, link);
DMAR_UNLOCK(dmar);
 
@@ -512,24 +528,86 @@ dmar_find_ctx_locked(struct dmar_u

svn commit: r257514 - head/release/picobsd/build

2013-11-01 Thread Luigi Rizzo
Author: luigi
Date: Fri Nov  1 18:29:27 2013
New Revision: 257514
URL: http://svnweb.freebsd.org/changeset/base/257514

Log:
  small cleanup for building picobsd-head without CLANG.
  
  Note that svn 257268 gnu/usr.bin/binutils/ld/Makefile
  seems to break the "toolchain" target when building HEAD
  on RELENG_9, so until this is solved you may want to
  
  svn update -r 257267 gnu/usr.bin/binutils/ld/Makefile
  
  before building picobsd

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==
--- head/release/picobsd/build/picobsd  Fri Nov  1 17:39:59 2013
(r257513)
+++ head/release/picobsd/build/picobsd  Fri Nov  1 18:29:27 2013
(r257514)
@@ -166,12 +166,6 @@ create_includes_and_libraries2() { # opt
 log "create_includes_and_libraries2() for ${SRC} $1"
 if [ ${OSVERSION} -ge 60 ] ; then
no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1"
-   #no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION"
-   # XXX 20131001 see if clang fixes the build
-   export WITHOUT_CLANG=YES
-   export WITHOUT_ICONV=YES
-   export WITH_GCC=YES
-   export WITH_GNUCXX=YES
no="$no -DMALLOC_PRODUCTION"
 else
no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R"
@@ -981,15 +975,16 @@ set_build_parameters() {
export MAKEOBJDIRPREFIX=${l_objtree}
export TARGET_ARCH=${o_arch} TARGET=${o_arch}
# XXX 20131001 see if CLANG fixes the build
-   # XXX export WITHOUT_CLANG_IS_CC=1
-   export WITHOUT_CLANG=YES
-   export WITHOUT_ICONV=YES
-   export WITH_GCC=YES
-   export WITH_GNUCXX=YES
+   export WITHOUT_CLANG_IS_CC=yes
+   export WITH_GCC=yes
+   export WITH_GNUCXX=yes
+   export WITHOUT_CLANG=yes
+   export WITHOUT_ICONV=yes
 
# XXX why change machine_arch ?
#-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m`
# export CWARNFLAGS="-Wextra -Wno-sign-compare 
-Wno-missing-field-initializers"
+   # XXX BINMAKE does not really exist anymore
eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\""
[ "$BINMAKE" = "" ] && \
   eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V SUB_MAKE`\""
___
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: r257515 - in head/sys/dev/xen: netback netfront

2013-11-01 Thread Gleb Smirnoff
Author: glebius
Date: Fri Nov  1 18:42:03 2013
New Revision: 257515
URL: http://svnweb.freebsd.org/changeset/base/257515

Log:
  Somehow fix LINT-NOIP.

Modified:
  head/sys/dev/xen/netback/netback.c
  head/sys/dev/xen/netback/netback_unit_tests.c
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netback/netback.c
==
--- head/sys/dev/xen/netback/netback.c  Fri Nov  1 18:29:27 2013
(r257514)
+++ head/sys/dev/xen/netback/netback.c  Fri Nov  1 18:42:03 2013
(r257515)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
  *   from this FreeBSD domain to other domains.
  */
 #include "opt_inet.h"
+#include "opt_inet6.h"
 #include "opt_global.h"
 
 #include "opt_sctp.h"
@@ -184,7 +185,6 @@ static int  xnb_rxpkt2gnttab(const struct
 static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt,
  const gnttab_copy_table gnttab, int n_entries,
  netif_rx_back_ring_t *ring);
-static voidxnb_add_mbuf_cksum(struct mbuf *mbufc);
 static voidxnb_stop(struct xnb_softc*);
 static int xnb_ioctl(struct ifnet*, u_long, caddr_t);
 static voidxnb_start_locked(struct ifnet*);
@@ -195,6 +195,9 @@ static void xnb_ifinit(void*);
 static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS);
 static int xnb_dump_rings(SYSCTL_HANDLER_ARGS);
 #endif
+#if defined(INET) || defined(INET6)
+static voidxnb_add_mbuf_cksum(struct mbuf *mbufc);
+#endif
 /*-- Data Structures 
-*/
 
 
@@ -1779,7 +1782,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con
}
mbufc->m_pkthdr.len = total_size;
 
+#if defined(INET) || defined(INET6)
xnb_add_mbuf_cksum(mbufc);
+#endif
 }
 
 /**
@@ -2122,6 +2127,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt,
return n_responses;
 }
 
+#if defined(INET) || defined(INET6)
 /**
  * Add IP, TCP, and/or UDP checksums to every mbuf in a chain.  The first mbuf
  * in the chain must start with a struct ether_header.
@@ -2176,6 +2182,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc)
break;
}
 }
+#endif /* INET || INET6 */
 
 static void
 xnb_stop(struct xnb_softc *xnb)

Modified: head/sys/dev/xen/netback/netback_unit_tests.c
==
--- head/sys/dev/xen/netback/netback_unit_tests.c   Fri Nov  1 18:29:27 
2013(r257514)
+++ head/sys/dev/xen/netback/netback_unit_tests.c   Fri Nov  1 18:42:03 
2013(r257515)
@@ -104,10 +104,6 @@ struct test_fixture {
 
 typedef struct test_fixture test_fixture_t;
 
-static voidxnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len,
-  uint16_t ip_id, uint16_t ip_p,
-  uint16_t ip_off, uint16_t ip_sum);
-static voidxnb_fill_tcp(struct mbuf *m);
 static int xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags);
 static int xnb_unit_test_runner(test_fixture_t const tests[], int ntests,
 char *buffer, size_t buflen);
@@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra;
 static testcase_t xnb_rxpkt2rsp_2short;
 static testcase_t xnb_rxpkt2rsp_2slots;
 static testcase_t xnb_rxpkt2rsp_copyerror;
+static testcase_t xnb_sscanf_llu;
+static testcase_t xnb_sscanf_lld;
+static testcase_t xnb_sscanf_hhu;
+static testcase_t xnb_sscanf_hhd;
+static testcase_t xnb_sscanf_hhn;
+
+#if defined(INET) || defined(INET6)
 /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */
 static testcase_t xnb_add_mbuf_cksum_arp;
 static testcase_t xnb_add_mbuf_cksum_tcp;
 static testcase_t xnb_add_mbuf_cksum_udp;
 static testcase_t xnb_add_mbuf_cksum_icmp;
 static testcase_t xnb_add_mbuf_cksum_tcp_swcksum;
-static testcase_t xnb_sscanf_llu;
-static testcase_t xnb_sscanf_lld;
-static testcase_t xnb_sscanf_hhu;
-static testcase_t xnb_sscanf_hhd;
-static testcase_t xnb_sscanf_hhn;
+static voidxnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len,
+  uint16_t ip_id, uint16_t ip_p,
+  uint16_t ip_off, uint16_t ip_sum);
+static voidxnb_fill_tcp(struct mbuf *m);
+#endif /* INET || INET6 */
 
 /** Private data used by unit tests */
 static struct {
@@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) 
{setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data},
{setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data},
{setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data},
+#if defined(INET) || defined(INET6)
{null_setup, xnb_add_mbuf_cksum_arp, null_teardown},
{null_setup, xnb_add_mbuf_cksum_icmp, null_teardown},
{null_setup, xnb_add_mbuf_cksum_tcp, null_teardown},
{null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown},
{null_setup

svn commit: r257516 - head/share/misc

2013-11-01 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Nov  1 18:55:56 2013
New Revision: 257516
URL: http://svnweb.freebsd.org/changeset/base/257516

Log:
  OpenBSD 5.4 added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Fri Nov  1 18:42:03 2013
(r257515)
+++ head/share/misc/bsd-family-tree Fri Nov  1 18:55:56 2013
(r257516)
@@ -283,7 +283,7 @@ FreeBSD 5.2   |  |  
  | |  |  |   | |   |
  |  FreeBSD   |  |NetBSD 6.1.2 |   |
  |9.2  Mac OS X  | |   |
- |   10.9| |   |
+ |   10.9|OpenBSD 5.4  |
  ||  | |   |
  ||  | |   |
  ||  | |   |
@@ -602,6 +602,7 @@ FreeBSD 9.2 2013-09-30 [FBD]
 NetBSD 6.0.3   2013-09-30 [NBD]
 NetBSD 6.1.2   2013-09-30 [NBD]
 Mac OS X 10.9  2013-10-22 [APL]
+OpenBSD 5.42013-11-01 [OBD]
 
 Bibliography
 
___
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: r257518 - in head/sys: arm/ti boot/fdt/dts

2013-11-01 Thread Ian Lepore
Author: ian
Date: Fri Nov  1 19:22:06 2013
New Revision: 257518
URL: http://svnweb.freebsd.org/changeset/base/257518

Log:
  TI sdhci driver improvements, mostly related to fdt data...
  
  Use the published compatible strings (our own invention, "ti,mmchs" is
  still accepted as well, for now).
  
  Don't blindly turn on 8-bit bus mode, because even though the conroller
  supports it, the board has to be wired appropriately as well.  Use the
  published property (bus-width=) and honor all the valid values (1,4,8).
  
  The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts.
  
  The mmchs controller can inherently do both 1.8v and 3.0v on the first
  device and 1.8v only on other devices, unless an external transceiver is
  used.  Set the voltage automatically for the first device and honor
  the published fdt property (ti,dualvolt) for other devices.
  
  Thanks go to Ilya Bakulin for figuring out the voltage compatibility stuff.

Modified:
  head/sys/arm/ti/ti_sdhci.c
  head/sys/boot/fdt/dts/am335x.dtsi
  head/sys/boot/fdt/dts/beaglebone-black.dts

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Fri Nov  1 19:19:47 2013(r257517)
+++ head/sys/arm/ti/ti_sdhci.c  Fri Nov  1 19:22:06 2013(r257518)
@@ -75,6 +75,21 @@ struct ti_sdhci_softc {
 };
 
 /*
+ * Table of supported FDT compat strings.
+ *
+ * Note that "ti,mmchs" is our own invention, and should be phased out in favor
+ * of the documented names.
+ *
+ * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x.
+ */
+static struct ofw_compat_data compat_data[] = {
+   {"ti,omap3-hsmmc",  1},
+   {"ti,omap4-hsmmc",  1},
+   {"ti,mmchs",1},
+   {NULL,  0},
+};
+
+/*
  * The MMCHS hardware has a few control and status registers at the beginning 
of
  * the device's memory map, followed by the standard sdhci register block.
  * Different SoCs have the register blocks at different offsets from the
@@ -93,6 +108,10 @@ struct ti_sdhci_softc {
 #defineMMCHS_CON   0x02C
 #define  MMCHS_CON_DW8   (1 << 5)
 #define  MMCHS_CON_DVAL_8_4MS(3 << 9)
+#defineMMCHS_SD_CAPA   0x240
+#define  MMCHS_SD_CAPA_VS18  (1 << 26)
+#define  MMCHS_SD_CAPA_VS30  (1 << 25)
+#define  MMCHS_SD_CAPA_VS33  (1 << 24)
 
 static inline uint32_t
 ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off)
@@ -320,6 +339,7 @@ ti_sdhci_hw_init(device_t dev)
 {
struct ti_sdhci_softc *sc = device_get_softc(dev);
clk_ident_t clk;
+   uint32_t regval;
unsigned long timeout;
 
/* Enable the controller and interface/functional clocks */
@@ -357,6 +377,21 @@ ti_sdhci_hw_init(device_t dev)
DELAY(100);
}
 
+   /*
+* The attach() routine has examined fdt data and set flags in
+* slot.host.caps to reflect what voltages we can handle.  Set those
+* values in the CAPA register.  The manual says that these values can
+* only be set once, "before initialization" whatever that means, and
+* that they survive a reset.  So maybe doing this will be a no-op if
+* u-boot has already initialized the hardware.
+*/
+   regval = ti_mmchs_read_4(sc, MMCHS_SD_CAPA);
+   if (sc->slot.host.caps & MMC_OCR_LOW_VOLTAGE)
+   regval |= MMCHS_SD_CAPA_VS18;
+   if (sc->slot.host.caps & (MMC_OCR_290_300 | MMC_OCR_300_310))
+   regval |= MMCHS_SD_CAPA_VS30;
+   ti_mmchs_write_4(sc, MMCHS_SD_CAPA, regval);
+
/* Set initial host configuration (1-bit, std speed, pwr off). */
ti_sdhci_write_1(dev, NULL, SDHCI_HOST_CONTROL, 0);
ti_sdhci_write_1(dev, NULL, SDHCI_POWER_CONTROL, 0);
@@ -378,7 +413,8 @@ ti_sdhci_attach(device_t dev)
/*
 * Get the MMCHS device id from FDT.  If it's not there use the newbus
 * unit number (which will work as long as the devices are in order and
-* none are skipped in the fdt).
+* none are skipped in the fdt).  Note that this is a property we made
+* up and added in freebsd, it doesn't exist in the published bindings.
 */
node = ofw_bus_get_node(dev);
if ((OF_getprop(node, "mmchs-device-id", &prop, sizeof(prop))) <= 0) {
@@ -388,7 +424,23 @@ ti_sdhci_attach(device_t dev)
} else
sc->mmchs_device_id = fdt32_to_cpu(prop);
 
-   /* See if we've got a GPIO-based write detect pin. */
+   /*
+* The hardware can inherently do dual-voltage (1p8v, 3p0v) on the first
+* device, and only 1p8v on other devices unless an external transceiver
+* is used.  The only way we could know about a transceiver is fdt data.
+* Note that we have to do this before cal

svn commit: r257519 - head/sys/arm/ti

2013-11-01 Thread Ian Lepore
Author: ian
Date: Fri Nov  1 19:29:59 2013
New Revision: 257519
URL: http://svnweb.freebsd.org/changeset/base/257519

Log:
  The ability to do 8-bit implies 4-bit capability too.  Rearrange the cases
  and add a fallthrough comment to make that happen.

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

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Fri Nov  1 19:22:06 2013(r257518)
+++ head/sys/arm/ti/ti_sdhci.c  Fri Nov  1 19:29:59 2013(r257519)
@@ -546,16 +546,17 @@ ti_sdhci_attach(device_t dev)
sc->slot.host.caps &= ~(MMC_CAP_4_BIT_DATA | 
MMC_CAP_8_BIT_DATA);
switch (prop) {
-   case 1:
-   break;
+   case 8:
+   sc->slot.host.caps |= MMC_CAP_8_BIT_DATA;
+   /* FALLTHROUGH */
case 4:
sc->slot.host.caps |= MMC_CAP_4_BIT_DATA;
break;
-   case 8:
-   sc->slot.host.caps |= MMC_CAP_8_BIT_DATA;
+   case 1:
break;
default:
device_printf(dev, "Bad bus-width value %u\n", prop);
+   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"


Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Brooks Davis
On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote:
> On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote:
> > On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote:
> > > as per the subject, after this commit building head on stable/9
> > > fails with the error below:
> > > 
> > > ===> lib/libpam/modules/pam_krb5 (all)
> > > make: don't know how to make
> > > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
> > > Stop
> > > 
> > > reverting the commit fixes the build.
> > > 
> > > Any idea how this can be fixed ?
> > 
> > I just built world and kernel with a freshly checked out head on
> > ref9-amd64 so I supect something in your environment.  This change
> > should only impact the installed copy of ld which would have no effect
> > on a 9-stable system.  Any portion of the build system using a version
> > effected by this change is broken since only the cross build version
> > should be used and that one will have it's own sysroot value as always
> > it always has.
> 
> ok so what happens is the following (trying to build HEAD on 9.2, both amd64)
> 
> - WITHOUT_CLANG and related options:
> "make toolchain"  fails with the error on krb5
> "make buildworld" works, and a subsequent
>   "make toolchain" also works
> 
> - without options (so compiling CLANG)
> 
> "make toolchain"  fails with the error below
> 
> building shared library libc.so.7
> /usr/bin/ld: this linker was not configured to use sysroots
> cc: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> *** [libc.so.7] Error code 1
> 1 error
> *** [all] Error code 2
> 1 error
> 
> 
> "make toolchain" on an empty tree used to work until before this commit,
> and does work if i revert this single change
> 
> So does this mean that 'toolchain' now has some prerequisites ?

I think I've found it.  I tried the last one first since it was the most
bizzare and about 40 lines up there was fairly obvious error output that
told me what was wrong.  The issue is that the :U modifer I used is a
bmake feature and that the toolchain target doesn't bootstrap bmake (or
perhaps doesn't do it early enough).  I plan to commit a workaround for
this particular case, but we probably need to alter the toolchain and
kernel-toolchain targets to bootstrap bmake on older systems or we'll
run into this again with some future change somewhere else.

-- Brooks


pgpLx4IbLS03k.pgp
Description: PGP signature


svn commit: r257525 - in head/sys: dev/random net sys

2013-11-01 Thread Adrian Chadd
Author: adrian
Date: Fri Nov  1 20:53:49 2013
New Revision: 257525
URL: http://svnweb.freebsd.org/changeset/base/257525

Log:
  Convert the random entropy harvesting code to use a const void * pointer
  rather than just void *.
  
  Then, as part of this, convert a couple of mbuf m->m_data accesses
  to mtod(m, const void *).
  
  Reviewed by:  markm
  Approved by:  security-officer (delphij)
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/dev/random/harvest.c
  head/sys/net/bpf.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_tun.c
  head/sys/sys/random.h

Modified: head/sys/dev/random/harvest.c
==
--- head/sys/dev/random/harvest.c   Fri Nov  1 20:33:30 2013
(r257524)
+++ head/sys/dev/random/harvest.c   Fri Nov  1 20:53:49 2013
(r257525)
@@ -86,7 +86,7 @@ randomdev_deinit_harvester(void)
  * read which can be quite expensive.
  */
 void
-random_harvest(void *entropy, u_int count, u_int bits, enum esource origin)
+random_harvest(const void *entropy, u_int count, u_int bits, enum esource 
origin)
 {
if (reap_func)
(*reap_func)(get_cyclecount(), entropy, count, bits, origin);

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Fri Nov  1 20:33:30 2013(r257524)
+++ head/sys/net/bpf.c  Fri Nov  1 20:53:49 2013(r257525)
@@ -577,7 +577,7 @@ bpf_movein(struct uio *uio, int linktype
goto bad;
}
}
-   bcopy(m->m_data, sockp->sa_data, hlen);
+   bcopy(mtod(m, const void *), sockp->sa_data, hlen);
}
*hdrlen = hlen;
 

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Fri Nov  1 20:33:30 2013(r257524)
+++ head/sys/net/if_ethersubr.c Fri Nov  1 20:53:49 2013(r257525)
@@ -642,7 +642,7 @@ ether_input_internal(struct ifnet *ifp, 
}
 
if (harvest.ethernet)
-   random_harvest(&(m->m_data), 12, 2, RANDOM_NET_ETHER);
+   random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_ETHER);
 
ether_demux(ifp, m);
CURVNET_RESTORE();

Modified: head/sys/net/if_tun.c
==
--- head/sys/net/if_tun.c   Fri Nov  1 20:33:30 2013(r257524)
+++ head/sys/net/if_tun.c   Fri Nov  1 20:53:49 2013(r257525)
@@ -919,7 +919,7 @@ tunwrite(struct cdev *dev, struct uio *u
return (EAFNOSUPPORT);
}
if (harvest.point_to_point)
-   random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN);
+   random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_TUN);
ifp->if_ibytes += m->m_pkthdr.len;
ifp->if_ipackets++;
CURVNET_SET(ifp->if_vnet);

Modified: head/sys/sys/random.h
==
--- head/sys/sys/random.h   Fri Nov  1 20:33:30 2013(r257524)
+++ head/sys/sys/random.h   Fri Nov  1 20:53:49 2013(r257525)
@@ -58,7 +58,7 @@ enum esource {
RANDOM_PURE_RNDTEST,
ENTROPYSOURCE
 };
-void random_harvest(void *, u_int, u_int, enum esource);
+void random_harvest(const void *, u_int, u_int, enum esource);
 
 /* Allow the sysadmin to select the broad category of
  * entropy types to harvest
___
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: r257529 - in head: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap

2013-11-01 Thread Luigi Rizzo
Author: luigi
Date: Fri Nov  1 21:21:14 2013
New Revision: 257529
URL: http://svnweb.freebsd.org/changeset/base/257529

Log:
  update to the latest netmap snapshot.
  This includes the following:
  - use separate memory regions for VALE ports
  - locking fixes
  - some simplifications in the NIC-specific routines
  - performance improvements for the VALE switch
  - some new features in the pkt-gen test program
  - documentation updates
  
  There are small API changes that require programs to be recompiled
  (NETMAP_API has been bumped so you will detect old binaries at runtime).
  
  In particular:
  - struct netmap_slot now is 16 bytes to support an extra pointer,
which may save one data copy when using VALE ports or VMs;
  - the struct netmap_if has two extra fields;
  
  MFC after:3 days

Modified:
  head/share/man/man4/netmap.4
  head/sys/conf/files
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/e1000/if_lem.h
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/netmap/if_em_netmap.h
  head/sys/dev/netmap/if_igb_netmap.h
  head/sys/dev/netmap/if_lem_netmap.h
  head/sys/dev/netmap/if_re_netmap.h
  head/sys/dev/netmap/ixgbe_netmap.h
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_kern.h
  head/sys/dev/netmap/netmap_mem2.c
  head/sys/dev/re/if_re.c
  head/sys/net/netmap.h
  head/tools/tools/netmap/nm_util.c
  head/tools/tools/netmap/pkt-gen.c

Modified: head/share/man/man4/netmap.4
==
--- head/share/man/man4/netmap.4Fri Nov  1 21:17:45 2013
(r257528)
+++ head/share/man/man4/netmap.4Fri Nov  1 21:21:14 2013
(r257529)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa
+.\" Copyright (c) 2011-2013 Matteo Landi, Luigi Rizzo, Universita` di Pisa
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -21,14 +21,13 @@
 .\" 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.
-.\" 
+.\"
 .\" This document is derived in part from the enet man page (enet.4)
 .\" distributed with 4.3BSD Unix.
 .\"
 .\" $FreeBSD$
-.\" $Id: netmap.4 11563 2012-08-02 08:59:12Z luigi $: 
stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $
 .\"
-.Dd September 23, 2013
+.Dd October 18, 2013
 .Dt NETMAP 4
 .Os
 .Sh NAME
@@ -38,101 +37,230 @@
 .Cd device netmap
 .Sh DESCRIPTION
 .Nm
-is a framework for fast and safe access to network devices
-(reaching 14.88 Mpps at less than 1 GHz).
-.Nm
-uses memory mapped buffers and metadata
-(buffer indexes and lengths) to communicate with the kernel,
-which is in charge of validating information through
-.Pa ioctl()
-and
-.Pa select()/poll().
+is a framework for extremely fast and efficient packet I/O
+(reaching 14.88 Mpps with a single core at less than 1 GHz)
+for both userspace and kernel clients.
+Userspace clients can use the netmap API
+to send and receive raw packets through physical interfaces
+or ports of the
+.Xr VALE 4
+switch.
+.Pp
+.Nm VALE
+is a very fast (reaching 20 Mpps per port)
+and modular software switch,
+implemented within the kernel, which can interconnect
+virtual ports, physical devices, and the native host stack.
+.Pp
+.Nm
+uses a memory mapped region to share packet buffers,
+descriptors and queues with the kernel.
+Simple
+.Pa ioctl()s
+are used to bind interfaces/ports to file descriptors and
+implement non-blocking I/O, whereas blocking I/O uses
+.Pa select()/poll() .
 .Nm
 can exploit the parallelism in multiqueue devices and
 multicore systems.
 .Pp
+For the best performance,
+.Nm
+requires explicit support in device drivers;
+a generic emulation layer is available to implement the
 .Nm
-requires explicit support in device drivers.
-For a list of supported devices, see the end of this manual page.
-.Sh OPERATION
+API on top of unmodified device drivers,
+at the price of reduced performance
+(but still better than what can be achieved with
+sockets or BPF/pcap).
+.Pp
+For a list of devices with native
 .Nm
-clients must first open the
+support, see the end of this manual page.
+.Pp
+.Sh OPERATION - THE NETMAP API
+.Nm
+clients must first
 .Pa open("/dev/netmap") ,
 and then issue an
-.Pa ioctl(...,NIOCREGIF,...)
-to bind the file descriptor to a network device.
-.Pp
-When a device is put in
+.Pa ioctl(fd, NIOCREGIF, (struct nmreq *)arg)
+to bind the file descriptor to a specific interface or port.
 .Nm
-mode, its data path is disconnected from the host stack.
-The processes owning the file descriptor
-can exchange packets with the device, or with the host stack,
-through an mmapped memory region that contains pre-allocated
-buffers and metadata.
+has multiple modes of operation controlled by the
+content of the
+.Pa struct nmreq
+passed to the
+.Pa ioctl() .
+In particular, the
+.Em nr_n

Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Luigi Rizzo
On Fri, Nov 01, 2013 at 03:48:48PM -0500, Brooks Davis wrote:
> On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote:
...
> > ok so what happens is the following (trying to build HEAD on 9.2, both 
> > amd64)
> > 
> > - WITHOUT_CLANG and related options:
> > "make toolchain"fails with the error on krb5
> > "make buildworld"   works, and a subsequent
> > "make toolchain" also works
> > 
> > - without options (so compiling CLANG)
> > 
> > "make toolchain"fails with the error below
> > 
> > building shared library libc.so.7
> > /usr/bin/ld: this linker was not configured to use sysroots
> > cc: error: linker command failed with exit code 1 (use -v to see 
> > invocation)
> > *** [libc.so.7] Error code 1
> > 1 error
> > *** [all] Error code 2
> > 1 error
> > 
> > 
> > "make toolchain" on an empty tree used to work until before this commit,
> > and does work if i revert this single change
> > 
> > So does this mean that 'toolchain' now has some prerequisites ?
> 
> I think I've found it.  I tried the last one first since it was the most
> bizzare and about 40 lines up there was fairly obvious error output that
> told me what was wrong.  The issue is that the :U modifer I used is a
> bmake feature and that the toolchain target doesn't bootstrap bmake (or
> perhaps doesn't do it early enough).  I plan to commit a workaround for
> this particular case, but we probably need to alter the toolchain and
> kernel-toolchain targets to bootstrap bmake on older systems or we'll
> run into this again with some future change somewhere else.

yes, bootstrapping bmake early seems a future-proof way to handle this.

Thanks a lot for following up

cheers
luigi
___
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: r257530 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Brooks Davis
Author: brooks
Date: Fri Nov  1 22:03:20 2013
New Revision: 257530
URL: http://svnweb.freebsd.org/changeset/base/257530

Log:
  Reimplement r257525 such that it work with the historic FreeBSD make
  implementation.  This fixes the toolchain and kernel-toolchain targets
  when building from older FreeBSD versions where make is fmake.
  
  Reported by:  luigi
  Sponsored by: DARPA/AFRL
  MFC after:3 days

Modified:
  head/gnu/usr.bin/binutils/ld/Makefile

Modified: head/gnu/usr.bin/binutils/ld/Makefile
==
--- head/gnu/usr.bin/binutils/ld/Makefile   Fri Nov  1 21:21:14 2013
(r257529)
+++ head/gnu/usr.bin/binutils/ld/Makefile   Fri Nov  1 22:03:20 2013
(r257530)
@@ -31,7 +31,12 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
 CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
-CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\"
+CFLAGS+= -DBINDIR=\"${BINDIR}\"
+.if defined(TOOLS_PREFIX)
+CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
+.else
+CFLAGS+= -DTARGET_SYSTEM_ROOT=\"/\"
+.endif
 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\"
 CFLAGS+= -D_GNU_SOURCE
 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
___
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: r257531 - head/sbin/nvmecontrol

2013-11-01 Thread Jim Harris
Author: jimharris
Date: Fri Nov  1 22:05:29 2013
New Revision: 257531
URL: http://svnweb.freebsd.org/changeset/base/257531

Log:
  Do not exit with error status after printing data for perftest.
  
  Sponsored by: Intel
  Reported by:  Joe Golio 
  MFC after:3 days

Modified:
  head/sbin/nvmecontrol/perftest.c

Modified: head/sbin/nvmecontrol/perftest.c
==
--- head/sbin/nvmecontrol/perftest.cFri Nov  1 22:03:20 2013
(r257530)
+++ head/sbin/nvmecontrol/perftest.cFri Nov  1 22:05:29 2013
(r257531)
@@ -64,8 +64,6 @@ print_perftest(struct nvme_io_test *io_t
for (i = 0; i < io_test->num_threads; i++)
printf("\t%3d: %8ju IO/s\n", i,
(uintmax_t)io_test->io_completed[i]/io_test->time);
-
-   exit(1);
 }
 
 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"


Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-11-01 Thread Brooks Davis
On Fri, Nov 01, 2013 at 10:32:54PM +0100, Luigi Rizzo wrote:
> On Fri, Nov 01, 2013 at 03:48:48PM -0500, Brooks Davis wrote:
> > On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote:
> ...
> > > ok so what happens is the following (trying to build HEAD on 9.2, both 
> > > amd64)
> > > 
> > > - WITHOUT_CLANG and related options:
> > > "make toolchain"  fails with the error on krb5
> > > "make buildworld" works, and a subsequent
> > >   "make toolchain" also works
> > > 
> > > - without options (so compiling CLANG)
> > > 
> > > "make toolchain"  fails with the error below
> > > 
> > > building shared library libc.so.7
> > > /usr/bin/ld: this linker was not configured to use sysroots
> > > cc: error: linker command failed with exit code 1 (use -v to see 
> > > invocation)
> > > *** [libc.so.7] Error code 1
> > > 1 error
> > > *** [all] Error code 2
> > > 1 error
> > > 
> > > 
> > > "make toolchain" on an empty tree used to work until before this commit,
> > > and does work if i revert this single change
> > > 
> > > So does this mean that 'toolchain' now has some prerequisites ?
> > 
> > I think I've found it.  I tried the last one first since it was the most
> > bizzare and about 40 lines up there was fairly obvious error output that
> > told me what was wrong.  The issue is that the :U modifer I used is a
> > bmake feature and that the toolchain target doesn't bootstrap bmake (or
> > perhaps doesn't do it early enough).  I plan to commit a workaround for
> > this particular case, but we probably need to alter the toolchain and
> > kernel-toolchain targets to bootstrap bmake on older systems or we'll
> > run into this again with some future change somewhere else.
> 
> yes, bootstrapping bmake early seems a future-proof way to handle this.

I've committed a workaround for HEAD that I'll MFC soon on the basis
that we in theory have infrastructure to support WITHOUT_BMAKE.
(In practice WITHOUT_BMAKE is broken and corrupts your object tree with a
make that fails until manually deleted.)  We should decide if it should
be fixed or removed before 10 goes out.

-- Brooks


pgpbnywNNKZKz.pgp
Description: PGP signature


svn commit: r257532 - head/tools/tools/ath/athstats

2013-11-01 Thread Adrian Chadd
Author: adrian
Date: Fri Nov  1 22:38:58 2013
New Revision: 257532
URL: http://svnweb.freebsd.org/changeset/base/257532

Log:
  Fix this build for clang.

Modified:
  head/tools/tools/ath/athstats/Makefile

Modified: head/tools/tools/ath/athstats/Makefile
==
--- head/tools/tools/ath/athstats/Makefile  Fri Nov  1 22:05:29 2013
(r257531)
+++ head/tools/tools/ath/athstats/Makefile  Fri Nov  1 22:38:58 2013
(r257532)
@@ -1,12 +1,16 @@
 # $FreeBSD$
 
+NO_MAN=1
+
+.include 
+
 .PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal
 
 PROG=  athstats
 
 # Because of a clang preprocessor parser limitation causing this
 # to not compile, use gcc for now.
-CC=gcc
+#CC=   gcc
 
 SRCS=  main.c statfoo.c athstats.c opt_ah.h ah_osdep.h
 
@@ -17,6 +21,10 @@ CLEANFILES+= opt_ah.h
 CFLAGS+=-DATH_SUPPORT_ANI
 CFLAGS+=-DATH_SUPPORT_TDMA
 
+.if (${COMPILER_TYPE} == "clang")
+CFLAGS+=-fbracket-depth=512
+.endif
+
 opt_ah.h:
echo "#define AH_DEBUG 1" > opt_ah.h
echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.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: r257534 - head/sys/dev/nvme

2013-11-01 Thread Jim Harris
Author: jimharris
Date: Fri Nov  1 23:30:54 2013
New Revision: 257534
URL: http://svnweb.freebsd.org/changeset/base/257534

Log:
  Create a unique unit number for each controller and namespace cdev.
  
  Sponsored by: Intel
  MFC after:3 days

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Fri Nov  1 22:55:11 2013
(r257533)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Fri Nov  1 23:30:54 2013
(r257534)
@@ -1150,8 +1150,8 @@ intx:
if (status != 0)
return (status);
 
-   ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
-   "nvme%d", device_get_unit(dev));
+   ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, device_get_unit(dev),
+   UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev));
 
if (ctrlr->cdev == NULL)
return (ENXIO);

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Fri Nov  1 22:55:11 2013(r257533)
+++ head/sys/dev/nvme/nvme_ns.c Fri Nov  1 23:30:54 2013(r257534)
@@ -492,6 +492,7 @@ nvme_ns_construct(struct nvme_namespace 
 struct nvme_controller *ctrlr)
 {
struct nvme_completion_poll_status  status;
+   int unit;
 
ns->ctrlr = ctrlr;
ns->id = id;
@@ -553,6 +554,12 @@ nvme_ns_construct(struct nvme_namespace 
if (ns->cdev != NULL)
return (0);
 
+   /*
+* Namespace IDs start at 1, so we need to subtract 1 to create a
+*  correct unit number.
+*/
+   unit = device_get_unit(ctrlr->dev) * NVME_MAX_NAMESPACES + ns->id - 1;
+
 /*
  * MAKEDEV_ETERNAL was added in r210923, for cdevs that will never
  *  be destroyed.  This avoids refcounting on the cdev object.
@@ -560,11 +567,11 @@ nvme_ns_construct(struct nvme_namespace 
  *  surprise removal nor namespace deletion.
  */
 #ifdef MAKEDEV_ETERNAL_KLD
-   ns->cdev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &nvme_ns_cdevsw, 0,
+   ns->cdev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &nvme_ns_cdevsw, unit,
NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d",
device_get_unit(ctrlr->dev), ns->id);
 #else
-   ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, 0,
+   ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, unit,
NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d",
device_get_unit(ctrlr->dev), ns->id);
 #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: r257535 - head/sys/netgraph

2013-11-01 Thread Adrian Chadd
Author: adrian
Date: Sat Nov  2 00:11:38 2013
New Revision: 257535
URL: http://svnweb.freebsd.org/changeset/base/257535

Log:
  Teach the netgraph code to use a const char * pointer too.
  
  Pointy hat to: adrian

Modified:
  head/sys/netgraph/ng_iface.c

Modified: head/sys/netgraph/ng_iface.c
==
--- head/sys/netgraph/ng_iface.cFri Nov  1 23:30:54 2013
(r257534)
+++ head/sys/netgraph/ng_iface.cSat Nov  2 00:11:38 2013
(r257535)
@@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite
return (EAFNOSUPPORT);
}
if (harvest.point_to_point)
-   random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG);
+   random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG);
M_SETFIB(m, ifp->if_fib);
netisr_dispatch(isr, m);
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: r257537 - head/sys/dev/netmap

2013-11-01 Thread Luigi Rizzo
Author: luigi
Date: Sat Nov  2 00:54:47 2013
New Revision: 257537
URL: http://svnweb.freebsd.org/changeset/base/257537

Log:
  add missing file from previous netmap update...

Added:
  head/sys/dev/netmap/netmap_mem2.h   (contents, props changed)

Added: head/sys/dev/netmap/netmap_mem2.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/netmap/netmap_mem2.h   Sat Nov  2 00:54:47 2013
(r257537)
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. 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$
+ *
+ * (New) memory allocator for netmap
+ */
+
+/*
+ * This allocator creates three memory pools:
+ * nm_if_pool  for the struct netmap_if
+ * nm_ring_poolfor the struct netmap_ring
+ * nm_buf_pool for the packet buffers.
+ *
+ * that contain netmap objects. Each pool is made of a number of clusters,
+ * multiple of a page size, each containing an integer number of objects.
+ * The clusters are contiguous in user space but not in the kernel.
+ * Only nm_buf_pool needs to be dma-able,
+ * but for convenience use the same type of allocator for all.
+ *
+ * Once mapped, the three pools are exported to userspace
+ * as a contiguous block, starting from nm_if_pool. Each
+ * cluster (and pool) is an integral number of pages.
+ *   [ . . . ][ . . . . . .][ . . . . . . . . . .]
+ *nm_if nm_ringnm_buf
+ *
+ * The userspace areas contain offsets of the objects in userspace.
+ * When (at init time) we write these offsets, we find out the index
+ * of the object, and from there locate the offset from the beginning
+ * of the region.
+ *
+ * The invididual allocators manage a pool of memory for objects of
+ * the same size.
+ * The pool is split into smaller clusters, whose size is a
+ * multiple of the page size. The cluster size is chosen
+ * to minimize the waste for a given max cluster size
+ * (we do it by brute force, as we have relatively few objects
+ * per cluster).
+ *
+ * Objects are aligned to the cache line (64 bytes) rounding up object
+ * sizes when needed. A bitmap contains the state of each object.
+ * Allocation scans the bitmap; this is done only on attach, so we are not
+ * too worried about performance
+ *
+ * For each allocator we can define (thorugh sysctl) the size and
+ * number of each object. Memory is allocated at the first use of a
+ * netmap file descriptor, and can be freed when all such descriptors
+ * have been released (including unmapping the memory).
+ * If memory is scarce, the system tries to get as much as possible
+ * and the sysctl values reflect the actual allocation.
+ * Together with desired values, the sysctl export also absolute
+ * min and maximum values that cannot be overridden.
+ *
+ * struct netmap_if:
+ * variable size, max 16 bytes per ring pair plus some fixed amount.
+ * 1024 bytes should be large enough in practice.
+ *
+ * In the worst case we have one netmap_if per ring in the system.
+ *
+ * struct netmap_ring
+ * variable size, 8 byte per slot plus some fixed amount.
+ * Rings can be large (e.g. 4k slots, or >32Kbytes).
+ * We default to 36 KB (9 pages), and a few hundred rings.
+ *
+ * struct netmap_buffer
+ * The more the better, both because fast interfaces tend to have
+ * many slots, and because we may want to use buffers to store
+ * packets in userspace avoiding copies.
+ * Must contain a full frame (eg 1518, or more for vlans, jumbo
+ * frames etc.) plus be nicely aligned, plus some NICs restrict
+ * the size to multipl

svn commit: r257539 - head/sys/geom/eli

2013-11-01 Thread Xin LI
Author: delphij
Date: Sat Nov  2 01:16:10 2013
New Revision: 257539
URL: http://svnweb.freebsd.org/changeset/base/257539

Log:
  When zero'ing out a buffer, make sure we are using right size.
  
  Without this change, in the worst but unlikely case scenario, certain
  administrative operations, including change of configuration, set or
  delete key from a GEOM ELI provider, may leave potentially sensitive
  information in buffer allocated from kernel memory.
  
  We believe that it is not possible to actively exploit these issues, nor
  does it impact the security of normal usage of GEOM ELI providers when
  these operations are not performed after system boot.
  
  Security: possible sensitive information disclosure
  Submitted by: Clement Lecigne 
  MFC after:3 days

Modified:
  head/sys/geom/eli/g_eli_ctl.c

Modified: head/sys/geom/eli/g_eli_ctl.c
==
--- head/sys/geom/eli/g_eli_ctl.c   Sat Nov  2 01:03:14 2013
(r257538)
+++ head/sys/geom/eli/g_eli_ctl.c   Sat Nov  2 01:16:10 2013
(r257539)
@@ -471,7 +471,7 @@ g_eli_ctl_configure(struct gctl_req *req
prov, error);
}
bzero(&md, sizeof(md));
-   bzero(sector, sizeof(sector));
+   bzero(sector, pp->sectorsize);
free(sector, M_ELI);
}
 }
@@ -562,7 +562,7 @@ g_eli_ctl_setkey(struct gctl_req *req, s
 
/* Encrypt Master Key with the new key. */
error = g_eli_mkey_encrypt(md.md_ealgo, key, md.md_keylen, mkeydst);
-   bzero(key, sizeof(key));
+   bzero(key, keysize);
if (error != 0) {
bzero(&md, sizeof(md));
gctl_error(req, "Cannot encrypt Master Key (error=%d).", error);
@@ -575,7 +575,7 @@ g_eli_ctl_setkey(struct gctl_req *req, s
bzero(&md, sizeof(md));
error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector,
pp->sectorsize);
-   bzero(sector, sizeof(sector));
+   bzero(sector, pp->sectorsize);
free(sector, M_ELI);
if (error != 0) {
gctl_error(req, "Cannot store metadata on %s (error=%d).",
@@ -691,7 +691,7 @@ g_eli_ctl_delkey(struct gctl_req *req, s
(void)g_io_flush(cp);
}
bzero(&md, sizeof(md));
-   bzero(sector, sizeof(sector));
+   bzero(sector, pp->sectorsize);
free(sector, M_ELI);
if (*all)
G_ELI_DEBUG(1, "All keys removed from %s.", pp->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"


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

2013-11-01 Thread Bruce Evans

On Sat, 2 Nov 2013, Adrian Chadd wrote:


Log:
 Teach the netgraph code to use a const char * pointer too.


This actually fixes a much larger bug that was apparently accidentally
exposed by new const poisoning and new smaller type bugs.


 Pointy hat to: adrian


Outpointed by the previous bug.


Modified: head/sys/netgraph/ng_iface.c
==
--- head/sys/netgraph/ng_iface.cFri Nov  1 23:30:54 2013
(r257534)
+++ head/sys/netgraph/ng_iface.cSat Nov  2 00:11:38 2013
(r257535)
@@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite
return (EAFNOSUPPORT);
}
if (harvest.point_to_point)
-   random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG);


'&(m->m_data)' is not just a pair of style bugs.  It gives address of
the pointer (somewhere in the mbuf header), not the address of pointed-
to data, so the randomness was almost null.  The style bugs are
excessive parentheses and chumminess with the implementation (non-use
of the accessor function mtod()).


+   random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG);


Presumably you really do want to harvest the pointed-to data and there
are at least 12 bytes of it, so the semantic fix isn't backwards or a
buffer overrun.


M_SETFIB(m, ifp->if_fib);
netisr_dispatch(isr, m);
return (0);


const poisoning sometimes exposes garbage pointers accidentally.  It seems
to take a new design error (random_harvest() taking a const char * instead
of a const void *) for this bug to be detected.  random_harvest() used to
take a void * arg and the garbage pointer was automatically converted to
that.  Conversion to const void * would be just as automatic.

The log message says const char * but the code says const void *.  The
latter is correct, at least mtod() is used, since the mtod() API
unfortunately requires naming a type and const void * is the best type
to use here.  Then futher conversions apparently occur: if there is
actually a const char * anywhere, it is wrong, and if we convert this
const void * to it then we must convert to const u_char * to actually
access the data It is best for intermediate conversions to only go
through const void * and not expand the old design error of making them
go through caddr_t (for m_data).

Bruce
___
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: r257535 - head/sys/netgraph

2013-11-01 Thread Adrian Chadd
Hm! A good question!

On 1 November 2013 22:22, Bruce Evans  wrote:

>> if (harvest.point_to_point)
>> -   random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG);
>
>
> '&(m->m_data)' is not just a pair of style bugs.  It gives address of
> the pointer (somewhere in the mbuf header), not the address of pointed-
> to data, so the randomness was almost null.  The style bugs are
> excessive parentheses and chumminess with the implementation (non-use
> of the accessor function mtod()).
>
>
>> +   random_harvest(mtod(m, const void *), 12, 2,
>> RANDOM_NET_NG);
>
>
> Presumably you really do want to harvest the pointed-to data and there
> are at least 12 bytes of it, so the semantic fix isn't backwards or a
> buffer overrun.
>


Mark - did you initially mean the address of the mbuf m_data pointer,
or the data payload itself?



-adrian
___
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: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat

2013-11-01 Thread Stefan Neudorf
Konstantin Belousov  writes:

> On Wed, Oct 30, 2013 at 10:20:52PM +0100, Jilles Tjoelker wrote:
>
>> On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote:
>> > Konstantin Belousov  writes:
>> > > Modified: head/usr.bin/limits/limits.c
>> > > ==
>> > > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013
>> > > (r256849)
>> > > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013
>> > > (r256850)
>> 
>> > This adds limits -e support only for sh, csh, tcsh. What about other
>> > shells that already support sbsize and swapuse extensions?
>> 
>> This can be done later; the kqueue rlimit need not be gated on it.
>
> I definitely do not want to go over the {pd,}ksh, zsh, bash, rc and
> whatever else. Somebody who cares should contact the projects and
> propose the changes.

Ah, you didn't catch my hint. There's no kqueues rlimit in contrib/tcsh.
I've submitted one upstream but it'd take some time before the next
release appears and we can update.

http://mx.gw.com/pipermail/tcsh-bugs/2013-October/000844.html

Same for zsh which also has csh-like rlimits.

http://sourceforge.net/p/zsh/code/ci/790a4fe

___
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"