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

2013-10-25 Thread Mark Johnston
Author: markj
Date: Sat Oct 26 06:23:51 2013
New Revision: 257152
URL: http://svnweb.freebsd.org/changeset/base/257152

Log:
  Do some cleanup of the SDT code. In particular,
  
  * Remove the unused sdt cdev.
  * Don't bother keeping a list of probes in struct sdt_prov; it's not needed.
  * Invoke sdt_load and sdt_unload from the module handler instead of
registering separate SYSINITs.
  * Keep to within 80 columns.
  * Check for errors from dtrace_unregister().

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 Oct 26 03:55:29 2013(r257151)
+++ head/sys/cddl/dev/sdt/sdt.c Sat Oct 26 06:23:51 2013(r257152)
@@ -24,6 +24,21 @@
  *
  */
 
+/*
+ * This file contains a reimplementation of the statically-defined tracing 
(SDT)
+ * framework for DTrace. Probes and SDT providers are defined using the macros
+ * in sys/sdt.h, which append all the needed structures to linker sets. When
+ * this module is loaded, it iterates over all of the loaded modules and
+ * registers probes and providers with the DTrace framework based on the
+ * contents of these linker sets.
+ *
+ * A list of SDT providers is maintained here since a provider may span 
multiple
+ * modules. When a kernel module is unloaded, a provider defined in that module
+ * is unregistered only if no other modules refer to it. The DTrace framework 
is
+ * responsible for destroying individual probes when a kernel module is
+ * unloaded; in particular, probes may not span multiple kernel modules.
+ */
+
 #include "opt_kdtrace.h"
 
 #include 
@@ -53,9 +68,8 @@ static void   sdt_destroy(void *, dtrace_i
 static voidsdt_enable(void *, dtrace_id_t, void *);
 static voidsdt_disable(void *, dtrace_id_t, void *);
 
-static d_open_tsdt_open;
-static voidsdt_load(void *);
-static int sdt_unload(void *);
+static voidsdt_load(void);
+static int sdt_unload(void);
 static voidsdt_create_provider(struct sdt_provider *);
 static voidsdt_create_probe(struct sdt_probe *);
 static voidsdt_kld_load(void *, struct linker_file *);
@@ -63,12 +77,6 @@ static void  sdt_kld_unload_try(void *, s
 
 static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers");
 
-static struct cdevsw sdt_cdevsw = {
-   .d_version  = D_VERSION,
-   .d_open = sdt_open,
-   .d_name = "sdt",
-};
-
 static dtrace_pattr_t sdt_attr = {
 { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON },
 { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
@@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = {
sdt_destroy,
 };
 
-static struct cdev *sdt_cdev;
-
 static TAILQ_HEAD(, sdt_provider) sdt_prov_list;
 
 eventhandler_tag   sdt_kld_load_tag;
@@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider 
newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO);
newprov->name = strdup(prov->name, M_SDT);
prov->sdt_refs = newprov->sdt_refs = 1;
-   TAILQ_INIT(&newprov->probe_list);
 
TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry);
 
@@ -161,12 +166,14 @@ sdt_create_probe(struct sdt_probe *probe
if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE)
return;
 
-   TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry);
-
(void)dtrace_probe_create(prov->id, mod, func, name, 1, probe);
 }
 
-/* Probes are created through the SDT module load/unload hook. */
+/*
+ * Probes are created through the SDT module load/unload hook, so this function
+ * has nothing to do. It only exists because the DTrace provider framework
+ * requires one of provide_probes and provide_module to be defined.
+ */
 static void
 sdt_provide_probes(void *arg, dtrace_probedesc_t *desc)
 {
@@ -198,39 +205,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id
struct sdt_argtype *argtype;
struct sdt_probe *probe = parg;
 
-   if (desc->dtargd_ndx < probe->n_args) {
-   TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) {
-   if (desc->dtargd_ndx == argtype->ndx) {
-   desc->dtargd_mapping = desc->dtargd_ndx;
-   strlcpy(desc->dtargd_native, argtype->type,
-   sizeof(desc->dtargd_native));
-   if (argtype->xtype != NULL)
-   strlcpy(desc->dtargd_xlate,
-   argtype->xtype,
-   sizeof(desc->dtargd_xlate));
-   else
-   desc->dtargd_xlate[0] = '\0';
+   if (desc->dtargd_ndx >= probe->n_args) {
+   desc->dtargd_ndx = DTRACE_ARGNONE;
+   return;
+   }
+
+   TAILQ_FORE

svn commit: r257151 - head/share/man/man7

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:55:29 2013
New Revision: 257151
URL: http://svnweb.freebsd.org/changeset/base/257151

Log:
  Document /var/cache/pkg into hier(7) which pkg(8) uses.
  
  Approved by:  bapt
  MFC after:2 days

Modified:
  head/share/man/man7/hier.7

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Sat Oct 26 03:53:24 2013(r257150)
+++ head/share/man/man7/hier.7  Sat Oct 26 03:55:29 2013(r257151)
@@ -735,6 +735,14 @@ directory containing output spool files
 .Pp
 .It Pa backups/
 miscellaneous backup files
+.It Pa cache/
+miscellaneous cached files
+.Bl -tag -width ".Pa pkg/" -compact
+.It Pa pkg/
+cached packages for
+.Xr pkg 8
+.El
+.Pp
 .It Pa crash/
 default directory to store kernel crash dumps; see
 .Xr crash 8
___
svn-src-all@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"


svn commit: r257150 - in head: etc etc/keys etc/keys/pkg etc/keys/pkg/trusted etc/mtree share/man/man7

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:53:24 2013
New Revision: 257150
URL: http://svnweb.freebsd.org/changeset/base/257150

Log:
  Add infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
  the current test key that packages will be signed with until 10.0-RELEASE.
  
  Approved by:  bapt
  Discussed by: bapt with des
  MFC after:2 days

Added:
  head/etc/keys/
  head/etc/keys/Makefile   (contents, props changed)
  head/etc/keys/pkg/
  head/etc/keys/pkg/Makefile   (contents, props changed)
  head/etc/keys/pkg/trusted/
  head/etc/keys/pkg/trusted/Makefile   (contents, props changed)
  head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301   (contents, props 
changed)
Modified:
  head/etc/Makefile
  head/etc/mtree/BSD.root.dist
  head/share/man/man7/hier.7

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Sat Oct 26 03:47:49 2013(r257149)
+++ head/etc/Makefile   Sat Oct 26 03:53:24 2013(r257150)
@@ -224,6 +224,7 @@ distribution:
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
+   ${_+_}cd ${.CURDIR}/keys; ${MAKE} install
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
 .if ${MK_PKGBOOTSTRAP} != "no"
${_+_}cd ${.CURDIR}/pkg; ${MAKE} install

Added: head/etc/keys/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/keys/Makefile  Sat Oct 26 03:53:24 2013(r257150)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR= pkg
+
+.include 

Added: head/etc/keys/pkg/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/keys/pkg/Makefile  Sat Oct 26 03:53:24 2013(r257150)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR=trusted
+
+.include 

Added: head/etc/keys/pkg/trusted/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/keys/pkg/trusted/Makefile  Sat Oct 26 03:53:24 2013
(r257150)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+NO_OBJ=
+
+FILES= pkg.freebsd.org.2013102301
+
+FILESDIR=  /etc/keys/pkg/trusted
+FILESMODE= 644
+
+.include 

Added: head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/keys/pkg/trusted/pkg.freebsd.org.2013102301Sat Oct 26 
03:53:24 2013(r257150)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+# This key is for testing purposes only and will be revoked before 10.0-RELEASE
+
+function: "sha256"
+fingerprint: "b0170035af3acc5f3f3ae1859dc717101b4e6c1d0a794ad554928ca0cbb2f438"

Modified: head/etc/mtree/BSD.root.dist
==
--- head/etc/mtree/BSD.root.distSat Oct 26 03:47:49 2013
(r257149)
+++ head/etc/mtree/BSD.root.distSat Oct 26 03:53:24 2013
(r257150)
@@ -34,6 +34,14 @@
 ..
 gss
 ..
+keys
+   pkg
+revoked
+..
+trusted
+..
+   ..
+   ..
 mail
 ..
 mtree

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Sat Oct 26 03:47:49 2013(r257149)
+++ head/share/man/man7/hier.7  Sat Oct 26 03:53:24 2013(r257150)
@@ -32,7 +32,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 19, 2013
+.Dd October 23, 2013
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -94,6 +94,15 @@ bluetooth configuration files
 gnats configuration files;
 see
 .Xr send-pr 1
+.It Pa keys/
+known trusted and revoked keys.
+.Pp
+.Bl -tag -width ".Pa keys/pkg/" -compact
+.It Pa keys/pkg/
+fingerprints for
+.Xr pkg 8
+.El
+.Pp
 .It Pa localtime
 local timezone information;
 see
___
svn-src-all@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"


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

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:47:49 2013
New Revision: 257149
URL: http://svnweb.freebsd.org/changeset/base/257149

Log:
  Add support to check the signature of a local pkg.txz file being
  added with "pkg add". If the pkg.conf is configured to check for
  signature, then the pkg.txz.sig file will be expected and validated
  per r257147
  
  Approved by:  bapt
  MFC after:2 days

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

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:44:08 2013(r257148)
+++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:47:49 2013(r257149)
@@ -135,7 +135,7 @@ cleanup:
 }
 
 static int
-install_pkg_static(char *path, char *pkgpath)
+install_pkg_static(const char *path, const char *pkgpath)
 {
int pstat;
pid_t pid;
@@ -864,13 +864,54 @@ pkg_query_yes_no(void)
return (ret);
 }
 
+static int
+bootstrap_pkg_local(const char *pkgpath)
+{
+   char path[MAXPATHLEN];
+   char pkgstatic[MAXPATHLEN];
+   const char *signature_type;
+   int fd_pkg, fd_sig, ret;
+
+   fd_sig = -1;
+   ret = -1;
+
+   fd_pkg = open(pkgpath, O_RDONLY);
+   if (fd_pkg == -1)
+   err(EXIT_FAILURE, "Unable to open %s", pkgpath);
+
+   if (config_string(SIGNATURE_TYPE, &signature_type) != 0) {
+   warnx("Error looking up SIGNATURE_TYPE");
+   return (-1);
+   }
+   if (signature_type != NULL &&
+   strcasecmp(signature_type, "FINGERPRINTS") == 0) {
+   snprintf(path, sizeof(path), "%s.sig", pkgpath);
+
+   if ((fd_sig = open(path, O_RDONLY)) == -1) {
+   fprintf(stderr, "Signature for pkg not available.\n");
+   goto cleanup;
+   }
+
+   if (verify_signature(fd_pkg, fd_sig) == false)
+   goto cleanup;
+   }
+
+   if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0)
+   ret = install_pkg_static(pkgstatic, pkgpath);
+
+cleanup:
+   close(fd_pkg);
+   if (fd_sig != -1)
+   close(fd_sig);
+
+   return (ret);
+}
+
 int
 main(__unused int argc, char *argv[])
 {
char pkgpath[MAXPATHLEN];
-   char pkgstatic[MAXPATHLEN];
bool yes = false;
-   int fd, ret;
 
snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg",
getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE);
@@ -884,16 +925,11 @@ main(__unused int argc, char *argv[])
if (argv[1] != NULL && strcmp(argv[1], "-N") == 0)
errx(EXIT_FAILURE, "pkg is not installed");
 
+   config_init();
+
if (argc > 2 && strcmp(argv[1], "add") == 0 &&
access(argv[2], R_OK) == 0) {
-   fd = open(argv[2], O_RDONLY);
-   if (fd == -1)
-   err(EXIT_FAILURE, "Unable to open %s", argv[2]);
-
-   if ((ret = extract_pkg_static(fd, pkgstatic, 
MAXPATHLEN)) == 0)
-   ret = install_pkg_static(pkgstatic, argv[2]);
-   close(fd);
-   if (ret != 0)
+   if (bootstrap_pkg_local(argv[2]) != 0)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
}
@@ -902,7 +938,6 @@ main(__unused int argc, char *argv[])
 * not tty. Check the environment to see if user has answer
 * tucked in there already.
 */
-   config_init();
config_bool(ASSUME_ALWAYS_YES, &yes);
if (!yes) {
printf("%s", confirmation_message);
___
svn-src-all@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"


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

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:44:08 2013
New Revision: 257148
URL: http://svnweb.freebsd.org/changeset/base/257148

Log:
  Tell which fingerprint pkg is being validated against.
  
  Approved by:  bapt
  MFC after:2 days

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

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:43:02 2013(r257147)
+++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:44:08 2013(r257148)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include "config.h"
 
 struct sig_cert {
+   char *name;
unsigned char *sig;
int siglen;
unsigned char *cert;
@@ -72,6 +73,7 @@ typedef enum {
 
 struct fingerprint {
hash_t type;
+   char *name;
char hash[BUFSIZ];
STAILQ_ENTRY(fingerprint) next;
 };
@@ -316,6 +318,19 @@ parse_fingerprint(yaml_document_t *doc, 
return (f);
 }
 
+static void
+free_fingerprint_list(struct fingerprint_list* list)
+{
+   struct fingerprint* fingerprint;
+
+   STAILQ_FOREACH(fingerprint, list, next) {
+   if (fingerprint->name)
+   free(fingerprint->name);
+   free(fingerprint);
+   }
+   free(list);
+}
+
 static struct fingerprint *
 load_fingerprint(const char *dir, const char *filename)
 {
@@ -342,6 +357,7 @@ load_fingerprint(const char *dir, const 
goto out;
 
f = parse_fingerprint(&doc, node);
+   f->name = strdup(filename);
 
 out:
yaml_document_delete(&doc);
@@ -511,7 +527,6 @@ rsa_verify_cert(int fd, const unsigned c
}
 
/* Verify signature of the SHA256(pkg) is valid. */
-   printf("Verifying signature... ");
if ((mdctx = EVP_MD_CTX_create()) == NULL) {
warnx("%s", ERR_error_string(ERR_get_error(), errbuf));
goto error;
@@ -631,6 +646,7 @@ verify_signature(int fd_pkg, int fd_sig)
char path[MAXPATHLEN];
char hash[SHA256_DIGEST_LENGTH * 2 + 1];
 
+   sc = NULL;
trusted = revoked = NULL;
ret = false;
 
@@ -672,8 +688,9 @@ verify_signature(int fd_pkg, int fd_sig)
if (revoked != NULL) {
STAILQ_FOREACH(fingerprint, revoked, next) {
if (strcasecmp(fingerprint->hash, hash) == 0) {
-   fprintf(stderr, "The certificate has been "
-   "revoked\n");
+   fprintf(stderr, "The package was signed with "
+   "revoked certificate %s\n",
+   fingerprint->name);
goto cleanup;
}
}
@@ -682,17 +699,19 @@ verify_signature(int fd_pkg, int fd_sig)
STAILQ_FOREACH(fingerprint, trusted, next) {
if (strcasecmp(fingerprint->hash, hash) == 0) {
sc->trusted = true;
+   sc->name = strdup(fingerprint->name);
break;
}
}
 
if (sc->trusted == false) {
-   fprintf(stderr, "No trusted certificate found matching "
+   fprintf(stderr, "No trusted fingerprint found matching "
"package's certificate\n");
goto cleanup;
}
 
/* Verify the signature. */
+   printf("Verifying signature with trusted certificate %s... ", sc->name);
if (rsa_verify_cert(fd_pkg, sc->cert, sc->certlen, sc->sig,
sc->siglen) == false) {
fprintf(stderr, "Signature is not valid\n");
@@ -702,21 +721,17 @@ verify_signature(int fd_pkg, int fd_sig)
ret = true;
 
 cleanup:
-   if (trusted) {
-   STAILQ_FOREACH(fingerprint, trusted, next)
-   free(fingerprint);
-   free(trusted);
-   }
-   if (revoked) {
-   STAILQ_FOREACH(fingerprint, revoked, next)
-   free(fingerprint);
-   free(revoked);
-   }
+   if (trusted)
+   free_fingerprint_list(trusted);
+   if (revoked)
+   free_fingerprint_list(revoked);
if (sc) {
if (sc->cert)
free(sc->cert);
if (sc->sig)
free(sc->sig);
+   if (sc->name)
+   free(sc->name);
free(sc);
}
 
___
svn-src-all@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"


svn commit: r257147 - in head: etc/pkg usr.sbin/pkg

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:43:02 2013
New Revision: 257147
URL: http://svnweb.freebsd.org/changeset/base/257147

Log:
  Support checking signature for pkg bootstrap.
  
  If the pkg.conf is configured with SIGNATURE_TYPE: FINGERPRINTS,
  and FINGERPRINTS: /etc/keys/pkg then a pkg.sig file is fetched along
  with pkg.txz. The signature contains the signature provided by the
  signing server, and the public key. The .sig is the exact output
  from the signing server in the following format:
  
SIGNATURE

CERT

END
  
  The signature is verified with the following logic:
  
   - If the .sig file is missing, it fails.
   - If the .sig doesn't validate, it fails.
   - If the public key in the .sig is not in the known trusted fingerprints,
 it fails.
   - If the public key is in the revoked key list, it fails.
  
  Approved by:  bapt
  MFC after:2 days
  Discussed by: bapt with des, jonathan, gavin

Modified:
  head/etc/pkg/FreeBSD.conf
  head/usr.sbin/pkg/Makefile
  head/usr.sbin/pkg/config.c
  head/usr.sbin/pkg/config.h
  head/usr.sbin/pkg/pkg.c

Modified: head/etc/pkg/FreeBSD.conf
==
--- head/etc/pkg/FreeBSD.conf   Sat Oct 26 03:32:06 2013(r257146)
+++ head/etc/pkg/FreeBSD.conf   Sat Oct 26 03:43:02 2013(r257147)
@@ -2,5 +2,7 @@
 FreeBSD: {
   url: "pkg+http://pkg.freebsd.org/${ABI}/latest";,
   mirror_type: "srv",
+  signature_type: "fingerprints",
+  fingerprints: "/etc/keys/pkg",
   enabled: "yes"
 }

Modified: head/usr.sbin/pkg/Makefile
==
--- head/usr.sbin/pkg/Makefile  Sat Oct 26 03:32:06 2013(r257146)
+++ head/usr.sbin/pkg/Makefile  Sat Oct 26 03:43:02 2013(r257147)
@@ -7,7 +7,7 @@ NO_MAN= yes
 CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include
 .PATH: ${.CURDIR}/../../contrib/libyaml/include
 DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF}
-LDADD= -larchive -lelf -lfetch -lyaml -lsbuf
+LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl
 USEPRIVATELIB= yaml
 
 .include 

Modified: head/usr.sbin/pkg/config.c
==
--- head/usr.sbin/pkg/config.c  Sat Oct 26 03:32:06 2013(r257146)
+++ head/usr.sbin/pkg/config.c  Sat Oct 26 03:43:02 2013(r257147)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2013 Baptiste Daroussin 
+ * Copyright (c) 2013 Bryan Drewery 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -86,7 +87,21 @@ static struct config_entry c[] = {
"NO",
NULL,
false,
-   }
+   },
+   [SIGNATURE_TYPE] = {
+   PKG_CONFIG_STRING,
+   "SIGNATURE_TYPE",
+   NULL,
+   NULL,
+   false,
+   },
+   [FINGERPRINTS] = {
+   PKG_CONFIG_STRING,
+   "FINGERPRINTS",
+   NULL,
+   NULL,
+   false,
+   },
 };
 
 static const char *
@@ -509,6 +524,12 @@ config_parse(yaml_document_t *doc, yaml_
else if (strcasecmp(key->data.scalar.value,
"mirror_type") == 0)
sbuf_cpy(buf, "MIRROR_TYPE");
+   else if (strcasecmp(key->data.scalar.value,
+   "signature_type") == 0)
+   sbuf_cpy(buf, "SIGNATURE_TYPE");
+   else if (strcasecmp(key->data.scalar.value,
+   "fingerprints") == 0)
+   sbuf_cpy(buf, "FINGERPRINTS");
else { /* Skip unknown entries for future use. */
++pair;
continue;

Modified: head/usr.sbin/pkg/config.h
==
--- head/usr.sbin/pkg/config.h  Sat Oct 26 03:32:06 2013(r257146)
+++ head/usr.sbin/pkg/config.h  Sat Oct 26 03:43:02 2013(r257147)
@@ -37,6 +37,8 @@ typedef enum {
ABI,
MIRROR_TYPE,
ASSUME_ALWAYS_YES,
+   SIGNATURE_TYPE,
+   FINGERPRINTS,
CONFIG_SIZE
 } pkg_config_key;
 

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:32:06 2013(r257146)
+++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:43:02 2013(r257147)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2012-2013 Baptiste Daroussin 
+ * Copyright (c) 2013 Bryan Drewery 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,10 +29,15 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
+#include 
 #include 
 
+#define _WITH_GETLINE
 #include 
 #include 
+#include 
 #include 
 #i

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

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:32:06 2013
New Revision: 257146
URL: http://svnweb.freebsd.org/changeset/base/257146

Log:
  Be verbose and tell where pkg(8) is being bootstrapped from.
  
  Approved by:  bapt
  MFC after:2 days

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

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Sat Oct 26 03:31:05 2013(r257145)
+++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:32:06 2013(r257146)
@@ -158,7 +158,6 @@ bootstrap_pkg(void)
config = NULL;
current = mirrors = NULL;
 
-   printf("Bootstrapping pkg, please wait...\n");
 
if (config_string(PACKAGESITE, &packagesite) != 0) {
warnx("No PACKAGESITE defined");
@@ -169,6 +168,8 @@ bootstrap_pkg(void)
return (-1);
}
 
+   printf("Bootstrapping pkg from %s, please wait...\n", packagesite);
+
/* Support pkg+http:// for PACKAGESITE which is the new format
   in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has
   no A record. */
___
svn-src-all@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"


svn commit: r257145 - in head: etc etc/pkg usr.sbin/pkg

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:31:05 2013
New Revision: 257145
URL: http://svnweb.freebsd.org/changeset/base/257145

Log:
  Add support for reading configuration files from /etc/pkg.
  For now only /etc/pkg/FreeBSD.conf is supported. Its style is:
  
  Repo: {
 URL: "...",
 MIRROR_TYPE: "...",
 ...
  }
  
  The configuration will be read from /usr/local/etc/pkg.conf if exists,
  otherwise /etc/pkg/FreeBSD.conf
  
  Approved by:  bapt
  MFC after:2 days

Added:
  head/etc/pkg/
  head/etc/pkg/FreeBSD.conf   (contents, props changed)
  head/etc/pkg/Makefile   (contents, props changed)
Modified:
  head/etc/Makefile
  head/usr.sbin/pkg/config.c
  head/usr.sbin/pkg/config.h

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Sat Oct 26 03:22:57 2013(r257144)
+++ head/etc/Makefile   Sat Oct 26 03:31:05 2013(r257145)
@@ -225,6 +225,9 @@ distribution:
${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
+.if ${MK_PKGBOOTSTRAP} != "no"
+   ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
+.endif
${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap

Added: head/etc/pkg/FreeBSD.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/pkg/FreeBSD.conf   Sat Oct 26 03:31:05 2013(r257145)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+FreeBSD: {
+  url: "pkg+http://pkg.freebsd.org/${ABI}/latest";,
+  mirror_type: "srv",
+  enabled: "yes"
+}

Added: head/etc/pkg/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/pkg/Makefile   Sat Oct 26 03:31:05 2013(r257145)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+NO_OBJ=
+
+FILES= FreeBSD.conf
+
+FILESDIR=  /etc/pkg
+FILESMODE= 644
+
+.include 

Modified: head/usr.sbin/pkg/config.c
==
--- head/usr.sbin/pkg/config.c  Sat Oct 26 03:22:57 2013(r257144)
+++ head/usr.sbin/pkg/config.c  Sat Oct 26 03:31:05 2013(r257145)
@@ -460,7 +460,7 @@ subst_packagesite(const char *abi)
 }
 
 static void
-config_parse(yaml_document_t *doc, yaml_node_t *node)
+config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype)
 {
yaml_node_pair_t *pair;
yaml_node_t *key, *val;
@@ -495,15 +495,33 @@ config_parse(yaml_document_t *doc, yaml_
}
 
sbuf_clear(buf);
-   for (j = 0; j < strlen(key->data.scalar.value); ++j)
-   sbuf_putc(buf, toupper(key->data.scalar.value[j]));
 
-   sbuf_finish(buf);
+   if (conftype == CONFFILE_PKG) {
+   for (j = 0; j < strlen(key->data.scalar.value); ++j)
+   sbuf_putc(buf,
+   toupper(key->data.scalar.value[j]));
+   sbuf_finish(buf);
+   } else if (conftype == CONFFILE_REPO) {
+   /* The CONFFILE_REPO type is more restrictive. Only
+  parse known elements. */
+   if (strcasecmp(key->data.scalar.value, "url") == 0)
+   sbuf_cpy(buf, "PACKAGESITE");
+   else if (strcasecmp(key->data.scalar.value,
+   "mirror_type") == 0)
+   sbuf_cpy(buf, "MIRROR_TYPE");
+   else { /* Skip unknown entries for future use. */
+   ++pair;
+   continue;
+   }
+   sbuf_finish(buf);
+   }
+
for (i = 0; i < CONFIG_SIZE; i++) {
if (strcmp(sbuf_data(buf), c[i].key) == 0)
break;
}
 
+   /* Silently skip unknown keys to be future compatible. */
if (i == CONFIG_SIZE) {
++pair;
continue;
@@ -522,36 +540,53 @@ config_parse(yaml_document_t *doc, yaml_
sbuf_delete(buf);
 }
 
-int
-config_init(void)
+/*-
+ * Parse new repo style configs in style:
+ * Name:
+ *   URL:
+ *   MIRROR_TYPE:
+ * etc...
+ */
+static void
+parse_repo_file(yaml_document_t *doc, yaml_node_t *node)
 {
-   FILE *fp;
-   yaml_parser_t parser;
-   yaml_document_t doc;
-   yaml_node_t *node;
-   const char *val;
-   int i;
-   const char *localbase;
-   char confpath[MAXPATHLEN];
-   char abi[BUFSIZ];
+   yaml_node_pair_t *pair;
 
-  

svn commit: r257144 - head/sys/dev/uart

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Oct 26 03:22:57 2013
New Revision: 257144
URL: http://svnweb.freebsd.org/changeset/base/257144

Log:
  Fix build after r257111 by including headers with definition of 
pmap_kextract().

Modified:
  head/sys/dev/uart/uart_cpu_fdt.c

Modified: head/sys/dev/uart/uart_cpu_fdt.c
==
--- head/sys/dev/uart/uart_cpu_fdt.cSat Oct 26 03:21:54 2013
(r257143)
+++ head/sys/dev/uart/uart_cpu_fdt.cSat Oct 26 03:22:57 2013
(r257144)
@@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 
___
svn-src-all@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"


svn commit: r257143 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace

2013-10-25 Thread Mark Johnston
Author: markj
Date: Sat Oct 26 03:21:54 2013
New Revision: 257143
URL: http://svnweb.freebsd.org/changeset/base/257143

Log:
  Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction:
  the code was trying to save the stack pointer rather than the frame pointer,
  and the arguments to copyout(9) were reversed, so nothing ended up being
  saved on the stack. This would cause process crashes when the pid provider
  was being used to instrument calls of a function starting with this
  instruction.
  
  Reported by:  symbol...@gmx.com
  Tested by:symbol...@gmx.com (earlier version)
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Sat Oct 
26 03:21:08 2013(r257142)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Sat Oct 
26 03:21:54 2013(r257143)
@@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le
 #definer_rip   r_eip
 #definer_rflags r_eflags
 #definer_rsp   r_esp
+#definer_rbp   r_ebp
 #endif
 
 /*
@@ -1394,29 +1395,27 @@ fasttrap_pid_probe(struct reg *rp)
case FASTTRAP_T_PUSHL_EBP:
{
int ret = 0;
-   uintptr_t addr = 0;
 
 #ifdef __amd64
if (p->p_model == DATAMODEL_NATIVE) {
-   addr = rp->r_rsp - sizeof (uintptr_t);
-   ret = fasttrap_sulword((void *)addr, &rp->r_rsp);
+   rp->r_rsp -= sizeof (uintptr_t);
+   ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp);
} else {
 #endif
 #ifdef __i386__
-   addr = rp->r_rsp - sizeof (uint32_t);
-   ret = fasttrap_suword32((void *)addr, &rp->r_rsp);
+   rp->r_rsp -= sizeof (uint32_t);
+   ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp);
 #endif
 #ifdef __amd64
}
 #endif
 
if (ret == -1) {
-   fasttrap_sigsegv(p, curthread, addr);
+   fasttrap_sigsegv(p, curthread, rp->r_rsp);
new_pc = pc;
break;
}
 
-   rp->r_rsp = addr;
new_pc = pc + tp->ftt_size;
break;
}
___
svn-src-all@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"


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

2013-10-25 Thread Bryan Drewery
Author: bdrewery (ports committer)
Date: Sat Oct 26 03:21:08 2013
New Revision: 257142
URL: http://svnweb.freebsd.org/changeset/base/257142

Log:
  Wrap long lines
  
  Approved by:  bapt
  MFC after:2 days

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

Modified: head/usr.sbin/pkg/config.c
==
--- head/usr.sbin/pkg/config.c  Sat Oct 26 01:17:54 2013(r257141)
+++ head/usr.sbin/pkg/config.c  Sat Oct 26 03:21:08 2013(r257142)
@@ -548,7 +548,8 @@ config_init(void)
 
if ((fp = fopen(confpath, "r")) == NULL) {
if (errno != ENOENT)
-   err(EXIT_FAILURE, "Unable to open configuration file 
%s", confpath);
+   err(EXIT_FAILURE, "Unable to open configuration "
+   "file %s", confpath);
/* no configuration present */
goto finalize;
}
@@ -561,11 +562,13 @@ config_init(void)
 
if (node != NULL) {
if (node->type != YAML_MAPPING_NODE)
-   warnx("Invalid configuration format, ignoring the 
configuration file");
+   warnx("Invalid configuration format, ignoring the "
+   "configuration file");
else
config_parse(&doc, node);
} else {
-   warnx("Invalid configuration format, ignoring the configuration 
file");
+   warnx("Invalid configuration format, ignoring the "
+   "configuration file");
}
 
yaml_document_delete(&doc);
@@ -574,7 +577,8 @@ config_init(void)
 finalize:
if (c[ABI].val == NULL && c[ABI].value == NULL) {
if (pkg_get_myabi(abi, BUFSIZ) != 0)
-   errx(EXIT_FAILURE, "Failed to determine the system 
ABI");
+   errx(EXIT_FAILURE, "Failed to determine the system "
+   "ABI");
c[ABI].val = abi;
}
 

Modified: head/usr.sbin/pkg/pkg.c
==
--- head/usr.sbin/pkg/pkg.c Sat Oct 26 01:17:54 2013(r257141)
+++ head/usr.sbin/pkg/pkg.c Sat Oct 26 03:21:08 2013(r257142)
@@ -267,8 +267,10 @@ bootstrap_pkg(void)
 
 fetchfail:
warnx("Error fetching %s: %s", url, fetchLastErrString);
-   fprintf(stderr, "A pre-built version of pkg could not be found for your 
system.\n");
-   fprintf(stderr, "Consider changing PACKAGESITE or installing it from 
ports: 'ports-mgmt/pkg'.\n");
+   fprintf(stderr, "A pre-built version of pkg could not be found for "
+   "your system.\n");
+   fprintf(stderr, "Consider changing PACKAGESITE or installing it from "
+   "ports: 'ports-mgmt/pkg'.\n");
 
 cleanup:
if (remote != NULL)
___
svn-src-all@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"


svn commit: r257141 - head/sys/dev/iwn

2013-10-25 Thread Adrian Chadd
Author: adrian
Date: Sat Oct 26 01:17:54 2013
New Revision: 257141
URL: http://svnweb.freebsd.org/changeset/base/257141

Log:
  add 0x8b, lifted from Linux iwlegacy/commands.h
  
  This is "STA invalid". I saw it during some 4965 testing (kern/183260)
  and I still have no idea what is causing it.
  
  Obtained from:Linux drivers/net/wireless/iwlegacy

Modified:
  head/sys/dev/iwn/if_iwnreg.h

Modified: head/sys/dev/iwn/if_iwnreg.h
==
--- head/sys/dev/iwn/if_iwnreg.hFri Oct 25 23:38:58 2013
(r257140)
+++ head/sys/dev/iwn/if_iwnreg.hSat Oct 26 01:17:54 2013
(r257141)
@@ -1234,6 +1234,7 @@ struct iwn_ucode_info {
 #define IWN_TX_FAIL_FIFO_UNDERRRUN 0x84/* tx fifo not kept running */
 #define IWN_TX_FAIL_DEST_IN_PS 0x88/* sta found in power save */
 #define IWN_TX_FAIL_TX_LOCKED  0x90/* waiting to see traffic */
+#define IWN_TX_FAIL_STA_INVALID0x8b/* XXX STA invalid 
(???) */
 
 struct iwn4965_tx_stat {
uint8_t nframes;
___
svn-src-all@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"


Re: svn commit: r257136 - stable/10

2013-10-25 Thread Glen Barber
On Sat, Oct 26, 2013 at 01:43:43AM +0200, Herbert J. Skuhra wrote:
> Hi,
> 
> On Fri, 25 Oct 2013 21:27:36 + (UTC)
> Glen Barber wrote:
> 
> > Author: gjb
> > Date: Fri Oct 25 21:27:35 2013
> > New Revision: 257136
> > URL: http://svnweb.freebsd.org/changeset/base/257136
> > 
> > Log:
> >   MFC r257079:
> >Fix build host pollution by avoiding calling 'uname -srp' to
> >determine values for 'VERSION'.
> >   
> >   Approved by:  re (glebius)
> > 
> > Modified:
> >   stable/10/Makefile.inc1   (contents, props changed)
> 
> When running make (check|delete)-old I am still getting:
> 
> >>> Checking for old files
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
> /usr/obj/usr/src/release -V REVISION" returned non-zero status
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
> /usr/obj/usr/src/release -V BRANCH" returned non-zero status
> awk: can't open file /usr/obj/usr/src/sys/sys/param.h
>  source line number 1
> make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
> '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
> /usr/obj/usr/src/sys/sys/param.h" returned non-zero status
> /usr/lib/libbsdyml.a
> /usr/lib/libbsdyml.so
> /usr/lib/libbsdyml_p.a
> /usr/share/man/man3/libbsdyml.3.gz
> /usr/include/bsdyml.h
> >>> Checking for old libraries
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
> /usr/obj/usr/src/release -V REVISION" returned non-zero status
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
> /usr/obj/usr/src/release -V BRANCH" returned non-zero status
> awk: can't open file /usr/obj/usr/src/sys/sys/param.h
>  source line number 1
> make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
> '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
> /usr/obj/usr/src/sys/sys/param.h" returned non-zero status
> /usr/lib/libbsdyml.so.0
> >>> Checking for old directories
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
> /usr/obj/usr/src/release -V REVISION" returned non-zero status
> make[3]: chdir /usr/obj/usr/src/release: No such file or directory
> make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
> /usr/obj/usr/src/release -V BRANCH" returned non-zero status
> awk: can't open file /usr/obj/usr/src/sys/sys/param.h
>  source line number 1
> make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
> '/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
> /usr/obj/usr/src/sys/sys/param.h" returned non-zero status
> /usr/share/doc/bind9
> /usr/share/doc/bind9/arm
> /usr/share/doc/bind9/misc
> To remove old files and directories run 'make delete-old'.
> To remove old libraries run 'make delete-old-libs'.
> 

This will be fixed after -BETA2.  I realize the output is annoying, but
in these cases, they are non-fatal warnings.  It *is* very high on my
priority list, but the fix right now is not clear.

I'll follow up on -stable@ and -current@ shortly with a full explanation
of why -BETA2 is taking so long, by the way, which is directly related
to the update this commit makes, and why it is important in order to
move forward with this change in the tree, versus reverting it (again).

Glen



pgpsHanulWiaD.pgp
Description: PGP signature


Re: svn commit: r257136 - stable/10

2013-10-25 Thread Herbert J. Skuhra
Hi,

On Fri, 25 Oct 2013 21:27:36 + (UTC)
Glen Barber wrote:

> Author: gjb
> Date: Fri Oct 25 21:27:35 2013
> New Revision: 257136
> URL: http://svnweb.freebsd.org/changeset/base/257136
> 
> Log:
>   MFC r257079:
>Fix build host pollution by avoiding calling 'uname -srp' to
>determine values for 'VERSION'.
>   
>   Approved by:re (glebius)
> 
> Modified:
>   stable/10/Makefile.inc1   (contents, props changed)

When running make (check|delete)-old I am still getting:

>>> Checking for old files
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
/usr/obj/usr/src/release -V REVISION" returned non-zero status
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
/usr/obj/usr/src/release -V BRANCH" returned non-zero status
awk: can't open file /usr/obj/usr/src/sys/sys/param.h
 source line number 1
make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
'/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
/usr/obj/usr/src/sys/sys/param.h" returned non-zero status
/usr/lib/libbsdyml.a
/usr/lib/libbsdyml.so
/usr/lib/libbsdyml_p.a
/usr/share/man/man3/libbsdyml.3.gz
/usr/include/bsdyml.h
>>> Checking for old libraries
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
/usr/obj/usr/src/release -V REVISION" returned non-zero status
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
/usr/obj/usr/src/release -V BRANCH" returned non-zero status
awk: can't open file /usr/obj/usr/src/sys/sys/param.h
 source line number 1
make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
'/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
/usr/obj/usr/src/sys/sys/param.h" returned non-zero status
/usr/lib/libbsdyml.so.0
>>> Checking for old directories
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 132: warning: "make -C 
/usr/obj/usr/src/release -V REVISION" returned non-zero status
make[3]: chdir /usr/obj/usr/src/release: No such file or directory
make[2]: "/usr/src/Makefile.inc1" line 133: warning: "make -C 
/usr/obj/usr/src/release -V BRANCH" returned non-zero status
awk: can't open file /usr/obj/usr/src/sys/sys/param.h
 source line number 1
make[2]: "/usr/src/Makefile.inc1" line 135: warning: "awk 
'/^#define[[:space:]]*__FreeBSD_version/ { print $3 }'  
/usr/obj/usr/src/sys/sys/param.h" returned non-zero status
/usr/share/doc/bind9
/usr/share/doc/bind9/arm
/usr/share/doc/bind9/misc
To remove old files and directories run 'make delete-old'.
To remove old libraries run 'make delete-old-libs'.

-- 
Herbert

___
svn-src-all@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"


svn commit: r257140 - svnadmin/conf

2013-10-25 Thread Olivier Houchard
Author: cognet
Date: Fri Oct 25 23:38:58 2013
New Revision: 257140
URL: http://svnweb.freebsd.org/changeset/base/257140

Log:
  Deliver zbb from my oppression.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Fri Oct 25 22:47:54 2013(r257139)
+++ svnadmin/conf/mentors   Fri Oct 25 23:38:58 2013(r257140)
@@ -29,4 +29,3 @@ odeds jhb Co-mentor: alfred
 peterj jhb Co-mentor: grog
 snbdwmalone
 versus gavin   Co-mentor: fjoe
-zbbcognet
___
svn-src-all@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"


Re: svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr

2013-10-25 Thread Eitan Adler
On Fri, Oct 25, 2013 at 2:43 PM, Colin Percival  wrote:
> Author: cperciva
> Date: Fri Oct 25 18:43:53 2013
> New Revision: 257129
> URL: http://svnweb.freebsd.org/changeset/base/257129
>
> Log:
>   Remove time and date stamps from svn* binaries, in order to make the
>   builds reproducible.

Thanks!

I wonder if we could work on a wiki paging listing all the other
non-reproducible portions of the FreeBSD build process.



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-all@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"


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

2013-10-25 Thread Brooks Davis
Author: brooks
Date: Fri Oct 25 22:47:54 2013
New Revision: 257139
URL: http://svnweb.freebsd.org/changeset/base/257139

Log:
  Regerate after r257138 swapped the default to WITH_NMTREE.
  
  MFC after:3 days
  Sponsored by: DARPA/AFRL

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Fri Oct 25 22:45:18 2013
(r257138)
+++ head/share/man/man5/src.conf.5  Fri Oct 25 22:47:54 2013
(r257139)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z 
des
 .\" $FreeBSD$
-.Dd October 24, 2013
+.Dd October 25, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -764,14 +764,14 @@ Set to not build NLS catalogs.
 .\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 
2006-03-21 07:50:50Z ru
 Set to not build NLS catalog support for
 .Xr csh 1 .
-.It Va WITH_NMTREE
-.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245435 2013-01-14 
20:38:32Z brooks
+.It Va WITHOUT_NMTREE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NMTREE 257138 2013-10-25 
22:45:18Z brooks
 Set to install
-.Xr nmtree 8
+.Xr fmtree 8
 as
 .Xr mtree 8 .
 By default
-.Xr fmtree 8
+.Xr nmtree 8
 is installed as
 .Xr mtree 8 .
 .It Va WITHOUT_NS_CACHING
___
svn-src-all@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"


svn commit: r257138 - in head: . share/mk tools/build/options

2013-10-25 Thread Brooks Davis
Author: brooks
Date: Fri Oct 25 22:45:18 2013
New Revision: 257138
URL: http://svnweb.freebsd.org/changeset/base/257138

Log:
  Switch the default mtree to nmtree our new NetBSD derived mtree.
  
  Exp-run by: bdrewery
  MFC after:  3 days
  Sponsored by: DARPA/AFRL

Added:
  head/tools/build/options/WITHOUT_NMTREE
 - copied, changed from r255666, head/tools/build/options/WITH_NMTREE
Deleted:
  head/tools/build/options/WITH_NMTREE
Modified:
  head/UPDATING
  head/share/mk/bsd.own.mk

Modified: head/UPDATING
==
--- head/UPDATING   Fri Oct 25 21:57:03 2013(r257137)
+++ head/UPDATING   Fri Oct 25 22:45:18 2013(r257138)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20131025:
+   The default version of mtree is nmtree which is obtained from
+   NetBSD.  The output is generally the same, but may vary
+   slightly.  If you found you need identical output adding
+   "-F freebsd9" to the command line should do the trick.  For the
+   time being, the old mtree is available as fmtree.
+
 20131014:
libbsdyml has been renamed to libyaml and moved to /usr/lib/private.
This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkFri Oct 25 21:57:03 2013(r257137)
+++ head/share/mk/bsd.own.mkFri Oct 25 22:45:18 2013(r257138)
@@ -320,6 +320,7 @@ __DEFAULT_YES_OPTIONS = \
 NIS \
 NLS \
 NLS_CATALOGS \
+NMTREE \
 NS_CACHING \
 NTP \
 OPENSSH \
@@ -370,7 +371,6 @@ __DEFAULT_NO_OPTIONS = \
 LIBICONV_COMPAT \
 INSTALL_AS_USER \
 LLDB \
-NMTREE \
 NAND \
 OFED \
 OPENSSH_NONE_CIPHER \

Copied and modified: head/tools/build/options/WITHOUT_NMTREE (from r255666, 
head/tools/build/options/WITH_NMTREE)
==
--- head/tools/build/options/WITH_NMTREEWed Sep 18 11:07:32 2013
(r255666, copy source)
+++ head/tools/build/options/WITHOUT_NMTREE Fri Oct 25 22:45:18 2013
(r257138)
@@ -1,9 +1,9 @@
 .\" $FreeBSD$
 Set to install
-.Xr nmtree 8
+.Xr fmtree 8
 as
 .Xr mtree 8 .
 By default
-.Xr fmtree 8
+.Xr nmtree 8
 is installed as
 .Xr mtree 8 .
___
svn-src-all@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"


svn commit: r257136 - stable/10

2013-10-25 Thread Glen Barber
Author: gjb
Date: Fri Oct 25 21:27:35 2013
New Revision: 257136
URL: http://svnweb.freebsd.org/changeset/base/257136

Log:
  MFC r257079:
   Fix build host pollution by avoiding calling 'uname -srp' to
   determine values for 'VERSION'.
  
  Approved by:  re (glebius)

Modified:
  stable/10/Makefile.inc1   (contents, props changed)

Modified: stable/10/Makefile.inc1
==
--- stable/10/Makefile.inc1 Fri Oct 25 19:49:03 2013(r257135)
+++ stable/10/Makefile.inc1 Fri Oct 25 21:27:35 2013(r257136)
@@ -58,6 +58,7 @@
 # use that new version.  And the new (dynamically-linked) /bin/sh
 # will expect to find appropriate libraries in /lib and /libexec.
 #
+SRCDIR?=   ${.CURDIR}
 .if defined(SUBDIR_OVERRIDE)
 SUBDIR=${SUBDIR_OVERRIDE}
 .else
@@ -128,8 +129,11 @@ OSRELDATE= 0
 .endif
 
 .if !defined(VERSION)
-VERSION!=  uname -srp
-VERSION+=  ${OSRELDATE}
+REVISION!= make -C ${SRCDIR}/release -V REVISION
+BRANCH!=   make -C ${SRCDIR}/release -V BRANCH
+SRCRELDATE!=   awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
+   ${SRCDIR}/sys/sys/param.h
+VERSION=   FreeBSD ${REVISION}-${BRANCH} ${TARGET_ARCH} ${SRCRELDATE}
 .endif
 
 KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips 
mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc 
powerpc64/powerpc sparc64
___
svn-src-all@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"


svn commit: r257135 - head/sys/net

2013-10-25 Thread Gleb Smirnoff
Author: glebius
Date: Fri Oct 25 19:49:03 2013
New Revision: 257135
URL: http://svnweb.freebsd.org/changeset/base/257135

Log:
  vnet.h needs to be included before raw_cb.h. Now it compiles due to
  pollution via if_var.h.

Modified:
  head/sys/net/raw_cb.c
  head/sys/net/raw_usrreq.c

Modified: head/sys/net/raw_cb.c
==
--- head/sys/net/raw_cb.c   Fri Oct 25 19:46:52 2013(r257134)
+++ head/sys/net/raw_cb.c   Fri Oct 25 19:49:03 2013(r257135)
@@ -44,8 +44,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 
 /*
  * Routines to manage the raw protocol control blocks.

Modified: head/sys/net/raw_usrreq.c
==
--- head/sys/net/raw_usrreq.c   Fri Oct 25 19:46:52 2013(r257134)
+++ head/sys/net/raw_usrreq.c   Fri Oct 25 19:49:03 2013(r257135)
@@ -46,8 +46,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 
 MTX_SYSINIT(rawcb_mtx, &rawcb_mtx, "rawcb", MTX_DEF);
 
___
svn-src-all@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"


svn commit: r257134 - head/sys/dev/iwn

2013-10-25 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 25 19:46:52 2013
New Revision: 257134
URL: http://svnweb.freebsd.org/changeset/base/257134

Log:
  Begin fleshing out a knob to enable/disable bluetooth coexistence.
  
  Some firmware versions seem to get very unhappy if they're sent btcoex
  commands when they don't actually have bluetooth hardware in them.
  So, disable sending them those commands.
  
  Tested:
  
  * 5100 (which has bluetooth, no problems)
  * 4965 (which doesn't have bluetooth, but didn't seem to crash)
  * 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.)

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Oct 25 19:44:53 2013(r257133)
+++ head/sys/dev/iwn/if_iwn.c   Fri Oct 25 19:46:52 2013(r257134)
@@ -705,6 +705,8 @@ iwn4965_attach(struct iwn_softc *sc, uin
/* Override chains masks, ROM is known to be broken. */
sc->txchainmask = IWN_ANT_AB;
sc->rxchainmask = IWN_ANT_ABC;
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__);
 
@@ -752,23 +754,40 @@ iwn5000_attach(struct iwn_softc *sc, uin
/* Override chains masks, ROM is known to be broken. */
sc->txchainmask = IWN_ANT_B;
sc->rxchainmask = IWN_ANT_AB;
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
break;
case IWN_HW_REV_TYPE_5150:
sc->limits = &iwn5150_sensitivity_limits;
sc->fwname = "iwn5150fw";
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
break;
case IWN_HW_REV_TYPE_5300:
case IWN_HW_REV_TYPE_5350:
sc->limits = &iwn5000_sensitivity_limits;
sc->fwname = "iwn5000fw";
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
break;
case IWN_HW_REV_TYPE_1000:
sc->limits = &iwn1000_sensitivity_limits;
sc->fwname = "iwn1000fw";
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
break;
case IWN_HW_REV_TYPE_6000:
sc->limits = &iwn6000_sensitivity_limits;
sc->fwname = "iwn6000fw";
+   /*
+* Disable btcoex for 6200.
+* XXX TODO: disable for 6205; no btcoex as well
+* (6230/6235 - enable bluetooth)
+*/
+   if (pid != 0x422c) {
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
+   }
if (pid == 0x422c || pid == 0x4239) {
sc->sc_flags |= IWN_FLAG_INTERNAL_PA;
/* Override chains masks, ROM is known to be broken. */
@@ -782,14 +801,20 @@ iwn5000_attach(struct iwn_softc *sc, uin
/* Override chains masks, ROM is known to be broken. */
sc->txchainmask = IWN_ANT_AB;
sc->rxchainmask = IWN_ANT_AB;
+   /* Enable normal btcoex */
+   sc->sc_flags |= IWN_FLAG_BTCOEX;
break;
case IWN_HW_REV_TYPE_6005:
sc->limits = &iwn6000_sensitivity_limits;
if (pid != 0x0082 && pid != 0x0085) {
sc->fwname = "iwn6000g2bfw";
sc->sc_flags |= IWN_FLAG_ADV_BTCOEX;
-   } else
+   } else {
sc->fwname = "iwn6000g2afw";
+   /*
+* 6250 - disable bluetooth coexistence.
+*/
+   }
break;
default:
device_printf(sc->sc_dev, "adapter type %d not supported\n",
@@ -797,6 +822,15 @@ iwn5000_attach(struct iwn_softc *sc, uin
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);
return ENOTSUP;
}
+   if (sc->sc_flags & IWN_FLAG_BTCOEX)
+   device_printf(sc->sc_dev,
+   "enable basic bluetooth coexistence\n");
+   else if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX)
+   device_printf(sc->sc_dev,
+   "enable advanced bluetooth coexistence\n");
+   else
+   device_printf(sc->sc_dev,
+   "disable bluetooth coexistence\n");
return 0;
 }
 
@@ -5404,9 +5438,10 @@ iwn_config(struct iwn_softc *sc)
}
 
/* Configure bluetooth coexistence. */
+   error = 0;
if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX)
error = iwn_send_advanced_btcoex(sc);
-   else
+   else if (sc->sc_flags & IWN_FLAG_BTCOEX)
error = iwn_send_btcoex

svn commit: r257133 - head/sys/dev/iwn

2013-10-25 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 25 19:44:53 2013
New Revision: 257133
URL: http://svnweb.freebsd.org/changeset/base/257133

Log:
  Temporarily disable multi-rate retry (link quality) and eliminate rate
  index lookups.
  
  * My recent(ish) change to iwn(4) and the net80211 rate control API to
support 11n rates broke the link quality table use.  So, until I or
someone else decides to fix it, let's just disable it for now.
  
  * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.
  
  * Eliminate two uses of the net80211 rate index lookup functions - they
are only for legacy rates and they're not needed here.
  
  This fixes some invalid looking rate control TX issues that showed up
  on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
  like DMA related issues.
  
  Tested:
  
  * 4965, STA mode
  * 5100, STA mode

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Oct 25 19:39:22 2013(r257132)
+++ head/sys/dev/iwn/if_iwn.c   Fri Oct 25 19:44:53 2013(r257133)
@@ -3476,6 +3476,53 @@ iwn5000_reset_sched(struct iwn_softc *sc
 }
 #endif
 
+/*
+ * Check whether OFDM 11g protection will be enabled for the given rate.
+ *
+ * The original driver code only enabled protection for OFDM rates.
+ * It didn't check to see whether it was operating in 11a or 11bg mode.
+ */
+static int
+iwn_check_rate_needs_protection(struct iwn_softc *sc,
+struct ieee80211vap *vap, uint8_t rate)
+{
+   struct ieee80211com *ic = vap->iv_ic;
+
+   /*
+* Not in 2GHz mode? Then there's no need to enable OFDM
+* 11bg protection.
+*/
+   if (! IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) {
+   return (0);
+   }
+
+   /*
+* 11bg protection not enabled? Then don't use it.
+*/
+   if ((ic->ic_flags & IEEE80211_F_USEPROT) == 0)
+   return (0);
+
+   /*
+* If it's an 11n rate, then for now we enable
+* protection.
+*/
+   if (rate & IEEE80211_RATE_MCS) {
+   return (1);
+   }
+
+   /*
+* Do a rate table lookup.  If the PHY is CCK,
+* don't do protection.
+*/
+   if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_CCK)
+   return (0);
+
+   /*
+* Yup, enable protection.
+*/
+   return (1);
+}
+
 static int
 iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
 {
@@ -3496,7 +3543,7 @@ iwn_tx_data(struct iwn_softc *sc, struct
uint16_t qos;
u_int hdrlen;
bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER];
-   uint8_t tid, ridx, txant, type;
+   uint8_t tid, type;
int ac, i, totlen, error, pad, nsegs = 0, rate;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
@@ -3546,8 +3593,6 @@ iwn_tx_data(struct iwn_softc *sc, struct
(void) ieee80211_ratectl_rate(ni, NULL, 0);
rate = ni->ni_txrate;
}
-   ridx = ieee80211_legacy_rate_lookup(ic->ic_rt,
-   rate & IEEE80211_RATE_VAL);
 
/* Encrypt the frame if need be. */
if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
@@ -3604,13 +3649,15 @@ iwn_tx_data(struct iwn_softc *sc, struct
/* NB: Group frames are sent using CCK in 802.11b/g. */
if (totlen + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) {
flags |= IWN_TX_NEED_RTS;
-   } else if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
-   ridx >= IWN_RIDX_OFDM6) {
+   } else if (iwn_check_rate_needs_protection(sc, vap, rate)) {
if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
flags |= IWN_TX_NEED_CTS;
else if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
flags |= IWN_TX_NEED_RTS;
}
+
+   /* XXX HT protection? */
+
if (flags & (IWN_TX_NEED_RTS | IWN_TX_NEED_CTS)) {
if (sc->hw_type != IWN_HW_REV_TYPE_4965) {
/* 5000 autoselects RTS/CTS or CTS-to-self. */
@@ -3654,6 +3701,7 @@ iwn_tx_data(struct iwn_softc *sc, struct
tx->data_ntries = 15;
tx->lifetime = htole32(IWN_LIFETIME_INFINITE);
tx->rate = iwn_rate_to_plcp(sc, ni, rate);
+#if 0
if (tx->id == sc->broadcast_id) {
/* Group or management frame. */
tx->linkq = 0;
@@ -3661,9 +3709,21 @@ iwn_tx_data(struct iwn_softc *sc, struct
txant = IWN_LSB(sc->txchainmask);
tx->rate |= htole32(IWN_RFLAG_ANT(txant));
} else {
+   /*
+* XXX This is no longer true.  ni_rates may actually
+* XXX need to be ni_htrates (for 11n rates) and thus
+* XXX ridx is tota

svn commit: r257132 - in head/sys/dev/usb: . serial

2013-10-25 Thread Nick Hibma
Author: n_hibma
Date: Fri Oct 25 19:39:22 2013
New Revision: 257132
URL: http://svnweb.freebsd.org/changeset/base/257132

Log:
  Add id for GTM661W.

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Fri Oct 25 19:19:12 2013
(r257131)
+++ head/sys/dev/usb/serial/u3g.c   Fri Oct 25 19:39:22 2013
(r257132)
@@ -387,6 +387,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(OPTION, GTMAXHSUPA, 0),
U3G_DEV(OPTION, GTMAXHSUPAE, 0),
U3G_DEV(OPTION, VODAFONEMC3G, 0),
+   U3G_DEV(OPTION, GTM661W, 0),
U3G_DEV(QISDA, H20_1, 0),
U3G_DEV(QISDA, H20_2, 0),
U3G_DEV(QISDA, H21_1, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Oct 25 19:19:12 2013(r257131)
+++ head/sys/dev/usb/usbdevsFri Oct 25 19:39:22 2013(r257132)
@@ -3248,6 +3248,7 @@ product OPTION GMT382 0x7501  Globetrott
 product OPTION GE40X_1 0x7301  Globetrotter HSUPA
 product OPTION GE40X_2 0x7361  Globetrotter HSUPA
 product OPTION GE40X_3 0x7381  Globetrotter HSUPA
+product OPTION GTM661W 0x9000  GTM661W
 product OPTION ICONEDGE0xc031  GlobeSurfer iCON EDGE
 product OPTION MODHSXPA0xd013  Globetrotter HSUPA
 product OPTION ICON321 0xd031  Globetrotter HSUPA
___
svn-src-all@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"


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

2013-10-25 Thread John Baldwin
On Friday, October 25, 2013 3:19:12 pm John Baldwin wrote:
> Author: jhb
> Date: Fri Oct 25 19:19:12 2013
> New Revision: 257131
> URL: http://svnweb.freebsd.org/changeset/base/257131
> 
> Log:
>   Reject attempts to attack a disk device that has the old NEEDSGIANT
>   flag set.

Actually, attacking a Giant disk device is just fine (and encouraged!),
it's attaching that is forbidden. :-P

Pointed out by: rdivacky

-- 
John Baldwin
___
svn-src-all@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"


svn commit: r257131 - head/sys/geom

2013-10-25 Thread John Baldwin
Author: jhb
Date: Fri Oct 25 19:19:12 2013
New Revision: 257131
URL: http://svnweb.freebsd.org/changeset/base/257131

Log:
  Reject attempts to attack a disk device that has the old NEEDSGIANT
  flag set.
  
  Reviewed by:  mav

Modified:
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_disk.h

Modified: head/sys/geom/geom_disk.c
==
--- head/sys/geom/geom_disk.c   Fri Oct 25 19:15:21 2013(r257130)
+++ head/sys/geom/geom_disk.c   Fri Oct 25 19:19:12 2013(r257131)
@@ -657,6 +657,13 @@ disk_create(struct disk *dp, int version
dp->d_name, dp->d_unit);
return;
}
+   if (dp->d_flags & DISKFLAG_RESERVED) {
+   printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n",
+   dp->d_name, dp->d_unit);
+   printf("WARNING: Ignoring disk %s%d\n",
+   dp->d_name, dp->d_unit);
+   return;
+   }
KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy"));
KASSERT(dp->d_name != NULL, ("disk_create need d_name"));
KASSERT(*dp->d_name != 0, ("disk_create need d_name"));

Modified: head/sys/geom/geom_disk.h
==
--- head/sys/geom/geom_disk.h   Fri Oct 25 19:15:21 2013(r257130)
+++ head/sys/geom/geom_disk.h   Fri Oct 25 19:19:12 2013(r257131)
@@ -103,6 +103,7 @@ struct disk {
void*d_drv1;
 };
 
+#define DISKFLAG_RESERVED  0x1 /* Was NEEDSGIANT */
 #define DISKFLAG_OPEN  0x2
 #define DISKFLAG_CANDELETE 0x4
 #define DISKFLAG_CANFLUSHCACHE 0x8
___
svn-src-all@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"


svn commit: r257130 - head/sys/dev/ofw

2013-10-25 Thread Ian Lepore
Author: ian
Date: Fri Oct 25 19:15:21 2013
New Revision: 257130
URL: http://svnweb.freebsd.org/changeset/base/257130

Log:
  Add a helper routine to search for a compat string in a table that
  associates compat strings with arbitrary values that mean something to
  the driver.  This is handy for drivers that support several variations
  of similar hardware and need to know which one matched.
  
  Reviewed by:  imp, jmg, nwhitehorn

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Fri Oct 25 18:43:53 2013
(r257129)
+++ head/sys/dev/ofw/ofw_bus_subr.c Fri Oct 25 19:15:21 2013
(r257130)
@@ -197,6 +197,21 @@ ofw_bus_is_compatible_strict(device_t de
return (0);
 }
 
+const struct ofw_compat_data *
+ofw_bus_search_compatible(device_t dev, const struct ofw_compat_data *compat)
+{
+
+   if (compat == NULL)
+   return NULL;
+
+   for (; compat->ocd_str != NULL; ++compat) {
+   if (ofw_bus_is_compatible(dev, compat->ocd_str))
+   break;
+   }
+
+   return (compat);
+}
+
 int
 ofw_bus_has_prop(device_t dev, const char *propname)
 {

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==
--- head/sys/dev/ofw/ofw_bus_subr.h Fri Oct 25 18:43:53 2013
(r257129)
+++ head/sys/dev/ofw/ofw_bus_subr.h Fri Oct 25 19:15:21 2013
(r257130)
@@ -47,6 +47,11 @@ struct ofw_bus_iinfo {
pcell_t opi_addrc;
 };
 
+struct ofw_compat_data {
+   const char  *ocd_str;
+   uintptr_tocd_data;
+};
+
 /* Generic implementation of ofw_bus_if.m methods and helper routines */
 intofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t);
 void   ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *);
@@ -74,6 +79,16 @@ void ofw_bus_find_iparent(phandle_t);
 int ofw_bus_is_compatible(device_t, const char *);
 int ofw_bus_is_compatible_strict(device_t, const char *);
 
+/* 
+ * Helper routine to search a list of compat properties.  The table is
+ * terminated by an entry with a NULL compat-string pointer; a pointer to that
+ * table entry is returned if none of the compat strings match for the device,
+ * giving you control over the not-found value.  Will not return NULL unless 
the
+ * provided table pointer is NULL.
+ */
+const struct ofw_compat_data *
+ofw_bus_search_compatible(device_t, const struct ofw_compat_data *);
+
 /* Helper routine for checking existence of a prop */
 int ofw_bus_has_prop(device_t, const char *);
 
___
svn-src-all@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"


svn commit: r257129 - head/contrib/subversion/subversion/libsvn_subr

2013-10-25 Thread Colin Percival
Author: cperciva
Date: Fri Oct 25 18:43:53 2013
New Revision: 257129
URL: http://svnweb.freebsd.org/changeset/base/257129

Log:
  Remove time and date stamps from svn* binaries, in order to make the
  builds reproducible.
  
  Reviewed by:  peter
  MFC after:3 days

Modified:
  head/contrib/subversion/subversion/libsvn_subr/opt.c
  head/contrib/subversion/subversion/libsvn_subr/version.c

Modified: head/contrib/subversion/subversion/libsvn_subr/opt.c
==
--- head/contrib/subversion/subversion/libsvn_subr/opt.cFri Oct 25 
18:39:01 2013(r257128)
+++ head/contrib/subversion/subversion/libsvn_subr/opt.cFri Oct 25 
18:43:53 2013(r257129)
@@ -1115,10 +1115,8 @@ svn_opt__print_version_info(const char *
 return svn_cmdline_printf(pool, "%s\n", SVN_VER_NUMBER);
 
   SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n"
- "   compiled %s, %s on %s\n\n"),
+ "   compiled on %s\n\n"),
  pgm_name, SVN_VERSION,
- svn_version_ext_build_date(info),
- svn_version_ext_build_time(info),
  svn_version_ext_build_host(info)));
   SVN_ERR(svn_cmdline_printf(pool, "%s\n", svn_version_ext_copyright(info)));
 

Modified: head/contrib/subversion/subversion/libsvn_subr/version.c
==
--- head/contrib/subversion/subversion/libsvn_subr/version.cFri Oct 25 
18:39:01 2013(r257128)
+++ head/contrib/subversion/subversion/libsvn_subr/version.cFri Oct 25 
18:43:53 2013(r257129)
@@ -125,8 +125,8 @@ svn_version_extended(svn_boolean_t verbo
 {
   svn_version_extended_t *info = apr_pcalloc(pool, sizeof(*info));
 
-  info->build_date = __DATE__;
-  info->build_time = __TIME__;
+  info->build_date = NULL;
+  info->build_time = NULL;
   info->build_host = SVN_BUILD_HOST;
   info->copyright = apr_pstrdup
 (pool, _("Copyright (C) 2013 The Apache Software Foundation.\n"
___
svn-src-all@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"


svn commit: r257128 - stable/10/usr.sbin/bhyve

2013-10-25 Thread Peter Grehan
Author: grehan
Date: Fri Oct 25 18:39:01 2013
New Revision: 257128
URL: http://svnweb.freebsd.org/changeset/base/257128

Log:
  MFC r256926, r257005
  
  r256926
Fix AHCI ATAPI emulation when backed with /dev/cd0
  
- remove assumption that the backing file/device had
  512-byte sectors
- fix incorrect iovec size variable that would result
  in a buffer overrun when an o/s issued an i/o request
  with more s/g elements than the blockif api
  
  r257005
Export the block size capability to guests.
- Use #defines for capability bits
- Export the VTBLK_F_BLK_SIZE capability
- Fix bug in calculating capacity: it is in
  512-byte units, not the underlying sector size
  
This allows virtio-blk to have backing devices
with non 512-byte sector sizes e.g. /dev/cd0, and
4K-block harddrives.
  
  Approved by:  re (glebius)

Modified:
  stable/10/usr.sbin/bhyve/pci_ahci.c
  stable/10/usr.sbin/bhyve/pci_virtio_block.c
Directory Properties:
  stable/10/usr.sbin/bhyve/   (props changed)

Modified: stable/10/usr.sbin/bhyve/pci_ahci.c
==
--- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 25 18:38:44 2013
(r257127)
+++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Oct 25 18:39:01 2013
(r257128)
@@ -663,8 +663,7 @@ atapi_read_capacity(struct ahci_port *p,
uint8_t buf[8];
uint64_t sectors;
 
-   sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx);
-   sectors >>= 2;
+   sectors = blockif_size(p->bctx) / 2048;
be32enc(buf, sectors - 1);
be32enc(buf + 4, 2048);
cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN;
@@ -908,9 +907,9 @@ atapi_read(struct ahci_port *p, int slot
/*
 * Build up the iovec based on the prdt
 */
-   for (i = 0; i < hdr->prdtl; i++) {
+   for (i = 0; i < iovcnt; i++) {
breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc),
-   prdt->dba, prdt->dbc + 1);
+   prdt->dba, prdt->dbc + 1);
breq->br_iov[i].iov_len = prdt->dbc + 1;
aior->done += (prdt->dbc + 1);
prdt++;

Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c
==
--- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 25 18:38:44 2013
(r257127)
+++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Oct 25 18:39:01 2013
(r257128)
@@ -66,11 +66,16 @@ __FBSDID("$FreeBSD$");
 
 #defineVTBLK_BLK_ID_BYTES  20
 
+/* Capability bits */
+#defineVTBLK_F_SEG_MAX (1 << 2)/* Maximum request 
segments */
+#defineVTBLK_F_BLK_SIZE(1 << 6)/* cfg block size valid 
*/
+
 /*
  * Host capabilities
  */
 #define VTBLK_S_HOSTCAPS  \
-  ( 0x0004 |   /* host maximum request segments */ \
+  ( VTBLK_F_SEG_MAX  | \
+VTBLK_F_BLK_SIZE | \
 VIRTIO_RING_F_INDIRECT_DESC )  /* indirect descriptors */
 
 /*
@@ -315,7 +320,7 @@ pci_vtblk_init(struct vmctx *ctx, struct
digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]);
 
/* setup virtio block config space */
-   sc->vbsc_cfg.vbc_capacity = size / sectsz;
+   sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */
sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS;
sc->vbsc_cfg.vbc_blk_size = sectsz;
sc->vbsc_cfg.vbc_size_max = 0;  /* not negotiated */
___
svn-src-all@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"


svn commit: r257127 - in head/sys: arm/broadcom/bcm2835 arm/lpc boot/uboot/lib dev/cesa dev/fdt powerpc/mpc85xx

2013-10-25 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Oct 25 18:38:44 2013
New Revision: 257127
URL: http://svnweb.freebsd.org/changeset/base/257127

Log:
  Remove all the instances of '#undef DEBUG' from kernel.
  
  Suggested by: rpaulo
  Approved by:  adrian (mentor)

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  head/sys/arm/lpc/if_lpe.c
  head/sys/arm/lpc/lpc_mmc.c
  head/sys/boot/uboot/lib/disk.c
  head/sys/boot/uboot/lib/glue.c
  head/sys/dev/cesa/cesa.c
  head/sys/dev/fdt/fdt_slicer.c
  head/sys/powerpc/mpc85xx/fsl_sdhc.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cFri Oct 25 17:15:57 
2013(r257126)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cFri Oct 25 18:38:44 
2013(r257127)
@@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$");
 
 #include "gpio_if.h"
 
-#undef DEBUG
-
 #ifdef DEBUG
 #define dprintf(fmt, args...) do { printf("%s(): ", __func__);   \
 printf(fmt,##args); } while (0)

Modified: head/sys/arm/lpc/if_lpe.c
==
--- head/sys/arm/lpc/if_lpe.c   Fri Oct 25 17:15:57 2013(r257126)
+++ head/sys/arm/lpc/if_lpe.c   Fri Oct 25 18:38:44 2013(r257127)
@@ -64,9 +64,6 @@ __FBSDID("$FreeBSD$");
 
 #include "miibus_if.h"
 
-#defineDEBUG
-#undef DEBUG
-
 #ifdef DEBUG
 #define debugf(fmt, args...) do { printf("%s(): ", __func__);   \
 printf(fmt,##args); } while (0)

Modified: head/sys/arm/lpc/lpc_mmc.c
==
--- head/sys/arm/lpc/lpc_mmc.c  Fri Oct 25 17:15:57 2013(r257126)
+++ head/sys/arm/lpc/lpc_mmc.c  Fri Oct 25 18:38:44 2013(r257127)
@@ -65,9 +65,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#defineDEBUG
-#undef DEBUG
-
 #ifdef DEBUG
 #define debugf(fmt, args...) do { printf("%s(): ", __func__);   \
 printf(fmt,##args); } while (0)

Modified: head/sys/boot/uboot/lib/disk.c
==
--- head/sys/boot/uboot/lib/disk.c  Fri Oct 25 17:15:57 2013
(r257126)
+++ head/sys/boot/uboot/lib/disk.c  Fri Oct 25 18:38:44 2013
(r257127)
@@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$");
 #include "glue.h"
 #include "libuboot.h"
 
-#define DEBUG
-#undef DEBUG
-
 #define stor_printf(fmt, args...) do { \
 printf("%s%d: ", dev->d_dev->dv_name, dev->d_unit);\
 printf(fmt, ##args);   \

Modified: head/sys/boot/uboot/lib/glue.c
==
--- head/sys/boot/uboot/lib/glue.c  Fri Oct 25 17:15:57 2013
(r257126)
+++ head/sys/boot/uboot/lib/glue.c  Fri Oct 25 18:38:44 2013
(r257127)
@@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$");
 #include "api_public.h"
 #include "glue.h"
 
-#define DEBUG
-#undef DEBUG
-
 #ifdef DEBUG
 #definedebugf(fmt, args...) do { printf("%s(): ", __func__); 
printf(fmt,##args); } while (0)
 #else

Modified: head/sys/dev/cesa/cesa.c
==
--- head/sys/dev/cesa/cesa.cFri Oct 25 17:15:57 2013(r257126)
+++ head/sys/dev/cesa/cesa.cFri Oct 25 18:38:44 2013(r257127)
@@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "cesa.h"
 
-#undef DEBUG
-
 static int cesa_probe(device_t);
 static int cesa_attach(device_t);
 static int cesa_detach(device_t);

Modified: head/sys/dev/fdt/fdt_slicer.c
==
--- head/sys/dev/fdt/fdt_slicer.c   Fri Oct 25 17:15:57 2013
(r257126)
+++ head/sys/dev/fdt/fdt_slicer.c   Fri Oct 25 18:38:44 2013
(r257127)
@@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#define DEBUG
-#undef DEBUG
-
 #ifdef DEBUG
 #define debugf(fmt, args...) do { printf("%s(): ", __func__);  \
 printf(fmt,##args); } while (0)

Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c
==
--- head/sys/powerpc/mpc85xx/fsl_sdhc.c Fri Oct 25 17:15:57 2013
(r257126)
+++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Fri Oct 25 18:38:44 2013
(r257127)
@@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$");
 
 #include "fsl_sdhc.h"
 
-#define DEBUG
-#undef DEBUG
 #ifdef DEBUG
 #defineDPRINTF(fmt, arg...)printf("DEBUG %s(): " fmt, 
__FUNCTION__, ##arg)
 #else
___
svn-src-all@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"


svn commit: r257126 - in stable/9/sys: kern sys

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 17:15:57 2013
New Revision: 257126
URL: http://svnweb.freebsd.org/changeset/base/257126

Log:
  MFC r256504:
  Add a sysctl kern.disallow_high_osrel which disables executing the
  images compiled on the world with higher major version number than the
  high version number of the booted kernel.  Default to disable.

Modified:
  stable/9/sys/kern/kern_exec.c
  stable/9/sys/sys/param.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/kern/kern_exec.c
==
--- stable/9/sys/kern/kern_exec.c   Fri Oct 25 17:04:46 2013
(r257125)
+++ stable/9/sys/kern/kern_exec.c   Fri Oct 25 17:15:57 2013
(r257126)
@@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
 &ps_arg_cache_limit, 0, "");
 
+static int disallow_high_osrel;
+SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW,
+&disallow_high_osrel, 0,
+"Disallow execution of binaries built for higher version of the world");
+
 static int map_at_zero = 0;
 TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
 SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
@@ -558,6 +563,15 @@ interpret:
 vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0))
imgp->execpath = args->fname;
 
+   if (disallow_high_osrel &&
+   P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) {
+   error = ENOEXEC;
+   uprintf("Osrel %d for image %s too high\n", p->p_osrel,
+   imgp->execpath != NULL ? imgp->execpath : "");
+   vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
+   goto exec_fail_dealloc;
+   }
+
/*
 * Copy out strings (args and env) and initialize stack base
 */

Modified: stable/9/sys/sys/param.h
==
--- stable/9/sys/sys/param.hFri Oct 25 17:04:46 2013(r257125)
+++ stable/9/sys/sys/param.hFri Oct 25 17:15:57 2013(r257126)
@@ -80,6 +80,8 @@
 #defineP_OSREL_SIGWAIT 70
 #defineP_OSREL_SIGSEGV 74
 #defineP_OSREL_MAP_ANON800104
+
+#defineP_OSREL_MAJOR(x)((x) / 10)
 #endif
 
 #ifndef LOCORE
___
svn-src-all@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"


svn commit: r257125 - in stable/9/sys: fs/devfs kern sys

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 17:04:46 2013
New Revision: 257125
URL: http://svnweb.freebsd.org/changeset/base/257125

Log:
  MFC r256502:
  Similar to debug.iosize_max_clamp sysctl, introduce
  devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized
  i/o requests on the devfs files.

Modified:
  stable/9/sys/fs/devfs/devfs_vnops.c
  stable/9/sys/kern/sys_generic.c
  stable/9/sys/sys/systm.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/fs/devfs/devfs_vnops.c
==
--- stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:49:32 2013
(r257124)
+++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 17:04:46 2013
(r257125)
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1178,6 +1179,8 @@ devfs_read_f(struct file *fp, struct uio
struct cdevsw *dsw;
struct file *fpop;
 
+   if (uio->uio_resid > DEVFS_IOSIZE_MAX)
+   return (EINVAL);
fpop = td->td_fpop;
error = devfs_fp_check(fp, &dev, &dsw, &ref);
if (error)
@@ -1653,6 +1656,8 @@ devfs_write_f(struct file *fp, struct ui
struct cdevsw *dsw;
struct file *fpop;
 
+   if (uio->uio_resid > DEVFS_IOSIZE_MAX)
+   return (EINVAL);
fpop = td->td_fpop;
error = devfs_fp_check(fp, &dev, &dsw, &ref);
if (error)

Modified: stable/9/sys/kern/sys_generic.c
==
--- stable/9/sys/kern/sys_generic.c Fri Oct 25 16:49:32 2013
(r257124)
+++ stable/9/sys/kern/sys_generic.c Fri Oct 25 17:04:46 2013
(r257125)
@@ -77,6 +77,10 @@ __FBSDID("$FreeBSD$");
 int iosize_max_clamp = 1;
 SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW,
 &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX");
+int devfs_iosize_max_clamp = 1;
+SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW,
+&devfs_iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices");
+
 /*
  * Assert that the return value of read(2) and write(2) syscalls fits
  * into a register.  If not, an architecture will need to provide the

Modified: stable/9/sys/sys/systm.h
==
--- stable/9/sys/sys/systm.hFri Oct 25 16:49:32 2013(r257124)
+++ stable/9/sys/sys/systm.hFri Oct 25 17:04:46 2013(r257125)
@@ -138,7 +138,9 @@ extern const void *zero_region; /* addre
 
 extern int unmapped_buf_allowed;
 extern int iosize_max_clamp;
+extern int devfs_iosize_max_clamp;
 #defineIOSIZE_MAX  (iosize_max_clamp ? INT_MAX : SSIZE_MAX)
+#defineDEVFS_IOSIZE_MAX(devfs_iosize_max_clamp ? INT_MAX : 
SSIZE_MAX)
 
 /*
  * General function declarations.
___
svn-src-all@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"


svn commit: r257124 - stable/9/sys/fs/devfs

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 16:49:32 2013
New Revision: 257124
URL: http://svnweb.freebsd.org/changeset/base/257124

Log:
  MFC r256501:
  Remove two instances of ARGSUSED comment, and wrap lines nearby the
  code that is to be changed.

Modified:
  stable/9/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/devfs/devfs_vnops.c
==
--- stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:36:16 2013
(r257123)
+++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Oct 25 16:49:32 2013
(r257124)
@@ -1168,9 +1168,9 @@ devfs_print(struct vop_print_args *ap)
return (0);
 }
 
-/* ARGSUSED */
 static int
-devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, 
struct thread *td)
+devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred,
+int flags, struct thread *td)
 {
struct cdev *dev;
int ioflag, error, ref;
@@ -1643,9 +1643,9 @@ devfs_truncate_f(struct file *fp, off_t 
return (vnops.fo_truncate(fp, length, cred, td));
 }
 
-/* ARGSUSED */
 static int
-devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, 
struct thread *td)
+devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred,
+int flags, struct thread *td)
 {
struct cdev *dev;
int error, ioflag, ref;
___
svn-src-all@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"


svn commit: r257123 - in stable/10/sys: kern sys

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 16:36:16 2013
New Revision: 257123
URL: http://svnweb.freebsd.org/changeset/base/257123

Log:
  MFC r256504:
  Add a sysctl kern.disallow_high_osrel which disables executing the
  images compiled on the world with higher major version number than the
  high version number of the booted kernel.  Default to disable.
  
  Approved by:  re (glebius)

Modified:
  stable/10/sys/kern/kern_exec.c
  stable/10/sys/sys/param.h
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/kern/kern_exec.c
==
--- stable/10/sys/kern/kern_exec.c  Fri Oct 25 16:33:24 2013
(r257122)
+++ stable/10/sys/kern/kern_exec.c  Fri Oct 25 16:36:16 2013
(r257123)
@@ -123,6 +123,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
 &ps_arg_cache_limit, 0, "");
 
+static int disallow_high_osrel;
+SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW,
+&disallow_high_osrel, 0,
+"Disallow execution of binaries built for higher version of the world");
+
 static int map_at_zero = 0;
 TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
 SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
@@ -552,6 +557,15 @@ interpret:
 vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0))
imgp->execpath = args->fname;
 
+   if (disallow_high_osrel &&
+   P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) {
+   error = ENOEXEC;
+   uprintf("Osrel %d for image %s too high\n", p->p_osrel,
+   imgp->execpath != NULL ? imgp->execpath : "");
+   vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
+   goto exec_fail_dealloc;
+   }
+
/*
 * Copy out strings (args and env) and initialize stack base
 */

Modified: stable/10/sys/sys/param.h
==
--- stable/10/sys/sys/param.h   Fri Oct 25 16:33:24 2013(r257122)
+++ stable/10/sys/sys/param.h   Fri Oct 25 16:36:16 2013(r257123)
@@ -80,6 +80,8 @@
 #defineP_OSREL_SIGWAIT 70
 #defineP_OSREL_SIGSEGV 74
 #defineP_OSREL_MAP_ANON800104
+
+#defineP_OSREL_MAJOR(x)((x) / 10)
 #endif
 
 #ifndef LOCORE
___
svn-src-all@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"


svn commit: r257122 - in stable/10/sys: fs/devfs kern sys

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 16:33:24 2013
New Revision: 257122
URL: http://svnweb.freebsd.org/changeset/base/257122

Log:
  MFC r256502:
  Similar to debug.iosize_max_clamp sysctl, introduce
  devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized
  i/o requests on the devfs files.
  
  Approved by:  re (glebius)

Modified:
  stable/10/sys/fs/devfs/devfs_vnops.c
  stable/10/sys/kern/sys_generic.c
  stable/10/sys/sys/systm.h
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/fs/devfs/devfs_vnops.c
==
--- stable/10/sys/fs/devfs/devfs_vnops.cFri Oct 25 16:31:28 2013
(r257121)
+++ stable/10/sys/fs/devfs/devfs_vnops.cFri Oct 25 16:33:24 2013
(r257122)
@@ -1178,6 +1178,8 @@ devfs_read_f(struct file *fp, struct uio
struct cdevsw *dsw;
struct file *fpop;
 
+   if (uio->uio_resid > DEVFS_IOSIZE_MAX)
+   return (EINVAL);
fpop = td->td_fpop;
error = devfs_fp_check(fp, &dev, &dsw, &ref);
if (error)
@@ -1653,6 +1655,8 @@ devfs_write_f(struct file *fp, struct ui
struct cdevsw *dsw;
struct file *fpop;
 
+   if (uio->uio_resid > DEVFS_IOSIZE_MAX)
+   return (EINVAL);
fpop = td->td_fpop;
error = devfs_fp_check(fp, &dev, &dsw, &ref);
if (error)

Modified: stable/10/sys/kern/sys_generic.c
==
--- stable/10/sys/kern/sys_generic.cFri Oct 25 16:31:28 2013
(r257121)
+++ stable/10/sys/kern/sys_generic.cFri Oct 25 16:33:24 2013
(r257122)
@@ -78,6 +78,10 @@ __FBSDID("$FreeBSD$");
 int iosize_max_clamp = 1;
 SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW,
 &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX");
+int devfs_iosize_max_clamp = 1;
+SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW,
+&devfs_iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices");
+
 /*
  * Assert that the return value of read(2) and write(2) syscalls fits
  * into a register.  If not, an architecture will need to provide the

Modified: stable/10/sys/sys/systm.h
==
--- stable/10/sys/sys/systm.h   Fri Oct 25 16:31:28 2013(r257121)
+++ stable/10/sys/sys/systm.h   Fri Oct 25 16:33:24 2013(r257122)
@@ -146,7 +146,9 @@ extern const void *zero_region; /* addre
 
 extern int unmapped_buf_allowed;
 extern int iosize_max_clamp;
+extern int devfs_iosize_max_clamp;
 #defineIOSIZE_MAX  (iosize_max_clamp ? INT_MAX : SSIZE_MAX)
+#defineDEVFS_IOSIZE_MAX(devfs_iosize_max_clamp ? INT_MAX : 
SSIZE_MAX)
 
 /*
  * General function declarations.
___
svn-src-all@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"


svn commit: r257121 - stable/10/sys/fs/devfs

2013-10-25 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 25 16:31:28 2013
New Revision: 257121
URL: http://svnweb.freebsd.org/changeset/base/257121

Log:
  MFC r256501:
  Remove two instances of ARGSUSED comment, and wrap lines nearby the
  code that is to be changed.
  
  Approved by:  re (glebius)

Modified:
  stable/10/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/fs/devfs/devfs_vnops.c
==
--- stable/10/sys/fs/devfs/devfs_vnops.cFri Oct 25 15:45:29 2013
(r257120)
+++ stable/10/sys/fs/devfs/devfs_vnops.cFri Oct 25 16:31:28 2013
(r257121)
@@ -1168,9 +1168,9 @@ devfs_print(struct vop_print_args *ap)
return (0);
 }
 
-/* ARGSUSED */
 static int
-devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, 
struct thread *td)
+devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred,
+int flags, struct thread *td)
 {
struct cdev *dev;
int ioflag, error, ref;
@@ -1643,9 +1643,9 @@ devfs_truncate_f(struct file *fp, off_t 
return (vnops.fo_truncate(fp, length, cred, td));
 }
 
-/* ARGSUSED */
 static int
-devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, 
struct thread *td)
+devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred,
+int flags, struct thread *td)
 {
struct cdev *dev;
int error, ioflag, ref;
___
svn-src-all@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"


svn commit: r257120 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2013-10-25 Thread Xin LI
Author: delphij
Date: Fri Oct 25 15:45:29 2013
New Revision: 257120
URL: http://svnweb.freebsd.org/changeset/base/257120

Log:
  MFC r253816: MFV r253780:
  
  To quote Illumos #3875:
  
  The problem here is that if we ever end up in the error
  path, we drop the locks protecting access to the zfsvfs_t
  prior to forcibly unmounting the filesystem. Because z_os
  is NULL, any thread that had already picked up the zfsvfs_t
  and was sitting in ZFS_ENTER() when we dropped our locks
  in zfs_resume_fs() will now acquire the lock, attempt to
  use z_os, and panic.
  
  Illumos ZFS issues:
3875 panic in zfs_root() after failed rollback

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
Fri Oct 25 15:43:59 2013(r257119)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
Fri Oct 25 15:45:29 2013(r257120)
@@ -514,6 +514,38 @@ dmu_objset_rele(objset_t *os, void *tag)
dsl_pool_rele(dp, tag);
 }
 
+/*
+ * When we are called, os MUST refer to an objset associated with a dataset
+ * that is owned by 'tag'; that is, is held and long held by 'tag' and ds_owner
+ * == tag.  We will then release and reacquire ownership of the dataset while
+ * holding the pool config_rwlock to avoid intervening namespace or ownership
+ * changes may occur.
+ *
+ * This exists solely to accommodate zfs_ioc_userspace_upgrade()'s desire to
+ * release the hold on its dataset and acquire a new one on the dataset of the
+ * same name so that it can be partially torn down and reconstructed.
+ */
+void
+dmu_objset_refresh_ownership(objset_t *os, void *tag)
+{
+   dsl_pool_t *dp;
+   dsl_dataset_t *ds, *newds;
+   char name[MAXNAMELEN];
+
+   ds = os->os_dsl_dataset;
+   VERIFY3P(ds, !=, NULL);
+   VERIFY3P(ds->ds_owner, ==, tag);
+   VERIFY(dsl_dataset_long_held(ds));
+
+   dsl_dataset_name(ds, name);
+   dp = dmu_objset_pool(os);
+   dsl_pool_config_enter(dp, FTAG);
+   dmu_objset_disown(os, tag);
+   VERIFY0(dsl_dataset_own(dp, name, tag, &newds));
+   VERIFY3P(newds, ==, os->os_dsl_dataset);
+   dsl_pool_config_exit(dp, FTAG);
+}
+
 void
 dmu_objset_disown(objset_t *os, void *tag)
 {

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Fri Oct 
25 15:43:59 2013(r257119)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Fri Oct 
25 15:45:29 2013(r257120)
@@ -1602,7 +1602,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t *
if (error != 0)
return (error);
error = dsl_dataset_clone_swap_check_impl(drc->drc_ds,
-   origin_head, drc->drc_force);
+   origin_head, drc->drc_force, drc->drc_owner, tx);
if (error != 0) {
dsl_dataset_rele(origin_head, FTAG);
return (error);
@@ -1654,6 +1654,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t
 
dsl_dataset_rele(origin_head, FTAG);
dsl_destroy_head_sync_impl(drc->drc_ds, tx);
+
+   if (drc->drc_owner != NULL)
+   VERIFY3P(origin_head->ds_owner, ==, drc->drc_owner);
} else {
dsl_dataset_t *ds = drc->drc_ds;
 
@@ -1752,8 +1755,10 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc)
 }
 
 int
-dmu_recv_end(dmu_recv_cookie_t *drc)
+dmu_recv_end(dmu_recv_cookie_t *drc, void *owner)
 {
+   drc->drc_owner = owner;
+
if (drc->drc_newfs)
return (dmu_recv_new_end(drc));
else

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   
Fri Oct 25 15:43:59 2013(r257119)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   

svn commit: r257119 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2013-10-25 Thread Xin LI
Author: delphij
Date: Fri Oct 25 15:43:59 2013
New Revision: 257119
URL: http://svnweb.freebsd.org/changeset/base/257119

Log:
  MFC r253816: MFV r253780:
  
  To quote Illumos #3875:
  
  The problem here is that if we ever end up in the error
  path, we drop the locks protecting access to the zfsvfs_t
  prior to forcibly unmounting the filesystem. Because z_os
  is NULL, any thread that had already picked up the zfsvfs_t
  and was sitting in ZFS_ENTER() when we dropped our locks
  in zfs_resume_fs() will now acquire the lock, attempt to
  use z_os, and panic.
  
  Illumos ZFS issues:
3875 panic in zfs_root() after failed rollback

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
Fri Oct 25 15:37:58 2013(r257118)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
Fri Oct 25 15:43:59 2013(r257119)
@@ -517,6 +517,38 @@ dmu_objset_rele(objset_t *os, void *tag)
dsl_pool_rele(dp, tag);
 }
 
+/*
+ * When we are called, os MUST refer to an objset associated with a dataset
+ * that is owned by 'tag'; that is, is held and long held by 'tag' and ds_owner
+ * == tag.  We will then release and reacquire ownership of the dataset while
+ * holding the pool config_rwlock to avoid intervening namespace or ownership
+ * changes may occur.
+ *
+ * This exists solely to accommodate zfs_ioc_userspace_upgrade()'s desire to
+ * release the hold on its dataset and acquire a new one on the dataset of the
+ * same name so that it can be partially torn down and reconstructed.
+ */
+void
+dmu_objset_refresh_ownership(objset_t *os, void *tag)
+{
+   dsl_pool_t *dp;
+   dsl_dataset_t *ds, *newds;
+   char name[MAXNAMELEN];
+
+   ds = os->os_dsl_dataset;
+   VERIFY3P(ds, !=, NULL);
+   VERIFY3P(ds->ds_owner, ==, tag);
+   VERIFY(dsl_dataset_long_held(ds));
+
+   dsl_dataset_name(ds, name);
+   dp = dmu_objset_pool(os);
+   dsl_pool_config_enter(dp, FTAG);
+   dmu_objset_disown(os, tag);
+   VERIFY0(dsl_dataset_own(dp, name, tag, &newds));
+   VERIFY3P(newds, ==, os->os_dsl_dataset);
+   dsl_pool_config_exit(dp, FTAG);
+}
+
 void
 dmu_objset_disown(objset_t *os, void *tag)
 {

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Fri Oct 
25 15:37:58 2013(r257118)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Fri Oct 
25 15:43:59 2013(r257119)
@@ -1602,7 +1602,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t *
if (error != 0)
return (error);
error = dsl_dataset_clone_swap_check_impl(drc->drc_ds,
-   origin_head, drc->drc_force);
+   origin_head, drc->drc_force, drc->drc_owner, tx);
if (error != 0) {
dsl_dataset_rele(origin_head, FTAG);
return (error);
@@ -1654,6 +1654,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t
 
dsl_dataset_rele(origin_head, FTAG);
dsl_destroy_head_sync_impl(drc->drc_ds, tx);
+
+   if (drc->drc_owner != NULL)
+   VERIFY3P(origin_head->ds_owner, ==, drc->drc_owner);
} else {
dsl_dataset_t *ds = drc->drc_ds;
 
@@ -1752,8 +1755,10 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc)
 }
 
 int
-dmu_recv_end(dmu_recv_cookie_t *drc)
+dmu_recv_end(dmu_recv_cookie_t *drc, void *owner)
 {
+   drc->drc_owner = owner;
+
if (drc->drc_newfs)
return (dmu_recv_new_end(drc));
else

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   
Fri Oct 25 15:37:58 2013(r257118)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   
Fri Oct 25 15:43:59 2013(r2571

svn commit: r257118 - head/sys/dev/ofw

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Oct 25 15:37:58 2013
New Revision: 257118
URL: http://svnweb.freebsd.org/changeset/base/257118

Log:
  Make sure to get the right node when looking up #interrupt-cells.

Modified:
  head/sys/dev/ofw/ofw_nexus.c

Modified: head/sys/dev/ofw/ofw_nexus.c
==
--- head/sys/dev/ofw/ofw_nexus.cFri Oct 25 14:43:16 2013
(r257117)
+++ head/sys/dev/ofw/ofw_nexus.cFri Oct 25 15:37:58 2013
(r257118)
@@ -464,8 +464,8 @@ nexus_setup_dinfo(device_t dev, phandle_
iparent = 0;
OF_searchencprop(node, "interrupt-parent", &iparent,
sizeof(iparent));
-   OF_searchencprop(iparent, "#interrupt-cells", &icells,
-   sizeof(icells));
+   OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells",
+   &icells, sizeof(icells));
for (i = 0; i < nintr; i+= icells) {
intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]);
resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i],
___
svn-src-all@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"


svn commit: r257117 - in head/sys: conf powerpc/mpc85xx

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Oct 25 14:43:16 2013
New Revision: 257117
URL: http://svnweb.freebsd.org/changeset/base/257117

Log:
  Convert e500 PCI driver to use common PPC PCI bus glue. No functional
  changes.

Added:
  head/sys/powerpc/mpc85xx/pci_mpc85xx.c
 - copied, changed from r257116, head/sys/powerpc/mpc85xx/pci_fdt.c
Deleted:
  head/sys/powerpc/mpc85xx/pci_fdt.c
Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Fri Oct 25 14:38:46 2013(r257116)
+++ head/sys/conf/files.powerpc Fri Oct 25 14:43:16 2013(r257117)
@@ -132,12 +132,12 @@ powerpc/mpc85xx/i2c.c optionaliicbus f
 powerpc/mpc85xx/isa.c  optionalmpc85xx isa
 powerpc/mpc85xx/lbc.c  optionalmpc85xx
 powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx
-powerpc/mpc85xx/pci_fdt.c  optionalpci mpc85xx
+powerpc/mpc85xx/pci_mpc85xx.c  optionalpci mpc85xx
 powerpc/ofw/ofw_cpu.c  optionalaim
 powerpc/ofw/ofw_machdep.c  optionalaim
-powerpc/ofw/ofw_pci.c  optionalpci aim
-powerpc/ofw/ofw_pcibus.c   optionalpci aim
-powerpc/ofw/ofw_pcib_pci.c optionalpci aim
+powerpc/ofw/ofw_pci.c  optionalpci
+powerpc/ofw/ofw_pcibus.c   optionalpci
+powerpc/ofw/ofw_pcib_pci.c optionalpci
 powerpc/ofw/ofw_real.c optionalaim
 powerpc/ofw/ofw_syscons.c  optionalsc aim
 powerpc/ofw/ofwcall32.Soptionalaim powerpc

Copied and modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c (from r257116, 
head/sys/powerpc/mpc85xx/pci_fdt.c)
==
--- head/sys/powerpc/mpc85xx/pci_fdt.c  Fri Oct 25 14:38:46 2013
(r257116, copy source)
+++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c  Fri Oct 25 14:43:16 2013
(r257117)
@@ -55,13 +55,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include "ofw_bus_if.h"
 #include "pcib_if.h"
 
@@ -98,20 +100,15 @@ __FBSDID("$FreeBSD$");
 #defineDEVFN(b, s, f)  ((b << 16) | (s << 8) | f)
 
 struct fsl_pcib_softc {
+   struct ofw_pci_softc pci_sc;
device_tsc_dev;
 
-   struct rman sc_iomem;
-   bus_addr_t  sc_iomem_va;/* Virtual mapping. */
-   bus_addr_t  sc_iomem_size;
-   bus_addr_t  sc_iomem_alloc; /* Next allocation. */
int sc_iomem_target;
-   struct rman sc_ioport;
-   bus_addr_t  sc_ioport_va;   /* Virtual mapping. */
-   bus_addr_t  sc_ioport_size;
-   bus_addr_t  sc_ioport_alloc;/* Next allocation. */
+   bus_addr_t  sc_iomem_alloc, sc_iomem_start, sc_iomem_end;
int sc_ioport_target;
+   bus_addr_t  sc_ioport_alloc, sc_ioport_start, sc_ioport_end;
 
-   struct resource *sc_res;
+   struct resource *sc_res;
bus_space_handle_t sc_bsh;
bus_space_tag_t sc_bst;
int sc_rid;
@@ -123,8 +120,6 @@ struct fsl_pcib_softc {
/* Devices that need special attention. */
int sc_devfn_tundra;
int sc_devfn_via_ide;
-
-   struct fdt_pci_intr sc_intr_info;
 };
 
 /* Local forward declerations. */
@@ -137,9 +132,6 @@ static void fsl_pcib_err_init(device_t);
 static void fsl_pcib_inbound(struct fsl_pcib_softc *, int, int, u_long,
 u_long, u_long);
 static int fsl_pcib_init(struct fsl_pcib_softc *, int, int);
-static int fsl_pcib_intr_info(phandle_t, struct fsl_pcib_softc *);
-static int fsl_pcib_set_range(struct fsl_pcib_softc *, int, int, u_long,
-u_long);
 static void fsl_pcib_outbound(struct fsl_pcib_softc *, int, int, u_long,
 u_long, u_long);
 
@@ -148,13 +140,6 @@ static int fsl_pcib_attach(device_t);
 static int fsl_pcib_detach(device_t);
 static int fsl_pcib_probe(device_t);
 
-static struct resource *fsl_pcib_alloc_resource(device_t, device_t, int, int *,
-u_long, u_long, u_long, u_int);
-static int fsl_pcib_read_ivar(device_t, device_t, int, uintptr_t *);
-static int fsl_pcib_release_resource(device_t, device_t, int, int,
-struct resource *);
-static int fsl_pcib_write_ivar(device_t, device_t, int, uintptr_t);
-
 static int fsl_pcib_maxslots(device_t);
 static uint32_t fsl_pcib_read_config(device_t, u_int, u_int, u_int, u_int, 
int);
 static void fsl_pcib_write_config(device_t, u_int, u_int, u_int, u_int,
@@ -173,53 +158,30 @@ static device_method_t fsl_pcib_methods[
DEVMETHOD(device_attach,fsl_pcib_attach),
DEVMETHOD(device_detach,fsl_pcib_detach),
 
-   /* Bus interface */
-   DEVMETHOD(bus_read_ivar,fsl_pcib_read_ivar),
-   DEVMETHOD(bus_write_

svn commit: r257116 - head/sys/powerpc/powerpc

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Oct 25 14:38:46 2013
New Revision: 257116
URL: http://svnweb.freebsd.org/changeset/base/257116

Log:
  Remove dead reference to PSL_MBO.

Modified:
  head/sys/powerpc/powerpc/exec_machdep.c

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==
--- head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 14:37:15 2013
(r257115)
+++ head/sys/powerpc/powerpc/exec_machdep.c Fri Oct 25 14:38:46 2013
(r257116)
@@ -1036,7 +1036,7 @@ cpu_set_upcall_kse(struct thread *td, vo
tf->srr0 = entry_desc[0];
tf->fixreg[2] = entry_desc[1];
tf->fixreg[11] = entry_desc[2];
-   tf->srr1 = PSL_SF | PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
+   tf->srr1 = PSL_SF | PSL_USERSET | PSL_FE_DFLT;
#endif
}
 
___
svn-src-all@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"


svn commit: r257115 - in head/sys/powerpc: include powerpc

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Oct 25 14:37:15 2013
New Revision: 257115
URL: http://svnweb.freebsd.org/changeset/base/257115

Log:
  Remove some #ifdef and duplication in the MSR bit definitions. This adds
  some security features to the Book-E kernel as well.

Modified:
  head/sys/powerpc/include/psl.h
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/powerpc/powerpc/genassym.c

Modified: head/sys/powerpc/include/psl.h
==
--- head/sys/powerpc/include/psl.h  Fri Oct 25 13:29:07 2013
(r257114)
+++ head/sys/powerpc/include/psl.h  Fri Oct 25 14:37:15 2013
(r257115)
@@ -35,96 +35,44 @@
 #ifndef_MACHINE_PSL_H_
 #define_MACHINE_PSL_H_
 
-#if defined(BOOKE_E500)
 /*
- * Machine State Register (MSR) - e500 core
- *
- * The PowerPC e500 does not implement the following bits:
- *
- * FP, FE0, FE1 - reserved, always cleared, setting has no effect.
- *
+ * Machine State Register (MSR) - All cores
  */
+#definePSL_VEC 0x0200UL/* AltiVec/SPE vector unit 
available */
+#definePSL_EE  0x8000UL/* external interrupt enable */
+#definePSL_PR  0x4000UL/* privilege mode (1 == user) */
+#definePSL_FP  0x2000UL/* floating point enable */
+#definePSL_ME  0x1000UL/* machine check enable */
+#definePSL_FE0 0x0800UL/* floating point interrupt 
mode 0 */
+#definePSL_BE  0x0200UL/* branch trace enable */
+#definePSL_FE1 0x0100UL/* floating point interrupt 
mode 1 */
+#definePSL_PMM 0x0004UL/* performance monitor mark */
+
+/* Machine State Register - Book-E cores */
 #define PSL_UCLE   0x0400UL/* User mode cache lock enable */
-#define PSL_SPE0x0200UL/* SPE enable */
 #define PSL_WE 0x0004UL/* Wait state enable */
 #define PSL_CE 0x0002UL/* Critical interrupt enable */
-#define PSL_EE 0x8000UL/* External interrupt enable */
-#define PSL_PR 0x4000UL/* User mode */
-#define PSL_FP 0x2000UL/* Floating point available */
-#define PSL_ME 0x1000UL/* Machine check interrupt enable */
-#define PSL_FE00x0800UL/* Floating point exception 
mode 0 */
-#define PSL_UBLE   0x0400UL/* BTB lock enable */
+#define PSL_UBLE   0x0400UL/* BTB lock enable - e500 only */
+#define PSL_DWE0x0400UL/* Debug Wait Enable - 440 
only*/
 #define PSL_DE 0x0200UL/* Debug interrupt enable */
-#define PSL_FE10x0100UL/* Floating point exception 
mode 1 */
 #define PSL_IS 0x0020UL/* Instruction address space */
 #define PSL_DS 0x0010UL/* Data address space */
-#define PSL_PMM0x0004UL/* Performance monitor mark */
-
-#define PSL_FE_DFLT0xUL/* default == none */
-
-/* Initial kernel MSR, use IS=1 ad DS=1. */
-#define PSL_KERNSET_INIT   (PSL_IS | PSL_DS)
-#define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE)
-#define PSL_USERSET(PSL_KERNSET | PSL_PR)
-
-#elif defined(BOOKE_PPC4XX)
-/*
- * Machine State Register (MSR) - PPC4xx core
- */
-#define PSL_WE (0x8000 >> 13) /* Wait State Enable */
-#define PSL_CE (0x8000 >> 14) /* Critical Interrupt Enable */
-#define PSL_EE (0x8000 >> 16) /* External Interrupt Enable */
-#define PSL_PR (0x8000 >> 17) /* Problem State */
-#define PSL_FP (0x8000 >> 18) /* Floating Point Available */
-#define PSL_ME (0x8000 >> 19) /* Machine Check Enable */
-#define PSL_FE0(0x8000 >> 20) /* Floating-point exception 
mode 0 */
-#define PSL_DWE(0x8000 >> 21) /* Debug Wait Enable */
-#define PSL_DE (0x8000 >> 22) /* Debug interrupt Enable */
-#define PSL_FE1(0x8000 >> 23) /* Floating-point exception 
mode 1 */
-#define PSL_IS (0x8000 >> 26) /* Instruction Address Space */
-#define PSL_DS (0x8000 >> 27) /* Data Address Space */
-
-#define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE | PSL_FP)
-#define PSL_USERSET(PSL_KERNSET | PSL_PR)
-
-#define PSL_FE_DFLT0xUL/* default == none */
-
-#else  /* if defined(BOOKE_*) */
-/*
- * Machine State Register (MSR)
- *
- * The PowerPC 601 does not implement the following bits:
- *
- * VEC, POW, ILE, BE, RI, LE[*]
- *
- * [*] Little-endian mode on the 601 is implemented in the HID0 register.
- */
 
+/* Machine State Register (MSR) - AIM cores */
 #ifdef __powerpc64__
 #define PSL_SF 0x8000UL/* 64-bit addressing */
 #define PSL_HV 0x1000UL/* hyper-privileged mode */
 #endif
 
-#definePSL_VEC 0x0200UL/* Alt

Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread Tim Kientzle

On Oct 25, 2013, at 2:34 AM, Dimitry Andric  wrote:

> On 25 Oct 2013, at 11:09, Steven Hartland  wrote:
>> Author: smh
>> Date: Fri Oct 25 09:09:00 2013
>> New Revision: 257109
>> URL: http://svnweb.freebsd.org/changeset/base/257109
>> 
>> Log:
>> Add clang-CC and CC to list of hints allowing clang to identify its operating
>> mode as c++ instead of defaulting to c for the binary names CC and clang-CC.
>> 
>> This fixes builds that use cmake, which automatically sets CXX to
>> /usr/bin/CC by default.
> 
> Huh, I’ve never seen that behavior with cmake?  At least, not with any
> fairly recent version... 
> 
> Anyway, I do not really agree with this change, and I would rather just
> get rid of the /usr/bin/CC link instead.

Even if FreeBSD removes the default symlink, clang should
still default to C++ mode when invoked as CC (possibly
through a symlink created by an individual user).

> Build scripts and Makefiles
> should use "c++" instead, which is the standard name for a C++ compiler.

Ours should, yes.

Tim

___
svn-src-all@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"


svn commit: r257114 - in head/sys: conf dev/fdt

2013-10-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Oct 25 13:29:07 2013
New Revision: 257114
URL: http://svnweb.freebsd.org/changeset/base/257114

Log:
  Use common OFW root code to set up fdtbus. This is an almost purely
  negative diff that should improve reliability somewhat. There should be
  no differences in behavior -- please report any that crop up. This has been
  tested on ARM and PPC systems.
  
  Tested by:ray

Modified:
  head/sys/conf/files
  head/sys/dev/fdt/fdtbus.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Oct 25 13:27:55 2013(r257113)
+++ head/sys/conf/files Fri Oct 25 13:29:07 2013(r257114)
@@ -1916,6 +1916,7 @@ dev/ofw/ofw_bus_subr.coptional fdt
 dev/ofw/ofw_fdt.c  optional fdt
 dev/ofw/ofw_if.m   optional fdt
 dev/ofw/ofw_iicbus.c   optional fdt iicbus
+dev/ofw/ofw_nexus.coptional fdt
 dev/ofw/openfirm.c optional fdt
 dev/ofw/openfirmio.c   optional fdt
 dev/patm/if_patm.c optional patm pci

Modified: head/sys/dev/fdt/fdtbus.c
==
--- head/sys/dev/fdt/fdtbus.c   Fri Oct 25 13:27:55 2013(r257113)
+++ head/sys/dev/fdt/fdtbus.c   Fri Oct 25 13:29:07 2013(r257114)
@@ -42,63 +42,20 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
-#include "fdt_common.h"
 #include "ofw_bus_if.h"
 
-#ifdef DEBUG
-#define debugf(fmt, args...) do { printf("%s(): ", __func__);  \
-printf(fmt,##args); } while (0)
-#else
-#define debugf(fmt, args...)
-#endif
-
-static MALLOC_DEFINE(M_FDTBUS, "fdtbus", "FDTbus devices information");
-
-struct fdtbus_devinfo {
-   phandle_t   di_node;
-   char*di_name;
-   char*di_type;
-   char*di_compat;
-   struct resource_listdi_res;
-
-   /* Interrupts sense-level info for this device */
-   struct fdt_sense_level  di_intr_sl[DI_MAX_INTR_NUM];
-};
-
-struct fdtbus_softc {
-   struct rman sc_irq;
-   struct rman sc_mem;
-};
-
 /*
  * Prototypes.
  */
 static void fdtbus_identify(driver_t *, device_t);
 static int fdtbus_probe(device_t);
-static int fdtbus_attach(device_t);
 
-static int fdtbus_print_child(device_t, device_t);
-static struct resource *fdtbus_alloc_resource(device_t, device_t, int,
-int *, u_long, u_long, u_long, u_int);
-static int fdtbus_release_resource(device_t, device_t, int, int,
-struct resource *);
 static int fdtbus_activate_resource(device_t, device_t, int, int,
 struct resource *);
 static int fdtbus_deactivate_resource(device_t, device_t, int, int,
 struct resource *);
-static int fdtbus_setup_intr(device_t, device_t, struct resource *, int,
-driver_filter_t *, driver_intr_t *, void *, void **);
-
-static const char *fdtbus_ofw_get_name(device_t, device_t);
-static phandle_t fdtbus_ofw_get_node(device_t, device_t);
-static const char *fdtbus_ofw_get_type(device_t, device_t);
-static const char *fdtbus_ofw_get_compat(device_t, device_t);
-
-/*
- * Local routines.
- */
-static void newbus_device_from_fdt_node(device_t, phandle_t);
 
 /*
  * Bus interface definition.
@@ -107,47 +64,26 @@ static device_method_t fdtbus_methods[] 
/* Device interface */
DEVMETHOD(device_identify,  fdtbus_identify),
DEVMETHOD(device_probe, fdtbus_probe),
-   DEVMETHOD(device_attach,fdtbus_attach),
-   DEVMETHOD(device_detach,bus_generic_detach),
-   DEVMETHOD(device_shutdown,  bus_generic_shutdown),
-   DEVMETHOD(device_suspend,   bus_generic_suspend),
-   DEVMETHOD(device_resume,bus_generic_resume),
 
/* Bus interface */
-   DEVMETHOD(bus_print_child,  fdtbus_print_child),
-   DEVMETHOD(bus_alloc_resource,   fdtbus_alloc_resource),
-   DEVMETHOD(bus_release_resource, fdtbus_release_resource),
DEVMETHOD(bus_activate_resource, fdtbus_activate_resource),
DEVMETHOD(bus_deactivate_resource, fdtbus_deactivate_resource),
DEVMETHOD(bus_config_intr,  bus_generic_config_intr),
-   DEVMETHOD(bus_setup_intr,   fdtbus_setup_intr),
+   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
 
-   /* OFW bus interface */
-   DEVMETHOD(ofw_bus_get_node, fdtbus_ofw_get_node),
-   DEVMETHOD(ofw_bus_get_name, fdtbus_ofw_get_name),
-   DEVMETHOD(ofw_bus_get_type, fdtbus_ofw_get_type),
-   DEVMETHOD(ofw_bus_get_compat,   fdtbus_ofw_get_compat),
-
-   { 0, 0 }
-};
-
-static driver_t fdtbus_driver = {
-   "fdtbus",
-   fdtbus_methods,
-   sizeof(struct fdtbus_softc)
+   DEVMETHOD_END
 };
 
 devclass_t fdtbus_devclass;
-
+DEFINE_CLASS_1(fdtbus, fdtbus_driver, fdtbus_methods,
+sizeof(struct ofw_nexus_sof

svn commit: r257113 - stable/10/include

2013-10-25 Thread Tijl Coosemans
Author: tijl
Date: Fri Oct 25 13:27:55 2013
New Revision: 257113
URL: http://svnweb.freebsd.org/changeset/base/257113

Log:
  MFC r256925:
  
  Add a dummy statement to the beginning of the pthread_cleanup_pop() macro
  to allow a call of the macro to be labelled as in:
  
  label:
pthread_cleanup_pop();
  
  Reviewed by:  imp
  Approved by:  re (glebius)

Modified:
  stable/10/include/pthread.h
Directory Properties:
  stable/10/include/   (props changed)

Modified: stable/10/include/pthread.h
==
--- stable/10/include/pthread.h Fri Oct 25 13:25:49 2013(r257112)
+++ stable/10/include/pthread.h Fri Oct 25 13:27:55 2013(r257113)
@@ -175,6 +175,7 @@ int pthread_barrierattr_setpshared(pthr
{
 
 #definepthread_cleanup_pop(execute)
\
+   (void)0;
\
}   
\
__pthread_cleanup_pop_imp(execute); 
\
}
___
svn-src-all@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"


svn commit: r257112 - stable/9/include

2013-10-25 Thread Tijl Coosemans
Author: tijl
Date: Fri Oct 25 13:25:49 2013
New Revision: 257112
URL: http://svnweb.freebsd.org/changeset/base/257112

Log:
  MFC r256925:
  
  Add a dummy statement to the beginning of the pthread_cleanup_pop() macro
  to allow a call of the macro to be labelled as in:
  
  label:
pthread_cleanup_pop();
  
  Reviewed by:  imp

Modified:
  stable/9/include/pthread.h
Directory Properties:
  stable/9/include/   (props changed)

Modified: stable/9/include/pthread.h
==
--- stable/9/include/pthread.h  Fri Oct 25 11:44:39 2013(r257111)
+++ stable/9/include/pthread.h  Fri Oct 25 13:25:49 2013(r257112)
@@ -175,6 +175,7 @@ int pthread_barrierattr_setpshared(pthr
{
 
 #definepthread_cleanup_pop(execute)
\
+   (void)0;
\
}   
\
__pthread_cleanup_pop_imp(execute); 
\
}
___
svn-src-all@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"


svn commit: r257111 - head/sys/dev/uart

2013-10-25 Thread Aleksandr Rybalko
Author: ray
Date: Fri Oct 25 11:44:39 2013
New Revision: 257111
URL: http://svnweb.freebsd.org/changeset/base/257111

Log:
  Test UARTs physical address instead of virtual.

Modified:
  head/sys/dev/uart/uart_cpu_fdt.c

Modified: head/sys/dev/uart/uart_cpu_fdt.c
==
--- head/sys/dev/uart/uart_cpu_fdt.cFri Oct 25 10:20:19 2013
(r257110)
+++ head/sys/dev/uart/uart_cpu_fdt.cFri Oct 25 11:44:39 2013
(r257111)
@@ -86,7 +86,13 @@ int
 uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
 {
 
-   return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0);
+   if (b1->bst != b2->bst)
+   return (0);
+   if (pmap_kextract(b1->bsh) == 0)
+   return (0);
+   if (pmap_kextract(b2->bsh) == 0)
+   return (0);
+   return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0);
 }
 
 int
___
svn-src-all@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"


Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread Steven Hartland
- Original Message - 
From: "David Chisnall" 



On 25 Oct 2013, at 06:03, "Steven Hartland"  wrote:


> As discussed on IRC while I agree removing CC is possibly the better
> fix moving forward, I think removing /usr/bin/CC has quite a bit more
> risk, especially at this stage in the release phase of 10.

I'm not sure what the risk is.  CC is an IRIXism that was never part of any
standard. Linux distros don't seem to provide a CC, just a c++, so this is
unlikely to cause problems with ported code.  


We've discussed removing CC for a while, and I think it's the right call.


We shouldn't forget that removing the creation of the link is not enough
to "remove" CC, it would also need to be added to the delete-old target
and also needs the user to run delete-old, which is a step not everyone
does ;-)

Given this even if we do remove CC I think its still prudent to keep the
fix for CC in clang as well.

   Regards
   Steve


This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
svn-src-all@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"


Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread David Chisnall
On 25 Oct 2013, at 06:03, "Steven Hartland"  wrote:

> As discussed on IRC while I agree removing CC is possibly the better
> fix moving forward, I think removing /usr/bin/CC has quite a bit more
> risk, especially at this stage in the release phase of 10.

I'm not sure what the risk is.  CC is an IRIXism that was never part of any 
standard.  Linux distros don't seem to provide a CC, just a c++, so this is 
unlikely to cause problems with ported code.  

We've discussed removing CC for a while, and I think it's the right call.

David

___
svn-src-all@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"


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

2013-10-25 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Oct 25 10:20:19 2013
New Revision: 257110
URL: http://svnweb.freebsd.org/changeset/base/257110

Log:
  MFC r256750:
  Improve XHCI stability. When a command timeout happens, the command
  should be aborted else the command queue can stop. Refer to section
  "4.6.1.2" of the XHCI specification.
  
  Approved by:  re (glebius)

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

Modified: stable/10/sys/dev/usb/controller/xhci.c
==
--- stable/10/sys/dev/usb/controller/xhci.c Fri Oct 25 09:09:00 2013
(r257109)
+++ stable/10/sys/dev/usb/controller/xhci.c Fri Oct 25 10:20:19 2013
(r257110)
@@ -1144,6 +1144,25 @@ xhci_do_command(struct xhci_softc *sc, s
}
if (err != 0) {
DPRINTFN(0, "Command timeout!\n");
+
+   /*
+* Try to abort the last command as per section
+* 4.6.1.2 "Aborting a Command" of the XHCI
+* specification:
+*/
+   temp = XREAD4(sc, oper, XHCI_CRCR_LO);
+   XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA);
+
+   /* wait for abort event, if any */
+   err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 
16);
+
+   if (err != 0 && xhci_interrupt_poll(sc) != 0) {
+   DPRINTF("Command was completed when polling\n");
+   err = 0;
+   }
+   if (err != 0) {
+   DPRINTF("Command abort timeout!\n");
+   }
err = USB_ERR_TIMEOUT;
trb->dwTrb2 = 0;
trb->dwTrb3 = 0;
___
svn-src-all@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"


Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread Steven Hartland

On 25 Oct 2013, at 11:09, Steven Hartland  wrote:
> Author: smh
> Date: Fri Oct 25 09:09:00 2013
> New Revision: 257109
> URL: http://svnweb.freebsd.org/changeset/base/257109
>
> Log:
>  Add clang-CC and CC to list of hints allowing clang to identify its operating
>  mode as c++ instead of defaulting to c for the binary names CC and clang-CC.
>
>  This fixes builds that use cmake, which automatically sets CXX to
>  /usr/bin/CC by default.

Huh, I’ve never seen that behavior with cmake?  At least, not with any
fairly recent version...

Anyway, I do not really agree with this change, and I would rather just
get rid of the /usr/bin/CC link instead.  Build scripts and Makefiles
should use "c++" instead, which is the standard name for a C++ compiler.

Note that you also introduce yet another change from upstream... :-/


As discussed on IRC while I agree removing CC is possibly the better
fix moving forward, I think removing /usr/bin/CC has quite a bit more
risk, especially at this stage in the release phase of 10.

Given this I would suggest this for now we make the change to clang and
then possibly look at remove CC at a later date.

If there's no objections I intend to ask re@ for permission to MFC this
for the release of 10, so if there are any objections please do speak up :)

   Regards
   Steve 




This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
svn-src-all@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"


Re: svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread Dimitry Andric
On 25 Oct 2013, at 11:09, Steven Hartland  wrote:
> Author: smh
> Date: Fri Oct 25 09:09:00 2013
> New Revision: 257109
> URL: http://svnweb.freebsd.org/changeset/base/257109
> 
> Log:
>  Add clang-CC and CC to list of hints allowing clang to identify its operating
>  mode as c++ instead of defaulting to c for the binary names CC and clang-CC.
> 
>  This fixes builds that use cmake, which automatically sets CXX to
>  /usr/bin/CC by default.

Huh, I’ve never seen that behavior with cmake?  At least, not with any
fairly recent version... 

Anyway, I do not really agree with this change, and I would rather just
get rid of the /usr/bin/CC link instead.  Build scripts and Makefiles
should use "c++" instead, which is the standard name for a C++ compiler.

Note that you also introduce yet another change from upstream... :-/

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r257109 - head/contrib/llvm/tools/clang/tools/driver

2013-10-25 Thread Steven Hartland
Author: smh
Date: Fri Oct 25 09:09:00 2013
New Revision: 257109
URL: http://svnweb.freebsd.org/changeset/base/257109

Log:
  Add clang-CC and CC to list of hints allowing clang to identify its operating
  mode as c++ instead of defaulting to c for the binary names CC and clang-CC.
  
  This fixes builds that use cmake, which automatically sets CXX to
  /usr/bin/CC by default.
  
  PR:   bin/182442
  Reviewed by:  dwhite, wca
  MFC after:2 days

Modified:
  head/contrib/llvm/tools/clang/tools/driver/driver.cpp

Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp
==
--- head/contrib/llvm/tools/clang/tools/driver/driver.cpp   Fri Oct 25 
08:41:36 2013(r257108)
+++ head/contrib/llvm/tools/clang/tools/driver/driver.cpp   Fri Oct 25 
09:09:00 2013(r257109)
@@ -284,11 +284,13 @@ static void ParseProgName(SmallVectorImp
   } suffixes [] = {
 { "clang", false, false },
 { "clang++", true, false },
+{ "clang-CC", true, false },
 { "clang-c++", true, false },
 { "clang-cc", false, false },
 { "clang-cpp", false, true },
 { "clang-g++", true, false },
 { "clang-gcc", false, false },
+{ "CC", true, false },
 { "cc", false, false },
 { "cpp", false, true },
 { "++", true, false },
___
svn-src-all@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"


Re: svn commit: r248653 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-10-25 Thread Andriy Gapon
on 23/03/2013 18:34 Will Andrews said the following:
> Author: will
> Date: Sat Mar 23 16:34:56 2013
> New Revision: 248653
> URL: http://svnweb.freebsd.org/changeset/base/248653
> 
> Log:
>   ZFS: Fix a panic while unmounting a busy filesystem.
>   
>   This particular scenario was easily reproduced using a NFS export.  When the
>   first 'zfs unmount' occurred, it returned EBUSY via this path, while
>   vflush() had flushed references on the filesystem's root vnode, which in
>   turn caused its v_interlock to be destroyed.  The next time 'zfs unmount'
>   was called, vflush() tried to obtain this lock, which caused this panic.
>   
>   Since vflush() on FreeBSD is a definitive call, there is no need to check
>   vfsp->vfs_count after it completes.  Simply #ifdef sun this check.
>   
>   Submitted by:   avg
>   Reviewed by:avg
>   Approved by:ken (mentor)
>   MFC after:  1 month

MFC timer expired half a year ago.  Could you please MFC this change?
I believe that we've just run into the same or similar panic on stable/9 (no NFS
was involved though):

#2  0x808f9d07 in panic (fmt=0x1 ) at
/usr/src/sys/kern/kern_shutdown.c:637
#3  0x80cecac0 in trap_fatal (frame=0xc, eva=) at
/usr/src/sys/amd64/amd64/trap.c:879
#4  0x80cece21 in trap_pfault (frame=0xff911d7e85b0, usermode=0) at
/usr/src/sys/amd64/amd64/trap.c:795
#5  0x80ced3d4 in trap (frame=0xff911d7e85b0) at
/usr/src/sys/amd64/amd64/trap.c:463
#6  0x80cd61e3 in calltrap () at 
/usr/src/sys/amd64/amd64/exception.S:232
#7  0x808e5d1d in _mtx_lock_sleep (m=0xfe01ec9a50c8,
tid=18446741917998455072, opts=, file=, line=0) at /usr/src/sys/kern/kern_mutex.c:394
#8  0x8099f38d in vflush (mp=, rootrefs=1,
flags=, td=0xfe0a159b1920) at
/usr/src/sys/kern/vfs_subr.c:2705
#9  0x817ed852 in zfs_umount (vfsp=0xfe02aa9ad9a8, fflag=) at
/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c:1982

(kgdb) p *rootvp
$1 = {v_type = VBAD, v_tag = 0x80f7fd7c "none", v_op =
0x812eb6a0, v_data = 0x0, v_mount = 0x0, v_nmntvnodes = {tqe_next =
0xfe0fc06a3800, tqe_prev = 0xfe02aa9ada08}, v_un = {vu_mount = 0x0,
vu_socket = 0x0, vu_cdev = 0x0, vu_fifoinfo = 0x0}, v_hashlist = {le_next =
0x0, le_prev = 0x0}, v_hash = 214452, v_cache_src = {lh_first = 0x0},
v_cache_dst = {tqh_first = 0x0, tqh_last = 0xfe01ec9a5060},
  v_cache_dd = 0x0, v_cstart = 0, v_lasta = 0, v_lastw = 0, v_clen = 0, v_lock =
{lock_object = {lo_name = 0x8185f1ac "zfs", lo_flags = 108658688,
lo_data = 0, lo_witness = 0x0}, lk_lock = 1, lk_exslpfail = 0,
lk_timo = 51, lk_pri = 96}, v_interlock = {lock_object = {lo_name =
0x80f9ae39 "vnode interlock", lo_flags = 16908288, lo_data = 0,
lo_witness = 0x0}, mtx_lock = 6}, v_vnlock = 0xfe01ec9a5098, v_holdcnt = 0,
  v_usecount = 0, v_iflag = 128, v_vflag = 1, v_writecount = 0, v_actfreelist =
{tqe_next = 0x0, tqe_prev = 0xfe02aa9ada20}, v_bufobj = {bo_mtx =
{lock_object = {lo_name = 0x80f9ae49 "bufobj interlock",
lo_flags = 16908288, lo_data = 0, lo_witness = 0x0}, mtx_lock = 6},
bo_clean = {bv_hd = {tqh_first = 0x0, tqh_last = 0xfe01ec9a5140}, bv_root =
0x0, bv_cnt = 0}, bo_dirty = {bv_hd = {tqh_first = 0x0,
tqh_last = 0xfe01ec9a5160}, bv_root = 0x0, bv_cnt = 0}, bo_numoutput
= 0, bo_flag = 0, bo_ops = 0x81316f20, bo_bsize = 131072, bo_object =
0x0, bo_synclist = {le_next = 0x0, le_prev = 0x0},
bo_private = 0xfe01ec9a5000, __bo_vnode = 0xfe01ec9a5000},
v_pollinfo = 0x0, v_label = 0x0, v_lockf = 0x0, v_rl = {rl_waiters = {tqh_first
= 0x0, tqh_last = 0xfe01ec9a51e0}, rl_currdep = 0x0},
  v_fullpath = '\0' }

> 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.c  Sat Mar 
> 23 16:06:20 2013(r248652)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c  Sat Mar 
> 23 16:34:56 2013(r248653)
> @@ -1968,6 +1968,7 @@ zfs_umount(vfs_t *vfsp, int fflag)
>   return (ret);
>   }
>  
> +#ifdef sun
>   if (!(fflag & MS_FORCE)) {
>   /*
>* Check the number of active vnodes in the file system.
> @@ -1988,6 +1989,7 @@ zfs_umount(vfs_t *vfsp, int fflag)
>   return (EBUSY);
>   }
>   }
> +#endif
>  
>   VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0);
>   os = zfsvfs->z_os;
> 


-- 
Andriy Gapon
___
svn-src-all@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"